diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue index 91683e07d..d1508e491 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue @@ -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); + // }); + // } + // }); } } }; diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js index 3846fd5b6..f410f1627 100644 --- a/src/scripts/cmdPlugin/CommandHandler.js +++ b/src/scripts/cmdPlugin/CommandHandler.js @@ -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 => {