@das-fed/upf-web 6.4.0-hot.4 → 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 +30 -30
- package/{index-D5VSmbe-.js → index-7abDOKzJ.js} +1 -1
- package/{index-Dv9DDevb.js → index-CUfV9lMV.js} +1 -1
- package/index-CUfV9lMV.js.gz +0 -0
- package/{index-DTDqZtIi.js → index-DigREEzd.js} +477 -470
- 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 -90
- package/packages/create-das-web-app/index.js +81 -74
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +1 -1
- package/packages/i18n/index.js +1 -1
- package/packages/i18n/index.js.gz +0 -0
- package/packages/layout/index.js.gz +0 -0
- package/index-DTDqZtIi.js.gz +0 -0
- package/index-Dv9DDevb.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) {
|
|
@@ -137,14 +138,15 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
137
138
|
t = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : "zh-CN";
|
|
138
139
|
console.log("registerMicroI18nData===", e, t);
|
|
139
140
|
_context2.p = 1;
|
|
140
|
-
V(t);
|
|
141
141
|
_context2.n = 2;
|
|
142
142
|
return Y(e, t);
|
|
143
143
|
case 2:
|
|
144
144
|
r = _context2.v;
|
|
145
|
-
console.log("i18nData===", r)
|
|
146
|
-
|
|
147
|
-
|
|
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);
|
|
148
150
|
_context2.n = 4;
|
|
149
151
|
break;
|
|
150
152
|
case 3:
|
|
@@ -162,62 +164,62 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
162
164
|
}(),
|
|
163
165
|
_ = function _(e) {
|
|
164
166
|
var _ref6;
|
|
165
|
-
var p, A,
|
|
167
|
+
var p, A, i, j, D;
|
|
166
168
|
var t = (_ref6 = (p = e == null ? undefined : e.router) == null ? undefined : p.routerBase) !== null && _ref6 !== void 0 ? _ref6 : "/",
|
|
167
169
|
r = ((A = e == null ? undefined : e.router) == null ? undefined : A.options) || {};
|
|
168
|
-
var o = Object.assign(((
|
|
169
|
-
var a = Object.values(o).filter(function (
|
|
170
|
-
return !!
|
|
171
|
-
}).flat().sort(function (
|
|
172
|
-
var
|
|
173
|
-
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);
|
|
174
176
|
}),
|
|
175
|
-
|
|
176
|
-
(
|
|
177
|
-
var
|
|
178
|
-
var
|
|
179
|
-
return !!
|
|
180
|
-
}).flat().sort(function (
|
|
181
|
-
var
|
|
182
|
-
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);
|
|
183
185
|
});
|
|
184
|
-
|
|
185
|
-
return _objectSpread(_objectSpread({},
|
|
186
|
-
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)
|
|
187
189
|
});
|
|
188
|
-
}))),
|
|
189
|
-
return !!
|
|
190
|
-
}).filter(function (
|
|
191
|
-
return
|
|
192
|
-
}).filter(function (
|
|
193
|
-
return
|
|
194
|
-
}).filter(function (
|
|
195
|
-
return !
|
|
196
|
-
}).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) {
|
|
197
199
|
return {
|
|
198
|
-
path:
|
|
199
|
-
redirect: "/".concat(
|
|
200
|
-
meta: _objectSpread(_objectSpread({},
|
|
200
|
+
path: s.path,
|
|
201
|
+
redirect: "/".concat(c.microAppName).concat(s.path),
|
|
202
|
+
meta: _objectSpread(_objectSpread({}, s.meta || {}), {}, {
|
|
201
203
|
isMicroAppRouteRedirect: true
|
|
202
204
|
})
|
|
203
205
|
};
|
|
204
206
|
})));
|
|
205
207
|
});
|
|
206
|
-
var
|
|
207
|
-
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))),
|
|
208
210
|
b = vueRouter.createRouter(_objectSpread({
|
|
209
211
|
history: vueRouter.createWebHistory(t),
|
|
210
212
|
routes: f
|
|
211
213
|
}, r)),
|
|
212
214
|
d = X;
|
|
213
215
|
if (Array.isArray(e == null ? undefined : e.microApps) && e.microApps.length && d) {
|
|
214
|
-
var
|
|
216
|
+
var c = /* @__PURE__ */new Map();
|
|
215
217
|
var _iterator = _createForOfIteratorHelper(e.microApps),
|
|
216
218
|
_step;
|
|
217
219
|
try {
|
|
218
220
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
+
var n = _step.value;
|
|
222
|
+
n != null && n.microAppName && n != null && n.i18n && c.set(n.microAppName, n.i18n);
|
|
221
223
|
}
|
|
222
224
|
} catch (err) {
|
|
223
225
|
_iterator.e(err);
|
|
@@ -225,14 +227,14 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
225
227
|
_iterator.f();
|
|
226
228
|
}
|
|
227
229
|
b.beforeEach(/*#__PURE__*/function () {
|
|
228
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(
|
|
229
|
-
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;
|
|
230
232
|
return _regenerator().w(function (_context3) {
|
|
231
233
|
while (1) switch (_context3.p = _context3.n) {
|
|
232
234
|
case 0:
|
|
233
235
|
_context3.p = 0;
|
|
234
|
-
|
|
235
|
-
_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());
|
|
236
238
|
_context3.p = 1;
|
|
237
239
|
_iterator2.s();
|
|
238
240
|
case 2:
|
|
@@ -240,31 +242,31 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
240
242
|
_context3.n = 10;
|
|
241
243
|
break;
|
|
242
244
|
}
|
|
243
|
-
_step2$value = _slicedToArray(_step2.value, 2),
|
|
244
|
-
if (!(!
|
|
245
|
+
_step2$value = _slicedToArray(_step2.value, 2), g = _step2$value[0], m = _step2$value[1];
|
|
246
|
+
if (!(!g || !$.toLowerCase().startsWith("/".concat(g.toLowerCase())))) {
|
|
245
247
|
_context3.n = 3;
|
|
246
248
|
break;
|
|
247
249
|
}
|
|
248
250
|
return _context3.a(3, 9);
|
|
249
251
|
case 3:
|
|
250
|
-
if (!(d.isLoaded(
|
|
252
|
+
if (!(d.isLoaded(h, g) || !m || !(m != null && m.length))) {
|
|
251
253
|
_context3.n = 4;
|
|
252
254
|
break;
|
|
253
255
|
}
|
|
254
256
|
return _context3.a(3, 10);
|
|
255
257
|
case 4:
|
|
256
|
-
|
|
257
|
-
d.markLoaded(
|
|
258
|
+
I = typeof m == "string" ? [m] : m;
|
|
259
|
+
d.markLoaded(h, g);
|
|
258
260
|
_context3.p = 5;
|
|
259
261
|
_context3.n = 6;
|
|
260
|
-
return Z(
|
|
262
|
+
return Z(I, h);
|
|
261
263
|
case 6:
|
|
262
264
|
_context3.n = 8;
|
|
263
265
|
break;
|
|
264
266
|
case 7:
|
|
265
267
|
_context3.p = 7;
|
|
266
268
|
_t3 = _context3.v;
|
|
267
|
-
d.markUnloaded(
|
|
269
|
+
d.markUnloaded(h, g), console.error("[initRouter] load micro app i18n failed for ".concat(g, ":"), _t3);
|
|
268
270
|
case 8:
|
|
269
271
|
return _context3.a(3, 10);
|
|
270
272
|
case 9:
|
|
@@ -290,7 +292,7 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
290
292
|
console.error("[initRouter] microApps i18n beforeEach handler error:", _t5);
|
|
291
293
|
case 15:
|
|
292
294
|
_context3.p = 15;
|
|
293
|
-
|
|
295
|
+
s();
|
|
294
296
|
return _context3.f(15);
|
|
295
297
|
case 16:
|
|
296
298
|
return _context3.a(2);
|
|
@@ -306,7 +308,7 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
306
308
|
router: b
|
|
307
309
|
};
|
|
308
310
|
},
|
|
309
|
-
|
|
311
|
+
E = function E(e, t) {
|
|
310
312
|
return e.map(function (r) {
|
|
311
313
|
var _ref8, _o$keepAlive;
|
|
312
314
|
var o = r.meta || {};
|
|
@@ -315,7 +317,7 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
315
317
|
});
|
|
316
318
|
});
|
|
317
319
|
},
|
|
318
|
-
|
|
320
|
+
ce = function ce(e) {
|
|
319
321
|
var f;
|
|
320
322
|
e || (e = {});
|
|
321
323
|
var t = vue.ref(true);
|
|
@@ -326,15 +328,15 @@ var T = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
|
326
328
|
r = _ref9.container,
|
|
327
329
|
o = _ref9.component,
|
|
328
330
|
a = _ref9.props,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
l = vue.createApp(o || index$1.DasWebLayout, a);
|
|
332
|
+
l.use(q, e), l.use(R);
|
|
331
333
|
var _ref0 = _(e),
|
|
332
|
-
|
|
333
|
-
return
|
|
334
|
-
app:
|
|
335
|
-
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,
|
|
336
338
|
loading: t,
|
|
337
|
-
store:
|
|
339
|
+
store: R
|
|
338
340
|
};
|
|
339
341
|
};
|
|
340
|
-
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,100 +43,107 @@ 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
|
}
|
|
63
63
|
}, Z = async (e = [], t = "zh-CN") => {
|
|
64
64
|
console.log("registerMicroI18nData===", e, t);
|
|
65
65
|
try {
|
|
66
|
-
V(t);
|
|
67
66
|
const r = await Y(e, t);
|
|
68
|
-
console.log("i18nData===", r)
|
|
69
|
-
|
|
70
|
-
|
|
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);
|
|
71
78
|
} catch (r) {
|
|
72
79
|
console.error("registerMicroI18nData error:", r);
|
|
73
80
|
}
|
|
74
81
|
}, _ = (e) => {
|
|
75
|
-
var p, A,
|
|
82
|
+
var p, A, i, j, D;
|
|
76
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) || {};
|
|
77
|
-
let o = Object.assign(((
|
|
78
|
-
const a = Object.values(o).filter((
|
|
79
|
-
(
|
|
80
|
-
var
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
...
|
|
84
|
-
),
|
|
85
|
-
...
|
|
86
|
-
path:
|
|
87
|
-
redirect: `/${
|
|
88
|
-
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 }
|
|
89
96
|
}))
|
|
90
97
|
);
|
|
91
98
|
});
|
|
92
|
-
const
|
|
93
|
-
...
|
|
94
|
-
...
|
|
95
|
-
...
|
|
96
|
-
], 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;
|
|
97
104
|
if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && d) {
|
|
98
|
-
const
|
|
99
|
-
for (const
|
|
100
|
-
|
|
101
|
-
b.beforeEach(async (
|
|
102
|
-
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;
|
|
103
110
|
try {
|
|
104
|
-
const
|
|
105
|
-
for (const [
|
|
106
|
-
if (!
|
|
107
|
-
if (d.isLoaded(
|
|
108
|
-
const
|
|
109
|
-
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);
|
|
110
117
|
try {
|
|
111
|
-
await Z(
|
|
112
|
-
} catch (
|
|
113
|
-
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);
|
|
114
121
|
}
|
|
115
122
|
break;
|
|
116
123
|
}
|
|
117
|
-
} catch (
|
|
118
|
-
console.error("[initRouter] microApps i18n beforeEach handler error:",
|
|
124
|
+
} catch (h) {
|
|
125
|
+
console.error("[initRouter] microApps i18n beforeEach handler error:", h);
|
|
119
126
|
} finally {
|
|
120
|
-
|
|
127
|
+
s();
|
|
121
128
|
}
|
|
122
129
|
});
|
|
123
130
|
}
|
|
124
131
|
return { router: b };
|
|
125
|
-
},
|
|
132
|
+
}, E = (e, t) => e.map((r) => {
|
|
126
133
|
const o = r.meta || {};
|
|
127
134
|
return o.keepAlive = o.keepAlive ?? (t == null ? void 0 : t.keepAlive) ?? !0, { ...r, meta: o };
|
|
128
|
-
}),
|
|
135
|
+
}), ce = (e) => {
|
|
129
136
|
var f;
|
|
130
137
|
e || (e = {});
|
|
131
138
|
const t = O(!0);
|
|
132
|
-
Promise.all([
|
|
139
|
+
Promise.all([x(e)]).then(() => {
|
|
133
140
|
t.value = !1;
|
|
134
141
|
});
|
|
135
|
-
const { container: r, component: o, props: a } = (e == null ? void 0 : e.root) || {},
|
|
136
|
-
|
|
137
|
-
const { router:
|
|
138
|
-
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 };
|
|
139
146
|
};
|
|
140
147
|
export {
|
|
141
|
-
|
|
148
|
+
ce as createDasWebApp
|
|
142
149
|
};
|
|
Binary file
|