diff --git a/src/assets/ibp_images/appendage_box.png b/src/assets/ibp_images/appendage_box.png new file mode 100644 index 000000000..687e88e4e Binary files /dev/null and b/src/assets/ibp_images/appendage_box.png differ diff --git a/src/assets/ibp_images/ibp_bg.png b/src/assets/ibp_images/ibp_bg.png index ba2d03cbf..6e48da514 100644 Binary files a/src/assets/ibp_images/ibp_bg.png and b/src/assets/ibp_images/ibp_bg.png differ diff --git a/src/ibp/constant/deviceRender.js b/src/ibp/constant/deviceRender.js index 86e642062..5b9b01671 100644 --- a/src/ibp/constant/deviceRender.js +++ b/src/ibp/constant/deviceRender.js @@ -27,8 +27,8 @@ deviceRender[deviceType.RotatingButton] = { zlevel: 2 }; -/** Tip渲染配置*/ -deviceRender[deviceType.Tip] = { +/** TipBox渲染配置*/ +deviceRender[deviceType.TipBox] = { zlevel: 2 }; diff --git a/src/ibp/constant/deviceType.js b/src/ibp/constant/deviceType.js index 59e79b6b4..c31c54c19 100644 --- a/src/ibp/constant/deviceType.js +++ b/src/ibp/constant/deviceType.js @@ -4,11 +4,12 @@ const deviceType = { WarnButton: 'WarnButton', Arrow: 'Arrow', RotatingButton: 'RotatingButton', - Tip: 'Tip', + TipBox: 'TipBox', Background: 'Background', CircularLamp: 'CircularLamp', IbpLine: 'IbpLine', - AppendageBox: 'AppendageBox' + AppendageBox: 'AppendageBox', + Alarm: 'Alarm' }; export default deviceType; diff --git a/src/ibp/constant/ibpData.js b/src/ibp/constant/ibpData.js index 656fc75cc..0e74a3e8d 100644 --- a/src/ibp/constant/ibpData.js +++ b/src/ibp/constant/ibpData.js @@ -13,6 +13,7 @@ const ibpData = { y: 400 }, length: 488, + width: 10, stroke: '#0000CD', fill: '#0000CD', lineWidth: 1, @@ -27,6 +28,7 @@ const ibpData = { y: 200 }, length: 488, + width: 10, stroke: '#0000CD', fill: '#0000CD', lineWidth: 1, diff --git a/src/ibp/shape/alarm.js b/src/ibp/shape/alarm.js index cc09557d8..b077b3186 100644 --- a/src/ibp/shape/alarm.js +++ b/src/ibp/shape/alarm.js @@ -7,6 +7,7 @@ export default class alarm extends Group { constructor(device) { super(); this.model = device.model; + this.event = device.event; this.zlevel = device.model.zlevel; this.create(); } @@ -20,15 +21,15 @@ export default class alarm extends Group { image: alarmpic, x: model.point.x, y: model.point.y, - width: 70, - height: 74 + width: model.width, + height: model.height } }); this.add(this.imageBg); } setDraggable() { - this.arrow.attr('draggable', true); + this.imageBg.attr('draggable', true); this.createMouseEvent(); } createMouseEvent() { diff --git a/src/ibp/shape/appendageBox.js b/src/ibp/shape/appendageBox.js index eb3dd85e8..2a84a0471 100644 --- a/src/ibp/shape/appendageBox.js +++ b/src/ibp/shape/appendageBox.js @@ -1,5 +1,6 @@ import Group from 'zrender/src/container/Group'; import Image from 'zrender/src/graphic/Image'; +import AppendageBoxImage from '@/assets/ibp_images/appendage_box.png'; export default class AppendageBox extends Group { constructor(device) { @@ -17,7 +18,7 @@ export default class AppendageBox extends Group { z: this.z, draggable: false, style: { - image: '', + image: AppendageBoxImage, x: this.model.point.x, y: this.model.point.y, width: this.model.width, diff --git a/src/ibp/shape/arrow.js b/src/ibp/shape/arrow.js index 166bc364b..9c88aed5a 100644 --- a/src/ibp/shape/arrow.js +++ b/src/ibp/shape/arrow.js @@ -16,9 +16,9 @@ class Arrow extends Group { this.arrow = new Polygon({ zlevel: model.zlevel, z: model.z, - draggable: model.draggable || false, + draggable: false, shape: { - points: arrow(this.model.point.x, this.model.point.y, this.model.length, 10) + points: arrow(this.model.point.x, this.model.point.y, this.model.length, this.model.width) }, style: { stroke: model.stroke, @@ -36,6 +36,14 @@ class Arrow extends Group { this.transformRotation(0); break; } + case 'top': { + this.transformRotation(90); + break; + } + case 'bottom': { + this.transformRotation(270); + break; + } case 'right': { this.transformRotation(180); break; diff --git a/src/ibp/shape/button.js b/src/ibp/shape/button.js index 050fc0a28..2f38ff20e 100644 --- a/src/ibp/shape/button.js +++ b/src/ibp/shape/button.js @@ -28,6 +28,7 @@ export default class button extends Group { super(); this.model = device.model; this.zlevel = device.model.zlevel; + this.event = device.event; this.create(); } create() { @@ -52,7 +53,7 @@ export default class button extends Group { } setDraggable() { - this.arrow.attr('draggable', true); + this.imageBg.attr('draggable', true); this.createMouseEvent(); } createMouseEvent() { @@ -75,7 +76,7 @@ export default class button extends Group { this.open(); this.model.status='off'; break; - } + } } } diff --git a/src/ibp/shape/factory.js b/src/ibp/shape/factory.js index 64a4a7888..17f1d4fcf 100644 --- a/src/ibp/shape/factory.js +++ b/src/ibp/shape/factory.js @@ -6,6 +6,8 @@ import IbpText from './ibpText'; import Alarm from './alarm'; import IbpLine from './ibpLine'; import Button from './button'; +import TipBox from './ibpTipBox'; +import AppendageBox from './appendageBox'; const ibpShape = {}; ibpShape[deviceType.Arrow] = Arrow; @@ -15,6 +17,8 @@ ibpShape[deviceType.IbpText] = IbpText; ibpShape[deviceType.Alarm] = Alarm; ibpShape[deviceType.IbpLine] = IbpLine; ibpShape[deviceType.SquareButton] = Button; +ibpShape[deviceType.TipBox] = TipBox; +ibpShape[deviceType.AppendageBox] = AppendageBox; function shapefactory(device, ibp) { const type = device.model._type; diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpAlarm.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpAlarm.vue index c70116a04..f18511237 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpAlarm.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpAlarm.vue @@ -1,6 +1,6 @@