This commit is contained in:
fan 2020-06-19 18:03:02 +08:00
commit 7bf2ce406c
10 changed files with 88 additions and 162 deletions

View File

@ -69,7 +69,7 @@
<script>
import NoticeInfo from '../childDialog/noticeInfo';
import PasswordBox from '../childDialog/passwordInputBox';
import {mouseCancelState} from '../../utils/menuItemStatus';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
@ -184,7 +184,7 @@ export default {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {

View File

@ -61,10 +61,12 @@ export const menuOperate = {
}
},
Signal:{
// 信号封锁
lock: {
operation: OperationEvent.Signal.lock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
// 信号解封
unlock: {
operation: OperationEvent.Signal.unlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
@ -331,21 +333,71 @@ export const menuOperate = {
}
},
LimitControl: {
// 取消全线临时限速
cancelSpeed: {
operation: OperationEvent.LimitControl.CancelAllLimit.menu.operation,
cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
}
},
Common: {
// 设置故障
setFault: {
operation: OperationEvent.MixinCommand.stoppage.menu.operation,
cmdType: CMD.Fault.CMD_SET_FAULT
},
// 取消故障
cancelFault: {
operation: OperationEvent.MixinCommand.cancelStoppage.menu.operation,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
},
Station:{
// 所有进路交人工控
humanControlALL:{
operation: OperationEvent.Station.humanControlALL.menu.operation,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
},
// 所有进路交ATS自动控
atsAutoControlALL:{
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
},
// 执行关键操作测试
execKeyOperationTest:{
operation: OperationEvent.Station.execKeyOperationTest.menu.operation,
cmdType:CMD.Station.CMD_STATION_KEY_OPERATION_TEST
},
// 上电解锁
powerUnLock:{
operation: OperationEvent.Station.powerUnLock.menu.operation,
cmdType:CMD.Station.CMD_STATION_POWER_ON_UNLOCK
},
// 全站取消联锁自动触发
cancelAutoTrigger:{
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
},
// 全站设置联锁自动触发
setAutoTrigger:{
operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER
}
},
AxleReset:{
// 设置计轴复位
SetAxleReset:{
operation: OperationEvent.AxleReset.SetAxleReset.menu.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
}
},
Train:{
// 新建计划车(开发专用)
createPlanTrain:{
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.Section.CMD_Train_Init_Plan
}
}
};
export function commitOperate(operate, paramList, over, val) {

View File

@ -11,7 +11,7 @@ import SectionAlxeReset from './dialog/sectionAlxeReset';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
@ -92,13 +92,8 @@ export default {
},
//
handleAxleReset() {
const operate = {
start: true,
operation: OperationEvent.AxleReset.SetAxleReset.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.AxleReset.SetAxleReset, {}, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionAlxeReset.doShow(operate);
}
});

View File

@ -166,19 +166,9 @@ export default {
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
commitOperate(menuOperate.Train.createPlanTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/setCommonMenuStep', step);
this.$store.dispatch('training/setCommonMenuStep', operate);
}
});
},

View File

@ -16,9 +16,10 @@ import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationMenu',
components: {
@ -142,8 +143,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.stoppage.menu.operation
};
@ -164,8 +163,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelStoppage.menu.operation
};
@ -182,100 +179,46 @@ export default {
},
//
setAutoTrigger() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.setAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
commitOperate(menuOperate.Station.setAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
cancelAutoTrigger() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
commitOperate(menuOperate.Station.cancelAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
powerUnLock() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.powerUnLock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.powerUnLock, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
});
},
//
execKeyOperationTest() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.execKeyOperationTest, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
});
},
//
humanControlALL() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.humanControlALL.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.humanControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(operate, this.selected);
}
});
},
//
atsAutoControlALL() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.stationSetRouteControlAll.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.atsAutoControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
}
});

View File

@ -60,6 +60,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'SectionCmdControl',
@ -243,6 +244,7 @@ export default {
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
command() {
if (this.operation == OperationEvent.Section.fault.menu.operation ||

View File

@ -82,6 +82,7 @@ import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
import { now } from '@/utils/date';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'SectionCmdSpeed',
@ -337,6 +338,7 @@ export default {
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
speedSelectChange(val) {
const operate = {

View File

@ -85,6 +85,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'SwitchCmdControl',
@ -280,8 +281,10 @@ export default {
});
},
doClose() {
debugger;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
command() {
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/

View File

@ -181,19 +181,9 @@ export default {
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
commitOperate(menuOperate.Train.createPlanTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/setCommonMenuStep', step);
this.$store.dispatch('training/setCommonMenuStep', operate);
}
});
},

View File

@ -20,6 +20,7 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationMenu',
@ -194,98 +195,46 @@ export default {
},
//
setAutoTrigger() {
const operate = {
start: true,
send: true,
code: this.selected.code,
operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
commitOperate(menuOperate.Station.setAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
cancelAutoTrigger() {
const operate = {
start: true,
send: true,
code: this.selected.code,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
commitOperate(menuOperate.Station.cancelAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
powerUnLock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.powerUnLock.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.powerUnLock, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
}).catch(error => {
this.$refs.noticeInfo.doShow(error.message);
});
},
//
execKeyOperationTest() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.execKeyOperationTest, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
});
},
//
humanControlALL() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.humanControlALL.menu.operation,
param:{
stationCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.humanControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(operate, this.selected);
}
});
},
// ATS
atsAutoControlALL() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
param:{
stationCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.Station.atsAutoControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
}
});