Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2022-12-07 15:19:00 +08:00
commit d7962674cd
16 changed files with 536 additions and 876 deletions

View File

@ -17,10 +17,19 @@ export function parser(data, skinCode, showConfig) {
var mapDevice = {}; var mapDevice = {};
var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null; var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null;
if (data) { if (data) {
const centralStationList = [];
zrUtil.each(data.stationList || [], elem => { zrUtil.each(data.stationList || [], elem => {
if (elem.centralized) {
centralStationList.push(elem);
}
mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert, showConfig);
}, this); }, this);
zrUtil.each(centralStationList, elem => {
mapDevice[elem.code].stationCode = elem.code;
zrUtil.each(elem.chargeStationCodeList || [], item => {
mapDevice[item].stationCode = elem.code;
});
});
zrUtil.each(data.sectionList || [], elem => { zrUtil.each(data.sectionList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig);
elem = propConvert.initPrivateProps(elem); elem = propConvert.initPrivateProps(elem);

View File

@ -1,13 +1,12 @@
<template> <template>
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" /> <menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-button ref="menuButton" />
<menu-station-stand ref="menuStationStand" :selected="selected" /> <menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" /> <menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" /> <menu-signal ref="menuSignal" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" /> <menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" work="dispatchWork"/>
<menu-limit ref="menuLimit" :selected="selected" /> <menu-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" />
@ -18,7 +17,6 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import MenuSignal from './menuSignal'; import MenuSignal from './menuSignal';
import MenuButton from './menuButton';
import MenuStationStand from './menuStationStand'; import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch'; import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection'; import MenuSection from './menuSection';
@ -34,7 +32,6 @@ export default {
name: 'DispatchWorkMenus', name: 'DispatchWorkMenus',
components: { components: {
MenuBar, MenuBar,
MenuButton,
MenuSignal, MenuSignal,
MenuSwitch, MenuSwitch,
MenuSection, MenuSection,

View File

@ -609,62 +609,6 @@ export default {
} }
}); });
}, },
//
addPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAdd.doShow(operate);
}
});
},
//
translatPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainTranstalet.doShow(operate);
}
});
},
//
delPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate);
}
});
},
//
userManage(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
});
},
// //
about(order) { about(order) {
const operate = { const operate = {
@ -684,15 +628,6 @@ export default {
this.closeMenu(true); this.closeMenu(true);
EventBus.$emit('refresh'); EventBus.$emit('refresh');
}, },
getLoginResult(operate) {
/** 密码校验*/
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
if (operate.success) {
/** 校验成功*/
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
}
}
},
undeveloped() { undeveloped() {
this.doClose(); this.doClose();
this.$alert('实现中......', '提示', { this.$alert('实现中......', '提示', {

View File

@ -2,14 +2,8 @@
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-bar ref="menuBar" :selected="selected" /> <menu-bar ref="menuBar" :selected="selected" />
<menu-button ref="menuButton" /> <menu-button ref="menuButton" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<menu-station ref="menuStation" :selected="selected" work="localWork" />
<passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" />
<passive-timeout ref="passiveTimeout" /> <passive-timeout ref="passiveTimeout" />
</div> </div>
@ -17,34 +11,22 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import MenuSignal from './menuSignal';
import MenuButton from './menuButton'; import MenuButton from './menuButton';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './localWorkMenuBar'; import MenuBar from './localWorkMenuBar';
import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm'; import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control'; import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout'; import PassiveTimeout from './passiveDialog/timeout';
import MenuStation from './menuStation';
export default { export default {
name: 'LocalWorkMenus', name: 'LocalWorkMenus',
components: { components: {
MenuBar, MenuBar,
MenuButton, MenuButton,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStationStand,
MenuStation,
MenuTrain,
MenuLimit,
PassiveAlarm, PassiveAlarm,
PassiveContorl, PassiveContorl,
PassiveTimeout PassiveTimeout,
MenuStation
}, },
props: { props: {
selected: { selected: {

View File

@ -140,254 +140,7 @@ export default {
tempClassA: -1, tempClassA: -1,
tempClassB: -1, tempClassB: -1,
valid: true, valid: true,
menu: [], menu: [
menuNormal: {
Local: [
{
title: '系统',
operate: OperationEvent.Command.mBar.system,
children: [
{
title: '登录',
click: this.undeveloped
},
{
title: '注销',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '站遥控',
operate: OperationEvent.MixinCommand.remoteControl.mbar,
click: this.stationRemoteControl
},
{
title: '区域选择',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '连接主用中心',
click: this.undeveloped
},
{
title: '连接备用中心',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '退出',
click: this.undeveloped
}
]
},
{
title: '查看',
operate: OperationEvent.Command.mBar.check,
children: [
{
title: '运行图',
click: this.undeveloped
},
{
title: '报告分析',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '视图',
click: this.undeveloped,
operate: '',
children: [{
title: '报警',
click: this.undeveloped
},
{
title: '列车运行信息',
click: this.undeveloped
},
{
title: '设备状态',
click: this.undeveloped
},
{
title: '列车详细信息',
click: this.undeveloped
},
{
title: '站台详细信息',
click: this.undeveloped
}]
},
{
title: '终端站发车列表',
click: this.undeveloped
},
{
title: '详细设备状态',
click: this.undeveloped
},
{
title: '查找列车',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '显示目的地号',
click: this.undeveloped
},
{
title: '显示轨道名',
click: this.undeveloped
},
{
title: '显示道岔名',
click: this.undeveloped
},
{
title: '显示信号机名',
click: this.undeveloped
},
{
title: '显示车次窗位置',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '显示车次号',
click: this.undeveloped
},
{
title: '显示车组号',
click: this.undeveloped
},
{
type: 'separator'
},
{
title: '全屏',
click: this.undeveloped
},
{
title: '放大',
click: this.undeveloped
},
{
title: '缩小',
click: this.undeveloped
},
{
title: '恢复',
click: this.undeveloped
}
]
},
{
title: '车站定位',
operate: '',
children: [
]
},
{
title: 'ATS终端操作',
operate: '',
children: [
{
title: '当天运行车计划',
click: this.undeveloped
},
{
title: '出入库预告',
click: this.undeveloped
}
]
},
{
title: '计划车操作',
operate: '',
children: [
{
title: '添加计划车',
click: this.undeveloped
},
{
title: '平移计划车',
click: this.undeveloped
},
{
title: '删除计划车',
click: this.undeveloped
}
]
},
{
title: '批处理命令',
operate: OperationEvent.Command.mBar.detainControl,
children: [
{
title: '全线扣车',
operate: OperationEvent.StationStand.setDetainTrainAll.mbar,
click: this.setDetainTrainAll
},
{
title: '取消全线扣车',
operate: OperationEvent.StationStand.cancelDetainTrainAll.mbar,
click: this.cancelDetainTrainAll
},
{
title: '取消上行全线扣车',
operate: OperationEvent.StationStand.cancelUpDetainTrainAll.mbar,
click: this.cancelUpDetainTrainAll
},
{
title: '取消下行全线扣车',
operate: OperationEvent.StationStand.cancelDownDetainTrainAll.mbar,
click: this.cancelDownDetainTrainAll
}
]
},
{
title: '信息管理',
operate: '',
children: [
{
title: '调度日志',
click: this.undeveloped
},
{
title: '调度留言提醒',
click: this.undeveloped
},
{
title: '报警设置',
click: this.undeveloped
}
]
},
{
title: '帮助',
children: [
{
title: '关于ITS GPC 工作站',
click: this.about,
operate: OperationEvent.Command.help.about
}
]
}
],
Center: [
{ {
title: '系统', title: '系统',
operate: OperationEvent.Command.mBar.system, operate: OperationEvent.Command.mBar.system,
@ -632,7 +385,6 @@ export default {
] ]
} }
] ]
}
}; };
}, },
computed: { computed: {
@ -857,62 +609,6 @@ export default {
} }
}); });
}, },
//
addPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAdd.doShow(operate);
}
});
},
//
translatPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainTranstalet.doShow(operate);
}
});
},
//
delPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate);
}
});
},
//
userManage(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
});
},
// //
about(order) { about(order) {
const operate = { const operate = {
@ -932,15 +628,6 @@ export default {
this.closeMenu(true); this.closeMenu(true);
EventBus.$emit('refresh'); EventBus.$emit('refresh');
}, },
getLoginResult(operate) {
/** 密码校验*/
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
if (operate.success) {
/** 校验成功*/
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
}
}
},
undeveloped() { undeveloped() {
this.doClose(); this.doClose();
this.$alert('实现中......', '提示', { this.$alert('实现中......', '提示', {

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="isShowBtn" id="menuButtons_box" class="menu menuButton" style="height:45px;" :style="{left: point.x+'px', bottom: point.y+'px' }"> <div id="menuButtons_box" class="menu menuButton" style="height:45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button <button
:id="Signal.arrangementRoute.button.domId" :id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@ -244,9 +244,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
// import Handler from '@/scripts/cmdPlugin/Handler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import { deepAssign } from '@/utils/index';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue'; import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
export default { export default {
@ -287,9 +285,6 @@ export default {
}, },
Command() { Command() {
return OperationEvent.Command; return OperationEvent.Command;
},
isShowBtn() {
return this.$store.state.training.prdType == '01';
} }
}, },
watch: { watch: {

View File

@ -11,7 +11,6 @@ import CancelAllLimit from '@/jmapNew/theme/components/menus/dialog/cancelAllLim
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default { export default {
@ -32,22 +31,13 @@ export default {
return { return {
menu: [], menu: [],
systemName:'beijing-01__systerm', systemName:'beijing-01__systerm',
menuNormal: { menuNormal: [
Local: [
{
label: '取消全线临时限速',
handler: this.cancelSpeed,
cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
}
],
Center: [
{ {
label: '取消全线临时限速', label: '取消全线临时限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
} }
] ]
}
}; };
}, },
computed: { computed: {
@ -72,8 +62,12 @@ export default {
}; };
}, },
initMenu() { initMenu() {
// this.menu = [];
// this.menu = MenuContextHandler.covert(this.menuNormal); this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected) : true;
this.menu.push(menuItem);
});
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -21,7 +21,6 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
@ -51,40 +50,39 @@ export default {
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [
],
Center: [
{ {
label: '轨道激活', label: '轨道激活',
handler: this.active, handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE cmdType: CMD.Section.CMD_SECTION_ACTIVE,
isDisabled: section => section.cutOff !== 1,
isShow: section => section.type !== '04'
}, },
{ {
label: '轨道切除', label: '轨道切除',
handler: this.split, handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF cmdType: CMD.Section.CMD_SECTION_CUT_OFF,
isDisabled: section => section.cutOff === 1,
isShow: section => section.type !== '04'
}, },
{ {
type: 'separator' type: 'separator'
}, },
// {
// label: '',
// handler: this.alxeEffective,
// cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
// },
{ {
label: '设置临时限速', label: '设置临时限速',
handler: this.setSpeed, handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: section => section.speedUpLimit === -1,
isShow: section => section.type !== '04'
}, },
{ {
label: '取消临时限速', label: '取消临时限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: section => section.speedUpLimit !== -1,
isShow: section => section.type !== '04'
} }
] ],
},
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -135,7 +133,7 @@ export default {
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
if (isDev) { if (isDev) {
this.menuNormal.Center.push({ this.menuNormal.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan cmdType: CMD.Section.CMD_Train_Init_Plan
@ -151,11 +149,12 @@ export default {
}, },
initMenu() { initMenu() {
// //
if (this.selected.type != '04') {
// this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = []; this.menu = [];
} this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected) : true;
this.menu.push(menuItem);
});
// //
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') { if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce; this.menu = this.menuForce;

View File

@ -21,7 +21,6 @@ import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
@ -54,14 +53,11 @@ export default {
clickNum:0, clickNum:0,
systemName:'beijing-01__systerm', systemName:'beijing-01__systerm',
oldSelected:null, oldSelected:null,
menuNormal: { menuNormal: [
Local: [
],
Center: [
{ {
label: '排列进路', label: '排列进路',
handler: this.arrangementRoute, handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
}, },
{ {
label: '取消进路', label: '取消进路',
@ -91,8 +87,7 @@ export default {
handler: this.detail, handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
} }
] ],
},
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -148,11 +143,14 @@ export default {
}, },
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected) : true;
this.menu.push(menuItem);
});
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} }
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce; this.menu = this.menuForce;

View File

@ -19,9 +19,7 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
@ -41,12 +39,64 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
{
label: '全站设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
isDisabled: () => {},
isShow: (station, work) => work === 'localWork'
},
{
label: '全站取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
isShow: (station, work) => work === 'localWork'
},
{
label: '所有进路自排关',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
isShow: (station, work) => work === 'disabledWork'
},
{
label: '所有进路自排开',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
isShow: (station, work) => work === 'disabledWork'
}
// -------
// {
// label: '',
// handler: this.powerUnLock,
// cmdType: CMD.Station.active,
// auth: { station: true, center: false }
// },
// {
// label: '',
// handler: this.execKeyOperationTest,
// cmdType: CMD.Station.active,
// auth: { station: true, center: false }
// }
// {
// label: '',
// handler: this.execKeyOperationTest,
// cmdType: CMD.Station.active,
// auth: { station: false, center: true }
// }
],
menuNormal1: {
Local: [ Local: [
{ {
label: '全站设置联锁自动触发', label: '全站设置联锁自动触发',

View File

@ -26,7 +26,6 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import {DeviceMenu } from '@/scripts/ConstDic'; import {DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';

View File

@ -24,7 +24,6 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import {DeviceMenu } from '@/scripts/ConstDic'; import {DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';

View File

@ -126,7 +126,7 @@ export default {
}, },
watch: { watch: {
'$store.state.training.initTime': function (initTime) { '$store.state.training.initTime': function (initTime) {
this.time = timestampFormat('HH:mmss', initTime) this.time = timestampFormat('HH:mmss', initTime);
} }
}, },
mounted() { mounted() {

View File

@ -34,12 +34,9 @@ import TrainDeletePlan from './dialog/trainDeletePlan';
import TrainSetHead from './dialog/trainSetHead'; import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork'; import TrainSetWork from './dialog/trainSetWork';
import TrainFlag from './dialog/trainFlag'; import TrainFlag from './dialog/trainFlag';
// import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'MenuTrain', name: 'MenuTrain',

View File

@ -0,0 +1,19 @@
import store from '@/store/index';
/**
* 判断菜单行值控制全
* @param {String} stationCode 所属车站code
* @param {String} centralStationCode 所属集中站code
* */
export function judgeStationControl(stationCode, centralStationCode, work) {
const centralStation = this.$store.getters['map/getDeviceByCode'](centralStationCode);
// 角色车站是 设备所属车站或所属集中站
if (work === 'localWork') {
const flag1 = store.state.training.roleDeviceCode === stationCode || store.state.training.roleDeviceCode === centralStationCode;
const flag2 = centralStation.controlMode === 'Local' || centralStation.controlMode === 'Emergency';
return flag1 && flag2;
} else if ( work === 'dispatchWork' ) {
return centralStation.controlMode === 'Center';
} else {
return true;
}
}

View File

@ -64,7 +64,7 @@ export default {
isDisabled: (section, work) => { isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') { if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || device.controlMode !== 'Local'; return this.$store.state.training.roleDeviceCode !== section.stationCode || (device.controlMode !== 'Local' && device.controlMode !== 'Emergency');
} else { } else {
return device.controlMode !== 'Center'; return device.controlMode !== 'Center';
} }