管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-22 3f3adb45c6c8c37567122dd9e361f14d88516b3b
src/views/Synthesis/LeftMenu.vue
@@ -680,7 +680,7 @@
        }
      }
      this.showTwoMenuFlag = res.id;
      if (val != 'h') {
      if (val != 'h' && res.id != "b9") {
        sgworld.Creator.SimpleGraphic.clear();
        Viewer.entities.removeAll();
      }
@@ -2166,9 +2166,16 @@
        case "b9": //地下模式
          // this.UndergroundMode = !this.UndergroundMode;
          // window.sgworld.Analysis.UndergroundMode(this.UndergroundMode, 0.3);
          this.$refs &&
            this.$refs.undergroundModel &&
            this.$refs.undergroundModel.open("地下模式", null,);
          if (window.UndergroundMode) {
            this.$refs &&
              this.$refs.undergroundModel &&
              this.$refs.undergroundModel.close();
          } else {
            this.$refs &&
              this.$refs.undergroundModel &&
              this.$refs.undergroundModel.open("地下模式", null,);
          }
          break;
      }
    },
@@ -2214,23 +2221,24 @@
      });
      var value = std.filter((str) => {
        if (str.url != null && str.type == 2 && str.isShow == 1) {
          return str;
        }
      })
      this.setAddLayers(value);
      var res = this.setTreeData(val);
      //存储选中图层
      // sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers));
      for (var i in res) {
        res[i].children = res[i].children.filter((val) => {
          if (val.children != null) {
            return val;
          }
        });
      }
      // for (var i in res) {
      //   res[i].children = res[i].children.filter((val) => {
      //     if (val.children != null) {
      //       return val;
      //     }
      //   });
      // }
      this.$store.state.treeData = res;
@@ -2248,6 +2256,7 @@
      });
    },
    setAddLayers(res) {
      this.setClearWmsLayer()
      var std = [[]];
      for (var i in res) {
        switch (res[i].serveType) {
@@ -2260,8 +2269,7 @@
        this.setAddWmsLayer(std[0])
      }
    },
    setAddWmsLayer(res) {
    setClearWmsLayer() {
      for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) {
        var val_id = window.Viewer.imageryLayers._layers[i].imageryProvider.name;
        if (val_id == "Wms_Layer") {
@@ -2277,10 +2285,15 @@
          window.map.removeLayer(layers_ol[i]); //显示图层
        }
      }
    },
    setAddWmsLayer(res) {
      var url = [];
      for (var i in res) {
        url.push(res[i].url)
        if (res[i].url) {
          url.push(res[i].url)
        }
      }
      url = url.reverse();
      var that = this;
      var getFeatureInfoFormat = new Cesium.GetFeatureInfoFormat("html", null, function (html) {
@@ -2336,6 +2349,7 @@
        const res = await dataQuery_selectTabByEntity({
          name: this.$store.state.pickoption.name
        })
        if (res.code != 200) {
          return;
        }
@@ -2384,6 +2398,7 @@
      if (data.code != 200) {
        return
      }
      var valste = data.result
@@ -2697,6 +2712,7 @@
      }
    });
    this.$bus.$on("showMenuLayer", ((res) => {
      this.setAddLayers(res);
    }));
    this.$store.state.showAllLayers = true;