代码调整

This commit is contained in:
joylink_cuiweidong 2023-02-07 16:45:34 +08:00
parent 31f0b61e68
commit c81190b284
3 changed files with 66 additions and 4 deletions

View File

@ -113,6 +113,7 @@
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" /> <train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" /> <shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<defective-shunting ref="defectiveShunting" @clearOperate="clearOperate" />
</div> </div>
</template> </template>
@ -130,11 +131,12 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import {UserOperationType} from '../../../../scripts/ConstDic'; import {UserOperationType} from '../../../../scripts/ConstDic';
import DefectiveShunting from './dialog/defectiveShunting.vue';
export default { export default {
name: 'MapButtonMenu', name: 'MapButtonMenu',
components: { components: {
// CenterConfig, // CenterConfig,
DefectiveShunting,
PasswordBox, PasswordBox,
NoticeInfo, NoticeInfo,
PopMenu, PopMenu,

View File

@ -25,6 +25,8 @@ import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import RouteCancel from './menuDialog/routeCancel'; import RouteCancel from './menuDialog/routeCancel';
import { UserOperationType } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default { export default {
name: 'SwitchMenu', name: 'SwitchMenu',
@ -108,19 +110,22 @@ export default {
}, },
{ {
label: '岔前 分路不良', label: '岔前 分路不良',
handle: '', handler: this.beforeForkDirective,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
isDisabled: (section, station, work) => station.controlMode !== 'Local', isDisabled: (section, station, work) => station.controlMode !== 'Local',
isShow: (section, work) => work === 'ctcWork' isShow: (section, work) => work === 'ctcWork'
}, },
{ {
label: '定位 分路不良', label: '定位 分路不良',
handle: '', handler: this.locateForkDirective,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
isDisabled: (section, station, work) => station.controlMode !== 'Local', isDisabled: (section, station, work) => station.controlMode !== 'Local',
isShow: (section, work) => work === 'ctcWork' isShow: (section, work) => work === 'ctcWork'
}, },
{ {
label: '反位 分路不良', label: '反位 分路不良',
handle: '', handler: this.reverseForkDirective,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
isDisabled: (section, station, work) => station.controlMode !== 'Local', isDisabled: (section, station, work) => station.controlMode !== 'Local',
isShow: (section, work) => work === 'ctcWork' isShow: (section, work) => work === 'ctcWork'
} }
@ -312,6 +317,57 @@ export default {
} }
}); });
}, },
//
beforeForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
operation: OperationEvent.Section.defectiveShunting.menu.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode,
shuntingTypeList:['SWITCH_FRONT_SHUNTING']
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
locateForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
operation: OperationEvent.Section.defectiveShunting.menu.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode,
shuntingTypeList:['FIXED_POSITION_SHUNTING']
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
reverseForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
operation: OperationEvent.Section.defectiveShunting.menu.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode,
shuntingTypeList:['REVERSE_POSITION_SHUNTING']
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
// //
hookLock() { hookLock() {
this.$refs.switchHookLock.doShow(this.selected); this.$refs.switchHookLock.doShow(this.selected);

View File

@ -2448,6 +2448,10 @@ export const OperationEvent = {
shuntingTypeListChange: { shuntingTypeListChange: {
operation: '4282', operation: '4282',
domId: '_Tips-Section-Defective-Shunting-Change' domId: '_Tips-Section-Defective-Shunting-Change'
},
menu:{
operation: '4283',
domId: '_Tips-Section-Defective-Shunting-Menu'
} }
// menuButton: { // menuButton: {
// operation: '428', // operation: '428',