Explorar o código

联调操作日志和登录日志列表、查询接口

wangrulan %!s(int64=2) %!d(string=hai) anos
pai
achega
b94761dc57

+ 18 - 4
src/common/js/home.js

@@ -146,12 +146,18 @@ export function getRoleCopy(data) {
   })
 }
 
-
-
 // 操作日志
 export function getOperationLogList(data) {
   return request({
-    url: '/api/api/web/log/operationLog',
+    url: '/api/api/web/log/operationLog/list',
+    method: 'post',
+    data: data
+  })
+}
+// 操作导出
+export function getOperationLogExport(data) {
+  return request({
+    url: '/api/api/web/log/operationLog/export',
     method: 'post',
     data: data
   })
@@ -159,7 +165,15 @@ export function getOperationLogList(data) {
 // 登录日志
 export function getVerificationLogList(data) {
   return request({
-    url: '/api/api/web/log/verificationLog',
+    url: '/api/api/web/log/verificationLog/list',
+    method: 'post',
+    data: data
+  })
+}
+// 登录导出
+export function getVerificationLogExport(data) {
+  return request({
+    url: '/api/api/web/log/verificationLog/export',
     method: 'post',
     data: data
   })

+ 44 - 30
src/components/permissions/login/index.vue

@@ -49,19 +49,13 @@
         />
       </el-form-item>
       <el-form-item label="地区" prop="cityId">
-        <el-select
+        <el-cascader
           v-model="queryParams.cityId"
-          placeholder="请选择地区"
+          placeholder="请选择省份/地市/区县"
+          :options="cityList"
+          @change="areaIdChange"
           clearable
-          size="small"
-        >
-          <el-option
-            v-for="dict in systemList"
-            :key="dict.system"
-            :label="dict.systemName"
-            :value="dict.system"
-          />
-        </el-select>
+        ></el-cascader>
       </el-form-item>
       <el-form-item label="时间范围" prop="value">
         <el-date-picker
@@ -118,7 +112,12 @@
 </template>
 
 <script>
-import { getSystemList, getVerificationLogList } from "../../../common/js/home";
+import {
+  getSystemList,
+  getCityAreaList,
+  getVerificationLogList,
+  getVerificationLogExport,
+} from "../../../common/js/home";
 export default {
   name: "Login",
   components: {},
@@ -130,13 +129,13 @@ export default {
       queryParams: {
         current: 1,
         pageSize: 10,
-        loginName: "",
-        userName: "",
-        system: "",
-        userId: "",
-        cityId: "",
-        startTime: "",
-        endTime: "",
+        loginName: null,
+        userName: null,
+        system: null,
+        userId: null,
+        cityId: null,
+        startTime: null,
+        endTime: null,
         value: [],
       },
       tableList: [],
@@ -151,32 +150,47 @@ export default {
   },
   methods: {
     init() {
-      // getSystemList().then(res=>{
-      //   console.log('res: ', res);
-      //   this.systemList = res.data
-      // })
+      getSystemList().then((res) => {
+        this.systemList = res.data;
+      });
+      getCityAreaList().then((res2) => {
+        this.cityList = res2.data;
+      });
     },
     getList() {
-      // getVerificationLogList(this.queryParams).then(res=>{
-      //   console.log('res: ', res);
-      //   this.tableList = res.data;
-      //   this.total = res.total
-      // })
+      this.loading = true;
+      getVerificationLogList(this.queryParams).then(res=>{
+        this.loading = false;
+        this.tableList = res.data.list;
+        this.total = res.data.total
+      })
     },
     timeChange(val) {
-      console.log("val: ", val);
       this.queryParams.startTime = val[0];
       this.queryParams.endTime = val[1];
     },
     handleQuery() {
+      this.queryParams.current = 1;
       this.getList();
     },
+    // 查询条件地区选择
+    areaIdChange(val) {
+      this.queryParams.cityId = val[val.length - 1];
+    },
     // 重置
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.startTime = "";
+      this.queryParams.endTime = "";
+      this.queryParams.current = 1;
+      this.getList();
     },
     // 导出
-    handleDownload() {},
+    handleDownload() {
+      getVerificationLogExport(this.queryParams).then(res=>{
+        
+      })
+    },
   },
 };
 </script>

+ 2 - 0
src/components/permissions/module/index.vue

@@ -266,11 +266,13 @@ export default {
       })
     },
     handleQuery() {
+      this.queryParams.current = 1;
       this.getList();
     },
     // 重置
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.current = 1;
       this.getList();
     },
     handleSelectionChange(val) {

+ 16 - 9
src/components/permissions/operate/index.vue

@@ -79,8 +79,8 @@
     <el-table v-loading="loading" :data="tableList"  border style="width: 100%">
       <el-table-column type="index" width="50" label="序号"/>
       <el-table-column label="操作名称" align="center" prop="operationName" />
-      <el-table-column label="操作内容" align="center" prop="operationContent" />
-      <el-table-column label="用户id" align="center" prop="operatorId" />
+      <el-table-column label="操作内容" align="center" prop="operationContent" :show-overflow-tooltip="true"/>
+      <el-table-column label="用户id" align="center" prop="operatorId" width="100"/>
       <el-table-column label="用户名称" align="center" prop="operatorName" />
       <el-table-column label="账号" align="center" prop="operatorAccount" />
       <el-table-column label="操作时间" align="center" prop="operationTime" />
@@ -96,7 +96,7 @@
 </template>
 
 <script>
-import { getOperationLogList } from "../../../common/js/home";
+import { getOperationLogList, getOperationLogExport } from "../../../common/js/home";
 export default {
   name: "Operate",
   components: {},
@@ -126,28 +126,35 @@ export default {
   },
   methods: {
     getList() {
-      // getOperationLogList(this.queryParams).then(res=>{
-      //   console.log('res: ', res);
-      //   this.tableList = res.data;
-      //   this.total = res.total
-      // })
+      this.loading = true
+      getOperationLogList(this.queryParams).then(res=>{
+        this.loading = false;
+        this.tableList = res.data.list;
+        this.total = res.data.total
+      })
     },
     timeChange(val) {
-      console.log('val: ', val);
       this.queryParams.startTime = val[0]
       this.queryParams.endTime = val[1]
 
     },
     handleQuery() {
+      this.queryParams.current = 1;
       this.getList();
     },
     // 重置
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.startTime = ''
+      this.queryParams.endTime = ''
+      this.queryParams.current = 1;
+      this.getList();
     },
     // 导出
     handleDownload() {
+      getOperationLogExport(this.queryParams).then(res=>{
 
+      })
     },
   },
 };

+ 2 - 0
src/components/permissions/role/index.vue

@@ -102,11 +102,13 @@ export default {
       })
     },
     handleQuery() {
+      this.queryParams.current = 1;
       this.getList();
     },
     // 重置
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.current = 1;
       this.getList()
     },
   },

+ 2 - 0
src/components/permissions/user/index.vue

@@ -368,6 +368,7 @@ export default {
       });
     },
     handleQuery() {
+      this.queryParams.current = 1;
       this.getList();
     },
     // 查询条件地区选择
@@ -377,6 +378,7 @@ export default {
     // 重置
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.current = 1;
       this.getList();
     },
     handleSelectionChange(val) {