126 lines
4.9 KiB
Vue
126 lines
4.9 KiB
Vue
<template>
|
|
<view class="basic">
|
|
<view class="grid-card">
|
|
<view class="grid-card-title">电网电流</view>
|
|
<view class="grid-card-content-3">
|
|
<view class="item item-title">名称</view>
|
|
<view class="item item-title">有效值(A)</view>
|
|
<view class="item item-title">THDI(%)</view>
|
|
<template v-for="(item, index) in renderData.电网侧">
|
|
<view class="item">{{ item.phase }}</view>
|
|
<view class="item">{{ item['Pq_RmsI(A)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_ThdI(%)'] || '-'}}</view>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
<view class="grid-card">
|
|
<view class="grid-card-title">电网电压</view>
|
|
<view class="grid-card-content-4">
|
|
<view class="item item-title">名称</view>
|
|
<view class="item item-title">电压(V)</view>
|
|
<view class="item item-title">频率(Hz)</view>
|
|
<view class="item item-title">THDU(%)</view>
|
|
<template v-for="(item, index) in renderData.电网侧">
|
|
<view class="item">{{ item.phase }}</view>
|
|
<view class="item">{{ item['Pq_RmsLU(V)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_Freq(Hz)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_ThdU(%)'] || '-' }}</view>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
<view class="grid-card">
|
|
<view class="grid-card-title">负载电流</view>
|
|
<view class="grid-card-content-3">
|
|
<view class="item item-title">名称</view>
|
|
<view class="item item-title">有效值(A)</view>
|
|
<view class="item item-title">THDI(%)</view>
|
|
<template v-for="(item, index) in renderData.负载侧">
|
|
<view class="item">{{ item.phase }}</view>
|
|
<view class="item">{{ item['Pq_RmsI(A)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_ThdI(%)'] || '-' }}</view>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
<view class="grid-card">
|
|
<view class="grid-card-title">补偿电流</view>
|
|
<view class="grid-card-content-3">
|
|
<view class="item item-title">名称</view>
|
|
<view class="item item-title">有效值(A)</view>
|
|
<view class="item item-title">负载率(%)</view>
|
|
<template v-for="(item, index) in renderData.输出侧">
|
|
<view class="item">{{ item.phase }}</view>
|
|
<view class="item">{{ item['Apf_RmsI_Sys(A)'] || '-' }}</view>
|
|
<view class="item"></view>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
renderData: {
|
|
电网侧: {},
|
|
负载侧: {},
|
|
输出侧: {},
|
|
},
|
|
}
|
|
},
|
|
props: {
|
|
basicData: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
},
|
|
},
|
|
},
|
|
watch: {
|
|
basicData: {
|
|
handler: function (newVal, oldVal) {
|
|
let arr = [
|
|
{
|
|
name: '电网侧',
|
|
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
|
|
},
|
|
{
|
|
name: '负载侧',
|
|
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
|
|
},
|
|
{
|
|
name: '输出侧',
|
|
linePostion: '26eae70fb5ff1c090d2dc7c3a0743948',
|
|
},
|
|
]
|
|
this.basicData.forEach((item) => {
|
|
if (item.phase === 'avg') {
|
|
return
|
|
}
|
|
let index = arr.findIndex((item2) => {
|
|
return item2.linePostion === item.position
|
|
})
|
|
if (index > -1) {
|
|
if (this.renderData[arr[index]['name']][item.phase]) {
|
|
this.renderData[arr[index]['name']][item.phase][item.statisticalName] = item.statisticalData || '-'
|
|
} else {
|
|
this.renderData[arr[index]['name']][item.phase] = {
|
|
phase: item.phase,
|
|
[item.statisticalName]: item.statisticalData || '-',
|
|
}
|
|
}
|
|
}
|
|
})
|
|
console.log(this.renderData)
|
|
},
|
|
deep: true,
|
|
immediate: true,
|
|
},
|
|
},
|
|
methods: {},
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
|
.basic {
|
|
}
|
|
</style>
|