diff --git a/src/jmapNew/theme/chengdu_01/menus/dialog/sectionCmdControl.vue b/src/jmapNew/theme/chengdu_01/menus/dialog/sectionCmdControl.vue
index 22ee8627d..05a71e097 100644
--- a/src/jmapNew/theme/chengdu_01/menus/dialog/sectionCmdControl.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/dialog/sectionCmdControl.vue
@@ -315,7 +315,9 @@ export default {
});
},
confirm2() {
- const operate = {};
+ const operate = {
+ send: true
+ };
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
diff --git a/src/jmapNew/theme/chengdu_01/menus/dispatchWorkMenu.vue b/src/jmapNew/theme/chengdu_01/menus/dispatchWorkMenu.vue
new file mode 100644
index 000000000..525fc3871
--- /dev/null
+++ b/src/jmapNew/theme/chengdu_01/menus/dispatchWorkMenu.vue
@@ -0,0 +1,438 @@
+
+
+
+
+
+
+
diff --git a/src/jmapNew/theme/chengdu_01/menus/localWorkMenu.vue b/src/jmapNew/theme/chengdu_01/menus/localWorkMenu.vue
new file mode 100644
index 000000000..b098b6bd9
--- /dev/null
+++ b/src/jmapNew/theme/chengdu_01/menus/localWorkMenu.vue
@@ -0,0 +1,438 @@
+
+
+
+
+
+
+
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuBar.vue b/src/jmapNew/theme/chengdu_01/menus/menuBar.vue
index 0a5e8b9d0..4e1caca77 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuBar.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuBar.vue
@@ -91,6 +91,12 @@ export default {
default() {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
@@ -101,104 +107,62 @@ export default {
tempClassB: -1,
valid: true,
menu: [],
- menuNormal: {
- Local: [
- {
- title: '访问控制',
- operate: OperationEvent.Command.mBar.system,
- children: [
- {
- title: '登录',
- click: this.login
- },
- {
- 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: '列车库存',
- operate: OperationEvent.Command.mBar.check
- },
- {
- title: '显示控制',
- operate: OperationEvent.Command.mBar.view
- }
- ],
- Center: [
- {
- title: '访问控制',
- operate: OperationEvent.Command.mBar.system,
- children: [
- {
- title: '登录',
- click: this.login
- },
- {
- title: '注销',
- click: this.logout
- },
- {
- 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: '列车库存',
- operate: OperationEvent.Command.mBar.check
- },
- {
- title: '显示控制',
- operate: OperationEvent.Command.mBar.view
- }
- ]
- }
+ menuNormal: [
+ {
+ title: '访问控制',
+ operate: OperationEvent.Command.mBar.system,
+ children: [
+ {
+ title: '登录',
+ show: true,
+ click: this.login
+ },
+ {
+ title: '注销',
+ show: true,
+ click: this.work == 'localWork' ? this.undeveloped : this.logout
+ },
+ {
+ title: '登录转移',
+ show: true,
+ click: this.undeveloped
+ },
+ {
+ title: '区域分配',
+ show: true,
+ click: this.undeveloped
+ },
+ {
+ title: '员工管理',
+ show: true,
+ click: this.undeveloped
+ },
+ {
+ title: '职位功能划分',
+ show: true,
+ click: this.undeveloped
+ },
+ {
+ title: '用户概况',
+ show: true,
+ click: this.undeveloped
+ },
+ {
+ title: '登录概览',
+ show: true,
+ click: this.undeveloped
+ }
+ ]
+ },
+ {
+ title: '列车库存',
+ operate: OperationEvent.Command.mBar.check
+ },
+ {
+ title: '显示控制',
+ operate: OperationEvent.Command.mBar.view
+ }
+ ]
};
},
computed: {
@@ -233,9 +197,6 @@ export default {
},
'$store.state.training.started': function (val) {
this.closeMenu(true);
- },
- '$store.state.training.prdType': function () {
- this.initMenu();
}
},
mounted() {
@@ -267,6 +228,13 @@ export default {
},
initMenu(menu) {
// this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[State2SimulationMap[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
+ this.menu = [];
+ this.menuNormal.forEach(menuItem => {
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
+ this.menu.push(menuItem);
+ });
+ console.log('🚀 ~ file: menuBar.vue:224 ~ initMenu ~ menu', this.menu);
if (this.menu.length) {
this.menu[2].children = this.initStationList();
this.clickEvent();
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSection.vue b/src/jmapNew/theme/chengdu_01/menus/menuSection.vue
index 1ac04d9df..30aa378a7 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuSection.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuSection.vue
@@ -26,6 +26,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
+import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SectionMenu',
@@ -45,32 +46,36 @@ export default {
default: () => {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
return {
menu: [],
- menuNormal: {
- Local: [
- ],
- Center: [
- {
- label: '轨道封锁',
- handler: this.lock,
- cmdType: CMD.Section.CMD_SECTION_BLOCK
- },
- {
- label: '轨道解封',
- handler: this.unlock,
- cmdType: CMD.Section.CMD_SECTION_UNBLOCK
- }
- // {
- // label: '速度控制',
- // handler: this.setSpeed,
- // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
- // }
- ]
- },
+ menuNormal: [
+ {
+ label: '轨道封锁',
+ handler: this.lock,
+ cmdType: CMD.Section.CMD_SECTION_BLOCK,
+ isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
+ },
+ {
+ label: '轨道解封',
+ handler: this.unlock,
+ cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
+ isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
+ }
+ // {
+ // label: '速度控制',
+ // handler: this.setSpeed,
+ // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
+ // }
+ ],
menuForce: [
{
label: '设置故障',
@@ -116,7 +121,7 @@ export default {
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
- this.menuNormal.Center.push( {
+ this.menuNormal.push( {
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
@@ -134,6 +139,13 @@ export default {
// 编辑模式菜单列表
if (this.selected.type != '04') {
// this.menu = MenuContextHandler.covert(this.menuNormal);
+ this.menu = [];
+ this.menuNormal.forEach(menuItem => {
+ const status = judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work);
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
+ this.menu.push(menuItem);
+ });
} else {
this.menu = [];
}
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue
index 735818aaf..c7bcd865a 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue
@@ -18,6 +18,7 @@ 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';
+import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SignalMenu',
@@ -33,142 +34,171 @@ export default {
default: () => {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
return {
menu: [],
popClass: 'chengdou-01__select-option',
- menuNormal: {
- Local: [
- {
- label: '始端/终端选择',
- handler: this.arrangementRoute,
- cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
- },
- {
- label: '取消进路',
- handler: this.cancelTrainRoute,
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
- },
- {
- label: '开放自动进路',
- handler: this.singalPassModel,
- cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
- },
- {
- label: '关闭自动进路',
- handler: this.singalCancelPassModel,
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
- },
- {
- label: '终端信号封锁',
- handler: this.lock,
- cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
- },
- {
- label: '终端信号解封',
- handler: this.unlock,
- cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
- },
- {
- label: '引导信号',
- handler: this.guide,
- cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
- },
- {
- label: '设备标签',
- handler: '',
- cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
- children: [
- {
- label: '创建设备标签',
- handler: '',
- cmdType: ''
- }
- ]
- },
- {
- label: '模拟',
- handler: '',
- cmdType: ''
- },
- {
- label: '选择设备',
- handler: '',
- cmdType: ''
- },
- {
- label: '帮助',
- handler: '',
- cmdType: ''
+ menuNormal: [
+ {
+ label: '始端/终端选择',
+ handler: this.arrangementRoute,
+ cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
+ isDisabled: (signal, work) => {
+ return false;
}
- ],
- Center: [
- {
- label: '始端/终端选择',
- handler: this.arrangementRoute,
- cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
- },
- {
- label: '取消进路',
- handler: this.cancelTrainRoute,
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
- },
- {
- label: '开放自动进路',
- handler: this.singalPassModel,
- cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
- },
- {
- label: '关闭自动进路',
- handler: this.singalCancelPassModel,
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
- },
- {
- label: '终端信号封锁',
- handler: this.lock,
- cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
- },
- {
- label: '终端信号解封',
- handler: this.unlock,
- cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
- },
- {
- label: '引导信号',
- handler: this.guide,
- cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
- },
- {
- label: '设备标签',
- handler: '',
- cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
- children: [
- {
- label: '创建设备标签',
- handler: this.createDeviceLabel,
- cmdType: ''
- }
- ]
- },
- {
- label: '模拟',
- handler: '',
- cmdType: ''
- },
- {
- label: '选择设备',
- handler: '',
- cmdType: ''
- },
- {
- label: '帮助',
- handler: '',
- cmdType: ''
+ },
+ {
+ label: '取消进路',
+ handler: this.cancelTrainRoute,
+ cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
+ isDisabled: (signal, work) => {
+ return false;
}
- ]
- },
+ },
+ {
+ label: '开放自动进路',
+ handler: this.singalPassModel,
+ cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
+ isDisabled: (signal, work) => {
+ return false;
+ }
+ },
+ {
+ label: '关闭自动进路',
+ handler: this.singalCancelPassModel,
+ cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
+ isDisabled: (signal, work) => {
+ return false;
+ }
+ },
+ {
+ label: '终端信号封锁',
+ handler: this.lock,
+ cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
+ isDisabled: (signal, work) => {
+ return signal.blockade !== 0;
+ }
+ },
+ {
+ label: '终端信号解封',
+ handler: this.unlock,
+ cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
+ isDisabled: (signal, work) => {
+ return signal.blockade === 0;
+ }
+ },
+ {
+ label: '引导信号',
+ handler: this.guide,
+ cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
+ isDisabled: (signal, work) => {
+ return false;
+ }
+ },
+ {
+ label: '设备标签',
+ handler: '',
+ cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
+ children: [
+ {
+ label: '创建设备标签',
+ handler: this.work == 'localWork' ? '' : this.createDeviceLabel,
+ cmdType: '',
+ show: false
+ }
+ ]
+ },
+ {
+ label: '模拟',
+ handler: '',
+ cmdType: '',
+ isShow: (signal, work) => false
+ },
+ {
+ label: '选择设备',
+ handler: '',
+ cmdType: '',
+ isShow: (signal, work) => false
+ },
+ {
+ label: '帮助',
+ handler: '',
+ cmdType: '',
+ isShow: (signal, work) => false
+ }
+ ],
+ // Center: [
+ // {
+ // label: '始端/终端选择',
+ // handler: this.arrangementRoute,
+ // cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
+ // },
+ // {
+ // label: '取消进路',
+ // handler: this.cancelTrainRoute,
+ // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
+ // },
+ // {
+ // label: '开放自动进路',
+ // handler: this.singalPassModel,
+ // cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
+ // },
+ // {
+ // label: '关闭自动进路',
+ // handler: this.singalCancelPassModel,
+ // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
+ // },
+ // {
+ // label: '终端信号封锁',
+ // handler: this.lock,
+ // cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
+ // },
+ // {
+ // label: '终端信号解封',
+ // handler: this.unlock,
+ // cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
+ // },
+ // {
+ // label: '引导信号',
+ // handler: this.guide,
+ // cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
+ // },
+ // {
+ // label: '设备标签',
+ // handler: '',
+ // cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
+ // children: [
+ // {
+ // label: '创建设备标签',
+ // handler: this.createDeviceLabel,
+ // cmdType: ''
+ // }
+ // ]
+ // },
+ // {
+ // label: '模拟',
+ // handler: '',
+ // cmdType: ''
+ // },
+ // {
+ // label: '选择设备',
+ // handler: '',
+ // cmdType: ''
+ // },
+ // {
+ // label: '帮助',
+ // handler: '',
+ // cmdType: ''
+ // }
+ // ]
menuForce: [
{
label: '设置故障',
@@ -222,6 +252,13 @@ export default {
initMenu() {
// 编辑模式菜单列表
// this.menu = MenuContextHandler.covert(this.menuNormal);
+ this.menu = [];
+ this.menuNormal.forEach(menuItem => {
+ const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work, this.lineCode) : true;
+ this.menu.push(menuItem);
+ });
// 故障模式菜单列表
if (this.operatemode === OperateMode.FAULT) {
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue
index 5b8ef4010..acc418989 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue
@@ -15,6 +15,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
+import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'StationMenu',
@@ -32,17 +33,19 @@ export default {
default: () => {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
return {
menu: [],
- menuNormal: {
- local: [
- ],
- central: [
- ]
- },
+ menuNormal: [
+ ],
menuForce: [
{
label: '设置ZC故障',
@@ -92,6 +95,13 @@ export default {
},
initMenu() {
if (this.selected.centralized) {
+ this.menu = [];
+ this.menuNormal.forEach(menuItem => {
+ const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work, this.lineCode) : true;
+ this.menu.push(menuItem);
+ });
// 故障模式菜单列表
if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce];
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuStationStand.vue b/src/jmapNew/theme/chengdu_01/menus/menuStationStand.vue
index dc6f4cbfa..596d3d260 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuStationStand.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuStationStand.vue
@@ -18,6 +18,7 @@ import { 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';
+import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'StationStandMenu',
@@ -33,51 +34,57 @@ export default {
default: () => {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
return {
menu: [],
- StoppingProfile: {
- Local: [],
- Center: [
- {
- label: '站台停站调整', // 设置停站时间
- handler: this.setStopTime,
- cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
- },
- {
- label: '站台停站',
- handler: '',
- cmdType: ''
- },
- {
- label: '帮助',
- handler: '',
- cmdType: ''
- }
- ]
- },
- know: {
- Local: [],
- Center: [
- {
- label: 'Skip Next Station',
- handler: '',
- cmdType: ''
- },
- {
- label: 'Skip Next Station',
- handler: '',
- cmdType: ''
- },
- {
- label: 'Help',
- handler: '',
- cmdType: ''
- }
- ]
- },
+ StoppingProfile: [
+ {
+ label: '站台停站调整', // 设置停站时间
+ handler: this.setStopTime,
+ cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
+ isShow: (stand, work) => work === 'dispatchWork'
+ },
+ {
+ label: '站台停站',
+ handler: '',
+ cmdType: '',
+ isShow: (stand, work) => work === 'dispatchWork'
+ },
+ {
+ label: '帮助',
+ handler: '',
+ cmdType: '',
+ isShow: (stand, work) => work === 'dispatchWork'
+ }
+ ],
+ know: [
+ {
+ label: 'Skip Next Station',
+ handler: '',
+ cmdType: '',
+ isShow: (stand, work) => work === 'dispatchWork'
+ },
+ {
+ label: 'Skip Next Station',
+ handler: '',
+ cmdType: '',
+ isShow: (stand, work) => work === 'dispatchWork'
+ },
+ {
+ label: 'Help',
+ handler: '',
+ cmdType: '',
+ isShow: (stand, work) => work === 'dispatchWork'
+ }
+ ],
menuForce: [
{
label: '设置故障',
@@ -113,14 +120,25 @@ export default {
self.doClose();
};
},
+ getMenu(type) {
+ this.menu = [];
+ this[type].forEach(menuItem => {
+ const status = judgeStationControl(this.selected.stationCode, this.selected.deviceStationCode, this.work);
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
+ this.menu.push(menuItem);
+ });
+ },
initMenu(type) {
// 编辑模式菜单列表
switch (type) {
case 'stoppingProfile':
// this.menu = MenuContextHandler.covert(this.StoppingProfile);
+ this.getMenu(type);
break;
case 'know':
// this.menu = MenuContextHandler.covert(this.StoppingProfile);
+ this.getMenu(type);
break;
}
// this.menu = MenuContextHandler.covert(this.menuNormal);
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue b/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue
index 72dec3796..ebc9d8583 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue
@@ -23,6 +23,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
+import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SwitchMenu',
@@ -43,84 +44,67 @@ export default {
default: () => {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
return {
menu: [],
- menuNormal: {
- Local: [
- {
- label: '道岔定位',
- handler: this.locate,
- cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
- },
- {
- label: '道岔反位',
- handler: this.reverse,
- cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
- },
- {
- label: '道岔单锁',
- handler: this.lock,
- cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
- },
- {
- label: '道岔单解',
- handler: this.unlock,
- cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
+ menuNormal: [
+ {
+ label: '道岔定位',
+ handler: this.locate,
+ cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION,
+ isDisabled: (switchDevice, work) => {
+ if (work === 'localWork') {
+ return switchDevice.normalPosition === 1;
+ } else {
+ return switchDevice.normalPosition === 1;
+ }
}
- ],
- Center: [
- {
- label: '道岔定位',
- handler: this.locate,
- cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
- },
- {
- label: '道岔反位',
- handler: this.reverse,
- cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
- },
- {
- label: '道岔单锁',
- handler: this.lock,
- cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
- },
- {
- label: '道岔单解',
- handler: this.unlock,
- cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
+ },
+ {
+ label: '道岔反位',
+ handler: this.reverse,
+ cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION,
+ isDisabled: (switchDevice, work) => {
+ if (work === 'localWork') {
+ return switchDevice.reversePosition === 1;
+ } else {
+ return switchDevice.reversePosition === 1;
+ }
}
- // {
- // label: '设备标签',
- // handler: '',
- // cmdType: '',
- // children: [
- // {
- // label: '创建设备标签',
- // handler: this.createDeviceLabel,
- // cmdType: ''
- // }
- // ]
- // },
- // {
- // label: '模拟',
- // handler: '',
- // cmdType: ''
- // },
- // {
- // label: '选择设备',
- // handler: '',
- // cmdType: ''
- // },
- // {
- // label: '帮助',
- // handler: '',
- // cmdType: ''
- // }
- ]
- },
+ },
+ {
+ label: '道岔单锁',
+ handler: this.lock,
+ cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
+ isDisabled: (switchDevice, work) => {
+ if (work === 'localWork') {
+ return switchDevice.singleLock !== 0;
+ } else {
+ return switchDevice.singleLock !== 0;
+ }
+ }
+ },
+ {
+ label: '道岔单解',
+ handler: this.unlock,
+ cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
+ isDisabled: (switchDevice, work) => {
+ if (work === 'localWork') {
+ return switchDevice.singleLock !== 1;
+ } else {
+ return switchDevice.singleLock !== 1;
+ }
+ }
+ }
+ ],
menuForce: [
{
label: '设置故障',
@@ -166,7 +150,13 @@ export default {
initMenu() {
// 编辑模式菜单列表
// this.menu = MenuContextHandler.covert(this.menuNormal);
-
+ this.menu = [];
+ this.menuNormal.forEach(menuItem => {
+ const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
+ menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
+ menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
+ this.menu.push(menuItem);
+ });
// 故障模式菜单列表
if (this.operatemode === OperateMode.FAULT) {
if (!this.$store.state.scriptRecord.bgSet) {
diff --git a/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue b/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue
index 4c2add4ea..1476dda68 100644
--- a/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue
+++ b/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue
@@ -37,6 +37,12 @@ export default {
default() {
return null;
}
+ },
+ work: {
+ type: String,
+ default() {
+ return '';
+ }
}
},
data() {
diff --git a/src/jmapNew/theme/xian_01/menus/dispatchWorkMenuBar.vue b/src/jmapNew/theme/xian_01/menus/dispatchWorkMenuBar.vue
index 250fd3411..6a66c4dc0 100644
--- a/src/jmapNew/theme/xian_01/menus/dispatchWorkMenuBar.vue
+++ b/src/jmapNew/theme/xian_01/menus/dispatchWorkMenuBar.vue
@@ -5,6 +5,7 @@
+
@@ -37,6 +38,7 @@ import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
// import DeleteRunplanLine from './menuDialog/deleteRunplanLine';
import { EventBus } from '@/scripts/event-bus';
+import MenuSystemTime from './menuSystemTime';
export default {
name: 'DispatchWorkMenuBarXian01',
@@ -53,7 +55,8 @@ export default {
TrainDelete,
ManageUser,
HelpAbout,
- WarningInfo
+ WarningInfo,
+ MenuSystemTime
// DeleteRunplanLine
},
props: {
diff --git a/src/jmapNew/theme/xian_01/menus/localWorkMenuBar.vue b/src/jmapNew/theme/xian_01/menus/localWorkMenuBar.vue
index fce0634b3..519355002 100644
--- a/src/jmapNew/theme/xian_01/menus/localWorkMenuBar.vue
+++ b/src/jmapNew/theme/xian_01/menus/localWorkMenuBar.vue
@@ -5,6 +5,7 @@
+
@@ -37,6 +38,7 @@ import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
// import DeleteRunplanLine from './menuDialog/deleteRunplanLine';
import { EventBus } from '@/scripts/event-bus';
+import MenuSystemTime from './menuSystemTime';
export default {
name: 'LocalWorkMenuBarXian01',
@@ -53,7 +55,8 @@ export default {
// TrainDelete,
ManageUser,
HelpAbout,
- WarningInfo
+ WarningInfo,
+ MenuSystemTime
// DeleteRunplanLine
},
props: {
diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue
index 0045090a7..e07dd9921 100644
--- a/src/jmapNew/theme/xian_01/menus/menuSection.vue
+++ b/src/jmapNew/theme/xian_01/menus/menuSection.vue
@@ -68,7 +68,7 @@ export default {
return section.blockade === 1;
}
},
- isShow: (section, work) => ['01', '02', '03'].includes(section.type)
+ isShow: (section, work) => ['01', '02'].includes(section.type)
},
{
label: '区段解封',
@@ -81,7 +81,7 @@ export default {
return section.blockade !== 1;
}
},
- isShow: (section, work) => ['01', '02', '03'].includes(section.type)
+ isShow: (section, work) => ['01', '02'].includes(section.type)
},
{
label: '故障解锁',
@@ -121,6 +121,7 @@ export default {
return section.cutOff === 1;
}
},
+ roleDisabled: this.work === 'dispatchWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
},
{
@@ -134,6 +135,7 @@ export default {
return section.cutOff !== 1;
}
},
+ roleDisabled: this.work === 'dispatchWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
}
],
@@ -196,7 +198,10 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
- const status = judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work);
+ let status = judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work);
+ if (menuItem.roleDisabled) {
+ status = true;
+ }
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
diff --git a/src/jmapNew/theme/xian_01/menus/menuStationStand.vue b/src/jmapNew/theme/xian_01/menus/menuStationStand.vue
index 45ab92447..81d513375 100644
--- a/src/jmapNew/theme/xian_01/menus/menuStationStand.vue
+++ b/src/jmapNew/theme/xian_01/menus/menuStationStand.vue
@@ -68,8 +68,9 @@ export default {
handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
isDisabled: (stand, work) => {
- if (work === 'localWork') {
- return stand.stationHoldTrain !== 0;
+ const centralStation = this.$store.getters['map/getDeviceByCode'](stand.deviceStationCode);
+ if (centralStation.controlMode === 'Center') {
+ return stand.centerHoldTrain !== 0;
} else {
return stand.stationHoldTrain !== 0;
}
@@ -81,8 +82,9 @@ export default {
handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
isDisabled: (stand, work) => {
- if (work === 'localWork') {
- return stand.stationHoldTrain !== 1;
+ const centralStation = this.$store.getters['map/getDeviceByCode'](stand.deviceStationCode);
+ if (centralStation.controlMode === 'Center') {
+ return stand.centerHoldTrain !== 1;
} else {
return stand.stationHoldTrain !== 1;
}
diff --git a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue
index 0a65f4246..5cb403b64 100644
--- a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue
+++ b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue
@@ -126,12 +126,28 @@ export default {
label: '区段切除',
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF,
+ isDisabled: (section, work) => {
+ if (work === 'localWork') {
+ return false;
+ } else {
+ return section.cutOff === 1;
+ }
+ },
+ roleDisabled: this.work === 'dispatchWork',
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
label: '区段激活',
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE,
+ isDisabled: (section, work) => {
+ if (work === 'localWork') {
+ return false;
+ } else {
+ return section.cutOff !== 1;
+ }
+ },
+ roleDisabled: this.work === 'dispatchWork',
isShow: (switchDevice, work) => work === 'dispatchWork'
},
{
@@ -198,7 +214,10 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
- const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
+ let status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
+ if (menuItem.roleDisabled) {
+ status = true;
+ }
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
diff --git a/src/jmapNew/theme/xian_01/menus/menuSystemTime.vue b/src/jmapNew/theme/xian_01/menus/menuSystemTime.vue
new file mode 100644
index 000000000..4e4b69c41
--- /dev/null
+++ b/src/jmapNew/theme/xian_01/menus/menuSystemTime.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+ {{ $t('display.systemTime.timePause') }}
+
+
+
+
+
{{ dateString }}
+
{{ dayString }}
+
+
+
+
+
+