添加页面补招功能

This commit is contained in:
GGJ
2025-04-30 16:00:26 +08:00
parent dabb960d09
commit 81726cde2d
15 changed files with 7778 additions and 576 deletions

View File

@@ -103,6 +103,9 @@
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button type="primary" icon="el-icon-Download" @click="makeUp">补招</el-button>
</template>
</TableHeader>
</div>
<div class="online_main">
@@ -110,7 +113,8 @@
<el-tab-pane :name="0" :lazy="true" label="数据完整性列表">
<Table
ref="tableRef"
:tree-config="{ transform: true, parentField: 'pid' }"
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
:checkbox-config="{ labelField: 'name', }"
:scroll-y="{ enabled: true }"
v-if="activeName == 0"
/>
@@ -183,7 +187,6 @@ const handleClick = (tab: any, e: any) => {
// }
}
// const datePickerRef = ref()
const tableHeaderRef = ref()
const tableStore = new TableStore({
publicHeight: 60,
@@ -195,8 +198,13 @@ const tableStore = new TableStore({
title: formData.value.statisticalType.name,
field: 'name',
align: 'left',
type: 'checkbox',
treeNode: true,
width: 350,
formatter: function (row) {
console.log("🚀 ~ row:", row)
return 123//row.cellValue ? row.cellValue : '/'
}
},
{
title: '网络参数',
@@ -291,9 +299,8 @@ const tableStore = new TableStore({
// tableStore.table.params.searchEndTime = tableHeaderRef.value.datePickerRef.timeValue[1]
},
loadCallback: () => {
let treeData = []
treeData = tree2List(tableStore.table.data)
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.column[0].title = formData.value.statisticalType.name
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
@@ -301,22 +308,20 @@ const tableStore = new TableStore({
}, 0)
}
})
const handleSearch = () => {
formData.value.searchBeginTime = datePickerRef.value.timeValue[0]
formData.value.searchEndTime = datePickerRef.value.timeValue[1]
}
tableStore.table.params.deptIndex = ''
tableStore.table.params.statisticalType = []
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
provide('tableStore', tableStore)
const tree2List = (list: any, pid?: string) => {
const tree2List = (list: any, id?: string) => {
//存储结果的数组
let arr: any = []
// 遍历 tree 数组
list.forEach((item: any) => {
// item.comFlag = item.comFlag == null ? 3 : item.comFlag
item.uPid = id
item.uId = Math.random() * 1000
item.valueOver =
item.integrityData == 3.14159
? 0
@@ -325,11 +330,10 @@ const tree2List = (list: any, pid?: string) => {
: item.integrityData >= 60 && item.integrityData < 90
? 2
: 3
item.pid = pid
// 判断item是否存在children
if (!item.children) return arr.push(item)
// 函数递归对children数组进行tree2List的转换
const children = tree2List(item.children, item.id)
const children = tree2List(item.children, item.uId)
// 删除item的children属性
delete item.children
// 把item和children数组添加至结果数组
@@ -340,7 +344,11 @@ const tree2List = (list: any, pid?: string) => {
return arr
}
onMounted(() => {})
// 补招
const makeUp = () => {
tableRef.value && tableRef.value.getRef().getCheckboxRecords()
console.log("🚀 ~ makeUp ~ tableRef.value.getRef().getCheckboxRecords():", tableRef.value.getRef().getCheckboxRecords())
}
watch(
() => treeData.value,
(val, oldVal) => {