From ddcd1fc431bcf4a3289a47b8dab6403564797461 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 24 十二月 2025 09:01:39 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 utils/common.js |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/utils/common.js b/utils/common.js
index dc857f6..90a457e 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -459,6 +459,37 @@
             return handler(key, match);
         });
     }
+    
+    fieldListFilterRole({FieldList, ExcludeKeys = [] ,RoleList = null}) {
+        if(!RoleList) {
+            RoleList = [
+                /^[a-zA-Z]+$/,
+                /\bid$/i
+            ]
+        }
+        if(!Array.isArray(RoleList)){
+            return {
+                status: false,
+                data: null,
+                Message: "杩囨护瀛楁鍒楄〃澶辫触锛岃鍒欏繀椤绘槸鏁扮粍銆�"
+            }
+        }
+        
+        let FieldListCache = Array(FieldList)
+        
+        let list1 = FieldListCache.filter(elem => role[0].test(elem.ColmCols))
+        console.log('list1: ',list1);
+        // RoleList.forEach(role => {
+        //     console.log(FieldListCache.filter(field => !role.test(field.ColmCols)))
+        //     FieldListCache = FieldListCache.filter(field => !role.test(field.ColmCols))
+        // })
+        
+        return {
+            status: true,
+            data: FieldListCache,
+            Message: ""
+        }
+    }
 }
 
 export const CommonUtils = new commonUtils()
\ No newline at end of file

--
Gitblit v1.9.1