修改 数据中心测试bug

This commit is contained in:
GGJ
2024-11-13 16:21:08 +08:00
parent 7640b53b20
commit e53a3dd8dd
11 changed files with 1721 additions and 7 deletions

View File

@@ -0,0 +1,300 @@
<template>
<div class="charts" style="position: relative; width: 100%">
<div style="position: absolute; right: 60px; top: 5px; font-weight: bold">
<el-tag style="
background: #cc0000;
width: 30px;
height: 15px;
border: 1px solid #cc0000;
float: left;
margin-top: 2px;
"></el-tag>
<span style="color: #cc0000; font-weight: 400; float: left">&nbsp&nbsp在线率<60% &nbsp&nbsp</span>
<el-tag size="small" style="
background: #ffcc33;
width: 30px;
height: 15px;
border: 1px solid #ffcc33;
float: left;
margin-top: 2px;
"></el-tag>
<span style="color: #ffcc33; font-weight: 400; float: left">&nbsp&nbsp60%在线率<90% &nbsp&nbsp</span>
<el-tag style="
background: #339966;
width: 30px;
height: 15px;
border: 1px solid #339966;
float: left;
margin-top: 2px;
"></el-tag>
<span style="color: #339966; font-weight: 400; float: left">&nbsp&nbsp在线率90%</span>
</div>
<my-echart v-loading="loading" class="mt10" :style="`height: calc(${tableStore.table.height} - 135px)`"
:options="options" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import * as echarts from 'echarts/core'
const dictData = useDictData()
const options = ref({})
const TableHeaderRef = ref()
const tableStoreParams: any = ref({})
const loading = ref(false)
const getTableStoreParams = async (val: any) => {
tableStoreParams.value = val
loading.value = true
setTimeout(() => {
tableStore.index()
}, 1500)
}
const itemStyle = {
normal: {
// 随机显示
//color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
// 定制显示(按顺序)
color: function (params) {
if (params.value >= 90) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: '#339966',
},
],
false
);
} else if (params.value >= 60 && params.value <= 90) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: '#FFCC33',
},
],
false
);
} else if (params.value <= 60 && params.value !== 3.14159) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: '#CC0000',
},
],
false
);
} else if (params.value == 3.14159) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: "#cccccc",
},
],
false
);
}
},
},
}
const tableStore = new TableStore({
url: '/harmonic-boot/steadyQualify/getSteadyQualifyCensus',
showPage: false,
method: 'POST',
column: [],
beforeSearchFun: () => {
tableStore.table.params = tableStoreParams.value
},
loadCallback: () => {
let code = tableStore.table.params.statisticalType.code
let title = '',
titleX = ''
if (code == 'Power_Network') {
title = '区域'
titleX = '区域'
} else if (code == 'Manufacturer') {
title = '终端厂家'
titleX = '终端\n厂家'
} else if (code == 'Voltage_Level') {
title = '电压等级'
titleX = '电压\n等级'
} else if (code == 'Load_Type') {
title = '干扰源类型'
titleX = '干扰\n源类型'
} else if (code == 'Report_Type') {
title = '上报类型'
titleX = '上报\n类型'
}
options.value = {
title: {
text: title
},
legend: {
show: false
},
// tooltip: {
// formatter: function (params: any) {
// var tips = ''
// for (var i = 0; i < params.length; i++) {
// if (params[i].value == 1) {
// tips += params[i].name + '</br>'
// tips += '总畸变率:暂无数据'
// } else {
// tips += params[i].name + '</br>'
// tips += '总畸变率:' + params[i].value.toFixed(2)
// }
// }
// return tips
// }
// },
xAxis: {
name: titleX,
data: tableStore.table.data.type
},
yAxis: {
name: '%',
max: 100
},
series: [
{
name: "频率偏差",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.freqOffset,
markLine: {
silent: false,
symbol: "circle",
data: [
{
name: "",
yAxis: 100,
lineStyle: {
color: '#339966',
},
label: {
// position: "middle",
formatter: "{b}",
textStyle: {
color: '#339966',
},
},
},
{
name: "",
yAxis: 90,
lineStyle: {
color: '#FFCC33',
},
label: {
// position: "middle",
formatter: "{b}",
textStyle: {
color: '#FFCC33',
},
},
},
{
name: "",
yAxis: 60,
lineStyle: {
color: '#CC0000',
},
label: {
// position: "middle",
formatter: "{b}",
textStyle: {
color: '#CC0000',
},
},
},
],
},
},
{
name: "闪变",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.flicker,
},
{
name: "三相电压不平衡",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.voltageUnbalance,
},
{
name: "谐波电压",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.harmonicVoltage,
},
{
name: "电压偏差",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.voltageOffset,
},
{
name: "谐波电流",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.harmonicCurrent,
},
{
name: "负序电流",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.negativeCurrent,
},
{
name: "间谐波电压含有率",
type: "bar",
itemStyle: itemStyle,
data: tableStore.table.data.interHarmonic,
},
]
}
loading.value = false
}
})
provide('tableStore', tableStore)
onMounted(() => { })
defineExpose({ getTableStoreParams })
</script>
<style scoped lang="scss"></style>