From 089b8960b9b7c9164749aeb4daeba17ca12edfe5 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 24 Mar 2020 18:01:10 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BD=9B=E5=B1=B1=E7=BA=BF=E8=B7=AF?= =?UTF-8?q?=E7=8E=B0=E5=9C=B0=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Switch/EMouse.js | 220 ++++++++-------- src/jmapNew/theme/foshan_01/menus/index.vue | 6 +- .../theme/foshan_01/menus/menuButton.vue | 242 +++++++++--------- .../theme/foshan_01/menus/menuSection.vue | 10 +- .../theme/foshan_01/menus/menuSignal.vue | 50 ++-- .../theme/foshan_01/menus/menuSwitch.vue | 60 ++--- .../dialog/childDialog/confirmControl.vue | 24 -- 7 files changed, 294 insertions(+), 318 deletions(-) diff --git a/src/jmapNew/shape/Switch/EMouse.js b/src/jmapNew/shape/Switch/EMouse.js index 5ae837984..5185dd030 100644 --- a/src/jmapNew/shape/Switch/EMouse.js +++ b/src/jmapNew/shape/Switch/EMouse.js @@ -2,127 +2,127 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; import store from '@/store'; class EMouse extends Group { - constructor(device) { - super(); - this.device = device; - this.create(); - this.craeteSwitchBorder(); - } - create() { - if (this.device.name) { - // 创建锁闭框 - const rect = this.device.name.getNameText().getBoundingRect(); - let textWidth = rect.width * 0.8; - if (this.device.triangle.drictx !== 1) { - // rect.x += rect.width; - textWidth = -textWidth; - } + constructor(device) { + super(); + this.device = device; + this.create(); + this.craeteSwitchBorder(); + } + create() { + if (this.device.name) { + // 创建锁闭框 + const rect = this.device.name.getNameText().getBoundingRect(); + let textWidth = rect.width * 0.8; + if (this.device.triangle.drictx !== 1) { + // rect.x += rect.width; + textWidth = -textWidth; + } - this.textRect = new Rect({ - zlevel: this.device.zlevel, - z: this.device.z, - silent: true, - shape: { - x: rect.x, - y: rect.y, - width: textWidth, - height: rect.height - }, - style: { - lineWidth: 1, - lineDash: [3, 3], - stroke: this.device.style.Switch.mouseOverStyle.borderColor, - fill: this.device.style.Switch.mouseOverStyle.borderBackgroundColor - } - }); - this.add(this.textRect); - this.textRect.hide(); - } - } + this.textRect = new Rect({ + zlevel: this.device.zlevel, + z: this.device.z, + silent: true, + shape: { + x: rect.x, + y: rect.y, + width: textWidth, + height: rect.height + }, + style: { + lineWidth: 1, + lineDash: [3, 3], + stroke: this.device.style.Switch.mouseOverStyle.borderColor, + fill: this.device.style.Switch.mouseOverStyle.borderBackgroundColor + } + }); + this.add(this.textRect); + this.textRect.hide(); + } + } - // 创建道岔边框 - craeteSwitchBorder() { - const sectionA = this.getInstanceByCode(this.device.model.sectionACode); - const sectionB = this.getInstanceByCode(this.device.model.sectionBCode); - const sectionC = this.getInstanceByCode(this.device.model.sectionCCode); - const rect = this.device.getBoundingRect(); + // 创建道岔边框 + craeteSwitchBorder() { + const sectionA = this.getInstanceByCode(this.device.model.sectionACode); + const sectionB = this.getInstanceByCode(this.device.model.sectionBCode); + const sectionC = this.getInstanceByCode(this.device.model.sectionCCode); + const rect = this.device.getBoundingRect(); - sectionA && rect.union(sectionA.getBoundingRect()); - sectionB && rect.union(sectionB.getBoundingRect()); - sectionC && rect.union(sectionC.getBoundingRect()); + sectionA && rect.union(sectionA.getBoundingRect()); + sectionB && rect.union(sectionB.getBoundingRect()); + sectionC && rect.union(sectionC.getBoundingRect()); - this.switchBorder = new Rect({ - zlevel: this.device.model.zlevel, - z: this.device.z, - silent: true, - shape: Object.assign({ r: 4 }, rect), - style: { - lineDash: [3, 3], - stroke: this.device.style.Switch.mouseOverStyle.borderColor, - fill: this.device.style.transparentColor - } - }); + this.switchBorder = new Rect({ + zlevel: this.device.model.zlevel, + z: this.device.z, + silent: true, + shape: Object.assign({ r: 4 }, rect), + style: { + lineDash: [3, 3], + stroke: this.device.style.Switch.mouseOverStyle.borderColor, + fill: this.device.style.transparentColor + } + }); - this.add(this.switchBorder); - this.switchBorder.hide(); - } + this.add(this.switchBorder); + this.switchBorder.hide(); + } - getInstanceByCode(code) { - return (store.getters['map/getDeviceByCode'](code) || {}).instance; - } + getInstanceByCode(code) { + return (store.getters['map/getDeviceByCode'](code) || {}).instance; + } - mouseout(e) { - if (!this.device.model.down) { - this.switchBorder && this.switchBorder.hide(); - this.device.setTextStyle({ - textFill: this.device.style.backgroundColor - }); - this.textRect && this.textRect.hide(); - this.device.setState(this.device.model); + mouseout(e) { + if (!this.device.model.down) { + this.switchBorder && this.switchBorder.hide(); + this.device.setTextStyle({ + textFill: this.device.style.backgroundColor + }); + this.textRect && this.textRect.hide(); + this.device.setState(this.device.model); - const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {}; - const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; - const instance = this.getInstanceByCode(parentSection.trainWindowCode); - if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) { - instance.mouseEvent.mouseLeave(e); - } - } - } + const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {}; + const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; + const instance = this.getInstanceByCode(parentSection.trainWindowCode); + if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) { + instance.mouseEvent.mouseLeave(e); + } + } + } - mouseover(e) { - 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(); + mouseover(e) { + 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(); - const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {}; - const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; - const instance = this.getInstanceByCode(parentSection.trainWindowCode); - if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) { - instance.mouseEvent.mouseEnter(e); - } - } + const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {}; + const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; + const instance = this.getInstanceByCode(parentSection.trainWindowCode); + if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) { + instance.mouseEvent.mouseEnter(e); + } + } - mouseEnter(e) { - 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(); - } + mouseEnter(e) { + 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(); + } - mouseLeave(e) { - this.switchBorder && this.switchBorder.hide(); - this.device.setTextStyle({ - textFill: this.device.style.backgroundColor - }); - this.textRect && this.textRect.hide(); - this.device.setState(this.device.model); - } + mouseLeave(e) { + this.switchBorder && this.switchBorder.hide(); + this.device.setTextStyle({ + textFill: this.device.style.backgroundColor + }); + this.textRect && this.textRect.hide(); + this.device.setState(this.device.model); + } } export default EMouse; diff --git a/src/jmapNew/theme/foshan_01/menus/index.vue b/src/jmapNew/theme/foshan_01/menus/index.vue index e80fc73b5..080ba8fe9 100644 --- a/src/jmapNew/theme/foshan_01/menus/index.vue +++ b/src/jmapNew/theme/foshan_01/menus/index.vue @@ -3,7 +3,7 @@