仿真右侧列车列表调整

福州线操作代码调整
This commit is contained in:
joylink_cuiweidong 2020-06-22 14:29:55 +08:00
parent 717e04c4c5
commit 5580a79344
8 changed files with 73 additions and 134 deletions

View File

@ -423,7 +423,7 @@ class Jlmap {
} else { } else {
if (elem.deviceType === 'TRAIN') { if (elem.deviceType === 'TRAIN') {
this.isUpdateShowTrainList = true; this.isUpdateShowTrainList = true;
store.dispatch('map/updateTrainList', elem); store.dispatch('map/updateActiveTrainList', elem);
// store.dispatch('map/updateTrainState', elem); // store.dispatch('map/updateTrainState', elem);
} else if (elem.deviceType === 'STAND') { } else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem); store.dispatch('map/updateStationStand', elem);

View File

@ -297,23 +297,6 @@ export default {
this.$refs.speedCmdControl.doShow(operate, this.selected); this.$refs.speedCmdControl.doShow(operate, this.selected);
} }
}); });
// const step = {
// start: true,
// code: `${this.selected.code}`,
// operation: OperationEvent.Section.cancelSpeed.menu.operation,
// param: {
// Section_Code: `${this.selected.code}`
// }
// };
// this.$store.dispatch('training/next', step).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Section.CMD_QUERY, {}).then(resp => {
// const tempData = resp.data;
// this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
// });
// }
// });
} }
} }
}; };

View File

@ -19,6 +19,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default { export default {
name: 'StationMenu', name: 'StationMenu',
@ -197,107 +198,47 @@ export default {
}, },
// //
setAutoTrigger() { setAutoTrigger() {
const step = { commitOperate(menuOperate.Station.setAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
start: true, }).catch(error=>{
code: `${this.selected.code}`, this.$refs.noticeInfo.doShow(error.message);
operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
}); });
}, },
// //
cancelAutoTrigger() { cancelAutoTrigger() {
const step = { commitOperate(menuOperate.Station.cancelAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
start: true, }).catch(error=>{
code: `${this.selected.code}`, this.$refs.noticeInfo.doShow(error.message);
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
}); });
}, },
// //
powerUnLock() { powerUnLock() {
const step = { commitOperate(menuOperate.Station.powerUnLock, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.powerUnLock.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationCmdControl.doShow(operate, this.selected);
this.$refs.stationCmdControl.doShow(step, this.selected);
} }
}); });
}, },
// //
execKeyOperationTest() { execKeyOperationTest() {
const step = { commitOperate(menuOperate.Station.execKeyOperationTest, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationCmdControl.doShow(operate, this.selected);
this.$refs.stationCmdControl.doShow(step, this.selected);
} }
}); });
}, },
// //
humanControlALL() { humanControlALL() {
const step = { commitOperate(menuOperate.Station.humanControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.humanControlALL.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationHumanControlAll.doShow(operate, this.selected);
this.$refs.stationHumanControlAll.doShow(step);
} }
}); });
}, },
// //
atsAutoControlALL() { atsAutoControlALL() {
const step = { commitOperate(menuOperate.Station.atsAutoControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
this.$refs.stationSetRouteControlAll.doShow(step, this.selected);
} }
}); });
} }

View File

@ -206,6 +206,7 @@ const map = {
mousemove: 0, // 实训战场图移动标识 mousemove: 0, // 实训战场图移动标识
version: '', // 地图版本, version: '', // 地图版本,
activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识 activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识
activeTrainList:[], // 当前按计划行车的列车列表
runPlanStatus:false, // 是否正处于按计划行车 runPlanStatus:false, // 是否正处于按计划行车
showCentralizedStationCode: '', // 现地分集中站显示(集中站code) showCentralizedStationCode: '', // 现地分集中站显示(集中站code)
showCentralizedStationNum: 0, // 现地分集中站显示判断 showCentralizedStationNum: 0, // 现地分集中站显示判断
@ -731,6 +732,7 @@ const map = {
}, },
resetActiveTrainList:(state) => { resetActiveTrainList:(state) => {
state.activeTrainListUpdate = 0; state.activeTrainListUpdate = 0;
state.activeTrainList = [];
}, },
setDeleteCount: (state) => { setDeleteCount: (state) => {
state.deleteCount++; state.deleteCount++;
@ -830,13 +832,14 @@ const map = {
} }
}); });
}, },
updateTrainList: (state, data)=>{ updateActiveTrainList: (state, data)=>{
const trainList = state.map.trainList; let isExist = false;
trainList.forEach(elem => { state.activeTrainList.forEach(elem => {
if (elem.code == data.code) { if (elem == data.code) {
elem = deepAssign(elem || {}, data); isExist = true;
} }
}); });
if (!isExist) { state.activeTrainList.push(data.code); }
} }
}, },
@ -911,9 +914,9 @@ const map = {
} }
}, },
// 更新列车信息 // 更新激活的列车信息
updateTrainList:({ commit }, train) => { updateActiveTrainList:({ commit }, train) => {
commit('updateTrainList', train); commit('updateActiveTrainList', train);
}, },
setMapDataIdList: ({ state }, data) => { setMapDataIdList: ({ state }, data) => {

View File

@ -221,6 +221,7 @@ export default {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/setRunPlanStatus', false); this.$store.dispatch('map/setRunPlanStatus', false);
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/clearJlmapTrainView'); this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}); });

View File

@ -71,19 +71,26 @@ export default {
watch:{ watch:{
'$store.state.map.activeTrainListUpdate': function (val) { '$store.state.map.activeTrainListUpdate': function (val) {
if (val) { if (val) {
const trainList = this.$store.state.map.map.trainList; const activeTrainList = this.$store.state.map.activeTrainList;
if (this.lineCode == '10' || this.lineCode == '11') { if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{ this.topTrainList = [];
this.bottomTrainList = [];
activeTrainList.forEach((trainCode)=>{
// train.serviceNumber != '' && train.serviceNumber != undefined && // train.serviceNumber != '' && train.serviceNumber != undefined &&
return !train.right && train.sectionCode; const train = this.$store.getters['map/getDeviceByCode'](trainCode);
}); if (train && !train.right && train.sectionCode) {
this.bottomTrainList = trainList.filter((train)=>{ this.topTrainList.push(train);
// train.serviceNumber != '' && train.serviceNumber != undefined && } else if (train && train.right && train.sectionCode) {
return train.right && train.sectionCode; this.bottomTrainList.push(train);
}
}); });
} else { } else {
this.trainList = trainList.filter((train)=>{ this.trainList = [];
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode; activeTrainList.forEach((trainCode)=>{
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && train.sectionCode) {
this.trainList.push(train);
}
}); });
} }
} else { } else {
@ -91,11 +98,6 @@ export default {
this.bottomTrainList = []; this.bottomTrainList = [];
this.trainList = []; this.trainList = [];
} }
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
this.$store.dispatch('map/resetActiveTrainList');
}
} }
}, },
mounted() { mounted() {
@ -116,11 +118,14 @@ export default {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
covert(data) { covert(data) {
let min = (Math.abs(data) - Math.abs(data) % 60) / 60; const absData = Math.abs(data);
let seconds = Math.abs(data) % 60; const hours = Math.floor(absData / 3600);
let min = Math.floor((absData % 3600) / 60);
let seconds = (absData % 3600) % 60;
min = min > 9 ? min : '0' + min; min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds; seconds = seconds > 9 ? seconds : '0' + seconds;
return data == 0 ? '00:00' : (data > 0 ? min + ':' + seconds + 'E' : min + ':' + seconds + 'L'); const time = hours + ':' + min + ':' + seconds;
return data == 0 ? '00:00:00' : (data > 0 ? time + 'E' : time + 'L');
} }
} }
}; };

View File

@ -296,6 +296,7 @@ export default {
}).catch(() => { }).catch(() => {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
this.isDisable = true; this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList');
this.$messageBox(this.$t('error.endSimulationFailed')); this.$messageBox(this.$t('error.endSimulationFailed'));
}); });
}); });

View File

@ -71,17 +71,26 @@ export default {
watch:{ watch:{
'$store.state.map.activeTrainListUpdate': function (val) { '$store.state.map.activeTrainListUpdate': function (val) {
if (val) { if (val) {
const trainList = this.$store.state.map.map.trainList; const activeTrainList = this.$store.state.map.activeTrainList;
if (this.lineCode == '10' || this.lineCode == '11') { if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{ this.topTrainList = [];
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode; this.bottomTrainList = [];
}); activeTrainList.forEach((trainCode)=>{
this.bottomTrainList = trainList.filter((train)=>{ // train.serviceNumber != '' && train.serviceNumber != undefined &&
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode; const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && !train.right && train.sectionCode) {
this.topTrainList.push(train);
} else if (train && train.right && train.sectionCode) {
this.bottomTrainList.push(train);
}
}); });
} else { } else {
this.trainList = trainList.filter((train)=>{ this.trainList = [];
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode; activeTrainList.forEach((trainCode)=>{
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && train.sectionCode) {
this.trainList.push(train);
}
}); });
} }
} else { } else {
@ -89,11 +98,6 @@ export default {
this.bottomTrainList = []; this.bottomTrainList = [];
this.trainList = []; this.trainList = [];
} }
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
this.$store.dispatch('map/resetActiveTrainList');
}
} }
}, },
mounted() { mounted() {
@ -114,9 +118,10 @@ export default {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
covert(data) { covert(data) {
const hours = Math.floor(data / 3600); const absData = Math.abs(data);
let min = Math.floor((data % 3600) / 60); const hours = Math.floor(absData / 3600);
let seconds = (data % 3600) % 60; let min = Math.floor((absData % 3600) / 60);
let seconds = (absData % 3600) % 60;
min = min > 9 ? min : '0' + min; min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds; seconds = seconds > 9 ? seconds : '0' + seconds;
const time = hours + ':' + min + ':' + seconds; const time = hours + ':' + min + ':' + seconds;