添加页面补招功能

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

@@ -81,7 +81,7 @@
<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' }"
:scroll-y="{ enabled: true }"
v-if="activeName == 0"
/>
@@ -197,10 +197,9 @@ const tableStore = new TableStore({
],
loadCallback: () => {
let treeData = []
treeData = tree2List(tableStore.table.data)
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
@@ -214,18 +213,18 @@ tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
tableStore.table.params.serverName = 'harmonicBoot'
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 == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 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数组添加至结果数组
@@ -235,6 +234,7 @@ const tree2List = (list: any, pid?: string) => {
// 返回结果数组
return arr
}
onMounted(() => {
tableStore.index()
})