From e0bee230d9fde5022163a11742c992243690b61f Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Mon, 12 Dec 2022 11:04:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/ningbo_01/menus/menuAutoTrunRoute.vue | 16 ++++++++++++++-- src/jmapNew/theme/ningbo_01/menus/menuSignal.vue | 12 ++++++++++++ .../theme/ningbo_01/menus/menuStationControl.vue | 1 - src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue | 12 ++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue index de2216f1f..ea3e602ea 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue @@ -13,6 +13,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { DeviceMenu, OperateMode, TrainingMode } from '@/scripts/ConstDic'; // import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'MenuLimit', @@ -41,12 +42,18 @@ export default { { label: '设置自动折返', handler: this.handlerTurnBack, - cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK + cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK, + isDisabled: (selected, work) => { + return selected.setUp === 1; + } }, { label: '取消自动折返', handler: this.cancelTurnBack, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK, + isDisabled: (selected, work) => { + return selected.setUp === 0; + } } ] }; @@ -75,6 +82,11 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { + 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/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index fcf117ee6..b14e909e7 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -89,11 +89,17 @@ export default { { label: '设置自动通过进路', handler: this.singalPassModel, + isDisabled: (signal, work) => { + return signal.fleetMode === 1; + }, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO }, { label: '取消自动通过进路', handler: this.singalCancelPassModel, + isDisabled: (signal, work) => { + return signal.fleetMode !== 1; + }, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO }, { @@ -109,12 +115,18 @@ export default { label: '封锁', handler: this.lock, cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, + isDisabled: (signal, work) => { + return signal.blockade !== 0; + }, isShow: (selected, work) => work == 'localWork' }, { label: '解封', handler: this.unlock, cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, + isDisabled: (signal, work) => { + return signal.blockade !== 1; + }, isShow: (selected, work) => work == 'localWork' }, { diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue index b2f5c98fc..f33dde531 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue @@ -43,7 +43,6 @@ export default { handler: this.setEmergencyControl, cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL, isDisabled: (selected, work) => { - console.log('🚀 ~ file: menuStationControl.vue:50 ~ data ~ selected', selected.controlMode); return selected.controlMode == 'Emergency'; } }, diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 912decbb7..154c82c76 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -82,24 +82,36 @@ export default { label: '道岔单锁', handler: this.lock, cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, + isDisabled: (station, work) => { + return station.singleLock === 1; + }, isShow: (selected, work) => work == 'localWork' }, { label: '道岔单解', handler: this.unlock, cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, + isDisabled: (station, work) => { + return station.singleLock !== 1; + }, isShow: (selected, work) => work == 'localWork' }, { label: '道岔封锁', handler: this.block, cmdType: CMD.Switch.CMD_SWITCH_BLOCK, + isDisabled: (station, work) => { + return station.blockade === 1; + }, isShow: (selected, work) => work == 'localWork' }, { label: '道岔解封', handler: this.unblock, cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK, + isDisabled: (station, work) => { + return station.blockade !== 1; + }, isShow: (selected, work) => work == 'localWork' }, { From 1b7ecb0aada260349bbcf8e3043b17830e8d2897 Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 12 Dec 2022 11:16:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/baseUrl.js | 2 +- src/views/newMap/display/terminals/index.vue | 7 ++---- .../newMap/display/terminals/terminalMenu.vue | 7 ------ .../trainingDesign/createDraftTraining.vue | 19 +++++++++++++-- .../display/trainingDesign/designPane.vue | 24 +++++++------------ 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 7cc370268..f84210e59 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -27,7 +27,7 @@ export function handlerUrl() { // BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://114.116.51.125/jlcloud'; - BASE_API = 'http://192.168.3.90:9000'; // 周寅 + // BASE_API = 'http://192.168.3.90:9000'; // 周寅 // BASE_API = 'http://192.168.3.94:9000'; // 旭强 // BASE_API = 'http://192.168.3.15:9000'; // 张赛 // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬 diff --git a/src/views/newMap/display/terminals/index.vue b/src/views/newMap/display/terminals/index.vue index 1b200776b..421695b27 100644 --- a/src/views/newMap/display/terminals/index.vue +++ b/src/views/newMap/display/terminals/index.vue @@ -229,6 +229,7 @@ export default { this.picture = val; if (this.picture === 'dispatchWork' && this.lineCode === '14') { this.picture = 'basidi'; + this.$store.dispatch('app/animationsClose'); } this.$store.dispatch('map/setPicture', this.picture); if (val === 'ibp') { @@ -268,11 +269,7 @@ export default { // 设置地图加载状态 mapViewLoaded(loading) { this.loading = loading; - if (loading) { - this.$store.dispatch('app/animationsClose'); - } else { - this.$store.dispatch('app/animationsClose'); - } + this.$store.dispatch('app/animationsClose'); } } }; diff --git a/src/views/newMap/display/terminals/terminalMenu.vue b/src/views/newMap/display/terminals/terminalMenu.vue index 24ca09c47..c41a236b6 100644 --- a/src/views/newMap/display/terminals/terminalMenu.vue +++ b/src/views/newMap/display/terminals/terminalMenu.vue @@ -195,14 +195,12 @@ export default { }, watch: { '$store.state.training.roles': function (val) { - console.log('watch', val); this.initTerminalList(); const trainingDetail = this.$store.state.trainingNew.trainingDetail; if (this.isFirst && this.$route.query.client) { this.isFirst = false; } else { if (trainingDetail && trainingDetail.client) { - console.log(trainingDetail.client, '-----------ee-'); this.changePictureShow(trainingDetail.client); } else { this.initPictureShow(); @@ -230,18 +228,14 @@ export default { }); }, noEvent(code) { - console.log(code, 'noEvent'); this.$emit('pictureChange', code); }, initPictureShow() { - console.log(this.roles, '-----------'); const localWorkRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER', 'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER']; if (localWorkRoleList.includes(this.roles)) { - console.log('00000000000000'); this.changePictureShow('localWork'); } else if (this.roles === 'DISPATCHER') { - console.log('00000001111'); this.changePictureShow('dispatchWork'); } else if (this.roles === 'MAINTAINER') { // 通号 @@ -251,7 +245,6 @@ export default { } }, changePictureShow(code) { - console.log(code, '111111'); this.$emit('loadingChange'); setTimeout(() => { this.$emit('pictureChange', code); diff --git a/src/views/newMap/display/trainingDesign/createDraftTraining.vue b/src/views/newMap/display/trainingDesign/createDraftTraining.vue index eeb5138c9..cd61005cf 100644 --- a/src/views/newMap/display/trainingDesign/createDraftTraining.vue +++ b/src/views/newMap/display/trainingDesign/createDraftTraining.vue @@ -7,7 +7,13 @@ 返回 - + + + + + + + { const cpData = Object.assign({}, this.formModel); + cpData.client = this.tagForm.client; cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags); + console.log(cpData, '----------'); let api = updateTraining; let mes = '编辑'; if (this.isCreate) { diff --git a/src/views/newMap/display/trainingDesign/designPane.vue b/src/views/newMap/display/trainingDesign/designPane.vue index 5e25a7a94..df16efa22 100644 --- a/src/views/newMap/display/trainingDesign/designPane.vue +++ b/src/views/newMap/display/trainingDesign/designPane.vue @@ -84,6 +84,7 @@ @@ -112,7 +113,7 @@