修改测试bug
This commit is contained in:
@@ -1,103 +1,114 @@
|
||||
<template>
|
||||
|
||||
<el-dialog draggable v-model="dialogVisible" :title="title" width="70%">
|
||||
<div style="height: 55vh">
|
||||
<vxe-table height="auto" auto-resize :data="tableData" v-loading="loading" v-bind="defaultAttribute"
|
||||
:key="key">
|
||||
<vxe-table
|
||||
height="auto"
|
||||
auto-resize
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
v-bind="defaultAttribute"
|
||||
:key="key"
|
||||
>
|
||||
<vxe-column field="name" title="名称"></vxe-column>
|
||||
<vxe-column field="powerCompany" title="供电公司" v-if="voltageLevelFlag"></vxe-column>
|
||||
<vxe-column field="substation" title="变电站" v-if="voltageLevelFlag"></vxe-column>
|
||||
<vxe-column field="busBar" title="母线" v-if="voltageLevelFlag"></vxe-column>
|
||||
|
||||
<vxe-column field="name" title="名称"></vxe-column>
|
||||
<vxe-column field="powerCompany" title="供电公司" v-if="voltageLevelFlag"></vxe-column>
|
||||
<vxe-column field="substation" title="变电站" v-if="voltageLevelFlag"></vxe-column>
|
||||
<vxe-column field="busBar" title="母线" v-if="voltageLevelFlag"></vxe-column>
|
||||
|
||||
<vxe-column field="voltageLevel" title="电压等级"
|
||||
v-if="statisticalName == '谐波电压' && !voltageLevelFlag"></vxe-column>
|
||||
<vxe-column field="data" :title="statisticalName">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
|
||||
<span v-else type="primary" size="small">
|
||||
{{ parseFloat(scope.row.data.toFixed(2)) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="zd" title="评估">
|
||||
<template #default="scope">
|
||||
<span v-if="
|
||||
0 <= scope.row.data &&
|
||||
scope.row.data < 1 &&
|
||||
scope.row.data !== 3.14159
|
||||
" style=" font-weight: bold;color: #339966;">
|
||||
无污染
|
||||
</span>
|
||||
<span v-if="
|
||||
1 <= scope.row.data &&
|
||||
scope.row.data < 1.2 &&
|
||||
scope.row.data !== 3.14159
|
||||
" style=" font-weight: bold;color: #3399ff;">
|
||||
轻微污染
|
||||
</span>
|
||||
<span v-if="
|
||||
1.2 <= scope.row.data &&
|
||||
scope.row.data < 1.6 &&
|
||||
scope.row.data !== 3.14159
|
||||
" style=" font-weight: bold;color: #ffcc33;">
|
||||
轻度污染
|
||||
</span>
|
||||
<span v-if="
|
||||
1.6 <= scope.row.data &&
|
||||
scope.row.data < 2 &&
|
||||
scope.row.data !== 3.14159
|
||||
" style=" font-weight: bold;color: #ff9900;">
|
||||
中度污染
|
||||
</span>
|
||||
<span v-if="
|
||||
2 <= scope.row.data && scope.row.data && scope.row.data !== 3.14159
|
||||
" style=" font-weight: bold;color: #cc0000;">
|
||||
重度污染
|
||||
</span>
|
||||
<span v-if="scope.row.data == 3.14159" style="color: #000;">
|
||||
暂无评估
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<vxe-column
|
||||
field="voltageLevel"
|
||||
title="电压等级"
|
||||
v-if="statisticalName == '谐波电压' && !voltageLevelFlag"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scaleList.filter(item => item.id == scope.row.voltageLevel)[0].name }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="data" :title="statisticalName">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
|
||||
<span v-else type="primary" size="small">
|
||||
{{ parseFloat(scope.row.data.toFixed(2)) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="zd" title="评估">
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="0 <= scope.row.data && scope.row.data < 1 && scope.row.data !== 3.14159"
|
||||
style="font-weight: bold; color: #339966"
|
||||
>
|
||||
无污染
|
||||
</span>
|
||||
<span
|
||||
v-if="1 <= scope.row.data && scope.row.data < 1.2 && scope.row.data !== 3.14159"
|
||||
style="font-weight: bold; color: #3399ff"
|
||||
>
|
||||
轻微污染
|
||||
</span>
|
||||
<span
|
||||
v-if="1.2 <= scope.row.data && scope.row.data < 1.6 && scope.row.data !== 3.14159"
|
||||
style="font-weight: bold; color: #ffcc33"
|
||||
>
|
||||
轻度污染
|
||||
</span>
|
||||
<span
|
||||
v-if="1.6 <= scope.row.data && scope.row.data < 2 && scope.row.data !== 3.14159"
|
||||
style="font-weight: bold; color: #ff9900"
|
||||
>
|
||||
中度污染
|
||||
</span>
|
||||
<span
|
||||
v-if="2 <= scope.row.data && scope.row.data && scope.row.data !== 3.14159"
|
||||
style="font-weight: bold; color: #cc0000"
|
||||
>
|
||||
重度污染
|
||||
</span>
|
||||
<span v-if="scope.row.data == 3.14159" style="color: #000">暂无评估</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getSubstationInfoById, getLineInfoById } from '@/api/harmonic-boot/area'
|
||||
const dialogVisible = ref(false)
|
||||
const dictData = useDictData()
|
||||
const loading = ref(false)
|
||||
const voltageLevelFlag = ref(false)
|
||||
const tableData = ref([])
|
||||
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const title = ref('')
|
||||
const key = ref(0)
|
||||
const statisticalName = ref('')
|
||||
const open = (row: any, flag: boolean, params: any) => {
|
||||
console.log("🚀 ~ open ~ row:", row)
|
||||
console.log('🚀 ~ open ~ row:', row)
|
||||
voltageLevelFlag.value = flag
|
||||
loading.value = true
|
||||
title.value = row.name + '详情'
|
||||
statisticalName.value = params.statisticalType.name
|
||||
statisticalName.value = params.statisticalType.name
|
||||
tableData.value = []
|
||||
if (flag) {
|
||||
getLineInfoById({ ...params, deptIndex: row.pid, id: row.id ,powerFlag: row.powerFlag }).then((res: any) => {
|
||||
tableData.value = res.data
|
||||
loading.value = false
|
||||
}).catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
getLineInfoById({ ...params, deptIndex: row.pid, id: row.id, powerFlag: row.powerFlag })
|
||||
.then((res: any) => {
|
||||
tableData.value = res.data
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
} else {
|
||||
getSubstationInfoById({ ...params, deptIndex: row.id }).then((res: any) => {
|
||||
tableData.value = res.data
|
||||
loading.value = false
|
||||
}).catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
getSubstationInfoById({ ...params, deptIndex: row.id })
|
||||
.then((res: any) => {
|
||||
tableData.value = res.data
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
key.value += 1
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
@click="queryline(item1, true)"
|
||||
>
|
||||
<el-tag
|
||||
v-if="item1.data == 3.14159 "
|
||||
v-if="item1.data == 3.14159"
|
||||
style="background: #ccc; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
@@ -271,6 +271,9 @@ const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/deptSubstationRelations',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.reportFlag = tableStore.table.params.interval
|
||||
},
|
||||
loadCallback: () => {
|
||||
histogram(tableStore.table.data)
|
||||
}
|
||||
@@ -281,7 +284,7 @@ tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||
tableStore.table.params.statisticalType = options[0]
|
||||
tableStore.table.params.monitorFlag = 2
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.reportFlag = 3
|
||||
|
||||
tableStore.table.params.serverName = 'event-boot'
|
||||
const handleTabChange = (val: any) => {
|
||||
if (val == 0) return
|
||||
@@ -318,7 +321,7 @@ const histogram = (res: any) => {
|
||||
' ' +
|
||||
' ' +
|
||||
(params[i].value == 0.14159
|
||||
? '无污染'
|
||||
? '暂无数据'
|
||||
: params[i].value < 1
|
||||
? '无污染'
|
||||
: params[i].value < 1.2
|
||||
@@ -385,8 +388,7 @@ const histogram = (res: any) => {
|
||||
|
||||
// 定制显示(按顺序)
|
||||
color: function (params) {
|
||||
if (params.value == 0.14159) {
|
||||
} else if (params.value == 0) {
|
||||
if (params.value == 0) {
|
||||
return '#339966'
|
||||
} else if (params.value > 2) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
@@ -448,7 +450,7 @@ const histogram = (res: any) => {
|
||||
0 < params.value &&
|
||||
params.value <= 1 &&
|
||||
params.value >= 0 &&
|
||||
params.value !== 0.05
|
||||
params.value !== 0.14159
|
||||
) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
@@ -463,7 +465,7 @@ const histogram = (res: any) => {
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value == 0.05) {
|
||||
} else if (params.value == 0.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
@@ -594,7 +596,7 @@ const map = (res: any) => {
|
||||
let d = element.name.split('\n')
|
||||
let p1 = {
|
||||
name: d[0],
|
||||
value: element.data
|
||||
value: element.data == 3.14159 ? -1 : element.data
|
||||
}
|
||||
|
||||
arr1.push(p1)
|
||||
@@ -673,7 +675,7 @@ const map = (res: any) => {
|
||||
},
|
||||
{
|
||||
gte: -1,
|
||||
lte: 0.05,
|
||||
lte: 0.14159,
|
||||
label: '无数据',
|
||||
color: '#ccc'
|
||||
}
|
||||
@@ -786,7 +788,7 @@ const layout1 = mainHeight(93) as any
|
||||
.legend {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 17px;
|
||||
top: 20px;
|
||||
z-index: 99;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<vxe-column field="name" title="名称"></vxe-column>
|
||||
<vxe-column field="data" :title="changeName">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data == -1" type="primary" size="small">暂无数据</span>
|
||||
<span v-if="scope.row.data !== -1 && scope.row.data !== 0.1" type="primary"
|
||||
<span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
|
||||
<span v-if="scope.row.data !== 3.14159 && scope.row.data !== 0.1" type="primary"
|
||||
size="small">
|
||||
{{ scope.row.data }}
|
||||
</span>
|
||||
@@ -155,7 +155,7 @@ const map = (res: any) => {
|
||||
let d = element.name.split('\n')
|
||||
let p1 = {
|
||||
name: d[0],
|
||||
value: element.data
|
||||
value: element.data == 3.14159 ? -1 : element.data
|
||||
}
|
||||
|
||||
arr1.push(p1)
|
||||
|
||||
Reference in New Issue
Block a user