odc.xiaohui
2023-01-11 4506c7f074f9dc7ec2937bd7d9c99a0a09d50ee6
src/views/intelligentPatrol/statistics/unlawful/type/index.vue
@@ -148,7 +148,34 @@
  methods: {
    ...mapActions(["searchByType"]),
    handleExport(e) {},
    handleExport(e) {
      this.$axios({
        method: 'post',
        url: `sccg/intelligentPatrol/statistics/export/unlawful`,
        responseType: 'arraybuffer'
      })
        .then(res => {
          let time = new Date()
            let deathdate =time.toLocaleDateString()
            const blob = new Blob([res.data], {
              type: "application/vnd.ms-excel;charset=utf-8",
            });
            debugger
            if (window.navigator.msSaveBlob) {
              window.navigator.msSaveBlob(blob, deathdate+"按违规类型统计" + ".xlsx");
            } else {
              const url = window.URL.createObjectURL(blob);
              const link = document.createElement("a");
              link.style.display = "none";
              link.href = url;
              link.download = deathdate+"按违规类型统计" + ".xlsx";
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
            }
            this.$message.success('操作成功');
        })
    },
    setTableDataHandle(e) {},
    resetTableData(e) {},
    // 设置表格斑马纹