@das-fed/upf-utils 6.4.0-dev.166 → 6.4.0-dev.168

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 (29) hide show
  1. package/api-services/index.js +903 -921
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +818 -836
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/bems/index.js +821 -839
  6. package/api-services/modules/bems/index.js.gz +0 -0
  7. package/api-services/modules/contract/index.js +818 -836
  8. package/api-services/modules/contract/index.js.gz +0 -0
  9. package/api-services/modules/enterpriseright/index.js +836 -818
  10. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  11. package/api-services/modules/gateway-edge/index.js +634 -630
  12. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  13. package/api-services/modules/justauth/index.js +819 -837
  14. package/api-services/modules/justauth/index.js.gz +0 -0
  15. package/api-services/modules/knowledge/index.js +836 -818
  16. package/api-services/modules/knowledge/index.js.gz +0 -0
  17. package/api-services/modules/super-admin/index.js +838 -820
  18. package/api-services/modules/super-admin/index.js.gz +0 -0
  19. package/api-services/modules/supplier/index.js +838 -820
  20. package/api-services/modules/supplier/index.js.gz +0 -0
  21. package/api-services/modules/supplychain-manage/index.js +818 -836
  22. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  23. package/api-services/modules/systemConfiguration/index.js +818 -836
  24. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  25. package/common-tools/handle-data/index.js +65 -38
  26. package/common-tools/handle-data/index.js.gz +0 -0
  27. package/create-api-service/index.js +788 -802
  28. package/create-api-service/index.js.gz +0 -0
  29. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- const b = (n) => n === null || typeof n > "u" || n === "", U = [
1
+ const k = (e) => e === null || typeof e > "u" || e === "", p = [
2
2
  "zh-CN",
3
3
  "zh-TW",
4
4
  "zh-HK",
@@ -15,7 +15,7 @@ const b = (n) => n === null || typeof n > "u" || n === "", U = [
15
15
  "nl-NL",
16
16
  "vi-VN",
17
17
  "tr-TR"
18
- ], c = {
18
+ ], u = {
19
19
  3: "zh-HK",
20
20
  4: "zh-TW",
21
21
  6: "ru-RU",
@@ -29,49 +29,76 @@ const b = (n) => n === null || typeof n > "u" || n === "", U = [
29
29
  14: "nl-NL",
30
30
  15: "vi-VN",
31
31
  16: "tr-TR"
32
- }, p = (n) => {
33
- const t = [...n, ...Object.values(c).filter((e) => n.includes(e))];
34
- return U.filter((e) => t.includes(e) || Object.entries(c).some(
35
- ([s, a]) => n.includes(s) && e === a || n.includes(a) && e === a
32
+ }, w = (e) => {
33
+ const c = [...e, ...Object.values(u).filter((t) => e.includes(t))];
34
+ return p.filter((t) => c.includes(t) || Object.entries(u).some(
35
+ ([a, s]) => e.includes(a) && t === s || e.includes(s) && t === s
36
36
  ));
37
- }, $ = ["zh-CN", "zh-MO", "en-US", "10"], m = async (n) => {
38
- try {
39
- let { currentLang: t = "zh-CN", baseUrl: e = "/", appName: s = "base", isPullBack: a = !1, urlObj: r = { frontEndUrl: "", backEndUrl: "" } } = n || {}, d = {
40
- frontEnd: null,
41
- backMsg: null
42
- }, u = (r == null ? void 0 : r.frontEndUrl) || `${e}web-front-end/i18n/${s}_${t}.js`, i = (r == null ? void 0 : r.backEndUrl) || `${e}web-back-end/i18n/${s}_${t}.js`;
43
- const f = await import(
44
- /* @vite-ignore */
45
- `${u}`
46
- );
47
- if (d.frontEnd = f.default || null, a || r != null && r.backEndUrl) {
48
- const l = await import(
37
+ }, b = ["zh-CN", "zh-MO", "en-US", "10"], g = async (e) => {
38
+ const c = e || {};
39
+ let {
40
+ currentLang: t = "zh-CN",
41
+ baseUrl: a = "/",
42
+ appName: s = "jc",
43
+ isPullBack: h = !1,
44
+ isDasUI: $ = !1,
45
+ urlObj: n = { frontEndUrl: "", backEndUrl: "", dasUiUrl: "" },
46
+ // 新增:当主地址加载失败时,用于针对失败项的本地回退地址
47
+ fallbackBaseUrl: r = ""
48
+ } = c;
49
+ (typeof t != "string" || !t) && (t = "zh-CN"), (typeof s != "string" || !s) && (s = "jc"), typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof r != "string" && (r = ""), r && !r.endsWith("/") && (r = r + "/");
50
+ const i = {
51
+ frontEnd: null,
52
+ dasUiEnd: null,
53
+ backMsg: null
54
+ };
55
+ let l = !1;
56
+ const E = async (o, d, y = "资源") => {
57
+ try {
58
+ const f = await import(
49
59
  /* @vite-ignore */
50
- `${i}`
60
+ `${o}`
51
61
  );
52
- d.backMsg = l.default || null;
62
+ return (f == null ? void 0 : f.default) ?? null;
63
+ } catch {
64
+ if (d)
65
+ try {
66
+ const U = await import(
67
+ /* @vite-ignore */
68
+ `${d}`
69
+ );
70
+ return (U == null ? void 0 : U.default) ?? null;
71
+ } catch {
72
+ }
73
+ return null;
53
74
  }
54
- const E = /* @__PURE__ */ Object.assign({});
55
- let h = `/node_modules/@das-fed/upf-ui/dist/web-front-end/i18n/dasui_${t}.js`;
56
- const o = E[h] || null;
57
- if (o) {
58
- let l = await o();
59
- d.frontEnd = { ...d.frontEnd, ...l.default };
60
- }
61
- return d;
62
- } catch {
75
+ };
76
+ {
77
+ const o = (n == null ? void 0 : n.frontEndUrl) || `${a}web-front-end/i18n/${s}_${t}.js`, d = !(n != null && n.frontEndUrl) && r ? `${r}web-front-end/i18n/${s}_${t}.js` : void 0;
78
+ i.frontEnd = await E(o, d, "前端业务语言资源"), i.frontEnd && (l = !0);
79
+ }
80
+ if (h && i.frontEnd || n != null && n.backEndUrl) {
81
+ const o = (n == null ? void 0 : n.backEndUrl) || `${a}web-back-end/i18n/${s}_${t}.js`, d = !(n != null && n.backEndUrl) && r ? `${r}web-back-end/i18n/${s}_${t}.js` : void 0;
82
+ i.backMsg = await E(o, d, "后端语言资源"), i.backMsg && (l = !0);
83
+ }
84
+ if ($) {
85
+ const o = (n == null ? void 0 : n.dasUiUrl) || `${a}web-front-end/i18n/dasui_${t}.js`, d = !(n != null && n.dasUiUrl) && r ? `${r}web-front-end/i18n/dasui_${t}.js` : void 0;
86
+ i.dasUiEnd = await E(o, d, "UI组件库语言资源"), i.dasUiEnd && (l = !0);
63
87
  }
64
- }, S = async (n = "front-end") => {
65
- let t = {}, s = await import(
88
+ if (!l)
89
+ throw new Error("语言包加载失败");
90
+ return i;
91
+ }, z = async (e = "front-end") => {
92
+ let c = {}, a = await import(
66
93
  /* @vite-ignore */
67
- `/i18n/${n}/global.js`
94
+ `/i18n/${e}/global.js`
68
95
  );
69
- return t = (s == null ? void 0 : s.default) || {}, t;
96
+ return c = (a == null ? void 0 : a.default) || {}, c;
70
97
  };
71
98
  export {
72
- $ as getCurrentSysLang,
73
- p as getSysLangArr,
74
- S as handleGlobalI18n,
75
- m as handleI18nData,
76
- b as isEmpty
99
+ b as getCurrentSysLang,
100
+ w as getSysLangArr,
101
+ z as handleGlobalI18n,
102
+ g as handleI18nData,
103
+ k as isEmpty
77
104
  };