@das-fed/upf-utils 6.4.0-dev.186 → 6.4.0-dev.188

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 (40) hide show
  1. package/api-services/es5.js +912 -914
  2. package/api-services/index.js +673 -677
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +968 -980
  5. package/api-services/modules/app-manage/index.js +786 -804
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +968 -980
  8. package/api-services/modules/authentication/index.js +786 -804
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +996 -984
  11. package/api-services/modules/bems/index.js +818 -800
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/contract/es5.js +969 -978
  14. package/api-services/modules/contract/index.js +788 -802
  15. package/api-services/modules/contract/index.js.gz +0 -0
  16. package/api-services/modules/duty-manage/es5.js +991 -982
  17. package/api-services/modules/duty-manage/index.js +815 -801
  18. package/api-services/modules/duty-manage/index.js.gz +0 -0
  19. package/api-services/modules/enterpriseright/es5.js +798 -801
  20. package/api-services/modules/enterpriseright/index.js +617 -621
  21. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  22. package/api-services/modules/es5.js +1155 -1164
  23. package/api-services/modules/index.js +907 -921
  24. package/api-services/modules/index.js.gz +0 -0
  25. package/api-services/modules/justauth/es5.js +982 -970
  26. package/api-services/modules/justauth/index.js +805 -787
  27. package/api-services/modules/justauth/index.js.gz +0 -0
  28. package/api-services/modules/portal/es5.js +980 -968
  29. package/api-services/modules/portal/index.js +804 -786
  30. package/api-services/modules/portal/index.js.gz +0 -0
  31. package/api-services/modules/space-manage/es5.js +980 -968
  32. package/api-services/modules/space-manage/index.js +804 -786
  33. package/api-services/modules/space-manage/index.js.gz +0 -0
  34. package/api-services/src/create-service/es5.js +978 -966
  35. package/api-services/src/create-service/index.js +803 -785
  36. package/api-services/src/create-service/index.js.gz +0 -0
  37. package/common-tools/handle-data/es5.js +156 -185
  38. package/common-tools/handle-data/index.js +106 -87
  39. package/common-tools/handle-data/index.js.gz +0 -0
  40. package/package.json +4 -4
@@ -1,130 +1,149 @@
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 || {};
1
+ import { getConfig as _ } from "@das-fed/upf-utils/config";
2
+ const M = (f) => f === null || typeof f > "u" || f === "", z = (f) => {
3
+ var n;
4
+ return (((n = _()) == null ? void 0 : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
5
+ }, A = async (f) => {
6
+ const x = f || {};
7
7
  let {
8
- currentLang: t = "zh-CN",
9
- baseUrl: o = "/",
10
- appName: g = "jc",
11
- isPullFrontEnd: _ = !0,
8
+ currentLang: n = "zh-CN",
9
+ baseUrl: c = "/",
10
+ appName: h = "jc",
11
+ isPullFrontEnd: L = !0,
12
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 = {
13
+ isDasUI: O = !1,
14
+ fallbackBaseUrl: a = ""
15
+ } = x;
16
+ (typeof n != "string" || !n) && (n = "zh-CN");
17
+ let l = [];
18
+ Array.isArray(h) ? (l = h.filter((r) => typeof r == "string" && r), l.length === 0 && (l = ["jc"])) : typeof h == "string" && h ? l = [h] : l = ["jc"], typeof c != "string" && (c = "/"), c || (c = "/"), c.endsWith("/") || (c = c + "/"), typeof a != "string" && (a = ""), a && !a.endsWith("/") && (a = a + "/");
19
+ const y = {
20
20
  frontEnd: null,
21
21
  // 统一格式:{ appName1: data1, appName2: data2, ... }
22
22
  dasUiEnd: null,
23
23
  backMsg: null
24
24
  // 统一格式:{ appName1: data1, appName2: data2, ... }
25
25
  };
26
- let w = !1;
27
- const k = async (a, s, h = "zh-CN", $ = "资源") => {
28
- const u = async (l) => {
26
+ let m = !1;
27
+ const j = async (r, s, $ = "zh-CN", w = "资源") => {
28
+ const u = async (i) => {
29
29
  try {
30
30
  if (typeof window < "u" && typeof window.fetch == "function") {
31
- const n = await window.fetch(l, { cache: "no-cache" });
32
- return !n || !n.ok ? null : await n.text();
31
+ const o = await window.fetch(i, { cache: "no-cache" });
32
+ return !o || !o.ok ? null : await o.text();
33
33
  } else
34
- return await new Promise((n) => {
34
+ return await new Promise((o) => {
35
35
  try {
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();
36
+ const t = new XMLHttpRequest();
37
+ t.open("GET", i, !0), t.onreadystatechange = function() {
38
+ t.readyState === 4 && o(t.status >= 200 && t.status < 300 ? t.responseText : null);
39
+ }, t.onerror = function() {
40
+ o(null);
41
+ }, t.send();
42
42
  } catch {
43
- n(null);
43
+ o(null);
44
44
  }
45
45
  });
46
46
  } catch {
47
47
  return null;
48
48
  }
49
- }, C = (l) => {
50
- const n = (l || "").replace(/^\uFEFF/, "");
49
+ }, F = (i) => {
50
+ if (!i || typeof i != "string")
51
+ return null;
52
+ const t = i.replace(/^\uFEFF/, "").trim();
53
+ if (t.startsWith("{"))
54
+ try {
55
+ const e = JSON.parse(t);
56
+ if (e && typeof e == "object")
57
+ return e;
58
+ } catch {
59
+ }
60
+ const b = t.match(/export\s+default\s*/);
61
+ if (!b || b.index === void 0)
62
+ return null;
51
63
  try {
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);
64
+ let e = t.substring(b.index);
65
+ if (e = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1").trim(), e = e.replace(/^\s*export\s+default\s*/, "").replace(/;?\s*$/, "").trim(), !e)
66
+ return null;
67
+ try {
68
+ const d = new Function(`return ${e}`)();
69
+ if (d && typeof d == "object")
70
+ return d;
71
+ } catch {
72
+ }
73
+ try {
74
+ const g = e.indexOf("{"), d = e.lastIndexOf("}");
75
+ if (g === -1 || d === -1 || d <= g)
76
+ return null;
77
+ let p = e.slice(g, d + 1);
78
+ p = p.replace(
79
+ /([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g,
80
+ '$1"$2":'
81
+ ), p = p.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, '"$1"'), p = p.replace(/,\s*([}\]])/g, "$1");
82
+ const E = JSON.parse(p);
83
+ if (E && typeof E == "object")
84
+ return E;
85
+ } catch {
58
86
  }
87
+ return null;
59
88
  } catch {
60
89
  return null;
61
90
  }
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)
66
- return i.ok ? i.value ?? null : 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;
74
- })();
75
- m.set(n, p);
76
- try {
77
- return await p;
78
- } finally {
79
- m.delete(n);
80
- }
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;
91
+ }, U = async (i) => {
92
+ if (!i) return null;
93
+ const o = await u(i);
94
+ if (!o)
95
+ return null;
96
+ const t = F(o);
97
+ return t !== null && typeof t == "object" ? t : null;
98
+ }, k = await U(r);
99
+ if (k)
100
+ return k;
101
+ if (s && z($)) {
102
+ const i = await U(s);
103
+ if (i)
104
+ return i;
86
105
  }
87
106
  return null;
88
107
  };
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,
108
+ if (L) {
109
+ const r = {};
110
+ for (const s of l) {
111
+ const $ = `${c}front-end/i18n/front-end-page/${s}_${n}.js`, w = a ? `${a}front-end/i18n/front-end-page/${s}_${n}.js` : void 0, u = await j(
94
112
  $,
95
- t,
113
+ w,
114
+ n,
96
115
  `前端业务语言资源(${s})`
97
116
  );
98
- u && (a[s] = u, w = !0);
117
+ u && (r[s] = u, m = !0);
99
118
  }
100
- Object.keys(a).length > 0 && (d.frontEnd = a);
119
+ Object.keys(r).length > 0 && (y.frontEnd = r);
101
120
  }
102
121
  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,
122
+ const r = {};
123
+ for (const s of l) {
124
+ const $ = `${c}front-end/i18n/return-msg/${s}_${n}.js`, w = a ? `${a}front-end/i18n/return-msg/${s}_${n}.js` : void 0, u = await j(
107
125
  $,
108
- t,
126
+ w,
127
+ n,
109
128
  `后端语言资源(${s})`
110
129
  );
111
- u && (a[s] = u, w = !0);
130
+ u && (r[s] = u, m = !0);
112
131
  }
113
- Object.keys(a).length > 0 && (d.backMsg = a);
132
+ Object.keys(r).length > 0 && (y.backMsg = r);
114
133
  }
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,
134
+ if (O) {
135
+ const r = `${c}front-end/i18n/front-end-page/dasui_${n}.js`, s = a ? `${a}front-end/i18n/front-end-page/dasui_${n}.js` : void 0;
136
+ y.dasUiEnd = await j(
137
+ r,
119
138
  s,
120
- t,
139
+ n,
121
140
  "UI组件库语言资源"
122
- ), d.dasUiEnd && (w = !0);
141
+ ), y.dasUiEnd && (m = !0);
123
142
  }
124
- return d;
143
+ return y;
125
144
  };
126
145
  export {
127
- S as handleI18nData,
128
- O as isCurrentLangInSysLang,
129
- F as isEmpty
146
+ A as handleI18nData,
147
+ z as isCurrentLangInSysLang,
148
+ M as isEmpty
130
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/upf-utils",
3
- "version": "6.4.0-dev.186",
3
+ "version": "6.4.0-dev.188",
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.186",
12
+ "@das-fed/upf-utils": "6.4.0-dev.188",
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.186",
26
- "@das-fed/upf-web": "6.4.0-dev.186",
25
+ "@das-fed/upf-cli": "6.4.0-dev.188",
26
+ "@das-fed/upf-web": "6.4.0-dev.188",
27
27
  "@rollup/plugin-babel": "6.0.4",
28
28
  "@types/js-cookie": "^3.0.6",
29
29
  "@types/lodash-es": "^4.17.12",