From 2103a99b803a34c1284acb20917e86f1625b117e Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期二, 22 四月 2025 17:32:11 +0800
Subject: [PATCH] 增加列表按钮权限控制

---
 src/utils/authFilter.js      |   25 +++++++++++++++++++++++++
 src/mixins/JeecgListMixin.js |    3 +++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js
index 2fa306f..b2a2972 100644
--- a/src/mixins/JeecgListMixin.js
+++ b/src/mixins/JeecgListMixin.js
@@ -78,6 +78,9 @@
     }
   },
   methods:{
+    isShowAuth(code){
+      return buttonShowAuthFilter(code);
+    },
     loadData(arg) {
       if(!this.url.list){
         this.$message.error("璇疯缃畊rl.list灞炴��!")
diff --git a/src/utils/authFilter.js b/src/utils/authFilter.js
index ed910bb..447965f 100644
--- a/src/utils/authFilter.js
+++ b/src/utils/authFilter.js
@@ -274,4 +274,29 @@
 
 function substrPre(str,pre) {
   return str.substr(pre.length);
+}
+/**
+ * 鏄剧ず鏉冮檺
+ * @param {*} code
+ * @returns
+ */
+export function buttonShowAuthFilter(code) {
+  if(code){
+    if(nodeShowAuth(code)){
+      return true;
+    }else{
+      return false;
+    }
+  }else{
+    return false;
+  }
+}
+function nodeShowAuth(code){
+  let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
+  for (let auth of authList) {
+    if(auth.action == code) {
+      return true;
+    }
+  }
+  return false;
 }
\ No newline at end of file

--
Gitblit v1.9.3