Przeglądaj źródła

智能选址增加图例

liutao 2 miesięcy temu
rodzic
commit
eb194d2166

+ 56 - 37
web_ui/src/views/industrial-land/AiIndustriaLandDetail.vue

@@ -70,7 +70,7 @@
             </div>
           </div>
         </div>
-        <!-- <div class="legend-panel" v-if="showLegend">
+        <div class="legend-panel" v-if="showLegend">
           <div class="name-panel">
             <div class="name">图例</div>
             <img
@@ -94,17 +94,19 @@
                 :key="index"
                 class="zl"
               >
-                <i
+              <img v-if="item.type=='img'" :src="citem.imgSrc"> 
+               <i v-else
                   :style="{
                     background: citem.fill == 'transparent' ? '' : citem.fill,
                     borderColor: citem.border,
                   }"
                 ></i
-                >{{ citem.name }}&nbsp;&nbsp;&nbsp;
+                >
+                {{ citem.name }}&nbsp;&nbsp;&nbsp;
               </div>
             </div>
           </div>
-        </div> -->
+        </div>
         <div v-if="!showQuery" class="topdiv">
           <div class="m-textarea-panel">
             <textarea
@@ -506,46 +508,46 @@ export default {
       this.activeIndex = 0;
       this.initMap();
 
-      // this.showResult = true;
-      // this.showQuery = true;
+      this.showResult = true;
+      this.showQuery = true;
+      this.xgdk = [
+        {
+          objectid: 1839,
+        },
+        {
+          objectid: 1843,
+        },
+        {
+          objectid: 1845,
+        },
+      ];
       // this.xgdk = [
       //   {
-      //     objectid: 1839,
+      //     id: 7685,
       //   },
       //   {
-      //     objectid: 1843,
+      //     id: 37091,
       //   },
       //   {
-      //     objectid: 1845,
+      //     id: 40175,
       //   },
       // ];
-      // // this.xgdk = [
-      // //   {
-      // //     id: 7685,
-      // //   },
-      // //   {
-      // //     id: 37091,
-      // //   },
-      // //   {
-      // //     id: 40175,
-      // //   },
-      // // ];
-      // this.getDetailByIdList(this.xgdk, (data) => {
-      //   this.xgdk = data;
-      // });
-      // this.addGdLayer(this.xgdk);
-      // this.detailData = {
-      //   id: 48668,
-      //   dkid: "1895353609416212480",
-      //   xzqmc: "萧山区",
-      //   dkmc: "湘湖国家旅游度假区建设工矿仓储项目",
-      //   address: "位于萧山区义桥镇,东至空地,南至空地,西至空地,北至云临路。",
-      //   dkmj: 60.714,
-      //   tdyt: "工业用地",
-      //   tax: "100",
-      //   center_wkt: "POINT(120.912063 29.486802)",
-      // };
-      // this.showDetail = true;
+      this.getDetailByIdList(this.xgdk, (data) => {
+        this.xgdk = data;
+      });
+      this.addGdLayer(this.xgdk);
+      this.detailData = {
+        id: 48668,
+        dkid: "1895353609416212480",
+        xzqmc: "萧山区",
+        dkmc: "湘湖国家旅游度假区建设工矿仓储项目",
+        address: "位于萧山区义桥镇,东至空地,南至空地,西至空地,北至云临路。",
+        dkmj: 60.714,
+        tdyt: "工业用地",
+        tax: "100",
+        center_wkt: "POINT(120.912063 29.486802)",
+      };
+      this.showDetail = true;
       // this.checkPermision();
     });
   },
@@ -560,7 +562,7 @@ export default {
   methods: {
     dSourceChange() {
       if (this.dSource === "3") {
-        this.$Message.error("暂无数据,请选择其他源!");
+        this.$Message.error("暂无数据,请选择其他数据源!");
       }
     },
     toggleContentVisabledAll() {
@@ -830,10 +832,27 @@ export default {
           }
         }
         this.map.addLayer(item.layer);
+
+        //添加图例
+        if (item.legend && item.legend.children) {
+          let find = this.legend.find((ele) => ele.name == item.name);
+          if (!find) {
+            this.legend.push({
+              name: item.name,
+              type:item.legend.type,
+              children: item.legend.children,
+            });
+          }
+        }
       } else {
         if (item.layer != undefined || item.layer != null) {
           this.map.removeLayer(item.layer);
         }
+
+        let findIndex = this.legend.findIndex((ele) => ele.name == item.name);
+        if (findIndex > -1) {
+          this.legend.splice(findIndex, 1);
+        }
       }
     },
     customTileUrl(coords) {

+ 58 - 3
web_ui/static/config.js

@@ -139,6 +139,15 @@
             url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/sde/wms',
             layername: 'sde:kfq',
             zindex: 1
+          },
+          {
+            name: "公告地块",
+            id: "ggdk",
+            checked: false,
+            type: 'geoserver',
+            url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/sde/wms',
+            layername: 'sde:ecgap_klyzy',
+            zindex: 1
           }
         ]
       },
@@ -150,7 +159,16 @@
             checked: false,
             type: 'tile2',
             url: 'https://ai.zrzyt.zj.gov.cn/mapserver/GDPProxy231/3a92d7f92e8f45ea92e1e83be0e52291/arcgis/rest/services/GCS330000_1002_GTBGDC_ZWB_2024/GCS330000_1002_GTBGDC_SD_2024/MapServer',
-            zindex: 1
+            zindex: 1,
+            legend: {
+              type:'img',
+              children: [
+                {
+                  name: "湿地",
+                  imgSrc: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAADFJREFUOI1jYaAyYKGZgfd2Xf9PiUFKbpqMKAZSC4waOGrgqIGjBtLZQFh5RjUDqQUA4ZwE45Cv8YAAAAAASUVORK5CYII=",
+                }
+              ],
+            },
           },
           {
             name: "耕地",
@@ -244,6 +262,15 @@
           id: "yjjbnt",
           checked: false,
           type: 'tile2',
+          legend: {
+            children: [
+              {
+                name: "永久基本农田",
+                fill: "yellow",
+                border: "yellow",
+              }
+            ],
+          },
           url: 'https://ai.zrzyt.zj.gov.cn/mapserver/GDPProxy226/a119e0e024944866a260798599aa19f4/arcgis/rest/services/GCS330000_2001_YJJBNT_GX/GCS330000_2001_YJJBNT_GX_XSB/MapServer',
           zindex: 1
         },
@@ -253,7 +280,26 @@
           checked: false,
           type: 'tile2',
           url: 'https://ai.zrzyt.zj.gov.cn/mapserver/GDPProxy226/789b497aff224fb3b612187decca0586/arcgis/rest/services/GCS330000_2001_CZKFBJ/GCS330000_2001_CZKFBJ_YHCG/MapServer',
-          zindex: 1
+          zindex: 1,
+          legend: {
+            children: [
+              {
+                name: "城镇发展区",
+                fill: "#41d7fa",
+                border: "#41d7fa",
+              },
+              {
+                name: "城镇弹性发展区",
+                fill: "#fac4cb",
+                border: "#fac4cb",
+              },
+              {
+                name: "城镇集中建设区",
+                fill: "#f26a85",
+                border: "#f26a85",
+              }
+            ],
+          },
         },
         {
           name: "生态保护红线",
@@ -261,7 +307,16 @@
           checked: false,
           type: 'tile2',
           url: 'https://ai.zrzyt.zj.gov.cn/mapserver/zjgt38/9a971693e3e1461b99a66c3a81dc6823/arcgis/rest/services/GCS330000_2001_SQSX_2022/GCS330000_2001_STBHHX_2022/MapServer',
-          zindex: 1
+          zindex: 1,
+          legend: {
+            children: [
+              {
+                name: "生态保护红线",
+                fill: "#7fff3c",
+                border: "#7fff3c",
+              }
+            ],
+          },
         }]
       }