Files
app-govern/pages/device/APF/comp/basic.vue

172 lines
6.9 KiB
Vue
Raw Normal View History

2023-02-06 13:34:15 +08:00
<template>
2023-07-24 08:47:20 +08:00
<view class="basic">
2023-02-06 13:34:15 +08:00
<view class="grid-card">
<view class="grid-card-title">电网电流</view>
2023-07-24 08:47:20 +08:00
<view class="grid-card-content-3">
2023-02-10 13:38:19 +08:00
<view class="item item-title">名称</view>
<view class="item item-title">有效值(A)</view>
2023-10-24 09:01:10 +08:00
<view class="item item-title">畸变率(%)</view>
2023-09-13 16:40:03 +08:00
<template v-for="(item, index) in renderData.电网电流">
2023-07-24 08:47:20 +08:00
<view class="item">{{ item.phase }}</view>
2024-09-05 09:01:16 +08:00
<view class="item">{{
item['Apf_RmsI_Sys(A)'] > 0 ? item['Apf_RmsI_Sys(A)'].toFixed(2) : item['Apf_RmsI_Sys(A)']
}}</view>
<view class="item">{{
item['Apf_ThdA_Sys(%)'] > 0 ? item['Apf_ThdA_Sys(%)'].toFixed(2) : item['Apf_ThdA_Sys(%)']
}}</view>
2023-07-24 08:47:20 +08:00
</template>
2023-02-06 13:34:15 +08:00
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">电网电压</view>
<view class="grid-card-content-4">
2023-02-10 13:38:19 +08:00
<view class="item item-title">名称</view>
<view class="item item-title">电压(V)</view>
<view class="item item-title">频率(Hz)</view>
2023-10-24 09:01:10 +08:00
<view class="item item-title">畸变率(%)</view>
2023-09-13 16:40:03 +08:00
<template v-for="(item, index) in renderData.电网电压">
2023-07-24 08:47:20 +08:00
<view class="item">{{ item.phase }}</view>
2024-09-05 09:01:16 +08:00
<view class="item">{{
item['Apf_PhV_Sys(V)'] > 0 ? item['Apf_PhV_Sys(V)'].toFixed(2) : item['Apf_PhV_Sys(V)']
}}</view>
<view class="item">{{
item['Apf_Freq(Hz)'] > 0 ? item['Apf_Freq(Hz)'].toFixed(2) : item['Apf_Freq(Hz)']
}}</view>
<view class="item">{{
item['Apf_ThdU_Sys(%)'] > 0 ? item['Apf_ThdU_Sys(%)'].toFixed(2) : item['Apf_ThdU_Sys(%)']
}}</view>
2023-07-24 08:47:20 +08:00
</template>
2023-02-06 13:34:15 +08:00
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">负载电流</view>
2023-07-24 08:47:20 +08:00
<view class="grid-card-content-3">
2023-02-10 13:38:19 +08:00
<view class="item item-title">名称</view>
<view class="item item-title">有效值(A)</view>
2023-10-24 09:01:10 +08:00
<view class="item item-title">畸变率(%)</view>
2023-09-13 16:40:03 +08:00
<template v-for="(item, index) in renderData.负载电流">
2023-07-24 08:47:20 +08:00
<view class="item">{{ item.phase }}</view>
2024-09-05 09:01:16 +08:00
<view class="item">{{
item['Apf_RmsI_Load(A)'] > 0 ? item['Apf_RmsI_Load(A)'].toFixed(2) : item['Apf_RmsI_Load(A)']
}}</view>
<view class="item">{{
item['Apf_ThdA_Load(%)'] > 0 ? item['Apf_ThdA_Load(%)'].toFixed(2) : item['Apf_ThdA_Load(%)']
}}</view>
2023-07-24 08:47:20 +08:00
</template>
2023-02-06 13:34:15 +08:00
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">补偿电流</view>
2023-07-24 08:47:20 +08:00
<view class="grid-card-content-3">
2023-02-10 13:38:19 +08:00
<view class="item item-title">名称</view>
<view class="item item-title">有效值(A)</view>
<view class="item item-title">负载率(%)</view>
2023-09-13 16:40:03 +08:00
<template v-for="(item, index) in renderData.补偿电流">
2023-07-24 08:47:20 +08:00
<view class="item">{{ item.phase }}</view>
2024-09-05 09:01:16 +08:00
<view class="item">{{
item['Apf_RmsI_TolOut(A)'] > 0
? item['Apf_RmsI_TolOut(A)'].toFixed(2)
: item['Apf_RmsI_TolOut(A)']
}}</view>
<view class="item">{{
item['load_Rate'] > 0 ? item['load_Rate'].toFixed(2) : item['load_Rate']
}}</view>
2023-07-24 08:47:20 +08:00
</template>
2023-02-06 13:34:15 +08:00
</view>
</view>
</view>
</template>
<script>
export default {
2023-07-24 08:47:20 +08:00
data() {
2023-02-06 13:34:15 +08:00
return {
2023-07-24 08:47:20 +08:00
renderData: {
2023-09-13 16:40:03 +08:00
电网电流: [],
电网电压: [],
负载电流: [],
补偿电流: [],
2024-09-05 09:01:16 +08:00
未知: [],
2023-07-24 08:47:20 +08:00
},
2023-02-06 13:34:15 +08:00
}
},
2023-07-24 08:47:20 +08:00
props: {
2023-08-18 14:41:53 +08:00
basicData: {
type: Array,
2023-07-24 08:47:20 +08:00
default: () => {
2023-08-18 14:41:53 +08:00
return []
2023-07-24 08:47:20 +08:00
},
},
},
watch: {
2023-08-18 14:41:53 +08:00
basicData: {
2023-07-24 08:47:20 +08:00
handler: function (newVal, oldVal) {
2024-09-05 09:01:16 +08:00
newVal.forEach((item) => {
2023-08-18 14:41:53 +08:00
if (item.phase === 'avg') {
2023-07-24 08:47:20 +08:00
return
}
2023-09-13 16:40:03 +08:00
let key = ''
switch (item.statisticalName) {
case 'Apf_RmsI_Sys(A)':
key = '电网电流'
break
case 'Apf_ThdA_Sys(%)':
key = '电网电流'
break
case 'Apf_PhV_Sys(V)':
key = '电网电压'
break
case 'Apf_Freq(Hz)':
key = '电网电压'
break
2023-09-28 16:30:07 +08:00
case 'Apf_ThdU_Sys(%)':
key = '电网电压'
break
2023-09-13 16:40:03 +08:00
case 'Apf_RmsI_Load(A)':
key = '负载电流'
break
case 'Apf_ThdA_Load(%)':
key = '负载电流'
break
case 'Apf_RmsI_TolOut(A)':
key = '补偿电流'
break
case 'Apf_PhV_Sys(V)':
key = '补偿电流'
break
case 'Apf_PhV_Sys(V)':
key = '补偿电流'
break
2023-11-08 10:50:53 +08:00
case 'load_Rate':
key = '补偿电流'
break
2023-09-13 16:40:03 +08:00
default:
key = '未知'
break
}
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
2023-07-24 08:47:20 +08:00
})
2023-08-18 14:41:53 +08:00
if (index > -1) {
2024-09-02 09:50:59 +08:00
this.renderData[key][index][item.statisticalName] = item.statisticalData //
2023-09-13 16:40:03 +08:00
} else {
this.renderData[key].push({
phase: item.phase,
2024-09-05 09:01:16 +08:00
[item.statisticalName]: item.statisticalData, //,
2023-09-13 16:40:03 +08:00
})
2023-08-18 14:41:53 +08:00
}
2023-07-24 08:47:20 +08:00
})
2023-08-18 14:41:53 +08:00
console.log(this.renderData)
2023-07-24 08:47:20 +08:00
},
deep: true,
immediate: true,
},
},
2024-09-05 09:01:16 +08:00
methods: {},
2023-02-06 13:34:15 +08:00
}
</script>
2023-07-24 08:47:20 +08:00
<style lang="scss">
.basic {
}
</style>