首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >导出功能怎么实现

导出功能怎么实现

作者头像
程序媛夏天
发布2024-01-18 20:51:21
发布2024-01-18 20:51:21
5820
举报
导出功能源代码
代码语言:javascript
复制
 exportExcel() {
 //导出条件,不符合条件则return
      if (!this.form.date[0] || !this.form.date[1]) {
        this.$message.info("请输入查询时间范围");
        return;
      }
      if (!this.form.selectedOptions[2]) {
        this.$message.info("请选择具体监测点");
        return;
      }
   //导出的接口
      historyExport({
        startTime: this.form.date[0],
        endTime: this.form.date[1],
        pointId: this.form.selectedOptions[2],
      }).then((msg) => {
        this.$message({
          type: "success",
          message: this.$t("message.operationSuccess"),
        });
        let exportObj = {
          taskId: msg,
          taskName: "站点列表",
          taskStatus: 0,
          rootPath: "historyPath",
        };
        //将导出任务丢入导出任务列表中
        //异步操作存储
        this.$store.dispatch("PushExportNotice", exportObj);
      });
    },
举一反三
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-01-18,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • 导出功能源代码
  • 举一反三
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档