月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-08-30 9370afd29a8f6662921cc3f0f9e0f78890061326
资源查询接口对接调试,功能优化;资源管理页面新增,修改功能优化
已修改4个文件
119 ■■■■ 文件已修改
public/config/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/layerManagement.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/resourceManagement.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/resourceQuery/resourceQuery.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/config/config.js
@@ -1,6 +1,6 @@
var isWeb = location.hostname.indexOf("103.85.165.") > -1;
const webUrl = location.href.indexOf("/web") > -1 ? "/web" : "";
const webUrl = location.href.indexOf("/middle") > -1 ? "/middle" : "";
var is_production = false;//判断是否为生产环境
src/views/datamanage/layerManagement.vue
@@ -1015,7 +1015,7 @@
      this.insertData.pid = id;
      this.insertData.level = lever;
      this.insertData.orderNum = orderNum;
      debugger
      this.dialogVisible = true;
    },
    getMaxOrderNum(res) {
src/views/datamanage/resourceManagement.vue
@@ -637,6 +637,11 @@
    },
    async setEditConfirm() {
      if (this.editData.url.indexOf('?') > -1) {
        var val = this.editData.url.split("?");
        this.editData.url = val[0];
        this.editData.args = this.editData.args + val[1];
      }
      const data = await res_update(this.editData);
      if (data.code == 200) {
        this.$message({
@@ -762,6 +767,12 @@
        .catch(_ => { });
    },
    async setInsertConfirm() {
      if (this.insertData.url.indexOf('?') > -1) {
        var val = this.insertData.url.split("?");
        this.insertData.url = val[0];
        this.insertData.args = val[1] + this.insertData.args;
      }
      this.insertData.status = parseInt(this.insertData.status)
      const data = await res_insert(this.insertData);
      if (data.code == 200) {
src/views/resourceQuery/resourceQuery.vue
@@ -57,7 +57,7 @@
            <el-form-item label="时间范围">
              <el-date-picker
                style="width: 100%"
                v-model="form.acqTime"
                v-model="acqTime"
                type="datetimerange"
                range-separator="至"
                start-placeholder="开始日期"
@@ -303,12 +303,14 @@
        name: "",
        sensorType: 0,
        mataType: 0,
        acqTime: null,
        wkt: null,
        pageIndex: 1,
        pageSize: 100,
        count: 0,
        startDate: null,
        endDate: null
      },
      acqTime: '',
      sensorOption: [],
      metaOption: [],
      detailsBox: false,
@@ -328,12 +330,19 @@
        if (!checked) {
          this.list[i].checked = true;
          this.listChecked.push(this.list[i]);
          this.setAddCheckLayer(this.list[i]);
        }
      }
    },
    setListRemoveCheckAll() {
      for (var i in this.list) {
        if (this.list[i].checked) {
        this.list[i].checked = false;
          this.setRemoveCheckLayer(this.list[i]);
        }
      }
      this.listChecked = [];
    },
@@ -346,6 +355,7 @@
      this.setFromStart();
      this.setDrawMenu(5);
      this.listChecked = [];
      Viewer.entities.removeAll()
    },
    async setQueryRetrieval() {
      if (this.geoWkt) {
@@ -353,13 +363,47 @@
      } else {
        this.form.wkt = null;
      }
      if (this.acqTime) {
        this.form.endDate = this.setFromDate(this.acqTime[0])
        this.form.startDate = this.setFromDate(this.acqTime[1])
      } else {
        this.form.endDate = null
        this.form.startDate = null
      }
      const data = await select_meta_ByPageAndCount(this.form);
      if (data.code != 200) return;
      this.form.count = data.count;
      this.list = data.result;
      this.listDialog = true;
    },
    setFromDate(res) {
      var time = new Date(res);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return (
        y +
        '-' +
        this.add0(m) +
        '-' +
        this.add0(d) +
        ' ' +
        this.add0(h) +
        ':' +
        this.add0(mm) +
        ':' +
        this.add0(s)
      );
    },
    //格式化时间
    add0(m) {
      return m < 10 ? "0" + m : m;
    },
    //大小值改变
    handleSizeChange(val) {
      this.form.pageIndex = 1;
      this.form.pageSize = val;
@@ -376,6 +420,7 @@
      val.checked = !val.checked;
      if (val.checked) {
        this.listChecked.push(val);
        this.setAddCheckLayer(val);
      }
      if (this.listChecked.length > 0) {
@@ -383,10 +428,46 @@
          this.listChecked.forEach((e, i) => {
            if (e.id == val.id) {
              this.listChecked.splice(i, 1);
              this.setRemoveCheckLayer(val);
            }
          });
        }
      }
    },
    setAddCheckLayer(res) {
      if (!res.geom) return
      var wkt = this.$wkt.parse(res.geom).coordinates[0]
      var geom = [];
      for (var i in wkt) {
        geom.push(Cesium.Cartesian3.fromDegrees(wkt[i][0], wkt[i][1]))
      }
      Viewer.entities.add({
        name: res.name + "&&" + res.id,
        polygon: {
          hierarchy: geom,
          material: Cesium.Color.WHITE.withAlpha(0.1),
          // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
          outline: true,
          outlineColor: Cesium.Color.fromCssColorString("rgba(130,167,33, 1)"),
          outlineWidth: 10,
          classificationType: Cesium.ClassificationType.BOTH,//贴地形和3dtile
          clampToGround: true,//开启贴地
          height: 0,
        },
      });
    },
    setRemoveCheckLayer(res) {
      var name = res.name + "&&" + res.id;
      var entity = Viewer.entities._entities._array
      for (var i = 0; i < entity.length; i++) {
        if (entity[i].name == name) {
          Viewer.entities.remove(entity[i])
          i--;
        }
      }
    },
    setDrawMenu(res) {
      this.bufferNumber = 100;
@@ -433,7 +514,7 @@
      }
      var that = this;
      sgworld.Creator.createSimpleGraphic(this.drawType, config, (entity) => {
        sgworld.Creator.SimpleGraphic.clear()
        that.querySatialQuery(entity);
      });
    },
@@ -453,10 +534,12 @@
          res_val = res.polygon.hierarchy.getValue().positions;
          break;
      }
      sgworld.Creator.SimpleGraphic.clear()
      this.geoWkt = this.getEntityGeometry(res_val, this.drawType)
      if (this.geoWkt) {
        this.$nextTick(() => {
        this.setAddWktEntity(this.geoWkt)
        })
      }
    },
@@ -464,18 +547,17 @@
      var wkt = this.$wkt.parse(res).coordinates[0];
      var geom = [];
      for (var i in wkt) {
        geom.push(Cesium.Cartesian3.fromDegrees(wkt[i][0], wkt[i][1], wkt[i][2] ?? 0))
      }
      this.wktEntity = Viewer.entities.add({
        name: '资源查询',
        polygon: {
          hierarchy: geom,
          material: Cesium.Color.BLUE.withAlpha(0),
          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
          material: Cesium.Color.WHITE.withAlpha(0.2),
          //heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
          outline: true,
          outlineColor: Cesium.Color.GREEN,
          outlineWidth: 5,
          outlineColor: Cesium.Color.RED,
          outlineWidth: 10,
          classificationType: Cesium.ClassificationType.BOTH,//贴地形和3dtile
          clampToGround: true,//开启贴地
          height: 0,
@@ -568,12 +650,14 @@
        name: "",
        sensorType: 0,
        mataType: 0,
        acqTime: null,
        wkt: null,
        pageIndex: 1,
        pageSize: 100,
        count: 0,
        startDate: null,
        endDate: null
      }
      this.acqTime = ''
    }
  },
  created() { },