This commit is contained in:
fan 2020-08-25 09:25:50 +08:00
commit 664e174fcf

View File

@ -86,6 +86,9 @@ export default {
selectedObj: null, selectedObj: null,
oldClickObj: null, // oldClickObj: null, //
route: null, // route: null, //
atpRoute:null,
groundRoute:null,
guideRoute:null,
centralizedStationList: new Array(15).fill({}), centralizedStationList: new Array(15).fill({}),
ciStationParamList: [], ciStationParamList: [],
// startVirtual: false, // startVirtual: false,
@ -194,14 +197,28 @@ export default {
}, },
clickCommand(row) { clickCommand(row) {
this.clearAllMenuShow(); this.clearAllMenuShow();
const setList = ['ATP进路', '联锁进路', '引导进路'];
const cancleList = ['取消ATP', '取消联锁', '取消引导'];
const routeList = [this.atpRoute, this.groundRoute, this.guideRoute];
const setIndex = setList.indexOf(row.name);
const cancleIndex = cancleList.indexOf(row.name);
let currentIndex = -1;
const step = {};
if (setIndex >= 0) { currentIndex = setIndex; }
if (cancleIndex >= 0) { currentIndex = cancleIndex; }
if (currentIndex >= 0) {
this.route = routeList[currentIndex];
this.tempData.push(this.route);
step.param = {
routeCode: this.route.code
};
}
if (this.tempData.length) { if (this.tempData.length) {
row.show = true; row.show = true;
this.operate = row.operate.operation; this.operate = row.operate.operation;
this.cmdType = row.cmdType; this.cmdType = row.cmdType;
this.canCommand = false; this.canCommand = false;
const step = { step.operation = this.operate;
operation: this.operate
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -275,24 +292,45 @@ export default {
this.centralizedStationList[index] = swicth; this.centralizedStationList[index] = swicth;
}); });
this.tempData = []; this.tempData = [];
this.tempData.push(this.route); // this.tempData.push(this.route);
this.param = { // this.param = {
routeCode: this.route.code // routeCode: this.route.code
}; // };
}, },
// //
checkSignal() { checkSignal() {
this.route = null; this.route = null;
this.atpRoute = null;
this.groundRoute = null;
this.guideRoute = null;
this.atp = false;
this.ground = false;
this.guide = false;
this.routeList.forEach(item => { this.routeList.forEach(item => {
if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selectedObj.code) { if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selectedObj.code) {
if (!this.atp) {
if (item.atp) {
this.atpRoute = item;
}
this.atp = item.atp; this.atp = item.atp;
}
if (!this.ground) {
if (item.ground) {
this.groundRoute = item;
}
this.ground = item.ground; this.ground = item.ground;
}
if (!this.guide) {
if (item.guide) {
this.guideRoute = item;
}
this.guide = item.guide; this.guide = item.guide;
this.route = item; }
// this.route = {};
this.initRouteMenus(); this.initRouteMenus();
} }
}); });
if (this.route && this.route.code) { if (this.atpRoute || this.groundRoute || this.guideRoute) {
this.handleRouteMenu(); this.handleRouteMenu();
this.deviceHighLight(this.selectedObj, true); this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj; this.oldDevice = this.selectedObj;