From 6b7827bd91422e8132640c264879d1be3ae34351 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 11 Jun 2021 18:17:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?zc=20=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 --- src/jmapNew/mouseController.js | 28 ++--- src/views/newMap/newDesignUser/demonList.vue | 2 +- .../newMapdraft/mapoperate/config/list.vue | 18 +++ .../newMap/newMapdraft/mapoperate/index.vue | 10 +- .../newMapdraft/mapoperate/zcControl.vue | 113 ++++++------------ 5 files changed, 80 insertions(+), 91 deletions(-) diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index 2ca7e4804..007fea5ca 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -97,23 +97,23 @@ class MouseController extends Eventful { } mousemove(e) { - if (this._dragging) { - const oldX = this._x; - const oldY = this._y; + if (this._dragging) { + const oldX = this._x; + const oldY = this._y; - const dx = e.offsetX - oldX; - const dy = e.offsetY - oldY; + const dx = e.offsetX - oldX; + const dy = e.offsetY - oldY; - this._x = e.offsetX; - this._y = e.offsetY; + this._x = e.offsetX; + this._y = e.offsetY; - if (e.which == 1) { - this._preventDefaultMouseMove && eventTool.stop(e.event); - this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); - } else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) { - this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY}); - } - } + if (e.which == 1) { + this._preventDefaultMouseMove && eventTool.stop(e.event); + this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); + } else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) { + this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY}); + } + } } mouseup(e) { diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index fe2232f8a..a094adb5d 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -109,7 +109,7 @@ export default { lineCode: elem.lineCode }, { - id: '1', + id: '2', name: '系统配置绘图', type: 'mapSystem', mapId: elem.id, diff --git a/src/views/newMap/newMapdraft/mapoperate/config/list.vue b/src/views/newMap/newMapdraft/mapoperate/config/list.vue index 48f18b520..e35051b57 100644 --- a/src/views/newMap/newMapdraft/mapoperate/config/list.vue +++ b/src/views/newMap/newMapdraft/mapoperate/config/list.vue @@ -294,6 +294,24 @@ + diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index b64de62cd..1664d54cd 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -196,11 +196,19 @@ export default { } else if (controlLampTypeList.includes(type)) { this.enabledTab = 'ControlLamp'; } else { - this.enabledTab = type; + if (this.$refs['ZcControl'] && this.$refs['ZcControl'][0].field == 'checkZcSection') { + this.enabledTab = 'ZcControl'; + } else { + this.enabledTab = type; + } } }, deviceSelect(type) { + // if (this.$refs['ZcControl'].field != 'checkZcSection') { this.selectDevice = type; + // } else { + // this.selectDevice = 'ZcControl'; + // } }, saveMapEvent() { this.$emit('saveMapEvent'); diff --git a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue index 0bf3f5b50..d21549558 100644 --- a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue @@ -1,5 +1,5 @@ - + + +
From a0861633f2c49a04c1cf32e29653dfc3ea3778e9 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 15 Jun 2021 15:33:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?zc=20=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9A=84=E5=8C=BA=E6=AE=B5=E5=88=97=E8=A1=A8=EF=BC=88=E8=AE=A1?= =?UTF-8?q?=E8=BD=B4=E5=8C=BA=E6=AE=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/mouseController.js | 25 +++++++- .../newMapdraft/mapoperate/config/list.vue | 12 +++- .../newMapdraft/mapoperate/zcControl.vue | 60 ++++++++++++++++--- 3 files changed, 82 insertions(+), 15 deletions(-) diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index 007fea5ca..360f9286f 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -112,6 +112,7 @@ class MouseController extends Eventful { this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); } else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) { this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY}); + this.isMoveRight = true; } } } @@ -121,10 +122,23 @@ class MouseController extends Eventful { this._dragging = false; } if (this._zoomOnMouseWheel && this.$jmap.mapDevice['check_box'] && this._previewOrMapDraw ) { + console.log(this.isMoveRight, 'mouseup'); this.eventTarget = this.$jmap.mapDevice['check_box'].instance; this.handleBoundingRect(this.eventTarget); - var em = this.checkEvent(e); + let em; + if (!this.isMoveRight) { + em = this.checkEvent(e); + } else { + em = { + clientX:e.offsetX, + clientY:e.offsetY, + eventTarget:this.eventTarget, + deviceCode:'check_box', + deviceType:'CheckBox' + }; + } this.trigger(this.events.Selected, em); + } } @@ -157,8 +171,13 @@ class MouseController extends Eventful { } contextmenu(e) { - var em = this.checkEvent(e); - this.trigger(this.events.Contextmenu, em); + // 判断是否正在右键拖选 若不是则弹出右键菜单 + if (!this.isMoveRight) { + var em = this.checkEvent(e); + this.trigger(this.events.Contextmenu, em); + } else { + this.isMoveRight = false; + } } moveEvent(e) { diff --git a/src/views/newMap/newMapdraft/mapoperate/config/list.vue b/src/views/newMap/newMapdraft/mapoperate/config/list.vue index e35051b57..f49ad6a5c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/config/list.vue +++ b/src/views/newMap/newMapdraft/mapoperate/config/list.vue @@ -304,10 +304,16 @@ :type="item.buttonShowType ? 'danger' : 'primary'" @click="item.hover(item.buttonType)" >激活选择 + 清空
-
-
{{ item.getName(nor) }}
-
+
+
+
{{ item.getName(nor) }}
+
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue index d21549558..0f5c7a72f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue @@ -53,6 +53,7 @@ export default { editModel: { code: '', name: '', + managedSectionList:[], // visible: '', // concentrateStationList:[], position: { @@ -95,7 +96,8 @@ export default { }, computed: { ...mapGetters('map', [ - 'zcList' + 'zcList', + 'seclectDeviceList' ]), isButtonType() { return this.field == 'checkZcSection'; @@ -117,7 +119,8 @@ export default { { prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } - ] } + ] }, + { prop:'managedSectionList', label:'管理区段列表: ', type: 'checkBoxDevice', getName:this.getName, mouseenter:this.mouseenter, mouseleave:this.mouseleave, buttonShowType:this.isButtonType, hover:this.hover, buttonType:'checkZcSection', clear:this.clear} // { prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation } ] } @@ -136,9 +139,7 @@ export default { { prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } - ] }, - - { prop:'sectionList', label:'关联区段: ', type: 'checkBoxDevice', getName:this.getName, mouseenter:this.mouseenter, mouseleave:this.mouseleave, buttonShowType:this.isButtonType, hover:this.hover, buttonType:'checkZcSection'} + ] } // // { prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation } ] @@ -159,15 +160,28 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - // debugger; // 待调整 - this.$refs.dataform && this.$refs.dataform.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); - if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) { + // this.$refs.make && this.$refs.make.resetFields(); + if (selected && selected._type.toUpperCase() === 'CheckBox'.toUpperCase()) { + this.activeName = 'first'; + this.seclectDeviceList.forEach(item => { + if (item._type == 'Section' && (item.type == '01' || item.type == '04') && !this.editModel.managedSectionList.includes(selected.code)) { + this.editModel.managedSectionList.push(item.code); + } + }); + } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { + if (selected._type == 'Section' && (selected.type == '01' || selected.type == '04') && !this.editModel.managedSectionList.includes(selected.code)) { + this.editModel.managedSectionList.push(selected.code); + } + } else if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) { + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } }, + clear() { + this.editModel.managedSectionList = []; + }, create() { const uid = getUID('ZcControl', this.zcList); const models = []; @@ -263,3 +277,31 @@ export default { color: #3E44BE; } +