@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.
Files changed (57) hide show
  1. package/api-services/es5.js +946 -943
  2. package/api-services/index.js +704 -700
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/bems/es5.js +994 -984
  5. package/api-services/modules/bems/index.js +813 -799
  6. package/api-services/modules/bems/index.js.gz +0 -0
  7. package/api-services/modules/duty-manage/es5.js +991 -982
  8. package/api-services/modules/duty-manage/index.js +815 -801
  9. package/api-services/modules/duty-manage/index.js.gz +0 -0
  10. package/api-services/modules/enterpriseright/es5.js +980 -968
  11. package/api-services/modules/enterpriseright/index.js +804 -786
  12. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  13. package/api-services/modules/file/es5.js +1103 -1091
  14. package/api-services/modules/file/index.js +900 -882
  15. package/api-services/modules/file/index.js.gz +0 -0
  16. package/api-services/modules/gateway-edge/es5.js +980 -968
  17. package/api-services/modules/gateway-edge/index.js +804 -786
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/iot/es5.js +974 -962
  20. package/api-services/modules/iot/index.js +798 -780
  21. package/api-services/modules/iot/index.js.gz +0 -0
  22. package/api-services/modules/justauth/es5.js +970 -982
  23. package/api-services/modules/justauth/index.js +787 -805
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/es5.js +968 -980
  26. package/api-services/modules/knowledge/index.js +786 -804
  27. package/api-services/modules/knowledge/index.js.gz +0 -0
  28. package/api-services/modules/link/es5.js +968 -980
  29. package/api-services/modules/link/index.js +786 -804
  30. package/api-services/modules/link/index.js.gz +0 -0
  31. package/api-services/modules/permission/es5.js +801 -798
  32. package/api-services/modules/permission/index.js +621 -617
  33. package/api-services/modules/permission/index.js.gz +0 -0
  34. package/api-services/modules/platformManage/es5.js +960 -972
  35. package/api-services/modules/platformManage/index.js +777 -795
  36. package/api-services/modules/platformManage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/es5.js +984 -996
  38. package/api-services/modules/super-admin/index.js +799 -817
  39. package/api-services/modules/super-admin/index.js.gz +0 -0
  40. package/api-services/modules/supplier/es5.js +1002 -990
  41. package/api-services/modules/supplier/index.js +822 -804
  42. package/api-services/modules/supplier/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/es5.js +980 -968
  44. package/api-services/modules/systemConfiguration/index.js +804 -786
  45. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  46. package/api-services/modules/tool/es5.js +968 -980
  47. package/api-services/modules/tool/index.js +786 -804
  48. package/api-services/modules/tool/index.js.gz +0 -0
  49. package/api-services/src/create-service/es5.js +966 -978
  50. package/api-services/src/create-service/index.js +785 -803
  51. package/api-services/src/create-service/index.js.gz +0 -0
  52. package/common-tools/handle-data/es5.js +179 -148
  53. package/common-tools/handle-data/index.d.ts +7 -4
  54. package/common-tools/handle-data/index.js +98 -83
  55. package/common-tools/handle-data/index.js.gz +0 -0
  56. package/esm-map.json +0 -1
  57. package/package.json +4 -4
@@ -1,115 +1,130 @@
1
- import { getConfig as N } from "@das-fed/upf-utils/config";
2
- const h = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), S = 3e5, b = (l) => l === null || typeof l > "u" || l === "", z = (l) => {
3
- var e;
4
- return (((e = N()) == null ? void 0 : e.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(l);
5
- }, B = async (l) => {
6
- const y = l || {};
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: e = "zh-CN",
9
- baseUrl: r = "/",
10
- appName: c = "jc",
11
- isPullBack: _ = !1,
12
- isDasUI: L = !1,
13
- urlObj: n = { frontEndUrl: "", backEndUrl: "", dasUiUrl: "" },
14
- // 新增:当主地址加载失败时,用于针对失败项的本地回退地址
15
- fallbackBaseUrl: s = ""
16
- } = y;
17
- (typeof e != "string" || !e) && (e = "zh-CN"), (typeof c != "string" || !c) && (c = "jc"), typeof r != "string" && (r = "/"), r || (r = "/"), r.endsWith("/") || (r = r + "/"), typeof s != "string" && (s = ""), s && !s.endsWith("/") && (s = s + "/");
18
- const f = {
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 U = !1;
24
- const w = async (g, d, I = "zh-CN", F = "资源") => {
25
- const M = async (o) => {
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 t = await window.fetch(o, { cache: "no-cache" });
29
- return !t || !t.ok ? null : await t.text();
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((t) => {
34
+ return await new Promise((n) => {
32
35
  try {
33
- const a = new XMLHttpRequest();
34
- a.open("GET", o, !0), a.onreadystatechange = function() {
35
- a.readyState === 4 && t(a.status >= 200 && a.status < 300 ? a.responseText : null);
36
- }, a.onerror = function() {
37
- t(null);
38
- }, a.send();
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
- t(null);
43
+ n(null);
41
44
  }
42
45
  });
43
46
  } catch {
44
47
  return null;
45
48
  }
46
- }, D = (o) => {
47
- const t = (o || "").replace(/^\uFEFF/, "");
49
+ }, C = (l) => {
50
+ const n = (l || "").replace(/^\uFEFF/, "");
48
51
  try {
49
- const a = t.trim();
50
- if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(a)) {
51
- let i = a.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
52
- const u = i.indexOf("{"), p = i.lastIndexOf("}");
53
- if (u !== -1 && p !== -1 && p > u)
54
- return i = i.slice(u, p + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
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
- }, E = async (o) => {
60
- if (!o) return null;
61
- const t = o, a = Date.now(), i = $.get(t);
62
- if (i && a - i.t <= S)
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 (h.has(t)) return h.get(t);
65
- const u = (async () => {
66
- const p = await M(t);
67
- if (!p)
68
- return $.set(t, { ok: !1, value: null, t: a }), null;
69
- const m = D(p);
70
- return $.set(t, { ok: !0, value: m, t: Date.now() }), m ?? null;
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
- h.set(t, u);
75
+ m.set(n, p);
73
76
  try {
74
- return await u;
77
+ return await p;
75
78
  } finally {
76
- h.delete(t);
79
+ m.delete(n);
77
80
  }
78
- }, k = await E(g);
79
- if (k) return k;
80
- if (d && z(I)) {
81
- const o = await E(d);
82
- if (o) return o;
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
- }, x = (n == null ? void 0 : n.frontEndUrl) || `${r}front-end/i18n/front-end-page/${c}_${e}.js`;
86
- let C = !(n != null && n.frontEndUrl) && s ? `${s}front-end/i18n/front-end-page/${c}_${e}.js` : void 0;
87
- if (f.frontEnd = await w(
88
- x,
89
- C,
90
- e,
91
- "前端业务语言资源"
92
- ), f.frontEnd && (U = !0), _ && f.frontEnd || n != null && n.backEndUrl) {
93
- const g = (n == null ? void 0 : n.backEndUrl) || `${r}front-end/i18n/return-msg/${c}_${e}.js`;
94
- let d = !(n != null && n.backEndUrl) && s ? `${s}front-end/i18n/return-msg/${c}_${e}.js` : void 0;
95
- f.backMsg = await w(g, d, e, "后端语言资源"), f.backMsg && (U = !0);
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 (L) {
98
- const g = (n == null ? void 0 : n.dasUiUrl) || `${r}front-end/i18n/front-end-page/dasui_${e}.js`;
99
- let d = !(n != null && n.dasUiUrl) && s ? `${s}front-end/i18n/front-end-page/dasui_${e}.js` : void 0;
100
- f.dasUiEnd = await w(g, d, e, "UI组件库语言资源"), f.dasUiEnd && (U = !0);
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 f;
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
- P as handleGlobalI18n,
112
- B as handleI18nData,
113
- z as isCurrentLangInSysLang,
114
- b as isEmpty
127
+ S as handleI18nData,
128
+ O as isCurrentLangInSysLang,
129
+ F as isEmpty
115
130
  };
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.183",
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.183",
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.183",
26
- "@das-fed/upf-web": "6.4.0-dev.183",
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",