佛山一号线 操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-03-30 09:45:23 +08:00
parent ba57262d2a
commit 1a998f405a
2 changed files with 20 additions and 135 deletions

View File

@ -28,6 +28,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
export default {
name: 'StationStandMenu',
@ -236,172 +237,56 @@ export default {
},
//
setDetainTrain() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
param: {
standCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
//
cancelDetainTrain() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
param: {
standCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
//
setJumpStop() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param: {
standCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStopControl.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standJumpStopControl.doShow(data.operate, this.selected);
});
},
//
cancelJumpStop() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param: {
standCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStopControl.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standJumpStopControl.doShow(data.operate, this.selected);
});
},
//
setStopTime() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
param: {
standCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => {
// const tempData = resp.data;
const tempData = [];
this.$refs.standStopTime.doShow(step, this.selected, tempData);
// });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standStopTime.doShow(data.operate, this.selected, []);
});
},
//
setRunLevel() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
param: {
standCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => {
// const tempData = resp.data;
const tempData = [];
this.$refs.standRunLevel.doShow(step, this.selected, tempData);
// });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standRunLevel.doShow(data.operate, this.selected, []);
});
},
//
earlyDeparture() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
param: {
standCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
// 线
cancelDetainTrainAll() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
param: {
standCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standDetainTrainAll.doShow(step, this.selected);
}
commitOperate(menuOperate.StationStand.cancelDetainTrainAll, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standDetainTrainAll.doShow(data.operate, this.selected);
});
},
//
detail() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.detail.menu.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => {
// const tempData = resp.data;
const tempData = [];
this.$refs.standDetail.doShow(step, this.selected, tempData);
// });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standDetail.doShow(data.operate, this.selected, []);
});
}
}