月球大数据地理空间分析展示平台-【前端】-月球2期前端
WX
2023-09-13 513e1bdf4b2703409d9e4dbb776e67ffa0c134a6
src/views/query/SpatialQuery.vue
@@ -77,7 +77,7 @@
            >
              <template #default="scope">
                <el-button
                  :icon="Location"
                  class="el-icon-map"
                  size="small"
                  @click.prevent="spaceLocation(scope.$index, scope.row)"
                >
@@ -513,9 +513,36 @@
    return ElMessage.error("空间查询失败");
  }
  listData.value.count = data.count;
  tableData.value = data.result;
  var val = data.result.filter((res) => {
    if (res.apprTime) {
      res.apprTime = format(res.apprTime);
    }
    if (res.createtime) {
      res.apprTime = format(res.createtime);
    }
    if (res.updatetime) {
      res.apprTime = format(res.updatetime);
    }
    return res;
  });
  tableData.value = val;
};
//格式化时间
const format = (shijianchuo) => {
  //shijianchuo是整数,否则要parseInt转换
  var time = new Date(shijianchuo);
  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 + "-" + add01(m) + "-" + add01(d) + " " + h + ":" + mm + ":" + s;
};
//格式化时间
const add01 = (m) => {
  return m < 10 ? "0" + m : m;
};
const setQueySpatialFields = async () => {
  const data = await dataQuery_selectFields({
    ns: "mn",
@@ -531,8 +558,17 @@
    }
  });
  attributeData.value = std;
  fieldOption.value = std;
  var val = std.filter((res) => {
    if (res.field.indexOf("_") > -1) {
      var str = res.field.split("_");
      res.field = str[0] + str[1][0].toUpperCase() + str[1].slice(1);
      return res;
    } else {
      return res;
    }
  });
  attributeData.value = val;
  fieldOption.value = val;
  conditionChange(data.result[0]);
  setQueySpatialData();
};
@@ -786,6 +822,16 @@
      color: #d6e4ff !important;
    }
  }
  .el-icon-map {
    background: url("../../assets/img/location.png") center no-repeat;
    background-size: 100% 100%;
    border: transparent;
  }
  .el-icon-map:before {
    content: "定位";
    font-size: 0;
    visibility: hidden;
  }
}
</style> 
<style lang="less"  >