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