管道基础大数据平台系统开发-【前端】-新系統界面
src/components/MapView/mapSpacePop.vue
@@ -787,91 +787,152 @@
        pageIndex: 1,
        pageSize: res,
        wkt: this.listdata.wkt,
        name: this.listdata.name
        name: this.listdata.name,
        hasGeom: 1,
      }
      const data = await dataQuerySelectByPage(obj)
      if (data.code != 200) {
        return
      }
      var val = data.result;
      for (var i in val) {
        this.setShowHistogramLayer(val[i])
      }
      // for (var i in val) {
      this.setShowHistogramLayer(val)
      // }
    },
    async setShowHistogramLayer(res) {
      var param = {
        gid: res.gid,
        name: this.spaceLayer,
      }
      var gid = [];
      for (var i in res) {
      const data1 = await dataQuerySelectWktById(param)
      if (data1.code != 200) {
        this.$message.error("列表调用失败")
        gid.push(res[i].exppointid)
      }
      var val1 = decr(data1.result)
      var wkt = this.$wkt.parse(val1)
      var coord = wkt.coordinates
      // var param = {
      //   gid: res.gid,
      //   name: this.spaceLayer,
      // }
      // const data1 = await dataQuerySelectWktById(param)
      // if (data1.code != 200) {
      //   this.$message.error("列表调用失败")
      // }
      // var val1 = decr(data1.result)
      // var wkt = this.$wkt.parse(val1)
      // var coord = wkt.coordinates
      var obj = {
        pageIndex: 1,
        pageSize: 10,
        pageSize: 100000000,
        name: 'sexplorationpointstratum',
        filter: "exppointid = '" + res.exppointid + "'"
        filter: "exppointid in '" + gid.toString() + "'"
      }
      var data = await dataQuerySelectByPage(obj)
      if (data.code != 200) { return }
      if (data.result.length != 0) {
        var val = data.result;
        // //冒泡排序
        // for (var i = 0; i < val.length; i++) {
        //   for (var u = i + 1; u < val.length; u++) {
        //     if (val[i].botdepth > val[u].botdepth) {
        //       var num = val[i];
        //       val[i] = val[u];
        //       val[u] = num;
        //     }
        //   }
        // }
        var outlineList = this.outlineList
        var num = res.elev;
        var height = 0;
        for (var i = 0; i < val.length; i++) {
          var line;
          var geoname = val[i].geoname;
          var col = outlineList.filter((res) => {
            if (res.name == geoname) {
              return res
            }
          })
          line = col[0].color
          var height = num - val[i].botdepth
          var layer = Viewer.entities.add({
            position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]),
            tag: 'Histogram',
            properties: val[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 -= val[i].botdepth;
          this.$store.state.histogramLayer.push(layer)
        }
      } else {
      if (data.result.length == 0) {
        return this.$message('查无数据');
      }
      for (var i in res) {
        this.setHistogramLayer(res[i], data.result)
      }
      // if (data.result.length != 0) {
      //   var val = data.result;
      // //冒泡排序
      // for (var i = 0; i < val.length; i++) {
      //   for (var u = i + 1; u < val.length; u++) {
      //     if (val[i].botdepth > val[u].botdepth) {
      //       var num = val[i];
      //       val[i] = val[u];
      //       val[u] = num;
      //     }
      //   }
      // }
      //   var num = res.elev;
      //   var height = 0;
      //   for (var i = 0; i < val.length; i++) {
      //     var line;
      //     var geoname = val[i].geoname;
      //     var col = outlineList.filter((res) => {
      //       if (res.name == geoname) {
      //         return res
      //       }
      //     })
      //     line = col[0].color
      //     var height = num - val[i].botdepth
      //     var layer = Viewer.entities.add({
      //       position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]),
      //       tag: 'Histogram',
      //       properties: val[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 -= val[i].botdepth;
      //     this.$store.state.histogramLayer.push(layer)
      //   }
      // } else {
      //
      // }
      //
    },
    setHistogramLayer(res, data) {
      var exppointid = res.exppointid;
      var val1 = decr(res.geom)
      var wkt = this.$wkt.parse(val1)
      var coord = wkt.coordinates;
      var std = [];
      var num = res.elev;
      var height = 0;
      for (var i in data) {
        if (data[i].exppointid == exppointid) {
          std.push(data[i])
        }
      }
      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
          }
        })
        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;
    },
@@ -918,47 +979,51 @@
          pageIndex: 1,
          pageSize: this.geobodyCount,
          wkt: this.listdata.wkt,
          name: this.listdata.name
          name: this.listdata.name,
          hasGeom: 1,
        }
        const data = await dataQuerySelectByPage(obj)
        if (data.code != 200) {
          return
        }
        var gid = [];
        var val = data.result;
        var std = [];
        for (var i in val) {
          var param = {
            gid: val[i].gid,
            name: this.spaceLayer,
          }
          gid.push(val[i].exppointid)
        }
        var obj = {
          pageIndex: 1,
          pageSize: 100000000,
          name: 'sexplorationpointstratum',
          filter: "exppointid in '" + gid.toString() + "'"
        }
        var data2 = await dataQuerySelectByPage(obj)
        debugger
        if (data2.code == 200) {
          var val2 = data2.result;
          var std = [];
          for (var i in val) {
            var soilLayers = [];
          const data1 = await dataQuerySelectWktById(param)
          if (data1.code != 200) {
            this.$message.error("列表调用失败")
          }
          var val1 = decr(data1.result)
          var wkt = this.$wkt.parse(val1)
          var coord = wkt.coordinates
          var obj = {
            pageIndex: 1,
            pageSize: 10,
            name: 'sexplorationpointstratum',
            filter: "exppointid = '" + val[i].exppointid + "'"
          }
          var data2 = await dataQuerySelectByPage(obj)
          if (data2.code == 200) {
            for (var j in val2) {
              if (val2[j].exppointid == val[i].exppointid) {
                soilLayers.push(val2[j])
              }
            }
            var val1 = decr(val[i].geom)
            var wkt = this.$wkt.parse(val1)
            var coord = wkt.coordinates
            std.push({
              bh: val[i].exppointid,
              X: coord[0],
              Y: coord[1],
              Z: val[i].elev,
              soilLayers: data2.result
              soilLayers: soilLayers
            })
          }
          this.setLayerByZFBH(std);
        }
        this.setLayerByZFBH(std);
      } else {
        return this.$message('未查询到转孔点数据,无法生成地质体');
      }
@@ -984,7 +1049,7 @@
    },
    CreateLayerByZFBH(zfbh, jsonObj, materialColor) {
      debugger
      var featurePoints = [];
      var featurePoints1 = [];
      let points = turf.featureCollection([]);