From e358d69fc18870584dd2d9f531910b7838ea27d9 Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期四, 02 一月 2025 09:58:53 +0800
Subject: [PATCH] 调整行点击后的回调

---
 Source/plt-web/plt-web-ui/src/views/system/log/index.vue |  117 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 78 insertions(+), 39 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/system/log/index.vue b/Source/plt-web/plt-web-ui/src/views/system/log/index.vue
index d025bfa..3eedc62 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/log/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/log/index.vue
@@ -11,10 +11,13 @@
       @search-change="handleSearch"
       @search-reset="handleReset"
       @size-change="sizeChange"
+      @row-click="rowClickHandler"
       @current-change="currentChange"
     >
       <template slot="menuLeft" slot-scope="scope">
-        <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
+        <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary"
+                   @click="exportClickHandler">瀵煎嚭
+        </el-button>
       </template>
     </avue-crud>
   </basic-container>
@@ -22,75 +25,76 @@
 
 <script>
 import basicOption from "@/util/basic-option";
-import {getLogListByContion,getOperatingUsers,exportLog} from "@/api/system/log/logBasic";
+import {getLogListByContion, getOperatingUsers, exportLog} from "@/api/system/log/logBasic";
 import func from "@/util/func";
+import {mapGetters} from "vuex";
 
 export default {
-name: "index",
+  name: "index",
   data: function () {
     return {
       tableLoading: false,
       tableData: [],
       option: {
         ...basicOption,
-        addBtn:false,
+        addBtn: false,
         editBtn: false,
         delBtn: false,
         calcHeight: -60,
-        align:'left',
-        headerAlign:'center',
-        menu:false,
+        align: 'left',
+        headerAlign: 'center',
+        menu: false,
         searchMenuSpan: 6,
-        searchIcon:false,
+        searchIcon: false,
         column: [
           {
             label: '鐢ㄦ埛鍚�',
-            prop: 'truename',
-            search:true,
+            prop: 'username',
+            search: true,
             searchSpan: 4,
-            searchLabel:'鎿嶄綔鐢ㄦ埛',
-            type:'select',
-            dicUrl:'/api/loginBasicController/getOperatingUsers',
-            sortable:true,
-            width: 150
+            searchLabel: '鎿嶄綔鐢ㄦ埛',
+            type: 'select',
+            dicUrl: '/api/loginBasicController/getOperatingUsers',
+            sortable: true,
+            width: 200
           }, {
             label: '濮撳悕',
-            prop: 'username',
-            sortable:true,
+            prop: 'truename',
+            sortable: true,
             width: 150
-          },{
+          }, {
             label: '鐢ㄦ埛IP',
             prop: 'userIp',
-            search:true,
+            search: true,
             searchSpan: 4,
-            sortable:true,
+            sortable: true,
             width: 150
-          },{
+          }, {
             label: '妯″潡',
             prop: 'moduleName',
-            sortable:true,
+            sortable: true,
             overHidden: true,
-          },{
+          }, {
             label: '鎿嶄綔',
             prop: 'type',
-            sortable:true,
+            sortable: true,
             width: 150
-          },{
+          }, {
             label: '鏃堕棿',
             prop: 'date',
-            type:'date',
-            search:true,
+            type: 'date',
+            search: true,
             searchOrder: 1,
             searchSpan: 8,
             searchRange: true,
-            searchLabel:'鏌ヨ鏃ユ湡',
-            valueFormat:'yyyy-MM-dd',
+            searchLabel: '鏌ヨ鏃ユ湡',
+            valueFormat: 'yyyy-MM-dd',
             width: 160
-          },{
+          }, {
             label: '鎻忚堪',
             prop: 'result',
             overHidden: true,
-            width:380,
+            width: 380,
           },
         ]
       },
@@ -100,7 +104,9 @@
         total: 0,
         pageSizes: [10, 30, 50, 100],
       },
-      searchParams: {}
+      searchParams: {},
+      selectList: [],
+
     }
   },
   watch: {
@@ -108,13 +114,27 @@
       this.getTableList();
     }
   },
+  computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+      };
+    },
+  },
+  created() {
+  },
   methods: {
     // 琛ㄦ牸璇锋眰
     getTableList() {
       this.tableLoading = true;
-      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType':this.$route.query.logType,...this.searchParams}).then(res => {
+      getLogListByContion(this.page.currentPage, this.page.pageSize, {
+        'logType': this.$route.query.logType,
+        'roleType': this.$route.query.roleType, ...this.searchParams
+      }).then(res => {
         this.tableData = res.data.data;
         this.page.total = res.data.total;
+        this.selectList=[];
         this.tableLoading = false;
       })
     },
@@ -122,10 +142,10 @@
     // 鎼滅储鏌ヨ
     handleSearch(params, done) {
       this.searchParams = {
-        userName:params.truename,
-        ipText:params.userIp,
-        startDate:params.date[0],
-        endDate:params.date[1]
+        userName: params.truename,
+        ipText: params.userIp,
+        startDate: params.date[0],
+        endDate: params.date[1]
       };
 
       this.getTableList();
@@ -148,19 +168,38 @@
       this.page.currentPage = val;
     },
 
-    handleRefresh(){
+    handleRefresh() {
       this.getTableList();
     },
     // 瀵煎嚭
     exportClickHandler() {
       const loading = this.$loading({});
-      exportLog().then(res => {
+      exportLog({
+        'pageNo': 1,
+        'pageSize': -1,
+        'logType': this.$route.query.logType,
+        'roleType': this.$route.query.roleType, ...this.searchParams
+      }).then(res => {
         func.downloadFileByBlobHandler(res);
         this.createdLoading = false
         this.$message.success('瀵煎嚭鎴愬姛');
         loading.close();
       })
     },
+    // 琛屽崟閫�
+    rowClickHandler(row) {
+      func.rowClickHandler(
+        row,
+        this.$refs.logCrud,
+        this.lastIndex,
+        (newIndex) => {
+          this.lastIndex = newIndex;
+        },
+        () => {
+          this.selectList = [row];
+        }
+      );
+    },
   }
 }
 </script>

--
Gitblit v1.9.3