diff --git a/src/jmap/map.js b/src/jmap/map.js index f31deb5ba..f4e863961 100644 --- a/src/jmap/map.js +++ b/src/jmap/map.js @@ -131,6 +131,7 @@ class Jmap { } setOptions(zoom) { + console.log(zoom, '1111'); this.$options.update(this.pullBack(zoom)); this.$painter.updateZoomTransform(this.$options); if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(); } diff --git a/src/jmap/mouseController.js b/src/jmap/mouseController.js index a188ff00a..8a94f4c2b 100644 --- a/src/jmap/mouseController.js +++ b/src/jmap/mouseController.js @@ -48,7 +48,7 @@ class MouseController extends Eventful { zr.on('click', clickHandler); zr.on('contextmenu', contextmenuHandler); - zr.on('mousemove', moveEventHandler); + // zr.on('mousemove', moveEventHandler); this.enable = function (opts) { opts = opts || {}; diff --git a/src/jmap/shape/Signal/index.js b/src/jmap/shape/Signal/index.js index 8e364ea67..7d64a10c8 100644 --- a/src/jmap/shape/Signal/index.js +++ b/src/jmap/shape/Signal/index.js @@ -193,7 +193,8 @@ class Signal extends Group { // 封锁 block() { this.lamps[0] && this.lamps[0].setColor(this.style.Signal.signalLampRedColor); - this.sigName.setColor(this.style.Signal.sectionBlockTextColor); + // this.sigName.setColor(this.style.Signal.sectionBlockTextColor); + this.sigName.setStyle({'textFill': this.style.Signal.sectionBlockTextColor}); } // 功能封锁 @@ -269,7 +270,8 @@ class Signal extends Group { recover() { this.sigDelay.hide(); this.sigPass.animationRecover(); - this.sigName.setColor(this.style.Signal.signalTextGreen); + // this.sigName.setColor(this.style.Signal.signalTextGreen); + this.sigName.setStyle({'textFill': this.style.Signal.signalTextGreen}); } setState(state) { diff --git a/src/jmap/shape/StationControl/index.js b/src/jmap/shape/StationControl/index.js index b4c4d18a8..be43b3cd3 100644 --- a/src/jmap/shape/StationControl/index.js +++ b/src/jmap/shape/StationControl/index.js @@ -28,8 +28,8 @@ export default class StationControl extends Group { style: this.style, zlevel: this.zlevel, point: { - x: model.position.x - this.style.StationControl.stationControlDistance * 3 / 2, - y: model.position.y + x: model.position.x - this.style.StationControl.stationControlDistance * 3 / 2 + this.style.StationControl.stationOffset.x, + y: model.position.y + this.style.StationControl.stationOffset.y }, context: model.jjzkContent, pop: false @@ -40,8 +40,8 @@ export default class StationControl extends Group { style: this.style, zlevel: this.zlevel, point: { - x: model.position.x - this.style.StationControl.stationControlDistance / 2, - y: model.position.y + x: model.position.x - this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, + y: model.position.y + this.style.StationControl.stationOffset.y }, context: model.zokContent, pop: false @@ -52,8 +52,8 @@ export default class StationControl extends Group { style: this.style, zlevel: this.zlevel, point: { - x: model.position.x + this.style.StationControl.stationControlDistance / 2, - y: model.position.y + x: model.position.x + this.style.StationControl.stationControlDistance / 2 + this.style.StationControl.stationOffset.x, + y: model.position.y + this.style.StationControl.stationOffset.y }, context: model.zakContent, pop: false @@ -69,23 +69,11 @@ export default class StationControl extends Group { count: this.count, drict: 1, point: point, - x: model.position.x, - y: model.position.y + this.style.StationControl.stationControlmodeR / 2, + x: model.position.x + this.style.StationControl.stationOffset.x, + y: model.position.y + this.style.StationControl.stationControlmodeR / 2 + this.style.StationControl.stationOffset.y, fill: this.style.StationControl.stationControlGrayColor, lineWidth: 1, stroke: this.style.sidelineColor - // cursor: 'pointer', - // // 图形元素上绑定事件 - // onmouseover: () => { - // if (model.status == '03') { - // this.add(this.arrowText); - // } - // }, - // onmouseout: () => { - // if (model.status == '03') { - // this.remove(this.arrowText); - // } - // } }); this.add(this.arrowsControl); } diff --git a/src/jmap/shape/element/ETextName.js b/src/jmap/shape/element/ETextName.js index 50056672c..47f331248 100644 --- a/src/jmap/shape/element/ETextName.js +++ b/src/jmap/shape/element/ETextName.js @@ -1,49 +1,67 @@ -import Group from 'zrender/src/container/Group'; +// import Group from 'zrender/src/container/Group'; import Text from 'zrender/src/graphic/Text'; /** 名称元素*/ -export default class ETextName extends Group { - constructor(model) { - super(); - this.model = model; - this.zlevel = model.zlevel; - this.z = model.z; - this._create(); - } - - _create() { - this.TextName = new Text({ - _subType: this.model._subType, - zlevel: this.zlevel, - z: this.z, - silent: this.model.silent || false, - style: { - x: this.model.x, - y: this.model.y, - text: this.model.text, - textFont: this.model.textFont, - textFill: this.model.textFill, - textAlign: this.model.textAlign, - textPosition: this.model.textPosition || 'inside', - textVerticalAlign: this.model.textVerticalAlign || null - } - }); - this.add(this.TextName); - } - - setStyle(model) { - this.TextName.setStyle(model); - } - - setColor(color) { - this.TextName.setStyle('textFill', color); - } - - hide() { - this.TextName.hide(); - } - - show() { - this.TextName.show(); - } +export default function ETextName(model) { + return new Text({ + _subType: model._subType, + zlevel: model.zlevel, + z: model.z, + silent: model.silent || false, + style: { + x: model.x, + y: model.y, + text: model.text, + textFont: model.textFont, + textFill: model.textFill, + textAlign: model.textAlign, + textPosition: model.textPosition || 'inside', + textVerticalAlign: model.textVerticalAlign || null + } + }); } +// export default class ETextName extends Group { +// constructor(model) { +// super(); +// this.model = model; +// this.zlevel = model.zlevel; +// this.z = model.z; +// this._create(); +// } + +// _create() { +// this.TextName = new Text({ +// _subType: this.model._subType, +// zlevel: this.zlevel, +// z: this.z, +// silent: this.model.silent || false, +// style: { +// x: this.model.x, +// y: this.model.y, +// text: this.model.text, +// textFont: this.model.textFont, +// textFill: this.model.textFill, +// textAlign: this.model.textAlign, +// textPosition: this.model.textPosition || 'inside', +// textVerticalAlign: this.model.textVerticalAlign || null +// } +// }); +// this.add(this.TextName); +// } + +// setStyle(model) { +// this.TextName.setStyle(model); +// } + +// setColor(color) { +// this.TextName.setStyle('textFill', color); +// } + +// hide() { +// this.TextName.hide(); +// } + +// show() { +// this.TextName.show(); +// } +// } diff --git a/src/jmap/theme/bejing.js b/src/jmap/theme/bejing.js index a69bf7cbf..a2c393a6f 100644 --- a/src/jmap/theme/bejing.js +++ b/src/jmap/theme/bejing.js @@ -196,7 +196,8 @@ class Beijing extends defaultSkin { }; this[deviceType.StationControl] = { singleControlNum: 3, - arrowsShow: false, + stationOffset: {x: 20, y: 0}, + arrowsShow: false, // 控制模式箭头显隐 /** 控制模式字体大小*/ stationControlTextSize: 10, /** 控制模式灯的半径 */ diff --git a/src/jmap/theme/fuzhou.js b/src/jmap/theme/fuzhou.js index f64fd5ad5..3c8268319 100644 --- a/src/jmap/theme/fuzhou.js +++ b/src/jmap/theme/fuzhou.js @@ -193,7 +193,8 @@ class Fuzhou extends defaultSkin { }; this[deviceType.StationControl] = { singleControlNum: 2, - arrowsShow: true, + stationOffset: {x: 0, y: 0}, + arrowsShow: true, // 控制模式箭头显隐 /** 控制模式字体大小*/ stationControlTextSize: 10, /** 控制模式灯的半径 */ diff --git a/src/views/jmap/index.vue b/src/views/jmap/index.vue index 03a5a387e..8c08585dd 100644 --- a/src/views/jmap/index.vue +++ b/src/views/jmap/index.vue @@ -12,7 +12,7 @@ export default { data() { return { id: '__jmap__', - jmap: null, + jmap: null }; }, mounted() { @@ -37,8 +37,8 @@ export default { viewLoaded() { console.log('viewLoaded'); }, stateLoaded() { console.log('stateLoaded'); }, viewUpdate() { console.log('viewUpdate'); }, - stateUpdate() { console.log('stateUpdate'); }, - optionsUpdate() { console.log('optionsUpdate'); } + stateUpdate() { console.log('stateUpdate'); } + // optionsUpdate() { console.log('optionsUpdate'); } } }); @@ -46,7 +46,7 @@ export default { this.jmap.on('contextmenu', this.contextmenu); // const list = []; - // for (let i = 1; i < 40; i++) { + // for (let i = 1; i < 20; i++) { // for (let j = 1; j < 1000; j++) { // list.push({ code: `${(Array(3).join(0) + i).slice(-3)}${(Array(3).join(0) + j).slice(-3)}`, lp: { x: 50 + i * 120, y: 50 + j * 20 }, rp: { x: 150 + i * 120, y: 50 + j * 20 } }); // } @@ -54,7 +54,7 @@ export default { // this.jmap.load({ skinVO: { code: '02' }, linkList: list }); - getPublishMapDetail('02').then(resp => { + getPublishMapDetail('03').then(resp => { this.jmap.load(resp.data); // this.jmap.setDefaultState(); this.jmap.setLevelInvisible([deviceType.Link]);