vue-element-plus-admin 2.0

const schema = reactive<FormSchema[]>([
  {
    field: 'idCard',
    label: '证件号:',
    component: 'Input',
    colProps: {
      span: 6
    }
  },
  {
    field: 'name',
    label: '用户名:',
    component: 'Input',
    colProps: {
      span: 6
    }
  },
  {
    field: 'executeNo',
    label: '执法编号:',
    component: 'Input',
    colProps: {
      span: 6
    }
  },
  {
    field: 'auditTypeId',
    label: '分类:',
    component: 'Select',
    colProps: {
      span: 6
    },
    componentProps: {
      options: Fl,//注意不带.value
      on: {
        change: (value: string) => {
          console.log(value)
        }
      }
    }
  },
  {
    field: 'beginDate',
    component: 'DatePicker',
    label: '选择时间:',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间'
    }
  }
])
// 搜索
const handleSearch = (data) => {
  currentPage.value = 1
  searchFormParams = reactive({
    idCard: data.idCard || '',
    name: data.name || '',
    executeNo: data.executeNo || '',
    auditTypeId: data.auditTypeId || '',
    beginDate: data.beginDate ? data.beginDate[0] : '',
    endDate: data.beginDate ? data.beginDate[1] : '',
    page: currentPage.value,
    pageSize: pageSize.value
  })
  getResultData()
}
let searchFormParams = reactive({
  idCard: '',
  name: '',
  executeNo: '',
  auditTypeId: '',
  beginDate: '',
  endDate: '',
  page: currentPage.value,
  pageSize: pageSize.value
})
const getResultData = () => {
  apply.getList(searchFormParams).then((res: any) => {
    total.value = res.dataCount
    resultData.value = res.data
  })
  // resultData.value = infoData.slice((page - 1) * pageSize.value, page * pageSize.value)
}
//搜索条件所需枚举
const Fl = ref([])
const getFl = () => {
  apply.getAuditApi().then((res: any) => {
    Fl.value = res.map((item: any) => {
      return {
        label: item.name,
        value: item.id
      }
    })
  })
}
//分页
const currentPage = ref(1)
const pageSize = ref(8)
const small = ref(false)
const background = ref(false)
const dialogVisible = ref(false)
const total = ref(0)
const resultData: any = ref([])
const handleCurrentChange = (val: number) => {
  currentPage.value = val
  searchFormParams.page = val
  getResultData()
}
<!--  -->
<template>
  <ContentWrap title="申请列表">
    <Search
      :schema="schema"
      is-col
      @register="searchRegister"
      @search="handleSearch"
      @reset="handleSearch"
    />
</template>

  • 8
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值