修改现场反馈问题
This commit is contained in:
@@ -2,69 +2,31 @@
|
||||
<TableHeader area datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classificationData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.statisticalType" value-key="id" placeholder="请选择统计类型">
|
||||
<el-option v-for="item in classificationData" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择电压等级"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.scale" multiple collapse-tags clearable value-key="id"
|
||||
placeholder="请选择电压等级">
|
||||
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择终端厂家"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in terminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.manufacturer" multiple collapse-tags clearable
|
||||
value-key="id" placeholder="请选择终端厂家">
|
||||
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择干扰源类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in interfereoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.loadType" multiple collapse-tags clearable value-key="id"
|
||||
placeholder="请选择干扰源类型">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -73,16 +35,11 @@
|
||||
<el-button icon="el-icon-Download" @click="exportEvent" type="primary">下载报告</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:radio-config="{
|
||||
labelField: 'name',
|
||||
highlight: true,
|
||||
visibleMethod: row => row.row.level == 6
|
||||
}"
|
||||
:tree-config="{ transform: true, parentField: 'pid' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
/>
|
||||
<Table ref="tableRef" :radio-config="{
|
||||
labelField: 'name',
|
||||
highlight: true,
|
||||
visibleMethod: row => row.row.level == 6
|
||||
}" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }" :scroll-y="{ enabled: true }" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
@@ -182,15 +139,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
loadCallback: () => {
|
||||
let treeData = []
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
if (item.children.length > 0) {
|
||||
item.children.forEach((k: any) => {
|
||||
k.pid = item.id
|
||||
})
|
||||
}
|
||||
})
|
||||
// tableStore.table.data.forEach((item: any) => {
|
||||
// if (item.children.length > 0) {
|
||||
// item.children.forEach((k: any) => {
|
||||
// k.pid = item.id
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
|
||||
treeData = tree2List(tableStore.table.data)
|
||||
treeData = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -205,19 +162,19 @@ tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, pid?: string) => {
|
||||
const tree2List = (list: any, id: any) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = (Math.random() * 1000)
|
||||
item.comFlag = item.comFlag == null ? 3 : item.comFlag
|
||||
|
||||
item.assess = item.integrityData == 3.14159 ? 0 : item.integrityData < 60 ? 1 : 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数组添加至结果数组
|
||||
|
||||
@@ -2,74 +2,36 @@
|
||||
<TableHeader area datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classificationData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.statisticalType" value-key="id" placeholder="请选择统计类型">
|
||||
<el-option v-for="item in classificationData" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择电压等级"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.scale" multiple collapse-tags clearable value-key="id"
|
||||
placeholder="请选择电压等级">
|
||||
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择终端厂家"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in terminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.manufacturer" multiple collapse-tags clearable
|
||||
value-key="id" placeholder="请选择终端厂家">
|
||||
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择干扰源类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in interfereoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-select v-model="tableStore.table.params.loadType" multiple collapse-tags clearable value-key="id"
|
||||
placeholder="请选择干扰源类型">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'pid' }" :scroll-y="{ enabled: true }" />
|
||||
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid',rowField:'uId' }" :scroll-y="{ enabled: true }" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
@@ -169,14 +131,24 @@ const tableStore = new TableStore({
|
||||
},
|
||||
loadCallback: () => {
|
||||
let treeData = []
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
if (item.children.length > 0) {
|
||||
item.children.forEach((k: any) => {
|
||||
k.pid = item.id
|
||||
})
|
||||
}
|
||||
})
|
||||
treeData = tree2List(tableStore.table.data)
|
||||
// tableStore.table.data.forEach((item: any, index: number) => {
|
||||
// item.id = Math.floor(Math.random() * 1000)
|
||||
// item.pid = index
|
||||
// if (item.children.length > 0) {
|
||||
// item.children.forEach((k: any) => {
|
||||
// k.id = Math.floor(Math.random() * 1000)
|
||||
// k.pid = item.id
|
||||
// // if (k.children.length > 0) {
|
||||
// // k.children.forEach((v: any) => {
|
||||
// // v.id = Math.floor(Math.random() * 1000)
|
||||
// // v.pid = k.id
|
||||
// // })
|
||||
// // }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
treeData = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
|
||||
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -191,17 +163,20 @@ tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any) => {
|
||||
|
||||
const tree2List = (list: any, id: any) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = (Math.random() * 1000)
|
||||
item.comFlag = item.comFlag == null ? 3 : item.comFlag
|
||||
item.assess = item.onlineRate == 3.14159 ? 0 : item.onlineRate < 60 ? 1 : item.onlineRate < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children)
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
|
||||
Reference in New Issue
Block a user