This commit is contained in:
zyy 2020-03-12 18:36:13 +08:00
commit 61ad60c365
3 changed files with 86 additions and 84 deletions

View File

@ -51,31 +51,31 @@ export default {
menu: [], menu: [],
menuNormal: { menuNormal: {
Local: [ Local: [
{ // {
label: '区段故障解锁', // label: '',
handler: this.fault, // handler: this.faultUnlock,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK // cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}, // },
{ // {
label: '区段激活', // label: '',
handler: this.active, // handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE // cmdType: CMD.Section.CMD_SECTION_ACTIVE
}, // },
{ // {
label: '区段切除', // label: '',
handler: this.split, // handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF // cmdType: CMD.Section.CMD_SECTION_CUT_OFF
}, // },
{ // {
label: '区段计轴预复位', // label: '',
handler: this.axlePreReset, // handler: this.axlePreReset,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET // cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
}, // },
{ // {
label: '区段设置限速', // label: '',
handler: this.setSpeed, // handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
} // }
], ],
Center: [ Center: [
{ {
@ -172,14 +172,19 @@ export default {
}, },
operationHandler(buttonOperation, selectType) { operationHandler(buttonOperation, selectType) {
switch (buttonOperation) { switch (buttonOperation) {
case OperationEvent.Signal.guide.button.operation: { case OperationEvent.Section.fault.menu.operation: {
// //
if (selectType.fault) {
this.faultUnlock(selectType);
} else {
this.$refs.noticeInfo.doShow({}, `该区段[${selectType.name}(${selectType.code})]没有故障`);
}
break; break;
} }
case OperationEvent.Signal.guide.button.operation: { // case OperationEvent: {
// // //
break; // break;
} // }
} }
}, },
// // // //
@ -205,20 +210,19 @@ export default {
// }); // });
// }, // },
// //
fault() { faultUnlock(selectType) {
const operate = { const operate = {
start: true, start: true,
code: this.selected.code,
operation: OperationEvent.Section.fault.menu.operation, operation: OperationEvent.Section.fault.menu.operation,
param: { param: {
sectionCode: `${this.selected.code}` sectionCode: selectType.code
} },
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected); // this.$refs.sectionCmdControl.doShow(operate, this.selected);
} }
}); });
}, },
@ -299,19 +303,6 @@ export default {
}, },
// //
setSpeed() { setSpeed() {
// let operate = {
// start: true,
// code: this.selected.code,
// type: MapDeviceType.Section.type,
// label: MapDeviceType.Section.label,
// operation: OperationEvent.Section.setLimitSpeed.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.speedCmdControl.doShow(operate, this.selected);
// }
// });
const operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,

View File

@ -218,6 +218,13 @@ export default {
} }
case OperationEvent.Signal.reopenSignal.button.operation: { case OperationEvent.Signal.reopenSignal.button.operation: {
// //
if (selectType.greenOpen) {
this.$refs.noticeInfo.doShow({}, `信号机[${selectType.name}(${selectType.code})]已开启,无需重开信号机`);
} else {
//
this.reopenSignalByRoute(selectType);
//
}
break; break;
} }
case OperationEvent.Signal.guide.button.operation: { case OperationEvent.Signal.guide.button.operation: {
@ -335,6 +342,27 @@ export default {
} }
}); });
}, },
//
reopenSignalByRoute(selectType) {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
param: {
signalCode: selectType.code
},
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
// //
reopenSignal() { reopenSignal() {
const operate = { const operate = {

View File

@ -306,42 +306,25 @@ export default {
} }
}); });
}, },
//
fault() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.fault.menu.operation,
param: {
switchCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
}
});
},
// //
cancelSpeed() { // cancelSpeed() {
const operate = { // const operate = {
start: true, // start: true,
send: true, // send: true,
code: this.selected.code, // code: this.selected.code,
operation: OperationEvent.Switch.cancelSpeed.menu.operation, // operation: OperationEvent.Switch.cancelSpeed.menu.operation,
param: { // param: {
switchCode: `${this.selected.code}` // switchCode: `${this.selected.code}`
} // }
}; // };
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { // this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) { // if (valid) {
const tempData = response.data; // const tempData = response.data;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData); // this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
} // }
}); // });
}, // },
// //
split() { split() {