浏览代码

lsyd地图定位

liutao 2 周之前
父节点
当前提交
3fcf07eebc

+ 1 - 1
YHYZT/client/src/components/common/BaseMap.vue

@@ -764,7 +764,7 @@ export default {
         this.map.getView().fit(source.getExtent(), {
           padding: [height, width, height, width + 300],
           duration: 500,
-          maxZoom: 21
+          maxZoom: 18
         })
       })
     },

+ 16 - 7
YHYZT/client/src/views/DataManage/lsyd/Detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="xm-detal">
-    <el-tabs type="border-card" v-model="currentTab">
+    <el-tabs type="border-card" v-model="currentTab" @tab-click="handleTabClick">
       <el-tab-pane label="项目信息" name="tab1">
         <div class="tables_grid">
           <div class="title">项目索引</div>
@@ -180,13 +180,22 @@ export default {
         }
       })
     },
-    locationDk(index,row){
-      if(row.pewg_id){
+    handleTabClick(tab) {
+      if (tab.name === 'tab2') {
+        // 切换到地图tab时,调用地块定位,使用objectid
+        if (this.detailData && this.detailData.objectid) {
+          this.locationDk(null, { objectid: this.detailData.objectid });
+        }
+      }
+    },
+    locationDk(index, row) {
+      if (row.objectid) {
         this.detailShow = false;
-        let dkbhArr = row.pewg_id?row.pewg_id.split(","):'';
-        let arr = dkbhArr.map(i=>{return   "'"+i+"'";});
-        this.$vm.$emit('locationGlobal', this.visibleLayerId[0], `xm_guid in (${arr.join()})`)
-        //this.$message.warning("暂无图形")
+        let arr = [`'${row.objectid}'`];
+        this.$nextTick(()=>{
+          this.$refs.baseMap.locationGlobal(this.visibleLayerId[0],`objectid in (${arr.join()})`);
+        },500);
+        
       }
     },
     drawShapeJsonEvent(json){

+ 0 - 1
YHYZT/server/src/main/java/com/zjugis/yzt/beans/entity/StNzydk.java

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.math.BigDecimal;
-import com.vividsolutions.jts.geom.Geometry;
 
 /**
  * @program: yh_yzt