From 61f9745da5195ee188ea0a529e5f2113e6e930cd Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 15 十二月 2022 10:09:23 +0800
Subject: [PATCH] 2022-12-14 肖辉 违规检索--- 导出

---
 src/views/intelligentPatrol/illegalSearch/index.vue |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/views/intelligentPatrol/illegalSearch/index.vue b/src/views/intelligentPatrol/illegalSearch/index.vue
index 9274a8b..258b3a3 100644
--- a/src/views/intelligentPatrol/illegalSearch/index.vue
+++ b/src/views/intelligentPatrol/illegalSearch/index.vue
@@ -23,7 +23,7 @@
         <!-- 鎸夐挳鍖哄煙 -->
         <div class="main-btns">
           <div class="main-btns-left">
-            <el-button icon="el-icon-download">涓嬭浇鍥剧墖</el-button>
+<!--            <el-button icon="el-icon-download">涓嬭浇鍥剧墖</el-button>-->
             <el-button icon="el-icon-folder" @click="exportTableData">瀵煎嚭</el-button>
           </div>
           <div class="main-btns-right">
@@ -253,8 +253,35 @@
 
     exportTableData() {
       basecase.exportViolationData({ current: 1 })
-          .then(() => {
+          .then((res) => {
+            console.log(res)
             this.$message.success('鎿嶄綔鎴愬姛');
+            // let res = basecase.exportUserOperationLogAjax({
+            //   startLogTime: transDate(this.searchQuery.date[0], "YYYY-MM-DD"),
+            //   endLogTime: transDate(this.searchQuery.date[1], "YYYY-MM-DD"),
+            //   systemName: this.searchQuery.systemName,
+            //   userName: this.searchQuery.user,
+            // }).then((res)=>{
+            //   console.log(res)
+            // });
+
+            let time = new Date()
+            let deathdate =time.toLocaleDateString()
+            const blob = new Blob([res.data], {
+              type: "application/vnd.ms-excel;charset=utf-8",
+            });
+            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);
+            }
           })
           .catch(err => this.$message.error(err))
     }

--
Gitblit v1.8.0