操作调整

This commit is contained in:
fan 2020-06-12 16:15:20 +08:00
parent 71a99f225c
commit 8fc521a780
2 changed files with 38 additions and 81 deletions

View File

@ -238,125 +238,76 @@ export default {
},
//
split() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.split.menu.operation,
param: {
sectionCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.split, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(step, this.selected);
this.$refs.sectionControl.doShow(operate, this.selected);
}
});
},
//
active() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.active.menu.operation,
param: {
sectionCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.active, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(step, this.selected);
this.$refs.sectionControl.doShow(operate, this.selected);
}
});
},
//
axlePreReset() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.axlePreReset, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(step, this.selected);
this.$refs.sectionCmdControl.doShow(operate, this.selected);
}
});
},
//
lock() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.lock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.lock, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(step, this.selected);
this.$refs.sectionControl.doShow(operate, this.selected);
}
});
},
//
unlock() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.unlock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.unlock, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(step, this.selected);
this.$refs.sectionCmdControl.doShow(operate, this.selected);
}
});
},
//
setSpeed() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Section.setSpeed, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(step, this.selected);
this.$refs.speedCmdControl.doShow(operate, this.selected);
}
});
},
//
cancelSpeed() {
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 }) => {
commitOperate(menuOperate.Section.cancelSpeed, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
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);
});
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

@ -18,7 +18,13 @@ class CommandHandle {
Common: {
Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Train_Init_Plan: {operate: 'Train_Init_Plan', paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}]}
Train_Init_Plan: {
operate: 'Train_Init_Plan',
paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}],
simulationRole: 'Center',
controlMode: ['OperateCenterControl'],
conditionList: []
}
}
};
(list || []).forEach(definition => {