liutao 2 месяцев назад
Родитель
Сommit
18de7649ed

+ 89 - 107
web_ui/src/views/industrial-land/AiIndustriaLandDetail.vue

@@ -114,7 +114,7 @@
               autocomplete="off"
               spellcheck="false"
               autocorrect="off"
-              placeholder="您可以试着这样问我,如“帮我在萧山区推荐一宗30-100亩左右的工业用地”"
+              placeholder="您可以试着这样问我,如“帮我在萧山区推荐3宗50-80亩之间的工业用地”"
               autofocus=""
             >
             </textarea>
@@ -174,13 +174,11 @@
                     <div class="number">{{ i + 1 }}</div>
                     <div class="content">
                       <h3>
-                        {{ citem.ydxz }}({{
-                          citem.ydmj ? citem.ydmj.toFixed(2) : "-"
-                        }}公顷)
+                        {{ citem.ydxz }}
                       </h3>
                       <p>
                         <span class="content-item"
-                          >用地性质:{{ citem.ydxz ? citem.ydxz : "-" }}</span
+                          >单元名称:{{ citem.dymc ? citem.dymc : "-" }}</span
                         >
                         <span class="content-item"
                           >行政区:{{ citem.xzqmc ? citem.xzqmc : "-" }}</span
@@ -318,6 +316,7 @@ export default {
   },
   data() {
     return {
+      geoLayer: null,
       nearMarkerList: [],
       radarScanStyle: {
         width: "100%",
@@ -334,7 +333,7 @@ export default {
           name: "请帮我在杭州市萧山机场附近推荐几块总价不超过2000万的工业用地",
         },
         {
-          name: "帮我在萧山区推荐一宗30-100亩左右的工业用地",
+          name: "帮我在萧山区推荐3宗50-80亩之间的工业用地",
         },
         {
           name: "请帮我杭州市找几块在开发区内,园区主导产业为新能源的工业用地",
@@ -541,7 +540,7 @@ export default {
       //     geom: "POLYGON((120.502129268 30.168593076,120.501546244 30.167333288,120.501537309 30.167317156,120.501526002 30.167302191,120.500703524 30.167926949,120.499290933 30.168947797,120.499089718 30.169139869,120.499102336 30.169156599,120.499478655 30.169583076,120.499495744 30.169599471,120.499515679 30.169613228,120.499537927 30.169623978,120.499561893 30.169631437,120.499586937 30.169635401,120.499612391 30.169635768,120.499637573 30.169632527,120.49966181 30.169625764,120.500722401 30.169244194,120.502044364 30.168768574,120.502068293 30.168757769,120.502089718 30.168743538,120.502107997 30.168726308,120.50212258 30.168706597,120.50213303 30.168684996,120.502139035 30.168662151,120.502140414 30.16863875,120.502137126 30.168615492,120.502129268 30.168593076))",
       //   },
       // ];
-
+      // this.addGdLayer(this.xgdk);
       // this.detailData = {
       //   id: 48668,
       //   dkid: "1895353609416212480",
@@ -566,6 +565,29 @@ export default {
   },
 
   methods: {
+    addGdLayer(dklist) {
+      if (this.geoLayer) {
+        this.map.removeLayer(this.geoLayer);
+        this.geoLayer = null;
+      }
+      let that = this;
+      if (dklist && dklist.length) {
+        let idGroup = dklist.map((item) => item.objectid);
+        let sql = "(" + idGroup.join(",") + ")";
+        let queryGeometryUrl = window.ApplicationConfig.queryGeometryListUrl;
+        axios.get(queryGeometryUrl, { params: { items: sql } }).then((data) => {
+          if (data && data.data && data.data.length) {
+            let geojsonList = data.data.map((ele) => JSON.parse(ele.geom));
+            that.geoLayer = L.geoJSON(geojsonList, {
+              style: function (feature) {
+                return { color: "blue" };
+              },
+            });
+            that.geoLayer.addTo(that.map);
+          }
+        });
+      }
+    },
     toggleLayerControl() {
       this.showLayerControl = !this.showLayerControl;
       if (!this.showLegend) {
@@ -649,38 +671,49 @@ export default {
         this.$Message.info("请输入");
         return;
       }
-      this.inputText = this.input;
-      this.zwinputText = "";
-      this.questionModal = false;
-      this.histories = new ArrayQueue(5);
-      // this.hzData = [];
-      // var item = { name: this.inputText, loading: true };
-      // this.hzData.push(item);
-      this.toggleTab(0);
+      // this.inputText = this.input;
+      // this.zwinputText = "";
+      // this.questionModal = false;
+      // this.histories = new ArrayQueue(5);
+      // // this.hzData = [];
+      // // var item = { name: this.inputText, loading: true };
+      // // this.hzData.push(item);
+      // this.toggleTab(0);
+      this.hotQuestionReset();
     },
     hotQuestionReset() {
       if (this.inputText == "" || this.inputText == null) {
         // this.$Message.info("请输入");
         // return;
-        this.inputText = "帮我在萧山区推荐一宗30-100亩左右的工业用地";
+        this.inputText = "帮我在萧山区推荐3宗50-80亩之间的工业用地";
       }
-
+      this.hideDetail();
       this.zwinputText = "";
       this.questionModal = false;
       this.histories = new ArrayQueue(5);
+      if (this.geoLayer) {
+        this.map.removeLayer(this.geoLayer);
+        this.geoLayer = null;
+      }
+      if (this.geojsonLayer) {
+        this.map.removeLayer(this.geojsonLayer);
+        this.geojsonLayer = null;
+      }
       this.toggleInfoTab();
       this.toggleTab(0);
     },
     zwsend() {
       if (!this.zwinputText) {
-        this.zwinputText = "帮我在萧山区推荐一宗30-100亩左右的工业用地";
+        this.zwinputText = "帮我在萧山区推荐3宗50-80亩之间的工业用地";
       }
-      var item = { name: this.zwinputText, loading: true };
-      // this.hzData = [item]
-      this.hzData.push(item);
-      this.activeIndex = 0;
-      this.toggleInfoTab();
-      this.send();
+      // var item = { name: this.zwinputText, loading: true };
+      // // this.hzData = [item]
+      // this.hzData.push(item);
+      // this.activeIndex = 0;
+      // this.toggleInfoTab();
+      // this.send();
+      this.inputText = this.zwinputText;
+      this.hotQuestionReset();
     },
     //ai超时超过3.5分钟 或者报错处理,结束请求提示未查询到信息
     checkTimeOut() {
@@ -926,41 +959,12 @@ export default {
     },
     //显示地块详情,先获取地块图斑,定位、路线、和地类分析需要叠加获取相交地块
     showDetailModal(item, index) {
-      // if (
-      //   (this.activeItem && this.activeItem.id != item.id) ||
-      //   this.activeItem == null
-      // ) {
-      //   if (this.dkIndex != index) {
-      //     if (this.geojsonLayer) {
-      //       this.map.removeLayer(this.geojsonLayer);
-      //       this.geojsonLayer = null;
-      //     }
-      //   }
-      //   this.clearMark();
-      //   this.showDetail = true;
-      //   this.activeItem = item;
-      //   this.dkIndex = index;
-      //   //高亮marker
-      //   this.hightMarker(index);
-      // } else {
-      //   if (this.geojsonLayer) {
-      //     this.map.removeLayer(this.geojsonLayer);
-      //     this.geojsonLayer = null;
-      //   }
-      //   this.showDetail = false;
-      //   this.clearMark();
-      //   this.activeItem = null;
-      // }
       this.clearMark();
       this.activeItem = item;
       //高亮marker
       this.hightMarker(index);
       this.showDetail = true;
       this.dkIndex = index;
-      if (this.geojsonLayer) {
-        this.map.removeLayer(this.geojsonLayer);
-        this.geojsonLayer = null;
-      }
       this.goLocation(item, index);
     },
     //地块收藏点击查看详情
@@ -975,14 +979,14 @@ export default {
     //隐藏详情
     hideDetail() {
       this.showDetail = false;
-      if (this.geojsonLayer) {
-        this.map.removeLayer(this.geojsonLayer);
-        this.geojsonLayer = null;
-      }
-      if (this.identifyGeojsonLayer) {
-        this.map.removeLayer(this.identifyGeojsonLayer);
-      }
-      this.clearMark();
+      // if (this.geojsonLayer) {
+      //   this.map.removeLayer(this.geojsonLayer);
+      //   this.geojsonLayer = null;
+      // }
+      // if (this.identifyGeojsonLayer) {
+      //   this.map.removeLayer(this.identifyGeojsonLayer);
+      // }
+      // this.clearMark();
     },
     //收藏
     doCollect(collect) {
@@ -1048,47 +1052,25 @@ export default {
       if (this.identifyGeojsonLayer) {
         this.map.removeLayer(this.identifyGeojsonLayer);
       }
-      this.detailData = item;
-      let geojson = wkt.parse(item.geom);
-      var geos = L.geoJSON(geojson, {
-        style: function (feature) {
-          return { color: "red", fillOpacity: 0 };
-        },
-      });
 
-      // this.dkGeo = geos;
-      // this.dkGeoJson = geojson;
-      this.geojsonLayer = geos.addTo(this.map);
-      this.map.fitBounds(geos.getBounds());
-      // console.log("item:" + item);
-      // let query =
-      //   window.ApplicationConfig.geoserverUrl +
-      //   "?service=WFS&version=1.0.0&request=GetFeature&typeName=" +
-      //   window.ApplicationConfig.gdLayerName +
-      //   "&maxFeatures=50&outputFormat=application%2Fjson&cql_filter=id=" +
-      //   item.id;
-      // axios.get(query).then((data) => {
-      //   console.log(data);
-      //   if (data.data.features.length < 1) {
-      //     this.$Message.info("未查询到数据");
-      //     return;
-      //   }
-      //   this.detailData = data.data.features[0].properties;
-      //   this.detailData.center_wkt = item.center_wkt;
-      //   var geojson = data.data.features[0].geometry;
-      //   this.detailData.wkt = wkt.stringify(geojson);
-      //   console.log("this.detailData");
-      //   console.log(this.detailData);
-      //   var geos = L.geoJSON(geojson, {
-      //     style: function (feature) {
-      //       return { color: "red", fillOpacity: 0 };
-      //     },
-      //   });
-
-      //   this.dkGeo = geos;
-      //   this.dkGeoJson = geojson;
-      //   this.geojsonLayer = geos.addTo(this.map);
-      //   this.map.fitBounds(geos.getBounds());
+      let queryGeometryUrl = window.ApplicationConfig.queryGeometryUrl;
+      let that =this;
+      axios
+        .get(queryGeometryUrl, { params: { id: item.objectid } })
+        .then((data) => {
+          if (data && data.data && data.data.length) {
+            that.detailData = data.data[0];
+            let geojson = wkt.parse(data.data[0].geom);
+            var geos = L.geoJSON(geojson, {
+              style: function (feature) {
+                return { color: "red", fillOpacity: 0 };
+              },
+            });
+            that.geojsonLayer = geos.addTo(that.map);
+            that.map.fitBounds(geos.getBounds(), { maxZoom: 17 });
+          }
+        });
+
       // });
     },
     //获取地块信息
@@ -1126,6 +1108,7 @@ export default {
         this.map.removeLayer(this.markerLayer);
         this.markerLayer = null;
       }
+
       if (this.polyline) {
         this.map.removeLayer(this.polyline);
         this.polylines = null;
@@ -1428,7 +1411,7 @@ export default {
         question = this.zwinputText.trim();
       }
       let mock = false;
-      if (question === "帮我在萧山区推荐宗31亩左右的工业用地") {
+      if (question === "帮我在萧山区推荐宗31亩左右的工业用地") {
         mock = true;
       }
 
@@ -1542,7 +1525,7 @@ export default {
       if (e.data != "[FINISH]" && e.data != "[DONE]") {
         const responseData = JSON.parse(e.data);
         const responses = responseData["agent_responses"];
-        console.log("responses: ", responses);
+        // console.log("responses: ", responses);
         const lastRes = responses[responses.length - 1];
         var lastUpRes = null;
         responses.forEach((item, index) => {
@@ -1552,7 +1535,7 @@ export default {
             item.exec_res.indexOf("\n```json\n") > -1
           ) {
             lastUpRes = responses[index];
-            console.log("lastUpRes: ", lastUpRes);
+            // console.log("lastUpRes: ", lastUpRes);
           }
         });
         const user_request = responseData.user_request;
@@ -1577,8 +1560,6 @@ export default {
               !executed
             ) {
               T.loading = false;
-              // T.summary = lastChoice.content.replaceAll('\n```json\n', '').replaceAll('```json\n', '')
-              //     .replaceAll('\n```\n', '')
               T.hzData.forEach((item, index) => {
                 if (index == T.hzData.length - 1) {
                   T.hzData[index].summary = lastChoice.content
@@ -1609,8 +1590,9 @@ export default {
                   T.xgdk = dk;
                   T.clearMark();
                   T.showXgdkCenterPoint();
+                  T.addGdLayer(T.xgdk);
                   T.answer = e.data;
-                  T.burialPoint();
+                  // T.burialPoint();
                 } else {
                   T.xgdk = [];
                   T.clearMark();

+ 46 - 8
web_ui/src/views/industrial-land/ZnxzDetail.vue

@@ -478,6 +478,7 @@ export default {
         },
         msg: "",
       },
+      kfqResult: {},
       markercenter: [],
       surroundAnalysisData: {
         code: 200,
@@ -878,6 +879,11 @@ export default {
       ],
 
       dkxx: [
+        {
+          name: "单元名称",
+          value: "",
+          key: "dymc",
+        },
         {
           name: "行政区名称",
           value: "",
@@ -891,7 +897,7 @@ export default {
         {
           name: "地块面积(亩)",
           value: "",
-          key: "ydmj",
+          key: "pfmarea",
         },
         {
           name: "用地性质",
@@ -981,9 +987,13 @@ export default {
           value: 0,
         },
         {
-          name: "建设用地",
+          name: "城镇村及工矿用地",
           value: 0,
         },
+        // {
+        //   name: "建设用地",
+        //   value: 0,
+        // },
         {
           name: "水域及水利设施用地",
           value: 0,
@@ -1226,7 +1236,7 @@ export default {
             that.dkxx.forEach((item) => {
               for (var key in attributes) {
                 if (key == item.key) {
-                  if (key == "area") {
+                  if (key == "pfmarea") {
                     item.value = attributes[key]
                       ? (attributes[key] * 0.0015).toFixed(2)
                       : "";
@@ -1502,6 +1512,33 @@ export default {
       });
     },
 
+    aaa(wkt) {
+      wkt =
+        "POLYGON((119.84164207 28.94396709,119.84145319 28.94408398,119.8405613 28.94469764,119.84047893 28.94472,119.8397249 28.94385862,119.83971844 28.94385124,119.83963416 28.94375317,119.83940952 28.94349834,119.83940318 28.94349109,119.83936822 28.94345082,119.84042896 28.94273167,119.83963696 28.94182755,119.83974238 28.9417985,119.84164207 28.94396709))";
+      console.log(wkt);
+      const url = window.ApplicationConfig.geoserverUrl;
+      const typeName =
+        window.ApplicationConfig.layerTreeConfig[2].layers[0].layername;
+      let cqlFilter = `INTERSECTS(shape,${wkt})`;
+      let parmas = {
+        service: "WFS",
+        version: "1.0",
+        request: "GetFeature",
+        typeName: typeName,
+        maxFeatures: 50,
+        outputFormat: "application/json",
+        cql_filter: cqlFilter,
+      };
+      axios.get(url, { params: parmas }).then((d) => {
+        if (d && d.data && d.data.features) {
+          let features = d.data.features;
+          features.forEach((f) => {
+            console.log(f);
+          });
+        }
+      });
+    },
+
     initXzfx(wktStr) {
       this.xzfxList[0].value = 0;
       this.xzfxList[1].value = 0;
@@ -1527,9 +1564,9 @@ export default {
             this.xzfxList[5].value = (data.ssnydIntersectArea * 0.0015).toFixed(
               2
             );
-            this.xzfxList[6].value = (data.jsydIntersectArea * 0.0015).toFixed(
-              2
-            );
+            this.xzfxList[6].value = (
+              data.czcjjsydIntersectArea * 0.0015
+            ).toFixed(2);
             this.xzfxList[7].value = (
               data.syjslssydIntersectArea * 0.0015
             ).toFixed(2);
@@ -1582,6 +1619,7 @@ export default {
         });
     },
     analysis() {
+      // this.aaa(this.item.geom);
       this.initXzfx(this.item.geom);
       this.initGhfx(this.item.geom);
       this.initSqsx(this.item.geom);
@@ -1733,8 +1771,8 @@ export default {
       let plot_ratio_end = this.dkxx["plot_ratio_end"];
       this.dkxx.forEach((prop) => {
         if (prop.key in this.item) {
-          if (prop.key == "tax" && this.item[prop.key]) {
-            prop.value = "≥" + this.item[prop.key];
+          if (prop.key == "pfmarea" && this.item[prop.key]) {
+            prop.value = (this.item[prop.key]*0.0015).toFixed(2);
           } else {
             prop.value = this.item[prop.key];
           }

+ 30 - 7
web_ui/static/config.js

@@ -3,6 +3,8 @@
     serverURL: "/server",
     // subscribeUrl: 'http://ai.zjugis.com:8511/subscribe/',
     subscribeUrl: 'http://localhost:8511/subscribe/',
+    queryGeometryUrl: 'http://localhost:8511/queryGeometry/',
+    queryGeometryListUrl: 'http://localhost:8511/queryGeometryList/',
     //  subscribeUrl: 'http://10.10.9.143:8511/subscribe/',
     //  subscribeUrl: '/agentai/subscribe/',
     // subscribeUrl: 'http://192.168.0.145:8511/subscribe/',
@@ -19,7 +21,10 @@
     gdUrl: 'http://60.191.110.204:6080/arcgis/rest/services/sde/ZPGGD/MapServer',
     landUrl: 'http://60.191.110.204:6080/arcgis/rest/services/sde/ecgap_klyzy/MapServer',
     xzqUrl: 'http://60.191.110.204:6080/arcgis/rest/services/sde/ZJXZQ/MapServer',
-    geoserverUrl: '/geoserver-host/geoserver/sde/ows',
+    geoserverUrl: '/geoserver-host/geoserver/nrllm/ows',
+    xzfxUrl:'/aisKnowledge/gis/intersect/get-intersect-wkt',
+    ghfxUrl:'/aisKnowledge/gis/intersect/get-kxg-intersect-wkt',
+    sqsxUrl:'/aisKnowledge/gis/intersect/get-sqsx-intersect-wkt',
     gdLayerName: 'sde%3Aecgap_klyzy',
     mapOptions: {
       zoom: 8,
@@ -91,24 +96,42 @@
             checked: true,
             type: 'geoserver',
             url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/test/wms',
-            layername: 'sde:sjxzq'
+            layername: 'sde:sjxzq',
           }
         ]
       },
       {
         name: '现状图层', layers: [
           {
-            name: "可利用资源",
+            name: "供地",
             id: "GD",
-            checked: true,
+            checked: false,
             type: 'geoserver',
-            // url: 'https://zdzy.zrzyt.zj.gov.cn/geoserver/sde/wms',
-            // layername: 'sde:ecgap_klyzy'
+            // url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/wms',
+            // layername: 'sde:gdxminfo_all',
             url: 'http://60.191.110.204:8515/geoserver/nrllm/wms',
             layername: 'nrllm:ecgap_klyzy'
+          },
+          {
+            name: "开发区",
+            id: "GD",
+            checked: false,
+            type: 'geoserver',
+            url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/sde/wms',
+            layername: 'sde:kfq',
+          },
+          {
+            name: "工业用地调查",
+            id: "GD",
+            checked: false,
+            type: 'geoserver',
+            url: 'https://kjzl.zrzyt.zj.gov.cn/zdzy/geoserver/sde/wms',
+            layername: 'sde:zjgyddc',
+
           }
         ]
-      }
+      },
+      
     ],
   }
 }(window))