区域选择界面调整
This commit is contained in:
parent
52af1d994b
commit
34a94e2c6d
@ -30,9 +30,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="车站名" align="center" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="control" label="控制状态" align="center" width="70">
|
||||
<el-table-column prop="controller" label="控制状态" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ getControlStatus(scope.row.code) }}</div>
|
||||
<div>{{ getControlStatus(scope.row.controller) }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationCode" label="" align="center">
|
||||
@ -93,9 +93,12 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapStateLoadedCount': function () {
|
||||
'$store.state.map.mapStationStateUpdateCount': function() {
|
||||
if (this.show) {
|
||||
this.tableData = [...this.tableData];
|
||||
this.tableData.forEach(item => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](item.code);
|
||||
item.controller = station.controller;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -122,24 +125,18 @@ export default {
|
||||
this.memberId = this.$store.state.training.myMemberId;
|
||||
const centralizedStationCode = this.stationCentralizedMap[this.$store.state.training.roleDeviceCode];
|
||||
const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode);
|
||||
this.$set(centralizedStation, 'apply', false);
|
||||
this.$set(centralizedStation, 'release', false);
|
||||
this.$set(centralizedStation, 'distribution', false);
|
||||
this.tableData.push(centralizedStation);
|
||||
const data = { code: centralizedStation.code, name: centralizedStation.name, apply: false, release: false, distribution: false, controller: null };
|
||||
this.tableData.push(data);
|
||||
centralizedStation.chargeStationCodeList.forEach(elem => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](elem);
|
||||
this.$set(station, 'apply', false);
|
||||
this.$set(station, 'release', false);
|
||||
this.$set(station, 'distribution', false);
|
||||
this.tableData.push(station);
|
||||
const data1 = { code: station.code, name: station.name, apply: false, release: false, distribution: false, controller: null };
|
||||
this.tableData.push(data1);
|
||||
});
|
||||
} else if (this.$store.state.training.roles === 'DISPATCHER') {
|
||||
this.memberId = this.$store.state.training.myMemberId;
|
||||
this.stationList.forEach(item => {
|
||||
this.$set(item, 'apply', false);
|
||||
this.$set(item, 'release', false);
|
||||
this.$set(item, 'distribution', false);
|
||||
this.tableData.push(item);
|
||||
const data = { code: item.code, name: item.name, apply: false, release: false, distribution: false, controller: null };
|
||||
this.tableData.push(data);
|
||||
});
|
||||
}
|
||||
this.show = true;
|
||||
@ -154,9 +151,8 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getControlStatus(code) {
|
||||
const newStation = this.$store.getters['map/getDeviceByCode'](code);
|
||||
return newStation.controller === this.memberId ? '自控' : '未控';
|
||||
getControlStatus(controller) {
|
||||
return controller === this.memberId ? '自控' : '未控';
|
||||
},
|
||||
getDisabled(code, type) {
|
||||
const newStation = this.$store.getters['map/getDeviceByCode'](code);
|
||||
@ -172,9 +168,8 @@ export default {
|
||||
}
|
||||
},
|
||||
getController(station) {
|
||||
const newStation = this.$store.getters['map/getDeviceByCode'](station.code);
|
||||
if (newStation.controller) {
|
||||
const controller = this.$store.state.training.memberData[newStation.controller];
|
||||
if (station.controller) {
|
||||
const controller = this.$store.state.training.memberData[station.controller];
|
||||
return controller.label;
|
||||
} else {
|
||||
return '';
|
||||
|
Loading…
Reference in New Issue
Block a user