From 39caa09d1aecac31c94cb24f679f60a024241da6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com>
Date: Tue, 16 Jul 2024 20:00:05 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E6=93=8D?=
=?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/model/user.js | 7 +++
src/views/userCenter/user/logs.vue | 87 +++++++++++++++++++++---------
2 files changed, 69 insertions(+), 25 deletions(-)
diff --git a/src/api/model/user.js b/src/api/model/user.js
index 6cdf90a..c333644 100644
--- a/src/api/model/user.js
+++ b/src/api/model/user.js
@@ -86,6 +86,13 @@ export default {
return await http.post(this.url, params);
},
},
+ log:{
+ url: `${config.API_URL}/user.log.list`,
+ name: "用户操作日志",
+ get: async function (params) {
+ return await http.post(this.url, params);
+ },
+ },
subscribe:{
list:{
url: `${config.API_URL}/messages.subscribe.list`,
diff --git a/src/views/userCenter/user/logs.vue b/src/views/userCenter/user/logs.vue
index c0363a8..24bffb5 100644
--- a/src/views/userCenter/user/logs.vue
+++ b/src/views/userCenter/user/logs.vue
@@ -1,15 +1,18 @@
-
-
-
-
-
-
- 成功
-
-
+
+
+
+
+
+
+
@@ -17,24 +20,58 @@
export default {
data() {
return {
- data: [
- {
- title: "修改用户 lolowan",
- ip: "211.187.11.18",
- code: "成功",
- time: "2022-10-10 08:41:17"
- },
- {
- title: "用户登录",
- ip: "211.187.11.18",
- code: "成功",
- time: "2022-10-10 08:21:51"
- }
- ]
+ size:"small",
+ list:{
+ apiObj: this.$API.user.log,
+ column: [],
+ },
+
+ searchList:[
+ {name:'操作日期',type:'date',code:'created_at'},
+ {name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true},
+ {name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true},
+ ],
+ params: {},
}
+ },
+ mounted() {
+
+ },
+ methods:{
+ getSelectData(item){
+ let {data,params} = item;
+ this.params = params;
+ if(data.code == "type"){
+ this.getTypeList(data,params)
+ }
+ },
+ async getTypeList(data,params) {
+ const res = await this.$API.system.log.operation.post(params);
+ if(res.code == 200){
+ res.data.forEach(item=>{
+ item.id = item.type;
+ item.label = item.log_title;
+ })
+ this.searchList.forEach(item=>{
+ if(item.code == data.code){
+ item.data = res.data;
+ }
+ })
+ }
+ },
+
+ upSearch(){
+ this.$refs.table.upData(this.params);
+ },
+ reset(){
+ this.params = {};
+ this.$refs.scSearch.reload();
+ this.$refs.table.reload();
+ },
}
}
-