This commit is contained in:
fan 2022-07-20 15:07:13 +08:00
commit 0c34aa9163
5 changed files with 94 additions and 18 deletions

View File

@ -92,6 +92,10 @@ class ESwName extends Group {
getTextRect() { getTextRect() {
return this.textRect; return this.textRect;
} }
getBoundingRect() {
return this.textRect.getBoundingRect();
}
} }
export default ESwName; export default ESwName;

View File

@ -240,6 +240,16 @@ export const menuOperate = {
// 道岔钩锁 // 道岔钩锁
operation: OperationEvent.Switch.hookLock.menu.operation, operation: OperationEvent.Switch.hookLock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_HOOK_LOCK cmdType: CMD.Switch.CMD_SWITCH_HOOK_LOCK
},
defectiveShunting:{
// 设置分路不良
operation: OperationEvent.Switch.defectiveShunting.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_DEFECTIVE_SHUNTING
},
cancelDefectiveShunting:{
// 取消分路不良
operation: OperationEvent.Switch.cancelDefectiveShunting.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_DEFECTIVE_SHUNTING
} }
}, },
StationStand:{ StationStand:{

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<switch-control ref="switchControl" pop-class="chengdou-03__systerm" /> <!-- <switch-control ref="switchControl" pop-class="chengdou-03__systerm" /> -->
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" /> <notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div> </div>
</template> </template>
@ -12,13 +12,13 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl'; // import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
export default { export default {
name: 'SwitchMenu', name: 'SwitchMenu',
components: { components: {
PopMenu, PopMenu,
SwitchControl, // SwitchControl,
NoticeInfo NoticeInfo
}, },
props: { props: {
@ -69,8 +69,27 @@ export default {
label: '解封', label: '解封',
handler: this.unblock, handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
type: 'separator'
},
{
label: '设置分路不良标记',
handler: this.defectiveShunting,
cmdType: CMD.Switch.CMD_SWITCH_DEFECTIVE_SHUNTING
},
//
{
label: '取消分路不良标记',
handler: this.cancelDefectiveShunting,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_DEFECTIVE_SHUNTING
},
//
{
label: '区段故障解锁',
handler: this.fault,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
} }
], ],
Center: [ Center: [
] ]
@ -89,53 +108,78 @@ export default {
methods:{ methods:{
// //
locate() { locate() {
commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 3).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
reverse() { reverse() {
commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 3).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
lock() { lock() {
commitOperate(menuOperate.Switch.lock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Switch.lock, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
unlock() { unlock() {
commitOperate(menuOperate.Switch.unlock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Switch.unlock, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
block() { block() {
commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
unblock() { unblock() {
commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.switchControl.doShow(operate, this.selected); // this.$refs.switchControl.doShow(operate, this.selected);
} }
}); });
}, },
// /
fault() {
commitOperate(menuOperate.Switch.fault, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
defectiveShunting() {
commitOperate(menuOperate.Switch.defectiveShunting, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
cancelDefectiveShunting() {
commitOperate(menuOperate.Switch.cancelDefectiveShunting, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
doShow(point) { doShow(point) {
this.initMenu(); this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {

View File

@ -45,7 +45,11 @@ export default {
/** 引导总锁 */ /** 引导总锁 */
CMD_SWITCH_MASTER_LOCK: {value:'Switch_Master_Lock', label: '设置引导总锁' }, CMD_SWITCH_MASTER_LOCK: {value:'Switch_Master_Lock', label: '设置引导总锁' },
/** 取消引导总锁 */ /** 取消引导总锁 */
CMD_SWITCH_MASTER_UNBLOCK: {value: 'Switch_Master_Unblock', label: '取消引导总锁'} CMD_SWITCH_MASTER_UNBLOCK: {value: 'Switch_Master_Unblock', label: '取消引导总锁'},
/** 道岔设置分路不良 */
CMD_SWITCH_DEFECTIVE_SHUNTING: {value: 'Switch_Defective_Shunting', label: '道岔设置分路不良'},
/** 道岔取消分路不良 */
CMD_SWITCH_CANCEL_DEFECTIVE_SHUNTING: {value: 'Switch_Cancel_Defective_Shunting', label: '道岔取消分路不良'}
}, },
// 控制模式操作 // 控制模式操作

View File

@ -1162,6 +1162,20 @@ export const OperationEvent = {
operation: '11b1', operation: '11b1',
domId: '_Tips-Switch-ForceCancelSpeed-Menu{BOTTOM}' domId: '_Tips-Switch-ForceCancelSpeed-Menu{BOTTOM}'
} }
},
// 设置分路不良
defectiveShunting:{
menu: {
operation: '11c',
domId: '_Tips-Switch-DefectiveShunting-Menu{TOP}'
}
},
// 取消分路不良
cancelDefectiveShunting:{
menu: {
operation: '11d',
domId: '_Tips-Switch-CancelDefectiveShunting-Menu{TOP}'
}
} }
}, },