管道基础大数据平台系统开发-【前端】-新系統界面
wulitaotao
2023-02-09 5ca6c8792edf5f2cfe5a59ff61139a9dc20aace2
src/views/Synthesis/LeftMenu.vue
@@ -1,5 +1,5 @@
<template>
  <div class="menu_Box">
  <div class="menu_Box box_div">
    <div
      class="leftMen_div"
      @click="setChangeTwoMenu(item)"
@@ -36,7 +36,7 @@
      showTwoMenuFlag: false,
      setListTwoMenu: [],
      setListTwoMenuAll: [
        [
        [
          {
            id: 'a1',
            label: 'synthesis.layer',
@@ -195,6 +195,26 @@
            name: '地形开挖',
            css: 'twoMenu_imge411',
          },
           {
            id: "d12",
            label: "synthesis.visibilityAnalysis",
            name: "通视分析",
            css: "twoMenu_imge412",
          },
          {
            id: "d13",
            label: "synthesis.viewAnalysis",
            name: "视域分析",
            css: "twoMenu_imge413",
          },
          {
            id: "d14",
            label: "synthesis.circularViewAnalysis",
            name: "圆形视域分析",
            css: "twoMenu_imge414",
          },
        ],
        [
          {
@@ -261,6 +281,12 @@
            name: '空间距离',
            css: 'twoMenu_imge76',
          },
          {
            id: "j7",
            label: "synthesis.synthobj.m9",
            name: "高程量测",
            css: "twoMenu_imge77",
          },
        ],
        [
          {
@@ -299,6 +325,12 @@
            name: '导出',
            css: 'twoMenu_imge86',
          },
        {
          id: 'h8',
          label: 'synthesis.addlabel',
          name: '文字',
          css: 'twoMenu_imge88',
        },
          {
            id: 'h7',
            label: 'synthesis.removepaint',
@@ -336,6 +368,20 @@
  methods: {
    //二級菜单点击切换
    setChangeTwoMenu(res) {
      //清除绘制图形对象
      sgworld.Creator.SimpleGraphic.clear();
      if (window.Viewer.scene.primitives.length != null) {
        window.Viewer.scene.primitives.removeAll();
      }
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
      //关闭打开的信息窗体
      this.showTwoMenuFlag = res.id;
      this.$store.state.mapMenuBoolean = false;
      this.$store.state.mapMenuBoxFlag = null;
@@ -346,6 +392,10 @@
        window.model.deleteObject();
        window.model = null;
      }
      switch (val) {
        case 'a': //图层管理
          this.setCoverage(res.id);
@@ -413,8 +463,12 @@
          break;
        case 'h7':
          sgworld.Creator.SimpleGraphic.clear();
          break;
      case 'h8':
         sgworld.Creator.createSimpleGraphic('label', {}, function (entity) {
          });
        break;
      }
    },
    handleSaveClick() {
@@ -455,6 +509,7 @@
        alert('当前场景没有entities实体');
      }
    },
    handleOpenClick() {
      sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
      let fileInput = document.querySelector('.file');
@@ -544,26 +599,17 @@
            }
          );
          break;
        case 'j3':
          // var measure = window.sgworld.Command.execute(
          //   1,
          //   11,
          //   this.colorAll,
          //   (data) => {
          //     data.id = window.sgworld.Core.getuid();
          //     this.measureData.set(data.id, measure);
          //     this.openMeasureResultInfo('海拔高度', data);
          //   }
          // );
            var measure = window.sgworld.Command.execute(0, 3, this.colorAll, (data) => {
        data.id = window.sgworld.Core.getuid();
       this.measureData.set(data.id, measure);
        this.openMeasureResultInfo('平面面积', data);
        // case 'j3':
      });
          break;
        //   var measure = window.sgworld.Command.execute(0, 3, this.colorAll, (data) => {
        //     data.id = window.sgworld.Core.getuid();
        //     this.measureData.set(data.id, measure);
        //     this.openMeasureResultInfo('平面面积', data);
        //   });
        //   break;
        case 'j2':
          var measure = window.sgworld.Command.execute(
            0,
@@ -635,6 +681,18 @@
            }
          );
          break;
          case "j7":
          var measure = window.sgworld.Command.execute(
            1,
            11,
            this.colorAll,
            data => {
              data.id = window.sgworld.Core.getuid()
              this.measureData.set(data.id, measure)
              this.openMeasureResultInfo("海拔高度", data)
            }
          )
          break
      }
    },
    openMeasureResultInfo(name, data) {
@@ -704,6 +762,7 @@
      }
    },
    setAnalsy(res) {
     //this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo");
      var that = this;
      switch (res) {
        case 'd1':
@@ -777,7 +836,9 @@
          );
          break;
        case 'd9':
       this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo");
          this.$store.state.mapPopBoxFlag = '3';
          this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("管道空间分析", null, {
            close: () => {
              if (this.$store.state.pipelineEntity.length != 0) {
@@ -835,6 +896,48 @@
            );
          }
          break;
          case "d12":
          if (window.Excavation) {
            window.Excavation.deleteObject()
            window.Excavation = null
          } else {
            window.Excavation = sgworld.Analysis.createSightLine({
              type: "default",
            })
          }
          break
        case "d13":
          if (window.Excavation) {
            window.Excavation.destroy()
            window.Excavation = null
          } else {
            window.Excavation = sgworld.Analysis.create3DViewshedPoss({
              height: 1.8,
            })
          }
          break
        case "d14":
          if (window.Excavation) {
            window.Excavation.close()
            window.Excavation = null
          } else {
            var SYFX_visible_color = { r: 0.0, g: 1.0, b: 0.0 },
              SYFX_notVisible_color = { r: 1.0, g: 0.0, b: 0.0 }
            window.Excavation = sgworld.Analysis.create3DViewshed({
              name: "Viewshed On Frederick",
              height: 1.8,
              color: {
                Back: SYFX_notVisible_color,
                Fore: SYFX_visible_color,
              },
              isSpherical: "spherical",
            })
          }
          break
      }
    },
    setclippingModel() {
@@ -1021,10 +1124,11 @@
      switch (res) {
        case 'a1':
          if (this.$store.state.layerMnage == false) {
            this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll();
            this.$refs && this.$refs.maplayer && this.$refs.maplayer.open();
            this.$store.state.layerMnage = true;
          } else if (this.$store.state.layerMnage == true) {
            this.$refs && this.$refs.maplayer && this.$refs.maplayer.close();
            this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll();
            this.$store.state.layerMnage = false;
          }
@@ -1049,12 +1153,10 @@
      }
    });
    this.$bus.$on('showLeftMenu', (res) => {
      this.$store.state.showAllLayers = true;
      this.setCoverage('a1');
    });
    this.$store.state.showAllLayers = true;
    this.$store.state.layerMnage = false;
    this.setCoverage('a1');
  },
};
</script>
@@ -1063,7 +1165,8 @@
.menu_Box {
  width: 100%;
  height: 100%;
  background: #303030;
  color: white;
  margin: 0;
  padding: 0;
  overflow-y: auto;
@@ -1075,7 +1178,7 @@
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #ffffff;
    padding: 10px;
    min-width: 100px;
    margin-left: 10px;
@@ -1083,12 +1186,14 @@
    border-radius: 5px;
  }
  .leftMen_div:hover {
    background: linear-gradient(180deg, #002992, #080472);
    border: 1px solid #000000;
    box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.21);
    background: rgba(64, 158, 255, 0.4);
    border: 1px solid #409eff;
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
  }
  .lefMenuDivActive {
    background: linear-gradient(180deg, #002992, #080472);
    background: rgba(64, 158, 255, 0.4);
    border: 1px solid #409eff;
  }
  .menuTwoImage {
    width: 32px;
@@ -1200,6 +1305,23 @@
    background: url("../../assets/img/synthesis/矩形 14 拷贝 7.png") no-repeat
      center;
  }
 // 通视分析、视域分析 预留
 .twoMenu_imge412 {
    background: url("../../assets/img/synthesis/矩形 14 拷贝 7.png") no-repeat
      center;
  }
  .twoMenu_imge413 {
    background: url("../../assets/img/synthesis/矩形 14 拷贝 7.png") no-repeat
      center;
  }
  .twoMenu_imge414 {
    background: url("../../assets/img/synthesis/矩形 14 拷贝 7.png") no-repeat
      center;
  }
  //查询
  .twoMenu_imge51 {
    background: url("../../assets/img/synthesis/图层 23.png") no-repeat center;
@@ -1236,6 +1358,15 @@
  .twoMenu_imge76 {
    background: url("../../assets/img/synthesis/空间测距.png") no-repeat center;
  }
    // 高层量测图标
    .twoMenu_imge77 {
    background: url("../../assets/img/synthesis/图层 31 拷贝.png") no-repeat
      center;
  }
  //标绘
  .twoMenu_imge81 {
    background: url("../../assets/img/synthesis/椭圆 5 拷贝 3.png") no-repeat
@@ -1262,5 +1393,9 @@
  .twoMenu_imge87 {
    background: url("../../assets/img/synthesis/清除.png") no-repeat center;
  }
  .twoMenu_imge88 {
    background: url("../../assets/img/synthesis/图层 32.png") no-repeat center;
  }
}
</style>