From d6737b65013a2d2078d5606a25f4a1d15fc0a1d8 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 10 Jan 2022 10:32:23 +0800
Subject: [PATCH] 登录记录新增导出

---
 src/views/statisticalQueryManagement/informationLoginStatistics.vue |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/src/views/statisticalQueryManagement/informationLoginStatistics.vue b/src/views/statisticalQueryManagement/informationLoginStatistics.vue
index 850108e..9cb966c 100644
--- a/src/views/statisticalQueryManagement/informationLoginStatistics.vue
+++ b/src/views/statisticalQueryManagement/informationLoginStatistics.vue
@@ -12,7 +12,18 @@
         @search-reset="searchReset"
         @refresh-change="refreshChange"
       >
+      <template slot="menuLeft">
+      <el-button
+              type="warning"
+              size="small"
+              plain
+              icon="el-icon-download"
+              @click="handleExportLoginRecord"
+              >导出
+            </el-button>
+      </template>
       </avue-crud>
+      
     </basic-container>
   </div>
 </template>
@@ -21,6 +32,9 @@
 import { getInformationLoginPage } from "@/api/loginRecord/loginRecord";
 import {  lazyTrees } from "@/api/index/index";
 import {dictionaryList} from "@/api/statisticalQueryManagement/statisticalQueryManagement";
+import Qs from "qs";
+import { getToken } from "@/util/auth";
+import { mapGetters } from "vuex";
 export default {
   data() {
     return {
@@ -145,12 +159,46 @@
       },
     };
   },
+  computed: {
+    ...mapGetters(["permission"]),
+  },
   created(){
     //分别查询辖区和字典数据
     this.getSubOfficeData();
     this.getDictionaryList();
   },
   methods: {
+    //登录数据导出
+    handleExportLoginRecord() {
+      this.$confirm("是否导出企业登录记录数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        //获取查询条件
+        const { releaseTimeRange } = this.search;
+        if (releaseTimeRange) {
+          this.search["startTime"] = releaseTimeRange[0];
+          this.search["endTime"] = releaseTimeRange[1];
+        }
+        var data = {
+          jurisdiction: this.search.jurisdictionName,
+          stats: this.search.stats,
+          deptName: this.search.deptName,
+          types: this.search.types,
+          startTime: this.search.startTime,
+          endTime: this.search.endTime,
+        };
+        // console.log(data,123);
+        //序列号url形式,用&拼接
+        data = Qs.stringify(data);
+        window.open(
+          `/api/loginRecord/export-login-record?${
+            this.website.tokenHeader
+          }=${getToken()}&` + data
+        );
+      });
+    },
     //获取辖区数据
     getSubOfficeData() {
       lazyTrees().then((res) => {

--
Gitblit v1.9.3