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; } +