供电线故障代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-02 18:51:53 +08:00
parent 8b5d848cf9
commit 30c71d02fb
7 changed files with 148 additions and 5 deletions

View File

@ -85,6 +85,20 @@ export default class Line2 extends Group {
}
}
getBoundingRect() {
const rect = this.line.getBoundingRect().clone();
if (this.model.leftTerminal) {
const subheadText = this.leftTerminal.getBoundingRect().clone();
rect.union(subheadText);
return rect;
}
if (this.model.rightTerminal) {
const subheadText = this.rightTerminal.getBoundingRect().clone();
rect.union(subheadText);
}
return rect;
}
setLineType(type) {
switch (type) {
case '01': break;

View File

@ -119,7 +119,11 @@ export default {
if (selected._type == 'Train') {
name = selected.serviceNumber;
}
this.deviceName = deviceType[selected._type] + '-' + name;
if (name) {
this.deviceName = deviceType[selected._type] + '-' + name;
} else {
this.deviceName = deviceType[selected._type];
}
this.faultList = deviceFaultType[selected._type];
if (this.faultList && this.faultList.length) {
this.form.faultType = this.faultList[0].value;

View File

@ -13,6 +13,7 @@
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<menu-power ref="menuPower" :selected="selected" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<!--<passive-Timeout ref="passiveTimeout" />-->
@ -34,6 +35,7 @@ import MenuStation from './menuStation';
import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import MenuStationTurnBack from './menuStationTurnBack';
import MenuPower from './menuPower';
// import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
// import PassiveTimeout from './passiveDialog/timeout';
@ -54,6 +56,7 @@ export default {
MenuTrain,
MenuStationTurnBack,
MenuLimit,
MenuPower,
// PassiveAlarm,
PassiveContorl
// PassiveTimeout

View File

@ -0,0 +1,117 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',
components: {
PopMenu,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data( ) {
return {
menu: [],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType:CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType:CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '触发故障管理',
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Power) && !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);
}
});
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
}
}
};
</script>

View File

@ -142,12 +142,12 @@ export default {
{
label: '设置故障',
handler: this.setStoppage,
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT
cmdType:CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT
cmdType:CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '手动开启屏蔽门',

View File

@ -118,6 +118,7 @@ export const DeviceMenu = {
AxleReset: '12',
Enabled: '13',
StationTurnBack: '14',
Power:'15',
Map: '100',
PrdCategory: '101',
@ -128,7 +129,7 @@ export const DeviceMenu = {
SetDriver: '106',
Script: '107',
IscsSystem: '108',
IscsInterface: '109'
IscsInterface: '109'
};
/**

View File

@ -49,6 +49,9 @@ export const deviceFaultType = {
],
Train: [
{label: '通信异常', value: 'COMMUNICATION_ABNORMAL'}
],
Power:[
{label: '供电故障', value: 'FAULT'}
]
};
/** 设备类型 */
@ -59,5 +62,6 @@ export const deviceType = {
Station: '车站',
StationStand: '站台',
Train: '列车',
ZcControl:'ZC'
ZcControl:'ZC',
Power:'供电线'
};