Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2022-12-07 14:02:43 +08:00
commit 57b4eedfe6
4 changed files with 167 additions and 71 deletions

View File

@ -3,6 +3,12 @@
<menu-bar ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'dispatchWork'" />
<menu-switch ref="menuSwitch" :selected="selected" :work="'dispatchWork'" />
<menu-signal ref="menuSignal" :selected="selected" :work="'dispatchWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'dispatchWork'" />
<menu-station ref="menuStation" :selected="selected" :work="'dispatchWork'" />
<menu-train ref="menuTrain" :selected="selected" :work="'dispatchWork'" />
</div>
</template>
<script>
@ -10,12 +16,20 @@ import { mapGetters } from 'vuex';
import MenuBar from './dispatchWorkMenuBar';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSignal from './menuSignal';
import MenuSection from './menuSection';
import MenuStation from './menuStation';
import MenuTrain from './menuTrain';
export default {
name: 'DispatchWorkMenu',
components: {
MenuBar,
MenuStationStand,
MenuSwitch
MenuSwitch,
MenuSignal,
MenuSection,
MenuStation,
MenuTrain
},
props: {
selected: {

View File

@ -0,0 +1,50 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'localWork'" />
<menu-switch ref="menuSwitch" :selected="selected" :work="'localWork'" />
<menu-signal ref="menuSignal" :selected="selected" :work="'localWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'localWork'" />
<menu-station ref="menuStation" :selected="selected" :work="'localWork'" />
<menu-train ref="menuTrain" :selected="selected" :work="'localWork'" />
</div>
</template>
<script>
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSignal from './menuSignal';
import MenuSection from './menuSection';
import MenuStation from './menuStation';
import MenuTrain from './menuTrain';
import { mapGetters } from 'vuex';
export default {
name: 'LocalWorkMenu',
components: {
MenuStationStand,
MenuSwitch,
MenuSignal,
MenuSection,
MenuStation,
MenuTrain
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
computed: {
...mapGetters('config', [
'width'
])
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
});
}
};
</script>

View File

@ -123,7 +123,7 @@ export default {
label: '设置跳停',
handler: this.setJumpStop,
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP,
isDisabled: (stand, work) => { stand.allSkip === 1; },
isDisabled: (stand, work) => { stand.allSkip === 0; },
isShow: (stand, work) => work === 'dispatchWork'
},
{
@ -131,7 +131,7 @@ export default {
handler: this.cancelJumpStop,
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
// && stand.assignSkip !== 1
isDisabled: (stand, work) => { (stand.allSkip !== 1); },
isDisabled: (stand, work) => { return stand.allSkip !== 1 || stand.assignSkip !== 1; },
isShow: (stand, work) => work === 'dispatchWork'
},
{

View File

@ -25,7 +25,6 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'SwitchMenu',
@ -45,77 +44,101 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
// {
// label: '',
// handler: this.locate,
// cmdType:CMD.Switch.CMD_SWITCH_NORMAL_POSITION
// },
// {
// label: '',
// handler: this.reverse,
// cmdType:CMD.Switch.CMD_SWITCH_REVERSE_POSITION
// },
{
label: '区段激活',
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '区段切除',
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '全线取消限速',
handler: this.cancelSpeed,
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
}
],
Center: [
menuNormal: [
{
label: '道岔总定',
handler: this.locate,
cmdType:CMD.Switch.CMD_SWITCH_NORMAL_POSITION
cmdType:CMD.Switch.CMD_SWITCH_NORMAL_POSITION,
isDisabled: switchDevice => switchDevice.pos === 'N',
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔总反',
handler: this.reverse,
cmdType:CMD.Switch.CMD_SWITCH_REVERSE_POSITION
cmdType:CMD.Switch.CMD_SWITCH_REVERSE_POSITION,
isDisabled: switchDevice => switchDevice.pos === 'R',
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔单锁',
handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
isDisabled: switchDevice => switchDevice.singleLock === 1,
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔单解',
handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
isDisabled: switchDevice => switchDevice.singleLock !== 1,
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔封闭',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
cmdType:CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: switchDevice => switchDevice.blockade === 1,
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}
]
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK,
isDisabled: switchDevice => switchDevice.blockade !== 1,
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '道岔强扳定位',
handler: this.locate,
cmdType:CMD.Switch.CMD_SWITCH_NORMAL_POSITION,
isDisabled: switchDevice => switchDevice.pos === 'N',
isShow: (switchDevice, work) => work === 'localWork'
},
{
label: '道岔强扳反位',
handler: this.reverse,
cmdType:CMD.Switch.CMD_SWITCH_REVERSE_POSITION,
isDisabled: switchDevice => switchDevice.pos === 'R',
isShow: (switchDevice, work) => work === 'localWork'
},
{
label: '区段激活',
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
isShow: (switchDevice, work) => work === 'localWork'
},
{
label: '区段切除',
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
isShow: (switchDevice, work) => work === 'localWork'
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
isShow: (switchDevice, work) => work === 'localWork'
},
{
label: '全线取消限速',
handler: this.cancelSpeed,
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED,
isShow: (switchDevice, work) => work === 'localWork'
}
],
menuForce: [
{
label: '设置故障',
@ -167,7 +190,16 @@ export default {
},
initMenu() {
//
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
//
if (this.operatemode === OperateMode.FAULT) {
// if (!this.$store.state.scriptRecord.bgSet) {