Compare commits

..

3 Commits

Author SHA1 Message Date
e1eec995ca 电池簇数据同步 2026-01-23 22:33:18 +08:00
b493e331c6 电表数据同步 2026-01-23 21:46:21 +08:00
b8898311ae pcs、bmszl 设备状态枚举workStatus更新 2026-01-23 20:28:39 +08:00
5 changed files with 110 additions and 46 deletions

View File

@ -2,11 +2,7 @@
<view class="page-container">
<uni-collapse ref="collapse" accordion v-if="list.length > 0">
<uni-collapse-item v-for="(item,index) in list" :key="item.deviceId+'bmscc'" :open="index===0"
class="common-collapse-item" :class="{
'timing-collapse-item':!['0','2'].includes(item.workStatus),
'warning-collapse-item':item.workStatus === '2',
'running-collapse-item':item.workStatus === '0'
}">
class="common-collapse-item" :class="handleCardClass(item)">
<template v-slot:title>
<view class='title-wrapper'>
@ -182,6 +178,15 @@
}
},
methods: {
handleCardClass(item) {
const {
workStatus = ''
} = item
return !['0', '2'].includes(item.workStatus) ? "timing-collapse-item" : workStatus === '2' ?
'warning-collapse-item' : 'running-collapse-item'
},
},
onLoad(options) {
uni.showLoading()
this.siteId = options.siteId || ''

View File

@ -2,16 +2,12 @@
<view class="page-container">
<uni-collapse ref="collapse" accordion v-if="list.length > 0">
<uni-collapse-item v-for="(item,index) in list" :key="item.deviceId+'bmszl'" :open="index===0"
class="common-collapse-item" :class="{
'timing-collapse-item':!['0','2'].includes(item.workStatus),
'warning-collapse-item':item.workStatus === '2',
'running-collapse-item':item.workStatus === '0'
}">
class="common-collapse-item" :class="handleCardClass(item,index)">
<template v-slot:title>
<view class='title-wrapper'>
<view class="top">
<view class="status">{{workStatusOptions[item.workStatus] || '暂无数据'}}</view>
<view class="status">{{STACKWorkStatusOptions[item.workStatus] || '暂无数据'}}</view>
<text class="name">{{item.deviceName}}</text>
</view>
</view>
@ -24,7 +20,7 @@
<view class="grid-item-box">
<view class="title">工作状态</view>
<text
class="text work-status-color">{{workStatusOptions[item.workStatus] || '-'}}</text>
class="text work-status-color">{{STACKWorkStatusOptions[item.workStatus] || '-'}}</text>
</view>
</view>
<view class="flex-lists">
@ -113,8 +109,8 @@
export default {
computed: {
...mapState({
workStatusOptions: (state) =>
state.ems.workStatusOptions,
STACKWorkStatusOptions: (state) =>
state.ems.STACKWorkStatusOptions,
communicationStatusOptions: (state) =>
state.ems.communicationStatusOptions,
})
@ -187,6 +183,15 @@
}
},
methods: {
handleCardClass(item) {
const {
workStatus = ''
} = item
return !Object.keys(this.STACKWorkStatusOptions).find(i => i === workStatus) ? "timing-collapse-item" :
workStatus === '9' ? 'warning-collapse-item' : 'running-collapse-item'
},
},
onLoad(options) {
uni.showLoading()
this.siteId = options.siteId || ''

View File

@ -16,22 +16,21 @@
</view>
</view>
</template>
<view class='content' v-if="deviceIdTypeMsg[item.deviceId]">
<view class='content'>
<uni-group mode="card" class="data-card-group">
<uni-row v-for="(tempDataItem,tempDataIndex) in
deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'" class="data-row">
(deviceIdTypeMsg[item.deviceId] || otherTypeMsg)" :key="tempDataIndex+'dbTempData'" class="data-row">
<uni-col :span="8">
<view class="title">{{tempDataItem.name}}</view>
</uni-col>
<uni-col :span="16">
<view class="value">{{item[tempDataItem.attr] | formatNumber}}
<!-- <text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text> -->
<text v-if="tempDataItem.unit" v-html="tempDataItem.unit"></text>
</view>
</uni-col>
</uni-row>
</uni-group>
</view>
<view v-else class='unknow-bd-device'>未知的电表数据</view>
</uni-collapse-item>
</uni-collapse>
<view class="no-data" v-else>
@ -63,88 +62,122 @@
'LOAD': [{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能'
pointName: '正向有功电能',
unit: 'kWh'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能'
pointName: '反向有功电能',
unit: 'kWh'
},
{
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能'
pointName: '正向无功电能',
unit: 'kvarh'
},
{
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能'
pointName: '反向无功电能',
unit: 'kvarh'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
pointName: '总有功功率',
unit: 'kW'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
pointName: '总无功功率',
unit: 'kvar'
}
],
'METE': [{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能'
pointName: '正向有功电能',
unit: 'kWh'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能'
pointName: '反向有功电能',
unit: 'kWh'
},
{
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能'
pointName: '正向无功电能',
unit: 'kvarh'
},
{
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能'
pointName: '反向无功电能',
unit: 'kvarh'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
pointName: '总有功功率',
unit: 'kW'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
pointName: '总无功功率',
unit: 'kvar'
}
],
'METEGF': [{
name: '有功电能',
attr: 'activeEnergy',
pointName: '有功电能'
pointName: '有功电能',
unit: 'kWh'
},
{
name: '无功电能',
attr: 'reactiveEnergy',
pointName: '无功电能'
pointName: '无功电能',
unit: 'kvarh'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率'
pointName: '总有功功率',
unit: 'kW'
},
{
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率'
pointName: '总无功功率',
unit: 'kvar'
}
]
}
},
otherTypeMsg: [{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能',
unit: 'kWh'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能',
unit: 'kWh'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率',
unit: 'kW'
},
]
}
},
onLoad(options) {

View File

@ -4,7 +4,7 @@
<uni-grid class="info-grid" :square="false" :column="2" :showBorder="false">
<uni-grid-item v-for="(item,index) in runningHeadData" :key="index+'head'">
<view class="grid-item-box">
<image :src="require('@/static/images/ems/pcs/'+item.img+'.jpg')" class="icon" alt="">
<image :src="require('@/static/images/ems/pcs/'+item.img+'.jpg')" class="icon" alt=""/>
<view class="title">{{item.title}}</view>
<view class="text">{{runningHeadInfo[item.attr] | formatNumber}}</view>
</view>
@ -13,16 +13,12 @@
<uni-collapse ref="collapse" accordion v-if="list.length > 0">
<uni-collapse-item v-for="(item,index) in list" :key="index+'pcs'" :open="index===0"
class="common-collapse-item" :class="{
'timing-collapse-item':!['0','2'].includes(item.workStatus),
'warning-collapse-item':item.workStatus === '2',
'running-collapse-item':item.workStatus === '0'
}">
class="common-collapse-item" :class="handleCardClass(item)">
<template v-slot:title>
<view class='title-wrapper'>
<view class="top">
<view class="status">{{workStatusOptions[item.workStatus] || '暂无数据'}}</view>
<view class="status">{{PCSWorkStatusOptions[item.workStatus] || '暂无数据'}}</view>
<text class="name">{{item.deviceName}}</text>
</view>
</view>
@ -35,7 +31,7 @@
<view class="grid-item-box">
<view class="title">工作状态</view>
<text
class="text work-status-color">{{workStatusOptions[item.workStatus] || '-'}}</text>
class="text work-status-color">{{PCSWorkStatusOptions[item.workStatus] || '-'}}</text>
</view>
</view>
<view class="flex-lists">
@ -119,8 +115,8 @@
export default {
computed: {
...mapState({
workStatusOptions: (state) =>
state.ems.workStatusOptions,
PCSWorkStatusOptions: (state) =>
state.ems.PCSWorkStatusOptions,
communicationStatusOptions: (state) =>
state.ems.communicationStatusOptions,
deviceStatusOptions: (state) =>
@ -262,6 +258,15 @@
]
}
},
methods: {
handleCardClass(item) {
const {
workStatus = ''
} = item
return workStatus === '1' || !Object.keys(this.PCSWorkStatusOptions).find(i => i === workStatus) ?
"timing-collapse-item" : workStatus === '2' ? 'warning-collapse-item' : 'running-collapse-item'
},
},
onLoad(options) {
uni.showLoading()
this.siteId = options.siteId || ''

View File

@ -5,6 +5,21 @@ const ems = {
'1': '停机',
'2': '故障'
}, //工作状态
PCSWorkStatusOptions: {
'0': '运行',
'1': '停机',
'2': '故障',
'3': '待机',
'4': '充电',
'5': '放电'
}, //PCS工作状态
STACKWorkStatusOptions: {
"0": "净置",
"1": "充电",
"2": "放电",
"3": "浮充",
'9': "故障"
}, //STACKBMS总览工作状态
deviceStatusOptions: {
'0': '离线',
'1': '在线'
@ -64,6 +79,7 @@ const ems = {
'2': '待机',
'3': '放电'
}, //冲放状态
}
}
export default ems