管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-03 c609695d14564f0bf4a2b119718400b2a2be037e
src/components/MapView/mapSpacePop.vue
@@ -60,7 +60,8 @@
      <div class="centTable">
        <el-table
          :data="tableData"
          height="260px"
          border
          height="100%"
          ref="filterTable"
          style="width: 100%"
        >
@@ -90,6 +91,7 @@
            :prop="item.field"
            show-overflow-tooltip
            align="center"
            :fit="true"
          ></el-table-column>
        </el-table>
      </div>
@@ -143,9 +145,9 @@
      optionx: [],
      options: [],
      conditions: [
        ['<>', 'like'],
        ['=', '<>', 'like'],
        ['>=', '>', ' =', '<=', '<', '<>'],
        ['>=', '<='],
        ['>=', '>', ' =', '<=', '<', '<>'],
      ],
      options1: [
        {
@@ -192,6 +194,7 @@
      spaceLayer: '',
      imagePoint: null,
      domainsLayer: null,
      querytype: null,
    };
  },
  watch: {
@@ -232,7 +235,7 @@
      obj = this.optionx.find(function (item) {
        return item.field === value;
      });
      // if (obj.type == 'serial' || obj.type == 'int') {
      //   this.options = this.options2;
      // } else {
@@ -241,7 +244,7 @@
      this.options = [];
      var std = [];
      this.querytype = obj.type
      if (obj.type == "text" || obj.type == "blob") {
        std = this.conditions[0];
      } else if (obj.type == "date" || obj.type == "datetime") {
@@ -269,6 +272,7 @@
      this.formInline.name = val_date.field;
      this.options = [];
      var std = [];
      this.querytype = val_date.type
      if (val_date.type == "text" || val_date.type == "blob") {
        std = this.conditions[0];
      } else if (val_date.type == "date" || val_date.type == "datetime") {
@@ -292,6 +296,7 @@
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
      this.optionx = [];
      var valadata = data.result;
      for (var i in valadata) {
@@ -320,10 +325,11 @@
    //初始化查询阈值表
    async getDomainsLayer() {
      const data = await inquiry_selectDomains({ name: this.spaceLayer });
        if (data.code != 200) {
          this.$message.error('列表调用失败');
        }
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
      this.domainsLayer = data.result;
      this.setListDataStart();
      this.getTableselectFields();
    },
@@ -333,13 +339,41 @@
      if (this.formInline.input == undefined || this.formInline.input == null) {
        this.listdata.filter = null;
      } else {
        var val;
        var value = this.formInline.input
        if (this.querytype == "long" || this.querytype == "integer") {
          val = parseInt(value);
        } else if (this.querytype == 'double') {
          if (this.formSql.value.indexOf(".") != -1) {
            val = value;
          } else {
            val = parseFloat(value).toFixed(1)
          }
        } else if (querytype == "date" || querytype == "datetime") {
          var time = new Date(value);
          var m = time.getMonth() + 1;
          var d = time.getDate();
          var y = time.getFullYear();
          val = "'" + y +
            '-' +
            this.add0(m) +
            '-' +
            this.add0(d) + "'";
        } else {
          val = "'" + value + "'";
        }
        this.listdata.filter =
          this.formInline.name +
          ' ' +
          this.formInline.region +
          ' ' +
          this.formInline.input;
          this.formInline.name + " " + this.formInline.region + " " + val
      }
      debugger
      const data = await dataQuerySelectByPage(this.listdata);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
@@ -379,7 +413,8 @@
          this.$store.state.primitLayer = null;
        }
        var wkt = this.$wkt.parse(val1);
        this.setMapLoaction(wkt);
        this.setMapLoaction(wkt, row);
      }
    },
    handleSizeChange(val) {
@@ -390,7 +425,7 @@
      this.listdata.pageIndex = val;
      this.getSpaceTableLayer();
    },
    setMapLoaction(res) {
    setMapLoaction(res, properties) {
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        // this.$store.state.primitLayer = null;
@@ -398,6 +433,7 @@
        this.$store.state.primitLayer = null;
      }
      var coord = res.coordinates;
      debugger
      if (res.type == 'Point') {
        var val = Cesium.Cartesian3.fromDegrees(
          res.coordinates[0],
@@ -405,6 +441,8 @@
        );
        this.$store.state.primitLayer = Viewer.entities.add({
          properties: properties,
          tag: "properties_point",
          position: val,
          billboard: {
            // 图像地址,URI或Canvas的属性
@@ -426,13 +464,41 @@
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer)
        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;
            // debugger
            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);
      } else if (res.type == 'MultiPolygon' || res.type == 'LineString') {
        var val = res.coordinates[0][0];
        var std = [];
        for (var i in val) {
          std.push({ x: val[i][0], y: val[i][1] })
          std.push(val[i][0])
          std.push(val[i][1])
        }
        this.$store.state.primitLayer = Viewer.entities.add({
          polyline: {
            positions: Cesium.Cartesian3.fromDegreesArray(std),
@@ -460,6 +526,9 @@
      }
    },
  },
  destroyed() {
    this.$store.state.propertiesFlag = null;
  }
};
</script>
@@ -473,7 +542,9 @@
  border: 1px solid gray;
  float: left;
  .centTable {
    height: 230px;
    position: absolute;
    height: 66%;
    width: 98%;
  }
  .rightTitle {
    padding: 5px;
@@ -486,7 +557,10 @@
  }
  .bottomPage {
    position: absolute;
    bottom: 1%;
    bottom: 3%;
  }
  /dep/.el-form-item {
    margin-bottom: 0px;
  }
}
</style>