diff --git a/src/iscs/constant/defaultStyle.js b/src/iscs/constant/defaultStyle.js index 70c7c4cc5..55d810b9a 100644 --- a/src/iscs/constant/defaultStyle.js +++ b/src/iscs/constant/defaultStyle.js @@ -1,5 +1,5 @@ export default class defaultStyle { - constructor() { - super(); - } + // constructor() { + // // super(); + // } } diff --git a/src/iscs/constant/deviceStyle.js b/src/iscs/constant/deviceStyle.js new file mode 100644 index 000000000..30d366b60 --- /dev/null +++ b/src/iscs/constant/deviceStyle.js @@ -0,0 +1,17 @@ +const mapDeviceStyle = { + '01': 'chengdu_01', + '02': 'fuzhou_01', + '03': 'bejing_01', + '04': 'chengdu_03', + '06': 'ningbo_01', + '07': 'haerbin_01', + '08': 'foshan_01', + '09': 'xian_02', + '10': 'xian_01', // 西安一号线 + '11': 'xian_01', // 西安三号线 + '12': 'ningbo_03' // 宁波三号线 +}; + +export function selectLineCode(code) { + return Object.assign({}, require(`./skinCode/${mapDeviceStyle[code || '02']}`).default); +} diff --git a/src/iscs/constant/skinCode/fuzhou_01.js b/src/iscs/constant/skinCode/fuzhou_01.js index dc35ba575..ee90e6726 100644 --- a/src/iscs/constant/skinCode/fuzhou_01.js +++ b/src/iscs/constant/skinCode/fuzhou_01.js @@ -4,6 +4,7 @@ import deviceType from '../../constant/deviceType'; class SkinCode extends defaultStyle { constructor() { super(); + this.lineCode = '02'; } } export default new SkinCode(); diff --git a/src/iscs/constant/skinCode/haerbin_01.js b/src/iscs/constant/skinCode/haerbin_01.js index 0765b2615..c567d8a05 100644 --- a/src/iscs/constant/skinCode/haerbin_01.js +++ b/src/iscs/constant/skinCode/haerbin_01.js @@ -4,9 +4,7 @@ import deviceType from '../../constant/deviceType'; class SkinCode extends defaultStyle { constructor() { super(); - this[deviceType.EntranceGuard] = { - - }; + this.lineCode = '07'; } } export default new SkinCode(); diff --git a/src/iscs/iscs.js b/src/iscs/iscs.js index 5128cd07b..d4fb2e9fb 100644 --- a/src/iscs/iscs.js +++ b/src/iscs/iscs.js @@ -8,6 +8,7 @@ import KeyboardController from './keyboardController'; import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser'; import { updateIscsData } from './utils/parser'; import store from '@/store/index_APP_TARGET'; +import { selectLineCode } from './constant/defaultStyle'; const renderer = 'canvas'; const devicePixelRatio = 1; @@ -55,7 +56,6 @@ class Iscs { this.$options.offsetX = config.origin.x; this.$options.offsetY = config.origin.y; } - // 保存原始数据 this.data = config; @@ -110,7 +110,9 @@ class Iscs { if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); } } - + loadStyle(lineCode) { + return selectLineCode(lineCode); + } setCenter(deviceCode) { const device = this.iscsDevice[deviceCode]; if (device && device.instance) { diff --git a/src/iscs/shape/machine.js b/src/iscs/shape/machine.js new file mode 100644 index 000000000..582ecbfff --- /dev/null +++ b/src/iscs/shape/machine.js @@ -0,0 +1,50 @@ +import Group from 'zrender/src/container/Group'; +import Image from 'zrender/src/graphic/Image'; +import Machine_Blue from '@/assets/iscs_icon/afc_machine_blue.png'; +import Machine_Green from '@/assets/iscs_icon/afc_machine_green.png'; +import Machine_Red from '@/assets/iscs_icon/afc_machine_red.png'; + +export default class Machine 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.machineImage = new Image({ + zlevel: this.zlevel, + z: this.z, + style: { + image: Machine_Green, + x: 0, + y: 0, + width: this.model.width, + height: this.model.width / 43 * 54 + } + }); + this.grouper.add(this.machineImage); + this.add(this.grouper); + } + setState(state) { + if (state.status === 'normal') { + this.machineImage.setStyle({image: Machine_Green}); + } else if (state.status === 'alarm') { + this.machineImage.setStyle({image: Machine_Red}); + } else if (state.status === 'unKnown') { + this.machineImage.setStyle({image: Machine_Blue}); + } + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/views/iscs/iscsDraw/icscComponents/button.vue b/src/views/iscs/iscsDraw/icscComponents/button.vue new file mode 100644 index 000000000..eb5e06a49 --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/button.vue @@ -0,0 +1,176 @@ + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/line.vue b/src/views/iscs/iscsDraw/icscComponents/line.vue new file mode 100644 index 000000000..89a2d99ba --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/line.vue @@ -0,0 +1,175 @@ + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/rect.vue b/src/views/iscs/iscsDraw/icscComponents/rect.vue new file mode 100644 index 000000000..76c132e4b --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/rect.vue @@ -0,0 +1,165 @@ + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/stateTable.vue b/src/views/iscs/iscsDraw/icscComponents/stateTable.vue new file mode 100644 index 000000000..42f60172c --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/stateTable.vue @@ -0,0 +1,285 @@ + + + + + diff --git a/src/views/iscs/iscsDraw/icscComponents/text.vue b/src/views/iscs/iscsDraw/icscComponents/text.vue new file mode 100644 index 000000000..4bc17d3b9 --- /dev/null +++ b/src/views/iscs/iscsDraw/icscComponents/text.vue @@ -0,0 +1,158 @@ + + + + diff --git a/src/views/iscs/iscsDraw/iscsAutomatic/index.vue b/src/views/iscs/iscsDraw/iscsAutomatic/index.vue index 157292430..89a9cf455 100644 --- a/src/views/iscs/iscsDraw/iscsAutomatic/index.vue +++ b/src/views/iscs/iscsDraw/iscsAutomatic/index.vue @@ -49,10 +49,10 @@