北京一号线 现地 设置进路操作代码调整
This commit is contained in:
parent
264310f28e
commit
494e1fc815
@ -47,6 +47,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
clickNum:0,
|
||||
oldSelected:null,
|
||||
menuNormal: {
|
||||
Local: [
|
||||
// {
|
||||
@ -206,6 +208,23 @@ export default {
|
||||
switch (buttonOperation) {
|
||||
case OperationEvent.Signal.arrangementRoute.button.operation: {
|
||||
// 进路建立
|
||||
if (this.clickNum >= 1) {
|
||||
let route = null;
|
||||
this.routeList.forEach(elem => {
|
||||
if (elem.startSignalCode === this.oldSelected.code && elem.endSignalCode === selectType.code) {
|
||||
route = elem;
|
||||
}
|
||||
});
|
||||
if (route) {
|
||||
this.setRoute(route);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow({}, `没有以[${this.oldSelected.name}(${this.oldSelected.code})]为始端信号机,以[${selectType.name}(${selectType.code})] 为终端信号机的进路`);
|
||||
}
|
||||
this.clickNum = 0;
|
||||
} else {
|
||||
this.oldSelected = selectType;
|
||||
this.clickNum++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.cancelTrainRoute.button.operation: {
|
||||
@ -325,6 +344,23 @@ export default {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 现地设置进路
|
||||
setRoute(route) {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
|
||||
param: {
|
||||
routeCode: route.code
|
||||
},
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 取消进路
|
||||
cancelTrainRoute() {
|
||||
const operate = {
|
||||
|
Loading…
Reference in New Issue
Block a user