增加哈尔滨线路故障操作

This commit is contained in:
zyy 2020-07-21 16:00:41 +08:00
parent d0697bd94a
commit 85203bfbe1
6 changed files with 648 additions and 2 deletions

View File

@ -2,7 +2,12 @@
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" /> <menu-cancel ref="menuCancel" />
<menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" /> <menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-button v-if="isShowButton" ref="menuButton" :selected="selected" /> <menu-button v-if="isShowButton" ref="menuButton" :selected="selected" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" /> <passive-contorl ref="passiveControl" />
@ -16,6 +21,11 @@ import MenuCancel from './menuCancel';
import MenuTrain from './menuTrain'; import MenuTrain from './menuTrain';
import MenuBar from './menuBar'; import MenuBar from './menuBar';
import MenuButton from './menuButton'; import MenuButton from './menuButton';
import MenuSignal from './menuSignal';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuStation from './menuStation';
import MenuStationStand from './menuStationStand';
import PassiveAlarm from './passiveDialog/alarm'; import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control'; import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout'; import PassiveTimeout from './passiveDialog/timeout';
@ -27,6 +37,11 @@ export default {
MenuButton, MenuButton,
MenuCancel, MenuCancel,
MenuTrain, MenuTrain,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStation,
MenuStationStand,
PassiveAlarm, PassiveAlarm,
PassiveContorl, PassiveContorl,
PassiveTimeout PassiveTimeout

View File

@ -0,0 +1,142 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<train-add-plan ref="trainAddPlan" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',
components: {
PopMenu,
NoticeInfo,
TrainAddPlan,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
],
Center: [
]
},
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType: CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
mounted() {
// const isDev = process.env.NODE_ENV === 'development';
// if (isDev) {
// this.menuNormal.Center.push({
// label: '',
// handler: this.addPlanTrain,
// cmdType: CMD.Section.CMD_Train_Init_Plan
// });
// }
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
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();
}
},
// // ()
// addPlanTrain() {
// commitOperate(menuOperate.Train.createPlanTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
// if (valid) {
// this.$refs.trainAddPlan.doShow(operate);
// }
// });
// },
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SignalMenu',
components: {
PopMenu,
NoticeInfo,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
systemName:'xian-01__systerm',
menuNormal: {
Local: [
],
Center: [
]
},
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType: CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
]),
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menu = [];
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
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();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>

View File

@ -0,0 +1,124 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationMenu',
components: {
PopMenu,
SetFault,
NoticeInfo
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
],
Center: [
]
},
menuForce: [
{
label: '设置ZC故障',
handler: this.setStoppage,
cmdType: CMD.Station.CMD_STATION_ADD_FAULT
},
{
label: '取消ZC故障',
handler: this.cancelStoppage,
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce];
}
},
doShow(point) {
if (this.selected.ciStation) {
this.clickEvent();
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();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationStandMenu',
components: {
PopMenu,
NoticeInfo,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
],
Center: [
]
},
menuForce: [
{
label: this.$t('menu.menuStationStand.setFault'),
handler: this.setStoppage,
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT
},
{
label: this.$t('menu.menuStationStand.cancelFault'),
handler: this.cancelStoppage,
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
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();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>

View File

@ -0,0 +1,121 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SwitchMenu',
components: {
PopMenu,
NoticeInfo,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
],
Center: [
]
},
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType: CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
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: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
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();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>