diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index adad5885e..2145884b5 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -168,6 +168,12 @@ deviceRender[deviceType.AirConditioner] = { zlevel: 1, z: 4 }; +/** 电源渲染配置 */ +deviceRender[deviceType.IscsPower] = { + _type: deviceType.IscsPower, + zlevel: 1, + z: 5 +}; /** 风量调节阀 */ deviceRender[deviceType.VolumeControlDamper] = { _type: deviceType.VolumeControlDamper, diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index dde28a2e5..0d014fbd8 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -30,6 +30,7 @@ const deviceType = { IscsLine: 'IscsLine', IscsPicture: 'IscsPicture', IscsRect: 'IscsRect', + IscsPower: 'IscsPower', IscsRhombus: 'IscsRhombus', IscsTick: 'IscsTick', IscsArrow: 'IscsArrow', diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index d7b50e63c..215397cbd 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -29,6 +29,7 @@ import BalancedElectric from './bas/balancedElectric'; import IscsText from './text'; import IscsLine from './line'; import IscsRect from './rect'; +import IscsPower from './power'; import IscsPicture from './picture'; import IscsRhombus from './rhombus'; import IscsTick from './tick'; @@ -92,6 +93,7 @@ iscsShape[deviceType.VolumeControlDamper] = VolumeControlDamper; iscsShape[deviceType.IscsText] = IscsText; iscsShape[deviceType.IscsLine] = IscsLine; iscsShape[deviceType.IscsRect] = IscsRect; +iscsShape[deviceType.IscsPower] = IscsPower; iscsShape[deviceType.IscsRhombus] = IscsRhombus; iscsShape[deviceType.IscsTick] = IscsTick; iscsShape[deviceType.IscsArrow] = IscsArrow; diff --git a/src/iscs/shape/power.js b/src/iscs/shape/power.js new file mode 100644 index 000000000..93e75de8a --- /dev/null +++ b/src/iscs/shape/power.js @@ -0,0 +1,73 @@ +import Group from 'zrender/src/container/Group'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; + +export default class Tick 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.iscsLine1 = new Polyline({ + zlevel: model.zlevel, + z: model.z, + shape: { + points: [ + [-model.fontSize, 0], + [model.fontSize, 0] + ] + }, + style: { + stroke: this.model.fillColor, + lineWidth: this.model.borderWidth || 1 + } + }); + this.iscsLine2 = new Polyline({ + zlevel: model.zlevel, + z: model.z, + shape: { + points: [ + [-model.fontSize + 3, model.borderWidth + 3], + [model.fontSize - 3, model.borderWidth + 3] + ] + }, + style: { + stroke: this.model.fillColor, + lineWidth: this.model.borderWidth || 1 + } + }); + this.iscsLine3 = new Polyline({ + zlevel: model.zlevel, + z: model.z, + shape: { + points: [ + [-model.fontSize + 6, model.borderWidth * 2 + 6], + [model.fontSize - 6, model.borderWidth * 2 + 6] + ] + }, + style: { + stroke: this.model.fillColor, + lineWidth: this.model.borderWidth || 1 + } + }); + this.grouper.add(this.iscsLine1); + this.grouper.add(this.iscsLine2); + this.grouper.add(this.iscsLine3); + this.grouper.origin = [0, 0]; + this.grouper.rotation = Math.PI / 180 * (model.rotate || 0); + 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 87c1b3036..b98430fd7 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -130,6 +130,9 @@ export function parser(data) { zrUtil.each(data.iscsTextList || [], elem=> { iscsDevice[elem.code] = deviceFactory(deviceType.IscsText, elem); }); + zrUtil.each(data.iscsPowerList || [], elem=> { + iscsDevice[elem.code] = deviceFactory(deviceType.IscsPower, elem); + }); zrUtil.each(data.iscsLineList || [], elem=> { iscsDevice[elem.code] = deviceFactory(deviceType.IscsLine, elem); }); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index d678bd1fa..524befeac 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,10 +2,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 - BASE_API = 'http://192.168.3.175:9000'; // 张赛 + // BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/iscs/iscsDraw/icscComponents/power.vue b/src/views/iscs/iscsDraw/icscComponents/power.vue new file mode 100644 index 000000000..584df0fe9 --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/power.vue @@ -0,0 +1,146 @@ + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/rhombus.vue b/src/views/iscs/iscsDraw/icscComponents/rhombus.vue index 0ae13be67..2aa486e56 100644 --- a/src/views/iscs/iscsDraw/icscComponents/rhombus.vue +++ b/src/views/iscs/iscsDraw/icscComponents/rhombus.vue @@ -104,7 +104,7 @@ export default { x: this.form.x, y: this.form.y }, - code: this.isUpdate ? this.form.code : getUID('IscsRhombus', this.iscs.iscsRectList), + code: this.isUpdate ? this.form.code : getUID('IscsRhombus', this.iscs.iscsRhombusList), _type: 'IscsRhombus', fillColor: this.form.fillColor, borderWidth: this.form.borderWidth, diff --git a/src/views/iscs/iscsDraw/icscComponents/tick.vue b/src/views/iscs/iscsDraw/icscComponents/tick.vue index 2bf7274cb..e8a284f9a 100644 --- a/src/views/iscs/iscsDraw/icscComponents/tick.vue +++ b/src/views/iscs/iscsDraw/icscComponents/tick.vue @@ -86,7 +86,7 @@ export default { x: this.form.x, y: this.form.y }, - code: this.isUpdate ? this.form.code : getUID('IscsTick', this.iscs.iscsRectList), + code: this.isUpdate ? this.form.code : getUID('IscsTick', this.iscs.iscsTickList), _type: 'IscsTick', fillColor: this.form.fillColor, borderWidth: this.form.borderWidth, diff --git a/src/views/iscs/iscsDraw/iscsPowerMonitoring/index.vue b/src/views/iscs/iscsDraw/iscsPowerMonitoring/index.vue index 9793e4983..cbac245f7 100644 --- a/src/views/iscs/iscsDraw/iscsPowerMonitoring/index.vue +++ b/src/views/iscs/iscsDraw/iscsPowerMonitoring/index.vue @@ -74,6 +74,14 @@ @deleteDataModel="deleteDataModel" /> + + +