From 1580a89770f32ade72ea76ca6cf5917a46639fd7 Mon Sep 17 00:00:00 2001 From: lVAL Date: Fri, 26 Feb 2021 16:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E8=B7=AF=EF=BC=9A=E5=AE=81=E6=B3=A2?= =?UTF-8?q?=E4=B8=80=EF=BC=8C=E5=8D=97=E4=BA=AC2=20=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=20a.=E5=8D=97=E4=BA=AC2=E7=8E=B0=E5=9C=B0=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E8=BF=9B=E5=85=A5=E5=90=8E=EF=BC=8C=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E7=AB=99=E6=B2=A1=E6=9C=89=E6=8B=86=E5=88=86?= =?UTF-8?q?=E6=88=90=E4=B8=A4=E5=88=97=20b.=E4=BF=AE=E6=94=B9=E5=AE=81?= =?UTF-8?q?=E6=B3=A2=E4=B8=80=EF=BC=8C=E8=AE=BE=E7=BD=AE=E9=80=9A=E8=BF=87?= =?UTF-8?q?dialog=E7=9A=84title=E6=8F=90=E7=A4=BA=20c.=E6=81=A2=E5=A4=8Dsh?= =?UTF-8?q?owStationContent=E5=87=BD=E6=95=B0=E7=9A=84=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=20d.=E5=88=A0=E9=99=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E4=B8=80=E4=BA=9B=E6=97=A0=E7=94=A8=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 88 ++++++++----------- src/jmapNew/shape/Psd/EHorizontal2Door.js | 8 +- .../shape/StationStand/EStationPlatform.js | 3 - .../dialog/childDialog/operateConfirm.vue | 10 ++- .../menuDialog/initializeSignalCanBlock.vue | 1 - src/scripts/GlobalPlugin.js | 16 ---- src/store/modules/exam.js | 10 --- src/store/modules/map.js | 7 ++ src/store/modules/training.js | 2 - src/views/newMap/displayNew/index.vue | 13 ++- src/views/newMap/displayNew/lesson/index.vue | 6 +- src/views/newMap/displayNew/menuSchema.vue | 6 -- .../scriptPreview/scriptButtonGroup.vue | 1 - src/views/newMap/displayNew/selectStation.vue | 1 + src/views/newMap/jlmapNew/index.vue | 20 ++--- 15 files changed, 79 insertions(+), 113 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index fba104b8e..80e8138da 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -200,9 +200,7 @@ class Jlmap { this.setOptions(dcenter); } } else { - setTimeout(() => { - this.setCenter(deviceCode); - }, 60); + setTimeout(() => { this.setCenter(deviceCode); }, 60); } } setRevoverBigScreen() { @@ -269,18 +267,8 @@ class Jlmap { list.forEach(elem => { const code = elem.code; const type = elem._type; - // const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); const oDevice = deviceFactory(type, elem, this.showConfig); - // const nDevice = deepAssign(oDevice || {}, elem); - // if (this.mapDevice[code]) { - // nDevice.instance = this.mapDevice[code].instance; // 保持相同 instance - // } - // this.$painter.delete(oDevice); - // delete this.mapDevice[code]; - // if (!elem._dispose) { - // this.mapDevice[code] = nDevice; - // this.$painter.add(nDevice); // 重新赋值instance - // } + if (this.mapDevice[code]) { this.$painter.delete(this.mapDevice[code]); delete this.mapDevice[code]; @@ -291,15 +279,14 @@ class Jlmap { } }); - if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } + const prdType2ShowMode = { '01': '03', '02': '02'}; + const showMode = prdType2ShowMode[this.showConfig.prdType]; + const stationCode = this.stationCode; + this.updateShowMode(list, showMode); + this.updateShowStation(list, stationCode); - const prdType2ShowMode = { - '01': '03', - '02': '02' - } - this.updateShowMode(list, prdType2ShowMode[this.showConfig.prdType]); - this.updateShowStation(list, this.stationCode); + if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } } // 中间处理 @@ -342,33 +329,6 @@ class Jlmap { getShowConfig() { return this.showConfig; } - updateShowStation(list = [], stationCode = false) { - this.stationCode = stationCode; - store.dispatch('map/setShowCentralizedStationCode', stationCode || ''); - list.forEach(elem => { - const code = elem.code; - const type = elem._type; - const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); - if (oDevice._type === deviceType.Station) { - this.showStationHandleStation(oDevice, stationCode); - } else if (oDevice._type === deviceType.Section) { - this.$painter.updateShowStation(oDevice, stationCode); - this.showStationHandleSection(oDevice, stationCode); - } else if (oDevice._type === deviceType.TrainWindow) { - // 不处理车次窗 勿删 - } else if (oDevice._type === deviceType.Psd) { - this.showStationHandlePsd(oDevice, stationCode); - } else { - this.$painter.updateShowStation(oDevice, stationCode); - } - }); - this.$painter.$transformHandle.revisibleAll(); - if (stationCode) { - this.$painter.$transformHandle.setFoldLines(store.state.map.foldLineMap[stationCode]); - } else { - this.$painter.$transformHandle.setFoldLines([]); - } - } showStationHandlePsd(oDevice, stationCode) { const standDevice = this.mapDevice[oDevice.standCode]; if (standDevice && standDevice.deviceStationCode === stationCode || !stationCode) { @@ -399,6 +359,34 @@ class Jlmap { this.$painter.updateSpecialShowStation(staDevice, false); }); } + } + updateShowStation(list = [], stationCode = '') { + this.stationCode = stationCode; + + store.dispatch('map/setShowCentralizedStationCode', stationCode); + list.forEach(elem => { + const code = elem.code; + const type = elem._type; + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); + if (oDevice._type === deviceType.Station) { + this.showStationHandleStation(oDevice, stationCode); + } else if (oDevice._type === deviceType.Section) { + this.$painter.updateShowStation(oDevice, stationCode); + this.showStationHandleSection(oDevice, stationCode); + } else if (oDevice._type === deviceType.TrainWindow) { + // 不处理车次窗 勿删 + } else if (oDevice._type === deviceType.Psd) { + this.showStationHandlePsd(oDevice, stationCode); + } else { + this.$painter.updateShowStation(oDevice, stationCode); + } + }); + this.$painter.$transformHandle.revisibleAll(); + if (stationCode) { + this.$painter.$transformHandle.setFoldLines(store.state.map.foldLineMap[stationCode]); + } else { + this.$painter.$transformHandle.setFoldLines([]); + } } // 模式选择 -> 更新 updateShowMode(list = [], showMode = '03') { @@ -597,11 +585,13 @@ class Jlmap { const zrHeight = this.$zr.getHeight(); const originX = payload.originX || zrWidth / 2; const originY = payload.originY || zrHeight / 2; - const x = (this.$options.offsetX + originX) / this.$options.scaleRate; + + const x = (this.$options.offsetX + originX) / this.$options.scaleRate; const y = (this.$options.offsetY + originY) / this.$options.scaleRate; const newScaleRate = this.$options.getScaleRate(payload.scale); const dx = originX - (x * newScaleRate - this.$options.offsetX); const dy = originY - (y * newScaleRate - this.$options.offsetY); + payload.dx = dx; payload.dy = dy; } diff --git a/src/jmapNew/shape/Psd/EHorizontal2Door.js b/src/jmapNew/shape/Psd/EHorizontal2Door.js index 8998156f4..3709c3a2f 100644 --- a/src/jmapNew/shape/Psd/EHorizontal2Door.js +++ b/src/jmapNew/shape/Psd/EHorizontal2Door.js @@ -65,7 +65,9 @@ class EHorizontal2Door extends Group { // 开门 if (style.Psd.horizontal2Door.special) { const stationStand = store.getters['map/getDeviceByCode'](this.model.modelData.standCode); - stationStand && stationStand.instance.setState({screenDoorOpenStatus:0}); + stationStand && + stationStand.instance && + stationStand.instance.setState({screenDoorOpenStatus:0}); } this.stand1.setStyle('fill', style.transparentColor); this.stand2.setStyle('fill', style.transparentColor); @@ -73,7 +75,9 @@ class EHorizontal2Door extends Group { // 关门 if (style.Psd.horizontal2Door.special) { const stationStand = store.getters['map/getDeviceByCode'](this.model.modelData.standCode); - stationStand && stationStand.instance.setState({screenDoorOpenStatus:1}); + stationStand && + stationStand.instance && + stationStand.instance.setState({screenDoorOpenStatus:1}); } this.stand1.setStyle('fill', style.Psd.horizontal2Door.defaultColor); this.stand2.setStyle('fill', style.Psd.horizontal2Door.defaultColor); diff --git a/src/jmapNew/shape/StationStand/EStationPlatform.js b/src/jmapNew/shape/StationStand/EStationPlatform.js index 76b8f62b4..468be4737 100644 --- a/src/jmapNew/shape/StationStand/EStationPlatform.js +++ b/src/jmapNew/shape/StationStand/EStationPlatform.js @@ -50,8 +50,6 @@ class EStationPlatform extends Group { this.stationPlatform && this.stationPlatform.setStyle({fill:color}); } recover() { - // console.log(this.model.modelData, 22222222222); - // console.log(this.model.modelData.code, 111111111); const style = this.model.style; this.setColor(style.StationStand.stationPlatform.defaultColor); } @@ -59,7 +57,6 @@ class EStationPlatform extends Group { setState(model) { const style = this.model.style; if (model.stationHoldTrain || model.centerHoldTrain) { - // console.log(model.code, model.stationHoldTrain, model.centerHoldTrain); this.setColor(style.StationStand.stationPlatform.detainColor); } if (model.assignSkip || model.allSkip) { diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/operateConfirm.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/operateConfirm.vue index 5a2481e02..2e799b7f8 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/operateConfirm.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/operateConfirm.vue @@ -4,7 +4,7 @@ class="ningbo-01__systerm confirm-control-speed" :title="title" :visible.sync="show" - width="340px" + width="390px" :before-close="doClose" :z-index="2000" :modal="false" @@ -24,9 +24,10 @@