rt-sim-training-client/src/jmapNew/theme/chengdu_03/menus/menuStationControl.vue

70 lines
1.6 KiB
Vue
Raw Normal View History

2019-11-29 12:51:58 +08:00
<template>
<pop-menu ref="popMenu" :menu="menu" />
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
2019-12-31 14:32:04 +08:00
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
2019-11-29 12:51:58 +08:00
export default {
2019-12-31 14:32:04 +08:00
name: 'StationControlMenu',
components: {
PopMenu
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: [
],
menuForce: [
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
doShow(point) {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
}
}
2019-11-29 12:51:58 +08:00
};
</script>