@das-fed/upf-web 6.4.0-hot.6 → 6.4.0-hot.8
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 +17640 -788
- package/esm-map.json +4 -1
- package/index-BfS5ZwdE.js +12613 -0
- package/index-BfS5ZwdE.js.gz +0 -0
- package/{packages/main-app-framework/index-C8tjINrY.js → index-C8iGOlyv.js} +1 -1
- package/index-DfI-VZvq.js +93 -0
- package/index-DfI-VZvq.js.gz +0 -0
- package/index.js +18 -16
- package/package.json +7 -6
- package/packages/create-das-web-app/es5.js +138 -254
- package/packages/create-das-web-app/index.js +67 -122
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +206 -114
- package/packages/i18n/index.js +99 -60
- package/packages/i18n/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +14782 -785
- package/{index-CihmHNMg.js → packages/main-app-framework/index-4P5L5Fln.js} +1 -1
- package/packages/main-app-framework/index-BZpwzi0c.js +93 -0
- package/packages/main-app-framework/index-BZpwzi0c.js.gz +0 -0
- package/packages/main-app-framework/index-BfSkRApB.js +11147 -0
- package/packages/main-app-framework/index-BfSkRApB.js.gz +0 -0
- package/packages/main-app-framework/index.js +1 -1
- package/packages/main-app-framework/style.css +1 -1
- package/packages/main-app-framework/style.css.gz +0 -0
- package/style.css +1 -1
- package/style.css.gz +0 -0
- package/types/i18n/{microI18n.d.ts → getMicroI18nData.d.ts} +1 -2
- package/types/i18n/index.d.ts +3 -1
- package/types/main-app-framework/init-config/index.d.ts +0 -1
- package/types/main-app-framework/init-mframe/hooks/business/use-iot-hooks.d.ts +3 -0
- package/types/main-app-framework/init-mframe/hooks/use-layout.d.ts +1 -0
- package/types/main-app-framework/init-mframe/index.d.ts +1 -0
- package/index-BhEtGWg9.js +0 -87
- package/index-BhEtGWg9.js.gz +0 -0
- package/index-ClQkHyu0.js +0 -13991
- package/index-ClQkHyu0.js.gz +0 -0
- package/packages/main-app-framework/index-BotXvTrW.js +0 -87
- package/packages/main-app-framework/index-BotXvTrW.js.gz +0 -0
- package/packages/main-app-framework/index-qZN6TvxI.js +0 -12524
- package/packages/main-app-framework/index-qZN6TvxI.js.gz +0 -0
- package/types/main-app-framework/init-config/get-project-config/api.d.ts +0 -5
- package/types/main-app-framework/init-config/get-project-config/index.d.ts +0 -1
package/packages/i18n/index.js
CHANGED
|
@@ -1,44 +1,72 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getUrlParams as D } from "@das-fed/upf-utils/common-tools";
|
|
3
|
-
|
|
1
|
+
import { reactive as p, ref as b, computed as j } from "vue";
|
|
2
|
+
import { handleI18nData as I, getUrlParams as D } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
import { getConfig as L } from "@das-fed/upf-utils/config";
|
|
4
|
+
const x = {
|
|
5
|
+
loaded: {},
|
|
6
|
+
isLoaded(t, n) {
|
|
7
|
+
return !!(this.loaded[t] && this.loaded[t][n]);
|
|
8
|
+
},
|
|
9
|
+
markLoaded(t, n) {
|
|
10
|
+
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][n] = !0;
|
|
11
|
+
},
|
|
12
|
+
markUnloaded(t, n) {
|
|
13
|
+
this.loaded[t] && (delete this.loaded[t][n], Object.keys(this.loaded[t]).length === 0 && delete this.loaded[t]);
|
|
14
|
+
}
|
|
15
|
+
}, U = async (t, n) => {
|
|
16
|
+
var m, u, g;
|
|
17
|
+
const o = L() || {}, a = ((m = o.i18n) == null ? void 0 : m.fromOss) ?? !0, s = ((u = o.i18n) == null ? void 0 : u.isPullBack) ?? !1, e = ((g = o.i18n) == null ? void 0 : g.isDasUI) ?? !0;
|
|
18
|
+
let r = "/oss/resource/";
|
|
19
|
+
try {
|
|
20
|
+
const l = await I({
|
|
21
|
+
baseUrl: a ? r : "/",
|
|
22
|
+
currentLang: n,
|
|
23
|
+
appName: t,
|
|
24
|
+
isPullBack: s,
|
|
25
|
+
fallbackBaseUrl: "/",
|
|
26
|
+
isDasUI: e
|
|
27
|
+
});
|
|
28
|
+
if (!l || !(l != null && l.frontEnd))
|
|
29
|
+
throw new Error("Failed to fetch i18n data");
|
|
30
|
+
return l;
|
|
31
|
+
} catch (h) {
|
|
32
|
+
throw new Error(`registerResources error: ${h}`);
|
|
33
|
+
}
|
|
34
|
+
}, C = "language", i = p({}), c = p({}), d = p({}), M = D(location.href, "lang") || "", O = M || window.localStorage.getItem(C) || window.navigator.language || "zh-CN", f = b(O), z = "dasI18n", E = () => {
|
|
4
35
|
const t = document.documentElement;
|
|
5
|
-
t && t.setAttribute("lang",
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
s[n] || (s[n] = {}), s[n][o] = t[o][n] ?? "", e && (i[n] || (i[n] = {}), i[n][o] = s[n][o]), r && (l[n] || (l[n] = {}, console.log(`${l[n]}为空,重新设置为{}`)), l[n][o] = s[n][o]);
|
|
13
|
-
console.log("customLangeData===注入", l), console.log("globalLangeData===注入", i);
|
|
14
|
-
}, y = (t = {}, a) => {
|
|
36
|
+
t && t.setAttribute("lang", f.value);
|
|
37
|
+
}, w = (t = {}, n) => {
|
|
38
|
+
const o = n === "global", a = !o, s = {};
|
|
39
|
+
for (const e in t)
|
|
40
|
+
for (const r in t[e])
|
|
41
|
+
s[r] || (s[r] = {}), s[r][e] = t[e][r] ?? "", o && (c[r] || (c[r] = {}), c[r][e] = s[r][e]), a && (i[r] || (i[r] = {}), i[r][e] = s[r][e]);
|
|
42
|
+
}, A = (t = {}, n) => {
|
|
15
43
|
var s;
|
|
16
|
-
const
|
|
17
|
-
for (const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
44
|
+
const o = n === "global", a = !o;
|
|
45
|
+
for (const e in t)
|
|
46
|
+
if (o && !c[e] && (c[e] = t[e]), a) {
|
|
47
|
+
const r = (s = t[e]) != null && s._appCode ? t[e]._appCode.toLowerCase() : "";
|
|
48
|
+
r && (d[r] || (d[r] = {}), d[r][e] = t[e]), i[e] || (i[e] = t[e]);
|
|
21
49
|
}
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
let
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
},
|
|
50
|
+
}, B = async (t) => {
|
|
51
|
+
E();
|
|
52
|
+
const n = window[z];
|
|
53
|
+
n && A(n, "global");
|
|
54
|
+
}, N = (t) => {
|
|
55
|
+
let n = "";
|
|
56
|
+
const o = /\/([^\/]+)\/([^\/]+)\//, a = t.match(o);
|
|
57
|
+
return a && a.length >= 3 && (n = a[1] + "/" + a[2]), n ? n.toLowerCase() : "";
|
|
58
|
+
}, R = (t, ...n) => j(() => {
|
|
59
|
+
const o = N(location.pathname);
|
|
60
|
+
let a = d.framework ?? {}, s = d[o] ?? {}, e = i[t] || c[t] || a[t] || s[t] || t;
|
|
61
|
+
if (e === t) return t;
|
|
62
|
+
typeof e == "string" && (e = { "zh-CN": e });
|
|
63
|
+
let r = e[f.value];
|
|
64
|
+
return f.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (r = e["zh-cn"]), n.map((m, u) => {
|
|
65
|
+
r && (r = r.replace(`$${u}`, m));
|
|
66
|
+
}), r;
|
|
67
|
+
}), k = R, F = (t, ...n) => k(t, ...n).value, v = (t) => {
|
|
68
|
+
f.value = t, E();
|
|
69
|
+
}, $ = () => f, y = {
|
|
42
70
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
43
71
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
44
72
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -53,32 +81,43 @@ const C = "language", l = g({}), i = g({}), m = g({}), h = D(location.href, "uiC
|
|
|
53
81
|
"nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
|
|
54
82
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
55
83
|
};
|
|
56
|
-
function
|
|
57
|
-
var
|
|
58
|
-
const
|
|
59
|
-
return
|
|
84
|
+
function G(t, n) {
|
|
85
|
+
var a;
|
|
86
|
+
const o = window.DATE_FORMAT_MAP;
|
|
87
|
+
return o && o[t] && o[t][n] ? o[t][n] : ((a = window.DATE_FORMAT_MAP[t]) == null ? void 0 : a[n]) || "YYYY-MM-DD";
|
|
60
88
|
}
|
|
61
|
-
const
|
|
62
|
-
const
|
|
89
|
+
const Y = async (t) => {
|
|
90
|
+
const n = y[t] || y["zh-CN"];
|
|
91
|
+
try {
|
|
92
|
+
const o = await n.ant();
|
|
93
|
+
return await n.dayjs(), o.default;
|
|
94
|
+
} catch (o) {
|
|
95
|
+
console.warn(`未找到对应的语言包: ${o}`);
|
|
96
|
+
}
|
|
97
|
+
}, K = async (t = [], n = "zh-CN") => {
|
|
63
98
|
try {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
99
|
+
const o = await U(t, n);
|
|
100
|
+
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 ? w({ [n]: o.frontEnd[a] }) : console.warn(`No front-end i18n data found for app: ${a}`);
|
|
102
|
+
}), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length && w({ [n]: o.dasUiEnd }), v(n);
|
|
103
|
+
} catch (o) {
|
|
104
|
+
console.error("registerMicroI18nData error:", o);
|
|
68
105
|
}
|
|
69
106
|
};
|
|
70
107
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
108
|
+
f as currentLang,
|
|
109
|
+
i as customLangeData,
|
|
110
|
+
G as getDateFormat,
|
|
111
|
+
R as getI18nRule,
|
|
112
|
+
$ as getLang,
|
|
113
|
+
k as i18n,
|
|
114
|
+
B as initI18n,
|
|
78
115
|
C as languageKey,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
116
|
+
Y as loadLocale,
|
|
117
|
+
x as microI18nStore,
|
|
118
|
+
K as registerMicroI18nData,
|
|
119
|
+
A as setI18nRule,
|
|
120
|
+
v as setLang,
|
|
121
|
+
w as setLangRule,
|
|
122
|
+
F as t
|
|
84
123
|
};
|
|
Binary file
|