From 368b6c77a9516bfe76faf845dd77d92bb45c95d8 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期五, 22 九月 2023 14:12:07 +0800
Subject: [PATCH] 空间查询,地名定位修改

---
 src/components/MapView/mapSpacePop.vue |  243 +++++++++++++++++++++++-------------------------
 1 files changed, 118 insertions(+), 125 deletions(-)

diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue
index 102b52f..ea93012 100644
--- a/src/components/MapView/mapSpacePop.vue
+++ b/src/components/MapView/mapSpacePop.vue
@@ -9,7 +9,7 @@
         <el-form-item>
           <el-input
             size="small"
-            style="width:47vh"
+            style="width:30vh"
             v-model="ruleForm.fileName"
             disabled
             placeholder="璇疯緭鍏�..."
@@ -20,7 +20,7 @@
             @click="conditionVisible = true"
             size="small"
             type="success"
-          >鏂板</el-button>
+          >{{$t('common.lable6')}}</el-button>
           <el-button
             size="small"
             @click="resetForm"
@@ -218,7 +218,10 @@
           </el-select>
         </el-form-item>
         <el-form-item v-show="!fromSqlflag">
-          <el-input v-model="formSql.value"></el-input>
+          <el-input
+            v-model="formSql.value"
+            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.queryContent')"
+          > </el-input>
         </el-form-item>
         <el-form-item v-show="fromSqlflag">
           <el-date-picker
@@ -463,8 +466,14 @@
       this.formInline.region = this.options[0].value
     },
     setListDataStart() {
-      this.listdata.pageSize = 10
-      this.listdata.pageIndex = 1
+      this.listdata = {
+        pageIndex: 1,
+        pageSize: 10,
+        name: null,
+        srid: 4326,
+        wkt: null,
+        filter: null,
+      }
       this.tableData = []
     },
     //鍒濆鍖栨煡璇㈡潯浠�
@@ -498,56 +507,29 @@
     async getTableselectFields() {
       const data = await inquiry_selectFields({ name: this.spaceLayer })
       if (data.code != 200) {
-        this.$message.error("鍒楄〃璋冪敤澶辫触")
+        this.$message.error("鍒楄〃璋冪敤瀛楁澶辫触")
       }
-      const data1 = await inquiry_selectDomains({ name: this.spaceLayer })
-      if (data1.code != 200) {
-        this.$message.error("鍒楄〃璋冪敤澶辫触")
+      if (data.result.length == 0) {
+        this.$message("鍒楄〃璋冪敤瀛楁鏌ユ棤鏁版嵁")
       }
 
-
-
+      this.filedsOption = [];
       this.optionx = []
-      this.attributeData = []
       var valadata = data.result
-      var laydomain = data1.result
-      this.optionx = data1.result
       for (var i in valadata) {
         if (valadata[i].showtype == 1) {
           if (
             valadata[i].domainNa != null &&
             valadata[i].domainNa != undefined
           ) {
-            for (var j in laydomain) {
-              if (laydomain[j].domName == valadata[i].domainNa) {
-                // valadata[i].domainNa = laydomain[j].codeDesc
-              }
-            }
+            valadata[i].domainNa = this.getMatchDomainNa(valadata[i].domainNa)
           }
-
+          this.optionx.push(valadata[i])
           this.filedsOption.push(valadata[i])
-          // this.attributeData.push(valadata[i])
-          // this.optionx.push(valadata[i])
           this.attributeData.push(valadata[i])
-
         }
       }
-
-      // this.filedsOption = [];
-      // this.optionx = []
-      // var valadata = data.result
-      // for (var i in valadata) {
-      //   if (valadata[i].showtype == 1) {
-      //     if (
-      //       valadata[i].domainNa != null &&
-      //       valadata[i].domainNa != undefined
-      //     ) {
-      //       valadata[i].domainNa = this.getMatchDomainNa(valadata[i].domainNa)
-      //     }
-
-      //   }
-      // }
-      // this.startFiledAndcondition();
+      this.startFiledAndcondition();
       this.showSpacePopLayer()
     },
     appendQueryFilter() {
@@ -612,10 +594,14 @@
     },
     //鍒濆鍖栨煡璇㈤槇鍊艰〃
     async getDomainsLayer() {
+      this.$store.state.loading = true;
       const data = await inquiry_selectDomains({ name: this.spaceLayer })
       if (data.code != 200) {
-        this.$message.error("鍒楄〃璋冪敤澶辫触")
+        this.$message.error("鍒楄〃闃堝�艰皟鐢ㄥけ璐�")
       }
+      // if (data.result.length == 0) {
+      //   this.$message("鍒楄〃闃堝�兼煡鏃犳暟鎹�")
+      // }
       this.domainsLayer = data.result
 
       this.setListDataStart()
@@ -641,12 +627,22 @@
       } else {
         this.listdata.filter = null;
       }
+      if (this.$store.state.pigCode) {
+        this.listdata.dirs = this.$store.state.pigCode;
 
+      }
 
       const data = await dataQuerySelectByPage(this.listdata)
+      this.$store.state.loading = false;
       if (data.code != 200) {
-        this.$message.error("鍒楄〃璋冪敤澶辫触")
+        return this.$message.error("鍒楄〃璋冪敤澶辫触")
       }
+      if (data.result.length == 0) {
+        return this.$message("鍒楄〃鏌ユ棤鏁版嵁")
+      }
+
+
+
       var val = data.result;
       val = val.filter((res) => {
 
@@ -676,43 +672,24 @@
       })
 
 
-
+      var val_Data = data.result
       this.count = data.count
-      for (var i in val) {
-        var meson = this.optionx.filter(res => {
-          if (res.domCode == val[i].medium) {
-            return res
-          }
-        })
-        if (meson.length > 0) {
-          val[i].medium = meson[0].codeDesc
-        } else {
-          val[i].medium = ''
-        }
 
+      for (var i in val_Data) {
+        var valste = val_Data[i]
+        for (var j in this.optionx) {
+          if (
+            this.optionx[j].domainNa != null &&
+            this.optionx[j].domainNa != undefined
+          ) {
+            valste[this.optionx[j].field] = this.optionx[j].domainNa
+          }
+        }
       }
 
-      // // // for (var i in val_Data) {
-      // // //   var valste = val_Data[i]
-      // // //   for (var j in this.optionx) {
-      // // //     if (
-      // // //       this.optionx[j].domainNa != null &&
-      // // //       this.optionx[j].domainNa != undefined
-      // // //     ) {
-      // // //       console.log(this.optionx[j])
-      // // //       // valste[this.optionx[j].field] = this.optionx[j].domainNa
-      // // //     }
-      // // //   }
-      // // // }
-      // // for (var j in this.optionx) {
-      // //   console.log(this.optionx[j].domainNa)
-      // //   // if (this.optionx[j].alias == '杈撻�佷粙璐�') {
-      // //   //   console.log(this.optionx[j].domainNa)
-      // //   // }
-      // // }
 
       this.tableData = val
-      this.$refs.filterTable.doLayout()
+      // this.$refs.filterTable.doLayout()
     },
 
     async setCartesianToEightFour(entities) {
@@ -801,19 +778,27 @@
           )
           window.histogramHandler.setInputAction((event) => {
             var pick = sgworld.Viewer.scene.pick(event.endPosition);
+            if (pick) {
 
-            var propertiesFlag = that.$store.state.propertiesFlag
+              var propertiesFlag = that.$store.state.propertiesFlag
 
-            if (Cesium.defined(pick)) {
-              if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") {
-                that.$store.state.propertiesInfo = {
-                  title: pick.id.properties._exppointid._value,
-                  name: pick.id.properties._geoname._value,
-                  type: pick.id.properties.geotype._value,
-                  botdepth: pick.id.properties._botdepth._value,
-                  describe: pick.id.properties._describe._value,
+              if (Cesium.defined(pick)) {
+                if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") {
+                  that.$store.state.propertiesInfo = {
+                    title: pick.id.properties._exppointid._value,
+                    name: pick.id.properties._geoname._value,
+                    type: pick.id.properties.geotype._value,
+                    botdepth: pick.id.properties._botdepth._value,
+                    describe: pick.id.properties._describe._value,
+                  }
+                  that.$store.state.propertiesFlag = "2"
+                } else {
+                  if (propertiesFlag == 1) {
+                    that.$store.state.propertiesFlag = propertiesFlag
+                  } else {
+                    that.$store.state.propertiesFlag = null
+                  }
                 }
-                that.$store.state.propertiesFlag = "2"
               } else {
                 if (propertiesFlag == 1) {
                   that.$store.state.propertiesFlag = propertiesFlag
@@ -821,13 +806,8 @@
                   that.$store.state.propertiesFlag = null
                 }
               }
-            } else {
-              if (propertiesFlag == 1) {
-                that.$store.state.propertiesFlag = propertiesFlag
-              } else {
-                that.$store.state.propertiesFlag = null
-              }
             }
+
           }, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
         }, 500);
       }
@@ -944,7 +924,8 @@
       var coord = wkt.coordinates;
 
       var std = [];
-      var num = res.elev;
+      var num = res.elev == null ? 0 : res.elev;
+
       var height = 0;
       for (var i in data) {
         if (data[i].exppointid == exppointid) {
@@ -953,45 +934,51 @@
       }
 
       var outlineList = this.outlineList;
-      for (var i in std) {
-        var line;
-        var geoname = std[i].geoname;
-        var col = outlineList.filter((ste) => {
-          if (ste.name == geoname) {
-            return res
-          }
-        })
-        console.log(1, col)
-        if (col.length == 0) {
-          col = outlineList.filter((ste) => {
-            if (ste.name == '鍏朵粬') {
+      if (std.length > 0) {
+        for (var i in std) {
+          var line;
+          var geoname = std[i].geoname;
+          var col = outlineList.filter((ste) => {
+            if (ste.name == geoname) {
               return res
             }
           })
+
+          if (col.length == 0) {
+            col = outlineList.filter((ste) => {
+              if (ste.name == '鍏朵粬') {
+                return res
+              }
+            })
+          }
+          line = col[0].color
+
+          var height = num - std[i].botdepth
+          // console.log(num, std[i].botdepth)
+          var layer = Viewer.entities.add({
+            position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]),
+            tag: 'Histogram',
+            properties: std[i],
+            ellipse: {
+              semiMinorAxis: 2.0, //鐭酱
+              semiMajorAxis: 2.0, //闀胯酱
+              height: height, //鎷変几楂樺害    elev  gwaterdep
+              extrudedHeight: num, //绂诲湴楂樺害
+              rotation: Cesium.Math.toRadians(0), //鏃嬭浆
+              fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖
+              material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊,
+              outline: false, //鏄惁鏄剧ず鍦嗚疆寤�
+
+            },
+          });
+          num -= std[i].botdepth;
+          this.$store.state.histogramLayer.push(layer)
         }
-        line = col[0].color
-
-        var height = num - std[i].botdepth
-        var layer = Viewer.entities.add({
-          position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]),
-          tag: 'Histogram',
-          properties: std[i],
-          ellipse: {
-            semiMinorAxis: 1.0, //鐭酱
-            semiMajorAxis: 1.0, //闀胯酱
-            height: height, //鎷変几楂樺害    elev  gwaterdep
-            extrudedHeight: num, //绂诲湴楂樺害
-            rotation: Cesium.Math.toRadians(0), //鏃嬭浆
-            fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖
-            material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊,
-            outline: false, //鏄惁鏄剧ず鍦嗚疆寤�
-
-          },
-        });
-        num -= std[i].botdepth;
-        this.$store.state.histogramLayer.push(layer)
+        this.$store.state.histLenged = true;
       }
-      this.$store.state.histLenged = true;
+
+
+
     },
 
 
@@ -1365,7 +1352,6 @@
           this.$store.state.queryInfo.push(point)
           sgworld.Navigate.flyToObj(point)
           this.$store.state.primitLayer = point
-
           break
         case "LineString":
         case "MultiLineString":
@@ -1425,6 +1411,13 @@
           pick.id.tag &&
           pick.id.tag.includes("properties_")
         ) {
+          if (this.spaceLayer == 'msurfacedeformationdata') {
+            this.$store.state.surfaceDeForm.flag = true;
+            this.$store.state.surfaceDeForm.gid = pick.id.properties.gid._value;
+          } else {
+            this.$store.state.surfaceDeForm.flag = false;
+            this.$store.state.surfaceDeForm.gid = null;
+          }
           this.$store.state.propertiesFlag = "1"
           let properties = pick.id.properties
           let propertyNames = pick.id.properties.propertyNames
@@ -1507,7 +1500,7 @@
   }
   .bottomPage {
     position: absolute;
-    bottom: 3%;
+    bottom: 10px;
   }
   /deep/.el-form-item {
     margin-bottom: 0px;

--
Gitblit v1.9.3