管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-03-06 4aa41941b8f3ebb2c5524035ff6d2d8207c62ab6
空间查询线面附件
已修改2个文件
770 ■■■■ 文件已修改
src/components/MapView/mapMenuPop.vue 596 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapSpacePop.vue 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuPop.vue
@@ -1,10 +1,7 @@
<template>
  <div class="menuPop">
    <div class="leftBox">
      <div
        class="leftDown"
        v-if="$store.state.download"
      >
      <div class="leftDown" v-if="$store.state.download">
        <div @click="getDownloadDep">
          <el-link icon="el-icon-download"> </el-link>
        </div>
@@ -34,11 +31,7 @@
            label="序号"
            width="50"
          />
          <el-table-column
            label="定位"
            width="100"
            align="center"
          >
          <el-table-column label="定位" width="100" align="center">
            <template slot-scope="scope">
              <el-button
                icon="el-icon-map-location"
@@ -57,10 +50,7 @@
          ></el-table-column>
        </el-table>
      </div>
      <div
        class="pagination_box"
        style="margin-top:10px"
      >
      <div class="pagination_box" style="margin-top: 10px">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
@@ -88,20 +78,14 @@
        label-width="100px"
        class="codeForm"
      >
        <el-form-item
          :label="$t('common.passworld')"
          prop="password"
        >
        <el-form-item :label="$t('common.passworld')" prop="password">
          <el-input
            type="password"
            v-model="codeForm.password"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('common.SPassword')"
          prop="repassword"
        >
        <el-form-item :label="$t('common.SPassword')" prop="repassword">
          <el-input
            type="password"
            v-model="codeForm.repassword"
@@ -113,12 +97,9 @@
            class="primary"
            size="small"
            @click="download('codeForm')"
          >{{ $t("common.confirm") }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="closeDown('codeForm')"
          >{{
            >{{ $t("common.confirm") }}</el-button
          >
          <el-button type="info" size="small" @click="closeDown('codeForm')">{{
            $t("common.cancel")
          }}</el-button>
        </el-form-item>
@@ -133,11 +114,7 @@
      :before-close="handleInsertClose"
    >
      <div style="width: 100%; max-height: 450px; overflow-y: auto">
        <el-form
          ref="form"
          :model="ruleForm"
          label-width="100px"
        >
        <el-form ref="form" :model="ruleForm" label-width="100px">
          <el-form-item label="审核单位">
            <div>
              <ul>
@@ -174,18 +151,10 @@
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-button
              class="primary"
              size="small"
              @click="getInsertDown"
            >{{
            <el-button class="primary" size="small" @click="getInsertDown">{{
              $t("common.confirm")
            }}</el-button>
            <el-button
              type="info"
              size="small"
              @click="closeInsertDown"
            >{{
            <el-button type="info" size="small" @click="closeInsertDown">{{
              $t("common.cancel")
            }}</el-button>
          </el-form-item>
@@ -213,30 +182,30 @@
  decr,
  encr,
  dataLib_selectDepsByIds,
} from "../../api/api.js";
import { getToken } from "@/utils/auth";
import $ from "jquery";
import { View } from "ol";
} from "../../api/api.js"
import { getToken } from "@/utils/auth"
import $ from "jquery"
import { View } from "ol"
export default {
  data() {
    var repasswordValidator = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
        callback(new Error("请再次输入密码"))
      } else if (value !== this.codeForm.password) {
        callback(new Error("两次输入密码不一致!"));
        callback(new Error("两次输入密码不一致!"))
      } else {
        callback();
        callback()
      }
    };
    }
    var passwordValidator = (rule, value, callback) => {
      var passwordreg =
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/
      if (!passwordreg.test(value)) {
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"));
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"))
      } else {
        callback();
        callback()
      }
    };
    }
    return {
      ruleForm: {
        depname: [],
@@ -294,19 +263,19 @@
      optionx: [],
      imagePoint: null,
      Layerprimit: null,
    };
    }
  },
  methods: {
    getInsertDown() {
      this.dialogInsertVisible = false;
      this.dialogVisible = true;
      this.dialogInsertVisible = false
      this.dialogVisible = true
    },
    handleInsertClose() {
      this.$confirm("确认关闭?")
        .then((_) => {
          this.closeInsertDown();
        .then(_ => {
          this.closeInsertDown()
        })
        .catch((_) => { });
        .catch(_ => {})
    },
    closeInsertDown() {
      this.ruleForm = {
@@ -316,72 +285,72 @@
        repwd: null,
        wkt: null,
        descr: null,
      };
      this.dialogInsertVisible = false;
      }
      this.dialogInsertVisible = false
    },
    async getDownloadDep() {
      var std = [];
      var std = []
      for (var i in this.option) {
        std.push(this.option[i].entity);
        std.push(this.option[i].entity)
      }
      var obj = {
        entities: std,
        wkt: this.listdata.wkt,
      };
      const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj));
      }
      const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj))
      if (data.code != 200) {
        this.$message.error("数据请求失败");
        return;
        this.$message.error("数据请求失败")
        return
      }
      if (data.result.length == 0 || data.result == null) {
        this.insertFlag = 1;
        this.dialogVisible = true;
        this.insertFlag = 1
        this.dialogVisible = true
      } else {
        this.insertFlag = 2;
        var std = [];
        this.insertOption.ids = data.result;
        var val = "";
        this.insertFlag = 2
        var std = []
        this.insertOption.ids = data.result
        var val = ""
        for (var i in data.result) {
          if (val == "") {
            val += "codes=" + data.result[i];
            val += "codes=" + data.result[i]
          } else {
            val += "&codes=" + data.result[i];
            val += "&codes=" + data.result[i]
          }
          std.push({
            name: data.result[i],
          });
          })
        }
        const data1 = await dataLib_selectDepsByIds(val);
        const data1 = await dataLib_selectDepsByIds(val)
        this.ruleForm.depid = data1.result;
        this.ruleForm.depname = std;
        this.ruleForm.wkt = decr(this.listdata.wkt);
        this.ruleForm.tabs = this.option;
        this.dialogInsertVisible = true;
        this.ruleForm.depid = data1.result
        this.ruleForm.depname = std
        this.ruleForm.wkt = decr(this.listdata.wkt)
        this.ruleForm.tabs = this.option
        this.dialogInsertVisible = true
      }
    },
    async signGetPublicKey() {
      const res = await sign_getPublicKey();
      const res = await sign_getPublicKey()
      if (res && res.code == 200) {
        window.encrypt = new JSEncrypt();
        encrypt.setPublicKey(res.result);
        window.encrypt = new JSEncrypt()
        encrypt.setPublicKey(res.result)
      }
    },
    async download() {
      if (this.codeForm.password == "") return;
      if (this.codeForm.password == "") return
      if (this.insertFlag == 1) {
        var obj = {
          pwd: encrypt.encrypt(this.codeForm.password),
          entities: [],
          wkt: this.listdata.wkt,
        };
        for (var i in this.option) {
          obj.entities.push(this.option[i].entity);
        }
        var token = getToken();
        var that = this;
        for (var i in this.option) {
          obj.entities.push(this.option[i].entity)
        }
        var token = getToken()
        var that = this
        $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
          type: "post",
          data: JSON.stringify(obj),
@@ -389,19 +358,19 @@
          cache: false,
          processData: false,
          contentType: false,
          success: (res) => {
          success: res => {
            if (res.code != 200) {
              return;
              return
            }
            this.selectDownloadFile(res.result, obj.pwd);
            this.selectDownloadFile(res.result, obj.pwd)
          },
        });
        })
      } else if (this.insertFlag == 2) {
        var std = [];
        var std1 = [];
        var std = []
        var std1 = []
        for (var i in this.option) {
          std.push(this.option[i].tabDesc);
          std1.push(this.option[i].entity);
          std.push(this.option[i].tabDesc)
          std1.push(this.option[i].entity)
        }
        var obj = {
          depcodes: this.insertOption.ids,
@@ -410,32 +379,32 @@
          entities: std1,
          wkt: this.listdata.wkt,
          descr: this.ruleForm.descr,
        };
        const data1 = await apply_insertApply(JSON.stringify(obj));
        }
        const data1 = await apply_insertApply(JSON.stringify(obj))
        if (data1.code != 200) {
          this.$message.error("数据申请失败");
          return;
          this.$message.error("数据申请失败")
          return
        }
        this.$message({
          message: "数据申请成功",
          type: "success",
        });
        })
        this.closeDown();
        this.closeDown()
      }
    },
    async selectDownloadFile(rsid, rspwd) {
      var downObj = {
        guid: rsid,
        pwd: encodeURIComponent(rspwd),
      };
      const data = await dataLib_selectDownloadFile(downObj);
      if (data.code != 200) {
        this.$message.error("下载请求失败");
        return;
      }
      this.closeDown();
      var token = getToken();
      const data = await dataLib_selectDownloadFile(downObj)
      if (data.code != 200) {
        this.$message.error("下载请求失败")
        return
      }
      this.closeDown()
      var token = getToken()
      var url =
        BASE_URL +
        "/dataLib/downloadFile?token=" +
@@ -443,73 +412,73 @@
        "&guid=" +
        rsid +
        "&pwd=" +
        encodeURIComponent(rspwd);
      $("#Iframe1").attr("src", url).click();
        encodeURIComponent(rspwd)
      $("#Iframe1").attr("src", url).click()
    },
    handleCloseDown() {
      this.$confirm("确认关闭?")
        .then((_) => {
          this.closeDown();
        .then(_ => {
          this.closeDown()
        })
        .catch((_) => { });
        .catch(_ => {})
    },
    closeDown() {
      this.dialogVisible = false;
      this.codeForm.password = "";
      this.codeForm.repassword = "";
      this.closeInsertDown();
      this.dialogVisible = false
      this.codeForm.password = ""
      this.codeForm.repassword = ""
      this.closeInsertDown()
    },
    startTableMssage() {
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      this.listdata.name = null;
      this.option = [];
      this.listdata.pageIndex = 1
      this.listdata.pageSize = 10
      this.listdata.name = null
      this.option = []
    },
    clearQuerInfo() {
      if (this.$store.state.queryInfo.length != 0) {
        sgworld.Creator.SimpleGraphic.clear();
        sgworld.Creator.SimpleGraphic.clear()
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i])
        }
        this.$store.state.queryInfo = [];
        this.$store.state.queryInfo = []
        if (this.$store.state.primitLayer != null) {
          sgworld.Viewer.entities.remove(this.$store.state.primitLayer);
          sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
          this.$store.state.primitLayer = null;
          sgworld.Viewer.entities.remove(this.$store.state.primitLayer)
          sgworld.Creator.DeleteObject(this.$store.state.primitLayer)
          this.$store.state.primitLayer = null
        }
      }
    },
    setTableAll() {
      this.clearQuerInfo();
      this.signGetPublicKey();
      this.startTableMssage();
      this.listdata.wkt = this.$store.state.mapMenuShpFile;
      this.querylayer = this.$store.state.mapSpaceQueryLayer;
      this.clearQuerInfo()
      this.signGetPublicKey()
      this.startTableMssage()
      this.listdata.wkt = this.$store.state.mapMenuShpFile
      this.querylayer = this.$store.state.mapSpaceQueryLayer
      //  = this.$store.state.mapSpaceQueryLayer;
      var arr = this.$store.state.mapSpaceQueryLayer;
      var obj = {};
      var arr = this.$store.state.mapSpaceQueryLayer
      var obj = {}
      arr = arr.reduce(function (item, next) {
        obj[next.label] ? "" : (obj[next.label] = true && item.push(next));
        return item;
      }, []);
      this.option = arr;
      this.listdata.name = this.option[0].entity;
        obj[next.label] ? "" : (obj[next.label] = true && item.push(next))
        return item
      }, [])
      this.option = arr
      this.listdata.name = this.option[0].entity
      this.getTableDateHidder();
      this.getTableDateHidder()
    },
    async getTableDateHidder() {
      const data = await inquiry_selectFields({ name: this.listdata.name });
      const data = await inquiry_selectFields({ name: this.listdata.name })
      if (data.code != 200) {
        this.$message.error("列表调用失败");
        this.$message.error("列表调用失败")
      }
      const data1 = await inquiry_selectDomains({ name: this.listdata.name });
      const data1 = await inquiry_selectDomains({ name: this.listdata.name })
      if (data1.code != 200) {
        this.$message.error("列表调用失败");
        this.$message.error("列表调用失败")
      }
      this.optionx = [];
      this.attributeData = [];
      var valadata = data.result;
      var laydomain = data1.result;
      this.optionx = []
      this.attributeData = []
      var valadata = data.result
      var laydomain = data1.result
      for (var i in valadata) {
        if (valadata[i].showtype == 1) {
@@ -519,144 +488,203 @@
          ) {
            for (var j in laydomain) {
              if (laydomain[j].domName == valadata[i].domainNa) {
                valadata[i].domainNa = laydomain[j].codeDesc;
                valadata[i].domainNa = laydomain[j].codeDesc
              }
            }
          }
          this.optionx.push(valadata[i]);
          this.attributeData.push(valadata[i]);
          this.optionx.push(valadata[i])
          this.attributeData.push(valadata[i])
        }
      }
      this.getTableData();
      this.getTableData()
    },
    async spaceLocation(index, row) {
      var param = {
        gid: row.gid,
        name: this.listdata.name,
      };
      const data = await dataQuerySelectWktById(param);
      }
      const data = await dataQuerySelectWktById(param)
      if (data.code != 200) {
        this.$message.error("列表调用失败");
        this.$message.error("列表调用失败")
      }
      var val1 = decr(data.result);
      var val1 = decr(data.result)
      if (val1) {
        if (this.imagePoint != null) {
          sgworld.Creator.DeleteObject(this.imagePoint);
          this.imagePoint = null;
          sgworld.Creator.DeleteObject(this.imagePoint)
          this.imagePoint = null
        }
        var wkt = this.$wkt.parse(val1);
        this.setMapLoaction(wkt, row);
        var wkt = this.$wkt.parse(val1)
        this.setMapLoaction(wkt, row)
      }
    },
    setMapLoaction(res) {
      var coord = res.coordinates;
      if (this.Layerprimit != null) {
        window.Viewer.scene.primitives.remove(this.Layerprimit);
        this.Layerprimit = null;
    setMapLoaction(res, properties) {
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer)
        // this.$store.state.primitLayer = null;
        sgworld.Viewer.entities.remove(this.$store.state.primitLayer)
        this.$store.state.primitLayer = null
      }
      if (res.type == "Point") {
        Viewer.camera.flyTo({
          destination: Cesium.Cartesian3.fromDegrees(coord[0], coord[1], 2000),
          orientation: {
            heading: Cesium.Math.toRadians(0), // 水平偏角,默认正北 0
            pitch: Cesium.Math.toRadians(-90), // 俯视角,默认-90,垂直向下
            roll: 0, // 旋转角
          },
        });
      } else if (res.type == "MultiPolygon") {
        var val = res.coordinates[0][0];
        var std = [];
      var coord = res.coordinates
        for (var i in val) {
          std.push({ x: val[i][0], y: val[i][1], z: 1000 });
        }
        this.$store.state.primitLayer = sgworld.Creator.createPolygon(
          std,
          {
            fillColor: "#ffff00",
            outlineColor: "#fff",
            outlineWidth: 2,
          },
          1,
          0,
          "面"
        );
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer.item);
      } else if (res.type == "MultiLineString") {
        var line = res.coordinates[0];
        var std = [];
      switch (res.type) {
        case "Point":
          var val = Cesium.Cartesian3.fromDegrees(
            res.coordinates[0],
            res.coordinates[1]
          )
          var point = Viewer.entities.add({
            properties: properties,
            tag: "properties_point",
            position: val,
            billboard: {
              // 图像地址,URI或Canvas的属性
              image: SmartEarthRootUrl + "Workers/image/mark.png",
              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
              // 大小是否以米为单位
              sizeInMeters: false,
              // 相对于坐标的垂直位置
              verticalOrigin: Cesium.VerticalOrigin.CENTER,
              // 相对于坐标的水平位置
              horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
              // 应用于图像的统一比例。比例大于会1.0放大标签,而比例小于会1.0缩小标签。
              scale: 1.0,
              // 是否显示
              show: true,
            },
          })
          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY
          this.$store.state.queryInfo.push(point)
          sgworld.Navigate.flyToObj(point)
          this.$store.state.primitLayer = point
        for (var i in line) {
          std.push({ x: line[i][0], y: line[i][1], z: 1000 });
        }
        this.$store.state.primitLayer = sgworld.Creator.createPolyline(
          std,
          "#ffff00",
          1,
          0,
          "线"
        );
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer.item);
          break
        case "LineString":
        case "MultiLineString":
          var line = res.coordinates[0]
          var std = []
          for (var i in line) {
            std.push(line[i][0], line[i][1])
          }
          var polyline = Viewer.entities.add({
            properties: properties,
            tag: "properties_line",
            polyline: {
              positions: Cesium.Cartesian3.fromDegreesArray(std),
              width: 5,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              clampToGround: true,
            },
          })
          this.$store.state.queryInfo.push(polyline)
          sgworld.Navigate.flyToObj(polyline)
          this.$store.state.primitLayer = polyline
          break
        case "MultiPolygon":
          var val = res.coordinates[0][0]
          var std = []
          for (var i in val) {
            std.push(val[i][0], val[i][1])
          }
          var entity = Viewer.entities.add({
            properties: properties,
            tag: "properties_polygon",
            polygon: {
              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
              //height : 100000,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              outline: true,
              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
            },
          })
          this.$store.state.queryInfo.push(entity)
          sgworld.Navigate.flyToObj(entity)
          this.$store.state.primitLayer = entity
          break
      }
      this.setMapHandler()
    },
    setMapHandler() {
      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 && pick.id.tag.includes('properties_')) {
          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)
    },
    setTableChange(res) {
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      this.listdata.name = res.entity;
      this.$store.state.propertiesName = res;
      this.getTableDateHidder();
      this.listdata.pageIndex = 1
      this.listdata.pageSize = 10
      this.listdata.name = res.entity
      this.$store.state.propertiesName = res
      this.getTableDateHidder()
    },
    handleSizeChange(val) {
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = val;
      this.getTableData();
      this.listdata.pageIndex = 1
      this.listdata.pageSize = val
      this.getTableData()
    },
    handleCurrentChange(val) {
      this.listdata.pageIndex = val;
      this.getTableData();
      this.listdata.pageIndex = val
      this.getTableData()
    },
    async getTableData() {
      this.tableData = [];
      this.tableData = []
      const data = await dataQuery_selectByPage(this.listdata);
      const data = await dataQuery_selectByPage(this.listdata)
      if (data.code != 200) {
        this.$message.error("列表调用失败");
        this.$message.error("列表调用失败")
      }
      var val_Data = data.result;
      var val_Data = data.result
      for (var i in val_Data) {
        var valste = val_Data[i];
        var valste = val_Data[i]
        for (var j in this.optionx) {
          if (
            this.optionx[j].domainNa != null &&
            this.optionx[j].domainNa != undefined
          ) {
            valste[this.optionx[j].field] = this.optionx[j].domainNa;
            valste[this.optionx[j].field] = this.optionx[j].domainNa
          }
        }
      }
      this.pageCount = data.count;
      this.tableData = data.result;
      this.$refs.dialogPayChannel.doLayout();
      this.showAllImage(data.result);
      this.pageCount = data.count
      this.tableData = data.result
      this.$refs.dialogPayChannel.doLayout()
      // this.showAllImage(data.result)
    },
    async showAllImage(res) {
      for (var i in res) {
        let properties = res[i];
        let properties = res[i]
        var param = {
          gid: res[i].gid,
          name: this.listdata.name,
        };
        const data = await dataQuerySelectWktById(param);
        if (data.code != 200) {
          this.$message.error("列表调用失败");
        }
        var val1 = decr(data.result);
        const data = await dataQuerySelectWktById(param)
        if (data.code != 200) {
          this.$message.error("列表调用失败")
        }
        var val1 = decr(data.result)
        if (val1) {
          var wkt = this.$wkt.parse(val1);
          var wkt = this.$wkt.parse(val1)
          // this.getprimitiLayer(wkt);
          this.primitivesAddLayer(wkt, properties);
          this.primitivesAddLayer(wkt, properties)
        }
      }
    },
@@ -665,8 +693,8 @@
        case "Point":
          this.$store.state.primitLayer = window.Viewer.scene.primitives.add(
            new Cesium.BillboardCollection()
          );
          break;
          )
          break
      }
    },
    primitivesAddLayer(res, properties) {
@@ -675,7 +703,7 @@
          var val = Cesium.Cartesian3.fromDegrees(
            res.coordinates[0],
            res.coordinates[1]
          );
          )
          var point = Viewer.entities.add({
            position: val,
            properties: properties,
@@ -695,22 +723,22 @@
              // 是否显示
              show: true,
            },
          });
          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY;
          this.$store.state.queryInfo.push(point);
          })
          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);
            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.$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) {
@@ -718,34 +746,38 @@
                  }
                })
              })
              this.$store.state.propertiesInfo = obj;
              this.$store.state.propertiesInfo = obj
            }
          }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
          break;
          }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
          break
        case "LineString":
        case "MultiLineString":
          var line = res.coordinates[0];
          var std = [];
          var line = res.coordinates[0]
          var std = []
          for (var i in line) {
            std.push(line[i][0], line[i][1]);
            std.push(line[i][0], line[i][1])
          }
          var polyline = Viewer.entities.add({
            polyline: {
              properties: properties,
              tag: "properties_line",
              positions: Cesium.Cartesian3.fromDegreesArray(std),
              width: 5,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              clampToGround: true,
            },
          });
          this.$store.state.queryInfo.push(polyline);
          break;
          })
          this.$store.state.queryInfo.push(polyline)
          break
        case "MultiPolygon":
          var val = res.coordinates[0][0];
          var std = [];
          var val = res.coordinates[0][0]
          var std = []
          for (var i in val) {
            std.push(val[i][0], val[i][1]);
            std.push(val[i][0], val[i][1])
          }
          var entity = Viewer.entities.add({
            properties: properties,
            tag: "properties_polygon",
            polygon: {
              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
              //height : 100000,
@@ -753,36 +785,42 @@
              outline: true,
              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
            },
          });
          this.$store.state.queryInfo.push(entity);
          break;
          })
          this.$store.state.queryInfo.push(entity)
          break
      }
    },
    closeMenuBox() {
      if (this.imagePoint != null) {
        sgworld.Creator.DeleteObject(this.imagePoint);
        this.imagePoint = null;
        sgworld.Creator.DeleteObject(this.imagePoint)
        this.imagePoint = null
      }
      sgworld.Creator.SimpleGraphic.clear();
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = null;
      sgworld.Creator.SimpleGraphic.clear()
      this.$store.state.mapPopBoolean = false
      this.$store.state.mapPopBoxFlag = null
    },
  },
  created() {
    this.setTableAll();
    this.setTableAll()
  },
  mounted() {
    this.$bus.$on("changeMapMenuTop", (res) => {
    this.$bus.$on("changeMapMenuTop", res => {
      if (res == "true") {
        this.setTableAll();
        this.setTableAll()
      }
    });
    })
  },
  destroyed() {
    this.$store.state.propertiesFlag = null;
  }
};
    this.$store.state.propertiesFlag = null
    if (propertieshandler != null && Cesium.defined(propertieshandler)) {
      window.propertieshandler.removeInputAction(
        Cesium.ScreenSpaceEventType.LEFT_CLICK
      )
      window.propertieshandler = null
    }
  },
}
</script>
<style scoped lang="less">
src/components/MapView/mapSpacePop.vue
@@ -192,7 +192,6 @@
      // this.getTableselectFields();
      // this.restSpacePopLayer();
    },
  },
  created() {
    this.spaceLayer = this.$store.state.mapSpaceQueryLayer
@@ -411,83 +410,80 @@
      }
      var coord = res.coordinates
      if (res.type == "Point") {
        var val = Cesium.Cartesian3.fromDegrees(
          res.coordinates[0],
          res.coordinates[1]
        )
        this.$store.state.primitLayer = Viewer.entities.add({
          properties: properties,
          tag: "properties_point",
          position: val,
          billboard: {
            // 图像地址,URI或Canvas的属性
            image: SmartEarthRootUrl + "Workers/image/mark.png",
            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
            // 大小是否以米为单位
            sizeInMeters: false,
            // 相对于坐标的垂直位置
            verticalOrigin: Cesium.VerticalOrigin.CENTER,
            // 相对于坐标的水平位置
            horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
            // 应用于图像的统一比例。比例大于会1.0放大标签,而比例小于会1.0缩小标签。
            scale: 1.0,
            // 是否显示
            show: true,
          },
        })
        this.$store.state.primitLayer.billboard.disableDepthTestDistance =
          Number.POSITIVE_INFINITY
      switch (res.type) {
        case "Point":
          var val = Cesium.Cartesian3.fromDegrees(
            res.coordinates[0],
            res.coordinates[1]
          )
          var point = Viewer.entities.add({
            properties: properties,
            tag: "properties_point",
            position: val,
            billboard: {
              // 图像地址,URI或Canvas的属性
              image: SmartEarthRootUrl + "Workers/image/mark.png",
              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
              // 大小是否以米为单位
              sizeInMeters: false,
              // 相对于坐标的垂直位置
              verticalOrigin: Cesium.VerticalOrigin.CENTER,
              // 相对于坐标的水平位置
              horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
              // 应用于图像的统一比例。比例大于会1.0放大标签,而比例小于会1.0缩小标签。
              scale: 1.0,
              // 是否显示
              show: true,
            },
          })
          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY
          this.$store.state.queryInfo.push(point)
          sgworld.Navigate.flyToObj(point)
          this.$store.state.primitLayer = point
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer)
      } else if (res.type == "MultiPolygon" || res.type == "LineString") {
        var val = res.coordinates[0][0]
        var std = []
        for (var i in val) {
          std.push(val[i][0])
          std.push(val[i][1])
        }
        this.$store.state.primitLayer = Viewer.entities.add({
          properties: properties,
          tag: "properties_line",
          polyline: {
            positions: Cesium.Cartesian3.fromDegreesArray(std),
            width: 5,
            material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
            clampToGround: true,
          },
        })
        // this.$store.state.primitLayer = sgworld.Creator.createPolygon(std, {
        //   fillColor: '#ffff00',
        //   outlineColor: '#fff',
        //   outlineWidth: 2
        // }, 1, 0, "面");
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer)
      } else if (res.type == "MultiLineString") {
        var line = res.coordinates[0]
        var std = []
        for (var i in line) {
          std.push({ x: line[i][0], y: line[i][1], z: 1000 })
        }
        const polyline = sgworld.Creator.createPolyline(
          std,
          "#ffff00",
          1,
          0,
          "线"
        )
        const entity =  polyline.item
        entity.properties = properties
        entity.tag =   "properties_line"
        this.$store.state.primitLayer = polyline
        sgworld.Navigate.flyToObj(entity)
          break
        case "LineString":
        case "MultiLineString":
          var line = res.coordinates[0]
          var std = []
          for (var i in line) {
            std.push(line[i][0], line[i][1])
          }
          var polyline = Viewer.entities.add({
            properties: properties,
            tag: "properties_line",
            polyline: {
              positions: Cesium.Cartesian3.fromDegreesArray(std),
              width: 5,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              clampToGround: true,
            },
          })
          this.$store.state.queryInfo.push(polyline)
          sgworld.Navigate.flyToObj(polyline)
          this.$store.state.primitLayer = polyline
          break
        case "MultiPolygon":
          var val = res.coordinates[0][0]
          var std = []
          for (var i in val) {
            std.push(val[i][0], val[i][1])
          }
          var entity = Viewer.entities.add({
            properties: properties,
            tag: "properties_polygon",
            polygon: {
              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
              //height : 100000,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              outline: true,
              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
            },
          })
          this.$store.state.queryInfo.push(entity)
          sgworld.Navigate.flyToObj(entity)
          this.$store.state.primitLayer = entity
          break
      }
      this.setMapHandler()
    },
@@ -497,24 +493,12 @@
      )
      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
        } else if (pick && pick.id && pick.id._polyline && pick.id.tag == "properties_line") {
        if (
          pick &&
          pick.id &&
          pick.id.tag &&
          pick.id.tag.includes("properties_")
        ) {
          this.$store.state.propertiesFlag = "1"
          let properties = pick.id.properties
          let propertyNames = pick.id.properties.propertyNames