diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index 9ba9224..8f83419 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -120,6 +120,11 @@ }, setCenter(){ if(this.map){ + let center = this.center + if(typeof this.center[0]==='string'){ + center = [parseFloat(this.center[0]), parseFloat(this.center[1])] + } + console.log('setCenter:', center) this.map.setCenter(this.center) } }, diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index 9ba9224..8f83419 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -120,6 +120,11 @@ }, setCenter(){ if(this.map){ + let center = this.center + if(typeof this.center[0]==='string'){ + center = [parseFloat(this.center[0]), parseFloat(this.center[1])] + } + console.log('setCenter:', center) this.map.setCenter(this.center) } }, diff --git a/src/views/overview/components/mapSearchComp.vue b/src/views/overview/components/mapSearchComp.vue index a355e6e..b34a006 100644 --- a/src/views/overview/components/mapSearchComp.vue +++ b/src/views/overview/components/mapSearchComp.vue @@ -8,7 +8,7 @@
- + 搜索 @@ -90,13 +90,13 @@ methods: { inputChange() { if (this.keywords) { - this.search(true) - } else { this.search(false) + } else { + this.search(true) } }, // 点击搜索按钮 - search(clear) { + search(clear = false) { this.$emit('search', this.keywords, clear) }, // 切换页码 diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index 9ba9224..8f83419 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -120,6 +120,11 @@ }, setCenter(){ if(this.map){ + let center = this.center + if(typeof this.center[0]==='string'){ + center = [parseFloat(this.center[0]), parseFloat(this.center[1])] + } + console.log('setCenter:', center) this.map.setCenter(this.center) } }, diff --git a/src/views/overview/components/mapSearchComp.vue b/src/views/overview/components/mapSearchComp.vue index a355e6e..b34a006 100644 --- a/src/views/overview/components/mapSearchComp.vue +++ b/src/views/overview/components/mapSearchComp.vue @@ -8,7 +8,7 @@
- + 搜索 @@ -90,13 +90,13 @@ methods: { inputChange() { if (this.keywords) { - this.search(true) - } else { this.search(false) + } else { + this.search(true) } }, // 点击搜索按钮 - search(clear) { + search(clear = false) { this.$emit('search', this.keywords, clear) }, // 切换页码 diff --git a/src/views/overview/components/popupDataFilter.vue b/src/views/overview/components/popupDataFilter.vue index 80e7a41..004c508 100644 --- a/src/views/overview/components/popupDataFilter.vue +++ b/src/views/overview/components/popupDataFilter.vue @@ -15,7 +15,7 @@ - + diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index 9ba9224..8f83419 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -120,6 +120,11 @@ }, setCenter(){ if(this.map){ + let center = this.center + if(typeof this.center[0]==='string'){ + center = [parseFloat(this.center[0]), parseFloat(this.center[1])] + } + console.log('setCenter:', center) this.map.setCenter(this.center) } }, diff --git a/src/views/overview/components/mapSearchComp.vue b/src/views/overview/components/mapSearchComp.vue index a355e6e..b34a006 100644 --- a/src/views/overview/components/mapSearchComp.vue +++ b/src/views/overview/components/mapSearchComp.vue @@ -8,7 +8,7 @@
- + 搜索 @@ -90,13 +90,13 @@ methods: { inputChange() { if (this.keywords) { - this.search(true) - } else { this.search(false) + } else { + this.search(true) } }, // 点击搜索按钮 - search(clear) { + search(clear = false) { this.$emit('search', this.keywords, clear) }, // 切换页码 diff --git a/src/views/overview/components/popupDataFilter.vue b/src/views/overview/components/popupDataFilter.vue index 80e7a41..004c508 100644 --- a/src/views/overview/components/popupDataFilter.vue +++ b/src/views/overview/components/popupDataFilter.vue @@ -15,7 +15,7 @@ - + diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue index cd3a3b9..40dc8f9 100644 --- a/src/views/overview/overviewAmap.vue +++ b/src/views/overview/overviewAmap.vue @@ -218,7 +218,7 @@ * @param showMessage 是否告知筛选结果 */ dataFilter(listQuery, showMessage = true) { - this.closeAllPopup() + this.clearInfoWindow() if (this.type === 'massMarkers') { // 过滤海量点 if (this.markers) { this.filterMassMarker(listQuery, showMessage) @@ -238,16 +238,19 @@ search(args) { const keywords = args[0] const clear = args[1] - if (keywords === '' && !clear) { + if (keywords === '' && !clear) { // clear为true表示清空时,不需要弹窗 this.$message.warning('搜索条件不能为空') } else { - this.resultList = this.markers.filter(item => { + this.resultList = this.allMarkers.filter(item => { if (item.wellCode.includes(keywords) || item.wellName.includes(keywords) || item.position.includes(keywords)) { return true } else { return false } }) + if (this.resultList.length == 0) { + this.$message.info('查无结果') + } } }, // 搜索结果页面变化,触发地图展示列表中所有 @@ -314,10 +317,8 @@ }, // 过滤报警 filterAlarm(listQuery, showMessage = false) { - debugger if (!this.showAlarm) return const hideWellIds = []// 要隐藏的点位编号 - debugger // 整理筛选条件 const keywords = listQuery.keywords const wellTypes = listQuery.wellTypes ? listQuery.wellTypes : listQuery.wellType ? [listQuery.wellType] : [] // 点位类型 @@ -411,9 +412,9 @@ }, // 过滤图层 filterLayer(checkedLayer) { + this.clearInfoWindow() // 1.过滤井图层 if (this.type === 'massMarkers') { - this.closeAllPopup() const wellTypes = checkedLayer.filter(item => item.indexOf('well-') > -1).map(item => item.substring(5)) this.showWellTypes = wellTypes this.layerFilter(wellTypes) @@ -573,9 +574,6 @@ */ openAlarmWindow(wellId, coordinates, needCenter = false) { console.log('openAlarmWindow:' + wellId) - if (this.needCenter) { // 如果需要居中 - this.center = coordinates - } // 获取报警详情 getWellAlarms(wellId).then(response => { if (response.code === 200) { @@ -598,6 +596,11 @@ autoMove: true // 是否自动调整窗体到视野内 }) infoWindow.open(this.map, new toLngLat(coordinates)) + if (needCenter) { // 如果需要居中 + const zoom = this.zoom < 16 ? 16 : this.zoom + const center = [parseFloat(coordinates[0]), parseFloat(coordinates[1])] + this.map.setZoomAndCenter(zoom, center) + } } }) }, @@ -639,12 +642,8 @@ const wellId = row.wellId for (const alarmWell of this.alarmWells) { if (alarmWell.wellId === wellId) { - // this.center = alarmWell.coordinates - if (this.zoom < 16) { - this.zoom = 16 - } - this.center = alarmWell.coordinates this.openAlarmWindow(alarmWell.wellId, alarmWell.coordinates, true) + // this.center = alarmWell.coordinates } } }, diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index 9ba9224..8f83419 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -120,6 +120,11 @@ }, setCenter(){ if(this.map){ + let center = this.center + if(typeof this.center[0]==='string'){ + center = [parseFloat(this.center[0]), parseFloat(this.center[1])] + } + console.log('setCenter:', center) this.map.setCenter(this.center) } }, diff --git a/src/views/overview/components/mapSearchComp.vue b/src/views/overview/components/mapSearchComp.vue index a355e6e..b34a006 100644 --- a/src/views/overview/components/mapSearchComp.vue +++ b/src/views/overview/components/mapSearchComp.vue @@ -8,7 +8,7 @@
- + 搜索 @@ -90,13 +90,13 @@ methods: { inputChange() { if (this.keywords) { - this.search(true) - } else { this.search(false) + } else { + this.search(true) } }, // 点击搜索按钮 - search(clear) { + search(clear = false) { this.$emit('search', this.keywords, clear) }, // 切换页码 diff --git a/src/views/overview/components/popupDataFilter.vue b/src/views/overview/components/popupDataFilter.vue index 80e7a41..004c508 100644 --- a/src/views/overview/components/popupDataFilter.vue +++ b/src/views/overview/components/popupDataFilter.vue @@ -15,7 +15,7 @@ - + diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue index cd3a3b9..40dc8f9 100644 --- a/src/views/overview/overviewAmap.vue +++ b/src/views/overview/overviewAmap.vue @@ -218,7 +218,7 @@ * @param showMessage 是否告知筛选结果 */ dataFilter(listQuery, showMessage = true) { - this.closeAllPopup() + this.clearInfoWindow() if (this.type === 'massMarkers') { // 过滤海量点 if (this.markers) { this.filterMassMarker(listQuery, showMessage) @@ -238,16 +238,19 @@ search(args) { const keywords = args[0] const clear = args[1] - if (keywords === '' && !clear) { + if (keywords === '' && !clear) { // clear为true表示清空时,不需要弹窗 this.$message.warning('搜索条件不能为空') } else { - this.resultList = this.markers.filter(item => { + this.resultList = this.allMarkers.filter(item => { if (item.wellCode.includes(keywords) || item.wellName.includes(keywords) || item.position.includes(keywords)) { return true } else { return false } }) + if (this.resultList.length == 0) { + this.$message.info('查无结果') + } } }, // 搜索结果页面变化,触发地图展示列表中所有 @@ -314,10 +317,8 @@ }, // 过滤报警 filterAlarm(listQuery, showMessage = false) { - debugger if (!this.showAlarm) return const hideWellIds = []// 要隐藏的点位编号 - debugger // 整理筛选条件 const keywords = listQuery.keywords const wellTypes = listQuery.wellTypes ? listQuery.wellTypes : listQuery.wellType ? [listQuery.wellType] : [] // 点位类型 @@ -411,9 +412,9 @@ }, // 过滤图层 filterLayer(checkedLayer) { + this.clearInfoWindow() // 1.过滤井图层 if (this.type === 'massMarkers') { - this.closeAllPopup() const wellTypes = checkedLayer.filter(item => item.indexOf('well-') > -1).map(item => item.substring(5)) this.showWellTypes = wellTypes this.layerFilter(wellTypes) @@ -573,9 +574,6 @@ */ openAlarmWindow(wellId, coordinates, needCenter = false) { console.log('openAlarmWindow:' + wellId) - if (this.needCenter) { // 如果需要居中 - this.center = coordinates - } // 获取报警详情 getWellAlarms(wellId).then(response => { if (response.code === 200) { @@ -598,6 +596,11 @@ autoMove: true // 是否自动调整窗体到视野内 }) infoWindow.open(this.map, new toLngLat(coordinates)) + if (needCenter) { // 如果需要居中 + const zoom = this.zoom < 16 ? 16 : this.zoom + const center = [parseFloat(coordinates[0]), parseFloat(coordinates[1])] + this.map.setZoomAndCenter(zoom, center) + } } }) }, @@ -639,12 +642,8 @@ const wellId = row.wellId for (const alarmWell of this.alarmWells) { if (alarmWell.wellId === wellId) { - // this.center = alarmWell.coordinates - if (this.zoom < 16) { - this.zoom = 16 - } - this.center = alarmWell.coordinates this.openAlarmWindow(alarmWell.wellId, alarmWell.coordinates, true) + // this.center = alarmWell.coordinates } } }, diff --git a/src/views/system/role/listRole.vue b/src/views/system/role/listRole.vue index 6dfd64d..3883aa9 100644 --- a/src/views/system/role/listRole.vue +++ b/src/views/system/role/listRole.vue @@ -14,7 +14,7 @@