管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2023-02-16 a92fa5ec4d415ccc42f8c3b7eae7d07cc8418889
src/components/MapView/mapMenuTop.vue
@@ -172,48 +172,19 @@
  },
  mounted() {
    // sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
    this.menuTopFrom.queryType = 'rectangle';
    this.getAllTable();
  },
  methods: {
    flyRemove() {
    },
    flyQuery() {
    // Viewer.flyTo( sgworld.Creator.SimpleGraphic._viewer.entities._entities._array[0])
      // switch (this.menuTopFrom.queryType) {
      //   case 'point': //点
      //     Viewer.camera.flyTo({
      //       destination: Cesium.Cartesian3.fromDegrees(this.flyEntity.lng, this.flyEntity.lat, 3000),
      //     });
      //     break;
      //   case 'polyline': //线
      //     debugger
      //     break;
      //   case 'rectangle': //矩形
      //     debugger
      //     break;
      //   case 'circle': //圆
      //     debugger
      //     break;
      //   case 'polygon': //多边形
      //     debugger
      //     break;
      // }
    },
    changeValue(value) {
      // var obj = {};
      // obj = this.queryOption.find(function (item) {
      //   return item.value === value;
      // });
      // if (obj.value == 'inputFile') {
      //   this.getMenuTopFile();
      // }
      var obj = {};
      obj = this.queryOption.find(function (item) {
        return item.value === value;
      });
      if (obj.value == 'inputFile') {
        this.getMenuTopFile();
      }
    },
    async getAllTable() {
      const data = await inquiry_SelectTabs();
@@ -300,7 +271,16 @@
      //清空标绘
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      sgworld.Creator.SimpleGraphic.clear();
      if (this.$store.state.queryInfo.length != 0) {
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
      }
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
      if (this.treeChange.length == 0) {
        this.$message.error('请选择要查询的数据');
        return;
@@ -368,7 +348,7 @@
        properties: { foo: 'bar' },
      };
      var circle = turf.circle(position, radius, options);
      debugger
      this.setJonToWKT(circle);
    },
    setTurfPolyOrLine(res, type) {
@@ -403,22 +383,22 @@
    showMapMenuPop() {
      this.$store.state.mapSpaceQueryLayer = this.treeChange;
      this.$store.state.mapPopBoxFlag = '1';
      // this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("空间查询", null, {
        close: () => {
          if (this.$store.state.primitLayer != null) {
            // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
            this.$store.state.primitLayer = null;
          }
          // if (this.$store.state.primitLayer != null) {
          //   // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
          //   this.$store.state.primitLayer = null;
          // }
          if (window.Viewer.scene.primitives.length != 0) {
            window.Viewer.scene.primitives.removeAll()
          }
          // if (window.Viewer.scene.primitives.length != 0) {
          //   window.Viewer.scene.primitives.removeAll()
          // }
        }
      });
      this.$bus.$emit('changeMapMenuTop', 'true');
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      // this.$bus.$emit('changeMapMenuTop', 'true');
      // sgworld.Creator.SimpleGraphic.clear();
      //清空inputFile
      // var file = document.getElementById('getMenuTopFile');
@@ -431,24 +411,21 @@
      this.menuTopFrom.queryLayer = null;
      this.menuTopFrom.queryType = 'rectangle';
      this.$refs.tree.setCheckedKeys([]);
 //清空标绘
      //清空标绘
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      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;
      // }
      if (this.$store.state.queryInfo.length != 0) {
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
      }
      //关闭窗口
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo");
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
    },
    setCartesianToEightFour(res) {
      var std = {};