# Conflicts:
#	src/jmap/config/deviceStyle.js
#	src/utils/baseUrl.js
#	src/views/map/runplan/manage/operateMenu.vue
This commit is contained in:
zyy 2019-08-02 14:32:42 +08:00
commit 0b93d7ef16
22 changed files with 82 additions and 145 deletions

View File

@ -24,8 +24,7 @@ class SkinStyle extends defaultStyle {
textVerticalAlign: 'middle', // 文字垂直对齐方式 textVerticalAlign: 'middle', // 文字垂直对齐方式
position: 1 // 区段名称位置 1 上面 -1 下面 0 默认 position: 1 // 区段名称位置 1 上面 -1 下面 0 默认
}, },
mouse: true, mouseOverStyle: {
mouseEvent: {
borderColor: '#fff', borderColor: '#fff',
borderBackgroundColor: '#22DFDF', borderBackgroundColor: '#22DFDF',
textShadowColor: '#22DFDF' textShadowColor: '#22DFDF'
@ -155,8 +154,7 @@ class SkinStyle extends defaultStyle {
/** 信号灯按钮闪烁颜色*/ /** 信号灯按钮闪烁颜色*/
signalButtonLightenColor: '#E4EF50' signalButtonLightenColor: '#E4EF50'
}, },
mouseEvent: true, mouseOverStyle: {
mouse: {
borderLineColor: '#FFFFFF', borderLineColor: '#FFFFFF',
borderLineDash: [3, 3], borderLineDash: [3, 3],
nameBackgroundColor: '#22DFDF', nameBackgroundColor: '#22DFDF',
@ -211,8 +209,7 @@ class SkinStyle extends defaultStyle {
offset: {x: -8, y: 22}, // 运行等级偏移量 offset: {x: -8, y: 22}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色 textColor: '#FFFFFF' // 停站等级字体颜色
}, },
mouseEvent: true, mouseOverStyle: {
mouse: {
borderLineColor: '#FFFFFF', borderLineColor: '#FFFFFF',
borderLineDash: [3, 3] borderLineDash: [3, 3]
} }
@ -244,8 +241,6 @@ class SkinStyle extends defaultStyle {
stationControlRedColor: '#FF0000', stationControlRedColor: '#FF0000',
/** 控制模式黄色*/ /** 控制模式黄色*/
stationControlYellowColor: '#FFFF00', stationControlYellowColor: '#FFFF00',
/** 是否有鼠标悬浮事件 */
mouseEvent: true,
/** 鼠标悬浮样式 */ /** 鼠标悬浮样式 */
mouseOverStyle: { mouseOverStyle: {
fontSize: 10, fontSize: 10,
@ -262,8 +257,7 @@ class SkinStyle extends defaultStyle {
}; };
this[deviceType.Switch] = { this[deviceType.Switch] = {
mouse: true, mouseOverStyle: {
mouseEvent: {
borderBackgroundColor: '#22DFDF', borderBackgroundColor: '#22DFDF',
borderColor: '#fff', borderColor: '#fff',
textShadowColor: '#22DFDF' textShadowColor: '#22DFDF'
@ -297,7 +291,6 @@ class SkinStyle extends defaultStyle {
radiusR: 6, radiusR: 6,
controlColor: '#FFFF00' controlColor: '#FFFF00'
}, },
mouseEvent: true,
mouseOverStyle: { mouseOverStyle: {
fontSize: 10, fontSize: 10,
fontFormat: 'consolas', fontFormat: 'consolas',
@ -318,7 +311,6 @@ class SkinStyle extends defaultStyle {
radiusR: 6, radiusR: 6,
controlColor: '#00FF00' controlColor: '#00FF00'
}, },
mouseEvent: true,
mouseOverStyle: { mouseOverStyle: {
fontSize: 10, fontSize: 10,
fontFormat: 'consolas', fontFormat: 'consolas',
@ -339,7 +331,6 @@ class SkinStyle extends defaultStyle {
radiusR: 6, radiusR: 6,
controlColor: '#ECE9D8' controlColor: '#ECE9D8'
}, },
mouseEvent: true,
mouseOverStyle: { mouseOverStyle: {
fontSize: 10, fontSize: 10,
fontFormat: 'consolas', fontFormat: 'consolas',

View File

@ -61,7 +61,7 @@ export default class LcControl extends Group {
} }
createMouseEvent() { createMouseEvent() {
if (this.style.LcControl.mouseEvent) { if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.mouseoverText = (e) => {

View File

@ -61,7 +61,7 @@ export default class LimitControl extends Group {
} }
createMouseEvent() { createMouseEvent() {
if (this.style.LimitControl.mouseEvent) { if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.mouseoverText = (e) => {

View File

@ -57,7 +57,7 @@ class EMouse extends Group {
x: rect.x + (rect.width / 2), x: rect.x + (rect.width / 2),
y: rect.y + (rect.height / 2), y: rect.y + (rect.height / 2),
text: this.device.model.name, text: this.device.model.name,
textFill: this.device.style.Section.mouseEvent.textShadowColor, // 黄色 textFill: this.device.style.Section.mouseOverStyle.textShadowColor, // 黄色
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.textFontFormat textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.textFontFormat
@ -74,7 +74,7 @@ class EMouse extends Group {
shape: rect, shape: rect,
style: { style: {
lineDash: [3, 3], lineDash: [3, 3],
stroke: this.device.style.Section.mouseEvent.borderColor, stroke: this.device.style.Section.mouseOverStyle.borderColor,
fill: this.device.style.transparentColor fill: this.device.style.transparentColor
} }
}); });

View File

@ -19,10 +19,10 @@ export default class Section extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 5 + parseInt(model.layer || 0); this.z = 5 + parseInt(model.layer || 0);
this.model = model; this.model = model;
this.selected = false;
this.style = style; this.style = style;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model);
} }
create() { create() {
@ -40,39 +40,16 @@ export default class Section extends Group {
if (model.type === '01') { if (model.type === '01') {
this.createAxles(); // 创建计轴 this.createAxles(); // 创建计轴
} }
this.setState(model);
} }
} }
createMouseEvent() { createMouseEvent() {
// 鼠标事件 // 鼠标事件
if (this.style.Section.mouse) { if (this.style.Section.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e.target._subType); });
// this.on('mousedown', this.mouseclick); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
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);
} }
} }

View File

@ -18,8 +18,8 @@ export default class EMouse extends Group {
z: 6, z: 6,
shape: this.device.getBoundingRect(), shape: this.device.getBoundingRect(),
style: { style: {
lineDash: this.style.Signal.mouse.borderLineDash, lineDash: this.style.Signal.mouseOverStyle.borderLineDash,
stroke: this.style.Signal.mouse.borderLineColor, stroke: this.style.Signal.mouseOverStyle.borderLineColor,
fill: this.style.transparentColor fill: this.style.transparentColor
} }
}); });
@ -30,9 +30,9 @@ export default class EMouse extends Group {
z: 5, z: 5,
shape: this.device.sigName.getBoundingRect(), shape: this.device.sigName.getBoundingRect(),
style: { style: {
lineDash: this.style.Signal.mouse.borderLineDash, lineDash: this.style.Signal.mouseOverStyle.borderLineDash,
stroke: this.style.Signal.mouse.borderLineColor, stroke: this.style.Signal.mouseOverStyle.borderLineColor,
fill: this.style.Signal.mouse.nameBackgroundColor fill: this.style.Signal.mouseOverStyle.nameBackgroundColor
} }
}); });
@ -46,7 +46,7 @@ export default class EMouse extends Group {
this.nameRect.show(); this.nameRect.show();
this.lampRect.show(); this.lampRect.show();
this.device.lamps.forEach(elem => { 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); this.device.sigName.setColor(this.style.backgroundColor);
} }

View File

@ -159,7 +159,7 @@ class Signal extends Group {
} }
createMouseEvent() { createMouseEvent() {
if (this.style.Signal.mouseEvent) { if (this.style.Signal.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.onmouseover = (e) => {

View File

@ -14,6 +14,7 @@ export default class Station extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.create(); this.create();
this.setState(model);
} }
create() { create() {
@ -57,7 +58,6 @@ export default class Station extends Group {
this.add(this.stationText); this.add(this.stationText);
this.add(this.mileageText); this.add(this.mileageText);
this.setShowMileageText(model.kmPostShow); this.setShowMileageText(model.kmPostShow);
this.setState(model);
} }
} }

View File

@ -6,9 +6,9 @@ export default class EMouse extends Group {
super(); super();
this.device = device; this.device = device;
this.down = true; this.down = true;
this._create(); this.create();
} }
_create() { create() {
this.text = new Text({ this.text = new Text({
_subType: 'Text', _subType: 'Text',
zlevel: this.device.zlevel, zlevel: this.device.zlevel,
@ -26,6 +26,7 @@ export default class EMouse extends Group {
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
} }
}); });
this.add(this.text); this.add(this.text);
this.text.hide(); this.text.hide();
} }

View File

@ -15,6 +15,7 @@ export default class StationControl extends Group {
this._code = model.code; this._code = model.code;
this._type = model._type; this._type = model._type;
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 1;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.create(); this.create();
@ -28,6 +29,7 @@ export default class StationControl extends Group {
_subType: 'emergency', _subType: 'emergency',
style: this.style, style: this.style,
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z,
point: { point: {
x: model.position.x - this.style.StationControl.stationControlDistance * 3 / 2 + this.style.StationControl.stationOffset.x, x: model.position.x - this.style.StationControl.stationControlDistance * 3 / 2 + this.style.StationControl.stationOffset.x,
y: model.position.y + this.style.StationControl.stationOffset.y y: model.position.y + this.style.StationControl.stationOffset.y
@ -40,6 +42,7 @@ export default class StationControl extends Group {
_subType: 'center', _subType: 'center',
style: this.style, style: this.style,
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z,
point: { point: {
x: model.position.x - this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, x: model.position.x - this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x,
y: model.position.y + this.style.StationControl.stationOffset.y y: model.position.y + this.style.StationControl.stationOffset.y
@ -52,6 +55,7 @@ export default class StationControl extends Group {
_subType: 'substation', _subType: 'substation',
style: this.style, style: this.style,
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z,
point: { point: {
x: model.position.x + this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, x: model.position.x + this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x,
y: model.position.y + this.style.StationControl.stationOffset.y 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); 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({ this.arrowsControl = new EArrow({
zlevel: this.zlevel, zlevel: this.zlevel,
z: 1, z: this.z,
style: this.style, style: this.style,
count: this.count, count: this.count,
drict: 1, drict: 1,
@ -123,15 +127,11 @@ export default class StationControl extends Group {
} }
} }
createMouseEvent() { createMouseEvent() {
if (this.style.ZcControl.mouseEvent) { if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.onmouseover = (e) => { this.mouseEvent.mouseover(e); };
this.mouseEvent.mouseover(e); this.onmouseout = (e) => { this.mouseEvent.mouseout(e); };
};
this.onmouseout = (e) => {
this.mouseEvent.mouseout(e);
};
} }
} }
getShapeTipPoint() { getShapeTipPoint() {

View File

@ -65,8 +65,8 @@ export default class StationDelayUnlock extends Group {
if (this.rect.height < 20) this.rect.height = 20; if (this.rect.height < 20) this.rect.height = 20;
this.table = new Rect({ this.table = new Rect({
zlevel: this.zlevel - 1, zlevel: this.zlevel,
z: this.z, z: this.z - 1,
shape: { shape: {
x: model.position.x - this.lPadding, x: model.position.x - this.lPadding,
y: model.position.y - this.vPadding, y: model.position.y - this.vPadding,

View File

@ -18,8 +18,8 @@ export default class EMouse extends Group {
z: 0, z: 0,
shape: this.device.getBoundingRect(), shape: this.device.getBoundingRect(),
style: { style: {
lineDash: this.style.StationStand.mouse.borderLineDash, lineDash: this.style.StationStand.mouseOverStyle.borderLineDash,
stroke: this.style.StationStand.mouse.borderLineColor, stroke: this.style.StationStand.mouseOverStyle.borderLineColor,
fill: this.style.transparentColor fill: this.style.transparentColor
} }
}); });

View File

@ -140,7 +140,7 @@ class StationStand extends Group {
} }
createMouseEvent() { createMouseEvent() {
if (this.style.StationStand.mouseEvent) { if (this.style.StationStand.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.onmouseover = (e) => {

View File

@ -1,6 +1,5 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
// import Vue from 'vue';
class EMouse extends Group { class EMouse extends Group {
constructor(device) { constructor(device) {
@ -33,8 +32,8 @@ class EMouse extends Group {
style: { style: {
lineWidth: 1, lineWidth: 1,
lineDash: [3, 3], lineDash: [3, 3],
stroke: this.device.style.Switch.mouseEvent.borderColor, stroke: this.device.style.Switch.mouseOverStyle.borderColor,
fill: this.device.style.Switch.mouseEvent.borderBackgroundColor fill: this.device.style.Switch.mouseOverStyle.borderBackgroundColor
} }
}); });
this.add(this.textRect); this.add(this.textRect);
@ -60,7 +59,7 @@ class EMouse extends Group {
shape: Object.assign({ r: 4 }, rect), shape: Object.assign({ r: 4 }, rect),
style: { style: {
lineDash: [3, 3], lineDash: [3, 3],
stroke: this.device.style.Switch.mouseEvent.borderColor, stroke: this.device.style.Switch.mouseOverStyle.borderColor,
fill: this.device.style.transparentColor fill: this.device.style.transparentColor
} }
}); });
@ -69,19 +68,6 @@ class EMouse extends Group {
this.switchBorder.hide(); 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() { mouseout() {
// const section = Vue.prototype.$jlmap.mapDevice[this.device.model.switchSectionCode].instance; // const section = Vue.prototype.$jlmap.mapDevice[this.device.model.switchSectionCode].instance;
// section && section.setTrainWindowEventShow(false); // section && section.setTrainWindowEventShow(false);
@ -93,5 +79,19 @@ class EMouse extends Group {
this.textRect && this.textRect.hide(); this.textRect && this.textRect.hide();
this.device.setState(this.device.model); 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; export default EMouse;

View File

@ -20,39 +20,17 @@ export default class Switch extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 6; this.z = 6;
this._create(); this._create();
this.setState(model);
this.createMouseEvent(); this.createMouseEvent();
this.setState(model);
} }
createMouseEvent() { createMouseEvent() {
// 鼠标事件 // 鼠标事件
if (this.style.Switch.mouse) { if (this.style.Switch.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
// this.on('mousedown', this.mouseclick); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
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();
} }
} }
@ -197,7 +175,7 @@ export default class Switch extends Group {
/** 设置道岔文字颜色*/ /** 设置道岔文字颜色*/
setTextColor(color) { 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) { 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.stopAnimation(false);
this.relocShelter.hide(); this.relocShelter.hide();
this.releaseBackground.hide(); this.releaseBackground.hide();
this.setHasTextBorder(0); 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.setSwitchCoreInvisible(true);
this.locShelter.show(); this.locShelter.show();
this.relocShelter.hide(); this.relocShelter.hide();
this.setTextColor(this.style.Switch.text.switchTextLocateColor);
} }
/** 反位*/ /** 反位*/
@ -248,6 +214,7 @@ export default class Switch extends Group {
this.setSwitchCoreInvisible(true); this.setSwitchCoreInvisible(true);
this.locShelter.hide(); this.locShelter.hide();
this.relocShelter.show(); this.relocShelter.show();
this.setTextColor(this.style.Switch.text.switchInversionColor);
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model.sectionAstatus); this.setSectionState(this.relocShelter.getSection(), 'fill', this.model.sectionAstatus);
} }
@ -257,6 +224,7 @@ export default class Switch extends Group {
this.locShelter.hide(); this.locShelter.hide();
this.relocShelter.hide(); this.relocShelter.hide();
this.setSwitchCoreInvisible(false); this.setSwitchCoreInvisible(false);
this.setTextColor(this.style.Switch.text.switchTextLossColor);
nameFlicker && this.nameTextAnimation(); nameFlicker && this.nameTextAnimation();
} }

View File

@ -10,8 +10,8 @@ export default class TextTrainNumber extends Group {
create() { create() {
const model = this.model; const model = this.model;
this.textTrainNumber = new Text({ this.textTrainNumber = new Text({
zlevel: model.zlevel+1, zlevel: model.zlevel,
z: model.z, z: model.z+1,
style: { style: {
x: parseInt(model.point.x + model.lrPadding), x: parseInt(model.point.x + model.lrPadding),
y: parseInt(model.point.y + model.upPadding), y: parseInt(model.point.y + model.upPadding),

View File

@ -28,8 +28,8 @@ class TrainWindow extends Group {
const point = model.point||model.position; const point = model.point||model.position;
this.trainRect = new Polygon({ this.trainRect = new Polygon({
_subType: 'TrainWindow', _subType: 'TrainWindow',
zlevel: this.zlevel - 1, zlevel: this.zlevel,
z: this.z, z: this.z - 1,
shape: { shape: {
smooth: this.style.TrainWindow.trainWindowSmooth, smooth: this.style.TrainWindow.trainWindowSmooth,
points: [ points: [

View File

@ -60,7 +60,7 @@ export default class ZcControl extends Group {
this.model = model; this.model = model;
} }
createMouseEvent() { createMouseEvent() {
if (this.style.ZcControl.mouseEvent) { if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.mouseoverText = (e) => {

View File

@ -74,7 +74,7 @@
dialogShow: false, dialogShow: false,
loading: false, loading: false,
operate: null, 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: { components: {

View File

@ -74,7 +74,7 @@
dialogShow: false, dialogShow: false,
loading: false, loading: false,
operate: null, 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: { components: {

View File

@ -27,7 +27,6 @@ import ZoomBox from './zoom/zoom';
import ProgressBar from '@/views/components/progressBar/index'; import ProgressBar from '@/views/components/progressBar/index';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'JlmapVisual', name: 'JlmapVisual',
@ -99,27 +98,27 @@ export default {
} }
}, },
created() { created() {
EventBus.$on('viewLoading', (loading) => { eventBus.$on('viewLoading', (loading) => {
this.mapViewLoaded(loading); this.mapViewLoaded(loading);
}); });
EventBus.$on('viewProgressAt', (percentage) => { eventBus.$on('viewProgressAt', (percentage) => {
this.mapViewProgressAt(percentage); this.mapViewProgressAt(percentage);
}); });
EventBus.$on('refresh', () => { eventBus.$on('refresh', () => {
this.refresh(this.$store.state.map.map); this.refresh(this.$store.state.map.map);
}); });
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
beforeDestroy() { async beforeDestroy() {
EventBus.$off('refresh'); await this.$store.dispatch('training/setPrdType', null);
EventBus.$off('viewLoading'); eventBus.$off('refresh');
EventBus.$off('viewProgressAt'); eventBus.$off('viewLoading');
eventBus.$off('viewProgressAt');
if (this.$jlmap) { if (this.$jlmap) {
this.$jlmap.dispose(); this.$jlmap.dispose();
} }
this.$store.dispatch('training/setPrdType', null);
}, },
methods: { methods: {
// jlmap // jlmap

View File

@ -56,10 +56,11 @@
this.loading = true; this.loading = true;
this.editModel.planId = this.selected.id; this.editModel.planId = this.selected.id;
publishRunPlan(this.editModel).then(resp => { publishRunPlan(this.editModel).then(resp => {
this.$message.success('发布运行成功');
this.loading = false; this.loading = false;
if (resp.data && resp.data.length) { if (resp.data && resp.data.length) {
this.$emit('showCheckInfo', { contextList: resp.data }); this.$emit('showCheckInfo', { contextList: resp.data });
} else {
this.$message.success('发布运行成功');
} }
this.close(); this.close();
}).catch(error => { }).catch(error => {