@das-fed/upf-web 6.4.0-hot.5 → 6.4.0-hot.6
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 +32 -32
- package/{index-CUfV9lMV.js → index-BhEtGWg9.js} +1 -1
- package/index-BhEtGWg9.js.gz +0 -0
- package/{index-7abDOKzJ.js → index-CihmHNMg.js} +1 -1
- package/{index-DigREEzd.js → index-ClQkHyu0.js} +523 -532
- package/index-ClQkHyu0.js.gz +0 -0
- package/index.js +1 -1
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +83 -85
- package/packages/create-das-web-app/index.js +75 -83
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +18 -18
- package/packages/i18n/index.js +17 -17
- package/packages/i18n/index.js.gz +0 -0
- package/packages/micro-frontend/index.js.gz +0 -0
- package/index-CUfV9lMV.js.gz +0 -0
- package/index-DigREEzd.js.gz +0 -0
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as s, D as t, F as n, E as r, G as i, e as o, o as u, z as g, r as m, f as l, j as p, n as D, y as L, B as c, C as b, k as h, i as y, J as A, K as T, w as M, h as R, H as W, I as F, v as I, N as V, L as d, s as f, m as k, q as v, x as w, A as x, t as K } from "./index-
|
|
1
|
+
import { M as s, D as t, F as n, E as r, G as i, e as o, o as u, z as g, r as m, f as l, j as p, n as D, y as L, B as c, C as b, k as h, i as y, J as A, K as T, w as M, h as R, H as W, I as F, v as I, N as V, L as d, s as f, m as k, q as v, x as w, A as x, t as K } from "./index-ClQkHyu0.js";
|
|
2
2
|
export {
|
|
3
3
|
s as DasMainAppLayout,
|
|
4
4
|
t as DasWebLayout,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/upf-web",
|
|
3
|
-
"version": "6.4.0-hot.
|
|
3
|
+
"version": "6.4.0-hot.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@das-fed/upf-ui": "6.4.0-hot.
|
|
8
|
-
"@das-fed/upf-utils": "6.4.0-hot.
|
|
9
|
-
"@das-fed/upf-web": "6.4.0-hot.
|
|
10
|
-
"@das-fed/upf-web-components": "6.4.0-hot.
|
|
7
|
+
"@das-fed/upf-ui": "6.4.0-hot.6",
|
|
8
|
+
"@das-fed/upf-utils": "6.4.0-hot.6",
|
|
9
|
+
"@das-fed/upf-web": "6.4.0-hot.6",
|
|
10
|
+
"@das-fed/upf-web-components": "6.4.0-hot.6",
|
|
11
11
|
"@microsoft/signalr": "^8.0.7",
|
|
12
12
|
"@vueuse/core": "^9.13.0",
|
|
13
13
|
"animate.css": "^4.1.1",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"vue-router": "^4.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@das-fed/upf-cli": "6.4.0-hot.
|
|
22
|
+
"@das-fed/upf-cli": "6.4.0-hot.6",
|
|
23
23
|
"@types/crypto-js": "^4.2.2",
|
|
24
24
|
"@types/lodash": "^4.14.194",
|
|
25
25
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -5,14 +5,14 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
7
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
10
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
9
11
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
12
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
13
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
12
14
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
13
15
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
18
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -25,17 +25,17 @@ 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 S = require('pinia-plugin-persistedstate');
|
|
29
29
|
var vueRouter = require('vue-router');
|
|
30
30
|
var commonTools = require('@das-fed/upf-utils/common-tools');
|
|
31
31
|
var config = require('@das-fed/upf-utils/config');
|
|
32
|
-
var
|
|
32
|
+
var F = {
|
|
33
33
|
install: function install(e, t) {
|
|
34
|
-
var
|
|
35
|
-
var r = (
|
|
36
|
-
r && Object.values(r).sort(function (a,
|
|
37
|
-
var _a$index,
|
|
38
|
-
return ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$index : 0) - ((
|
|
34
|
+
var c;
|
|
35
|
+
var r = (c = t == null ? undefined : t.plugins) == null ? undefined : c.glob;
|
|
36
|
+
r && Object.values(r).sort(function (a, o) {
|
|
37
|
+
var _a$index, _o$index;
|
|
38
|
+
return ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$index : 0) - ((_o$index = o.index) !== null && _o$index !== void 0 ? _o$index : 0);
|
|
39
39
|
}).filter(function (a) {
|
|
40
40
|
return a ? !!(a["default"] && a["default"].install || a.install) : false;
|
|
41
41
|
}).forEach(function (a) {
|
|
@@ -43,32 +43,34 @@ var q = {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
L = pinia.createPinia();
|
|
47
|
+
L.use(S);
|
|
48
|
+
var N = "language",
|
|
49
|
+
p = vue.reactive({}),
|
|
50
|
+
A = vue.reactive({});
|
|
51
51
|
vue.reactive({});
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
53
|
+
J = T || window.localStorage.getItem(N) || window.navigator.language || "zh-CN",
|
|
54
|
+
R = vue.ref(J),
|
|
55
|
+
Q = function Q() {
|
|
56
56
|
var e = document.documentElement;
|
|
57
|
-
e && e.setAttribute("lang",
|
|
57
|
+
e && e.setAttribute("lang", R.value);
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
$ = function $() {
|
|
60
60
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
61
61
|
var t = arguments.length > 1 ? arguments[1] : undefined;
|
|
62
|
+
var r = t === "global",
|
|
63
|
+
c = !r;
|
|
62
64
|
console.log("setLangRule===", e, t);
|
|
63
|
-
var
|
|
64
|
-
for (var o in e) for (var
|
|
65
|
-
var _e$o$
|
|
66
|
-
|
|
65
|
+
var a = {};
|
|
66
|
+
for (var o in e) for (var n in e[o]) {
|
|
67
|
+
var _e$o$n;
|
|
68
|
+
a[n] || (a[n] = {}), a[n][o] = (_e$o$n = e[o][n]) !== null && _e$o$n !== void 0 ? _e$o$n : "", r && (A[n] || (A[n] = {}), A[n][o] = a[n][o]), c && (p[n] || (p[n] = {}, console.log("".concat(p[n], "\u4E3A\u7A7A\uFF0C\u91CD\u65B0\u8BBE\u7F6E\u4E3A{}"))), p[n][o] = a[n][o]);
|
|
67
69
|
}
|
|
68
|
-
console.log("customLangeData
|
|
70
|
+
console.log("customLangeData===注入", p), console.log("globalLangeData===注入", A);
|
|
69
71
|
},
|
|
70
72
|
V = function V(e) {
|
|
71
|
-
|
|
73
|
+
R.value = e, console.log("currentLang.value===", R.value), Q();
|
|
72
74
|
},
|
|
73
75
|
X = {
|
|
74
76
|
loaded: {},
|
|
@@ -85,21 +87,21 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
85
87
|
Y = /*#__PURE__*/function () {
|
|
86
88
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e, t) {
|
|
87
89
|
var _ref2, _ref3, _ref4;
|
|
88
|
-
var f, b, d, r,
|
|
90
|
+
var f, b, d, r, c, a, o, n, i, _t;
|
|
89
91
|
return _regenerator().w(function (_context) {
|
|
90
92
|
while (1) switch (_context.p = _context.n) {
|
|
91
93
|
case 0:
|
|
92
|
-
r = config.getConfig() || {},
|
|
93
|
-
|
|
94
|
+
r = config.getConfig() || {}, c = (_ref2 = (f = r.i18n) == null ? undefined : f.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, a = (_ref3 = (b = r.i18n) == null ? undefined : b.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false, o = (_ref4 = (d = r.i18n) == null ? undefined : d.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
|
|
95
|
+
n = "/oss/resource/";
|
|
94
96
|
_context.p = 1;
|
|
95
97
|
_context.n = 2;
|
|
96
98
|
return commonTools.handleI18nData({
|
|
97
|
-
baseUrl:
|
|
99
|
+
baseUrl: c ? n : "/",
|
|
98
100
|
currentLang: t,
|
|
99
101
|
appName: e,
|
|
100
102
|
isPullBack: a,
|
|
101
103
|
fallbackBaseUrl: "/",
|
|
102
|
-
isDasUI:
|
|
104
|
+
isDasUI: o
|
|
103
105
|
});
|
|
104
106
|
case 2:
|
|
105
107
|
i = _context.v;
|
|
@@ -128,7 +130,6 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
128
130
|
var e,
|
|
129
131
|
t,
|
|
130
132
|
r,
|
|
131
|
-
o,
|
|
132
133
|
_args2 = arguments,
|
|
133
134
|
_t2;
|
|
134
135
|
return _regenerator().w(function (_context2) {
|
|
@@ -136,17 +137,14 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
136
137
|
case 0:
|
|
137
138
|
e = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : [];
|
|
138
139
|
t = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : "zh-CN";
|
|
139
|
-
console.log("registerMicroI18nData===", e, t);
|
|
140
140
|
_context2.p = 1;
|
|
141
141
|
_context2.n = 2;
|
|
142
142
|
return Y(e, t);
|
|
143
143
|
case 2:
|
|
144
144
|
r = _context2.v;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
r != null && r.
|
|
148
|
-
r.frontEnd[a] && _typeof(r.frontEnd[a]) == "object" && Object.keys(r.frontEnd[a]).length ? o[t] = _objectSpread(_objectSpread({}, o[t] || {}), r.frontEnd[a]) : console.warn("No front-end i18n data found for app: ".concat(a));
|
|
149
|
-
}), r != null && r.dasUiEnd && _typeof(r.dasUiEnd) == "object" && Object.keys(r.dasUiEnd).length && (o[t] = _objectSpread(_objectSpread({}, o[t] || {}), r.dasUiEnd)), o[t] && Object.keys(o[t]).length && Q(o), V(t);
|
|
145
|
+
r != null && r.frontEnd && _typeof(r.frontEnd) == "object" && Object.keys(r.frontEnd).length && e.forEach(function (c) {
|
|
146
|
+
r.frontEnd[c] && _typeof(r.frontEnd[c]) == "object" && Object.keys(r.frontEnd[c]).length ? $(_defineProperty({}, t, r.frontEnd[c]), "global") : console.warn("No front-end i18n data found for app: ".concat(c));
|
|
147
|
+
}), r != null && r.dasUiEnd && _typeof(r.dasUiEnd) == "object" && Object.keys(r.dasUiEnd).length && $(_defineProperty({}, t, r.dasUiEnd)), V(t);
|
|
150
148
|
_context2.n = 4;
|
|
151
149
|
break;
|
|
152
150
|
case 3:
|
|
@@ -164,30 +162,30 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
164
162
|
}(),
|
|
165
163
|
_ = function _(e) {
|
|
166
164
|
var _ref6;
|
|
167
|
-
var
|
|
168
|
-
var t = (_ref6 = (
|
|
169
|
-
r = ((
|
|
170
|
-
var
|
|
171
|
-
var a = Object.values(
|
|
172
|
-
return !!
|
|
173
|
-
}).flat().sort(function (
|
|
174
|
-
var
|
|
175
|
-
return ((
|
|
165
|
+
var w, E, i, j, O;
|
|
166
|
+
var t = (_ref6 = (w = e == null ? undefined : e.router) == null ? undefined : w.routerBase) !== null && _ref6 !== void 0 ? _ref6 : "/",
|
|
167
|
+
r = ((E = e == null ? undefined : e.router) == null ? undefined : E.options) || {};
|
|
168
|
+
var c = Object.assign(((i = e == null ? undefined : e.router) == null ? undefined : i.glob) || {});
|
|
169
|
+
var a = Object.values(c).filter(function (u) {
|
|
170
|
+
return !!u;
|
|
171
|
+
}).flat().sort(function (u, l) {
|
|
172
|
+
var _u$index, _l$index;
|
|
173
|
+
return ((_u$index = u.index) !== null && _u$index !== void 0 ? _u$index : 0) - ((_l$index = l.index) !== null && _l$index !== void 0 ? _l$index : 0);
|
|
176
174
|
}),
|
|
177
|
-
|
|
178
|
-
(j = e == null ? undefined : e.microApps) == null || j.map(function (
|
|
175
|
+
o = [];
|
|
176
|
+
(j = e == null ? undefined : e.microApps) == null || j.map(function (u) {
|
|
179
177
|
var k;
|
|
180
|
-
var
|
|
178
|
+
var l = Object.values(((k = u.router) == null ? undefined : k.glob) || {}).filter(function (s) {
|
|
181
179
|
return !!s;
|
|
182
180
|
}).flat().sort(function (s, y) {
|
|
183
181
|
var _s$index, _y$index;
|
|
184
182
|
return ((_s$index = s.index) !== null && _s$index !== void 0 ? _s$index : 0) - ((_y$index = y.index) !== null && _y$index !== void 0 ? _y$index : 0);
|
|
185
183
|
});
|
|
186
|
-
|
|
184
|
+
o.push.apply(o, _toConsumableArray(l.map(function (s) {
|
|
187
185
|
return _objectSpread(_objectSpread({}, s), {}, {
|
|
188
|
-
path: "/".concat(
|
|
186
|
+
path: "/".concat(u.microAppName).concat(s.path)
|
|
189
187
|
});
|
|
190
|
-
}))),
|
|
188
|
+
}))), o.push.apply(o, _toConsumableArray(l.filter(function (s) {
|
|
191
189
|
return !!s.path;
|
|
192
190
|
}).filter(function (s) {
|
|
193
191
|
return s.path !== "";
|
|
@@ -198,28 +196,28 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
198
196
|
}).map(function (s) {
|
|
199
197
|
return {
|
|
200
198
|
path: s.path,
|
|
201
|
-
redirect: "/".concat(
|
|
199
|
+
redirect: "/".concat(u.microAppName).concat(s.path),
|
|
202
200
|
meta: _objectSpread(_objectSpread({}, s.meta || {}), {}, {
|
|
203
201
|
isMicroAppRouteRedirect: true
|
|
204
202
|
})
|
|
205
203
|
};
|
|
206
204
|
})));
|
|
207
205
|
});
|
|
208
|
-
var
|
|
209
|
-
f = [].concat(_toConsumableArray(
|
|
206
|
+
var n = ((O = e == null ? undefined : e.router) == null ? undefined : O.routers) || [],
|
|
207
|
+
f = [].concat(_toConsumableArray(v(a, e)), _toConsumableArray(v(n, e)), _toConsumableArray(v(o, e))),
|
|
210
208
|
b = vueRouter.createRouter(_objectSpread({
|
|
211
209
|
history: vueRouter.createWebHistory(t),
|
|
212
210
|
routes: f
|
|
213
211
|
}, r)),
|
|
214
212
|
d = X;
|
|
215
213
|
if (Array.isArray(e == null ? undefined : e.microApps) && e.microApps.length && d) {
|
|
216
|
-
var
|
|
214
|
+
var u = /* @__PURE__ */new Map();
|
|
217
215
|
var _iterator = _createForOfIteratorHelper(e.microApps),
|
|
218
216
|
_step;
|
|
219
217
|
try {
|
|
220
218
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
221
|
-
var
|
|
222
|
-
|
|
219
|
+
var l = _step.value;
|
|
220
|
+
l != null && l.microAppName && l != null && l.i18n && u.set(l.microAppName, l.i18n);
|
|
223
221
|
}
|
|
224
222
|
} catch (err) {
|
|
225
223
|
_iterator.e(err);
|
|
@@ -227,14 +225,14 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
227
225
|
_iterator.f();
|
|
228
226
|
}
|
|
229
227
|
b.beforeEach(/*#__PURE__*/function () {
|
|
230
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(
|
|
231
|
-
var y,
|
|
228
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(l, k, s) {
|
|
229
|
+
var y, g, I, _iterator2, _step2, _step2$value, h, m, P, _t3, _t4, _t5;
|
|
232
230
|
return _regenerator().w(function (_context3) {
|
|
233
231
|
while (1) switch (_context3.p = _context3.n) {
|
|
234
232
|
case 0:
|
|
235
233
|
_context3.p = 0;
|
|
236
|
-
|
|
237
|
-
_iterator2 = _createForOfIteratorHelper(
|
|
234
|
+
g = ((y = l.query) == null ? void 0 : y.uiCulture) || window.localStorage.getItem(N) || window.navigator.language || "zh-CN", I = l.path || "";
|
|
235
|
+
_iterator2 = _createForOfIteratorHelper(u.entries());
|
|
238
236
|
_context3.p = 1;
|
|
239
237
|
_iterator2.s();
|
|
240
238
|
case 2:
|
|
@@ -242,31 +240,31 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
242
240
|
_context3.n = 10;
|
|
243
241
|
break;
|
|
244
242
|
}
|
|
245
|
-
_step2$value = _slicedToArray(_step2.value, 2),
|
|
246
|
-
if (!(!
|
|
243
|
+
_step2$value = _slicedToArray(_step2.value, 2), h = _step2$value[0], m = _step2$value[1];
|
|
244
|
+
if (!(!h || !I.toLowerCase().startsWith("/".concat(h.toLowerCase())))) {
|
|
247
245
|
_context3.n = 3;
|
|
248
246
|
break;
|
|
249
247
|
}
|
|
250
248
|
return _context3.a(3, 9);
|
|
251
249
|
case 3:
|
|
252
|
-
if (!(d.isLoaded(
|
|
250
|
+
if (!(d.isLoaded(g, h) || !m || !(m != null && m.length))) {
|
|
253
251
|
_context3.n = 4;
|
|
254
252
|
break;
|
|
255
253
|
}
|
|
256
254
|
return _context3.a(3, 10);
|
|
257
255
|
case 4:
|
|
258
|
-
|
|
259
|
-
d.markLoaded(
|
|
256
|
+
P = typeof m == "string" ? [m] : m;
|
|
257
|
+
d.markLoaded(g, h);
|
|
260
258
|
_context3.p = 5;
|
|
261
259
|
_context3.n = 6;
|
|
262
|
-
return Z(
|
|
260
|
+
return Z(P, g);
|
|
263
261
|
case 6:
|
|
264
262
|
_context3.n = 8;
|
|
265
263
|
break;
|
|
266
264
|
case 7:
|
|
267
265
|
_context3.p = 7;
|
|
268
266
|
_t3 = _context3.v;
|
|
269
|
-
d.markUnloaded(
|
|
267
|
+
d.markUnloaded(g, h), console.error("[initRouter] load micro app i18n failed for ".concat(h, ":"), _t3);
|
|
270
268
|
case 8:
|
|
271
269
|
return _context3.a(3, 10);
|
|
272
270
|
case 9:
|
|
@@ -308,16 +306,16 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
308
306
|
router: b
|
|
309
307
|
};
|
|
310
308
|
},
|
|
311
|
-
|
|
309
|
+
v = function v(e, t) {
|
|
312
310
|
return e.map(function (r) {
|
|
313
|
-
var _ref8,
|
|
314
|
-
var
|
|
315
|
-
return
|
|
316
|
-
meta:
|
|
311
|
+
var _ref8, _c$keepAlive;
|
|
312
|
+
var c = r.meta || {};
|
|
313
|
+
return c.keepAlive = (_ref8 = (_c$keepAlive = c.keepAlive) !== null && _c$keepAlive !== void 0 ? _c$keepAlive : t == null ? undefined : t.keepAlive) !== null && _ref8 !== void 0 ? _ref8 : true, _objectSpread(_objectSpread({}, r), {}, {
|
|
314
|
+
meta: c
|
|
317
315
|
});
|
|
318
316
|
});
|
|
319
317
|
},
|
|
320
|
-
|
|
318
|
+
le = function le(e) {
|
|
321
319
|
var f;
|
|
322
320
|
e || (e = {});
|
|
323
321
|
var t = vue.ref(true);
|
|
@@ -326,17 +324,17 @@ var G = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
326
324
|
});
|
|
327
325
|
var _ref9 = (e == null ? undefined : e.root) || {},
|
|
328
326
|
r = _ref9.container,
|
|
329
|
-
|
|
327
|
+
c = _ref9.component,
|
|
330
328
|
a = _ref9.props,
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
o = vue.createApp(c || index$1.DasWebLayout, a);
|
|
330
|
+
o.use(F, e), o.use(L);
|
|
333
331
|
var _ref0 = _(e),
|
|
334
|
-
|
|
335
|
-
return
|
|
336
|
-
app:
|
|
337
|
-
router:
|
|
332
|
+
n = _ref0.router;
|
|
333
|
+
return o.use(n), o.mount(r || "#app"), (f = window.top) != null && f.vueRouter || window.top && (window.top.vueRouter = n), {
|
|
334
|
+
app: o,
|
|
335
|
+
router: n,
|
|
338
336
|
loading: t,
|
|
339
|
-
store:
|
|
337
|
+
store: L
|
|
340
338
|
};
|
|
341
339
|
};
|
|
342
|
-
exports.createDasWebApp =
|
|
340
|
+
exports.createDasWebApp = le;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { reactive as U, ref as
|
|
2
|
-
import { initTheme as
|
|
3
|
-
import { DasWebLayout as
|
|
1
|
+
import { reactive as U, ref as D, createApp as B } from "vue";
|
|
2
|
+
import { initTheme as W } from "@das-fed/upf-web/packages/theme/index";
|
|
3
|
+
import { DasWebLayout as C } from "@das-fed/upf-web/packages/layout/index";
|
|
4
4
|
import { createPinia as M } from "pinia";
|
|
5
|
-
import
|
|
6
|
-
import { createRouter as
|
|
7
|
-
import { getUrlParams as
|
|
8
|
-
import { getConfig as
|
|
9
|
-
const
|
|
5
|
+
import S from "pinia-plugin-persistedstate";
|
|
6
|
+
import { createRouter as z, createWebHistory as G } from "vue-router";
|
|
7
|
+
import { getUrlParams as H, handleI18nData as K } from "@das-fed/upf-utils/common-tools";
|
|
8
|
+
import { getConfig as q } from "@das-fed/upf-utils/config";
|
|
9
|
+
const F = {
|
|
10
10
|
install: (e, t) => {
|
|
11
|
-
var
|
|
12
|
-
const r = (
|
|
13
|
-
r && Object.values(r).sort((a,
|
|
11
|
+
var c;
|
|
12
|
+
const r = (c = t == null ? void 0 : t.plugins) == null ? void 0 : c.glob;
|
|
13
|
+
r && Object.values(r).sort((a, o) => (a.index ?? 0) - (o.index ?? 0)).filter((a) => a ? !!(a.default && a.default.install || a.install) : !1).forEach((a) => {
|
|
14
14
|
a.default && a.default.install && e.use(a.default, t), a.install && e.use(a, t);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
}, L = M();
|
|
18
|
+
L.use(S);
|
|
19
|
+
const N = "language", p = U({}), A = U({});
|
|
20
20
|
U({});
|
|
21
|
-
const
|
|
21
|
+
const T = H(location.href, "uiCulture") || "", J = T || window.localStorage.getItem(N) || window.navigator.language || "zh-CN", R = D(J), Q = () => {
|
|
22
22
|
const e = document.documentElement;
|
|
23
|
-
e && e.setAttribute("lang",
|
|
24
|
-
},
|
|
23
|
+
e && e.setAttribute("lang", R.value);
|
|
24
|
+
}, $ = (e = {}, t) => {
|
|
25
|
+
const r = t === "global", c = !r;
|
|
25
26
|
console.log("setLangRule===", e, t);
|
|
26
|
-
const
|
|
27
|
+
const a = {};
|
|
27
28
|
for (const o in e)
|
|
28
|
-
for (const
|
|
29
|
-
|
|
30
|
-
console.log("customLangeData
|
|
29
|
+
for (const n in e[o])
|
|
30
|
+
a[n] || (a[n] = {}), a[n][o] = e[o][n] ?? "", r && (A[n] || (A[n] = {}), A[n][o] = a[n][o]), c && (p[n] || (p[n] = {}, console.log(`${p[n]}为空,重新设置为{}`)), p[n][o] = a[n][o]);
|
|
31
|
+
console.log("customLangeData===注入", p), console.log("globalLangeData===注入", A);
|
|
31
32
|
}, V = (e) => {
|
|
32
|
-
|
|
33
|
+
R.value = e, console.log("currentLang.value===", R.value), Q();
|
|
33
34
|
}, X = {
|
|
34
35
|
loaded: {},
|
|
35
36
|
isLoaded(e, t) {
|
|
@@ -43,107 +44,98 @@ const G = C(location.href, "uiCulture") || "", T = G || window.localStorage.getI
|
|
|
43
44
|
}
|
|
44
45
|
}, Y = async (e, t) => {
|
|
45
46
|
var f, b, d;
|
|
46
|
-
const r =
|
|
47
|
-
let
|
|
47
|
+
const r = q() || {}, c = ((f = r.i18n) == null ? void 0 : f.fromOss) ?? !0, a = ((b = r.i18n) == null ? void 0 : b.isPullBack) ?? !1, o = ((d = r.i18n) == null ? void 0 : d.isDasUI) ?? !0;
|
|
48
|
+
let n = "/oss/resource/";
|
|
48
49
|
try {
|
|
49
|
-
const i = await
|
|
50
|
-
baseUrl:
|
|
50
|
+
const i = await K({
|
|
51
|
+
baseUrl: c ? n : "/",
|
|
51
52
|
currentLang: t,
|
|
52
53
|
appName: e,
|
|
53
54
|
isPullBack: a,
|
|
54
55
|
fallbackBaseUrl: "/",
|
|
55
|
-
isDasUI:
|
|
56
|
+
isDasUI: o
|
|
56
57
|
});
|
|
57
58
|
if (!i || !(i != null && i.frontEnd))
|
|
58
59
|
throw new Error("Failed to fetch i18n data");
|
|
59
60
|
return i;
|
|
60
|
-
} catch (
|
|
61
|
-
throw new Error(`registerResources error: ${
|
|
61
|
+
} catch (w) {
|
|
62
|
+
throw new Error(`registerResources error: ${w}`);
|
|
62
63
|
}
|
|
63
64
|
}, Z = async (e = [], t = "zh-CN") => {
|
|
64
|
-
console.log("registerMicroI18nData===", e, t);
|
|
65
65
|
try {
|
|
66
66
|
const r = await Y(e, t);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
r != null && r.
|
|
70
|
-
r.frontEnd[a] && typeof r.frontEnd[a] == "object" && Object.keys(r.frontEnd[a]).length ? o[t] = {
|
|
71
|
-
...o[t] || {},
|
|
72
|
-
...r.frontEnd[a]
|
|
73
|
-
} : console.warn(`No front-end i18n data found for app: ${a}`);
|
|
74
|
-
}), r != null && r.dasUiEnd && typeof r.dasUiEnd == "object" && Object.keys(r.dasUiEnd).length && (o[t] = {
|
|
75
|
-
...o[t] || {},
|
|
76
|
-
...r.dasUiEnd
|
|
77
|
-
}), o[t] && Object.keys(o[t]).length && Q(o), V(t);
|
|
67
|
+
r != null && r.frontEnd && typeof r.frontEnd == "object" && Object.keys(r.frontEnd).length && e.forEach((c) => {
|
|
68
|
+
r.frontEnd[c] && typeof r.frontEnd[c] == "object" && Object.keys(r.frontEnd[c]).length ? $({ [t]: r.frontEnd[c] }, "global") : console.warn(`No front-end i18n data found for app: ${c}`);
|
|
69
|
+
}), r != null && r.dasUiEnd && typeof r.dasUiEnd == "object" && Object.keys(r.dasUiEnd).length && $({ [t]: r.dasUiEnd }), V(t);
|
|
78
70
|
} catch (r) {
|
|
79
71
|
console.error("registerMicroI18nData error:", r);
|
|
80
72
|
}
|
|
81
73
|
}, _ = (e) => {
|
|
82
|
-
var
|
|
83
|
-
const t = ((
|
|
84
|
-
let
|
|
85
|
-
const a = Object.values(
|
|
86
|
-
(j = e == null ? void 0 : e.microApps) == null || j.map((
|
|
74
|
+
var w, E, i, j, O;
|
|
75
|
+
const t = ((w = e == null ? void 0 : e.router) == null ? void 0 : w.routerBase) ?? "/", r = ((E = e == null ? void 0 : e.router) == null ? void 0 : E.options) || {};
|
|
76
|
+
let c = Object.assign(((i = e == null ? void 0 : e.router) == null ? void 0 : i.glob) || {});
|
|
77
|
+
const a = Object.values(c).filter((u) => !!u).flat().sort((u, l) => (u.index ?? 0) - (l.index ?? 0)), o = [];
|
|
78
|
+
(j = e == null ? void 0 : e.microApps) == null || j.map((u) => {
|
|
87
79
|
var k;
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
...
|
|
91
|
-
),
|
|
92
|
-
...
|
|
80
|
+
const l = Object.values(((k = u.router) == null ? void 0 : k.glob) || {}).filter((s) => !!s).flat().sort((s, y) => (s.index ?? 0) - (y.index ?? 0));
|
|
81
|
+
o.push(
|
|
82
|
+
...l.map((s) => ({ ...s, path: `/${u.microAppName}${s.path}` }))
|
|
83
|
+
), o.push(
|
|
84
|
+
...l.filter((s) => !!s.path).filter((s) => s.path !== "").filter((s) => s.path !== "/").filter((s) => !s.path.startsWith(`/${s.microAppName}`)).map((s) => ({
|
|
93
85
|
path: s.path,
|
|
94
|
-
redirect: `/${
|
|
86
|
+
redirect: `/${u.microAppName}${s.path}`,
|
|
95
87
|
meta: { ...s.meta || {}, isMicroAppRouteRedirect: !0 }
|
|
96
88
|
}))
|
|
97
89
|
);
|
|
98
90
|
});
|
|
99
|
-
const
|
|
100
|
-
...
|
|
101
|
-
...
|
|
102
|
-
...
|
|
103
|
-
], b =
|
|
91
|
+
const n = ((O = e == null ? void 0 : e.router) == null ? void 0 : O.routers) || [], f = [
|
|
92
|
+
...v(a, e),
|
|
93
|
+
...v(n, e),
|
|
94
|
+
...v(o, e)
|
|
95
|
+
], b = z({ history: G(t), routes: f, ...r }), d = X;
|
|
104
96
|
if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && d) {
|
|
105
|
-
const
|
|
106
|
-
for (const
|
|
107
|
-
|
|
108
|
-
b.beforeEach(async (
|
|
97
|
+
const u = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const l of e.microApps)
|
|
99
|
+
l != null && l.microAppName && (l != null && l.i18n) && u.set(l.microAppName, l.i18n);
|
|
100
|
+
b.beforeEach(async (l, k, s) => {
|
|
109
101
|
var y;
|
|
110
102
|
try {
|
|
111
|
-
const
|
|
112
|
-
for (const [
|
|
113
|
-
if (!
|
|
114
|
-
if (d.isLoaded(
|
|
115
|
-
const
|
|
116
|
-
d.markLoaded(
|
|
103
|
+
const g = ((y = l.query) == null ? void 0 : y.uiCulture) || window.localStorage.getItem(N) || window.navigator.language || "zh-CN", I = l.path || "";
|
|
104
|
+
for (const [h, m] of u.entries()) {
|
|
105
|
+
if (!h || !I.toLowerCase().startsWith(`/${h.toLowerCase()}`)) continue;
|
|
106
|
+
if (d.isLoaded(g, h) || !m || !(m != null && m.length)) break;
|
|
107
|
+
const P = typeof m == "string" ? [m] : m;
|
|
108
|
+
d.markLoaded(g, h);
|
|
117
109
|
try {
|
|
118
|
-
await Z(
|
|
119
|
-
} catch (
|
|
120
|
-
d.markUnloaded(
|
|
110
|
+
await Z(P, g);
|
|
111
|
+
} catch (x) {
|
|
112
|
+
d.markUnloaded(g, h), console.error(`[initRouter] load micro app i18n failed for ${h}:`, x);
|
|
121
113
|
}
|
|
122
114
|
break;
|
|
123
115
|
}
|
|
124
|
-
} catch (
|
|
125
|
-
console.error("[initRouter] microApps i18n beforeEach handler error:",
|
|
116
|
+
} catch (g) {
|
|
117
|
+
console.error("[initRouter] microApps i18n beforeEach handler error:", g);
|
|
126
118
|
} finally {
|
|
127
119
|
s();
|
|
128
120
|
}
|
|
129
121
|
});
|
|
130
122
|
}
|
|
131
123
|
return { router: b };
|
|
132
|
-
},
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
}),
|
|
124
|
+
}, v = (e, t) => e.map((r) => {
|
|
125
|
+
const c = r.meta || {};
|
|
126
|
+
return c.keepAlive = c.keepAlive ?? (t == null ? void 0 : t.keepAlive) ?? !0, { ...r, meta: c };
|
|
127
|
+
}), le = (e) => {
|
|
136
128
|
var f;
|
|
137
129
|
e || (e = {});
|
|
138
|
-
const t =
|
|
139
|
-
Promise.all([
|
|
130
|
+
const t = D(!0);
|
|
131
|
+
Promise.all([W(e)]).then(() => {
|
|
140
132
|
t.value = !1;
|
|
141
133
|
});
|
|
142
|
-
const { container: r, component:
|
|
143
|
-
|
|
144
|
-
const { router:
|
|
145
|
-
return
|
|
134
|
+
const { container: r, component: c, props: a } = (e == null ? void 0 : e.root) || {}, o = B(c || C, a);
|
|
135
|
+
o.use(F, e), o.use(L);
|
|
136
|
+
const { router: n } = _(e);
|
|
137
|
+
return o.use(n), o.mount(r || "#app"), (f = window.top) != null && f.vueRouter || window.top && (window.top.vueRouter = n), { app: o, router: n, loading: t, store: L };
|
|
146
138
|
};
|
|
147
139
|
export {
|
|
148
|
-
|
|
140
|
+
le as createDasWebApp
|
|
149
141
|
};
|
|
Binary file
|