From e4f452a6955e6769c9a91082aca02e4a71a7c3ec Mon Sep 17 00:00:00 2001 From: fangyuan <527392886@qq.com> Date: 星期三, 11 一月 2023 09:18:54 +0800 Subject: [PATCH] 违法统计导出功能添加 --- src/views/intelligentPatrol/statistics/unlawful/time/index.vue | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/src/views/intelligentPatrol/statistics/unlawful/time/index.vue b/src/views/intelligentPatrol/statistics/unlawful/time/index.vue index 27e81b7..8f6c378 100644 --- a/src/views/intelligentPatrol/statistics/unlawful/time/index.vue +++ b/src/views/intelligentPatrol/statistics/unlawful/time/index.vue @@ -137,7 +137,34 @@ methods: { ...mapActions(["searchByTime"]), - 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) {}, // 璁剧疆琛ㄦ牸鏂戦┈绾� -- Gitblit v1.8.0