添加页面补招功能

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

@@ -1,7 +1,7 @@
<template>
<div class="default-main online">
<div class="online_header">
<TableHeader date-picker ref="tableHeaderRef" >
<TableHeader date-picker ref="tableHeaderRef">
<template #select>
<el-form-item label="统计类型:">
<el-select
@@ -110,7 +110,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"
/>
@@ -193,7 +193,7 @@ const tableStore = new TableStore({
field: 'name',
align: 'left',
treeNode: true,
width: 350,
width: 350
},
{
title: '网络参数',
@@ -255,7 +255,7 @@ const tableStore = new TableStore({
title: '评估',
field: 'valueOver',
align: 'center',
effect:"dark",
effect: 'dark',
render: 'tag',
custom: {
null: 'info',
@@ -289,9 +289,10 @@ 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))
// 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)
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
@@ -305,18 +306,18 @@ 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 == 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数组添加至结果数组
@@ -325,6 +326,7 @@ const tree2List = (list: any, pid?: string) => {
})
// 返回结果数组
return arr
}
onMounted(() => {})
@@ -342,6 +344,4 @@ watch(
}
)
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>