消息推送

This commit is contained in:
仲么了
2023-09-13 16:40:03 +08:00
parent f8d8229cc1
commit f9bb466096
13 changed files with 204 additions and 154 deletions

View File

@@ -69,23 +69,24 @@ export default {
watch: {
basicData: {
handler: function (newVal, oldVal) {
console.log(this.basicData)
let basicData = JSON.parse(JSON.stringify(this.basicData))
let arr = [
{
name: '电网侧',
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
key: 'Apf_HarmI_Sys',
},
{
name: '负载侧',
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
key: 'Apf_HarmI_Load',
},
]
basicData.forEach((item) => {
if (item.statisticalName.indexOf('Pq_HarmI_') === -1) {
if (item.statisticalName.indexOf('HarmI') === -1) {
return
}
let index = arr.findIndex((item2) => {
return item2.linePostion === item.position
return item.statisticalName.indexOf(item2.key) > -1
})
if (index > -1) {
if (this.renderData[arr[index]['name']][item.phase]) {
@@ -93,7 +94,6 @@ export default {
item.statisticalData || 0
} else {
this.renderData[arr[index]['name']][item.phase] = {
phase: item.phase,
[item.statisticalName]: item.statisticalData || 0,
}
}
@@ -110,10 +110,11 @@ export default {
let obj = JSON.parse(
JSON.stringify(this.renderData['电网侧'][Object.keys(this.renderData['电网侧'])[0]]),
)
delete obj['phase']
console.log(
Object.keys(obj).map((item) => {
return item.match(/Pq_HarmI_(\d+)/)[1]
// Apf_HarmI_Sys_36(A) 匹配36
return item.match(/\d+/)[0]
}),
)
console.log(
@@ -128,7 +129,8 @@ export default {
)
this.chartData = {
categories: Object.keys(obj).map((item) => {
return Number(item.match(/Pq_HarmI_(\d+)/)[1])
// Apf_HarmI_Sys_36(A) 匹配36
return Number(item.match(/\d+/)[0])
}),
series: [
{