Files
emsfront/src/views/ems/dzjk/sbjk/db/index.vue

238 lines
6.6 KiB
Vue
Raw Normal View History

<template>
2025-08-15 14:13:54 +08:00
<div v-loading="loading">
2025-12-12 17:38:26 +08:00
<el-card
v-for="(item,index) in list"
:key="index+'dbList'"
shadow="always"
class="sbjk-card-container list"
:class="{
2026-01-23 21:46:02 +08:00
'timing-card-container':!['0','2'].includes(item.emsCommunicationStatus),
'warning-card-container':item.emsCommunicationStatus === '2',
2025-09-26 14:47:45 +08:00
'running-card-container':item.emsCommunicationStatus === '0'
2025-09-10 09:54:29 +08:00
}"
2025-12-12 17:38:26 +08:00
>
<div slot="header">
<span class="large-title">{{ item.deviceName }}</span>
<div class="info">
<div>
{{
2026-01-23 21:46:02 +08:00
communicationStatusOptions[item.emsCommunicationStatus] || '-'
2025-12-12 17:38:26 +08:00
}}
</div>
2026-01-23 21:46:02 +08:00
<div>数据更新时间{{ item.dataUpdateTime || '-' }}</div>
2025-12-12 17:38:26 +08:00
</div>
<div class="alarm">
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
详细
</el-button>
<el-badge :value="item.alarmNum || 0" class="item">
<i
class="el-icon-message-solid alarm-icon"
@click="pointDetail(item,'alarmPoint')"
></i>
</el-badge>
</div>
</div>
<el-row class="device-info-row">
2026-01-23 14:18:22 +08:00
<el-col v-for="(tempDataItem,tempDataIndex) in (deviceIdTypeMsg[item.deviceId] || otherTypeMsg)"
:key="tempDataIndex+'dbTempData'"
:span="8" class="device-info-col">
<span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceId)">
2026-01-13 16:38:21 +08:00
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] || '-' }}<span
2025-12-12 17:38:26 +08:00
v-html="tempDataItem.unit"></span></span>
</span>
2026-01-23 14:18:22 +08:00
</el-col>
2025-12-12 17:38:26 +08:00
</el-row>
</el-card>
2025-09-26 14:47:45 +08:00
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
2025-09-13 20:36:46 +08:00
<point-chart ref="pointChart" :site-id="siteId"/>
2025-11-25 17:56:12 +08:00
<point-table ref="pointTable"/>
2025-08-15 14:13:54 +08:00
</div>
</template>
<script>
2025-09-13 20:36:46 +08:00
import pointChart from "./../PointChart.vue";
2025-06-30 17:32:04 +08:00
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
2025-12-12 17:38:26 +08:00
import {getAmmeterDataList} from "@/api/ems/dzjk";
2025-09-10 09:54:29 +08:00
import intervalUpdate from "@/mixins/ems/intervalUpdate";
2025-11-25 17:56:12 +08:00
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
2026-01-23 21:46:02 +08:00
import {mapState} from "vuex";
2025-12-12 17:38:26 +08:00
export default {
2025-08-15 14:13:54 +08:00
name: "DzjkSbjkDb",
2025-12-12 17:38:26 +08:00
mixins: [getQuerySiteId, intervalUpdate],
components: {PointTable, pointChart},
2026-01-23 21:46:02 +08:00
computed: {
...mapState({
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
})
},
data() {
return {
2025-08-15 14:13:54 +08:00
loading: false,
2025-12-12 17:38:26 +08:00
list: [],
deviceIdTypeMsg: {
'LOAD': [
{
2025-12-12 17:38:26 +08:00
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能',
unit: 'kWh'
},
{
2025-12-12 17:38:26 +08:00
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能',
unit: 'kWh'
},
{
2025-12-12 17:38:26 +08:00
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能',
unit: 'kvarh'
},
{
2025-12-12 17:38:26 +08:00
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能',
unit: 'kvarh'
},
{
2025-12-12 17:38:26 +08:00
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率',
unit: 'kW'
},
{
2025-12-12 17:38:26 +08:00
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率',
unit: 'kvar'
}
],
2025-12-12 17:38:26 +08:00
'METE': [
{
2025-12-12 17:38:26 +08:00
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能',
unit: 'kWh'
},
{
2025-12-12 17:38:26 +08:00
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能',
unit: 'kWh'
},
{
2025-12-12 17:38:26 +08:00
name: '正向无功电能',
attr: 'forwardReactive',
pointName: '正向无功电能',
unit: 'kvarh'
},
{
2025-12-12 17:38:26 +08:00
name: '反向无功电能',
attr: 'reverseReactive',
pointName: '反向无功电能',
unit: 'kvarh'
},
{
2025-12-12 17:38:26 +08:00
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率',
unit: 'kW'
},
{
2025-12-12 17:38:26 +08:00
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率',
unit: 'kvar'
}
],
2025-12-12 17:38:26 +08:00
'METEGF': [
{
2025-12-12 17:38:26 +08:00
name: '有功电能',
attr: 'activeEnergy',
pointName: '有功电能',
unit: 'kWh'
},
{
2025-12-12 17:38:26 +08:00
name: '无功电能',
attr: 'reactiveEnergy',
pointName: '无功电能',
unit: 'kvarh'
},
{
2025-12-12 17:38:26 +08:00
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率',
unit: 'kW'
},
{
2025-12-12 17:38:26 +08:00
name: '无功功率',
attr: 'reactivePower',
pointName: '总无功功率',
unit: 'kvar'
}
]
2026-01-23 14:18:22 +08:00
},
otherTypeMsg: [
{
name: '正向有功电能',
attr: 'forwardActive',
pointName: '正向有功电能',
unit: 'kWh'
},
{
name: '反向有功电能',
attr: 'reverseActive',
pointName: '反向有功电能',
unit: 'kWh'
},
{
name: '有功功率',
attr: 'activePower',
pointName: '总有功功率',
unit: 'kW'
},
]
2025-08-15 14:13:54 +08:00
};
},
2025-08-15 14:13:54 +08:00
methods: {
2025-11-25 17:56:12 +08:00
// 查看设备电位表格
2025-12-12 17:38:26 +08:00
pointDetail(row, dataType) {
2025-11-25 17:56:12 +08:00
const {deviceId} = row
2025-12-12 17:38:26 +08:00
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'AMMETER'}, dataType)
2025-11-25 17:56:12 +08:00
},
2025-12-12 17:38:26 +08:00
showChart(pointName, deviceId) {
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'AMMETER', deviceId})
2025-09-13 20:36:46 +08:00
},
2025-12-12 17:38:26 +08:00
updateData() {
2025-08-15 14:13:54 +08:00
this.loading = true;
getAmmeterDataList(this.siteId)
2025-09-10 09:54:29 +08:00
.then((response) => {
2025-09-26 14:47:45 +08:00
this.list = response?.data || []
2025-09-10 09:54:29 +08:00
})
.finally(() => {
this.loading = false;
});
},
init() {
this.updateData()
this.updateInterval(this.updateData)
2025-08-15 14:13:54 +08:00
},
},
2025-12-12 17:38:26 +08:00
mounted() {
},
2025-08-15 14:13:54 +08:00
};
</script>
<style scoped lang="scss">
.sbjk-card-container {
2025-12-12 17:38:26 +08:00
&.list:not(:last-child) {
2025-09-26 14:47:45 +08:00
margin-bottom: 25px;
}
}
2025-09-17 14:52:08 +08:00
</style>