From 52874e13b27f92bc21b0a3b079077739841ebdb3 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 23 十月 2024 17:07:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/plt-web/plt-web-ui/src/views/system/log/index.vue |  170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 170 insertions(+), 0 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
new file mode 100644
index 0000000..9b02091
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/views/system/log/index.vue
@@ -0,0 +1,170 @@
+<template>
+  <basic-container>
+    <avue-crud
+      ref="logCrud"
+      :data="tableData"
+      :option="option"
+      :page.sync="page"
+      :table-loading="tableLoading"
+      @on-load="getTableList"
+      @refresh-change="handleRefresh"
+      @search-change="handleSearch"
+      @search-reset="handleReset"
+      @size-change="sizeChange"
+      @current-change="currentChange"
+    >
+      <template slot="menuLeft" slot-scope="scope">
+        <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import basicOption from "@/util/basic-option";
+import {getLogListByContion,getOperatingUsers,exportLog} from "@/api/system/log/logBasic";
+import func from "@/util/func";
+
+export default {
+  name: "index",
+  data: function () {
+    return {
+      tableLoading: false,
+      tableData: [],
+      option: {
+        ...basicOption,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        calcHeight: -60,
+        align: 'left',
+        headerAlign: 'center',
+        menu: false,
+        searchMenuSpan: 6,
+        searchIcon: false,
+        column: [
+          {
+            label: '鐢ㄦ埛鍚�',
+            prop: 'truename',
+            search: true,
+            searchSpan: 4,
+            searchLabel: '鎿嶄綔鐢ㄦ埛',
+            type: 'select',
+            dicUrl: '/api/loginBasicController/getOperatingUsers',
+            sortable: true,
+            width: 150
+          }, {
+            label: '濮撳悕',
+            prop: 'username',
+            sortable: true,
+            width: 150
+          }, {
+            label: '鐢ㄦ埛IP',
+            prop: 'userIp',
+            search: true,
+            searchSpan: 4,
+            sortable: true,
+            width: 150
+          }, {
+            label: '妯″潡',
+            prop: 'moduleName',
+            sortable: true,
+            overHidden: true,
+          }, {
+            label: '鎿嶄綔',
+            prop: 'type',
+            sortable: true,
+            width: 150
+          }, {
+            label: '鏃堕棿',
+            prop: 'date',
+            type: 'date',
+            search: true,
+            searchOrder: 1,
+            searchSpan: 8,
+            searchRange: true,
+            searchLabel: '鏌ヨ鏃ユ湡',
+            valueFormat: 'yyyy-MM-dd',
+            width: 160
+          }, {
+            label: '鎻忚堪',
+            prop: 'result',
+            overHidden: true,
+            width: 380,
+          },
+        ]
+      },
+      page: {
+        currentPage: 1,
+        pageSize: 50,
+        total: 0,
+        pageSizes: [10, 30, 50, 100],
+      },
+      searchParams: {}
+    }
+  },
+  watch: {
+    $route(to, from) {
+      this.getTableList();
+    }
+  },
+  methods: {
+    // 琛ㄦ牸璇锋眰
+    getTableList() {
+      this.tableLoading = true;
+      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType': this.$route.query.logType, ...this.searchParams}).then(res => {
+        this.tableData = res.data.data;
+        this.page.total = res.data.total;
+        this.tableLoading = false;
+      })
+    },
+
+    // 鎼滅储鏌ヨ
+    handleSearch(params, done) {
+      this.searchParams = {
+        userName: params.truename,
+        ipText: params.userIp,
+        startDate: params.date[0],
+        endDate: params.date[1]
+      };
+
+      this.getTableList();
+      done();
+    },
+
+    // 閲嶇疆鎼滅储鏉′欢
+    handleReset() {
+      this.searchParams = {};
+      this.getTableList();
+    },
+
+    // 鏉℃暟
+    sizeChange(val) {
+      this.page.pageSize = val;
+    },
+
+    // 椤电爜
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+
+    handleRefresh() {
+      this.getTableList();
+    },
+    // 瀵煎嚭
+    exportClickHandler() {
+      const loading = this.$loading({});
+      exportLog().then(res => {
+        func.downloadFileByBlobHandler(res);
+        this.createdLoading = false
+        this.$message.success('瀵煎嚭鎴愬姛');
+        loading.close();
+      })
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

--
Gitblit v1.9.3