@das-fed/upf-utils 6.4.0-dev.169 → 6.4.0-dev.170

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 (27) hide show
  1. package/api-services/modules/authentication/index.js +818 -836
  2. package/api-services/modules/authentication/index.js.gz +0 -0
  3. package/api-services/modules/contract/index.js +818 -836
  4. package/api-services/modules/contract/index.js.gz +0 -0
  5. package/api-services/modules/duty-manage/index.js +814 -832
  6. package/api-services/modules/duty-manage/index.js.gz +0 -0
  7. package/api-services/modules/enterpriseright/index.js +818 -836
  8. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  9. package/api-services/modules/gateway-edge/index.js +818 -836
  10. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  11. package/api-services/modules/justauth/index.js +819 -837
  12. package/api-services/modules/justauth/index.js.gz +0 -0
  13. package/api-services/modules/knowledge/index.js +831 -817
  14. package/api-services/modules/knowledge/index.js.gz +0 -0
  15. package/api-services/modules/platformManage/index.js +836 -818
  16. package/api-services/modules/platformManage/index.js.gz +0 -0
  17. package/api-services/modules/portal/index.js +818 -836
  18. package/api-services/modules/portal/index.js.gz +0 -0
  19. package/api-services/modules/supplychain-manage/index.js +818 -836
  20. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  21. package/common-tools/handle-data/index.d.ts +1 -2
  22. package/common-tools/handle-data/index.js +38 -70
  23. package/common-tools/handle-data/index.js.gz +0 -0
  24. package/create-api-service/index.js +789 -807
  25. package/create-api-service/index.js.gz +0 -0
  26. package/esm-map.json +1 -2
  27. package/package.json +4 -4
@@ -4,8 +4,7 @@
4
4
  * @returns
5
5
  */
6
6
  export declare const isEmpty: (value: any) => boolean;
7
- export declare const getSysLangArr: (langArr: string[]) => any;
8
- export declare const getCurrentSysLang: {};
7
+ export declare const isCurrentLangInSysLang: (lang: string) => any;
9
8
  /**
10
9
  * 处理多语言在打包时的数据
11
10
  * @param opt
@@ -1,71 +1,39 @@
1
- const k = (e) => e === null || typeof e > "u" || e === "", p = [
2
- "zh-CN",
3
- "zh-TW",
4
- "zh-HK",
5
- "zh-MO",
6
- "en-US",
7
- "ru-RU",
8
- "sv-SE",
9
- "fr-FR",
10
- "de-DE",
11
- "ar-SA",
12
- "es-ES",
13
- "it-IT",
14
- "pt-PT",
15
- "nl-NL",
16
- "vi-VN",
17
- "tr-TR"
18
- ], u = {
19
- 3: "zh-HK",
20
- 4: "zh-TW",
21
- 6: "ru-RU",
22
- 7: "sv-SE",
23
- 8: "fr-FR",
24
- 9: "de-DE",
25
- 10: "ar-SA",
26
- 11: "es-ES",
27
- 12: "it-IT",
28
- 13: "pt-PT",
29
- 14: "nl-NL",
30
- 15: "vi-VN",
31
- 16: "tr-TR"
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
- ));
37
- }, b = ["zh-CN", "zh-MO", "en-US", "10"], g = async (e) => {
38
- const c = e || {};
1
+ import { getConfig as k } from "@das-fed/upf-utils/config";
2
+ const w = (e) => e === null || typeof e > "u" || e === "", g = (e) => {
3
+ var t;
4
+ return (((t = k()) == null ? void 0 : t.systemLangList) || []).includes(e);
5
+ }, b = async (e) => {
6
+ const d = e || {};
39
7
  let {
40
8
  currentLang: t = "zh-CN",
41
9
  baseUrl: a = "/",
42
- appName: s = "jc",
43
- isPullBack: h = !1,
44
- isDasUI: $ = !1,
10
+ appName: l = "jc",
11
+ isPullBack: p = !1,
12
+ isDasUI: y = !1,
45
13
  urlObj: n = { frontEndUrl: "", backEndUrl: "", dasUiUrl: "" },
46
14
  // 新增:当主地址加载失败时,用于针对失败项的本地回退地址
47
15
  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 = {
16
+ } = d;
17
+ (typeof t != "string" || !t) && (t = "zh-CN"), (typeof l != "string" || !l) && (l = "jc"), typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof r != "string" && (r = ""), r && !r.endsWith("/") && (r = r + "/");
18
+ const s = {
51
19
  frontEnd: null,
52
20
  dasUiEnd: null,
53
21
  backMsg: null
54
22
  };
55
- let l = !1;
56
- const E = async (o, d, y = "资源") => {
23
+ let f = !1;
24
+ const $ = async (o, i, E = "zh-CN", u = "资源") => {
57
25
  try {
58
- const f = await import(
26
+ const c = await import(
59
27
  /* @vite-ignore */
60
28
  `${o}`
61
29
  );
62
- return (f == null ? void 0 : f.default) ?? null;
30
+ return (c == null ? void 0 : c.default) ?? null;
63
31
  } catch {
64
- if (d)
32
+ if (i && g(E))
65
33
  try {
66
34
  const U = await import(
67
35
  /* @vite-ignore */
68
- `${d}`
36
+ `${i}`
69
37
  );
70
38
  return (U == null ? void 0 : U.default) ?? null;
71
39
  } catch {
@@ -73,32 +41,32 @@ const k = (e) => e === null || typeof e > "u" || e === "", p = [
73
41
  return null;
74
42
  }
75
43
  };
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);
44
+ if (!y) {
45
+ const o = (n == null ? void 0 : n.frontEndUrl) || `${a}web-front-end/i18n/${l}_${t}.js`;
46
+ let i = !(n != null && n.frontEndUrl) && r ? `${r}web-front-end/i18n/${l}_${t}.js` : void 0;
47
+ s.frontEnd = await $(o, i, t, "前端业务语言资源"), s.frontEnd && (f = !0);
79
48
  }
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);
49
+ if (p && s.frontEnd || n != null && n.backEndUrl) {
50
+ const o = (n == null ? void 0 : n.backEndUrl) || `${a}web-back-end/i18n/${l}_${t}.js`;
51
+ let i = !(n != null && n.backEndUrl) && r ? `${r}web-back-end/i18n/${l}_${t}.js` : void 0;
52
+ s.backMsg = await $(o, i, t, "后端语言资源"), s.backMsg && (f = !0);
83
53
  }
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);
54
+ if (y) {
55
+ const o = (n == null ? void 0 : n.dasUiUrl) || `${a}web-front-end/i18n/dasui_${t}.js`;
56
+ let i = !(n != null && n.dasUiUrl) && r ? `${r}web-front-end/i18n/dasui_${t}.js` : void 0;
57
+ s.dasUiEnd = await $(o, i, t, "UI组件库语言资源"), s.dasUiEnd && (f = !0);
87
58
  }
88
- if (!l)
89
- throw new Error("语言包加载失败");
90
- return i;
91
- }, z = async (e = "front-end") => {
92
- let c = {}, a = await import(
59
+ return s;
60
+ }, m = async (e = "front-end") => {
61
+ let d = {}, a = await import(
93
62
  /* @vite-ignore */
94
63
  `/i18n/${e}/global.js`
95
64
  );
96
- return c = (a == null ? void 0 : a.default) || {}, c;
65
+ return d = (a == null ? void 0 : a.default) || {}, d;
97
66
  };
98
67
  export {
99
- b as getCurrentSysLang,
100
- w as getSysLangArr,
101
- z as handleGlobalI18n,
102
- g as handleI18nData,
103
- k as isEmpty
68
+ m as handleGlobalI18n,
69
+ b as handleI18nData,
70
+ g as isCurrentLangInSysLang,
71
+ w as isEmpty
104
72
  };