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

126 lines
3.5 KiB
Vue
Raw Normal View History

2023-02-07 17:59:54 +08:00
<template>
2024-09-02 09:50:59 +08:00
<view class="basic">
<view class="grid-card">
<view class="grid-card-title">电网侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
2024-11-06 11:19:28 +08:00
<view class="item item-title">有功功率(kW)</view>
2024-09-02 09:50:59 +08:00
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<view class="item item-title">功率因数</view>
<template v-for="(item, index) in renderData.电网侧">
<view class="item">{{ item.phase }}</view>
2024-11-06 11:19:28 +08:00
<view class="item">{{ item['Apf_P_Sys(W)'] == '-' ? '-' : (item['Apf_P_Sys(W)'] / 1000).toFixed(2) }}
</view>
<view class="item">{{ item['Apf_Q_Sys(Var)'] == '-' ? '-' : (item['Apf_Q_Sys(Var)'] / 1000).toFixed(2) }}
</view>
<view class="item">{{ item['Apf_S_Sys(VA)'] == '-' ? '-' : (item['Apf_S_Sys(VA)'] / 1000).toFixed(2) }}
</view>
2024-09-02 09:50:59 +08:00
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
</template>
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">负载侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
2024-11-06 11:19:28 +08:00
<view class="item item-title">有功功率(kW)</view>
2024-09-02 09:50:59 +08:00
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<view class="item item-title">功率因数</view>
<template v-for="(item, index) in renderData.负载侧">
<view class="item">{{ item.phase }}</view>
2024-11-06 11:19:28 +08:00
<view class="item">{{ item['Apf_P_Load(W)'] == '-' ? '-' : (item['Apf_P_Load(W)'] / 1000).toFixed(2) }}
</view>
<view class="item">{{ item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2)
}}</view>
<view class="item">{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] / 1000).toFixed(2) }}
</view>
2024-09-02 09:50:59 +08:00
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
</template>
</view>
</view>
</view>
2023-02-07 17:59:54 +08:00
</template>
<script>
export default {
2024-09-02 09:50:59 +08:00
data() {
return {
renderData: {
电网侧: [],
负载侧: [],
未知: [],
},
}
},
props: {
basicData: {
type: Array,
default: () => {
return []
},
},
},
watch: {
basicData: {
handler: function (newVal, oldVal) {
newVal.forEach((item) => {
if (item.phase === 'avg') {
return
}
let key = ''
switch (item.statisticalName) {
case 'Apf_P_Sys(W)':
key = '电网侧'
break
case 'Apf_Q_Sys(Var)':
key = '电网侧'
break
case 'Apf_S_Sys(VA)':
key = '电网侧'
break
case 'Apf_PF_Sys(null)':
key = '电网侧'
break
case 'Apf_P_Load(W)':
key = '负载侧'
break
case 'Apf_Q_Load(Var)':
key = '负载侧'
break
case 'Apf_S_Load(VA)':
key = '负载侧'
break
case 'Apf_PF_Load(null)':
key = '负载侧'
break
default:
key = '未知'
break
}
2023-09-13 16:40:03 +08:00
2024-09-02 09:50:59 +08:00
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
})
if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
} else {
this.renderData[key].push({
phase: item.phase,
[item.statisticalName]: item.statisticalData || '-',
})
}
})
console.log(this.renderData)
},
deep: true,
immediate: true,
},
},
methods: {},
2023-02-07 17:59:54 +08:00
}
</script>
2023-07-24 08:47:20 +08:00
<style lang="scss">
2024-11-06 11:19:28 +08:00
.basic {}
2023-07-24 08:47:20 +08:00
</style>