- 电
+
+ 蒸汽
水
-
+
压缩空气
-
- 蒸汽
-
-
氮气
+
+ 电
+
{{ deviceOverviewData.deviceSum }}
@@ -112,7 +112,7 @@
设备名称
- A相电流
+ {{ currentTypeMeta.field1Label }}
@@ -121,7 +121,7 @@
- A相电压
+ {{ currentTypeMeta.field2Label }}
@@ -146,7 +146,7 @@
{{ item.monitorName || '' }}
- {{ item.iA || 0 }}
+ {{ item[currentTypeMeta.field1Key] || 0 }}
- {{ item.vA || 0 }}
+ {{ item[currentTypeMeta.field2Key] || 0 }}
@@ -263,13 +263,23 @@ export default {
computed: {
topRankingData() {
return this.rankingData.slice(0, 5)
+ },
+ currentTypeMeta() {
+ const map = {
+ '2': { rankName: '用电', unit: 'kWh', field1Label: 'A相电流', field2Label: 'A相电压', field1Key: 'iA', field2Key: 'vA' },
+ '3': { rankName: '用水', unit: 'm³', field1Label: '瞬时流量', field2Label: '累计流量', field1Key: 'instantFlow', field2Key: 'cumulativeFlow' },
+ '4': { rankName: '用蒸汽', unit: 't', field1Label: '瞬时流量', field2Label: '累计流量', field1Key: 'instantFlow', field2Key: 'cumulativeFlow' },
+ '5': { rankName: '用压缩空气', unit: 'm³', field1Label: '瞬时流量', field2Label: '累计流量', field1Key: 'instantFlow', field2Key: 'cumulativeFlow' },
+ '6': { rankName: '用氮气', unit: 'm³', field1Label: '瞬时流量', field2Label: '累计流量', field1Key: 'instantFlow', field2Key: 'cumulativeFlow' }
+ }
+ return map[this.typeData] || map['4']
}
},
data() {
return {
selectData: 'year',
- typeData: "2",
+ typeData: "4",
colors: ['#30A0FB', '#00FF89', '#F9E435', '#FB5C2D', '#73c0de'],
chart1TableOption: {
step: 0.5, // 数值越大速度滚动越快
@@ -588,7 +598,7 @@ export default {
},
yAxis: {
type: 'value',
- name: '单位(kwh)',
+ name: `单位(${this.currentTypeMeta.unit})`,
max: function (value) {
return value.max * 1.2;
},