diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index a24b8d7c6..5432ec283 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -92,4 +92,11 @@ deviceRender[deviceType.EndDoor] = { z: 4 }; +/** 圆角边框渲染配置 */ +deviceRender[deviceType.BorderRadius] = { + _type: deviceType.BorderRadius, + zlevel: 1, + z: 4 +}; + export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index 725930728..da0627662 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -12,6 +12,7 @@ const deviceType = { Ventilator:'Ventilator', Chiller:'Chiller', CoolTower:'CoolTower', + BorderRadius: 'borderRadius', EndDoor: 'endDoor' }; diff --git a/src/iscs/shape/borderRadius.js b/src/iscs/shape/borderRadius.js new file mode 100644 index 000000000..0cb2964f9 --- /dev/null +++ b/src/iscs/shape/borderRadius.js @@ -0,0 +1,87 @@ +import Group from 'zrender/src/container/Group'; +import Line from 'zrender/src/graphic/shape/Line'; +import Sector from 'zrender/src/graphic/shape/Sector'; + +export default class BorderRadius 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(); + } + create() { + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.leftSector = new Sector({ + zlevel: this.zlevel, + z: this.z, + shape: { + cx: this.model.height / 2, + cy: this.model.height / 2, + r: this.model.height / 2, + startAngle: Math.PI * 2, + endAngle: Math.PI + }, + style: { + fill: 'rgba(0, 0, 0, 0.1)', + stroke: '#EBEE0C' + } + }); + this.rightSector = new Sector({ + zlevel: this.zlevel, + z: this.z, + shape:{ + cx: this.model.width - this.model.height / 2, + cy: this.model.height / 2, + r: this.model.height / 2, + startAngle: 0, + endAngle: Math.PI + }, + style: { + fill: 'rgba(0, 0, 0, 0.1)', + stroke: '#EBEE0C' + } + }); + this.topLine = new Line({ + zlevel: this.zlevel, + z: this.z, + shape: { + x1: this.model.height / 2, + y1: 0, + x2: this.model.width - this.model.height / 2, + y2: 0 + }, + style: { + lineWidth: 2, + stroke: '#EBEE0C' + } + }); + this.bottomLine = new Line({ + zlevel: this.zlevel, + z: this.z, + shape: { + x1: this.model.height / 2, + y1: this.model.height, + x2: this.model.width - this.model.height / 2, + y2: this.model.height + }, + style: { + lineWidth: 2, + stroke: '#EBEE0C' + } + }); + this.grouper.add(this.leftSector); + this.grouper.add(this.rightSector); + this.grouper.add(this.bottomLine); + this.grouper.add(this.topLine); + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index 305149db1..48e6f578b 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -13,6 +13,7 @@ import Ventilator from './bas/ventilator'; import Chiller from './bas/chiller'; import CoolTower from './bas/coolTower'; import EndDoor from './endDoor'; +import BorderRadius from './borderRadius'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -29,6 +30,7 @@ iscsShape[deviceType.Ventilator] = Ventilator; iscsShape[deviceType.Chiller] = Chiller; iscsShape[deviceType.CoolTower] = CoolTower; iscsShape[deviceType.EndDoor] = EndDoor; +iscsShape[deviceType.BorderRadius] = BorderRadius; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/iscs/shape/stateTable.js b/src/iscs/shape/stateTable.js index 00773fd59..b2f138301 100644 --- a/src/iscs/shape/stateTable.js +++ b/src/iscs/shape/stateTable.js @@ -15,9 +15,10 @@ const mean = { allDoorsCloseInPlace: '所有门关到位', systemDrivePowerFailure: '系统驱动电源故障', systemControlPowerFailure: '系统控制电源故障', - monitorPowerFailure: '监视电源故障' - + monitorPowerFailure: '监视电源故障', + fieldBusFault:'现场总线故障' }; + export default class StateTable extends Group { constructor(device) { super(); diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index de14ac1e4..39ef28ddd 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -83,6 +83,9 @@ export function parser(data) { iscsDevice[elem.code] = deviceFactory(deviceType.EndDoor, elem); }); + zrUtil.each(data.borderRadiusList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.BorderRadius, elem); + } ); } return iscsDevice; @@ -145,6 +148,9 @@ export function updateIscsData(device) { case deviceType.EndDoor: updateIscsListByDevice(iscsData, 'endDoorList', device); break; + case deviceType.BorderRadius: + updateIscsListByDevice(iscsData, 'borderRadius', device); + break; } store.dispatch('iscs/setIscsData', iscsData); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 79d1c6346..1e9afea51 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,11 +3,11 @@ 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.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; }