工作栏
This commit is contained in:
238
pages/work/bmsdcc/index.vue
Normal file
238
pages/work/bmsdcc/index.vue
Normal file
@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<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+'bmsdcc'" :open="index===0"
|
||||
:title="`${index+1}#${item.deviceName}`" :class="item.workStatus === '0' ? 'running' :'danger'">
|
||||
<view>
|
||||
<uni-group mode="card" class="work-group">
|
||||
<uni-grid :column="3" :showBorder="false">
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<view class="title">工作状态</view>
|
||||
<text class="text status">{{workStatusOptions[item.workStatus]}}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<view class="title">与PCS通信</view>
|
||||
<text
|
||||
class="text">{{communicationStatusOptions[item.pcsCommunicationStatus]}}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<view class="title">与EMS通信</view>
|
||||
<text
|
||||
class="text">{{communicationStatusOptions[item.emsCommunicationStatus]}}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</uni-group>
|
||||
<uni-group mode="card">
|
||||
<uni-grid :column="3" :showBorder="false">
|
||||
<uni-grid-item v-for="(infoDataItem,infoDataIndex) in infoData"
|
||||
:key="infoDataIndex+'infoData'">
|
||||
<view class="grid-item-box">
|
||||
<view class="title">{{infoDataItem.label}}</view>
|
||||
<text class="text">{{item[infoDataItem.attr]}}
|
||||
<text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text>
|
||||
</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</uni-group>
|
||||
<uni-group mode="card" style="margin-bottom: 25px;">
|
||||
<uni-table border stripe emptyText="暂无数据">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th align="center">名称</uni-th>
|
||||
<uni-th align="center">单体平均值</uni-th>
|
||||
<uni-th align="center">单体最小值</uni-th>
|
||||
<uni-th align="center">单体最小值ID</uni-th>
|
||||
<uni-th align="center">单体最大值</uni-th>
|
||||
<uni-th align="center">单体最大值ID</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(tableItem, tableIndex) in item.batteryDataList"
|
||||
:key="tableIndex+'batteryDataList'">
|
||||
<uni-td align="center"
|
||||
v-html="`${tableItem.dataName}(${unitObj[tableItem.dataName]})`"></uni-td>
|
||||
<uni-td align="center">{{tableItem.avgData}}</uni-td>
|
||||
<uni-td align="center">{{tableItem.minData}}</uni-td>
|
||||
<uni-td align="center">{{tableItem.minDataID}}</uni-td>
|
||||
<uni-td align="center">{{tableItem.maxData}}</uni-td>
|
||||
<uni-td align="center">{{tableItem.maxDataID}}</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</uni-group>
|
||||
</view>
|
||||
</uni-collapse-item>
|
||||
</uni-collapse>
|
||||
<view class="no-data" v-else>
|
||||
暂无数据
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getBMSBatteryCluster
|
||||
} from '@/api/ems/site.js'
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex'
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
workStatusOptions: (state) =>
|
||||
state.ems.workStatusOptions,
|
||||
communicationStatusOptions: (state) =>
|
||||
state.ems.communicationStatusOptions,
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unitObj: {
|
||||
'电压': 'V',
|
||||
'温度': '℃',
|
||||
'SOC': '%'
|
||||
},
|
||||
list: [],
|
||||
siteId: '',
|
||||
infoData: [{
|
||||
label: '簇电压',
|
||||
attr: 'clusterVoltage',
|
||||
unit: 'V'
|
||||
},
|
||||
{
|
||||
label: '可充电量',
|
||||
attr: 'chargeableCapacity',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
label: '累计充电量',
|
||||
attr: 'totalChargedCapacity',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
label: '簇电流',
|
||||
attr: 'clusterCurrent',
|
||||
unit: 'A'
|
||||
},
|
||||
{
|
||||
label: '可放电量',
|
||||
attr: 'dischargeableCapacity',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
label: '累计放电量',
|
||||
attr: 'totalDischargedCapacity',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
label: 'SOH',
|
||||
attr: 'soh',
|
||||
unit: '%'
|
||||
},
|
||||
{
|
||||
label: '平均温度',
|
||||
attr: 'averageTemperature',
|
||||
unit: '℃'
|
||||
},
|
||||
{
|
||||
label: '绝缘电阻',
|
||||
attr: 'insulationResistance',
|
||||
unit: 'Ω'
|
||||
},
|
||||
{
|
||||
label: '当前SOC',
|
||||
attr: 'currentSoc',
|
||||
unit: '%'
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
uni.showLoading()
|
||||
this.siteId = this.$route.query.siteId || ''
|
||||
getBMSBatteryCluster({
|
||||
siteId: this.siteId
|
||||
}).then(response => {
|
||||
this.list = response?.data || []
|
||||
if (this.list.length > 0) {
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.collapse.resize()
|
||||
uni.hideLoading()
|
||||
}, 100)
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.uni-collapse-item__wrap {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.running {
|
||||
.uni-collapse-item__title-text {
|
||||
color: #05AEA3;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: #05AEA3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.danger {
|
||||
.uni-collapse-item__title-text {
|
||||
color: #FC6B69;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: #FC6B69;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user