diff --git a/src/jmap/config/deviceStyle.js b/src/jmap/config/deviceStyle.js index 93bc1b125..adef27cac 100644 --- a/src/jmap/config/deviceStyle.js +++ b/src/jmap/config/deviceStyle.js @@ -2,7 +2,7 @@ const mapDeviceStyle = { // '01': 'chengdu_04', '02': 'fuzhou_01', '03': 'bejing_01', - '04': 'chengdu_03', + // '03': 'chengdu_03', '05': 'batong_01' // 暂时没有画北京八通线 }; diff --git a/src/jmap/config/skinStyle/bejing_01.js b/src/jmap/config/skinStyle/bejing_01.js index b15867c90..373284fa4 100644 --- a/src/jmap/config/skinStyle/bejing_01.js +++ b/src/jmap/config/skinStyle/bejing_01.js @@ -24,8 +24,7 @@ class SkinStyle extends defaultStyle { textVerticalAlign: 'middle', // 文字垂直对齐方式 position: 1 // 区段名称位置 1 上面 -1 下面 0 默认 }, - mouse: true, - mouseEvent: { + mouseOverStyle: { borderColor: '#fff', borderBackgroundColor: '#22DFDF', textShadowColor: '#22DFDF' @@ -155,8 +154,7 @@ class SkinStyle extends defaultStyle { /** 信号灯按钮闪烁颜色*/ signalButtonLightenColor: '#E4EF50' }, - mouseEvent: true, - mouse: { + mouseOverStyle: { borderLineColor: '#FFFFFF', borderLineDash: [3, 3], nameBackgroundColor: '#22DFDF', @@ -211,8 +209,7 @@ class SkinStyle extends defaultStyle { offset: {x: -8, y: 22}, // 运行等级偏移量 textColor: '#FFFFFF' // 停站等级字体颜色 }, - mouseEvent: true, - mouse: { + mouseOverStyle: { borderLineColor: '#FFFFFF', borderLineDash: [3, 3] } @@ -244,8 +241,6 @@ class SkinStyle extends defaultStyle { stationControlRedColor: '#FF0000', /** 控制模式黄色*/ stationControlYellowColor: '#FFFF00', - /** 是否有鼠标悬浮事件 */ - mouseEvent: true, /** 鼠标悬浮样式 */ mouseOverStyle: { fontSize: 10, @@ -262,8 +257,7 @@ class SkinStyle extends defaultStyle { }; this[deviceType.Switch] = { - mouse: true, - mouseEvent: { + mouseOverStyle: { borderBackgroundColor: '#22DFDF', borderColor: '#fff', textShadowColor: '#22DFDF' @@ -297,7 +291,6 @@ class SkinStyle extends defaultStyle { radiusR: 6, controlColor: '#FFFF00' }, - mouseEvent: true, mouseOverStyle: { fontSize: 10, fontFormat: 'consolas', @@ -318,7 +311,6 @@ class SkinStyle extends defaultStyle { radiusR: 6, controlColor: '#00FF00' }, - mouseEvent: true, mouseOverStyle: { fontSize: 10, fontFormat: 'consolas', @@ -339,7 +331,6 @@ class SkinStyle extends defaultStyle { radiusR: 6, controlColor: '#ECE9D8' }, - mouseEvent: true, mouseOverStyle: { fontSize: 10, fontFormat: 'consolas', diff --git a/src/jmap/shape/LcControl/index.js b/src/jmap/shape/LcControl/index.js index f75535829..7aed8e788 100644 --- a/src/jmap/shape/LcControl/index.js +++ b/src/jmap/shape/LcControl/index.js @@ -61,7 +61,7 @@ export default class LcControl extends Group { } createMouseEvent() { - if (this.style.LcControl.mouseEvent) { + if (this.style.LcControl.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); this.mouseoverText = (e) => { diff --git a/src/jmap/shape/LimitControl/index.js b/src/jmap/shape/LimitControl/index.js index 942d90a94..e4cd7428c 100644 --- a/src/jmap/shape/LimitControl/index.js +++ b/src/jmap/shape/LimitControl/index.js @@ -61,7 +61,7 @@ export default class LimitControl extends Group { } createMouseEvent() { - if (this.style.LimitControl.mouseEvent) { + if (this.style.LimitControl.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); this.mouseoverText = (e) => { diff --git a/src/jmap/shape/Section/EMouse.js b/src/jmap/shape/Section/EMouse.js index 83a5b3d20..ada372efe 100644 --- a/src/jmap/shape/Section/EMouse.js +++ b/src/jmap/shape/Section/EMouse.js @@ -57,7 +57,7 @@ class EMouse extends Group { x: rect.x + (rect.width / 2), y: rect.y + (rect.height / 2), text: this.device.model.name, - textFill: this.device.style.Section.mouseEvent.textShadowColor, // 黄色 + textFill: this.device.style.Section.mouseOverStyle.textShadowColor, // 黄色 textAlign: 'middle', textVerticalAlign: 'top', textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.textFontFormat @@ -74,7 +74,7 @@ class EMouse extends Group { shape: rect, style: { lineDash: [3, 3], - stroke: this.device.style.Section.mouseEvent.borderColor, + stroke: this.device.style.Section.mouseOverStyle.borderColor, fill: this.device.style.transparentColor } }); diff --git a/src/jmap/shape/Section/index.js b/src/jmap/shape/Section/index.js index 94a6a4e30..1ab846001 100644 --- a/src/jmap/shape/Section/index.js +++ b/src/jmap/shape/Section/index.js @@ -18,10 +18,10 @@ export default class Section extends Group { this.zlevel = model.zlevel; this.z = 5 + parseInt(model.layer || 0); this.model = model; - this.selected = false; this.style = style; this.create(); this.createMouseEvent(); + this.setState(model); } create() { @@ -38,39 +38,16 @@ export default class Section extends Group { if (model.type === '01') { this.createAxles(); // 创建计轴 } - this.setState(model); } } createMouseEvent() { // 鼠标事件 - if (this.style.Section.mouse) { + if (this.style.Section.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); - - // this.on('mousedown', this.mouseclick); - this.on('mouseout', this.mouseleave); - this.on('mouseover', this.mouseenter); - } - } - mouseclick(e) { - if ([3].includes(e.which)) { - this.selected = !this.selected; - if (this.selected) { - this.mouseEvent.mouseover(e.target._subType); - } - } - } - - mouseenter(e) { - if (!this.selected) { - this.mouseEvent.mouseover(e.target._subType); - } - } - - mouseleave(e) { - if (!this.selected) { - this.mouseEvent.mouseout(e); + this.on('mouseout', (e) => { this.mouseEvent.mouseout(e.target._subType); }); + this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); } } diff --git a/src/jmap/shape/Signal/EMouse.js b/src/jmap/shape/Signal/EMouse.js index 7920adb2e..cd6ad0083 100644 --- a/src/jmap/shape/Signal/EMouse.js +++ b/src/jmap/shape/Signal/EMouse.js @@ -18,8 +18,8 @@ export default class EMouse extends Group { z: 6, shape: this.device.getBoundingRect(), style: { - lineDash: this.style.Signal.mouse.borderLineDash, - stroke: this.style.Signal.mouse.borderLineColor, + lineDash: this.style.Signal.mouseOverStyle.borderLineDash, + stroke: this.style.Signal.mouseOverStyle.borderLineColor, fill: this.style.transparentColor } }); @@ -30,9 +30,9 @@ export default class EMouse extends Group { z: 5, shape: this.device.sigName.getBoundingRect(), style: { - lineDash: this.style.Signal.mouse.borderLineDash, - stroke: this.style.Signal.mouse.borderLineColor, - fill: this.style.Signal.mouse.nameBackgroundColor + lineDash: this.style.Signal.mouseOverStyle.borderLineDash, + stroke: this.style.Signal.mouseOverStyle.borderLineColor, + fill: this.style.Signal.mouseOverStyle.nameBackgroundColor } }); @@ -46,7 +46,7 @@ export default class EMouse extends Group { this.nameRect.show(); this.lampRect.show(); this.device.lamps.forEach(elem => { - elem.setBorderColor(this.style.Signal.mouse.lampBorderLineColor); + elem.setBorderColor(this.style.Signal.mouseOverStyle.lampBorderLineColor); }); this.device.sigName.setColor(this.style.backgroundColor); } diff --git a/src/jmap/shape/Signal/index.js b/src/jmap/shape/Signal/index.js index 71e5bdced..e24cdd1be 100644 --- a/src/jmap/shape/Signal/index.js +++ b/src/jmap/shape/Signal/index.js @@ -159,7 +159,7 @@ class Signal extends Group { } createMouseEvent() { - if (this.style.Signal.mouseEvent) { + if (this.style.Signal.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); this.onmouseover = (e) => { diff --git a/src/jmap/shape/Station/index.js b/src/jmap/shape/Station/index.js index f7027b80c..51876658d 100644 --- a/src/jmap/shape/Station/index.js +++ b/src/jmap/shape/Station/index.js @@ -14,6 +14,7 @@ export default class Station extends Group { this.model = model; this.style = style; this.create(); + this.setState(model); } create() { @@ -57,7 +58,6 @@ export default class Station extends Group { this.add(this.stationText); this.add(this.mileageText); this.setShowMileageText(model.kmPostShow); - this.setState(model); } } diff --git a/src/jmap/shape/StationControl/EMouse.js b/src/jmap/shape/StationControl/EMouse.js index c1f6c8e75..00c03aca2 100644 --- a/src/jmap/shape/StationControl/EMouse.js +++ b/src/jmap/shape/StationControl/EMouse.js @@ -6,9 +6,9 @@ export default class EMouse extends Group { super(); this.device = device; this.down = true; - this._create(); + this.create(); } - _create() { + create() { this.text = new Text({ _subType: 'Text', zlevel: this.device.zlevel, @@ -26,6 +26,7 @@ export default class EMouse extends Group { textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign } }); + this.add(this.text); this.text.hide(); } diff --git a/src/jmap/shape/StationControl/index.js b/src/jmap/shape/StationControl/index.js index 2daed0595..22eaa3eed 100644 --- a/src/jmap/shape/StationControl/index.js +++ b/src/jmap/shape/StationControl/index.js @@ -15,6 +15,7 @@ export default class StationControl extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + this.z = 1; this.model = model; this.style = style; this.create(); @@ -28,6 +29,7 @@ export default class StationControl extends Group { _subType: 'emergency', style: this.style, zlevel: this.zlevel, + z: this.z, point: { x: model.position.x - this.style.StationControl.stationControlDistance * 3 / 2 + this.style.StationControl.stationOffset.x, y: model.position.y + this.style.StationControl.stationOffset.y @@ -40,6 +42,7 @@ export default class StationControl extends Group { _subType: 'center', style: this.style, zlevel: this.zlevel, + z: this.z, point: { x: model.position.x - this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, y: model.position.y + this.style.StationControl.stationOffset.y @@ -52,6 +55,7 @@ export default class StationControl extends Group { _subType: 'substation', style: this.style, zlevel: this.zlevel, + z: this.z, point: { x: model.position.x + this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, y: model.position.y + this.style.StationControl.stationOffset.y @@ -65,7 +69,7 @@ export default class StationControl extends Group { const point = arrows(this.model.position.x, this.model.position.y + this.style.StationControl.stationControlmodeR / 2, this.style.StationControl.stationControlDistance / 6, this.style.StationControl.stationControlmodeR * 0.8); this.arrowsControl = new EArrow({ zlevel: this.zlevel, - z: 1, + z: this.z, style: this.style, count: this.count, drict: 1, @@ -123,15 +127,11 @@ export default class StationControl extends Group { } } createMouseEvent() { - if (this.style.ZcControl.mouseEvent) { + if (this.style.ZcControl.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); - this.onmouseover = (e) => { - this.mouseEvent.mouseover(e); - }; - this.onmouseout = (e) => { - this.mouseEvent.mouseout(e); - }; + this.onmouseover = (e) => { this.mouseEvent.mouseover(e); }; + this.onmouseout = (e) => { this.mouseEvent.mouseout(e); }; } } getShapeTipPoint() { diff --git a/src/jmap/shape/StationDelayUnlock/index.js b/src/jmap/shape/StationDelayUnlock/index.js index d41840cff..7dd0e7006 100644 --- a/src/jmap/shape/StationDelayUnlock/index.js +++ b/src/jmap/shape/StationDelayUnlock/index.js @@ -65,8 +65,8 @@ export default class StationDelayUnlock extends Group { if (this.rect.height < 20) this.rect.height = 20; this.table = new Rect({ - zlevel: this.zlevel - 1, - z: this.z, + zlevel: this.zlevel, + z: this.z - 1, shape: { x: model.position.x - this.lPadding, y: model.position.y - this.vPadding, diff --git a/src/jmap/shape/StationStand/EMouse.js b/src/jmap/shape/StationStand/EMouse.js index 586ef2506..bc3b85a5c 100644 --- a/src/jmap/shape/StationStand/EMouse.js +++ b/src/jmap/shape/StationStand/EMouse.js @@ -18,8 +18,8 @@ export default class EMouse extends Group { z: 0, shape: this.device.getBoundingRect(), style: { - lineDash: this.style.StationStand.mouse.borderLineDash, - stroke: this.style.StationStand.mouse.borderLineColor, + lineDash: this.style.StationStand.mouseOverStyle.borderLineDash, + stroke: this.style.StationStand.mouseOverStyle.borderLineColor, fill: this.style.transparentColor } }); diff --git a/src/jmap/shape/StationStand/index.js b/src/jmap/shape/StationStand/index.js index 2c3c11398..a5298bcd6 100644 --- a/src/jmap/shape/StationStand/index.js +++ b/src/jmap/shape/StationStand/index.js @@ -158,7 +158,7 @@ class StationStand extends Group { } createMouseEvent() { - if (this.style.StationStand.mouseEvent) { + if (this.style.StationStand.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); this.onmouseover = (e) => { diff --git a/src/jmap/shape/Switch/EMouse.js b/src/jmap/shape/Switch/EMouse.js index 0a0db390c..6cbe814df 100644 --- a/src/jmap/shape/Switch/EMouse.js +++ b/src/jmap/shape/Switch/EMouse.js @@ -1,6 +1,5 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; -// import Vue from 'vue'; class EMouse extends Group { constructor(device) { @@ -33,8 +32,8 @@ class EMouse extends Group { style: { lineWidth: 1, lineDash: [3, 3], - stroke: this.device.style.Switch.mouseEvent.borderColor, - fill: this.device.style.Switch.mouseEvent.borderBackgroundColor + stroke: this.device.style.Switch.mouseOverStyle.borderColor, + fill: this.device.style.Switch.mouseOverStyle.borderBackgroundColor } }); this.add(this.textRect); @@ -60,7 +59,7 @@ class EMouse extends Group { shape: Object.assign({ r: 4 }, rect), style: { lineDash: [3, 3], - stroke: this.device.style.Switch.mouseEvent.borderColor, + stroke: this.device.style.Switch.mouseOverStyle.borderColor, fill: this.device.style.transparentColor } }); @@ -69,19 +68,6 @@ class EMouse extends Group { this.switchBorder.hide(); } - mouseover() { - // 显示车次窗 - // const section = Vue.prototype.$jlmap.mapDevice[this.device.model.switchSectionCode].instance; - // section && section.setTrainWindowEventShow(true); - - this.switchBorder && this.switchBorder.show(); - this.device.setLossAction(false); - this.device.setSwitchCoreColor(this.device.style.Switch.mouseEvent.borderBackgroundColor); - this.device.setTextStyle({ - textFill: '#000' - }); - this.textRect && this.textRect.show(); - } mouseout() { // const section = Vue.prototype.$jlmap.mapDevice[this.device.model.switchSectionCode].instance; // section && section.setTrainWindowEventShow(false); @@ -93,5 +79,19 @@ class EMouse extends Group { this.textRect && this.textRect.hide(); this.device.setState(this.device.model); } + + mouseover() { + // 显示车次窗 + // const section = Vue.prototype.$jlmap.mapDevice[this.device.model.switchSectionCode].instance; + // section && section.setTrainWindowEventShow(true); + + this.switchBorder && this.switchBorder.show(); + this.device.setLossAction(false); + this.device.setSwitchCoreColor(this.device.style.Switch.mouseOverStyle.borderBackgroundColor); + this.device.setTextStyle({ + textFill: '#000' + }); + this.textRect && this.textRect.show(); + } } export default EMouse; diff --git a/src/jmap/shape/Switch/index.js b/src/jmap/shape/Switch/index.js index ab04fa08d..c5ac63f9b 100644 --- a/src/jmap/shape/Switch/index.js +++ b/src/jmap/shape/Switch/index.js @@ -20,39 +20,17 @@ export default class Switch extends Group { this.zlevel = model.zlevel; this.z = 6; this._create(); - this.setState(model); this.createMouseEvent(); + this.setState(model); } createMouseEvent() { // 鼠标事件 - if (this.style.Switch.mouse) { + if (this.style.Switch.mouseOverStyle) { this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); - - // this.on('mousedown', this.mouseclick); - this.on('mouseout', this.mouseleave); - this.on('mouseover', this.mouseenter); - } - } - mouseclick(e) { - if ([3].includes(e.which)) { - this.selected = !this.selected; - if (this.selected) { - this.mouseEvent.mouseover(); - } - } - } - - mouseenter(e) { - if (!this.selected) { - this.mouseEvent.mouseover(); - } - } - - mouseleave() { - if (!this.selected) { - this.mouseEvent.mouseout(); + this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); + this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); } } @@ -197,7 +175,7 @@ export default class Switch extends Group { /** 设置道岔文字颜色*/ setTextColor(color) { - this.name.getNameText().setStyle('textFill', color); + this.name.getNameText().setStyle({textFill: color}); } /** 设置道岔背景颜色*/ @@ -207,7 +185,7 @@ export default class Switch extends Group { /** 设置道岔文字边框颜色 */ setHasTextBorder(width) { - this.name.getTextRect().setStyle('lineWidth', width); + this.name.getTextRect().setStyle({lineWidth: width}); } /** 恢复状态*/ @@ -218,20 +196,7 @@ export default class Switch extends Group { this.relocShelter.stopAnimation(false); this.relocShelter.hide(); this.releaseBackground.hide(); - this.setHasTextBorder(0); - - switch (this.model.locateType) { - case '01': - this.setTextColor(this.style.Switch.text.switchTextLocateColor); - break; - case '02': - this.setTextColor(this.style.Switch.text.switchInversionColor); - break; - default: - this.setTextColor(this.style.Switch.text.switchTextLossColor); - break; - } } /** 定位*/ @@ -240,6 +205,7 @@ export default class Switch extends Group { this.setSwitchCoreInvisible(true); this.locShelter.show(); this.relocShelter.hide(); + this.setTextColor(this.style.Switch.text.switchTextLocateColor); } /** 反位*/ @@ -248,6 +214,7 @@ export default class Switch extends Group { this.setSwitchCoreInvisible(true); this.locShelter.hide(); this.relocShelter.show(); + this.setTextColor(this.style.Switch.text.switchInversionColor); this.setSectionState(this.relocShelter.getSection(), 'fill', this.model.sectionAstatus); } @@ -257,6 +224,7 @@ export default class Switch extends Group { this.locShelter.hide(); this.relocShelter.hide(); this.setSwitchCoreInvisible(false); + this.setTextColor(this.style.Switch.text.switchTextLossColor); nameFlicker && this.nameTextAnimation(); } diff --git a/src/jmap/shape/Train/TrainBody/TextTrainNumber.js b/src/jmap/shape/Train/TrainBody/TextTrainNumber.js index 0e5f19a66..546fe4444 100644 --- a/src/jmap/shape/Train/TrainBody/TextTrainNumber.js +++ b/src/jmap/shape/Train/TrainBody/TextTrainNumber.js @@ -10,8 +10,8 @@ export default class TextTrainNumber extends Group { create() { const model = this.model; this.textTrainNumber = new Text({ - zlevel: model.zlevel+1, - z: model.z, + zlevel: model.zlevel, + z: model.z+1, style: { x: parseInt(model.point.x + model.lrPadding), y: parseInt(model.point.y + model.upPadding), diff --git a/src/jmap/shape/TrainWindow/index.js b/src/jmap/shape/TrainWindow/index.js index 9a896ed78..a98c1aeb4 100644 --- a/src/jmap/shape/TrainWindow/index.js +++ b/src/jmap/shape/TrainWindow/index.js @@ -28,8 +28,8 @@ class TrainWindow extends Group { const point = model.point||model.position; this.trainRect = new Polygon({ _subType: 'TrainWindow', - zlevel: this.zlevel - 1, - z: this.z, + zlevel: this.zlevel, + z: this.z - 1, shape: { smooth: this.style.TrainWindow.trainWindowSmooth, points: [ diff --git a/src/jmap/theme/beijing_01/menus/menuDialog/viewName.vue b/src/jmap/theme/beijing_01/menus/menuDialog/viewName.vue index d52460b2f..3d84f07ba 100644 --- a/src/jmap/theme/beijing_01/menus/menuDialog/viewName.vue +++ b/src/jmap/theme/beijing_01/menus/menuDialog/viewName.vue @@ -74,7 +74,7 @@ dialogShow: false, loading: false, operate: null, - nameLevels: [1, 2, 4, 5, 6, 7, 8, 10, 11, 12], + nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12], } }, components: { diff --git a/src/jmap/theme/chengdou_03/menus/menuDialog/viewName.vue b/src/jmap/theme/chengdou_03/menus/menuDialog/viewName.vue index db2b5142d..e960f8c95 100644 --- a/src/jmap/theme/chengdou_03/menus/menuDialog/viewName.vue +++ b/src/jmap/theme/chengdou_03/menus/menuDialog/viewName.vue @@ -74,7 +74,7 @@ dialogShow: false, loading: false, operate: null, - nameLevels: [1, 2, 4, 5, 6, 7, 8, 10, 11, 12], + nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12], } }, components: { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 3f8bc9aeb..eac39207e 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { - // BASE_API = 'https://joylink.club/jlcloud' - BASE_API = 'https://test.joylink.club/jlcloud' - // BASE_API = 'http://192.168.3.5:9010' // 袁琪 - // BASE_API = 'http://192.168.3.6:9010'; // 旭强 - // BASE_API = 'http://192.168.3.4:9010' // 琰培 + // BASE_API = 'https://joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.4:9000'; // 琰培 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue index 0dcbcd7b5..fcd6d1d93 100644 --- a/src/views/jlmap/index.vue +++ b/src/views/jlmap/index.vue @@ -27,7 +27,6 @@ import ZoomBox from './zoom/zoom'; import ProgressBar from '@/views/components/progressBar/index'; import { mapGetters } from 'vuex'; import { TrainingMode } from '@/scripts/ConstDic'; -import { EventBus } from '@/scripts/event-bus'; export default { name: 'JlmapVisual', @@ -99,27 +98,27 @@ export default { } }, created() { - EventBus.$on('viewLoading', (loading) => { - this.mapViewLoaded(loading); + eventBus.$on('viewLoading', (loading) => { + this.mapViewLoaded(loading); }); - EventBus.$on('viewProgressAt', (percentage) => { - this.mapViewProgressAt(percentage); + eventBus.$on('viewProgressAt', (percentage) => { + this.mapViewProgressAt(percentage); }); - EventBus.$on('refresh', () => { - this.refresh(this.$store.state.map.map); + eventBus.$on('refresh', () => { + this.refresh(this.$store.state.map.map); }); }, mounted() { this.initLoadPage(); }, - beforeDestroy() { - EventBus.$off('refresh'); - EventBus.$off('viewLoading'); - EventBus.$off('viewProgressAt'); + async beforeDestroy() { + await this.$store.dispatch('training/setPrdType', null); + eventBus.$off('refresh'); + eventBus.$off('viewLoading'); + eventBus.$off('viewProgressAt'); if (this.$jlmap) { this.$jlmap.dispose(); } - this.$store.dispatch('training/setPrdType', null); }, methods: { // 初始化jlmap diff --git a/src/views/map/runplan/manage/operateMenu.vue b/src/views/map/runplan/manage/operateMenu.vue index b8db972e7..1daef0314 100644 --- a/src/views/map/runplan/manage/operateMenu.vue +++ b/src/views/map/runplan/manage/operateMenu.vue @@ -80,7 +80,7 @@ let self = this; window.onclick = function (e) { self.doClose(); - }; + } }, methods: { doShow(point) { @@ -129,7 +129,6 @@ }, importChart(file) { let skinStyle = this.selected ? this.selected.id : null; - const that = this; if (file && skinStyle) { const loading = this.$loading({ lock: true, @@ -157,11 +156,10 @@ if (wb) { try { let jsonData = []; - const PlanConvert = that.$theme.loadPlanConvert(skinStyle); + let PlanConvert = that.$theme.loadPlanConvert(skinStyle); for (let index in wb.Sheets) { jsonData = PlanConvert.importData(wb.Sheets[index], jsonData); } - console.log(jsonData, '解析数据'); importRunPlan({ skinStyle: skinStyle, runPlanList: jsonData }).then(response => { loading.close(); diff --git a/src/views/map/runplan/manage/publish.vue b/src/views/map/runplan/manage/publish.vue index cff68cbcc..61600f2f4 100644 --- a/src/views/map/runplan/manage/publish.vue +++ b/src/views/map/runplan/manage/publish.vue @@ -56,10 +56,11 @@ this.loading = true; this.editModel.planId = this.selected.id; publishRunPlan(this.editModel).then(resp => { - this.$message.success('发布运行成功'); this.loading = false; if (resp.data && resp.data.length) { this.$emit('showCheckInfo', { contextList: resp.data }); + } else { + this.$message.success('发布运行成功'); } this.close(); }).catch(error => {