This commit is contained in:
白菜
2025-10-15 18:16:56 +08:00
parent a8c79eef72
commit 6149cba24e
8 changed files with 430 additions and 189 deletions

View File

@ -1,90 +1,39 @@
<template>
<view class="page-container">
<uni-collapse ref="collapse">
<!-- 总表 -->
<uni-collapse-item open :class="zbInfo.emsCommunicationStatus !== '0' ? 'danger' :'running'">
<uni-collapse-item open v-for="(item,index) in list" :key="index+'dbList'"
:class="item.emsCommunicationStatus !== '0' ? 'danger' :'running'">
<template v-slot:title>
<view class="title-row">
<view class="title">{{`1#${zbInfo.deviceName || ''}`}}</view>
<view class="title">{{index+1}}#{{item.deviceName || ''}}</view>
<view class="msg">
<view>{{communicationStatusOptions[zbInfo.emsCommunicationStatus] || ''}}</view>
<view>数据更新时间{{zbInfo.dataUpdateTime || ''}}</view>
<view>{{communicationStatusOptions[item.emsCommunicationStatus] || ''}}</view>
<view>数据更新时间{{item.dataUpdateTime || ''}}</view>
</view>
</view>
</template>
<uni-group :title=" item.category" mode="card" v-for="(item,index) in zbInfo.loadDataDetailInfo"
:key="index+'zbInfo'">
<uni-row>
<uni-group mode="card">
<uni-grid :column="2" showBorder class="info-grid">
<uni-grid-item v-for="(tempDataItem,tempDataIndex) in
deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'">
<view class="grid-item-box">
<view class="title">{{tempDataItem.name}}</view>
<text class="text">{{item[tempDataItem.attr]}}
<!-- <text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text> -->
</text>
</view>
</uni-grid-item>
</uni-grid>
<!-- <uni-row v-for="(tempDataItem,tempDataIndex) in deviceIdTypeMsg[item.deviceId]"
:key="tempDataIndex+'dbTempData'">
<uni-col :span="8">
<view>/kWh</view>
<view>{{tempDataItem.name}}</view>
</uni-col>
<uni-col :span="16">
<view>{{item.totalKwh}}</view>
<view>{{item[tempDataItem.attr]}}</view>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="8">
<view>/kWh</view>
</uni-col>
<uni-col :span="16">
<view>{{item.peakKwh}}</view>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="8">
<view>/kWh</view>
</uni-col>
<uni-col :span="16">
<view>{{item.highKwh}}</view>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="8">
<view>/kWh</view>
</uni-col>
<uni-col :span="16">
<view>{{item.flatKwh}}</view>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="8">
<view>/kWh</view>
</uni-col>
<uni-col :span="16">
<view>{{item.valleyKwh}}</view>
</uni-col>
</uni-row>
</uni-group>
</uni-collapse-item>
<!-- 储能表 -->
<uni-collapse-item open :class="cnbInfo.emsCommunicationStatus !== '0' ? 'danger' :'running'">
<template v-slot:title>
<view class="title-row">
<view class="title">{{`2#${cnbInfo.deviceName || ''}`}}</view>
<view class="msg">
<view>{{communicationStatusOptions[cnbInfo.emsCommunicationStatus] || ''}}</view>
<view>数据更新时间{{cnbInfo.dataUpdateTime || ''}}</view>
</view>
</view>
</template>
<uni-group :title="item.category" mode="card" v-for="(item,index) in cnbInfo.meteDataDetailInfo"
:key="index+'cnbInfo'">
<uni-row>
<uni-col :span="8">
<view>有功功率</view>
</uni-col>
<uni-col :span="16">
<view>{{item.activePower}}</view>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="8">
<view>无功功率</view>
</uni-col>
<uni-col :span="16">
<view>{{item.reactivePower}}</view>
</uni-col>
</uni-row>
</uni-row> -->
</uni-group>
</uni-collapse-item>
</uni-collapse>
@ -110,8 +59,93 @@
data() {
return {
siteId: '',
zbInfo: {},
cnbInfo: {},
list: [],
deviceIdTypeMsg: {
'LOAD': [{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能'
},
{
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能'
},
{
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
}
],
'METE': [{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能'
},
{
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能'
},
{
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
}
],
'METEGF': [{
name: '有功电能',
attr: 'activeEnergy',
pointName: '有功电能'
},
{
name: '无功电能',
attr: 'reactiveEnergy',
pointName: '无功电能'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
}
]
}
}
},
mounted() {
@ -120,8 +154,7 @@
getAmmeterDataList({
siteId: this.siteId
}).then(response => {
this.zbInfo = JSON.parse(JSON.stringify(response?.data?.ammeterLoadData || {}));
this.cnbInfo = JSON.parse(JSON.stringify(response?.data?.ammeterMeteData || {}));
this.list = response?.data || []
this.$nextTick(() => {
setTimeout(() => {
this.$refs.collapse.resize()
@ -155,7 +188,52 @@
}
}
.grid-item-box {
flex: 1;
// position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
background-color: #fff;
.title {
font-size: 14px;
color: #666;
}
.text {
margin-top: 10px;
font-size: 16px;
font-weight: 500;
color: #666;
overflow-wrap: anywhere;
}
.status-danger {
color: #FC6B69;
}
.status-running {
color: #05AEA3;
}
}
::v-deep {
.info-grid {
.uni-grid-item {
height: 80px !important;
.grid-item-box {
padding: 0;
}
}
}
.uni-group__title {
background-color: #959595;