From 30c0b1fa3214ce973fe424e30a04fb3770046c67 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Mon, 6 Jun 2022 15:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/community/community.vue | 4 +- .../visual/components/screen-map/index.vue | 40 +++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index 43472844..c19f811c 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -269,7 +269,7 @@ export default { await this.loadOrgData() await this.loadTree() - await this.loadOpenNode() + // await this.loadOpenNode() await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) if (this.treeData.length > 0) { @@ -347,6 +347,8 @@ export default { const { data, code, msg } = await requestPost(url, params) if (code === 0) { + this.openNodes = [] + this.openNodes.push(data[0].id) this.treeData = data if (!isRefresh && data.length > 0) { diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index bf287012..54d0204d 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/src/views/modules/visual/components/screen-map/index.vue @@ -32,7 +32,7 @@ class="ol-popup-closer"> - 更多>>>> @@ -107,9 +107,9 @@ let polygonColorArray = [ 'rgba(183, 185, 0, 0.16)' ]; - //icon文字样式 +//icon文字样式 let createTextStyle = function (feature) { - + if (iconTextsStyle) { let iconTextsStyles = { ...iconTextsStyle } iconTextsStyles.text = feature.values_ && feature.values_.name || feature.name @@ -224,11 +224,11 @@ const vueGis = { // iconArrays.forEach(item => { // console.log(item.type, item.urlIndex, item.latitude, item.longitude) // }); - + //初始化地图 this.initMap() - + if (this.showPolIconLayer) { console.log('showPolIconLayer++++++++++++++++++++++', this.showPolIconLayer) //初始化多边形标注图层 @@ -242,7 +242,7 @@ const vueGis = { //加载当前园区的标注 this.loadPolygon() } - + if (this.showIconLayer) { //初始化icon图层 @@ -262,14 +262,14 @@ const vueGis = { //刷新地图 async refreshMap (mapInfo, polygonArray, iconArrays) { this.mapInfo = mapInfo - this.polygonArray = [] + this.polygonArray = [] this.polygonArray = polygonArray this.iconArrays = iconArrays iconSource.clear() polygonSource.clear() polIconSource.clear() this.initPolIconLayer() - + if (this.showPolygonLayer) { this.initPolygonLayer() //加载当前园区的标注 @@ -287,7 +287,7 @@ const vueGis = { } this.setMapLocation() // gaodeMapLayer.getSource().changed() - + }, //加载区域多边形 @@ -305,7 +305,7 @@ const vueGis = { oneData = { type: 'Feature', - + properties: { ...polygonItem }, geometry: { type: 'Polygon', @@ -345,7 +345,7 @@ const vueGis = { if (this.showPolIconLayer) { this.loadPolIcon(feature) } - + } @@ -549,9 +549,9 @@ const vueGis = { } mapView.setZoom(this.zoom); - + }, - firstCentermap() { + firstCentermap () { if (this.mapInfo.longitude && this.mapInfo.latitude) { this.centerPoint = [] this.centerPoint.push(this.mapInfo.longitude) @@ -743,14 +743,14 @@ const vueGis = { this.overlay.getElement().parentNode.parentNode.style.display = 'block' content.innerHTML = showData; this.overlay.setPosition(coordinate); - //把 overlay 显示到指定的 x,y坐标 - + //把 overlay 显示到指定的 x,y坐标 + }, // 关闭弹窗 - handleClosePopup() { - this.overlay.setPosition(undefined); - document.getElementById("popup-closer").blur(); - return false; + handleClosePopup () { + this.overlay.setPosition(undefined); + document.getElementById("popup-closer").blur(); + return false; }, //取随机数 @@ -895,7 +895,7 @@ export default vueGis; .popup-content { width: 300px; } -.popup-goMore{ +.popup-goMore { margin: 20px 0; } .ol-popup-closer:after {