From 657b67ff21e0389b75aea7ee547aec2fbcb35bf3 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 02 二月 2026 17:24:26 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
utils/common.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/utils/common.js b/utils/common.js
index c4778dc..6905022 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -312,10 +312,9 @@
method,
}) {
if (this.requestLock) {
- console.warn("璇ヨ姹傝閿佸畾,涓嶈兘閲嶅璇锋眰!!!")
+ console.log("璇ヨ姹傝閿佸畾,涓嶈兘閲嶅璇锋眰!!!")
return
}
-
this.requestLock = true
return new Promise((resolve, reject) => {
// that = that || this;
@@ -341,7 +340,7 @@
})
})
}
-
+ //娌℃湁娣诲姞閿佺殑寮傛鏌ヨ
async doRequest2Async({
url,
data,
@@ -393,9 +392,10 @@
console.log(res.errCode);
});
innerAudioContext.onPause(function() {
- console.log('鎾斁鍑虹幇閿欒锛岄攢姣�');
+ console.log('鎾斁鏆傚仠锛岄攢姣�');
innerAudioContext.destroy();
- })
+ });
+
}
// playSound(e) {
// // 鍏ㄥ眬缁存姢涓�涓煶棰戝疄渚嬶紝闃叉缂撳瓨婧㈠嚭
@@ -459,6 +459,55 @@
return handler(key, match);
});
}
+
+ fieldListFilterRole({FieldList, ExcludeKeys = [] ,RoleList = null}) {
+ if(!RoleList) {
+ RoleList = [
+ /^[a-zA-Z]+$/,
+ /id$/i
+ ]
+ }
+ if(!Array.isArray(RoleList)){
+ return {
+ status: false,
+ data: null,
+ Message: "杩囨护瀛楁鍒楄〃澶辫触锛岃鍒欏繀椤绘槸鏁扮粍銆�"
+ }
+ }
+
+ let FieldListCache = Array(...FieldList)
+
+ RoleList.forEach(role => {
+ FieldListCache = FieldListCache.filter(elem => !role.test(elem.ColmCols))
+ })
+
+ FieldListCache = FieldListCache.filter(elem => !ExcludeKeys.includes(elem.ColmCols))
+ return {
+ status: true,
+ data: FieldListCache,
+ Message: ""
+ }
+ }
+
+ emptyValueFilter(item, fieldList){
+ return fieldList.filter(e => {
+ return item[e.ColmCols]
+ })
+ }
+
+ httpFormatWs(httpUrl=this.serverUrl) {
+ if(httpUrl.indexOf("http://") === 0){
+ httpUrl = httpUrl.replace("http://", "")
+ httpUrl = "ws://" + httpUrl.split(":")[0]+":8089/ws"
+ }else if(httpUrl.indexOf("https://") === 0) {
+ httpUrl = httpUrl.replace("https://", "")
+ httpUrl = "wss://" + httpUrl.split(":")[0]+":8089/ws"
+ }else{
+ // 鎻愮ず浼犲叆杩炴帴閿欒
+ }
+
+ return httpUrl
+ }
}
export const CommonUtils = new commonUtils()
\ No newline at end of file
--
Gitblit v1.9.1