From 960d8e69024c7878f5c05e88eb06926726f156fd Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 5 Feb 2020 16:33:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?ISCS=20=E7=BB=98=E5=88=B6=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs/constant/iscsData.js | 10 +- .../iscs/iscsDraw/iscsAfcOperate/index.vue | 12 +- .../iscs/iscsDraw/iscsCctvOperate/index.vue | 10 +- .../iscs/iscsDraw/iscsCommonElem/line.vue | 168 +++++------------- src/views/iscs/iscsDraw/iscsOperate/index.vue | 21 ++- .../iscs/iscsDraw/iscsPsdOperate/index.vue | 12 +- 6 files changed, 78 insertions(+), 155 deletions(-) diff --git a/src/iscs/constant/iscsData.js b/src/iscs/constant/iscsData.js index 0b1acbb88..d8489ff51 100644 --- a/src/iscs/constant/iscsData.js +++ b/src/iscs/constant/iscsData.js @@ -1,9 +1,9 @@ const iscsData = { - '11': {}, - '12': {}, - '21': {}, - '31': {}, - '41': { "vidiconList": [{ "_type": "Vidicon", "code": "Vidicon_1", "width": 40, "right": true, "point": { "x": 180, "y": 72 }, "zlevel": 1, "z": 4 }], "iscsRect": [{ "point": { "x": 10, "y": 10 }, "code": "IscsRect_1", "_type": "IscsRect", "fillColor": "rgba(28, 27, 27, 0)", "borderWidth": 2, "strokeColor": "#F8F4F4", "width": 70, "height": 90, "zlevel": 1, "z": 3 }] }, + '11': { 'manualAlarmButtonList': [{ 'point': { 'x': 560, 'y': 100 }, 'code': 'ManualAlarmButton_1', '_type': 'ManualAlarmButton', 'width': 25, 'zlevel': 1, 'z': 4 }], 'fireHydranAlarmButtonList': [{ 'point': { 'x': 562, 'y': 234 }, 'code': 'FireHydranAlarmButton_1', '_type': 'FireHydranAlarmButton', 'width': 25, 'zlevel': 1, 'z': 4 }, { 'point': { 'x': 201, 'y': 242 }, 'code': 'FireHydranAlarmButton_2', '_type': 'FireHydranAlarmButton', 'width': 25, 'zlevel': 1, 'z': 4 }, { 'point': { 'x': 391, 'y': 127 }, 'code': 'FireHydranAlarmButton_3', '_type': 'FireHydranAlarmButton', 'width': 25, 'zlevel': 1, 'z': 4 }] }, + '12':{}, + '21':{}, + '31':{}, + '41': {"vidiconList":[{"_type":"Vidicon","code":"Vidicon_1","width":40,"right":true,"point":{"x":180,"y":72},"zlevel":1,"z":4}],"iscsRect":[{"point":{"x":10,"y":10},"code":"IscsRect_1","_type":"IscsRect","fillColor":"rgba(28, 27, 27, 0)","borderWidth":2,"strokeColor":"#F8F4F4","width":70,"height":90,"zlevel":1,"z":3}]}, '42': {}, '51': {}, '61': {}, diff --git a/src/views/iscs/iscsDraw/iscsAfcOperate/index.vue b/src/views/iscs/iscsDraw/iscsAfcOperate/index.vue index 29416b9a5..c3ac3ea7b 100644 --- a/src/views/iscs/iscsDraw/iscsAfcOperate/index.vue +++ b/src/views/iscs/iscsDraw/iscsAfcOperate/index.vue @@ -10,7 +10,7 @@ >{{ $t('ibp.save') }} - + - + - + - + - + - + {{ $t('ibp.save') }} - + - + - + - + - + -
- 起始坐标 - - - - - - -
-
- 终点坐标 - - - - - - -
+ + + + + + + + + + + + {{ buttonText }} 删除 @@ -60,66 +34,37 @@ import {getUID} from '@/iscs/utils/Uid'; export default { name: 'Line', data() { - return { - isUpdate: false, - buttonText: '立即创建', - showDeleteButton: false, - form: { - code: '', - lineWidth: '', - fillColor: '#fff', - x1: 10, - y1: 10, - x2: 20, - y2: 10 - }, - rules: { - lineWidth: [ - { required: true, message: '请输入线段宽度', trigger: 'blur' } - ], - fillColor: [ - { required: true, message: '请输入线段颜色', trigger: 'blur' } - ], - x1: [ - { required: true, message: '请输入数值', trigger: 'blur' } - ], - y1: [ - { required: true, message: '请输入数值', trigger: 'blur' } - ], - x2: [ - { required: true, message: '请输入数值', trigger: 'blur' } - ], - y2: [ - { required: true, message: '请输入数值', trigger: 'blur' } - ] - } - }; - }, - computed:{ - ...mapGetters('iscs', [ - 'iscs' - ]) - }, - watch: { - '$store.state.iscs.rightClickCount': function (val) { - const model = this.$store.getters['iscs/updateDeviceData']; - if (model._type === 'IscsLine' ) { - this.buttonText = '修改'; - this.showDeleteButton = true; - this.isUpdate = true; - this.form = { - code: model.code, - lineWidth: model.lineWidth, - fillColor: model.fillColor, - x1: model.x1, - y1: model.y1, - x2: model.x2, - y2: model.y2 - }; - } - } - }, - mounted() {}, + return { + isUpdate: false, + buttonText: '立即创建', + showDeleteButton: false, + form: { + code: '', + lineWidth: '', + fillColor: '#000000', + x1: 10, + y1: 10, + x2: 20, + y2: 10 + }, + rules: { + lineWidth: [ + { required: true, message: '请输入线段宽度', trigger: 'blur' } + ], + fillColor: [ + { required: true, message: '请输入线段颜色', trigger: 'blur' } + ], + } + }; + }, + computed:{ + ...mapGetters('iscs', [ + 'iscs' + ]) + }, + watch: { + }, + mounted() {}, methods: { onSubmit(form) { this.$refs[form].validate((valid) => { @@ -169,7 +114,7 @@ export default { this.form = { code: '', lineWidth: '', - fillColor: '#fff', + fillColor: '', x1: 10, y1: 10, x2: 20, @@ -180,30 +125,5 @@ export default { }; diff --git a/src/views/iscs/iscsDraw/iscsOperate/index.vue b/src/views/iscs/iscsDraw/iscsOperate/index.vue index dc637e99f..7640d6b2b 100644 --- a/src/views/iscs/iscsDraw/iscsOperate/index.vue +++ b/src/views/iscs/iscsDraw/iscsOperate/index.vue @@ -10,7 +10,7 @@ >{{ $t('ibp.save') }} - + - + - + - + - + - + - + - + @@ -120,7 +123,7 @@ export default { } }, mounted() { - this.$emit('iscsChange', this.$route.params.id); + this.$emit('iscsChange', this.$route.params.id); }, beforeDestroy() { diff --git a/src/views/iscs/iscsDraw/iscsPsdOperate/index.vue b/src/views/iscs/iscsDraw/iscsPsdOperate/index.vue index 74d63b4dd..ae1eaf788 100644 --- a/src/views/iscs/iscsDraw/iscsPsdOperate/index.vue +++ b/src/views/iscs/iscsDraw/iscsPsdOperate/index.vue @@ -10,7 +10,7 @@ >{{ $t('ibp.save') }} - + - + - + - + - + - + Date: Wed, 5 Feb 2020 16:41:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?iscs=20=E5=8F=B3=E9=94=AE=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iscs/iscsDraw/iscsAcsOperate/index.vue | 8 +++--- .../iscs/iscsDraw/iscsBasOperate/index.vue | 28 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/views/iscs/iscsDraw/iscsAcsOperate/index.vue b/src/views/iscs/iscsDraw/iscsAcsOperate/index.vue index 852cb8600..d8a635f74 100644 --- a/src/views/iscs/iscsDraw/iscsAcsOperate/index.vue +++ b/src/views/iscs/iscsDraw/iscsAcsOperate/index.vue @@ -10,7 +10,7 @@ >{{ $t('ibp.save') }} - + - + - + - + {{ $t('ibp.save') }} - + - + - + - + - + - + - + - + - + - + - + - + - + - + Date: Wed, 5 Feb 2020 16:53:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?iscs=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs/constant/iscsData.js | 2 +- src/iscs/iscs.js | 1 - src/iscs/mouseController.js | 14 +++++--------- src/iscs/transformHandle.js | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/iscs/constant/iscsData.js b/src/iscs/constant/iscsData.js index d8489ff51..2002c1a76 100644 --- a/src/iscs/constant/iscsData.js +++ b/src/iscs/constant/iscsData.js @@ -3,7 +3,7 @@ const iscsData = { '12':{}, '21':{}, '31':{}, - '41': {"vidiconList":[{"_type":"Vidicon","code":"Vidicon_1","width":40,"right":true,"point":{"x":180,"y":72},"zlevel":1,"z":4}],"iscsRect":[{"point":{"x":10,"y":10},"code":"IscsRect_1","_type":"IscsRect","fillColor":"rgba(28, 27, 27, 0)","borderWidth":2,"strokeColor":"#F8F4F4","width":70,"height":90,"zlevel":1,"z":3}]}, + '41': {"vidiconList":[{"_type":"Vidicon","code":"Vidicon_1","width":40,"right":true,"point":{"x":178,"y":73},"zlevel":1,"z":4},{"_type":"Vidicon","code":"Vidicon_2","width":40,"right":true,"point":{"x":309,"y":147},"zlevel":1,"z":4},{"_type":"Vidicon","code":"Vidicon_3","width":40,"right":true,"point":{"x":308,"y":72},"zlevel":1,"z":4}],"iscsRectList":[{"point":{"x":25,"y":176},"code":"IscsRect_1","_type":"IscsRect","fillColor":"rgba(239, 231, 231, 0)","borderWidth":2,"strokeColor":"#F7F1F1","width":70,"height":90,"zlevel":1,"z":3},{"point":{"x":96,"y":176},"code":"IscsRect_2","_type":"IscsRect","fillColor":"rgba(239, 231, 231, 0)","borderWidth":2,"strokeColor":"#F7F1F1","width":70,"height":90,"zlevel":1,"z":3},{"point":{"x":167,"y":176},"code":"IscsRect_3","_type":"IscsRect","fillColor":"rgba(239, 231, 231, 0)","borderWidth":2,"strokeColor":"#F7F1F1","width":70,"height":90,"zlevel":1,"z":3},{"point":{"x":238,"y":176},"code":"IscsRect_4","_type":"IscsRect","fillColor":"rgba(239, 231, 231, 0)","borderWidth":2,"strokeColor":"#F7F1F1","width":70,"height":90,"zlevel":1,"z":3},{"point":{"x":309,"y":149},"code":"IscsRect_5","_type":"IscsRect","fillColor":"rgba(239, 231, 231, 0)","borderWidth":2,"strokeColor":"#F7F1F1","width":70,"height":90,"zlevel":1,"z":3}],"vidiconCloudList":[{"_type":"VidiconCloud","code":"VidiconCloud_1","r":18,"point":{"x":50,"y":61},"zlevel":1,"z":4},{"_type":"VidiconCloud","code":"VidiconCloud_2","r":18,"point":{"x":121,"y":206},"zlevel":1,"z":4},{"_type":"VidiconCloud","code":"VidiconCloud_3","r":18,"point":{"x":192,"y":206},"zlevel":1,"z":4},{"_type":"VidiconCloud","code":"VidiconCloud_4","r":18,"point":{"x":262,"y":207},"zlevel":1,"z":4}],"iscsLineList":[{"point1":{"x":375,"y":50},"point2":{"x":1075,"y":50},"code":"IscsLine_1","_type":"IscsLine","lineWidth":10,"fillColor":"#F7F1F1","zlevel":1,"z":4,"point":{"x":375,"y":50}},{"point1":{"x":376,"y":306},"point2":{"x":1076,"y":306},"code":"IscsLine_2","_type":"IscsLine","lineWidth":10,"fillColor":"#F7F1F1","zlevel":1,"z":4,"point":{"x":376,"y":306}}]}, '42': {}, '51': {}, '61': {}, diff --git a/src/iscs/iscs.js b/src/iscs/iscs.js index 163c2a6f9..f257c1973 100644 --- a/src/iscs/iscs.js +++ b/src/iscs/iscs.js @@ -237,7 +237,6 @@ class Iscs { } dispose() { this.off(this.events.Pan, this.optionsHandler); - this.off(this.events.Zoom, this.optionsHandler); this.clear(); diff --git a/src/iscs/mouseController.js b/src/iscs/mouseController.js index f433ca155..d2cd567b2 100644 --- a/src/iscs/mouseController.js +++ b/src/iscs/mouseController.js @@ -137,9 +137,6 @@ class MouseController extends Eventful { this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY); this.eventTarget.dirty(); } - if (this.eventTarget._type === deviceType.Background) { - this.eventTarget.setCursor('default'); - } this.eventTarget = ''; this._dragging = false; this.deviceList = []; @@ -203,7 +200,7 @@ class MouseController extends Eventful { } /** 处理鼠标左键按下事件 */ handleMouseDownLeft(e) { - if (this.eventTarget && this.eventTarget._type === deviceType.Background) { + if (this.eventTarget) { this.eventTarget.setCursor('pointer'); this.$iscs.deleteCheckBox('check_box'); } else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) { @@ -216,9 +213,7 @@ class MouseController extends Eventful { handleMouseDownWheel(e) { this.deviceList = []; Object.values(this.$iscs.iscsDevice).forEach(item => { - if (item.instance._type !== deviceType.Background) { this.deviceList.push(item.instance); - } }); } /** 处理右键拖动事件--- 改变选中区域大小 */ @@ -241,12 +236,15 @@ class MouseController extends Eventful { item.grouper.drift(dx, dy, e); }); } else if (this._dragging && this.eventTarget) { // 选中元素图形移动 - if (( this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) { + if (!this.isAllowDragging) { this._preventDefaultMouseMove && eventTool.stop(e.event); this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); } else if (this.isAllowDragging) { this.eventTarget.grouper.drift(dx, dy, e); } + } else if (this._dragging) { + this._preventDefaultMouseMove && eventTool.stop(e.event); + this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); } } /** 通过包围盒筛选选中区域的元素 */ @@ -257,13 +255,11 @@ class MouseController extends Eventful { const deviceList = Object.values(this.$iscs.iscsDevice); const includeDeviceList = []; deviceList.forEach( item =>{ - if (item.instance._type !== deviceType.Background) { let deviceBoundingRect = item.instance.grouper.getBoundingRect(); deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect); if (this.whetherInclude(boundingRect, deviceBoundingRect )) { includeDeviceList.push(item.instance); } - } }); this.deviceList = includeDeviceList; } diff --git a/src/iscs/transformHandle.js b/src/iscs/transformHandle.js index 3ff3ab22a..ca8c0cd12 100644 --- a/src/iscs/transformHandle.js +++ b/src/iscs/transformHandle.js @@ -17,7 +17,7 @@ class TransformHandle { } revisibleView(view) { - if (this.checkVisible(view) || view._type === deviceType.Background) { + if (this.checkVisible(view)) { view.show(); } else { view.hide();