diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index d464329d5..274fb01e7 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -52,11 +52,18 @@ deviceRender[deviceType.FrozenPump] = { z: 0 }; -/** IbpText渲染配置*/ +/** Vidicon渲染配置*/ deviceRender[deviceType.Vidicon] = { _type: deviceType.Vidicon, zlevel: 1, z: 4 }; +/** VidiconCloud渲染配置*/ +deviceRender[deviceType.VidiconCloud] = { + _type: deviceType.VidiconCloud, + zlevel: 1, + z: 4 +}; + export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index ad36705d5..d77559704 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -1,6 +1,7 @@ const deviceType = { ManualAlarmButton: 'manualAlarmButton', Vidicon: 'Vidicon', + VidiconCloud: 'VidiconCloud', CheckBox: 'CheckBox', FrozenPump:'FrozenPump', FireHydranAlarmButton: 'fireHydranAlarmButton', diff --git a/src/iscs/shape/Vidicon.js b/src/iscs/shape/Vidicon.js index fde5bea83..f90edb516 100644 --- a/src/iscs/shape/Vidicon.js +++ b/src/iscs/shape/Vidicon.js @@ -2,7 +2,7 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; import Polyline from 'zrender/src/graphic/shape/Polyline'; -export default class Button extends Group { +export default class Vidicon extends Group { constructor(device) { super(); this.model = device.model; diff --git a/src/iscs/shape/VidiconCloud.js b/src/iscs/shape/VidiconCloud.js new file mode 100644 index 000000000..ce9604134 --- /dev/null +++ b/src/iscs/shape/VidiconCloud.js @@ -0,0 +1,66 @@ +import Group from 'zrender/src/container/Group'; +import Sector from 'zrender/src/graphic/shape/Sector'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; + +export default class VidiconCloud 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.zlevel; + this.create(); + } + create() { + console.log(this.model, Math.cos(45 * (Math.PI / 180))); + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.semicircle = new Sector({ + zlevel: this.model.zlevel, + z: this.model.z, + shape: { + cx: this.model.point.x, + cy: this.model.point.y, + r: this.model.r || 30, + startAngle: 0, + endAngle: Math.PI, + clockwise: true + }, + style: { + stroke: '#00FF00', + lineWidth: 2, + fill: 'rgba(0,0,0,0)' + } + }); + + this.Polyline = new Polyline({ + zlevel: this.model.zlevel, + z: this.model.z + 1, + shape: { + points: [ + [this.model.point.x + this.model.r / 2, this.model.point.y], + [this.model.point.x - Math.cos(45 * (Math.PI / 180)) * this.model.r, this.model.point.y + Math.sin(45 * (Math.PI / 180)) * this.model.r], + [this.model.point.x - Math.cos(55 * (Math.PI / 180)) * this.model.r, this.model.point.y + Math.sin(55 * (Math.PI / 180)) * this.model.r], + [this.model.point.x + this.model.r / 1.2, this.model.point.y] + ] + }, + style: { + stroke: '#00FF00', + lineWidth: 2, + fill: '#00FF00' + } + }); + + this.grouper.add(this.semicircle); + this.grouper.add(this.Polyline); + this.add(this.grouper); + } + + 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 964b93a36..868c9f610 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -1,5 +1,6 @@ import ManualAlarmButton from './manualAlarmButton'; import Vidicon from './Vidicon'; +import VidiconCloud from './VidiconCloud'; import deviceType from '../constant/deviceType'; import CheckBox from './checkBox'; import FrozenPump from './frozenPump'; @@ -12,6 +13,7 @@ import PlatformScreenDoor from './psd/platformScreenDoor'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; iscsShape[deviceType.Vidicon] = Vidicon; +iscsShape[deviceType.VidiconCloud] = VidiconCloud; iscsShape[deviceType.CheckBox] = CheckBox; iscsShape[deviceType.FrozenPump] = FrozenPump; iscsShape[deviceType.FireHydranAlarmButton] = FireHydranAlarmButton; diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 793303cf6..a4e2a820c 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -40,7 +40,10 @@ export function parser(data) { iscsDevice[elem.code] = deviceFactory(deviceType.ManualAlarmButton, elem); }, this); zrUtil.each(data.vidiconList || [], elem => { - iscsDevice[elem.code] = deviceFactory(deviceType.Vidicon, elem); + iscsDevice[elem.code] = deviceFactory(deviceType.vidiconList, elem); + }, this); + zrUtil.each(data.vidiconCloudList || [], elem => { + iscsDevice[elem.code] = deviceFactory(deviceType.vidiconCloudList, elem); }, this); zrUtil.each(data.frozenPumpList || [], elem => { iscsDevice[elem.code] = deviceFactory(deviceType.FrozenPump, elem); @@ -87,6 +90,12 @@ function updateIscsListByDevice(iscs, name, device) { export function updateIscsData(device) { const iscsData = store.getters['iscs/iscs']; switch (device._type) { + case deviceType.vidiconList : + updateIscsListByDevice(iscsData, 'vidiconList', device); + break; + case deviceType.vidiconCloudList : + updateIscsListByDevice(iscsData, 'vidiconCloudList', device); + break; case deviceType.ManualAlarmButton : updateIscsListByDevice(iscsData, 'manualAlarmButtonList', device); break; diff --git a/src/store/modules/iscs.js b/src/store/modules/iscs.js index d455ffcc5..70df69726 100644 --- a/src/store/modules/iscs.js +++ b/src/store/modules/iscs.js @@ -32,9 +32,16 @@ const iscs = { updateDeviceData: (state) => { return state.updateDeviceData; }, - buttonList: (state) => { - if (state.iscs && state.iscs.buttonList) { - return state.iscs.buttonList; + vidiconList: (state) => { + if (state.iscs && state.iscs.vidiconList) { + return state.iscs.vidiconList; + } else { + return []; + } + }, + vidiconCloudList: (state) => { + if (state.iscs && state.iscs.vidiconCloudList) { + return state.iscs.vidiconCloudList; } else { return []; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 1e9afea51..79d1c6346 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; } diff --git a/src/views/system/configLine/config.vue b/src/views/system/configLine/config.vue index 560c830fa..f6125a6a2 100644 --- a/src/views/system/configLine/config.vue +++ b/src/views/system/configLine/config.vue @@ -4,10 +4,20 @@
- - - - + +