From f26726055cfeccb7ca8de1a111a13b2ed2efddb4 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 22 Sep 2020 17:51:15 +0800 Subject: [PATCH] =?UTF-8?q?iscs=20=E7=BB=98=E5=9B=BE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs/constant/deviceRender.js | 15 ++ src/iscs/constant/deviceType.js | 4 +- src/iscs/shape/factory.js | 4 + src/iscs/shape/fuzhouPsd.js | 87 +++++++++++ src/iscs/shape/iscsCircle.js | 41 +++++ src/iscs/utils/parser.js | 6 + .../iscs/iscsDraw/icscComponents/circle.vue | 147 ++++++++++++++++++ .../iscs/iscsDraw/icscComponents/triangle.vue | 2 +- .../iscs/iscsDraw/iscsAutomatic/index.vue | 10 +- .../iscsDraw/iscsCommonElem/fuzhouPsd.vue | 110 +++++++++++++ src/views/iscs/iscsDraw/iscsPsd/index.vue | 25 ++- 11 files changed, 442 insertions(+), 9 deletions(-) create mode 100644 src/iscs/shape/fuzhouPsd.js create mode 100644 src/iscs/shape/iscsCircle.js create mode 100644 src/views/iscs/iscsDraw/icscComponents/circle.vue create mode 100644 src/views/iscs/iscsDraw/iscsCommonElem/fuzhouPsd.vue diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index 7f2951d39..f1824b32a 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -333,4 +333,19 @@ deviceRender[deviceType.IscsTriangle] = { zlevel:1, z: 5 }; + +/** 福州 圆形 */ +deviceRender[deviceType.IscsCircle] = { + _type: deviceType.IscsCircle, + zlevel:1, + z: 5 +}; + +/** 福州 屏蔽门 */ +deviceRender[deviceType.FuzhouPsd] = { + _type: deviceType.FuzhouPsd, + zlevel:1, + z: 5 +}; + export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index 18392d076..c94e38467 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -51,7 +51,9 @@ const deviceType = { CommunicationButcher: 'CommunicationButcher', AfcDoorUnite: 'AfcDoorUnite', RectText: 'RectText', - IscsTriangle:'IscsTriangle' + IscsTriangle:'IscsTriangle', + IscsCircle:'IscsCircle', + FuzhouPsd:'FuzhouPsd' }; export default deviceType; diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index 721ee81eb..6b505ca00 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -52,6 +52,8 @@ import CommunicationButcher from './communicationButcher'; import AfcDoorUnite from './afcDoorUnite'; import RectText from './rectText'; import IscsTriangle from './iscsTriangle'; +import IscsCircle from './iscsCircle'; +import FuzhouPsd from './fuzhouPsd'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -108,6 +110,8 @@ iscsShape[deviceType.CommunicationButcher] = CommunicationButcher; iscsShape[deviceType.AfcDoorUnite] = AfcDoorUnite; iscsShape[deviceType.RectText] = RectText; iscsShape[deviceType.IscsTriangle] = IscsTriangle; +iscsShape[deviceType.IscsCircle] = IscsCircle; +iscsShape[deviceType.FuzhouPsd] = FuzhouPsd; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/iscs/shape/fuzhouPsd.js b/src/iscs/shape/fuzhouPsd.js new file mode 100644 index 000000000..e1aa716c3 --- /dev/null +++ b/src/iscs/shape/fuzhouPsd.js @@ -0,0 +1,87 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; + +export default class fuzhouPsd extends Group { + constructor(device) { + super(); + this.model = device.model; + this.zlevel = device.model.zlevel; + this.z = device.model.z; + this._type = device.model._type; + this._code = device.model.code; + this.create(); + this.setState(this.model); + } + create() { + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.fuzhouPsdBorder = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 0, + y: 0, + width: this.model.height * 1.6, + height: this.model.height + }, + style: { + fill: '#c48b19', + stroke: '#f00', + lineWidth: 0 + } + }); + this.fuzhouPsdLeft = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 3 + (this.model.height * 1.6 - 8) * 0.15, + y: 3, + width: (this.model.height * 1.6 - 8) * 0.35, + height: this.model.height - 6 + }, + style: { + fill: '#33CC00', + stroke: '#000', + lineWidth: 1 + } + }); + this.fuzhouPsdRight = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: (this.model.height * 1.6 - 8) * 0.5 + 5, + y: 3, + width: (this.model.height * 1.6 - 8) * 0.35, + height: this.model.height - 6 + }, + style: { + fill: '#33CC00', + stroke: '#000', + lineWidth: 1 + } + }); + this.grouper.add(this.fuzhouPsdBorder); + this.grouper.add(this.fuzhouPsdLeft); + this.grouper.add(this.fuzhouPsdRight); + this.add(this.grouper); + } + setState(model) { + if (model.alarm) { + this.fuzhouPsdBorder.setStyle('lineWidth', 1); + } + if (model.noStatus) { + this.fuzhouPsdLeft.attr({shape:{x: 3}}); + this.fuzhouPsdRight.attr({shape:{x: this.model.height * 1.04 - 0.2}}); + this.fuzhouPsdBorder.setStyle('fill', '#0f96dc'); + this.fuzhouPsdRight.setStyle('fill', '#0f96dc'); + this.fuzhouPsdLeft.setStyle('fill', '#0f96dc'); + } + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } + +} diff --git a/src/iscs/shape/iscsCircle.js b/src/iscs/shape/iscsCircle.js new file mode 100644 index 000000000..e5d6b8e4a --- /dev/null +++ b/src/iscs/shape/iscsCircle.js @@ -0,0 +1,41 @@ +import Group from 'zrender/src/container/Group'; +import Circle from 'zrender/src/graphic/shape/Circle'; + +export default class iscsCircle extends Group { + constructor(device) { + super(); + this.model = device.model; + this._type = device.model._type; + this._code = device.model.code; + this.zlevel = device.model.zlevel; + this.z = device.model.z; + this.create(); + } + create() { + const model = this.model; + this.grouper = new Group({ + id: model.code, + position: [model.point.x, model.point.y] + }); + this.iscsCircle = new Circle({ + zlevel: model.zlevel, + z: model.z, + shape: { + cx:this.model.radius, + cy:this.model.radius, + r:this.model.radius + }, + style: { + fill: this.model.fillColor, + stroke: this.model.strokeColor, + lineWidth: this.model.borderWidth + } + }); + this.grouper.add(this.iscsCircle); + this.add(this.grouper); + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 788d8dc44..e57bd5784 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -202,6 +202,12 @@ export function parser(data) { zrUtil.each(data.iscsTriangleList || [], elem=> { iscsDevice[elem.code] = deviceFactory(deviceType.IscsTriangle, elem); }); + zrUtil.each(data.iscsCircleList || [], elem=> { + iscsDevice[elem.code] = deviceFactory(deviceType.IscsCircle, elem); + }); + zrUtil.each(data.fuzhouPsdList || [], elem=> { + iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouPsd, elem); + }); } return iscsDevice; diff --git a/src/views/iscs/iscsDraw/icscComponents/circle.vue b/src/views/iscs/iscsDraw/icscComponents/circle.vue new file mode 100644 index 000000000..b0195e332 --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/circle.vue @@ -0,0 +1,147 @@ + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/triangle.vue b/src/views/iscs/iscsDraw/icscComponents/triangle.vue index a810e94e3..dd38636be 100644 --- a/src/views/iscs/iscsDraw/icscComponents/triangle.vue +++ b/src/views/iscs/iscsDraw/icscComponents/triangle.vue @@ -106,7 +106,7 @@ export default { x: this.form.x, y: this.form.y }, - code: this.isUpdate ? this.form.code : getUID('IscsTriangle', this.iscs.iscsRectList), + code: this.isUpdate ? this.form.code : getUID('IscsTriangle', this.iscs.iscsTriangleList), _type: 'IscsTriangle', fillColor: this.form.fillColor, borderWidth: this.form.borderWidth, diff --git a/src/views/iscs/iscsDraw/iscsAutomatic/index.vue b/src/views/iscs/iscsDraw/iscsAutomatic/index.vue index a77b2987a..099310688 100644 --- a/src/views/iscs/iscsDraw/iscsAutomatic/index.vue +++ b/src/views/iscs/iscsDraw/iscsAutomatic/index.vue @@ -42,7 +42,7 @@ @deleteDataModel="deleteDataModel" /> - + - + - + - + +
+ + + + + + + + + + + + {{ buttonText }} + 删除 + 取消 + + +
+ + + + + diff --git a/src/views/iscs/iscsDraw/iscsPsd/index.vue b/src/views/iscs/iscsDraw/iscsPsd/index.vue index aa545a283..271d01747 100644 --- a/src/views/iscs/iscsDraw/iscsPsd/index.vue +++ b/src/views/iscs/iscsDraw/iscsPsd/index.vue @@ -50,9 +50,25 @@ @deleteDataModel="deleteDataModel" />
+ + + + + +