flaT: 暂存

This commit is contained in:
Apcallover
2024-03-31 21:52:33 +08:00
parent 1a6b5cb8c8
commit 3e4782ef7d

View File

@@ -16,9 +16,14 @@
</template>
<script>
import {reviewCount} from '@/api/report/report'
import {potentialCount} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date";
const columnEnum = {
'totalCount': '总数',
'otherCount': '机构登记数',
'registerCount': '总库(其他)',
}
const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = {
dateBtn: false,
@@ -44,6 +49,7 @@ export default {
infoData: [],
visible: false,
search: {},
headColum: [],
}
},
created() {
@@ -51,36 +57,30 @@ export default {
},
computed: {
options() {
const tableHead = this.headColum.map((item, index) => ({
label: item.columnName,
display:false,
children: Object.keys(columnEnum).map((key) => ({
label: columnEnum[key],
prop: `${index}_${key}`,
display:false,
width: 120,
}))
}))
return {
...baseOptions,
height: 200,
width:200,
column: [{
label: '机构名称',
prop: 'name',
search: true,
},{
label: '多级表头',
display:false,
children: [
fixed: true,
width: 200,
},
...tableHead,
{
label: '年龄',
prop: 'age',
display:false
}, {
label: '手机号',
prop: 'phone',
display:false
}
]
},{
label: '认证企业数',
prop: 'companyCount',
},{
label: '审核任务数',
prop: 'missionCount',
},{
label: '审核岗位数',
prop: 'roleCount'
},{
label: '日期',
prop: 'date',
hide: true,
@@ -124,17 +124,32 @@ export default {
params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date
}
console.log(123123, params)
let resData = await reviewCount(params)
let resData = await potentialCount(params)
if(resData.data.code === 200) {
const { records, current, total, size } = resData.data.data
this.infoData = records
const { list, columnInfo } = resData.data.data
const { current, size ,total, records } = list
this.infoData = records.map((item) => ({
...item,
...this.decompose(item.list)
}))
console.log('infoData',this.infoData)
this.headColum = columnInfo
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
this.$api.sleep(1000).then(() => {this.visible = false; resolve(true)})
} else {
reject()
}
})
},
decompose(list) {
let obj = {}
for (let i = 0; i < list.length; i++) {
const item = list[i]
Object.keys(item).forEach((vitem) => {
obj[`${i}_${vitem}`] = item[vitem]
})
}
return obj
}
}
}