管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-12 6e92e7b101c2ea468a4b0d2a19066bc1b4d31764
src/views/Tools/LayerTree.vue
@@ -399,6 +399,9 @@
      } else if (Node.data.children == null && Node.data.serveType != "Tileset") {
        this.showlocal = false;
        this.showopaque = false;
      } else if (Node.data.children == null && Node.data.serveType != "DEM") {
        this.showlocal = false;
        this.showopaque = false;
      }
      this.menuVisible = true;
@@ -936,6 +939,7 @@
        tileset.readyPromise.then((tileset) => {
          tileset.id = res.cnName;
          tileset.layerId = res.id;
          tileset.pubid = res.pubid;
@@ -962,6 +966,9 @@
            window.modelHeight = height;
          } else window.modelHeight = 0;
          this.getTilesetArgs(tileset, res);
        });
        this.$store.state.setAlphaList.push({
          name: res.cnName,
@@ -1013,7 +1020,11 @@
        if (data.code != 200) {
        } else {
          this.reload(tileset, data.result.json)
          if (res.bak != '3dml') {
            this.reload(tileset, data.result.json)
          } else {
            this.tileSet(tileset, parseFloat(res.elev))
          }
        }
      } else {
        this.tileSet(tileset, parseFloat(res.elev))
@@ -1208,7 +1219,7 @@
    },
    getNewTree(obj, result) {
      for (const i in obj) {
        console.log(obj[i].cnName)
        result.push(obj[i])
        if (obj[i].children && obj[i].children.length > 0) {
          this.getNewTree(obj[i].children, result)
@@ -1240,20 +1251,22 @@
          if (rs.enName == st_code[0].code) {
            return rs
          }
          if (rs.enName && rs.enName.indexOf(st_code[0].code) > -1) {
            return rs
          }
        })
        this.removeAllLayer();
        var obj = {
          dirid: res,
          pageIndex: 1,
          pageSize: 10,
        }
        const data = await project_selectByDirid(obj);
        if (data.code != 200) {
          this.$message.error("列表获取失败");
          return;
        }
        if (data.result[0]) {
          var geom = data.result[0].geom
          if (geom) {
@@ -1262,34 +1275,28 @@
              destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0].toFixed(6), wkt.coordinates[1].toFixed(6), 5000),
            });
          }
        }
        this.cannelTerrainLayer();
        this.setTerrainMptLayer();
        //清空图层树选中状态
        this.$refs.tree.setCheckedKeys([]);
        if (val.length > 0) {
          if (val[0].type == 1 && val[0].isProject == 1) {//项目分类
            var std_check = [];
            for (var i in val) {
          var std_check = [];
          for (var i in val) {
            if (val[i].type == 1 && val[i].isProject == 1) {//项目分类
              var std_val = this.getNewTree([this.$refs.tree.getNode(val[i].id).data], [])
              for (var j in std_val) {
                std_check.push(std_val[j])
              }
            }
            var value = this.$store.state.isProjectLayer;
            for (var i in value) {
              std_check.push(value[i])
            }
            this.setProjectLayer(std_check);
          } else {
            this.setChangeProLayer();
          }
          var value = this.$store.state.isProjectLayer;
          for (var i in value) {
            std_check.push(value[i])
          }
          this.setProjectLayer(std_check);
        } else {
          this.setChangeProLayer();
        }