@das-fed/upf-web 6.4.0-hot.7 → 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/index-BfS5ZwdE.js +12613 -0
- package/index-BfS5ZwdE.js.gz +0 -0
- package/{index-BHYGpKaC.js → index-C8iGOlyv.js} +1 -1
- package/index-DfI-VZvq.js +93 -0
- package/index-DfI-VZvq.js.gz +0 -0
- package/index.js +3 -3
- package/package.json +7 -6
- package/packages/create-das-web-app/es5.js +3 -3
- package/packages/create-das-web-app/index.js +7 -7
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +49 -51
- package/packages/i18n/index.js +45 -47
- package/packages/i18n/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +14782 -785
- package/packages/main-app-framework/{index-C8tjINrY.js → 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/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-CrHkmIjO.js +0 -87
- package/index-CrHkmIjO.js.gz +0 -0
- package/index-yBzlMgvo.js +0 -13992
- package/index-yBzlMgvo.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
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ref as d, computed as p, defineComponent as U, withDirectives as C, openBlock as A, createBlock as S, unref as f, withCtx as I, createVNode as j, vShow as D } from "vue";
|
|
2
|
+
import { layoutData as $ } from "@das-fed/upf-web/packages/layout/index";
|
|
3
|
+
import { t as x } from "@das-fed/upf-web/packages/i18n/index";
|
|
4
|
+
import { DasAppContainer as T } from "@das-fed/upf-ui/packages/business-components/app-container/index";
|
|
5
|
+
import { DasSpin as E } from "@das-fed/upf-ui/packages/components/spin/index";
|
|
6
|
+
import { getTabInfo as L } from "@das-fed/upf-utils/common-info";
|
|
7
|
+
import { setShowLayout as P } from "@das-fed/upf-utils/common-tools";
|
|
8
|
+
import { createService as b } from "@das-fed/upf-utils/create-api-service";
|
|
9
|
+
import { u as q, p as B, c as h, l as K, g as M, a as N } from "./index-BfS5ZwdE.js";
|
|
10
|
+
const O = d(!1), c = d([]);
|
|
11
|
+
p(() => {
|
|
12
|
+
var l;
|
|
13
|
+
return ((l = c.value) == null ? void 0 : l.map((u) => u.apps).flat()) || [];
|
|
14
|
+
});
|
|
15
|
+
d([]);
|
|
16
|
+
const V = "v1", F = b(`/api/justauth/client/${V}`), G = F.get("/visitor/kingdee/auth/user/auth_code"), oo = /* @__PURE__ */ U({
|
|
17
|
+
__name: "index",
|
|
18
|
+
setup(l) {
|
|
19
|
+
const { beforeEntryApp: u, entryApp: m } = q(), w = p(() => B.value.skinStyle), y = p(() => !!$.menu.items.length), _ = p(() => {
|
|
20
|
+
if (!c.value || !c.value.length) return [];
|
|
21
|
+
const t = h(c.value);
|
|
22
|
+
return Array.isArray(t) ? t.length ? (t.forEach((r) => {
|
|
23
|
+
r.apps = k(
|
|
24
|
+
r.apps.filter((o) => (o == null ? void 0 : o.code) && o.code !== "dasaiassistant"),
|
|
25
|
+
4
|
|
26
|
+
);
|
|
27
|
+
}), t) : [] : [];
|
|
28
|
+
}), k = (t, r) => {
|
|
29
|
+
const o = [];
|
|
30
|
+
for (let a = 0; a < t.length; a += r)
|
|
31
|
+
o.push(t.slice(a, a + r));
|
|
32
|
+
return o;
|
|
33
|
+
}, v = async (t) => {
|
|
34
|
+
if (!t) return;
|
|
35
|
+
if (!sessionStorage.getItem("projectInfo")) {
|
|
36
|
+
window.confirm(x("系统资源更新,请刷新系统")) && (window.__isAutoCloseApp = !1, window.location.reload());
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const o = h(t);
|
|
40
|
+
if (K.innerSet = !0, o.routeUrl) {
|
|
41
|
+
if (t.code === "Ioc") {
|
|
42
|
+
window.open(o.routeUrl, "_blank");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (t.code === "wojiacloud") {
|
|
46
|
+
const e = sessionStorage.getItem("kingdee_token") || "";
|
|
47
|
+
if (e) {
|
|
48
|
+
const [n, s] = await G().run({ accessToken: e });
|
|
49
|
+
if (s) {
|
|
50
|
+
const i = (s == null ? void 0 : s.auth_code) ?? "";
|
|
51
|
+
o.routeUrl = o.routeUrl.includes("?") ? `${o.routeUrl}&code=${i}` : `${o.routeUrl}?code=${i}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const a = (t == null ? void 0 : t.openType) ?? 1, g = (t == null ? void 0 : t.type) ?? 1;
|
|
57
|
+
if (a === 1) {
|
|
58
|
+
if (!await u(t)) return;
|
|
59
|
+
const n = L().preTab[t.code], s = (n == null ? void 0 : n.code) ?? "", i = { ...(n == null ? void 0 : n.query) ?? {} };
|
|
60
|
+
m({ microApp: o, menuCode: s, route: { query: i } });
|
|
61
|
+
}
|
|
62
|
+
if (a === 2 && o.routeUrl) {
|
|
63
|
+
let e = "";
|
|
64
|
+
if (g === 1)
|
|
65
|
+
e = o != null && o.applicationPath ? location.origin + "/" + o.applicationPath + o.routeUrl : location.origin + o.routeUrl, e = P(e);
|
|
66
|
+
else if (g === 2) {
|
|
67
|
+
const n = await M(o.routeUrl, (o == null ? void 0 : o.param) ?? []);
|
|
68
|
+
e = N(n);
|
|
69
|
+
}
|
|
70
|
+
window.open(e, "_blank");
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return (t, r) => C((A(), S(f(E), {
|
|
74
|
+
full: "",
|
|
75
|
+
spinning: f(O)
|
|
76
|
+
}, {
|
|
77
|
+
default: I(() => [
|
|
78
|
+
j(f(T), {
|
|
79
|
+
theme: w.value,
|
|
80
|
+
appCategorys: _.value,
|
|
81
|
+
onOpenApp: v
|
|
82
|
+
}, null, 8, ["theme", "appCategorys"])
|
|
83
|
+
]),
|
|
84
|
+
_: 1
|
|
85
|
+
/* STABLE */
|
|
86
|
+
}, 8, ["spinning"])), [
|
|
87
|
+
[D, !y.value]
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export {
|
|
92
|
+
oo as default
|
|
93
|
+
};
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as s, D as t, F as n, E as r, G as i, b as o, m as u, z as g, o as m, d as l, f as p, k as D, y as c, B as L, C as b, h, i as y, J as A, K as I, w as M, e as T, H as R, I as W, q as F, N as d, L as V, r as f, v as k, s as v, j as w, n as x, x as K, A as N, t as j } from "./index-BfS5ZwdE.js";
|
|
2
2
|
export {
|
|
3
3
|
s as DasMainAppLayout,
|
|
4
4
|
t as DasWebLayout,
|
|
@@ -24,8 +24,8 @@ export {
|
|
|
24
24
|
R as layout,
|
|
25
25
|
W as layoutData,
|
|
26
26
|
F as loadLocale,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
d as mainAppFramework,
|
|
28
|
+
V as microFrontend,
|
|
29
29
|
f as microI18nStore,
|
|
30
30
|
k as registerMicroI18nData,
|
|
31
31
|
v as setI18nRule,
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/upf-web",
|
|
3
|
-
"version": "6.4.0-hot.
|
|
3
|
+
"version": "6.4.0-hot.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@das-fed/
|
|
8
|
-
"@das-fed/upf-
|
|
9
|
-
"@das-fed/upf-
|
|
10
|
-
"@das-fed/upf-web
|
|
7
|
+
"@das-fed/mframe": "0.0.41",
|
|
8
|
+
"@das-fed/upf-ui": "6.4.0-hot.8",
|
|
9
|
+
"@das-fed/upf-utils": "6.4.0-hot.8",
|
|
10
|
+
"@das-fed/upf-web": "6.4.0-hot.8",
|
|
11
|
+
"@das-fed/upf-web-components": "6.4.0-hot.8",
|
|
11
12
|
"@microsoft/signalr": "^8.0.7",
|
|
12
13
|
"@vueuse/core": "^9.13.0",
|
|
13
14
|
"animate.css": "^4.1.1",
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
"vue-router": "^4.4.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
|
-
"@das-fed/upf-cli": "6.4.0-hot.
|
|
23
|
+
"@das-fed/upf-cli": "6.4.0-hot.8",
|
|
23
24
|
"@types/crypto-js": "^4.2.2",
|
|
24
25
|
"@types/lodash": "^4.14.194",
|
|
25
26
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -25,7 +25,7 @@ var vue = require('vue');
|
|
|
25
25
|
var index = require('@das-fed/upf-web/packages/theme/index/es5');
|
|
26
26
|
var index$1 = require('@das-fed/upf-web/packages/layout/index/es5');
|
|
27
27
|
var pinia = require('pinia');
|
|
28
|
-
var
|
|
28
|
+
var M = require('pinia-plugin-persistedstate');
|
|
29
29
|
var vueRouter = require('vue-router');
|
|
30
30
|
var index$2 = require('@das-fed/upf-web/packages/i18n/index/es5');
|
|
31
31
|
var q = {
|
|
@@ -43,7 +43,7 @@ var q = {
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
b = pinia.createPinia();
|
|
46
|
-
b.use(
|
|
46
|
+
b.use(M);
|
|
47
47
|
var z = function z(e) {
|
|
48
48
|
var _ref;
|
|
49
49
|
var R, y, v, k, $;
|
|
@@ -115,7 +115,7 @@ var z = function z(e) {
|
|
|
115
115
|
while (1) switch (_context.p = _context.n) {
|
|
116
116
|
case 0:
|
|
117
117
|
_context.p = 0;
|
|
118
|
-
s = ((h = a.query) == null ? void 0 : h.
|
|
118
|
+
s = ((h = a.query) == null ? void 0 : h.lang) || window.localStorage.getItem(index$2.languageKey) || window.navigator.language || "zh-CN", x = a.path || "";
|
|
119
119
|
_iterator2 = _createForOfIteratorHelper(n.entries());
|
|
120
120
|
_context.p = 1;
|
|
121
121
|
_iterator2.s();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as W, createApp as O } from "vue";
|
|
2
2
|
import { initTheme as P } from "@das-fed/upf-web/packages/theme/index";
|
|
3
3
|
import { DasWebLayout as j } from "@das-fed/upf-web/packages/layout/index";
|
|
4
|
-
import { createPinia as
|
|
5
|
-
import
|
|
6
|
-
import { createRouter as
|
|
4
|
+
import { createPinia as D } from "pinia";
|
|
5
|
+
import M from "pinia-plugin-persistedstate";
|
|
6
|
+
import { createRouter as C, createWebHistory as E } from "vue-router";
|
|
7
7
|
import { languageKey as S, registerMicroI18nData as B, microI18nStore as I } from "@das-fed/upf-web/packages/i18n/index";
|
|
8
8
|
const q = {
|
|
9
9
|
install: (e, u) => {
|
|
@@ -13,8 +13,8 @@ const q = {
|
|
|
13
13
|
t.default && t.default.install && e.use(t.default, u), t.install && e.use(t, u);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
}, b =
|
|
17
|
-
b.use(
|
|
16
|
+
}, b = D();
|
|
17
|
+
b.use(M);
|
|
18
18
|
const z = (e) => {
|
|
19
19
|
var R, y, v, k, $;
|
|
20
20
|
const u = ((R = e == null ? void 0 : e.router) == null ? void 0 : R.routerBase) ?? "/", i = ((y = e == null ? void 0 : e.router) == null ? void 0 : y.options) || {};
|
|
@@ -37,7 +37,7 @@ const z = (e) => {
|
|
|
37
37
|
...A(t, e),
|
|
38
38
|
...A(m, e),
|
|
39
39
|
...A(c, e)
|
|
40
|
-
], w =
|
|
40
|
+
], w = C({ history: E(u), routes: d, ...i }), p = I;
|
|
41
41
|
if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && p) {
|
|
42
42
|
const n = /* @__PURE__ */ new Map();
|
|
43
43
|
for (const a of e.microApps)
|
|
@@ -45,7 +45,7 @@ const z = (e) => {
|
|
|
45
45
|
w.beforeEach(async (a, g, r) => {
|
|
46
46
|
var h;
|
|
47
47
|
try {
|
|
48
|
-
const s = ((h = a.query) == null ? void 0 : h.
|
|
48
|
+
const s = ((h = a.query) == null ? void 0 : h.lang) || window.localStorage.getItem(S) || window.navigator.language || "zh-CN", x = a.path || "";
|
|
49
49
|
for (const [o, f] of n.entries()) {
|
|
50
50
|
if (!o || !x.toLowerCase().startsWith(`/${o.toLowerCase()}`)) continue;
|
|
51
51
|
if (p.isLoaded(s, o) || !f || !(f != null && f.length)) break;
|
|
Binary file
|
package/packages/i18n/es5.js
CHANGED
|
@@ -14,34 +14,34 @@ var commonTools = require('@das-fed/upf-utils/common-tools');
|
|
|
14
14
|
var config = require('@das-fed/upf-utils/config');
|
|
15
15
|
var x = {
|
|
16
16
|
loaded: {},
|
|
17
|
-
isLoaded: function isLoaded(t,
|
|
18
|
-
return !!(this.loaded[t] && this.loaded[t][
|
|
17
|
+
isLoaded: function isLoaded(t, n) {
|
|
18
|
+
return !!(this.loaded[t] && this.loaded[t][n]);
|
|
19
19
|
},
|
|
20
|
-
markLoaded: function markLoaded(t,
|
|
21
|
-
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][
|
|
20
|
+
markLoaded: function markLoaded(t, n) {
|
|
21
|
+
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][n] = true;
|
|
22
22
|
},
|
|
23
|
-
markUnloaded: function markUnloaded(t,
|
|
24
|
-
this.loaded[t] && (delete this.loaded[t][
|
|
23
|
+
markUnloaded: function markUnloaded(t, n) {
|
|
24
|
+
this.loaded[t] && (delete this.loaded[t][n], Object.keys(this.loaded[t]).length === 0 && delete this.loaded[t]);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
U = /*#__PURE__*/function () {
|
|
28
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t,
|
|
28
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t, n) {
|
|
29
29
|
var _ref2, _ref3, _ref4;
|
|
30
|
-
var m, u, g, o, a, s,
|
|
30
|
+
var m, u, g, o, a, s, e, r, l, _t;
|
|
31
31
|
return _regenerator().w(function (_context) {
|
|
32
32
|
while (1) switch (_context.p = _context.n) {
|
|
33
33
|
case 0:
|
|
34
|
-
o = config.getConfig() || {}, a = (_ref2 = (m = o.i18n) == null ? undefined : m.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, s = (_ref3 = (u = o.i18n) == null ? undefined : u.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false,
|
|
34
|
+
o = config.getConfig() || {}, a = (_ref2 = (m = o.i18n) == null ? undefined : m.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, s = (_ref3 = (u = o.i18n) == null ? undefined : u.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false, e = (_ref4 = (g = o.i18n) == null ? undefined : g.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
|
|
35
35
|
r = "/oss/resource/";
|
|
36
36
|
_context.p = 1;
|
|
37
37
|
_context.n = 2;
|
|
38
38
|
return commonTools.handleI18nData({
|
|
39
39
|
baseUrl: a ? r : "/",
|
|
40
|
-
currentLang:
|
|
40
|
+
currentLang: n,
|
|
41
41
|
appName: t,
|
|
42
42
|
isPullBack: s,
|
|
43
43
|
fallbackBaseUrl: "/",
|
|
44
|
-
isDasUI:
|
|
44
|
+
isDasUI: e
|
|
45
45
|
});
|
|
46
46
|
case 2:
|
|
47
47
|
l = _context.v;
|
|
@@ -69,7 +69,7 @@ var x = {
|
|
|
69
69
|
i = vue.reactive({}),
|
|
70
70
|
c = vue.reactive({}),
|
|
71
71
|
d = vue.reactive({}),
|
|
72
|
-
M = commonTools.getUrlParams(location.href, "
|
|
72
|
+
M = commonTools.getUrlParams(location.href, "lang") || "",
|
|
73
73
|
O = M || window.localStorage.getItem(C) || window.navigator.language || "zh-CN",
|
|
74
74
|
f = vue.ref(O),
|
|
75
75
|
z = "dasI18n",
|
|
@@ -79,37 +79,35 @@ var x = {
|
|
|
79
79
|
},
|
|
80
80
|
w = function w() {
|
|
81
81
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
82
|
-
var
|
|
83
|
-
var o =
|
|
82
|
+
var n = arguments.length > 1 ? arguments[1] : undefined;
|
|
83
|
+
var o = n === "global",
|
|
84
84
|
a = !o,
|
|
85
85
|
s = {};
|
|
86
|
-
for (var
|
|
87
|
-
var _t$
|
|
88
|
-
s[r] || (s[r] = {}), s[r][
|
|
86
|
+
for (var e in t) for (var r in t[e]) {
|
|
87
|
+
var _t$e$r;
|
|
88
|
+
s[r] || (s[r] = {}), s[r][e] = (_t$e$r = t[e][r]) !== null && _t$e$r !== void 0 ? _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]);
|
|
89
89
|
}
|
|
90
|
-
console.log("注册customLangeData", i);
|
|
91
90
|
},
|
|
92
91
|
A = function A() {
|
|
93
92
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
94
|
-
var
|
|
93
|
+
var n = arguments.length > 1 ? arguments[1] : undefined;
|
|
95
94
|
var s;
|
|
96
|
-
var o =
|
|
95
|
+
var o = n === "global",
|
|
97
96
|
a = !o;
|
|
98
|
-
for (var
|
|
99
|
-
var r = (s = t[
|
|
100
|
-
r && (d[r] || (d[r] = {}), d[r][
|
|
97
|
+
for (var e in t) if (o && !c[e] && (c[e] = t[e]), a) {
|
|
98
|
+
var r = (s = t[e]) != null && s._appCode ? t[e]._appCode.toLowerCase() : "";
|
|
99
|
+
r && (d[r] || (d[r] = {}), d[r][e] = t[e]), i[e] || (i[e] = t[e]);
|
|
101
100
|
}
|
|
102
|
-
console.log("获取customLangeData", i);
|
|
103
101
|
},
|
|
104
102
|
B = /*#__PURE__*/function () {
|
|
105
103
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
|
|
106
|
-
var
|
|
104
|
+
var n;
|
|
107
105
|
return _regenerator().w(function (_context2) {
|
|
108
106
|
while (1) switch (_context2.n) {
|
|
109
107
|
case 0:
|
|
110
108
|
E();
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
n = window[z];
|
|
110
|
+
n && A(n, "global");
|
|
113
111
|
case 1:
|
|
114
112
|
return _context2.a(2);
|
|
115
113
|
}
|
|
@@ -120,37 +118,37 @@ var x = {
|
|
|
120
118
|
};
|
|
121
119
|
}(),
|
|
122
120
|
N = function N(t) {
|
|
123
|
-
var
|
|
121
|
+
var n = "";
|
|
124
122
|
var o = /\/([^\/]+)\/([^\/]+)\//,
|
|
125
123
|
a = t.match(o);
|
|
126
|
-
return a && a.length >= 3 && (
|
|
124
|
+
return a && a.length >= 3 && (n = a[1] + "/" + a[2]), n ? n.toLowerCase() : "";
|
|
127
125
|
},
|
|
128
126
|
R = function R(t) {
|
|
129
|
-
for (var _len = arguments.length,
|
|
130
|
-
|
|
127
|
+
for (var _len = arguments.length, n = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
128
|
+
n[_key - 1] = arguments[_key];
|
|
131
129
|
}
|
|
132
130
|
return vue.computed(function () {
|
|
133
131
|
var _d$framework, _d$o;
|
|
134
132
|
var o = N(location.pathname);
|
|
135
133
|
var a = (_d$framework = d.framework) !== null && _d$framework !== void 0 ? _d$framework : {},
|
|
136
134
|
s = (_d$o = d[o]) !== null && _d$o !== void 0 ? _d$o : {},
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
typeof
|
|
140
|
-
"zh-CN":
|
|
135
|
+
e = i[t] || c[t] || a[t] || s[t] || t;
|
|
136
|
+
if (e === t) return t;
|
|
137
|
+
typeof e == "string" && (e = {
|
|
138
|
+
"zh-CN": e
|
|
141
139
|
});
|
|
142
|
-
var r =
|
|
143
|
-
return f.value === "zh-CN" &&
|
|
140
|
+
var r = e[f.value];
|
|
141
|
+
return f.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (r = e["zh-cn"]), n.map(function (m, u) {
|
|
144
142
|
r && (r = r.replace("$".concat(u), m));
|
|
145
143
|
}), r;
|
|
146
144
|
});
|
|
147
145
|
},
|
|
148
146
|
k = R,
|
|
149
147
|
F = function F(t) {
|
|
150
|
-
for (var _len2 = arguments.length,
|
|
151
|
-
|
|
148
|
+
for (var _len2 = arguments.length, n = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
149
|
+
n[_key2 - 1] = arguments[_key2];
|
|
152
150
|
}
|
|
153
|
-
return k.apply(void 0, [t].concat(
|
|
151
|
+
return k.apply(void 0, [t].concat(n)).value;
|
|
154
152
|
},
|
|
155
153
|
v = function v(t) {
|
|
156
154
|
f.value = t, E();
|
|
@@ -316,25 +314,25 @@ var x = {
|
|
|
316
314
|
}
|
|
317
315
|
}
|
|
318
316
|
};
|
|
319
|
-
function G(t,
|
|
317
|
+
function G(t, n) {
|
|
320
318
|
var a;
|
|
321
319
|
var o = window.DATE_FORMAT_MAP;
|
|
322
|
-
return o && o[t] && o[t][
|
|
320
|
+
return o && o[t] && o[t][n] ? o[t][n] : ((a = window.DATE_FORMAT_MAP[t]) == null ? undefined : a[n]) || "YYYY-MM-DD";
|
|
323
321
|
}
|
|
324
322
|
var Y = /*#__PURE__*/function () {
|
|
325
323
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(t) {
|
|
326
|
-
var
|
|
324
|
+
var n, o, _t2;
|
|
327
325
|
return _regenerator().w(function (_context3) {
|
|
328
326
|
while (1) switch (_context3.p = _context3.n) {
|
|
329
327
|
case 0:
|
|
330
|
-
|
|
328
|
+
n = y[t] || y["zh-CN"];
|
|
331
329
|
_context3.p = 1;
|
|
332
330
|
_context3.n = 2;
|
|
333
|
-
return
|
|
331
|
+
return n.ant();
|
|
334
332
|
case 2:
|
|
335
333
|
o = _context3.v;
|
|
336
334
|
_context3.n = 3;
|
|
337
|
-
return
|
|
335
|
+
return n.dayjs();
|
|
338
336
|
case 3:
|
|
339
337
|
return _context3.a(2, o["default"]);
|
|
340
338
|
case 4:
|
|
@@ -353,7 +351,7 @@ var Y = /*#__PURE__*/function () {
|
|
|
353
351
|
K = /*#__PURE__*/function () {
|
|
354
352
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
355
353
|
var t,
|
|
356
|
-
|
|
354
|
+
n,
|
|
357
355
|
o,
|
|
358
356
|
_args4 = arguments,
|
|
359
357
|
_t3;
|
|
@@ -361,15 +359,15 @@ var Y = /*#__PURE__*/function () {
|
|
|
361
359
|
while (1) switch (_context4.p = _context4.n) {
|
|
362
360
|
case 0:
|
|
363
361
|
t = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : [];
|
|
364
|
-
|
|
362
|
+
n = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : "zh-CN";
|
|
365
363
|
_context4.p = 1;
|
|
366
364
|
_context4.n = 2;
|
|
367
|
-
return U(t,
|
|
365
|
+
return U(t, n);
|
|
368
366
|
case 2:
|
|
369
367
|
o = _context4.v;
|
|
370
368
|
o != null && o.frontEnd && _typeof(o.frontEnd) == "object" && Object.keys(o.frontEnd).length && t.forEach(function (a) {
|
|
371
|
-
o.frontEnd[a] && _typeof(o.frontEnd[a]) == "object" && Object.keys(o.frontEnd[a]).length ? w(_defineProperty({},
|
|
372
|
-
}), o != null && o.dasUiEnd && _typeof(o.dasUiEnd) == "object" && Object.keys(o.dasUiEnd).length && w(_defineProperty({},
|
|
369
|
+
o.frontEnd[a] && _typeof(o.frontEnd[a]) == "object" && Object.keys(o.frontEnd[a]).length ? w(_defineProperty({}, n, o.frontEnd[a])) : console.warn("No front-end i18n data found for app: ".concat(a));
|
|
370
|
+
}), o != null && o.dasUiEnd && _typeof(o.dasUiEnd) == "object" && Object.keys(o.dasUiEnd).length && w(_defineProperty({}, n, o.dasUiEnd)), v(n);
|
|
373
371
|
_context4.n = 4;
|
|
374
372
|
break;
|
|
375
373
|
case 3:
|
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
|
|
3
|
-
import { getConfig as
|
|
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
4
|
const x = {
|
|
5
5
|
loaded: {},
|
|
6
|
-
isLoaded(t,
|
|
7
|
-
return !!(this.loaded[t] && this.loaded[t][
|
|
6
|
+
isLoaded(t, n) {
|
|
7
|
+
return !!(this.loaded[t] && this.loaded[t][n]);
|
|
8
8
|
},
|
|
9
|
-
markLoaded(t,
|
|
10
|
-
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][
|
|
9
|
+
markLoaded(t, n) {
|
|
10
|
+
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][n] = !0;
|
|
11
11
|
},
|
|
12
|
-
markUnloaded(t,
|
|
13
|
-
this.loaded[t] && (delete this.loaded[t][
|
|
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
14
|
}
|
|
15
|
-
}, U = async (t,
|
|
15
|
+
}, U = async (t, n) => {
|
|
16
16
|
var m, u, g;
|
|
17
|
-
const o =
|
|
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
18
|
let r = "/oss/resource/";
|
|
19
19
|
try {
|
|
20
|
-
const l = await
|
|
20
|
+
const l = await I({
|
|
21
21
|
baseUrl: a ? r : "/",
|
|
22
|
-
currentLang:
|
|
22
|
+
currentLang: n,
|
|
23
23
|
appName: t,
|
|
24
24
|
isPullBack: s,
|
|
25
25
|
fallbackBaseUrl: "/",
|
|
26
|
-
isDasUI:
|
|
26
|
+
isDasUI: e
|
|
27
27
|
});
|
|
28
28
|
if (!l || !(l != null && l.frontEnd))
|
|
29
29
|
throw new Error("Failed to fetch i18n data");
|
|
@@ -31,42 +31,40 @@ 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 = D(location.href, "lang") || "", O = M || window.localStorage.getItem(C) || window.navigator.language || "zh-CN", f = b(O), z = "dasI18n", E = () => {
|
|
35
35
|
const t = document.documentElement;
|
|
36
36
|
t && t.setAttribute("lang", f.value);
|
|
37
|
-
}, w = (t = {},
|
|
38
|
-
const o =
|
|
39
|
-
for (const
|
|
40
|
-
for (const r in t[
|
|
41
|
-
s[r] || (s[r] = {}), s[r][
|
|
42
|
-
|
|
43
|
-
}, A = (t = {}, e) => {
|
|
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) => {
|
|
44
43
|
var s;
|
|
45
|
-
const o =
|
|
46
|
-
for (const
|
|
47
|
-
if (o && !c[
|
|
48
|
-
const r = (s = t[
|
|
49
|
-
r && (d[r] || (d[r] = {}), d[r][
|
|
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]);
|
|
50
49
|
}
|
|
51
|
-
console.log("获取customLangeData", i);
|
|
52
50
|
}, B = async (t) => {
|
|
53
51
|
E();
|
|
54
|
-
const
|
|
55
|
-
|
|
52
|
+
const n = window[z];
|
|
53
|
+
n && A(n, "global");
|
|
56
54
|
}, N = (t) => {
|
|
57
|
-
let
|
|
55
|
+
let n = "";
|
|
58
56
|
const o = /\/([^\/]+)\/([^\/]+)\//, a = t.match(o);
|
|
59
|
-
return a && a.length >= 3 && (
|
|
60
|
-
}, R = (t, ...
|
|
57
|
+
return a && a.length >= 3 && (n = a[1] + "/" + a[2]), n ? n.toLowerCase() : "";
|
|
58
|
+
}, R = (t, ...n) => j(() => {
|
|
61
59
|
const o = N(location.pathname);
|
|
62
|
-
let a = d.framework ?? {}, s = d[o] ?? {},
|
|
63
|
-
if (
|
|
64
|
-
typeof
|
|
65
|
-
let r =
|
|
66
|
-
return f.value === "zh-CN" &&
|
|
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) => {
|
|
67
65
|
r && (r = r.replace(`$${u}`, m));
|
|
68
66
|
}), r;
|
|
69
|
-
}), k = R, F = (t, ...
|
|
67
|
+
}), k = R, F = (t, ...n) => k(t, ...n).value, v = (t) => {
|
|
70
68
|
f.value = t, E();
|
|
71
69
|
}, $ = () => f, y = {
|
|
72
70
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
@@ -83,25 +81,25 @@ const x = {
|
|
|
83
81
|
"nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
|
|
84
82
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
85
83
|
};
|
|
86
|
-
function G(t,
|
|
84
|
+
function G(t, n) {
|
|
87
85
|
var a;
|
|
88
86
|
const o = window.DATE_FORMAT_MAP;
|
|
89
|
-
return o && o[t] && o[t][
|
|
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";
|
|
90
88
|
}
|
|
91
89
|
const Y = async (t) => {
|
|
92
|
-
const
|
|
90
|
+
const n = y[t] || y["zh-CN"];
|
|
93
91
|
try {
|
|
94
|
-
const o = await
|
|
95
|
-
return await
|
|
92
|
+
const o = await n.ant();
|
|
93
|
+
return await n.dayjs(), o.default;
|
|
96
94
|
} catch (o) {
|
|
97
95
|
console.warn(`未找到对应的语言包: ${o}`);
|
|
98
96
|
}
|
|
99
|
-
}, K = async (t = [],
|
|
97
|
+
}, K = async (t = [], n = "zh-CN") => {
|
|
100
98
|
try {
|
|
101
|
-
const o = await U(t,
|
|
99
|
+
const o = await U(t, n);
|
|
102
100
|
o != null && o.frontEnd && typeof o.frontEnd == "object" && Object.keys(o.frontEnd).length && t.forEach((a) => {
|
|
103
|
-
o.frontEnd[a] && typeof o.frontEnd[a] == "object" && Object.keys(o.frontEnd[a]).length ? w({ [
|
|
104
|
-
}), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length && w({ [
|
|
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);
|
|
105
103
|
} catch (o) {
|
|
106
104
|
console.error("registerMicroI18nData error:", o);
|
|
107
105
|
}
|
|
Binary file
|