实训调整
This commit is contained in:
parent
6498f68295
commit
6667adca07
@ -134,18 +134,9 @@ export default {
|
||||
},
|
||||
'$store.state.training.prdType': function (val) {
|
||||
if (val == '01' && this.centralizedStationList1.length) {
|
||||
this.switchShowStation(this.centralizedStationList1[0].code);
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationList1[0].code);
|
||||
} else {
|
||||
this.switchShowStation('');
|
||||
}
|
||||
},
|
||||
'$store.state.training.offsetStationCode': function(code) {
|
||||
if (code) {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (sectionModel._type == 'Section' || sectionModel._type == 'Switch' || sectionModel._type == 'Signal') {
|
||||
const stationModel = this.$store.getters['map/getDeviceByCode'](sectionModel.stationCode);
|
||||
this.switchShowStation(stationModel.code);
|
||||
}
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', '');
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -176,20 +167,12 @@ export default {
|
||||
this.stationCode = centralizedStationList[0].code;
|
||||
}
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
this.switchShowStation(this.stationCode);
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', this.stationCode);
|
||||
}
|
||||
},
|
||||
switchShowStation(stationCode) {
|
||||
this.stationCode = stationCode;
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
if (item !== 'skinVO') {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
this.$jlmap.setCenter(stationCode);
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', stationCode);
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
|
@ -203,7 +203,8 @@ const map = {
|
||||
mousemove: 0, // 实训战场图移动标识
|
||||
version: '', // 地图版本,
|
||||
trainListUpdate:0, // 列车列表更新标识,
|
||||
runPlanStatus:false // 是否正处于按计划行车
|
||||
runPlanStatus:false, // 是否正处于按计划行车
|
||||
showCentralizedStationCode: '' // 现地分集中站显示(集中站code)
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -714,6 +715,9 @@ const map = {
|
||||
},
|
||||
setRunPlanStatus:(state, runPlanStatus) => {
|
||||
state.runPlanStatus = runPlanStatus;
|
||||
},
|
||||
setShowCentralizedStationCode: (state, stationCode) => {
|
||||
state.showCentralizedStationCode = stationCode;
|
||||
}
|
||||
},
|
||||
|
||||
@ -880,6 +884,9 @@ const map = {
|
||||
},
|
||||
setRunPlanStatus:({commit}, runPlanStatus) => {
|
||||
commit('setRunPlanStatus', runPlanStatus);
|
||||
},
|
||||
setShowCentralizedStationCode: ({commit}, stationCode) => {
|
||||
commit('setShowCentralizedStationCode', stationCode);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -148,7 +148,7 @@ export default {
|
||||
group: '',
|
||||
showStation: '',
|
||||
stationList: [],
|
||||
showSelectStation: false,
|
||||
showSelectStation: false, // 是否展示现地选择设备集中站select
|
||||
prdTypeMap: {
|
||||
'01': '01', // 现地 => 现地
|
||||
'02': '02', // 行调 => 行调
|
||||
@ -234,7 +234,7 @@ export default {
|
||||
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation);
|
||||
this.switchStationMode(this.showStation);
|
||||
},
|
||||
'$store.state.map.mousemove': function (val) {
|
||||
this.mousemove();
|
||||
@ -261,32 +261,6 @@ export default {
|
||||
'$store.state.map.map': function (val) {
|
||||
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
||||
this.showSelectStation && this.setStationList(val);
|
||||
},
|
||||
'$store.state.training.offsetStationCode': function(code) {
|
||||
if (code) {
|
||||
this.setCenter(code);
|
||||
}
|
||||
if (code && this.showSelectStation) {
|
||||
const deviceModel = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (deviceModel._type == 'Section' || deviceModel._type == 'Switch' || deviceModel._type == 'Signal' || deviceModel._type == 'Switch') {
|
||||
const stationModel = this.$store.getters['map/getDeviceByCode'](deviceModel.stationCode);
|
||||
this.switchStationMode(stationModel.code, true);
|
||||
} else if (deviceModel._type === 'Station') {
|
||||
let stationModel = '';
|
||||
if (deviceModel.centralized) {
|
||||
stationModel = deviceModel;
|
||||
} else {
|
||||
this.$store.state.map.map.stationList || [].forEach(item => {
|
||||
item.chargeStationCodeList || [].forEach(it => {
|
||||
if (it === deviceModel.code) {
|
||||
stationModel = item;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.switchStationMode(stationModel.code, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@ -612,9 +586,9 @@ export default {
|
||||
panel.setAttribute('style', '');
|
||||
}
|
||||
},
|
||||
switchStationMode(val, isTraining) {
|
||||
switchStationMode(val) {
|
||||
this.showStation = val;
|
||||
this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation, isTraining);
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
|
||||
},
|
||||
setStationList(val) {
|
||||
this.stationList = [];
|
||||
|
@ -69,7 +69,8 @@ export default {
|
||||
concentrationStationList: [],
|
||||
showMode: '03',
|
||||
localStationShow: false,
|
||||
previewOrMapDraw: false
|
||||
previewOrMapDraw: false,
|
||||
trainingSetStation: false // 现地实训是否根据设备仅显示设备集中站设备
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -135,6 +136,33 @@ export default {
|
||||
},
|
||||
'$store.state.training.prdType': function (val) {
|
||||
this.changePrdType(val);
|
||||
},
|
||||
'$store.state.map.showCentralizedStationCode': function (val) {
|
||||
this.setShowStation(val);
|
||||
},
|
||||
'$store.state.training.offsetStationCode': function(code) {
|
||||
if (code && this.localStationShow && this.$store.state.training.prdType === '01') {
|
||||
const deviceModel = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (deviceModel._type == 'Section' || deviceModel._type == 'Switch' || deviceModel._type == 'Signal' || deviceModel._type == 'Switch') {
|
||||
const stationModel = this.$store.getters['map/getDeviceByCode'](deviceModel.stationCode);
|
||||
this.setShowStation(stationModel.code, true);
|
||||
} else if (deviceModel._type === 'Station') {
|
||||
let stationModel = '';
|
||||
if (deviceModel.centralized) {
|
||||
stationModel = deviceModel;
|
||||
} else {
|
||||
this.$store.state.map.map.stationList || [].forEach(item => {
|
||||
item.chargeStationCodeList || [].forEach(it => {
|
||||
if (it === deviceModel.code) {
|
||||
stationModel = item;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.setShowStation(stationModel.code, true);
|
||||
}
|
||||
this.setCenter(code);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -165,9 +165,6 @@ export default {
|
||||
mapViewLoaded(loading) {
|
||||
this.$refs.jlmapVisual && this.$refs.jlmapVisual.mapViewLoaded(loading);
|
||||
},
|
||||
setShowStation(stationCode, isTraining) {
|
||||
this.$refs.jlmapVisual && this.$refs.jlmapVisual.setShowStation(stationCode, isTraining);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$refs.jlmapVisual && this.$refs.jlmapVisual.setCenter(code);
|
||||
}
|
||||
|
@ -111,9 +111,6 @@ export default {
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||
},
|
||||
setShowStation(stationCode, isTraining) {
|
||||
this.$refs.mapCommon && this.$refs.mapCommon.setShowStation(stationCode, isTraining);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user