@das-fed/upf-utils 6.4.0-dev.183 → 6.4.0-dev.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services/es5.js +946 -943
- package/api-services/index.js +704 -700
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +994 -984
- package/api-services/modules/bems/index.js +813 -799
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +991 -982
- package/api-services/modules/duty-manage/index.js +815 -801
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +980 -968
- package/api-services/modules/enterpriseright/index.js +804 -786
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/es5.js +1103 -1091
- package/api-services/modules/file/index.js +900 -882
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +980 -968
- package/api-services/modules/gateway-edge/index.js +804 -786
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +974 -962
- package/api-services/modules/iot/index.js +798 -780
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +970 -982
- package/api-services/modules/justauth/index.js +787 -805
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +968 -980
- package/api-services/modules/knowledge/index.js +786 -804
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +968 -980
- package/api-services/modules/link/index.js +786 -804
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +801 -798
- package/api-services/modules/permission/index.js +621 -617
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +960 -972
- package/api-services/modules/platformManage/index.js +777 -795
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +984 -996
- package/api-services/modules/super-admin/index.js +799 -817
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1002 -990
- package/api-services/modules/supplier/index.js +822 -804
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +980 -968
- package/api-services/modules/systemConfiguration/index.js +804 -786
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +968 -980
- package/api-services/modules/tool/index.js +786 -804
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +966 -978
- package/api-services/src/create-service/index.js +785 -803
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-tools/handle-data/es5.js +179 -148
- package/common-tools/handle-data/index.d.ts +7 -4
- package/common-tools/handle-data/index.js +98 -83
- package/common-tools/handle-data/index.js.gz +0 -0
- package/esm-map.json +0 -1
- package/package.json +4 -4
|
@@ -1,115 +1,130 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
return (((
|
|
5
|
-
},
|
|
6
|
-
const
|
|
1
|
+
import { getConfig as I } from "@das-fed/upf-utils/config";
|
|
2
|
+
const m = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), M = 3e5, F = (c) => c === null || typeof c > "u" || c === "", O = (c) => {
|
|
3
|
+
var t;
|
|
4
|
+
return (((t = I()) == null ? void 0 : t.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(c);
|
|
5
|
+
}, S = async (c) => {
|
|
6
|
+
const U = c || {};
|
|
7
7
|
let {
|
|
8
|
-
currentLang:
|
|
9
|
-
baseUrl:
|
|
10
|
-
appName:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
currentLang: t = "zh-CN",
|
|
9
|
+
baseUrl: o = "/",
|
|
10
|
+
appName: g = "jc",
|
|
11
|
+
isPullFrontEnd: _ = !0,
|
|
12
|
+
isPullBack: N = !1,
|
|
13
|
+
isDasUI: x = !1,
|
|
14
|
+
fallbackBaseUrl: r = ""
|
|
15
|
+
} = U;
|
|
16
|
+
(typeof t != "string" || !t) && (t = "zh-CN");
|
|
17
|
+
let f = [];
|
|
18
|
+
Array.isArray(g) ? (f = g.filter((a) => typeof a == "string" && a), f.length === 0 && (f = ["jc"])) : typeof g == "string" && g ? f = [g] : f = ["jc"], typeof o != "string" && (o = "/"), o || (o = "/"), o.endsWith("/") || (o = o + "/"), typeof r != "string" && (r = ""), r && !r.endsWith("/") && (r = r + "/");
|
|
19
|
+
const d = {
|
|
19
20
|
frontEnd: null,
|
|
21
|
+
// 统一格式:{ appName1: data1, appName2: data2, ... }
|
|
20
22
|
dasUiEnd: null,
|
|
21
23
|
backMsg: null
|
|
24
|
+
// 统一格式:{ appName1: data1, appName2: data2, ... }
|
|
22
25
|
};
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
+
let w = !1;
|
|
27
|
+
const k = async (a, s, h = "zh-CN", $ = "资源") => {
|
|
28
|
+
const u = async (l) => {
|
|
26
29
|
try {
|
|
27
30
|
if (typeof window < "u" && typeof window.fetch == "function") {
|
|
28
|
-
const
|
|
29
|
-
return !
|
|
31
|
+
const n = await window.fetch(l, { cache: "no-cache" });
|
|
32
|
+
return !n || !n.ok ? null : await n.text();
|
|
30
33
|
} else
|
|
31
|
-
return await new Promise((
|
|
34
|
+
return await new Promise((n) => {
|
|
32
35
|
try {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
36
|
+
const e = new XMLHttpRequest();
|
|
37
|
+
e.open("GET", l, !0), e.onreadystatechange = function() {
|
|
38
|
+
e.readyState === 4 && n(e.status >= 200 && e.status < 300 ? e.responseText : null);
|
|
39
|
+
}, e.onerror = function() {
|
|
40
|
+
n(null);
|
|
41
|
+
}, e.send();
|
|
39
42
|
} catch {
|
|
40
|
-
|
|
43
|
+
n(null);
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
46
|
} catch {
|
|
44
47
|
return null;
|
|
45
48
|
}
|
|
46
|
-
},
|
|
47
|
-
const
|
|
49
|
+
}, C = (l) => {
|
|
50
|
+
const n = (l || "").replace(/^\uFEFF/, "");
|
|
48
51
|
try {
|
|
49
|
-
const
|
|
50
|
-
if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(
|
|
51
|
-
let i =
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
return i = i.slice(
|
|
52
|
+
const e = n.trim();
|
|
53
|
+
if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(e)) {
|
|
54
|
+
let i = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
|
|
55
|
+
const p = i.indexOf("{"), y = i.lastIndexOf("}");
|
|
56
|
+
if (p !== -1 && y !== -1 && y > p)
|
|
57
|
+
return i = i.slice(p, y + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
|
|
55
58
|
}
|
|
56
59
|
} catch {
|
|
57
60
|
return null;
|
|
58
61
|
}
|
|
59
|
-
},
|
|
60
|
-
if (!
|
|
61
|
-
const
|
|
62
|
-
if (i &&
|
|
62
|
+
}, b = async (l) => {
|
|
63
|
+
if (!l) return null;
|
|
64
|
+
const n = l, e = Date.now(), i = E.get(n);
|
|
65
|
+
if (i && e - i.t <= M)
|
|
63
66
|
return i.ok ? i.value ?? null : null;
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
return
|
|
69
|
-
const
|
|
70
|
-
return
|
|
67
|
+
if (m.has(n)) return m.get(n);
|
|
68
|
+
const p = (async () => {
|
|
69
|
+
const y = await u(n);
|
|
70
|
+
if (!y)
|
|
71
|
+
return E.set(n, { ok: !1, value: null, t: e }), null;
|
|
72
|
+
const L = C(y);
|
|
73
|
+
return E.set(n, { ok: !0, value: L, t: Date.now() }), L ?? null;
|
|
71
74
|
})();
|
|
72
|
-
|
|
75
|
+
m.set(n, p);
|
|
73
76
|
try {
|
|
74
|
-
return await
|
|
77
|
+
return await p;
|
|
75
78
|
} finally {
|
|
76
|
-
|
|
79
|
+
m.delete(n);
|
|
77
80
|
}
|
|
78
|
-
},
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
81
|
+
}, j = await b(a);
|
|
82
|
+
if (j) return j;
|
|
83
|
+
if (s && O(h)) {
|
|
84
|
+
const l = await b(s);
|
|
85
|
+
if (l) return l;
|
|
83
86
|
}
|
|
84
87
|
return null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
};
|
|
89
|
+
if (_) {
|
|
90
|
+
const a = {};
|
|
91
|
+
for (const s of f) {
|
|
92
|
+
const h = `${o}front-end/i18n/front-end-page/${s}_${t}.js`, $ = r ? `${r}front-end/i18n/front-end-page/${s}_${t}.js` : void 0, u = await k(
|
|
93
|
+
h,
|
|
94
|
+
$,
|
|
95
|
+
t,
|
|
96
|
+
`前端业务语言资源(${s})`
|
|
97
|
+
);
|
|
98
|
+
u && (a[s] = u, w = !0);
|
|
99
|
+
}
|
|
100
|
+
Object.keys(a).length > 0 && (d.frontEnd = a);
|
|
101
|
+
}
|
|
102
|
+
if (N) {
|
|
103
|
+
const a = {};
|
|
104
|
+
for (const s of f) {
|
|
105
|
+
const h = `${o}front-end/i18n/return-msg/${s}_${t}.js`, $ = r ? `${r}front-end/i18n/return-msg/${s}_${t}.js` : void 0, u = await k(
|
|
106
|
+
h,
|
|
107
|
+
$,
|
|
108
|
+
t,
|
|
109
|
+
`后端语言资源(${s})`
|
|
110
|
+
);
|
|
111
|
+
u && (a[s] = u, w = !0);
|
|
112
|
+
}
|
|
113
|
+
Object.keys(a).length > 0 && (d.backMsg = a);
|
|
96
114
|
}
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
115
|
+
if (x) {
|
|
116
|
+
const a = `${o}front-end/i18n/front-end-page/dasui_${t}.js`, s = r ? `${r}front-end/i18n/front-end-page/dasui_${t}.js` : void 0;
|
|
117
|
+
d.dasUiEnd = await k(
|
|
118
|
+
a,
|
|
119
|
+
s,
|
|
120
|
+
t,
|
|
121
|
+
"UI组件库语言资源"
|
|
122
|
+
), d.dasUiEnd && (w = !0);
|
|
101
123
|
}
|
|
102
|
-
return
|
|
103
|
-
}, P = async (l = "front-end") => {
|
|
104
|
-
let y = {}, r = await import(
|
|
105
|
-
/* @vite-ignore */
|
|
106
|
-
`/i18n/${l}/global.js`
|
|
107
|
-
);
|
|
108
|
-
return y = (r == null ? void 0 : r.default) || {}, y;
|
|
124
|
+
return d;
|
|
109
125
|
};
|
|
110
126
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
b as isEmpty
|
|
127
|
+
S as handleI18nData,
|
|
128
|
+
O as isCurrentLangInSysLang,
|
|
129
|
+
F as isEmpty
|
|
115
130
|
};
|
|
Binary file
|
package/esm-map.json
CHANGED
|
@@ -143,7 +143,6 @@
|
|
|
143
143
|
"getFileExtension": "/common-tools/get-file-extension/index",
|
|
144
144
|
"getLanguages": "/common-info/index",
|
|
145
145
|
"handleI18nData": "/common-tools/handle-data/index",
|
|
146
|
-
"handleGlobalI18n": "/common-tools/handle-data/index",
|
|
147
146
|
"getToken": "/create-api-service/sso/index",
|
|
148
147
|
"getValidAccessToken": "/create-api-service/check-token/index",
|
|
149
148
|
"isCurrentLangInSysLang": "/common-tools/handle-data/index"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/upf-utils",
|
|
3
|
-
"version": "6.4.0-dev.
|
|
3
|
+
"version": "6.4.0-dev.185",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/upf-utils": "6.4.0-dev.
|
|
12
|
+
"@das-fed/upf-utils": "6.4.0-dev.185",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/preset-env": "7.26.0",
|
|
25
|
-
"@das-fed/upf-cli": "6.4.0-dev.
|
|
26
|
-
"@das-fed/upf-web": "6.4.0-dev.
|
|
25
|
+
"@das-fed/upf-cli": "6.4.0-dev.185",
|
|
26
|
+
"@das-fed/upf-web": "6.4.0-dev.185",
|
|
27
27
|
"@rollup/plugin-babel": "6.0.4",
|
|
28
28
|
"@types/js-cookie": "^3.0.6",
|
|
29
29
|
"@types/lodash-es": "^4.17.12",
|