管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-03-03 b6c8e7c61f0270598ba7fdbc44f79512e010d0fe
src/components/MapView/mapMenuPop.vue
@@ -546,7 +546,7 @@
          this.imagePoint = null;
        }
        var wkt = this.$wkt.parse(val1);
        this.setMapLoaction(wkt);
        this.setMapLoaction(wkt, row);
      }
    },
    setMapLoaction(res) {
@@ -604,6 +604,7 @@
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      this.listdata.name = res.entity;
      this.$store.state.propertiesName = res;
      this.getTableDateHidder();
    },
    handleSizeChange(val) {
@@ -642,6 +643,7 @@
    },
    async showAllImage(res) {
      for (var i in res) {
        let properties = res[i];
        var param = {
          gid: res[i].gid,
          name: this.listdata.name,
@@ -654,7 +656,7 @@
        if (val1) {
          var wkt = this.$wkt.parse(val1);
          // this.getprimitiLayer(wkt);
          this.primitivesAddLayer(wkt);
          this.primitivesAddLayer(wkt, properties);
        }
      }
    },
@@ -667,7 +669,7 @@
          break;
      }
    },
    primitivesAddLayer(res) {
    primitivesAddLayer(res, properties) {
      switch (res.type) {
        case "Point":
          var val = Cesium.Cartesian3.fromDegrees(
@@ -676,6 +678,8 @@
          );
          var point = Viewer.entities.add({
            position: val,
            properties: properties,
            tag: "properties_point",
            billboard: {
              // 图像地址,URI或Canvas的属性
              image: SmartEarthRootUrl + "Workers/image/mark.png",
@@ -694,6 +698,29 @@
          });
          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY;
          this.$store.state.queryInfo.push(point);
          //点击事件
          window.propertieshandler = new Cesium.ScreenSpaceEventHandler(
            sgworld.Viewer.scene.canvas
          );
          window.propertieshandler.setInputAction(event => {
            let pick = sgworld.Viewer.scene.pick(event.position);
            // ;
            if (pick && pick.id && pick.id.tag == "properties_point") {
              this.$store.state.propertiesFlag = '1';
              let properties = pick.id.properties;
              let propertyNames = pick.id.properties.propertyNames;
              let obj = {};
              obj["eventid"] = properties['_eventid']._value;
              this.attributeData.forEach(item => {
                propertyNames.forEach(itemElement => {
                  if (itemElement == item.field) {
                    obj[item.alias] = properties[itemElement]._value
                  }
                })
              })
              this.$store.state.propertiesInfo = obj;
            }
          }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
          break;
        case "LineString":
        case "MultiLineString":
@@ -752,6 +779,9 @@
      }
    });
  },
  destroyed() {
    this.$store.state.propertiesFlag = null;
  }
};
</script>