From 1c12b88d6d5c90812a4085e681bca936c4d3bdc7 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 7 May 2020 13:35:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=98=BE=E7=A4=BA=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 11 +++++------ src/jmapNew/theme/ningbo_01/model.js | 9 +++++++++ src/jmapNew/transformHandleScreen.js | 11 +++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 1852c8715..f9cb6ed03 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -157,14 +157,13 @@ class Jlmap { } setUpdateScreen(opts) { + const scale = 0.3; this.$painter.updateTransform1( [ - { scaleRate: 0.3, offsetY: -100 }, - { scaleRate: 0.3, offsetY: -300 }, - { scaleRate: 0.3, offsetY: -500 }, - { scaleRate: 0.3, offsetY: -700 }, - { scaleRate: 0.3, offsetY: -900 }, - { scaleRate: 0.3, offsetY: -1100 } + { scaleRate: scale, offsetY: -100 }, + { scaleRate: scale, offsetY: -300 }, + { scaleRate: scale, offsetY: -500 }, + { scaleRate: scale, offsetY: -700 } ], {width: opts.width, height: opts.height}); } diff --git a/src/jmapNew/theme/ningbo_01/model.js b/src/jmapNew/theme/ningbo_01/model.js index b5f49ae6a..c696290aa 100644 --- a/src/jmapNew/theme/ningbo_01/model.js +++ b/src/jmapNew/theme/ningbo_01/model.js @@ -42,6 +42,15 @@ class Model { }; } + handleScreenProps(viewModel) { // 大屏隐藏元素 + const model = viewModel.model; + if (model._type == deviceType.OutFrame || + model._type == deviceType.Text || + model._type == deviceType.AutoTurnBack) { + return true; + } + } + initPublicProps(model) { if (model) { var modelInitial = this.public[model._type]; diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index 7d99e56ad..2fa289655 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -1,5 +1,7 @@ import {createTransform, createBoundingRect} from './utils/parser'; +import Vue from 'vue'; +import store from '@/store/index_APP_TARGET'; class TransformHandle { constructor(painter) { @@ -21,10 +23,15 @@ class TransformHandle { if (view) { for (let i = 0; i < this.transform.length; i++) { view.transform = this.transform[i]; - view.decomposeTransform(); + view.decomposeTransform(); // 修改 transform 后同步位置 + const propConvert = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code); + if (propConvert.handleScreenProps && propConvert.handleScreenProps(view)) { + view.hide(); + return; + } if (this.checkVisible(view)) { view.show(); return; } else { view.hide(); } } - view.dirty(); + view.dirty(); // 更新 } } From 0f81decc2c64e8c4abf7c404525dfda9cf0fe084 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 7 May 2020 13:49:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?iscs=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs/shape/button.js | 50 +++++----- src/iscs/shape/factory.js | 2 + .../iscs/iscsDraw/iscsCommonElem/button.vue | 92 ++++++++++--------- .../iscs/iscsDraw/iscsCommonElem/line.vue | 2 +- .../iscs/iscsDraw/iscsCommonElem/rect.vue | 2 +- .../iscs/iscsDraw/iscsCommonElem/text.vue | 2 +- src/views/iscs/iscsDraw/iscsOperate/index.vue | 17 ++-- 7 files changed, 89 insertions(+), 78 deletions(-) diff --git a/src/iscs/shape/button.js b/src/iscs/shape/button.js index d29fcc56a..79c521a5c 100644 --- a/src/iscs/shape/button.js +++ b/src/iscs/shape/button.js @@ -9,6 +9,7 @@ export default class Button extends Group { this._type = device.model._type; this._code = device.model.code; this.zlevel = device.model.zlevel; + this._function = device.model.function; this.z = device.model.z; this.create(); } @@ -18,36 +19,37 @@ export default class Button extends Group { id: model.code, position: [model.point.x, model.point.y] }); + this.buttonText = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + style: { + x: 0, + y: 0, + fontWeight: 'normal', + fontSize: model.fontSize, + fontFamily: 'consolas', + text: model.context, + textFill: '#FFF', + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'bottom' + } + }); + const textRect = this.buttonText.getBoundingRect(); + this.buttonText.setStyle('textLineHeight', textRect.height); this.buttonRect = new Rect({ zlevel: model.zlevel, z: model.z, shape: { - x: 0, - y: 0, - width: model.width, - height: model.height + x: textRect.x - model.levelPadding, + y: textRect.y - model.verticalPadding, + width: textRect.width + 2 * model.levelPadding, + height: textRect.height + 2 * model.verticalPadding }, style: { - fill: model.fillColor, - stroke: model.strokeColor, - lineWidth: model.borderWidth - } - }); - this.buttonText = new Text({ - zlevel: model.zlevel, - z: model.z, - style: { - x: model.width / 2, - y: model.height / 2, - fontWeight: 'normal', - fontSize: model.height - 2, - fontFamily: 'consolas', - text: model.context, - textFill: model.textFill, - textAlign: 'center', - textPosition: 'inside', - textVerticalAlign: 'middle', - textLineHeight: model.height + fill: '#879096', + stroke: '#132E48', + lineWidth: 1 } }); this.grouper.add(this.buttonRect); diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index d77341832..739456572 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -34,6 +34,7 @@ import FasBrakeMachine from './fasBrakeMachine'; import Staircase from './staircase'; import SingleStaircase from './singleStaircase'; import ArcStatus from './ArcStatus'; +import IscsButton from './button'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -72,6 +73,7 @@ iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine; iscsShape[deviceType.Staircase] = Staircase; iscsShape[deviceType.SingleStaircase] = SingleStaircase; iscsShape[deviceType.ArcStatus] = ArcStatus; +iscsShape[deviceType.IscsButton] = IscsButton; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/views/iscs/iscsDraw/iscsCommonElem/button.vue b/src/views/iscs/iscsDraw/iscsCommonElem/button.vue index de882d517..8c6ca8389 100644 --- a/src/views/iscs/iscsDraw/iscsCommonElem/button.vue +++ b/src/views/iscs/iscsDraw/iscsCommonElem/button.vue @@ -1,25 +1,28 @@