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 +++++++++
src/views/intelligentPatrol/statistics/unlawful/shop/index.vue | 29 +++++++++
src/views/intelligentPatrol/statistics/unlawful/type/index.vue | 29 +++++++++
src/views/intelligentPatrol/statistics/unlawful/area/index.vue | 29 +++++++++
src/views/intelligentPatrol/statistics/unlawful/point/index.vue | 29 +++++++++
5 files changed, 140 insertions(+), 5 deletions(-)
diff --git a/src/views/intelligentPatrol/statistics/unlawful/area/index.vue b/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
index 0025cda..484c11d 100644
--- a/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
+++ b/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
@@ -137,7 +137,34 @@
methods: {
...mapActions(["searchByArea"]),
- 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) {},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
diff --git a/src/views/intelligentPatrol/statistics/unlawful/point/index.vue b/src/views/intelligentPatrol/statistics/unlawful/point/index.vue
index e2c0d5c..8bde4be 100644
--- a/src/views/intelligentPatrol/statistics/unlawful/point/index.vue
+++ b/src/views/intelligentPatrol/statistics/unlawful/point/index.vue
@@ -147,7 +147,34 @@
methods: {
...mapActions(["searchByPoint"]),
- 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) {},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
diff --git a/src/views/intelligentPatrol/statistics/unlawful/shop/index.vue b/src/views/intelligentPatrol/statistics/unlawful/shop/index.vue
index 2dad694..57557cd 100644
--- a/src/views/intelligentPatrol/statistics/unlawful/shop/index.vue
+++ b/src/views/intelligentPatrol/statistics/unlawful/shop/index.vue
@@ -141,7 +141,34 @@
methods: {
...mapActions(["searchByShop"]),
- handleExport(e) {},
+ handleExport(e) {
+ this.$axios({
+ method: 'post',
+ url: `sccg/intelligentPatrol/statistics/export/shop`,
+ 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) {},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
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) {},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
diff --git a/src/views/intelligentPatrol/statistics/unlawful/type/index.vue b/src/views/intelligentPatrol/statistics/unlawful/type/index.vue
index 8c1e6b1..5c69bec 100644
--- a/src/views/intelligentPatrol/statistics/unlawful/type/index.vue
+++ b/src/views/intelligentPatrol/statistics/unlawful/type/index.vue
@@ -145,7 +145,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) {},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
--
Gitblit v1.8.0