管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-08 e4c5bd13edea4cf6a1b0f4e825902344b5cb599e
src/views/Synthesis/LeftMenu.vue
@@ -7,13 +7,21 @@
      :class="{ lefMenuDivActive: showTwoMenuFlag == item.id }"
      :key="index"
    >
      <div class="menuTwoImage" :class="item.css"></div>
      <div
        class="menuTwoImage"
        :class="item.css"
      ></div>
      <div>{{ $t(item.label) }}</div>
    </div>
    <mapinfo ref="mapinfo" />
    <maplayer ref="maplayer" />
    <queryinfo ref="queryinfo" />
    <input type="file" accept=".kml" class="file" style="display: none" />
    <input
      type="file"
      accept=".kml"
      class="file"
      style="display: none"
    />
  </div>
</template>
@@ -186,6 +194,24 @@
            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",
          },
        ],
        [
          {
@@ -264,6 +290,12 @@
            id: "h1",
            label: "synthesis.point",
            name: "点",
            css: "twoMenu_imge81",
          },
          {
            id: "h8",
            label: "synthesis.textLabel",
            name: "文本点",
            css: "twoMenu_imge81",
          },
          {
@@ -376,27 +408,27 @@
    setPlot(res) {
      switch (res) {
        case "h1":
          sgworld.Creator.createSimpleGraphic("point", {}, function (entity) {})
          sgworld.Creator.createSimpleGraphic("point", {}, function (entity) { })
          break
        case "h2":
          sgworld.Creator.createSimpleGraphic(
            "polyline",
            {},
            function (entity) {}
            function (entity) { }
          )
          break
        case "h3":
          sgworld.Creator.createSimpleGraphic(
            "rectangle",
            {},
            function (entity) {}
            function (entity) { }
          )
          break
        case "h4":
          sgworld.Creator.createSimpleGraphic(
            "polygon",
            {},
            function (entity) {}
            function (entity) { }
          )
          break
        case "h5":
@@ -408,6 +440,9 @@
        case "h7":
          sgworld.Creator.SimpleGraphic.clear()
          break
        case "h8":
          sgworld.Creator.createSimpleGraphic("label", {}, function (entity) { })
          break
      }
    },
@@ -456,6 +491,7 @@
        let files = evt.target.files
        if (files.length > 0) {
          let file = evt.target.files[0]
          // sgworld.Creator.addKmlLayer('kml数据', file, true);
          let fileReader = new FileReader()
          fileReader.readAsDataURL(file)
          fileReader.onload = () => {
@@ -464,6 +500,7 @@
              canvas: sgworld.Viewer.scene.canvas,
              clampToGround: true,
            }
            files
            var geocachePromise = Cesium.KmlDataSource.load(
              fileReader.result,
              kmlOptions
@@ -473,8 +510,8 @@
              for (var i = 0; i < geocacheEntities.length; i++) {
                var entity = geocacheEntities[i]
                sgworld.Viewer.entities.add(entity)
                console.log("entity", entity)
              }
            })
            // sgworld.Viewer.dataSources
@@ -510,18 +547,18 @@
        url,
        name,
        "height=" +
          iHeight +
          ",,innerHeight=" +
          iHeight +
          ",width=" +
          iWidth +
          ",innerWidth=" +
          iWidth +
          ",top=" +
          iTop +
          ",left=" +
          iLeft +
          ",toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no"
        iHeight +
        ",,innerHeight=" +
        iHeight +
        ",width=" +
        iWidth +
        ",innerWidth=" +
        iWidth +
        ",top=" +
        iTop +
        ",left=" +
        iLeft +
        ",toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no"
      )
    },
@@ -550,29 +587,6 @@
              this.openMeasureResultInfo("空间距离", data)
            }
          )
          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)
            }
          )
          break
        case "j2":
          var measure = window.sgworld.Command.execute(
@@ -613,6 +627,7 @@
              this.openMeasureResultInfo("平面面积", data)
            }
          )
          // sgworld.Analysis.planeArea(this.colorAll, () => {})
          break
        case "j4":
          var volumetricMeasurementTool =
@@ -622,9 +637,8 @@
            "auto",
            data => {
              if (volumetricMeasurementTool.popupData) {
                volumetricMeasurementTool.popupData.value = `填方:${
                  data.volume.fill.toFixed(4) + data.unit.fill
                }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
                volumetricMeasurementTool.popupData.value = `填方:${data.volume.fill.toFixed(4) + data.unit.fill
                  }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
              } else {
                data.id = window.sgworld.Core.getuid()
                this.measureData.set(data.id, volumetricMeasurementTool)
@@ -688,9 +702,8 @@
          })
          break
        case "体积方量":
          info = `填方:${
            data.volume.fill.toFixed(4) + data.unit.fill
          }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
          info = `填方:${data.volume.fill.toFixed(4) + data.unit.fill
            }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
          break
      }
      return (
@@ -779,9 +792,8 @@
            "auto",
            data => {
              if (volumetricMeasurementTool.popupData) {
                volumetricMeasurementTool.popupData.value = `填方:${
                  data.volume.fill.toFixed(4) + data.unit.fill
                }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
                volumetricMeasurementTool.popupData.value = `填方:${data.volume.fill.toFixed(4) + data.unit.fill
                  }<br>挖方:${data.volume.dig.toFixed(4) + data.unit.dig}`
              } else {
                data.id = sgworld.Core.getuid()
                this.measureData.set(data.id, volumetricMeasurementTool)
@@ -863,9 +875,48 @@
            window.Excavation = sgworld.Analysis.TerrainExcavation(
              10,
              {},
              function () {}
              function () { }
            )
          }
          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
      }
    },
@@ -906,7 +957,7 @@
        GroupID: 0,
        url: "/SmartEarthSDK/Workers/image/waterNormals.jpg",
      }
      window.AnalysisFlood = sgworld.Command.execute(2, 2, method, value => {})
      window.AnalysisFlood = sgworld.Command.execute(2, 2, method, value => { })
    },
    addterrainSectionAnalysis() {
      window.AnalysisDXPM = sgworld.Command.execute(
@@ -1034,10 +1085,32 @@
        case "b7": //比例尺
          this.isRuler = !this.isRuler
          window.sgworld.navControl("scale", this.isRuler)
          let scale = document.querySelector(".ol-scale-line")
          let zoomCtrl = document.querySelector(".ol-zoom")
          if (!this.isRuler) {
            scale.style.display = "none"
            zoomCtrl.style.display = "none"
          } else {
            scale.style.display = "block"
            zoomCtrl.style.display = "block"
          }
          break
        case "b8": //指北针
          this.isNaviget = !this.isNaviget
          window.sgworld.navControl("nav", this.isNaviget)
          let rotate = document.querySelector(".ol-rotate")
          let fullscreen = document.querySelector(".ol-full-screen")
          if (!this.isNaviget) {
            rotate.style.display = "none"
            fullscreen.style.display = "none"
          } else {
            rotate.style.display = "block"
            fullscreen.style.display = "block"
          }
          break
        case "b9": //地下模式
          this.UndergroundMode = !this.UndergroundMode
@@ -1090,7 +1163,8 @@
.menu_Box {
  width: 100%;
  height: 100%;
  background: #303030;
  color: white;
  margin: 0;
  padding: 0;
  overflow-y: auto;
@@ -1229,6 +1303,19 @@
    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;