修改技术监督

This commit is contained in:
GGJ
2025-12-11 15:03:11 +08:00
parent 0fe2d2b911
commit b36f765d07
21 changed files with 546 additions and 300 deletions

View File

@@ -33,7 +33,7 @@
<br />
<span style="color: #ff9900">中度污染(1.6 , 2]</span>
<br />
<span style="color: #A52a2a">重度污染(2 , +)</span>
<span style="color: #a52a2a">重度污染(2 , +)</span>
</div>
</el-popover>
</span>
@@ -49,11 +49,11 @@
<el-radio-button v-for="item in options" :label="item.id">{{ item.name }}</el-radio-button>
</el-radio-group>
</div>
<!-- :style="i == 3 ? `margin-left: 20%;` : ``" -->
<div class="pie">
<MyEChart
v-for="(item, i) in picEChart"
:style="i == 3 ? `margin-left: 20%;` : ``"
class="MyEChart"
:options="item"
/>
@@ -72,6 +72,7 @@
<vxe-column field="num3" sortable title="轻度污染数量" :formatter="formatter" />
<vxe-column field="num4" sortable title="中度污染数量" :formatter="formatter" />
<vxe-column field="num5" sortable title="重度污染数量" :formatter="formatter" />
<vxe-column field="num6" sortable title="暂无数据数量" :formatter="formatter" />
</vxe-table>
</div>
</el-dialog>
@@ -88,11 +89,12 @@ const dictData = useDictData()
const dialogVisible: any = ref(false)
const time = ref('1')
const Voltage = dictData.getBasicData('Dev_Voltage_Stand')
const options: any = dictData.getBasicData('Pollution_Statis').filter(item => {
if (item.code == 'V_Harmonic' || item.code == 'I_All') {
return item
}
})
const options: any = dictData.getBasicData('Pollution_Calc')
// .filter(item => {
// if (item.code == 'V_Harmonic' || item.code == 'I_All') {
// return item
// }
// })
const contaminate = ref(options[0].id)
const rowList: any = ref({})
const trendEChart: any = ref({})
@@ -119,57 +121,223 @@ const open = async (row: any) => {
}
const contaminateC = () => {
// rowList.value.deviceInfoParam.ids=[contaminate.value]
getPollutionAlarmData({ ...rowList.value, ids: [contaminate.value] }).then(res => {
let data = []
// getPollutionAlarmData({ ...rowList.value, ids: [contaminate.value] }).then(res => {
// let data = []
let a1 = 0
let a2 = 0
let a3 = 0
let a4 = 0
let a5 = 0
if (rowList.value.isUpToGrid == 0) {
data = res.data.info
} else {
data = res.data.gwInfo
}
for (let i = 0; i < data.length; i++) {
if (data[i] >= 2) {
++a5
} else if (data[i] >= 1.6 && data[i] < 2) {
++a4
} else if (data[i] >= 1.2 && data[i] < 1.6) {
++a3
} else if (data[i] >= 1 && data[i] < 1.2) {
++a2
} else if (data[i] >= 0 && data[i] < 1) {
++a1
// let a1 = 0
// let a2 = 0
// let a3 = 0
// let a4 = 0
// let a5 = 0
// if (rowList.value.isUpToGrid == 0) {
// data = res.data.info
// } else {
// data = res.data.gwInfo
// }
// for (let i = 0; i < data.length; i++) {
// if (data[i] >= 2) {
// ++a5
// } else if (data[i] >= 1.6 && data[i] < 2) {
// ++a4
// } else if (data[i] >= 1.2 && data[i] < 1.6) {
// ++a3
// } else if (data[i] >= 1 && data[i] < 1.2) {
// ++a2
// } else if (data[i] >= 0 && data[i] < 1) {
// ++a1
// }
// }
// let list = [
// {
// value: ((a1 / data.length || 0) * 100).toFixed(2),
// name: `无污染:${a1}座`
// },
// {
// value: ((a2 / data.length || 0) * 100).toFixed(2),
// name: `轻微污染::${a2}座`
// },
// {
// value: ((a3 / data.length || 0) * 100).toFixed(2),
// name: `轻度污染:${a3}座`
// },
// {
// value: ((a4 / data.length || 0) * 100).toFixed(2),
// name: `中度污染:${a4}座`
// },
// {
// value: ((a5 / data.length || 0) * 100).toFixed(2),
// name: `重度污染:${a5}座`
// }
// ]
// const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a']
// list.forEach((item, i) => {
// picEChart.value[i] = {
// legend: {
// type: 'scroll',
// orient: 'vertical',
// left: 10,
// top: '10%'
// },
// xAxis: {
// show: false
// },
// yAxis: {
// show: false
// },
// options: {
// toolbox:null,
// dataZoom: null,
// series: [
// {
// type: 'gauge',
// startAngle: 180,
// center: ['50%', '80%'],
// radius: '135%',
// endAngle: 0,
// min: 0,
// max: 100,
// progress: {
// show: true,
// width: 15,
// itemStyle: {
// color: color[i]
// }
// },
// pointer: {
// show: false
// },
// axisLine: {
// lineStyle: {
// width: 15,
// color: [[1, '#f4f4f4']]
// }
// },
// axisTick: {
// show: false
// },
// splitLine: {
// show: false
// },
// axisLabel: {
// show: false
// // distance: 5,
// // color: '#666',
// // fontSize: 12,
// // formatter: function (value: any) {
// // if (value === 0 || value === 100) {
// // return value + '%'
// // }
// // }
// },
// anchor: {
// show: false,
// showAbove: false,
// size: 25,
// itemStyle: {
// borderWidth: 60
// }
// },
// title: {
// show: true,
// offsetCenter: [0, '20%'],
// fontSize: 14
// },
// detail: {
// valueAnimation: true,
// fontSize: 14,
// lineHeight: 20,
// color: color[i],
// fontWeight: 'bold',
// offsetCenter: [0, '-20%'],
// formatter: function (value: any) {
// return '{a|占比} ' + '\n' + value + '{a|%}'
// },
// rich: {
// a: {
// color: '#333',
// fontSize: 16,
// lineHeight: 30
// }
// }
// },
// data: [item]
// }
// ]
// }
// }
// })
// })
getPollutionAlarmList({ ...rowList.value, ids: [contaminate.value] }).then(res => {
tableData.value = res.data.map((item: any) => {
return {
name: item[0],
num: item[1],
num1: item[2],
num2: item[3],
num3: item[4],
num4: item[5],
num5: item[6],
num6: item[7]
}
}
// console.log('🚀 ~ getPollutionAlarmData ~ a1 / data.length:', a1 / data.length)
})
console.log(123, tableData.value)
let data = []
let a1 = tableData.value.reduce((t, item) => t + (item.num1 - 0 || 0), 0)
let a2 = tableData.value.reduce((t, item) => t + (item.num2 - 0 || 0), 0)
let a3 = tableData.value.reduce((t, item) => t + (item.num3 - 0 || 0), 0)
let a4 = tableData.value.reduce((t, item) => t + (item.num4 - 0 || 0), 0)
let a5 = tableData.value.reduce((t, item) => t + (item.num5 - 0 || 0), 0)
let a6 = tableData.value.reduce((t, item) => t + (item.num6 - 0 || 0), 0)
let total = a1 + a2 + a3 + a4 + a5 + a6
// if (rowList.value.isUpToGrid == 0) {
// data = res.data.info
// } else {
// data = res.data.gwInfo
// }
// for (let i = 0; i < data.length; i++) {
// if (data[i] >= 2) {
// ++a5
// } else if (data[i] >= 1.6 && data[i] < 2) {
// ++a4
// } else if (data[i] >= 1.2 && data[i] < 1.6) {
// ++a3
// } else if (data[i] >= 1 && data[i] < 1.2) {
// ++a2
// } else if (data[i] >= 0 && data[i] < 1) {
// ++a1
// }
// }
let list = [
{
value: ((a1 / data.length || 0) * 100).toFixed(2),
value: ((a1 / total || 0) * 100).toFixed(2),
name: `无污染:${a1}`
},
{
value: ((a2 / data.length || 0) * 100).toFixed(2),
value: ((a2 / total || 0) * 100).toFixed(2),
name: `轻微污染::${a2}`
},
{
value: ((a3 / data.length || 0) * 100).toFixed(2),
value: ((a3 / total || 0) * 100).toFixed(2),
name: `轻度污染:${a3}`
},
{
value: ((a4 / data.length || 0) * 100).toFixed(2),
value: ((a4 / total || 0) * 100).toFixed(2),
name: `中度污染:${a4}`
},
{
value: ((a5 / data.length || 0) * 100).toFixed(2),
value: ((a5 / total || 0) * 100).toFixed(2),
name: `重度污染:${a5}`
}
},
{
value: ((a6 / total || 0) * 100).toFixed(2),
name: `暂无数据:${a6}`
},
]
const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a']
const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a','#ccc']
list.forEach((item, i) => {
picEChart.value[i] = {
@@ -186,7 +354,7 @@ const contaminateC = () => {
show: false
},
options: {
toolbox:null,
toolbox: null,
dataZoom: null,
series: [
{
@@ -268,19 +436,6 @@ const contaminateC = () => {
}
})
})
getPollutionAlarmList({ ...rowList.value, ids: [contaminate.value] }).then(res => {
tableData.value = res.data.map((item: any) => {
return {
name: item[0],
num: item[1],
num1: item[2],
num2: item[3],
num3: item[4],
num4: item[5],
num5: item[6]
}
})
})
}
const analysis = (e: any) => {
let time = rowList.value.searchBeginTime?.slice(0, 4) + `-01-01`

View File

@@ -97,7 +97,7 @@ const url: any = [
new URL(`@/assets/img/SB.png`, import.meta.url)
]
const tableData: any = ref([])
const title = ['电压偏差(超标)', '频率偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
const title = ['频率偏差(超标)', '电压偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
const echart = (row: any) => {
let maxList: any = []