管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-28 fb207b8eec40b5111018db0ae38c3e9fef56f0aa
src/views/Synthesis/LeftMenu.vue
@@ -71,6 +71,18 @@
            name: "图层管理",
            css: "twoMenu_imge11",
          },
          {
            id: "b1",
            label: "synthesis.split",
            name: "分屏",
            css: "twoMenu_imge21",
          },
          {
            id: "b9",
            label: "synthesis.undergroundMode",
            name: "地下模式",
            css: "twoMenu_imge29",
          },
        ],
        [
          {
@@ -1159,6 +1171,12 @@
          break;
        case "d2": //坡度分析
          that.isslopeFlag = !that.isslopeFlag;
          var val = {
            name: "Lengend",
            id: res,
            vshow: that.isslopeFlag
          };
          this.$bus.$emit("mapChangeBox", val);
          window.PDelevationTool = new SmartEarth.ElevationTool(sgworld); //全局变量
          if (that.isslopeFlag == true) {
            PDelevationTool.type = "slope";
@@ -1167,6 +1185,7 @@
            PDelevationTool.type = "none";
          }
          PDelevationTool.render();
          break;
        case "d3": //路径分析
@@ -1242,7 +1261,7 @@
          var that = this;
          window.model = sgworld.Creator.create3DTilesets(
            "",
            modelUrl,
            modelUrl + '/tileset/m/SN/tileset.json',
            {},
            {},
            "0",
@@ -1264,8 +1283,7 @@
                close: () => {
                  if (this.$store.state.pipelineEntity.length != 0) {
                    for (var i in this.$store.state.pipelineEntity) {
                      var item = this.$store.state.pipelineEntity[i];
                      sgworld.Viewer.entities.remove(item);
                      sgworld.Viewer.entities.remove(this.$store.state.pipelineEntity[i]);
                    }
                  }
                },
@@ -1287,34 +1305,39 @@
          }
          break;
        case "d10": //地面整平
          if (this.DXZPState != null) {
            this.DXZPState.drawHandler && this.DXZPState.drawHandler.destroy();
            Viewer._container.style.cursor = "default";
            this.DXZPState.tooltip && this.DXZPState.tooltip.show(false);
            if (window.DXTerrainFlattening != null) {
              DXTerrainFlattening.remove();
            }
            window.DXTerrainFlattening = null;
            this.DXZPState = null;
          } else {
            this.DXZPState = sgworld.Creator.createSimpleGraphic(
              "polygon",
              {
                clampToGround: true,
              },
              function (entity) {
                let positions = entity.polygon.hierarchy.getValue().positions;
                sgworld.Creator.SimpleGraphic.remove(entity.id);
                window.DXTerrainFlattening =
                  sgworld.Creator.createTerrainModifier(
                    "地形压平",
                    positions,
                    10,
                    {}
                  );
              }
            );
          }
          var val = {
            name: "Trrain",
            id: res,
          };
          this.$bus.$emit("mapChangeBox", val);
          // if (this.DXZPState != null) {
          //   this.DXZPState.drawHandler && this.DXZPState.drawHandler.destroy();
          //   Viewer._container.style.cursor = "default";
          //   this.DXZPState.tooltip && this.DXZPState.tooltip.show(false);
          //   if (window.DXTerrainFlattening != null) {
          //     DXTerrainFlattening.remove();
          //   }
          //   window.DXTerrainFlattening = null;
          //   this.DXZPState = null;
          // } else {
          //   this.DXZPState = sgworld.Creator.createSimpleGraphic(
          //     "polygon",
          //     {
          //       clampToGround: true,
          //     },
          //     function (entity) {
          //       let positions = entity.polygon.hierarchy.getValue().positions;
          //       sgworld.Creator.SimpleGraphic.remove(entity.id);
          //       window.DXTerrainFlattening =
          //         sgworld.Creator.createTerrainModifier(
          //           "地形压平",
          //           positions,
          //           10,
          //           {}
          //         );
          //     }
          //   );
          // }
          break;
@@ -1427,7 +1450,7 @@
        pointSelect: true,
        spood: 20,
        GroupID: 0,
        url: "/SmartEarthSDK/Workers/image/waterNormals.jpg",
        url: "/SmartEarthSDK/Workers/image/33.gif",
      };
      window.AnalysisFlood = sgworld.Command.execute(
        2,
@@ -1470,7 +1493,7 @@
      );
    },
    setWander(res) {
      debugger;
      ;
      switch (res) {
        case "c1":
@@ -1644,6 +1667,17 @@
      // this.$refs.tree.setCheckedKeys(checkKey);
      this.$store.state.checkedKeys = checkKey
    },
    setTreeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2;
        // 由此循环多次后,就能形成相应的树形数据结构
        return father.pid == 0; // 返回一级菜单
      });
    },
    setAddLayers(res) {
      if (res.serveType == "WMS") {
        var resource = geoServerURl;
@@ -1722,7 +1756,7 @@
        });
        window.map.addLayer(vectorLayer);
      } else if (res.serveType == "Tileset") {
        debugger
        var tileset = Viewer.scene.primitives.add(
          new Cesium.Cesium3DTileset({
            name: res.cnName,
@@ -1772,6 +1806,7 @@
.menu_Box {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;