diff --git a/src/iscs/iscs.js b/src/iscs/iscs.js index c6f6a20c4..45740d63e 100644 --- a/src/iscs/iscs.js +++ b/src/iscs/iscs.js @@ -116,6 +116,13 @@ class Iscs { // loadStyle(lineCode) { // return selectLineCode(lineCode); // } + hideShowElementType(deviceType, subType) { + for (const val in this.iscsDevice) { + if (this.iscsDevice[val].model._type === deviceType && this.iscsDevice[val].model.type.includes(subType)) { + this.$painter.hideShowElement(this.iscsDevice[val]); + } + } + } setCenter(deviceCode) { const device = this.iscsDevice[deviceCode]; diff --git a/src/iscs/painter.js b/src/iscs/painter.js index 0bbf14f1e..3871a39eb 100644 --- a/src/iscs/painter.js +++ b/src/iscs/painter.js @@ -53,7 +53,10 @@ class Painter { this.add(device); }); } - + /** 视图显影控制 */ + hideShowElement(device) { + device.instance.hideShowElement(); + } /** * 添加视图 * @param {*} device diff --git a/src/iscs/shape/button.js b/src/iscs/shape/button.js index 13dc4d329..9ad606999 100644 --- a/src/iscs/shape/button.js +++ b/src/iscs/shape/button.js @@ -112,28 +112,28 @@ export default class Button extends Group { this.grouper.add(this.textButtonRect); this.grouper.add(this.lineLeftTop); this.grouper.add(this.lineBottomRight); - if (this.model.function == 'ElementShow') { - this.textButtonRectSmall = new Rect({ - zlevel: model.zlevel, - z: model.z, - z2: model.z2 || 0, - shape: { - x: textRect.x - model.levelPadding + 6, - y: textRect.y - model.verticalPadding + 6, - width: textRect.width + 2 * model.levelPadding - 12, - height: textRect.height + 2 * model.verticalPadding - 12, - }, - style: { - lineWidth: model.isTransparent ? 0: 2, - fill: model.fillColor||'rgba(0,0,0,0)', - stroke: '#908A90' - } - }); - this.grouper.add(this.textButtonRectSmall); - this.textButtonRect.setStyle({fill: model.fillColor||'#D1C2C2'}); - this.lineLeftTop.setStyle({stroke: '#ffffff'}); - this.lineBottomRight.setStyle({stroke: '#948390'}); - } else { + // if (this.model.function == 'ElementShow') { + // this.textButtonRectSmall = new Rect({ + // zlevel: model.zlevel, + // z: model.z, + // z2: model.z2 || 0, + // shape: { + // x: textRect.x - model.levelPadding + 6, + // y: textRect.y - model.verticalPadding + 6, + // width: textRect.width + 2 * model.levelPadding - 12, + // height: textRect.height + 2 * model.verticalPadding - 12, + // }, + // style: { + // lineWidth: model.isTransparent ? 0: 2, + // fill: model.fillColor||'rgba(0,0,0,0)', + // stroke: '#908A90' + // } + // }); + // this.grouper.add(this.textButtonRectSmall); + // this.textButtonRect.setStyle({fill: model.fillColor||'#D1C2C2'}); + // this.lineLeftTop.setStyle({stroke: '#ffffff'}); + // this.lineBottomRight.setStyle({stroke: '#948390'}); + // } else { this.on('mousedown', (e) => { this.textButtonRect.setStyle({fill: model.fillColorActive}); this.lineLeftTop.setStyle({stroke: '#696969'}); @@ -144,8 +144,7 @@ export default class Button extends Group { this.lineLeftTop.setStyle({stroke: '#FFFFFF'}); this.lineBottomRight.setStyle({stroke: '#696969'}); }); - } - + // } } this.grouper.add(this.buttonText); this.add(this.grouper); diff --git a/src/iscs/shape/picture.js b/src/iscs/shape/picture.js index a63cd87e7..570eaed78 100644 --- a/src/iscs/shape/picture.js +++ b/src/iscs/shape/picture.js @@ -72,12 +72,12 @@ import fireDamperGreen from '@/assets/iscs_picture/fireDamper_green.png'; import alarmLampRed from '@/assets/iscs_picture/alarmLamp_red.png'; import alarmLampBlue from '@/assets/iscs_picture/alarmLamp_blue.png'; import alarmLampGreen from '@/assets/iscs_picture/alarmLamp_green.png'; -import bgStationA from '@/assets/iscs_picture/bg-station-A.png' -import bgStationB from '@/assets/iscs_picture/bg-station-B.png' -import bgStationC from '@/assets/iscs_picture/bg-station-C.png' -import bgStationD from '@/assets/iscs_picture/bg-station-D.png' -import bgStationE from '@/assets/iscs_picture/bg-station-E.png' -import bgStationF from '@/assets/iscs_picture/bg-station-F.png' +import bgStationA from '@/assets/iscs_picture/bg-station-A.png'; +import bgStationB from '@/assets/iscs_picture/bg-station-B.png'; +import bgStationC from '@/assets/iscs_picture/bg-station-C.png'; +import bgStationD from '@/assets/iscs_picture/bg-station-D.png'; +import bgStationE from '@/assets/iscs_picture/bg-station-E.png'; +import bgStationF from '@/assets/iscs_picture/bg-station-F.png'; import bgDoorStationA from '@/assets/iscs_picture/bg-door-station-A.png'; import bgDoorStandA from '@/assets/iscs_picture/bg-door-stand-A.png'; import littleStation from '@/assets/iscs_picture/little-station.png'; @@ -89,8 +89,8 @@ const pictureObj = { 'psdRight': psdRight, 'APF': iscsAPF, 'envPersonDoor': envPersonDoor, - 's': fireBlue, - 'a': fireRed, + 'alarmButtonBlue': fireBlue, + 'alarmButtonRed': fireRed, hand, fmBlue, fmGray, @@ -154,16 +154,16 @@ const pictureObj = { alarmLampRed, alarmLampBlue, alarmLampGreen, - bgStationA, - bgStationB, - bgStationC, - bgStationD, - bgStationE, - bgStationF, - bgDoorStationA, - bgDoorStandA, - littleStation, - littleStand + bgStationA, + bgStationB, + bgStationC, + bgStationD, + bgStationE, + bgStationF, + bgDoorStationA, + bgDoorStandA, + littleStation, + littleStand }; export default class Picture extends Group { constructor(device) { @@ -220,4 +220,11 @@ export default class Picture extends Group { rect.y = rect.y + this.model.point.y; return rect; } + hideShowElement() { + if (this.imageButton && this.imageButton.ignore) { + this.imageButton.show(); + } else { + this.imageButton && this.imageButton.hide(); + } + } } diff --git a/src/views/iscs/iscsDraw/group/card.vue b/src/views/iscs/iscsDraw/group/card.vue index b59976b6c..63ea2ac40 100644 --- a/src/views/iscs/iscsDraw/group/card.vue +++ b/src/views/iscs/iscsDraw/group/card.vue @@ -41,6 +41,7 @@ export default { }, handleSave() { const data = JSON.stringify(this.$store.state.iscs.iscs); + console.log(data, '==='); this.$emit('handleSave', data); } } diff --git a/src/views/iscs/iscsDraw/icscComponents/button.vue b/src/views/iscs/iscsDraw/icscComponents/button.vue index 992300265..fd9abf82e 100644 --- a/src/views/iscs/iscsDraw/icscComponents/button.vue +++ b/src/views/iscs/iscsDraw/icscComponents/button.vue @@ -13,9 +13,9 @@ - - - + + + @@ -50,6 +50,16 @@ /> + + + + + {{ buttonText }} 删除 @@ -90,20 +100,32 @@ export default { fontSize: 10, x: 10, y: 10, - isTransparent: false, + isTransparent: false, context: '', function: '', textColor: '', textColorActive: '#000', fillColor: 'rgba(0,0,0,0)', - fillColorActive: 'rgba(0,0,0,0)' + fillColorActive: 'rgba(0,0,0,0)', + hideType: '' }, + hideTypeList: [ + { label: '温感器', value: 'alarmLamp' }, + { label: '烟感器', value: 'smokeDetector' }, + { label: '防火阀', value: 'fireDamper' }, + { label: '报警按钮', value: 'alarmButton' } + // { label: '消火栓按钮', value: 'zanwu' }, + // { label: '标签', value: '' } + ], rules: { context: [ { required: true, message: '请填写按钮文字', trigger: 'blur' } ], function: [ { required: true, message: '请选择按钮功能', trigger: 'change'} + ], + hideType: [ + { required: true, message: '请选择显隐元素类型', trigger: 'change' } ] } }; @@ -124,7 +146,7 @@ export default { this.form.z2 = model.z2; this.form.levelPadding = model.levelPadding; this.form.verticalPadding = model.verticalPadding; - this.form.isTransparent = model.isTransparent; + this.form.isTransparent = model.isTransparent; this.form.x = model.point.x; this.form.y = model.point.y; this.form.context = model.context; @@ -134,6 +156,7 @@ export default { this.form.textColorActive = model.textColorActive || '#000'; this.form.fillColor = model.fillColor; this.form.fillColorActive = model.fillColorActive; + this.hideType = model.hideType; } } }, @@ -143,15 +166,15 @@ export default { {label: '操作按钮', value: 'OperatingButton'}, {label: '门禁站台层', value: 'goToStand'}, {label: '门禁站厅层', value: 'goToStation'}, - {label: '火灾报警系统-站厅层A端', value: 'goFireStation-Two'}, - {label: '火灾报警系统-站厅层B端', value: 'goFireStation-Three'}, - {label: '火灾报警系统-站厅层C端', value: 'goFireStation-Four'}, - {label: '火灾报警系统-站厅层D端', value: 'goFireStation-Five'}, - {label: '火灾报警系统-站厅层E端', value: 'goFireStation-Six'}, - {label: '火灾报警系统-站厅层F端', value: 'goFireStation-Seven'}, + {label: '火灾报警系统-站厅层A端', value: 'goFireStation-Two'}, + {label: '火灾报警系统-站厅层B端', value: 'goFireStation-Three'}, + {label: '火灾报警系统-站厅层C端', value: 'goFireStation-Four'}, + {label: '火灾报警系统-站厅层D端', value: 'goFireStation-Five'}, + {label: '火灾报警系统-站厅层E端', value: 'goFireStation-Six'}, + {label: '火灾报警系统-站厅层F端', value: 'goFireStation-Seven'}, {label: '火灾报警系统-站台层A端', value: 'goFireStand-Two'}, - {label: '火灾报警系统-站台层B端', value: 'goFireStand-Three'}, - {label: '火灾报警系统-站台层公共区段', value: 'goFireStand-Four'}, + {label: '火灾报警系统-站台层B端', value: 'goFireStand-Three'}, + {label: '火灾报警系统-站台层公共区段', value: 'goFireStand-Four'}, {label: '元素显隐', value: 'ElementShow'}, {label: '返回', value: 'GoBack'} ]; @@ -183,14 +206,15 @@ export default { z2: this.form.z2, levelPadding: this.form.levelPadding, verticalPadding: this.form.verticalPadding, - isTransparent: this.form.isTransparent, + isTransparent: this.form.isTransparent, context: this.form.context, function: this.form.function, fontSize: this.form.fontSize, textColor: this.form.textColor, textColorActive: this.form.textColorActive, fillColor: this.form.fillColor, - fillColorActive: this.form.fillColorActive + fillColorActive: this.form.fillColorActive, + hideType: this.form.hideType }; this.$emit('createDataModel', rectModel); this.initPage(); @@ -209,12 +233,13 @@ export default { _type: 'IscsButton', levelPadding: this.form.levelPadding, verticalPadding: this.form.verticalPadding, - isTransparent: this.form.isTransparent, + isTransparent: this.form.isTransparent, context: this.form.context, function: this.form.function, fontSize: this.form.fontSize, fillColor: this.form.fillColor, - fillColorActive: this.form.fillColorActive + fillColorActive: this.form.fillColorActive, + hideType: this.form.hideType }; this.$emit('deleteDataModel', rectModel); }, @@ -233,10 +258,11 @@ export default { context: '', function: '', textColor: '', - isTransparent: false, + isTransparent: false, textColorActive: '#000', fillColor: '', - fillColorActive: '' + fillColorActive: '', + hideType: '' }; } } diff --git a/src/views/iscs/iscsDraw/icscComponents/picture.vue b/src/views/iscs/iscsDraw/icscComponents/picture.vue index 093af0861..08b6f6402 100644 --- a/src/views/iscs/iscsDraw/icscComponents/picture.vue +++ b/src/views/iscs/iscsDraw/icscComponents/picture.vue @@ -60,8 +60,8 @@ export default { { name: '车尾', value: 'psdRight' }, { name: '车厢', value: 'psdSystem' }, { name: '人防门', value: 'envPersonDoor'}, - { name: '报警按钮蓝', value: 's'}, - { name: '报警按钮红', value: 'a'}, + { name: '报警按钮蓝', value: 'alarmButtonBlue'}, + { name: '报警按钮红', value: 'alarmButtonRed'}, { name: 'APF', value: 'APF'}, { name: '手动阀', value: 'hand'}, { name: '蓝色-阀门', value: 'fmBlue'}, @@ -132,10 +132,10 @@ export default { { name: '站厅D', value: 'bgStationD' }, { name: '站厅E', value: 'bgStationE' }, { name: '站厅F', value: 'bgStationF' }, - { name: '门禁站厅A', value: 'bgDoorStationA' }, + { name: '门禁站厅A', value: 'bgDoorStationA' }, { name: '门禁站台A', value: 'bgDoorStandA' }, - { name: '小站台', value: 'littleStand' }, - { name: '小站厅', value: 'littleStation' }, + { name: '小站台', value: 'littleStand' }, + { name: '小站厅', value: 'littleStation' } ], rules: { diff --git a/src/views/iscs/iscsDraw/index.vue b/src/views/iscs/iscsDraw/index.vue index a4545b875..0460043ea 100644 --- a/src/views/iscs/iscsDraw/index.vue +++ b/src/views/iscs/iscsDraw/index.vue @@ -110,6 +110,7 @@ export default { this.tableShow = !this.tableShow; }, handleSave(data) { + const param = { graphData: data, mapId: this.$route.query.mapId, @@ -117,6 +118,7 @@ export default { totalSystem: this.$route.query.mode, userInterface: this.$route.query.part }; + // console.log(data.iscsPictureList, '==='); saveIscsElement(param).then(resp => { this.$message.success('ISCS数据保存成功!'); }).catch(() => { diff --git a/src/views/iscs/iscsDraw/iscsFireAlarm/index.vue b/src/views/iscs/iscsDraw/iscsFireAlarm/index.vue index eac848f4e..b9ce80172 100644 --- a/src/views/iscs/iscsDraw/iscsFireAlarm/index.vue +++ b/src/views/iscs/iscsDraw/iscsFireAlarm/index.vue @@ -42,7 +42,7 @@ @deleteDataModel="deleteDataModel" /> - + - + - + - +