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,
oldClickObj: null, //
route: null, //
atpRoute:null,
groundRoute:null,
guideRoute:null,
centralizedStationList: new Array(15).fill({}),
ciStationParamList: [],
// startVirtual: false,
@ -194,14 +197,28 @@ export default {
},
clickCommand(row) {
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) {
row.show = true;
this.operate = row.operate.operation;
this.cmdType = row.cmdType;
this.canCommand = false;
const step = {
operation: this.operate
};
step.operation = this.operate;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -275,24 +292,45 @@ export default {
this.centralizedStationList[index] = swicth;
});
this.tempData = [];
this.tempData.push(this.route);
this.param = {
routeCode: this.route.code
};
// this.tempData.push(this.route);
// this.param = {
// routeCode: this.route.code
// };
},
//
checkSignal() {
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 => {
if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selectedObj.code) {
this.atp = item.atp;
this.ground = item.ground;
this.guide = item.guide;
this.route = item;
if (!this.atp) {
if (item.atp) {
this.atpRoute = item;
}
this.atp = item.atp;
}
if (!this.ground) {
if (item.ground) {
this.groundRoute = item;
}
this.ground = item.ground;
}
if (!this.guide) {
if (item.guide) {
this.guideRoute = item;
}
this.guide = item.guide;
}
// this.route = {};
this.initRouteMenus();
}
});
if (this.route && this.route.code) {
if (this.atpRoute || this.groundRoute || this.guideRoute) {
this.handleRouteMenu();
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;