@das-fed/upf-web 6.4.0-dev.231 → 6.4.0-dev.232
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 +37 -37
- package/front-end/i18n/front-end-page/dasweb_en-US.js +2 -2
- package/front-end/i18n/front-end-page/dasweb_zh-CN.js +2 -2
- package/front-end/i18n/front-end-page/dasweb_zh-MO.js +2 -2
- package/{index-IJWJDds3.js → index-BY6POt5_.js} +35 -35
- package/index-BY6POt5_.js.gz +0 -0
- package/{index-0g6_Ce0M.js → index-CUJfUQFX.js} +1 -1
- package/index-CUJfUQFX.js.gz +0 -0
- package/{packages/main-app-framework/index-7BUmPh7i.js → index-wW15s_in.js} +1 -1
- package/index.js +1 -1
- package/package.json +5 -5
- package/packages/layout/es5.js +96 -96
- package/packages/layout/index.js +98 -98
- package/packages/layout/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +29 -29
- package/packages/main-app-framework/{index-BP8gHC_g.js → index-BSIXDWdJ.js} +1 -1
- package/packages/main-app-framework/index-BSIXDWdJ.js.gz +0 -0
- package/{index-CppaPRNy.js → packages/main-app-framework/index-C0K5zcvx.js} +1 -1
- package/packages/main-app-framework/{index-CUuJCTjN.js → index-y647qjnX.js} +27 -27
- package/packages/main-app-framework/index-y647qjnX.js.gz +0 -0
- package/packages/main-app-framework/index.js +1 -1
- package/packages/main-app-framework/style.css +1 -1
- package/packages/main-app-framework/style.css.gz +0 -0
- package/packages/micro-frontend/es5.js +156 -156
- package/packages/micro-frontend/index.js +127 -127
- package/packages/micro-frontend/index.js.gz +0 -0
- package/style.css +1 -1
- package/style.css.gz +0 -0
- package/index-0g6_Ce0M.js.gz +0 -0
- package/index-IJWJDds3.js.gz +0 -0
- package/packages/main-app-framework/index-BP8gHC_g.js.gz +0 -0
- package/packages/main-app-framework/index-CUuJCTjN.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@das-fed/upf-web/packages/micro-frontend/style.css';
|
|
2
|
-
import { ref as w, watch as M, reactive as T, getCurrentScope as ue, onScopeDispose as de, unref as I, getCurrentInstance as fe, onMounted as
|
|
2
|
+
import { ref as w, watch as M, reactive as T, getCurrentScope as ue, onScopeDispose as de, unref as I, getCurrentInstance as fe, onMounted as me, nextTick as ne, defineComponent as x, computed as N, openBlock as E, createElementBlock as D, Fragment as z, renderList as pe, withDirectives as ve, createBlock as se, vShow as he, createCommentVNode as Ae, mergeProps as we, withCtx as C, renderSlot as V, createVNode as O, onActivated as ge } from "vue";
|
|
3
3
|
import { DasWebLayout as ye, DasWebNav as Me, DasWebMenu as Le, DasWebTabs as _e } from "@das-fed/upf-web/packages/layout/index";
|
|
4
|
-
const W = w("/das-micro-app"),
|
|
4
|
+
const W = w("/das-micro-app"), p = w([]), k = w(!1), F = w([]), R = w(!0);
|
|
5
5
|
let v = null, h = null, _ = null;
|
|
6
6
|
const be = (e) => new Promise((t) => {
|
|
7
7
|
const n = () => {
|
|
@@ -10,12 +10,12 @@ const be = (e) => new Promise((t) => {
|
|
|
10
10
|
};
|
|
11
11
|
n();
|
|
12
12
|
}), b = (e, t, n, s) => {
|
|
13
|
-
var
|
|
14
|
-
const { awaitListener: c = !1 } = s || {}, { origin:
|
|
13
|
+
var a;
|
|
14
|
+
const { awaitListener: c = !1 } = s || {}, { origin: i } = new URL(location.href);
|
|
15
15
|
c ? be(t).then(() => {
|
|
16
16
|
var r;
|
|
17
|
-
(r = window.self) == null || r.postMessage({ type: t, data: n },
|
|
18
|
-
}) : (
|
|
17
|
+
(r = window.self) == null || r.postMessage({ type: t, data: n }, i);
|
|
18
|
+
}) : (a = window.self) == null || a.postMessage({ type: t, data: n }, i);
|
|
19
19
|
}, Ie = (e) => new Promise((t) => {
|
|
20
20
|
const n = () => {
|
|
21
21
|
if (h != null && h[e]) return t();
|
|
@@ -23,12 +23,12 @@ const be = (e) => new Promise((t) => {
|
|
|
23
23
|
};
|
|
24
24
|
n();
|
|
25
25
|
}), q = (e, t, n) => {
|
|
26
|
-
var
|
|
26
|
+
var i;
|
|
27
27
|
const { awaitListener: s = !1 } = n || {}, { origin: c } = new URL(location.href);
|
|
28
28
|
s ? Ie(e).then(() => {
|
|
29
|
-
var
|
|
30
|
-
(
|
|
31
|
-
}) : (
|
|
29
|
+
var a;
|
|
30
|
+
(a = window.self) == null || a.postMessage({ type: e, data: t }, c);
|
|
31
|
+
}) : (i = window.self) == null || i.postMessage({ type: e, data: t }, c);
|
|
32
32
|
}, Ee = () => {
|
|
33
33
|
h || (h || (h = {}), window.addEventListener(
|
|
34
34
|
"message",
|
|
@@ -69,7 +69,7 @@ const be = (e) => new Promise((t) => {
|
|
|
69
69
|
};
|
|
70
70
|
}, Q = async (e) => {
|
|
71
71
|
await Promise.all(
|
|
72
|
-
|
|
72
|
+
p.value.filter((t) => t.loaded).map((t) => new Promise(async (n) => {
|
|
73
73
|
t.dom || await new Promise((s) => M(() => t.dom, s)), setTimeout(() => {
|
|
74
74
|
b(t.name, "sessionStorage", e), n(!0);
|
|
75
75
|
}, 0);
|
|
@@ -78,24 +78,24 @@ const be = (e) => new Promise((t) => {
|
|
|
78
78
|
}, d = {
|
|
79
79
|
loadMicroApp: (e) => {
|
|
80
80
|
k.value = !0;
|
|
81
|
-
const t =
|
|
81
|
+
const t = p.value.find((a) => a.name === e), n = p.value.find((a) => a.actived), s = !!t, c = !(t != null && t.loaded), i = t == null ? void 0 : t.actived;
|
|
82
82
|
if (!s) {
|
|
83
83
|
n && (n.actived = !1);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
if (t.isFirstActived = !0, c) {
|
|
87
87
|
t.src = t.entry;
|
|
88
|
-
const
|
|
89
|
-
|
|
88
|
+
const a = p.value.find((r) => r.actived);
|
|
89
|
+
a && (a.actived = !1), t.loaded = !0, t.actived = !0;
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (!
|
|
92
|
+
if (!i) {
|
|
93
93
|
n && (n.actived = !1), t.actived = !0;
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
hideMicroApp: async (e) => {
|
|
98
|
-
const t =
|
|
98
|
+
const t = p.value.find((n) => n.name === e);
|
|
99
99
|
t && t.loaded && (t.dom || await new Promise((n) => M(() => t.dom, n)), b(e, "router", {
|
|
100
100
|
cmd: "push",
|
|
101
101
|
route: {
|
|
@@ -105,28 +105,28 @@ const be = (e) => new Promise((t) => {
|
|
|
105
105
|
}));
|
|
106
106
|
},
|
|
107
107
|
hideAllMicroApp: () => {
|
|
108
|
-
k.value = !1,
|
|
108
|
+
k.value = !1, p.value.map((e) => {
|
|
109
109
|
e.actived = !1;
|
|
110
110
|
});
|
|
111
111
|
},
|
|
112
112
|
unloadMicroApp: (e) => {
|
|
113
|
-
const t =
|
|
113
|
+
const t = p.value.find((n) => n.name === e);
|
|
114
114
|
t && (t.loaded = !1, t.actived = !1, t.dom = void 0);
|
|
115
115
|
},
|
|
116
116
|
unloadAllMicroApp: () => {
|
|
117
|
-
k.value = !1,
|
|
117
|
+
k.value = !1, p.value.map((e) => {
|
|
118
118
|
e.loaded = !1, e.actived = !1, e.dom = void 0;
|
|
119
119
|
});
|
|
120
120
|
},
|
|
121
121
|
setMicroAppRoute: async (e, t, n) => {
|
|
122
|
-
const s =
|
|
122
|
+
const s = p.value.find((r) => r.name === t);
|
|
123
123
|
if (!s || !s.loaded || !s.actived || (s.dom || await new Promise((r) => M(() => s.dom, r)), !s.actived)) return s;
|
|
124
|
-
const c = n.path || n,
|
|
124
|
+
const c = n.path || n, i = n.query || {}, a = n.params || {};
|
|
125
125
|
return e.push({
|
|
126
126
|
path: `/${t}${c}`,
|
|
127
|
-
query:
|
|
127
|
+
query: i,
|
|
128
128
|
// @ts-ignore
|
|
129
|
-
params:
|
|
129
|
+
params: a
|
|
130
130
|
}), setTimeout(() => {
|
|
131
131
|
const { isFirstActived: r } = s;
|
|
132
132
|
b(t, "router", {
|
|
@@ -169,21 +169,21 @@ const be = (e) => new Promise((t) => {
|
|
|
169
169
|
}, { remove: s };
|
|
170
170
|
},
|
|
171
171
|
triggerMicroAppLifeCycleListener: (e, t, n) => {
|
|
172
|
-
var
|
|
172
|
+
var i;
|
|
173
173
|
const s = _, { autoRemove: c = !1 } = n || {};
|
|
174
|
-
for (const
|
|
175
|
-
const r = s[
|
|
176
|
-
r.type === e && ((
|
|
174
|
+
for (const a in s) {
|
|
175
|
+
const r = s[a];
|
|
176
|
+
r.type === e && ((i = r == null ? void 0 : r.handler) == null || i.call(r, t).then(() => {
|
|
177
177
|
c && r.remove();
|
|
178
178
|
}));
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
reloadMicroAppRoute: async (e, t) => {
|
|
182
|
-
const n =
|
|
182
|
+
const n = p.value.find((s) => s.name === e);
|
|
183
183
|
n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "reload", path: t })));
|
|
184
184
|
},
|
|
185
185
|
unloadMicroAppRoute: async (e, t) => {
|
|
186
|
-
const n =
|
|
186
|
+
const n = p.value.find((s) => s.name === e);
|
|
187
187
|
n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "unload", path: t })));
|
|
188
188
|
},
|
|
189
189
|
setMainAppLayoutVisible: (e) => {
|
|
@@ -247,17 +247,17 @@ const be = (e) => new Promise((t) => {
|
|
|
247
247
|
l.searchConfig = e;
|
|
248
248
|
},
|
|
249
249
|
triggerEventListener: (e, t, n) => {
|
|
250
|
-
var
|
|
251
|
-
const s = l.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
250
|
+
var a;
|
|
251
|
+
const s = l.eventListeners, { autoRemove: c = !1 } = n || {}, i = [];
|
|
252
252
|
for (const r in s) {
|
|
253
253
|
const o = s[r];
|
|
254
|
-
o.type === e &&
|
|
255
|
-
(
|
|
254
|
+
o.type === e && i.push(
|
|
255
|
+
(a = o == null ? void 0 : o.handler) == null ? void 0 : a.call(o, t).then(() => {
|
|
256
256
|
c && o.remove();
|
|
257
257
|
})
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
|
-
return Promise.all(
|
|
260
|
+
return Promise.all(i).then(() => !0).catch(() => !1);
|
|
261
261
|
},
|
|
262
262
|
addEventListener: (e, t) => {
|
|
263
263
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
@@ -268,8 +268,8 @@ const be = (e) => new Promise((t) => {
|
|
|
268
268
|
handler: async (c) => {
|
|
269
269
|
try {
|
|
270
270
|
await t(c);
|
|
271
|
-
} catch (
|
|
272
|
-
throw
|
|
271
|
+
} catch (i) {
|
|
272
|
+
throw i;
|
|
273
273
|
}
|
|
274
274
|
},
|
|
275
275
|
remove: s
|
|
@@ -300,17 +300,17 @@ const be = (e) => new Promise((t) => {
|
|
|
300
300
|
g.popupClassName = e;
|
|
301
301
|
},
|
|
302
302
|
triggerEventListener: (e, t, n) => {
|
|
303
|
-
var
|
|
304
|
-
const s = g.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
303
|
+
var a;
|
|
304
|
+
const s = g.eventListeners, { autoRemove: c = !1 } = n || {}, i = [];
|
|
305
305
|
for (const r in s) {
|
|
306
306
|
const o = s[r];
|
|
307
|
-
o.type === e &&
|
|
308
|
-
(
|
|
307
|
+
o.type === e && i.push(
|
|
308
|
+
(a = o == null ? void 0 : o.handler) == null ? void 0 : a.call(o, t).then(() => {
|
|
309
309
|
c && o.remove();
|
|
310
310
|
})
|
|
311
311
|
);
|
|
312
312
|
}
|
|
313
|
-
return Promise.all(
|
|
313
|
+
return Promise.all(i).then(() => !0).catch(() => !1);
|
|
314
314
|
},
|
|
315
315
|
addEventListener: (e, t) => {
|
|
316
316
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
@@ -321,8 +321,8 @@ const be = (e) => new Promise((t) => {
|
|
|
321
321
|
handler: async (c) => {
|
|
322
322
|
try {
|
|
323
323
|
await t(c);
|
|
324
|
-
} catch (
|
|
325
|
-
throw
|
|
324
|
+
} catch (i) {
|
|
325
|
+
throw i;
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
328
|
remove: s
|
|
@@ -354,17 +354,17 @@ const be = (e) => new Promise((t) => {
|
|
|
354
354
|
A.activeItem = e;
|
|
355
355
|
},
|
|
356
356
|
triggerEventListener: (e, t, n) => {
|
|
357
|
-
var
|
|
358
|
-
const s = A.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
357
|
+
var a;
|
|
358
|
+
const s = A.eventListeners, { autoRemove: c = !1 } = n || {}, i = [];
|
|
359
359
|
for (const r in s) {
|
|
360
360
|
const o = s[r];
|
|
361
|
-
o.type === e &&
|
|
362
|
-
(
|
|
361
|
+
o.type === e && i.push(
|
|
362
|
+
(a = o == null ? void 0 : o.handler) == null ? void 0 : a.call(o, t).then(() => {
|
|
363
363
|
c && o.remove();
|
|
364
364
|
})
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
|
-
return Promise.all(
|
|
367
|
+
return Promise.all(i).then(() => !0).catch(() => !1);
|
|
368
368
|
},
|
|
369
369
|
addEventListener: (e, t) => {
|
|
370
370
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
@@ -375,8 +375,8 @@ const be = (e) => new Promise((t) => {
|
|
|
375
375
|
handler: async (c) => {
|
|
376
376
|
try {
|
|
377
377
|
await t(c);
|
|
378
|
-
} catch (
|
|
379
|
-
throw
|
|
378
|
+
} catch (i) {
|
|
379
|
+
throw i;
|
|
380
380
|
}
|
|
381
381
|
},
|
|
382
382
|
remove: s
|
|
@@ -388,17 +388,17 @@ const be = (e) => new Promise((t) => {
|
|
|
388
388
|
eventListeners: {}
|
|
389
389
|
}), Ce = {
|
|
390
390
|
triggerEventListener: (e, t, n) => {
|
|
391
|
-
var
|
|
392
|
-
const s = P.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
391
|
+
var a;
|
|
392
|
+
const s = P.eventListeners, { autoRemove: c = !1 } = n || {}, i = [];
|
|
393
393
|
for (const r in s) {
|
|
394
394
|
const o = s[r];
|
|
395
|
-
o.type === e &&
|
|
396
|
-
(
|
|
395
|
+
o.type === e && i.push(
|
|
396
|
+
(a = o == null ? void 0 : o.handler) == null ? void 0 : a.call(o, t).then(() => {
|
|
397
397
|
c && o.remove();
|
|
398
398
|
})
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
|
-
return Promise.all(
|
|
401
|
+
return Promise.all(i).then(() => !0).catch(() => !1);
|
|
402
402
|
},
|
|
403
403
|
addEventListener: (e, t) => {
|
|
404
404
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
@@ -409,8 +409,8 @@ const be = (e) => new Promise((t) => {
|
|
|
409
409
|
handler: async (c) => {
|
|
410
410
|
try {
|
|
411
411
|
await t(c);
|
|
412
|
-
} catch (
|
|
413
|
-
throw
|
|
412
|
+
} catch (i) {
|
|
413
|
+
throw i;
|
|
414
414
|
}
|
|
415
415
|
},
|
|
416
416
|
remove: s
|
|
@@ -462,7 +462,7 @@ function ie(e) {
|
|
|
462
462
|
return ue() ? (de(e), !0) : !1;
|
|
463
463
|
}
|
|
464
464
|
function ke(e, t = !0) {
|
|
465
|
-
fe() ?
|
|
465
|
+
fe() ? me(e) : t ? e() : ne(e);
|
|
466
466
|
}
|
|
467
467
|
function oe(e) {
|
|
468
468
|
var t;
|
|
@@ -475,12 +475,12 @@ function qe(...e) {
|
|
|
475
475
|
if (Re(e[0]) || Array.isArray(e[0]) ? ([n, s, c] = e, t = xe) : [t, n, s, c] = e, !t)
|
|
476
476
|
return Ne;
|
|
477
477
|
Array.isArray(n) || (n = [n]), Array.isArray(s) || (s = [s]);
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
}, r = (u, y,
|
|
481
|
-
|
|
478
|
+
const i = [], a = () => {
|
|
479
|
+
i.forEach((u) => u()), i.length = 0;
|
|
480
|
+
}, r = (u, y, m, L) => (u.addEventListener(y, m, L), () => u.removeEventListener(y, m, L)), o = M(() => [oe(t), ae(c)], ([u, y]) => {
|
|
481
|
+
a(), u && i.push(...n.flatMap((m) => s.map((L) => r(u, m, L, y))));
|
|
482
482
|
}, { immediate: !0, flush: "post" }), f = () => {
|
|
483
|
-
o(),
|
|
483
|
+
o(), a();
|
|
484
484
|
};
|
|
485
485
|
return ie(f), f;
|
|
486
486
|
}
|
|
@@ -533,37 +533,37 @@ const Y = [
|
|
|
533
533
|
]
|
|
534
534
|
];
|
|
535
535
|
function Be(e, t = {}) {
|
|
536
|
-
const { document: n = Ve, autoExit: s = !1 } = t, c = n == null ? void 0 : n.querySelector("html"),
|
|
537
|
-
let
|
|
536
|
+
const { document: n = Ve, autoExit: s = !1 } = t, c = n == null ? void 0 : n.querySelector("html"), i = w(!1);
|
|
537
|
+
let a = Y[0];
|
|
538
538
|
const r = Qe(() => {
|
|
539
539
|
if (n) {
|
|
540
540
|
for (const S of Y)
|
|
541
541
|
if (S[1] in n)
|
|
542
|
-
return
|
|
542
|
+
return a = S, !0;
|
|
543
543
|
} else
|
|
544
544
|
return !1;
|
|
545
545
|
return !1;
|
|
546
|
-
}), [o, f, u, , y] =
|
|
547
|
-
async function
|
|
548
|
-
r.value && (n != null && n[u] && await n[f](),
|
|
546
|
+
}), [o, f, u, , y] = a;
|
|
547
|
+
async function m() {
|
|
548
|
+
r.value && (n != null && n[u] && await n[f](), i.value = !1);
|
|
549
549
|
}
|
|
550
550
|
async function L() {
|
|
551
551
|
if (!r.value)
|
|
552
552
|
return;
|
|
553
|
-
await
|
|
553
|
+
await m();
|
|
554
554
|
const S = oe(c);
|
|
555
|
-
S && (await S[o](),
|
|
555
|
+
S && (await S[o](), i.value = !0);
|
|
556
556
|
}
|
|
557
557
|
async function le() {
|
|
558
|
-
|
|
558
|
+
i.value ? await m() : await L();
|
|
559
559
|
}
|
|
560
560
|
return n && qe(n, y, () => {
|
|
561
|
-
|
|
562
|
-
}, !1), s && ie(
|
|
561
|
+
i.value = !!(n != null && n[u]);
|
|
562
|
+
}, !1), s && ie(m), {
|
|
563
563
|
isSupported: r,
|
|
564
|
-
isFullscreen:
|
|
564
|
+
isFullscreen: i,
|
|
565
565
|
enter: L,
|
|
566
|
-
exit:
|
|
566
|
+
exit: m,
|
|
567
567
|
toggle: le
|
|
568
568
|
};
|
|
569
569
|
}
|
|
@@ -619,8 +619,8 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
619
619
|
setup(e, { emit: t }) {
|
|
620
620
|
const n = e, s = t, c = (r) => {
|
|
621
621
|
s("onLoaded", r);
|
|
622
|
-
},
|
|
623
|
-
return M(() =>
|
|
622
|
+
}, i = N(() => n.actived);
|
|
623
|
+
return M(() => i.value, (r) => {
|
|
624
624
|
r && s("onActivated"), r || s("onDeactivated");
|
|
625
625
|
}), (r, o) => (E(), D("iframe", {
|
|
626
626
|
class: "das-micro-app",
|
|
@@ -634,15 +634,15 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
634
634
|
}), Je = /* @__PURE__ */ re(Ge, [["__scopeId", "data-v-8ae871f6"]]), Ke = /* @__PURE__ */ x({
|
|
635
635
|
__name: "das-micro-apps",
|
|
636
636
|
setup(e) {
|
|
637
|
-
const t = w(null), n = async (
|
|
638
|
-
const r =
|
|
637
|
+
const t = w(null), n = async (i, a) => {
|
|
638
|
+
const r = p.value.find((m) => m.name === a);
|
|
639
639
|
if (!r) return;
|
|
640
|
-
r.dom =
|
|
640
|
+
r.dom = i.target, await ne(), await new Promise((m) => setTimeout(m, 50));
|
|
641
641
|
const o = () => {
|
|
642
|
-
const
|
|
643
|
-
return
|
|
642
|
+
const m = t.value.getBoundingClientRect() || {};
|
|
643
|
+
return m.width = t.value.clientWidth, m.height = t.value.clientHeight, m;
|
|
644
644
|
};
|
|
645
|
-
d.sendMessageToMicroApp(
|
|
645
|
+
d.sendMessageToMicroApp(a, "onLoaded", {
|
|
646
646
|
href: location.href,
|
|
647
647
|
microAppContainerRect: o(),
|
|
648
648
|
entry: r.entry,
|
|
@@ -650,20 +650,20 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
650
650
|
});
|
|
651
651
|
const { dom: f, ...u } = r;
|
|
652
652
|
d.triggerMicroAppLifeCycleListener("onLoaded", u), new ResizeObserver(() => {
|
|
653
|
-
d.sendMessageToMicroApp(
|
|
654
|
-
}).observe(t.value), d.sendMessageToMicroApp(
|
|
655
|
-
}, s = (
|
|
656
|
-
const r =
|
|
653
|
+
d.sendMessageToMicroApp(a, "resize", o());
|
|
654
|
+
}).observe(t.value), d.sendMessageToMicroApp(a, "setProxyMessageStatus", { visible: !0, parentHref: location.href }), d.sendMessageToMicroApp(a, "setProxSsoStatus", { visible: !0, parentHref: location.href });
|
|
655
|
+
}, s = (i, a) => {
|
|
656
|
+
const r = p.value.find((u) => u.name === a);
|
|
657
657
|
if (!r) return;
|
|
658
658
|
const { dom: o, ...f } = r;
|
|
659
|
-
d.sendMessageToMicroApp(
|
|
660
|
-
}, c = (
|
|
661
|
-
const r =
|
|
659
|
+
d.sendMessageToMicroApp(a, "onActivated"), d.triggerMicroAppLifeCycleListener("onActivated", f);
|
|
660
|
+
}, c = (i, a) => {
|
|
661
|
+
const r = p.value.find((u) => u.name === a);
|
|
662
662
|
if (!r) return;
|
|
663
663
|
const { dom: o, ...f } = r;
|
|
664
|
-
d.sendMessageToMicroApp(
|
|
664
|
+
d.sendMessageToMicroApp(a, "onDeactivated"), d.triggerMicroAppLifeCycleListener("onDeactivated", f);
|
|
665
665
|
};
|
|
666
|
-
return (
|
|
666
|
+
return (i, a) => (E(), D(
|
|
667
667
|
"div",
|
|
668
668
|
{
|
|
669
669
|
ref_key: "containerRef",
|
|
@@ -674,7 +674,7 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
674
674
|
(E(!0), D(
|
|
675
675
|
z,
|
|
676
676
|
null,
|
|
677
|
-
|
|
677
|
+
pe(I(p), (r) => (E(), D(
|
|
678
678
|
z,
|
|
679
679
|
null,
|
|
680
680
|
[
|
|
@@ -719,23 +719,23 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
719
719
|
"enter-active-class": "animate__animated animate__fadeInLeft",
|
|
720
720
|
...t.transitionConfig
|
|
721
721
|
})), c = N(() => ({ showLayout: t.showLayout, showAside: t.showAside, showTabs: t.showTabs }));
|
|
722
|
-
return (
|
|
722
|
+
return (i, a) => (E(), se(I(ye), we({
|
|
723
723
|
"transition-config": s.value,
|
|
724
724
|
"router-view-visible": n.value
|
|
725
725
|
}, c.value), {
|
|
726
726
|
header: C(() => [
|
|
727
|
-
V(
|
|
727
|
+
V(i.$slots, "header", {}, () => [
|
|
728
728
|
O(I(Me))
|
|
729
729
|
])
|
|
730
730
|
]),
|
|
731
731
|
aside: C(() => [
|
|
732
|
-
V(
|
|
733
|
-
O(I(Le), { menuAttr:
|
|
732
|
+
V(i.$slots, "aside", {}, () => [
|
|
733
|
+
O(I(Le), { menuAttr: e.menuAttr }, null, 8, ["menuAttr"])
|
|
734
734
|
])
|
|
735
735
|
]),
|
|
736
736
|
tab: C(() => [
|
|
737
|
-
V(
|
|
738
|
-
O(I(_e), { tabsAttr:
|
|
737
|
+
V(i.$slots, "tab", {}, () => [
|
|
738
|
+
O(I(_e), { tabsAttr: e.tabsAttr }, null, 8, ["tabsAttr"])
|
|
739
739
|
])
|
|
740
740
|
]),
|
|
741
741
|
default: C(() => [
|
|
@@ -756,28 +756,28 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
756
756
|
}
|
|
757
757
|
}), Ye = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.startsWith(n)) ? e : `/${e}`, nt = (e, t) => {
|
|
758
758
|
if (!(e != null && e.microApps) || !Array.isArray(e.microApps)) return;
|
|
759
|
-
window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (W.value = e.microAppRouterPrefix),
|
|
759
|
+
window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (W.value = e.microAppRouterPrefix), p.value = (e.microApps || []).filter((c) => !!c.name).map((c) => ({ ...c, entry: Ye(c.entry || c.name) })), t == null || t.addRoute({
|
|
760
760
|
name: "das-micro-app",
|
|
761
761
|
path: `${W.value}/:pathMatch(.*)*`,
|
|
762
762
|
component: ce,
|
|
763
763
|
meta: { isMicroApp: !0, keepAlive: !0 }
|
|
764
764
|
}), d.addEventListenerFromMicroApp("bodyOverlay", (c) => {
|
|
765
|
-
const { visible:
|
|
766
|
-
G.overlay.set(
|
|
765
|
+
const { visible: i, style: a } = c.data;
|
|
766
|
+
G.overlay.set(i, a);
|
|
767
767
|
}), d.addEventListenerFromMicroApp("layoutVisible", (c) => {
|
|
768
|
-
const { visible:
|
|
769
|
-
G.setVisible(
|
|
768
|
+
const { visible: i } = c.data;
|
|
769
|
+
G.setVisible(i);
|
|
770
770
|
}), d.addEventListenerFromMicroApp("route", (c) => {
|
|
771
|
-
const { name:
|
|
772
|
-
|
|
771
|
+
const { name: i, cmd: a, path: r } = c.data;
|
|
772
|
+
a === "reload" && d.reloadMicroAppRoute(i, r), a === "unload" && d.unloadMicroAppRoute(i, r);
|
|
773
773
|
});
|
|
774
774
|
const { enter: n, exit: s } = Be();
|
|
775
775
|
d.addEventListenerFromMicroApp("fullscreen", (c) => {
|
|
776
|
-
const
|
|
777
|
-
|
|
776
|
+
const i = c.data;
|
|
777
|
+
i && n(), i || s();
|
|
778
778
|
}), d.addEventListenerFromMicroApp("location", (c) => {
|
|
779
|
-
const { cmd:
|
|
780
|
-
|
|
779
|
+
const { cmd: i, isAutoCloseApp: a } = c.data || {};
|
|
780
|
+
i === "reload" && (a !== void 0 && (window.__isAutoCloseApp = a), location.reload());
|
|
781
781
|
});
|
|
782
782
|
}, st = (e, t) => {
|
|
783
783
|
if (!(e != null && e.microAppName)) return;
|
|
@@ -789,10 +789,10 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
789
789
|
component: ce,
|
|
790
790
|
meta: { isMicroApp: !0, keepAlive: !0 }
|
|
791
791
|
});
|
|
792
|
-
const s = w(!1), c = w(!1),
|
|
792
|
+
const s = w(!1), c = w(!1), i = w("");
|
|
793
793
|
M(
|
|
794
794
|
() => t.currentRoute.value,
|
|
795
|
-
(
|
|
795
|
+
(a) => {
|
|
796
796
|
if (s.value) {
|
|
797
797
|
s.value = !1;
|
|
798
798
|
return;
|
|
@@ -801,9 +801,9 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
801
801
|
c.value = !1;
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
804
|
-
const { path: r, query: o, params: f, meta: u } =
|
|
805
|
-
if (
|
|
806
|
-
|
|
804
|
+
const { path: r, query: o, params: f, meta: u } = a;
|
|
805
|
+
if (i.value.includes(a.path)) {
|
|
806
|
+
i.value = "";
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
809
|
d.sendMessageToMainApp("router", {
|
|
@@ -816,28 +816,28 @@ const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
|
816
816
|
}
|
|
817
817
|
});
|
|
818
818
|
}
|
|
819
|
-
), d.addEventListenerFromMainApp("router", async (
|
|
819
|
+
), d.addEventListenerFromMainApp("router", async (a) => {
|
|
820
820
|
var u;
|
|
821
|
-
const { cmd: r, route: o, microAppName: f = "" } =
|
|
822
|
-
|
|
823
|
-
}), d.addEventListenerFromMainApp("onLoaded", (
|
|
824
|
-
const { href: r, microAppContainerRect: o } =
|
|
821
|
+
const { cmd: r, route: o, microAppName: f = "" } = a.data;
|
|
822
|
+
i.value = ("/" + f + o.path).replace(/\/\//g, "/"), (u = t == null ? void 0 : t[r]) == null || u.call(t, o);
|
|
823
|
+
}), d.addEventListenerFromMainApp("onLoaded", (a) => {
|
|
824
|
+
const { href: r, microAppContainerRect: o } = a.data;
|
|
825
825
|
window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF = r, window.__DAS_MICRO_APP_CONTAINER_RECT = o;
|
|
826
|
-
}), d.addEventListenerFromMainApp("onDeactivated", (
|
|
826
|
+
}), d.addEventListenerFromMainApp("onDeactivated", (a) => {
|
|
827
827
|
const { name: r = "", path: o, params: f = {}, query: u = {} } = t.currentRoute.value;
|
|
828
828
|
c.value = !0, t == null || t.push({
|
|
829
829
|
name: n,
|
|
830
830
|
query: { microAppName: e.microAppName, fromQuery: JSON.stringify(u), fromPath: o },
|
|
831
831
|
params: f
|
|
832
832
|
});
|
|
833
|
-
}), d.addEventListenerFromMainApp("onActivated", (
|
|
833
|
+
}), d.addEventListenerFromMainApp("onActivated", (a) => {
|
|
834
834
|
const { name: r = "", params: o = {}, query: f = {} } = t.currentRoute.value, { fromPath: u = "", fromQuery: y = "{}" } = f || {};
|
|
835
835
|
s.value = !0, t == null || t.push({ path: u, query: JSON.parse(y), params: o });
|
|
836
|
-
}), d.addEventListenerFromMainApp("sessionStorage", (
|
|
837
|
-
const { cmd: r, key: o, value: f } =
|
|
836
|
+
}), d.addEventListenerFromMainApp("sessionStorage", (a) => {
|
|
837
|
+
const { cmd: r, key: o, value: f } = a.data;
|
|
838
838
|
r === "setItem" && window.sessionStorage.setItem(o, f), r === "getItem" && window.sessionStorage.getItem(o), r === "removeItem" && window.sessionStorage.removeItem(o), r === "clear" && window.sessionStorage.clear();
|
|
839
|
-
}), d.addEventListenerFromMainApp("route", (
|
|
840
|
-
const { cmd: r, path: o } =
|
|
839
|
+
}), d.addEventListenerFromMainApp("route", (a) => {
|
|
840
|
+
const { cmd: r, path: o } = a.data;
|
|
841
841
|
r === "reload" && (F.value.push(o), R.value = !1, setTimeout(() => {
|
|
842
842
|
R.value = !0, F.value = [];
|
|
843
843
|
}, 300)), r === "unload" && (F.value.push(o), R.value = !1, setTimeout(() => {
|
|
Binary file
|