<!-- 业务看板 --> <script lang="ts" setup name="BoardList"> import { reactive, ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { getListPage } from '@/api/eqpt/measurementPlan/task' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ deptId: '', offset: 1, limit: 20, }) const columns = ref([ { text: '部门', value: 'orderNo', align: 'center', }, { text: '设备总数', value: 'customerName', align: 'center', }, { text: '本月到期设备', value: '', align: 'center', }, { text: '已超期设备', value: 'createUserName', align: 'center', }, { text: '在检设备', value: 'createTime', align: 'center', }, { text: '年度应检数量', value: 'deliverer', align: 'center', }, { text: '年度已检数量', value: 'receiveStatusName', align: 'center', }, { text: '计量计划完成率', value: 'receiveStatusName', align: 'center', }, ]) const list = ref([]) const total = ref(0) const listLoading = ref(true) // 获取数据 const fetchData = (isNowPage = true) => { listLoading.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.offset = 1 } // getListPage(listQuery).then((response) => { // list.value = response.data.rows // total.value = parseInt(response.data.total) // listLoading.value = false // }) listLoading.value = false } fetchData() // 查询数据 const search = () => { fetchData(false) } // 重置 const reset = () => { listQuery.deptId = '' listQuery.offset = 1 listQuery.limit = 20 search() } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size: number; page: number }) => { if (val && val.size) { listQuery.limit = val.size } if (val && val.page) { listQuery.offset = val.page } fetchData() } </script> <template> <app-container> <!-- 筛选条件 --> <search-area :need-clear="true" @search="search" @clear="reset"> <search-item> <el-input v-model.trim="listQuery.deptId" placeholder="部门" clearable /> </search-item> </search-area> <table-container> <template #btns-right> <icon-button icon="icon-export" title="导出" /> </template> <!-- 普通表格 --> <normal-table :data="list" :total="total" :columns="columns" :query="listQuery" :list-loading="listLoading" :is-showmulti-select="true" @change="changePage" /> </table-container> </app-container> </template>