106 lines
4.0 KiB
Vue
106 lines
4.0 KiB
Vue
<template>
|
|
<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>
|
|
<view class="item item-title">有功功率(kw)</view>
|
|
<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>
|
|
<view class="item">{{ item['Pq_P(W)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_Q(var)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_S(VA)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_PF(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>
|
|
<view class="item item-title">有功功率(kw)</view>
|
|
<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>
|
|
<view class="item">{{ item['Pq_P(W)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_Q(var)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_S(VA)'] || '-' }}</view>
|
|
<view class="item">{{ item['Pq_PF(null)'] || '-' }}</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>
|