|
|
@@ -2,6 +2,7 @@
|
|
|
<c-dialog
|
|
|
ref="dialog"
|
|
|
title="配电箱"
|
|
|
+ size="lg fixed"
|
|
|
@closed="onClose"
|
|
|
>
|
|
|
<template #default>
|
|
|
@@ -36,11 +37,18 @@
|
|
|
@change="onModeChange"
|
|
|
>定时</el-radio>
|
|
|
</div>
|
|
|
- <schema-table
|
|
|
- ref="table"
|
|
|
- class="c-sibling-item--v"
|
|
|
- :schema="schema"
|
|
|
- />
|
|
|
+ <div class="l-flex l-flex__self c-sibling-item--v c-step">
|
|
|
+ <schema-table
|
|
|
+ ref="reportTable"
|
|
|
+ class="l-flex__none c-step__column u-width--lg"
|
|
|
+ :schema="reoirtSchema"
|
|
|
+ />
|
|
|
+ <schema-table
|
|
|
+ ref="table"
|
|
|
+ class="c-step__column"
|
|
|
+ :schema="schema"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</c-dialog>
|
|
|
</template>
|
|
|
@@ -57,15 +65,23 @@ import {
|
|
|
|
|
|
const ELECTRIC_ID = 1
|
|
|
|
|
|
+const SWITCH_KEY = 'S10'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'PowerBoxConfigDialog',
|
|
|
data () {
|
|
|
return {
|
|
|
identifier: '',
|
|
|
- switchKey: 'S10',
|
|
|
- allSwitch: false,
|
|
|
mode: '',
|
|
|
- strategies: [],
|
|
|
+ reoirtSchema: {
|
|
|
+ nonPagination: true,
|
|
|
+ autoRefresh: true,
|
|
|
+ list: this.getReports,
|
|
|
+ cols: [
|
|
|
+ { prop: 'name', label: '参数', align: 'center' },
|
|
|
+ { prop: 'value', label: '', align: 'center' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
schema: {
|
|
|
nonPagination: true,
|
|
|
autoRefresh: true,
|
|
|
@@ -134,6 +150,37 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getReports () {
|
|
|
+ return electricQuery({
|
|
|
+ electricId: ELECTRIC_ID,
|
|
|
+ commandKey: 17,
|
|
|
+ queryMode: 1
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data[0]) {
|
|
|
+ const valueMap = data[0]
|
|
|
+ return { data: [
|
|
|
+ { key: 'totalEnergy', name: '总电能' },
|
|
|
+ { key: 'temp', name: '温度', unit: '℃' },
|
|
|
+ { key: 'earthWireTemp1', name: '零线1温度', unit: '℃' },
|
|
|
+ { key: 'earthWireTemp2', name: '零线2温度', unit: '℃' },
|
|
|
+ { key: 'humidity', name: '电箱湿度', unit: 'RH' },
|
|
|
+ { key: 'smog', name: '电箱烟雾' },
|
|
|
+ { key: 'phaseVoltageU', name: 'U相电压', unit: 'V' },
|
|
|
+ { key: 'phaseCurrentU', name: 'U相电流', unit: 'A' },
|
|
|
+ { key: 'phaseVoltageV', name: 'V相电压', unit: 'V' },
|
|
|
+ { key: 'phaseCurrentV', name: 'V相电流', unit: 'A' },
|
|
|
+ { key: 'phaseVoltageW', name: 'W电电压', unit: 'V' },
|
|
|
+ { key: 'phaseCurrentW', name: 'W相电流', unit: 'A' }
|
|
|
+ ].map(({ key, name, unit }) => {
|
|
|
+ return {
|
|
|
+ key, name,
|
|
|
+ value: unit ? `${valueMap[key]}${unit}` : valueMap[key]
|
|
|
+ }
|
|
|
+ }) }
|
|
|
+ }
|
|
|
+ return { data: [] }
|
|
|
+ })
|
|
|
+ },
|
|
|
getPorts () {
|
|
|
return electricQuery({
|
|
|
electricId: ELECTRIC_ID,
|
|
|
@@ -168,6 +215,7 @@ export default {
|
|
|
id: ELECTRIC_ID,
|
|
|
identifier: this.identifier
|
|
|
}).then(this.initPowerBox).then(() => {
|
|
|
+ this.$refs.reportTable.pageTo(1)
|
|
|
this.$refs.table.pageTo(1)
|
|
|
})
|
|
|
},
|
|
|
@@ -198,7 +246,7 @@ export default {
|
|
|
electricControl({
|
|
|
commandKey: 2,
|
|
|
electricId: 1,
|
|
|
- plcSwitch: this.switchKey,
|
|
|
+ plcSwitch: SWITCH_KEY,
|
|
|
status: bool ? 1 : 0
|
|
|
}).then(() => {
|
|
|
this.$message({
|