diff --git a/src/ibp/mouseController.js b/src/ibp/mouseController.js index 903ea6e6d..21145a9e5 100644 --- a/src/ibp/mouseController.js +++ b/src/ibp/mouseController.js @@ -199,13 +199,13 @@ class MouseController extends Eventful { // 如果实例有取消选择函数并且被点击,则执行取消选中函数 if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) { // 视图数据设置点击标志,同步执行 - oldDevice['down'] = false; + oldDevice.instance['__down'] = false; oldInstance.mouseEvent['mouseout'](e); } // 如果实例有选中函数并且被点击,则执行选中函数 if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) { - newDevice['down'] = true; + newDevice.instance['__down'] = true; newInstance.mouseEvent['mouseover'](e); } } diff --git a/src/iscs/mouseController.js b/src/iscs/mouseController.js index cd6ad1fc3..44205f387 100644 --- a/src/iscs/mouseController.js +++ b/src/iscs/mouseController.js @@ -166,13 +166,13 @@ class MouseController extends Eventful { // 如果实例有取消选择函数并且被点击,则执行取消选中函数 if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) { // 视图数据设置点击标志,同步执行 - oldDevice['down'] = false; + oldDevice.instance['__down'] = false; oldInstance.mouseEvent['mouseout'](e); } // 如果实例有选中函数并且被点击,则执行选中函数 if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) { - newDevice['down'] = true; + newDevice.instance['__down'] = true; newInstance.mouseEvent['mouseover'](e); } } diff --git a/src/iscs/mouseController1.js b/src/iscs/mouseController1.js index 824361b49..da5fd9db5 100644 --- a/src/iscs/mouseController1.js +++ b/src/iscs/mouseController1.js @@ -176,13 +176,13 @@ class MouseController extends Eventful { // 如果实例有取消选择函数并且被点击,则执行取消选中函数 if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) { // 视图数据设置点击标志,同步执行 - oldDevice['down'] = false; + oldDevice.instance['__down'] = false; oldInstance.mouseEvent['mouseout'](e); } // 如果实例有选中函数并且被点击,则执行选中函数 if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) { - newDevice['down'] = true; + newDevice.instance['__down'] = true; newInstance.mouseEvent['mouseover'](e); } } diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index ac57e4a03..91f55b882 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -242,10 +242,14 @@ class SkinCode extends defaultStyle { textBorderWidth:0, // 字体边框宽度 isSpecialType:true, // 特雷兹特殊类型 noneModeColor:'#ff0', // 无模式时字体颜色 - currentModeColor:'#0f0' // 当前被控制时字体颜色 + currentModeColor:'#0f0', // 当前被控制时字体颜色 + dispatherColor:'#FFF', // 非当前控制 行调控制时字体颜色 + centralizedColor:'#000', // 非当前控制 行值集中站控制时字体颜色 + noCentralizedColor:'#1BFAEB' // 非当前控制 行值非集中站控制时字体颜色 }, kmPostShow: false, // 公里标显示 + syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步 kilometerPosition: 'up', // 公里标朝向 text: { fontSize: 11, // 字体大小 diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index c72b4e8a5..58644d743 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -196,13 +196,13 @@ class MouseController extends Eventful { // 如果实例有取消选择函数并且被点击,则执行取消选中函数 if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) { // 视图数据设置点击标志,同步执行 - oldDevice['down'] = false; + oldDevice.instance['__down'] = false; oldInstance.mouseEvent['mouseout'](e); } // 如果实例有选中函数并且被点击,则执行选中函数 if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) { - newDevice['down'] = true; + newDevice.instance['__down'] = true; newInstance.mouseEvent['mouseover'](e); } } diff --git a/src/jmapNew/shape/AutoTurnBack/EMouse.js b/src/jmapNew/shape/AutoTurnBack/EMouse.js index 47b8e1138..c0eb1a7ac 100644 --- a/src/jmapNew/shape/AutoTurnBack/EMouse.js +++ b/src/jmapNew/shape/AutoTurnBack/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { // this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -37,8 +39,9 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target) { + if (!this.device.__down) { + if (e && + e.target) { this.text.hide(); } else { // this.device.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/AutomacticRoute/EMouse.js b/src/jmapNew/shape/AutomacticRoute/EMouse.js index f2547d8c6..2cf5d2e38 100644 --- a/src/jmapNew/shape/AutomacticRoute/EMouse.js +++ b/src/jmapNew/shape/AutomacticRoute/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -39,8 +41,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/AxleReset/EMouse.js b/src/jmapNew/shape/AxleReset/EMouse.js index fa836611b..26a5b406f 100644 --- a/src/jmapNew/shape/AxleReset/EMouse.js +++ b/src/jmapNew/shape/AxleReset/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { // this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -39,8 +41,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { // this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/GuideLock/EMouse.js b/src/jmapNew/shape/GuideLock/EMouse.js index 1589c764a..4bdbe8731 100644 --- a/src/jmapNew/shape/GuideLock/EMouse.js +++ b/src/jmapNew/shape/GuideLock/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { // this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -37,8 +39,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { // this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/LcControl/EMouse.js b/src/jmapNew/shape/LcControl/EMouse.js index f2547d8c6..2cf5d2e38 100644 --- a/src/jmapNew/shape/LcControl/EMouse.js +++ b/src/jmapNew/shape/LcControl/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -39,8 +41,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/LimitControl/EMouse.js b/src/jmapNew/shape/LimitControl/EMouse.js index c650da217..c4c451e4b 100644 --- a/src/jmapNew/shape/LimitControl/EMouse.js +++ b/src/jmapNew/shape/LimitControl/EMouse.js @@ -29,7 +29,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { this.device.control.setControlColor(this.device.style.LimitControl.mouseOverStyle.arcColor); @@ -40,8 +42,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor); diff --git a/src/jmapNew/shape/SaidLamp/EMouse.js b/src/jmapNew/shape/SaidLamp/EMouse.js index 156f18853..4bd9eb897 100644 --- a/src/jmapNew/shape/SaidLamp/EMouse.js +++ b/src/jmapNew/shape/SaidLamp/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { this.device.control.setControlColor(this.device.deviceStyle.mouseOverStyle.arcColor); @@ -39,8 +41,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { this.device.control.setControlColor(this.device.deviceStyle.lamp.controlColor); diff --git a/src/jmapNew/shape/Section/EMouse.js b/src/jmapNew/shape/Section/EMouse.js index 531584df1..aa5ea60c3 100644 --- a/src/jmapNew/shape/Section/EMouse.js +++ b/src/jmapNew/shape/Section/EMouse.js @@ -161,7 +161,7 @@ class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { + if (!this.device.__down) { if (this.device.model.switchSection && this.device.model.relSwitchCode) { const instance = this.getInstanceByCode(this.device.model.relSwitchCode); if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { diff --git a/src/jmapNew/shape/Signal/EMouse.js b/src/jmapNew/shape/Signal/EMouse.js index da04dc523..e01b44ad7 100644 --- a/src/jmapNew/shape/Signal/EMouse.js +++ b/src/jmapNew/shape/Signal/EMouse.js @@ -51,7 +51,7 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { + if (!this.device.__down) { this.nameRect.hide(); this.lampRect.hide(); this.device.lamps.forEach(elem => { diff --git a/src/jmapNew/shape/Station/EMouse.js b/src/jmapNew/shape/Station/EMouse.js index 7da8fe5c7..156122f5c 100644 --- a/src/jmapNew/shape/Station/EMouse.js +++ b/src/jmapNew/shape/Station/EMouse.js @@ -38,7 +38,7 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { + if (!this.device.__down) { if (e.target) { this.text.hide(); } diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index 9d7e57d6c..cf5d1a42a 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -511,14 +511,28 @@ export default class Station extends Group { if (!this.isShowShape) return; this.recover(); model.controlMode && this['handle' + model.controlMode](); - model.controller && this.handleComplexControl(model.controller); - if (this.style.Station.syncCentralizeStation && model.controlMode && model.centralized) { + // if (this.style.Station.syncCentralizeStation && model.controller && model.centralized) { + // debugger; + // model.chargeStationCodeList.forEach(item => { + // const device = store.getters['map/getDeviceByCode'](item); + // // device.controller = model.controller; + // device && device.instance && device.instance.recover(); + // device && device.instance && device.instance.handleComplexControl(model.controller); + // }); + // // + // } + model.controller && this.handleComplexControl(model.controller); + if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller) && model.centralized) { model.chargeStationCodeList.forEach(item => { const device = store.getters['map/getDeviceByCode'](item); - device.controlMode = model.controlMode; device && device.instance && device.instance.recover(); - device && device.instance && device.instance['handle' + model.controlMode](); + if (model.controller) { + device && device.instance && device.instance.handleComplexControl(model.controller); + } else { + device.controlMode = model.controlMode; + device && device.instance && device.instance['handle' + model.controlMode](); + } }); } if (model.tbStrategyId) { @@ -532,13 +546,26 @@ export default class Station extends Group { } handleComplexControl(controller) { - // debugger; - // store.state.user.id - // if (controller == ) { - // this.stationText.setColor(this.style.Station.stationText.currentModeColor); - // } else { - // debugger; - // } + const memberData = store.state.training.memberData; + if (memberData[controller].userId) { + if (memberData[controller].userId == store.state.user.id) { + this.stationText.setColor(this.style.Station.stationText.currentModeColor); + } else { + if (memberData[controller].type == 'DISPATCHER') { + this.stationText.setColor(this.style.Station.stationText.dispatherColor); + } else if (memberData[controller].type == 'STATION_SUPERVISOR') { + const deviceCode = memberData[controller].deviceCode; + if (deviceCode) { + const device = store.getters['map/getDeviceByCode'](deviceCode); + if (device.centralized) { + this.stationText.setColor(this.style.Station.stationText.centralizedColor); + } else { + this.stationText.setColor(this.style.Station.stationText.noCentralizedColor); + } + } + } + } + } } // setState(model) { diff --git a/src/jmapNew/shape/StationStand/EMouse.js b/src/jmapNew/shape/StationStand/EMouse.js index 4d2ee619a..37955f2e9 100644 --- a/src/jmapNew/shape/StationStand/EMouse.js +++ b/src/jmapNew/shape/StationStand/EMouse.js @@ -56,7 +56,7 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { + if (!this.device.__down) { if (this.style.StationStand.mouseOverStyle.standBackgroundColor) { this.device.solidStand && this.device.solidStand.removeHover(); } diff --git a/src/jmapNew/shape/StationTurnBack/EMouse.js b/src/jmapNew/shape/StationTurnBack/EMouse.js index 47b8e1138..c0eb1a7ac 100644 --- a/src/jmapNew/shape/StationTurnBack/EMouse.js +++ b/src/jmapNew/shape/StationTurnBack/EMouse.js @@ -28,7 +28,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { // this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); @@ -37,8 +39,9 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target) { + if (!this.device.__down) { + if (e && + e.target) { this.text.hide(); } else { // this.device.setControlColor(this.device.style.LcControl.lamp.controlColor); diff --git a/src/jmapNew/shape/Switch/EMouse.js b/src/jmapNew/shape/Switch/EMouse.js index 61e5fadd1..a63394f05 100644 --- a/src/jmapNew/shape/Switch/EMouse.js +++ b/src/jmapNew/shape/Switch/EMouse.js @@ -103,7 +103,7 @@ class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { + if (!this.device.__down) { this.switchBorder && this.switchBorder.hide(); this.device.setTextStyle({ textFill: this.device.style.backgroundColor diff --git a/src/jmapNew/shape/Train/EMouse.js b/src/jmapNew/shape/Train/EMouse.js index 4b1e46fe6..a84a803c9 100644 --- a/src/jmapNew/shape/Train/EMouse.js +++ b/src/jmapNew/shape/Train/EMouse.js @@ -114,23 +114,23 @@ class EMouse extends Group { mouseover() { if (this.device.model.style.Train.common.trainTip) { - this.device.deviceModel.down = true; + this.device.deviceModel.__down = true; this.arrowText.show(); } if (this.device.style.Train.mouseOverStyle) { - this.device.deviceModel.down = true; + this.device.deviceModel.__down = true; this.trainBorder.show(); } } mouseout() { - if (this.device.model.style.Train.common.trainTip && this.device.deviceModel.down) { + if (this.device.model.style.Train.common.trainTip && this.device.deviceModel.__down) { this.arrowText.hide(); - this.device.deviceModel.down = false; + this.device.deviceModel.__down = false; } - if (this.device.style.Train.mouseOverStyle && this.device.deviceModel.down) { + if (this.device.style.Train.mouseOverStyle && this.device.deviceModel.__down) { this.trainBorder.hide(); - this.device.deviceModel.down = false; + this.device.deviceModel.__down = false; } } diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index cc3c80081..17875fbb7 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -23,7 +23,7 @@ export default class TrainBody extends Group { createMouse() { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); - if (this.deviceModel.down) { + if (this.deviceModel.__down) { store.dispatch('map/setTrainDetails', this.deviceModel); this.mouseEvent.mouseover(); } @@ -303,7 +303,7 @@ export default class TrainBody extends Group { removeTrainDetail() { this.mouseEvent.mouseout(); store.dispatch('map/setTrainDetails', null); - this.deviceModel.down = false; + this.deviceModel.__down = false; } setTrainColor(color) { this.trainBodyBox && this.trainBodyBox.setColor('fill', color); diff --git a/src/jmapNew/shape/ZcControl/EMouse.js b/src/jmapNew/shape/ZcControl/EMouse.js index fd8eb1fe8..bedc46d8a 100644 --- a/src/jmapNew/shape/ZcControl/EMouse.js +++ b/src/jmapNew/shape/ZcControl/EMouse.js @@ -29,7 +29,9 @@ export default class EMouse extends Group { this.text.hide(); } mouseover(e) { - if (e.target && e.target._subType == 'Text') { + if (e && + e.target && + e.target._subType == 'Text') { this.text.show(); } else { this.device.control.setControlColor(this.device.style.ZcControl.mouseOverStyle.arcColor); @@ -40,8 +42,10 @@ export default class EMouse extends Group { } mouseout(e) { - if (!this.device.model.down) { - if (e.target && e.target._subType == 'Text') { + if (!this.device.__down) { + if (e && + e.target && + e.target._subType == 'Text') { this.text.hide(); } else { this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor); diff --git a/src/jmapNew/theme/beijing_01/menus/index.vue b/src/jmapNew/theme/beijing_01/menus/index.vue index b421bc928..1c2ae33f3 100644 --- a/src/jmapNew/theme/beijing_01/menus/index.vue +++ b/src/jmapNew/theme/beijing_01/menus/index.vue @@ -78,7 +78,6 @@ export default { this.selected && this.selected.instance && this.selected.instance.mouseEvent) { - this.selected.instance.__over = true; this.selected.instance.mouseEvent.mouseover(); } }) @@ -88,7 +87,7 @@ export default { this.selected && this.selected.instance && this.selected.instance.mouseEvent) { - this.selected.instance.__over = false; + this.selected.instance.__down = false; this.selected.instance.mouseEvent.mouseout(); this.$jlmap.clearEvent(); } diff --git a/src/jmapNew/theme/components/utils/menuItemStatus.js b/src/jmapNew/theme/components/utils/menuItemStatus.js index deea73da2..ebf00be7c 100644 --- a/src/jmapNew/theme/components/utils/menuItemStatus.js +++ b/src/jmapNew/theme/components/utils/menuItemStatus.js @@ -7,7 +7,7 @@ export function mouseCancelState(selected) { const device = Vue.prototype.$jlmap.getDeviceByCode(selected.code); const instance = (device || {}).instance; if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { - device['down'] = false; + device.instance['__down'] = false; instance.mouseEvent.mouseout(Vue.prototype.$jlmap.$zr.curEvent); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/index.vue b/src/jmapNew/theme/ningbo_01/menus/index.vue index 6b42189e4..a52ecabe2 100644 --- a/src/jmapNew/theme/ningbo_01/menus/index.vue +++ b/src/jmapNew/theme/ningbo_01/menus/index.vue @@ -103,6 +103,7 @@ export default { this.selected.instance && this.selected.instance.mouseEvent) { this.selected.instance.__over = false; + this.selected.instance.__down = false; this.selected.instance.mouseEvent.mouseout(); this.$jlmap.clearEvent(); } diff --git a/src/jmapNew/theme/ningbo_01/operationConfig.js b/src/jmapNew/theme/ningbo_01/operationConfig.js index 794aecce1..90bc44960 100644 --- a/src/jmapNew/theme/ningbo_01/operationConfig.js +++ b/src/jmapNew/theme/ningbo_01/operationConfig.js @@ -706,7 +706,7 @@ export default { trainingType: 'Signal', productTypes: ['01', '02'], stepVOList: [ - { deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【人解列车进路】' }, + { deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【人工解锁进路】' }, { deviceType: '04', orderNum: 2, operateCode: '305', tip: '鼠标左键点击【确定】按钮' } ] }, diff --git a/src/jmapNew/theme/ningbo_03/menus/menuBar.vue b/src/jmapNew/theme/ningbo_03/menus/menuBar.vue index a20f1103d..3722ff914 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuBar.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuBar.vue @@ -1344,9 +1344,6 @@ export default { if (list && list.length) { this.checkRoleChange(list); } - }, - '$store.state.training.simulationUserList':function(list) { - debugger; } }, @@ -1356,8 +1353,15 @@ export default { methods: { checkRoleChange(list) { list.forEach(item => { - if ((item.messageType === 'PLAY_CHANGE' || item.messageType == 'ONLINE') && item.userId == this.userId ) { + // || item.messageType == 'ONLINE' + if ((item.messageType === 'PLAY_CHANGE') && item.userId == this.userId ) { + if (item.memberId && item.type) { + // this.$store.dispatch('training/setCurrentRoleInfo', {memberId:item.memberId,type:item.type,deviceCode:}); + } + // currentRole + // this.$store.state; // this.switchShowStation(this.centralizedMap[item.deviceCode]); + // "memberId":"1","type":"DISPATCHER","deviceCode":"Station10002" } }); }, diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue index b4bc0a5be..819f5fcc3 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue @@ -2,7 +2,7 @@ - - - - - + + + + +
{{ message }}
- 确定(O) + 确定(O) - 应用(A) + 应用(A) 关闭(C) @@ -45,7 +45,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; export default { name: 'StationControl', components: { - NoticeInfo + NoticeInfo }, data() { return { @@ -104,11 +104,18 @@ export default { watch: { 'selected': function(val) { if (val) { - const sationEle = this.$store.getters['map/getDeviceByCode'](val.code); - if (this.prdType == '02') { - this.status = sationEle && sationEle.controlMode != 'Center'; - } else { - this.status = sationEle && sationEle.controlMode == 'Center'; + const stationEle = this.$store.getters['map/getDeviceByCode'](val.code); + if (stationEle) { + if (stationEle.controller) { + const memberData = this.$store.state.training.memberData; + if (memberData[stationEle.controller].userId == this.$store.state.user.id) { + this.status = false; + } else { + this.status = true; + } + } else { + this.status = true; + } } } } @@ -116,15 +123,17 @@ export default { methods: { doShow() { this.message = ''; - this.dialogShow = true; - this.$nextTick(e => { - this.$refs.table.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - }) + this.dialogShow = true; + this.$nextTick(e => { + this.$refs.table.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + }); }, doClose() { - this.dialogShow = false; - this.$refs.table.setCurrentRow(); + this.dialogShow = false; + this.status = true; + this.$store.dispatch('menuOperation/setSelected', {device: {}}); + this.$refs.table.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('socket/shiftMsgQueue'); }, @@ -165,7 +174,8 @@ export default { param: {stationCode:val.code} }; - steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL; + // steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL; + steps.cmdType = CMD.Station.CMD_STATION_CONTROL_DEVOLVE; this.$store.dispatch('training/nextNew', steps).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue index d9e99cca2..ec898fa3e 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue @@ -106,12 +106,17 @@ export default { watch: { 'selected': function(val) { if (val) { - const sationEle = this.$store.getters['map/getDeviceByCode'](val.code); - if (sationEle) { - if (sationEle.controller != this.$store.state.user.id) { - this.status = false; + const stationEle = this.$store.getters['map/getDeviceByCode'](val.code); + if (stationEle) { + if (stationEle.controller) { + const memberData = this.$store.state.training.memberData; + if (memberData[stationEle.controller].userId == this.$store.state.user.id) { + this.status = true; + } else { + this.status = false; + } } else { - this.status = true; + this.status = false; } } } @@ -128,6 +133,8 @@ export default { }, doClose() { this.dialogShow = false; + this.status = true; + this.$store.dispatch('menuOperation/setSelected', {device: {}}); this.$refs.table.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('socket/shiftMsgQueue'); @@ -169,7 +176,6 @@ export default { param: {stationCodes:[val.code]} }; // CMD_STATION_CONTROL_TRANSFER - // CMD_STATION_CONTROL_DEVOLVE // CMD_STATION_CONTROL_REVOKE // steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL; steps.cmdType = CMD.Station.CMD_STATION_CONTROL_APPLY; @@ -177,7 +183,6 @@ export default { this.$store.dispatch('training/nextNew', steps).then(({ valid }) => { if (valid) { if (isClose) { - this.$store.dispatch('menuOperation/setSelected', {device: {}}); this.doClose(); } this.$emit('commandSuccess', val.code); diff --git a/src/mixin/CancelMouseState.js b/src/mixin/CancelMouseState.js index 3e8110957..91d736a50 100644 --- a/src/mixin/CancelMouseState.js +++ b/src/mixin/CancelMouseState.js @@ -5,7 +5,7 @@ export default { const device = this.$jlmap.getDeviceByCode(selected.code); const instance = (device || {}).instance; if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { - device['down'] = false; + device.instance['__down'] = false; instance.mouseEvent.mouseout(this.$jlmap.$zr.curEvent); } }