铁科院 大铁线路 道岔右键菜单添加
This commit is contained in:
parent
985180eba7
commit
3e13058b3a
37
src/jmapNew/theme/datie_tky/menus/index.vue
Normal file
37
src/jmapNew/theme/datie_tky/menus/index.vue
Normal file
@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="menus" :style="{width: width + 'px'}">
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import MenuSignal from './menuSignal';
|
||||
import MenuSwitch from './menuSwitch';
|
||||
|
||||
export default {
|
||||
name: 'Menus',
|
||||
components: {
|
||||
MenuSignal,
|
||||
MenuSwitch
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('config', [
|
||||
'width'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,15 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
// OperateMode
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
export default {
|
||||
name: 'SignalMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
PopMenu,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -71,6 +76,15 @@ export default {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
@ -106,6 +120,11 @@ export default {
|
||||
// 加封
|
||||
seal() {
|
||||
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
134
src/jmapNew/theme/datie_tky/menus/menuSwitch.vue
Normal file
134
src/jmapNew/theme/datie_tky/menus/menuSwitch.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
// OperateMode
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
export default {
|
||||
name: 'SwitchMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '单锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
},
|
||||
{
|
||||
label: '单解',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '封闭',
|
||||
handler: this.block,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
},
|
||||
{
|
||||
label: '解封',
|
||||
handler: this.unblock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
}
|
||||
|
||||
],
|
||||
Center: [
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
locate() {
|
||||
|
||||
},
|
||||
reverse() {
|
||||
|
||||
},
|
||||
lock() {
|
||||
|
||||
},
|
||||
unlock() {
|
||||
|
||||
},
|
||||
block() {
|
||||
|
||||
},
|
||||
unblock() {
|
||||
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menu = this.menuNormal.Local;
|
||||
// 故障模式菜单列表
|
||||
// if (this.operatemode === OperateMode.FAULT) {
|
||||
// if (!this.$store.state.scriptRecord.bgSet) {
|
||||
// const menuHook = [{
|
||||
// label: '道岔钩锁',
|
||||
// handler: this.hookLock
|
||||
// }];
|
||||
// this.menu = [...this.menuForce, ...menuHook];
|
||||
// } else {
|
||||
// this.menu = this.menuForce;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user