This commit is contained in:
fan 2020-11-02 19:09:16 +08:00
commit 815735b8c5
10 changed files with 175 additions and 6 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;
}
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

@ -302,6 +302,11 @@ export const menuOperate = {
// 批量取消扣车
operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL
},
openPsdByHand:{
// 手动开启屏蔽门
operation: OperationEvent.StationStand.openPsdByHand.menu.operation,
cmdType:CMD.Stand.CMD_STAND_OPEN_PSD
}
},
StationControl:{

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,17 @@ 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: '手动开启屏蔽门',
handler: this.openPsdByHand,
cmdType: CMD.Stand.CMD_STAND_OPEN_PSD
},
{
label: '触发故障管理',
@ -317,6 +322,13 @@ export default {
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
},
//
openPsdByHand() {
commitOperate(menuOperate.StationStand.openPsdByHand, {standCode:this.selected.code}, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}
};

View File

@ -118,6 +118,7 @@ export const DeviceMenu = {
AxleReset: '12',
Enabled: '13',
StationTurnBack: '14',
Power:'15',
Map: '100',
PrdCategory: '101',

View File

@ -183,7 +183,9 @@ export default {
/** 查看站台状态 */
CMD_STAND_VIEW_STATUS:{value:'Stand_View_Status', label: '查看站台状态'},
/** 站台总取消 */
CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'}
CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'},
/** 手动开启屏蔽门 */
CMD_STAND_OPEN_PSD:{value:'Stand_Open_Psd', label: '手动开启屏蔽门'}
},
Station: {

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:'供电线'
};

View File

@ -1766,6 +1766,13 @@ export const OperationEvent = {
operation: '518',
domId: '_Tips-Stand-cancelDetainTrainAuto-Menu'
}
},
// 手动开启屏蔽门
openPsdByHand:{
menu: {
operation: '519',
domId: '_Tips-Stand-openPsdByHand-Menu'
}
}
},