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 @@