@das-fed/upf-web 6.4.0-dev.216 → 6.4.0-dev.217
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/es5.js +1434 -1476
- package/{index-WRedchsT.js → index-Bg6PM02l.js} +1 -1
- package/{packages/main-app-framework/index-CI6ZgPEU.js → index-DsbX1-Oq.js} +1 -1
- package/index-DsbX1-Oq.js.gz +0 -0
- package/{index-BmGy3aNh.js → index-Duoum6s2.js} +1372 -1398
- package/index-Duoum6s2.js.gz +0 -0
- package/index.js +1 -1
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +35 -36
- package/packages/create-das-web-app/index.js +40 -41
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +71 -73
- package/packages/i18n/index.js +60 -62
- package/packages/i18n/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +786 -825
- package/packages/main-app-framework/{index-BqKJ4JMx.js → index-D2D_f0hd.js} +691 -714
- package/packages/main-app-framework/index-D2D_f0hd.js.gz +0 -0
- package/packages/main-app-framework/{index-DRkEsoNL.js → index-D2I3UnWM.js} +1 -1
- package/{index-Dv-J3JZD.js → packages/main-app-framework/index-DLOeR4lo.js} +1 -1
- package/packages/main-app-framework/index-DLOeR4lo.js.gz +0 -0
- package/packages/main-app-framework/index.js +1 -1
- package/index-BmGy3aNh.js.gz +0 -0
- package/index-Dv-J3JZD.js.gz +0 -0
- package/packages/main-app-framework/index-BqKJ4JMx.js.gz +0 -0
- package/packages/main-app-framework/index-CI6ZgPEU.js.gz +0 -0
package/packages/i18n/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { reactive as p, ref as b, computed as j } from "vue";
|
|
2
|
-
import { handleI18nData as I, getUrlParams as
|
|
3
|
-
import { getConfig as
|
|
2
|
+
import { handleI18nData as I, getUrlParams as L } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
import { getConfig as D } from "@das-fed/upf-utils/config";
|
|
4
4
|
const x = {
|
|
5
5
|
loaded: {},
|
|
6
|
-
isLoaded(t,
|
|
7
|
-
return !!(this.loaded[t] && this.loaded[t][
|
|
6
|
+
isLoaded(t, e) {
|
|
7
|
+
return !!(this.loaded[t] && this.loaded[t][e]);
|
|
8
8
|
},
|
|
9
|
-
markLoaded(t,
|
|
10
|
-
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][
|
|
9
|
+
markLoaded(t, e) {
|
|
10
|
+
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][e] = !0;
|
|
11
11
|
},
|
|
12
|
-
markUnloaded(t,
|
|
13
|
-
this.loaded[t] && (delete this.loaded[t][
|
|
12
|
+
markUnloaded(t, e) {
|
|
13
|
+
this.loaded[t] && (delete this.loaded[t][e], Object.keys(this.loaded[t]).length === 0 && delete this.loaded[t]);
|
|
14
14
|
}
|
|
15
|
-
}, U = async (t,
|
|
15
|
+
}, U = async (t, e) => {
|
|
16
16
|
var m, u, g;
|
|
17
|
-
const o =
|
|
17
|
+
const o = D() || {}, a = ((m = o.i18n) == null ? void 0 : m.fromOss) ?? !0, s = ((u = o.i18n) == null ? void 0 : u.isPullBack) ?? !1, n = ((g = o.i18n) == null ? void 0 : g.isDasUI) ?? !0;
|
|
18
18
|
let r = "/oss/resource/";
|
|
19
19
|
try {
|
|
20
20
|
const l = await I({
|
|
21
21
|
baseUrl: a ? r : "/",
|
|
22
|
-
currentLang:
|
|
22
|
+
currentLang: e,
|
|
23
23
|
appName: t,
|
|
24
24
|
isPullBack: s,
|
|
25
25
|
fallbackBaseUrl: "/",
|
|
26
|
-
isDasUI:
|
|
26
|
+
isDasUI: n
|
|
27
27
|
});
|
|
28
28
|
if (!l || !(l != null && l.frontEnd))
|
|
29
29
|
throw new Error("Failed to fetch i18n data");
|
|
@@ -31,42 +31,42 @@ const x = {
|
|
|
31
31
|
} catch (h) {
|
|
32
32
|
throw new Error(`registerResources error: ${h}`);
|
|
33
33
|
}
|
|
34
|
-
}, C = "language", i = p({}), c = p({}), d = p({}), M =
|
|
34
|
+
}, C = "language", i = p({}), c = p({}), d = p({}), M = L(location.href, "lang") || "", O = M || window.localStorage.getItem(C) || window.navigator.language || "zh-CN", f = b(O), z = "dasI18n", w = () => {
|
|
35
35
|
const t = document.documentElement;
|
|
36
36
|
t && t.setAttribute("lang", f.value);
|
|
37
|
-
},
|
|
38
|
-
const o =
|
|
39
|
-
for (const
|
|
40
|
-
for (const r in t[
|
|
41
|
-
s[r] || (s[r] = {}), s[r][
|
|
42
|
-
}, A = (t = {},
|
|
37
|
+
}, y = (t = {}, e) => {
|
|
38
|
+
const o = e === "global", a = !o, s = {};
|
|
39
|
+
for (const n in t)
|
|
40
|
+
for (const r in t[n])
|
|
41
|
+
s[r] || (s[r] = {}), s[r][n] = t[n][r] ?? "", o && (c[r] || (c[r] = {}), c[r][n] = s[r][n]), a && (i[r] || (i[r] = {}), i[r][n] = s[r][n]);
|
|
42
|
+
}, A = (t = {}, e) => {
|
|
43
43
|
var s;
|
|
44
|
-
const o =
|
|
45
|
-
for (const
|
|
46
|
-
if (o && !c[
|
|
47
|
-
const r = (s = t[
|
|
48
|
-
r && (d[r] || (d[r] = {}), d[r][
|
|
44
|
+
const o = e === "global", a = !o;
|
|
45
|
+
for (const n in t)
|
|
46
|
+
if (o && !c[n] && (c[n] = t[n]), a) {
|
|
47
|
+
const r = (s = t[n]) != null && s._appCode ? t[n]._appCode.toLowerCase() : "";
|
|
48
|
+
r && (d[r] || (d[r] = {}), d[r][n] = t[n]), i[n] || (i[n] = t[n]);
|
|
49
49
|
}
|
|
50
50
|
}, B = async (t) => {
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
let
|
|
51
|
+
w();
|
|
52
|
+
const e = window[z];
|
|
53
|
+
e && A(e, "global");
|
|
54
|
+
}, R = (t) => {
|
|
55
|
+
let e = "";
|
|
56
56
|
const o = /\/([^\/]+)\/([^\/]+)\//, a = t.match(o);
|
|
57
|
-
return a && a.length >= 3 && (
|
|
58
|
-
},
|
|
59
|
-
const o =
|
|
60
|
-
let a = d.framework ?? {}, s = d[o] ?? {},
|
|
61
|
-
if (
|
|
62
|
-
typeof
|
|
63
|
-
let r =
|
|
64
|
-
return f.value === "zh-CN" &&
|
|
57
|
+
return a && a.length >= 3 && (e = a[1] + "/" + a[2]), e ? e.toLowerCase() : "";
|
|
58
|
+
}, k = (t, ...e) => j(() => {
|
|
59
|
+
const o = R(location.pathname);
|
|
60
|
+
let a = d.framework ?? {}, s = d[o] ?? {}, n = i[t] || c[t] || a[t] || s[t] || t;
|
|
61
|
+
if (n === t) return t;
|
|
62
|
+
typeof n == "string" && (n = { "zh-CN": n });
|
|
63
|
+
let r = n[f.value];
|
|
64
|
+
return f.value === "zh-CN" && n["zh-cn"] && !n["zh-CN"] && (r = n["zh-cn"]), e.map((m, u) => {
|
|
65
65
|
r && (r = r.replace(`$${u}`, m));
|
|
66
66
|
}), r;
|
|
67
|
-
}),
|
|
68
|
-
f.value = t,
|
|
69
|
-
},
|
|
67
|
+
}), v = k, F = (t, ...e) => v(t, ...e).value, N = (t) => {
|
|
68
|
+
f.value = t, w();
|
|
69
|
+
}, G = () => f, E = {
|
|
70
70
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
71
71
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
72
72
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -81,43 +81,41 @@ const x = {
|
|
|
81
81
|
"nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
|
|
82
82
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
83
83
|
};
|
|
84
|
-
function
|
|
84
|
+
function Y(t, e) {
|
|
85
85
|
var a;
|
|
86
86
|
const o = window.DATE_FORMAT_MAP;
|
|
87
|
-
return o && o[t] && o[t][
|
|
87
|
+
return o && o[t] && o[t][e] ? o[t][e] : ((a = window.DATE_FORMAT_MAP[t]) == null ? void 0 : a[e]) || "YYYY-MM-DD";
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
const
|
|
89
|
+
const K = async (t) => {
|
|
90
|
+
const e = E[t] || E["zh-CN"];
|
|
91
91
|
try {
|
|
92
|
-
const o = await
|
|
93
|
-
return await
|
|
94
|
-
} catch
|
|
95
|
-
console.warn(`未找到对应的语言包: ${o}`);
|
|
92
|
+
const o = await e.ant();
|
|
93
|
+
return await e.dayjs(), o.default;
|
|
94
|
+
} catch {
|
|
96
95
|
}
|
|
97
|
-
},
|
|
96
|
+
}, $ = async (t = [], e = "zh-CN") => {
|
|
98
97
|
try {
|
|
99
|
-
const o = await U(t,
|
|
98
|
+
const o = await U(t, e);
|
|
100
99
|
o != null && o.frontEnd && typeof o.frontEnd == "object" && Object.keys(o.frontEnd).length && t.forEach((a) => {
|
|
101
|
-
o.frontEnd[a] && typeof o.frontEnd[a] == "object" && Object.keys(o.frontEnd[a]).length
|
|
102
|
-
}), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length &&
|
|
103
|
-
} catch
|
|
104
|
-
console.error("registerMicroI18nData error:", o);
|
|
100
|
+
o.frontEnd[a] && typeof o.frontEnd[a] == "object" && Object.keys(o.frontEnd[a]).length && y({ [e]: o.frontEnd[a] });
|
|
101
|
+
}), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length && y({ [e]: o.dasUiEnd }), N(e);
|
|
102
|
+
} catch {
|
|
105
103
|
}
|
|
106
104
|
};
|
|
107
105
|
export {
|
|
108
106
|
f as currentLang,
|
|
109
107
|
i as customLangeData,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
Y as getDateFormat,
|
|
109
|
+
k as getI18nRule,
|
|
110
|
+
G as getLang,
|
|
111
|
+
v as i18n,
|
|
114
112
|
B as initI18n,
|
|
115
113
|
C as languageKey,
|
|
116
|
-
|
|
114
|
+
K as loadLocale,
|
|
117
115
|
x as microI18nStore,
|
|
118
|
-
|
|
116
|
+
$ as registerMicroI18nData,
|
|
119
117
|
A as setI18nRule,
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
N as setLang,
|
|
119
|
+
y as setLangRule,
|
|
122
120
|
F as t
|
|
123
121
|
};
|
|
Binary file
|