月球大数据地理空间分析展示平台-【前端】-月球2期前端
surprise
2023-10-31 b7e62ad2625121586b1254dab69b3c3d38da71de
src/views/export/exportMap.vue
@@ -131,7 +131,6 @@
  var layers = store.state.chekNowLayers
  var tabLayer = layers.filter((rs) => {
    console.log(rs)
    if (!rs.shpType && rs.isLayer == 1) {
      return rs
    }
@@ -143,7 +142,27 @@
  exportFrom.value.xmax = val[2];
  exportFrom.value.ymax = val[3];
};
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 +
    '-' +
    add0(m) +
    '-' +
    add0(d)
  );
}
//格式化时间
const add0 = (m) => {
  return m < 10 ? '0' + m : m;
}
const setInsertExporLayer = () => {
  emits("SETexportMap", false);
  store.state.loading = true;
@@ -153,20 +172,23 @@
  for (var i in tableData.value) {
    if (tableData.value[i].tab) {
      res.push(tableData.value[i].tab.replace("moon:", ""));
    }
    if (!tableData.value[i].shpType) {
        ids.push(tableData.value[i].id);
      }
      ids.push(tableData.value[i].id);
    }
  }
  res.push();
  var nowDate = format(exportFrom.value.date)
  var obj = {
    layerIds: ids,
    token: token.replace("?token=", ""),
    title: exportFrom.value.name,
    pageSize: exportFrom.value.pageSize,
    date: exportFrom.value.date,
    date: nowDate,
    layers: res.toString(),
    rotation: exportFrom.value.role,
    xmin: exportFrom.value.xmin,