@das-fed/web 6.4.0-test.8.1 → 7.0.0
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/{index-DGluLInD.js → index-Do-hi0sT.js} +5039 -4842
- package/index-Do-hi0sT.js.gz +0 -0
- package/index-Ho3juDFP.js +10 -0
- package/{packages/main-app-framework/index-BNKYCeAC.js → index-ybkIe7Qx.js} +36 -31
- package/index-ybkIe7Qx.js.gz +0 -0
- package/index.js +1 -1
- package/package.json +6 -6
- package/packages/i18n/index.js +23 -21
- package/packages/i18n/index.js.gz +0 -0
- package/packages/layout/index.js +284 -282
- package/packages/layout/index.js.gz +0 -0
- package/packages/layout/style.css +1 -1
- package/packages/layout/style.css.gz +0 -0
- package/packages/main-app-framework/{index-WJZZ_VcX.js → index-By_I7kxF.js} +3682 -3501
- package/packages/main-app-framework/index-By_I7kxF.js.gz +0 -0
- package/packages/main-app-framework/index-D6tSxSCm.js +10 -0
- package/{index-tX8Sh7Y3.js → packages/main-app-framework/index-uy_tfCFy.js} +36 -31
- package/packages/main-app-framework/index-uy_tfCFy.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/index.js +266 -259
- package/packages/micro-frontend/index.js.gz +0 -0
- package/packages/style/style.css +1 -1
- package/packages/style/style.css.gz +0 -0
- package/style.css +1 -1
- package/style.css.gz +0 -0
- package/types/i18n/global.d.ts +10 -0
- package/types/i18n/index.d.ts +1 -1
- package/types/layout/store/index.d.ts +1 -1
- package/types/layout/store/nav.d.ts +1 -1
- package/types/main-app-framework/business/message-notify/index.d.ts +1 -0
- package/types/main-app-framework/business/remote-control/apis.d.ts +2 -0
- package/types/main-app-framework/business/remote-control/utils.d.ts +7 -0
- package/types/main-app-framework/components/person-set-dialog/src/api.d.ts +2 -0
- package/types/main-app-framework/components/person-set-dialog/src/components/index.d.ts +1 -0
- package/types/main-app-framework/components/person-set-dialog/src/components/set-home/api.d.ts +1 -1
- package/types/main-app-framework/i18n/index.d.ts +20 -0
- package/types/main-app-framework/init-config/get-nav-config/index.d.ts +2 -1
- package/types/main-app-framework/init-config/get-system-config/api.d.ts +2 -0
- package/types/main-app-framework/init-config/get-system-config/index.d.ts +4 -2
- package/types/main-app-framework/init-config/get-tenant-config/api.d.ts +3 -1
- package/types/main-app-framework/init-config/get-tenant-config/index.d.ts +2 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/index.d.ts +1 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/use-ai-helper.d.ts +4 -0
- package/types/main-app-framework/init-layout/hooks/use-initialization.d.ts +1 -0
- package/types/main-app-framework/utils/src/set-common-info.d.ts +2 -0
- package/index-DGluLInD.js.gz +0 -0
- package/index-DSr0lbga.js +0 -10
- package/index-tX8Sh7Y3.js.gz +0 -0
- package/packages/main-app-framework/index-BNKYCeAC.js.gz +0 -0
- package/packages/main-app-framework/index-DfAg8at4.js +0 -10
- package/packages/main-app-framework/index-WJZZ_VcX.js.gz +0 -0
|
@@ -1,64 +1,76 @@
|
|
|
1
1
|
import '@das-fed/web/packages/micro-frontend/style.css';
|
|
2
|
-
import { ref as w, watch as M, reactive as
|
|
3
|
-
import { DasWebLayout as ye,
|
|
4
|
-
const z = w("/das-micro-app"), f = w([]), k = w(!1),
|
|
5
|
-
let
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import { ref as w, watch as M, reactive as P, getCurrentScope as ue, onScopeDispose as de, getCurrentInstance as pe, onMounted as me, nextTick as ne, unref as I, defineComponent as x, computed as N, createElementBlock as D, openBlock as E, Fragment as $, renderList as fe, withDirectives as ve, createCommentVNode as he, createBlock as se, vShow as Ae, mergeProps as we, withCtx as T, createVNode as C, renderSlot as V, onActivated as ge } from "vue";
|
|
3
|
+
import { DasWebLayout as ye, DasWebTabs as Me, DasWebMenu as Le, DasWebNav as _e } from "@das-fed/web/packages/layout/index";
|
|
4
|
+
const z = w("/das-micro-app"), f = w([]), k = w(!1), O = w([]), F = w(!0);
|
|
5
|
+
let v = null, h = null, _ = null;
|
|
6
|
+
const be = (e) => new Promise((t) => {
|
|
7
|
+
const n = () => {
|
|
8
|
+
if (v != null && v[e]) return t();
|
|
9
|
+
setTimeout(() => n(), 50);
|
|
10
|
+
};
|
|
11
|
+
n();
|
|
12
|
+
}), b = (e, t, n, s) => {
|
|
13
|
+
var i;
|
|
14
|
+
const { awaitListener: c = !1 } = s || {}, { origin: a } = new URL(location.href);
|
|
15
|
+
c ? be(t).then(() => {
|
|
16
|
+
var r;
|
|
17
|
+
(r = window.self) == null || r.postMessage({ type: t, data: n }, a);
|
|
18
|
+
}) : (i = window.self) == null || i.postMessage({ type: t, data: n }, a);
|
|
19
|
+
}, Ie = (e) => new Promise((t) => {
|
|
20
|
+
const n = () => {
|
|
21
|
+
if (h != null && h[e]) return t();
|
|
22
|
+
setTimeout(() => n(), 50);
|
|
23
|
+
};
|
|
24
|
+
n();
|
|
25
|
+
}), q = (e, t, n) => {
|
|
26
|
+
var a;
|
|
27
|
+
const { awaitListener: s = !1 } = n || {}, { origin: c } = new URL(location.href);
|
|
28
|
+
s ? Ie(e).then(() => {
|
|
29
|
+
var i;
|
|
30
|
+
(i = window.self) == null || i.postMessage({ type: e, data: t }, c);
|
|
31
|
+
}) : (a = window.self) == null || a.postMessage({ type: e, data: t }, c);
|
|
32
|
+
}, Ee = () => {
|
|
33
|
+
h || (h || (h = {}), window.addEventListener(
|
|
22
34
|
"message",
|
|
23
35
|
(e) => {
|
|
24
36
|
const { type: t, source: n } = e.data || {};
|
|
25
|
-
if (n !== "react-devtools-content-script" &&
|
|
26
|
-
for (const
|
|
27
|
-
|
|
37
|
+
if (n !== "react-devtools-content-script" && h[t])
|
|
38
|
+
for (const s in h[t])
|
|
39
|
+
h[t][s](e.data);
|
|
28
40
|
},
|
|
29
41
|
!1
|
|
30
42
|
));
|
|
31
|
-
},
|
|
32
|
-
|
|
43
|
+
}, Se = () => {
|
|
44
|
+
v || (v || (v = {}), window.addEventListener(
|
|
33
45
|
"message",
|
|
34
46
|
(e) => {
|
|
35
47
|
const { type: t } = e.data || {};
|
|
36
|
-
if (
|
|
37
|
-
for (const n in
|
|
38
|
-
|
|
48
|
+
if (v[t])
|
|
49
|
+
for (const n in v[t])
|
|
50
|
+
v[t][n](e.data);
|
|
39
51
|
},
|
|
40
52
|
!1
|
|
41
53
|
));
|
|
42
|
-
},
|
|
43
|
-
|
|
54
|
+
}, Pe = (e, t) => {
|
|
55
|
+
Se();
|
|
44
56
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
|
|
45
|
-
return
|
|
57
|
+
return v[e] || (v[e] = {}), v[e][n] = t, {
|
|
46
58
|
remove: () => {
|
|
47
|
-
|
|
59
|
+
v[e] && v[e][n] && delete v[e][n];
|
|
48
60
|
}
|
|
49
61
|
};
|
|
50
|
-
},
|
|
51
|
-
|
|
62
|
+
}, Te = (e, t) => {
|
|
63
|
+
Ee();
|
|
52
64
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
|
|
53
|
-
return
|
|
65
|
+
return h[e] || (h[e] = {}), h[e][n] = t, {
|
|
54
66
|
remove: () => {
|
|
55
|
-
|
|
67
|
+
h[e] && h[e][n] && delete h[e][n];
|
|
56
68
|
}
|
|
57
69
|
};
|
|
58
70
|
}, Q = async (e) => {
|
|
59
71
|
await Promise.all(
|
|
60
72
|
f.value.filter((t) => t.loaded).map((t) => new Promise(async (n) => {
|
|
61
|
-
t.dom || await new Promise((
|
|
73
|
+
t.dom || await new Promise((s) => M(() => t.dom, s)), setTimeout(() => {
|
|
62
74
|
b(t.name, "sessionStorage", e), n(!0);
|
|
63
75
|
}, 0);
|
|
64
76
|
}))
|
|
@@ -66,14 +78,14 @@ const b = (e, t, n) => {
|
|
|
66
78
|
}, d = {
|
|
67
79
|
loadMicroApp: (e) => {
|
|
68
80
|
k.value = !0;
|
|
69
|
-
const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived),
|
|
70
|
-
if (!
|
|
81
|
+
const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived), s = !!t, c = !(t != null && t.loaded), a = t == null ? void 0 : t.actived;
|
|
82
|
+
if (!s) {
|
|
71
83
|
n && (n.actived = !1);
|
|
72
84
|
return;
|
|
73
85
|
}
|
|
74
86
|
if (t.isFirstActived = !0, c) {
|
|
75
87
|
t.src = t.entry;
|
|
76
|
-
const i = f.value.find((
|
|
88
|
+
const i = f.value.find((r) => r.actived);
|
|
77
89
|
i && (i.actived = !1), t.loaded = !0, t.actived = !0;
|
|
78
90
|
return;
|
|
79
91
|
}
|
|
@@ -107,8 +119,8 @@ const b = (e, t, n) => {
|
|
|
107
119
|
});
|
|
108
120
|
},
|
|
109
121
|
setMicroAppRoute: async (e, t, n) => {
|
|
110
|
-
const
|
|
111
|
-
if (!
|
|
122
|
+
const s = f.value.find((r) => r.name === t);
|
|
123
|
+
if (!s || !s.loaded || !s.actived || (s.dom || await new Promise((r) => M(() => s.dom, r)), !s.actived)) return s;
|
|
112
124
|
const c = n.path || n, a = n.query || {}, i = n.params || {};
|
|
113
125
|
return e.push({
|
|
114
126
|
path: `/${t}${c}`,
|
|
@@ -116,18 +128,18 @@ const b = (e, t, n) => {
|
|
|
116
128
|
// @ts-ignore
|
|
117
129
|
params: i
|
|
118
130
|
}), setTimeout(() => {
|
|
119
|
-
const { isFirstActived:
|
|
131
|
+
const { isFirstActived: r } = s;
|
|
120
132
|
b(t, "router", {
|
|
121
|
-
cmd:
|
|
133
|
+
cmd: r ? "replace" : "push",
|
|
122
134
|
route: n,
|
|
123
135
|
microAppName: t
|
|
124
|
-
}),
|
|
125
|
-
}, 0),
|
|
136
|
+
}), r && (s.isFirstActived = !1);
|
|
137
|
+
}, 0), s;
|
|
126
138
|
},
|
|
127
139
|
sendMessageToMicroApp: b,
|
|
128
140
|
sendMessageToMainApp: q,
|
|
129
|
-
addEventListenerFromMainApp:
|
|
130
|
-
addEventListenerFromMicroApp:
|
|
141
|
+
addEventListenerFromMainApp: Pe,
|
|
142
|
+
addEventListenerFromMicroApp: Te,
|
|
131
143
|
setMainAppOverlay: (e, t) => {
|
|
132
144
|
q("bodyOverlay", { visible: e, style: t });
|
|
133
145
|
},
|
|
@@ -146,38 +158,38 @@ const b = (e, t, n) => {
|
|
|
146
158
|
},
|
|
147
159
|
addMicroAppLifeCycleListener: (e, t) => {
|
|
148
160
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
161
|
+
_ || (_ = {});
|
|
162
|
+
const s = () => {
|
|
163
|
+
_[n] && delete _[n];
|
|
152
164
|
};
|
|
153
|
-
return
|
|
165
|
+
return _[n] = {
|
|
154
166
|
type: e,
|
|
155
167
|
handler: async (c) => await t(c),
|
|
156
|
-
remove:
|
|
157
|
-
}, { remove:
|
|
168
|
+
remove: s
|
|
169
|
+
}, { remove: s };
|
|
158
170
|
},
|
|
159
171
|
triggerMicroAppLifeCycleListener: (e, t, n) => {
|
|
160
172
|
var a;
|
|
161
|
-
const
|
|
162
|
-
for (const i in
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
c &&
|
|
173
|
+
const s = _, { autoRemove: c = !1 } = n || {};
|
|
174
|
+
for (const i in s) {
|
|
175
|
+
const r = s[i];
|
|
176
|
+
r.type === e && ((a = r == null ? void 0 : r.handler) == null || a.call(r, t).then(() => {
|
|
177
|
+
c && r.remove();
|
|
166
178
|
}));
|
|
167
179
|
}
|
|
168
180
|
},
|
|
169
181
|
reloadMicroAppRoute: async (e, t) => {
|
|
170
|
-
const n = f.value.find((
|
|
171
|
-
n && (!n.loaded || !n.actived || (n.dom || await new Promise((
|
|
182
|
+
const n = f.value.find((s) => s.name === e);
|
|
183
|
+
n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "reload", path: t })));
|
|
172
184
|
},
|
|
173
185
|
unloadMicroAppRoute: async (e, t) => {
|
|
174
|
-
const n = f.value.find((
|
|
175
|
-
n && (!n.loaded || !n.actived || (n.dom || await new Promise((
|
|
186
|
+
const n = f.value.find((s) => s.name === e);
|
|
187
|
+
n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "unload", path: t })));
|
|
176
188
|
},
|
|
177
189
|
setMainAppLayoutVisible: (e) => {
|
|
178
190
|
q("layoutVisible", { visible: e });
|
|
179
191
|
}
|
|
180
|
-
},
|
|
192
|
+
}, u = P({
|
|
181
193
|
visible: !1,
|
|
182
194
|
theme: "default",
|
|
183
195
|
logo: "",
|
|
@@ -189,56 +201,56 @@ const b = (e, t, n) => {
|
|
|
189
201
|
// activeItem: '',
|
|
190
202
|
// activeProject: {},
|
|
191
203
|
eventListeners: {}
|
|
192
|
-
}),
|
|
204
|
+
}), W = {
|
|
193
205
|
show: () => {
|
|
194
|
-
|
|
206
|
+
u.visible = !0;
|
|
195
207
|
},
|
|
196
208
|
hide: () => {
|
|
197
|
-
|
|
209
|
+
u.visible = !1;
|
|
198
210
|
},
|
|
199
211
|
setLogo: (e) => {
|
|
200
|
-
|
|
212
|
+
u.logo = e;
|
|
201
213
|
},
|
|
202
214
|
setTheme: (e) => {
|
|
203
|
-
|
|
215
|
+
u.theme = e;
|
|
204
216
|
},
|
|
205
217
|
setItems: (e) => {
|
|
206
|
-
|
|
218
|
+
u.visible || (u.visible = !0), u.items = e;
|
|
207
219
|
},
|
|
208
|
-
getItems: () =>
|
|
220
|
+
getItems: () => u.items,
|
|
209
221
|
removeItem: (e) => {
|
|
210
|
-
const t =
|
|
211
|
-
|
|
222
|
+
const t = u.items.filter((n) => n.value !== e);
|
|
223
|
+
u.items = t;
|
|
212
224
|
},
|
|
213
225
|
appendItem: (e) => {
|
|
214
|
-
|
|
226
|
+
u.visible || (u.visible = !0), !u.items.find((n) => n.value == e.value) && u.items.push(e);
|
|
215
227
|
},
|
|
216
228
|
setActiveItem: (e) => {
|
|
217
|
-
|
|
229
|
+
u.activeItem = e;
|
|
218
230
|
},
|
|
219
231
|
setConfig: (e) => {
|
|
220
|
-
|
|
232
|
+
u.config = e;
|
|
221
233
|
},
|
|
222
234
|
setProjects: (e) => {
|
|
223
|
-
|
|
235
|
+
u.projects = e;
|
|
224
236
|
},
|
|
225
237
|
setProjectConfig: (e) => {
|
|
226
|
-
|
|
238
|
+
u.projectConfig = e;
|
|
227
239
|
},
|
|
228
240
|
setActiveProject: (e) => {
|
|
229
|
-
|
|
241
|
+
u.activeProject = e;
|
|
230
242
|
},
|
|
231
243
|
setUserInfo: (e) => {
|
|
232
|
-
|
|
244
|
+
u.userInfo = e;
|
|
233
245
|
},
|
|
234
246
|
setSearchConfig: (e) => {
|
|
235
|
-
|
|
247
|
+
u.searchConfig = e;
|
|
236
248
|
},
|
|
237
249
|
triggerEventListener: (e, t, n) => {
|
|
238
250
|
var i;
|
|
239
|
-
const
|
|
240
|
-
for (const
|
|
241
|
-
const o = r
|
|
251
|
+
const s = u.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
252
|
+
for (const r in s) {
|
|
253
|
+
const o = s[r];
|
|
242
254
|
o.type === e && a.push(
|
|
243
255
|
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
244
256
|
c && o.remove();
|
|
@@ -248,10 +260,10 @@ const b = (e, t, n) => {
|
|
|
248
260
|
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
249
261
|
},
|
|
250
262
|
addEventListener: (e, t) => {
|
|
251
|
-
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8),
|
|
252
|
-
|
|
263
|
+
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
264
|
+
u.eventListeners[n] && delete u.eventListeners[n];
|
|
253
265
|
};
|
|
254
|
-
return
|
|
266
|
+
return u.eventListeners[n] = {
|
|
255
267
|
type: e,
|
|
256
268
|
handler: async (c) => {
|
|
257
269
|
try {
|
|
@@ -260,17 +272,17 @@ const b = (e, t, n) => {
|
|
|
260
272
|
throw a;
|
|
261
273
|
}
|
|
262
274
|
},
|
|
263
|
-
remove:
|
|
275
|
+
remove: s
|
|
264
276
|
}, {
|
|
265
|
-
remove:
|
|
277
|
+
remove: s
|
|
266
278
|
};
|
|
267
279
|
}
|
|
268
|
-
}, g =
|
|
280
|
+
}, g = P({
|
|
269
281
|
theme: "default",
|
|
270
282
|
items: [],
|
|
271
283
|
collapse: !1,
|
|
272
284
|
eventListeners: {}
|
|
273
|
-
}),
|
|
285
|
+
}), j = {
|
|
274
286
|
setItems: (e) => {
|
|
275
287
|
g.items = e;
|
|
276
288
|
},
|
|
@@ -289,9 +301,9 @@ const b = (e, t, n) => {
|
|
|
289
301
|
},
|
|
290
302
|
triggerEventListener: (e, t, n) => {
|
|
291
303
|
var i;
|
|
292
|
-
const
|
|
293
|
-
for (const
|
|
294
|
-
const o = r
|
|
304
|
+
const s = g.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
305
|
+
for (const r in s) {
|
|
306
|
+
const o = s[r];
|
|
295
307
|
o.type === e && a.push(
|
|
296
308
|
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
297
309
|
c && o.remove();
|
|
@@ -301,7 +313,7 @@ const b = (e, t, n) => {
|
|
|
301
313
|
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
302
314
|
},
|
|
303
315
|
addEventListener: (e, t) => {
|
|
304
|
-
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8),
|
|
316
|
+
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
305
317
|
g.eventListeners[n] && delete g.eventListeners[n];
|
|
306
318
|
};
|
|
307
319
|
return g.eventListeners[n] = {
|
|
@@ -313,39 +325,39 @@ const b = (e, t, n) => {
|
|
|
313
325
|
throw a;
|
|
314
326
|
}
|
|
315
327
|
},
|
|
316
|
-
remove:
|
|
328
|
+
remove: s
|
|
317
329
|
}, {
|
|
318
|
-
remove:
|
|
330
|
+
remove: s
|
|
319
331
|
};
|
|
320
332
|
}
|
|
321
|
-
},
|
|
333
|
+
}, A = P({
|
|
322
334
|
theme: "default",
|
|
323
335
|
items: [],
|
|
324
336
|
eventListeners: {}
|
|
325
|
-
}),
|
|
337
|
+
}), H = {
|
|
326
338
|
setItems: (e) => {
|
|
327
|
-
|
|
339
|
+
A.items = e;
|
|
328
340
|
},
|
|
329
|
-
getItems: () =>
|
|
341
|
+
getItems: () => A.items,
|
|
330
342
|
setTheme: (e) => {
|
|
331
|
-
|
|
343
|
+
A.theme = e;
|
|
332
344
|
},
|
|
333
345
|
removeItem: (e) => {
|
|
334
|
-
const t =
|
|
335
|
-
|
|
346
|
+
const t = A.items.filter((n) => n.value !== e);
|
|
347
|
+
A.items = t;
|
|
336
348
|
},
|
|
337
349
|
appendItem: (e) => {
|
|
338
|
-
const t =
|
|
339
|
-
t !== -1 ?
|
|
350
|
+
const t = A.items.findIndex((n) => n.value == e.value);
|
|
351
|
+
t !== -1 ? A.items.splice(t, 1, e) : A.items.push(e);
|
|
340
352
|
},
|
|
341
353
|
setActiveItem: (e) => {
|
|
342
|
-
|
|
354
|
+
A.activeItem = e;
|
|
343
355
|
},
|
|
344
356
|
triggerEventListener: (e, t, n) => {
|
|
345
357
|
var i;
|
|
346
|
-
const
|
|
347
|
-
for (const
|
|
348
|
-
const o = r
|
|
358
|
+
const s = A.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
359
|
+
for (const r in s) {
|
|
360
|
+
const o = s[r];
|
|
349
361
|
o.type === e && a.push(
|
|
350
362
|
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
351
363
|
c && o.remove();
|
|
@@ -355,10 +367,10 @@ const b = (e, t, n) => {
|
|
|
355
367
|
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
356
368
|
},
|
|
357
369
|
addEventListener: (e, t) => {
|
|
358
|
-
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8),
|
|
359
|
-
|
|
370
|
+
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
371
|
+
A.eventListeners[n] && delete A.eventListeners[n];
|
|
360
372
|
};
|
|
361
|
-
return
|
|
373
|
+
return A.eventListeners[n] = {
|
|
362
374
|
type: e,
|
|
363
375
|
handler: async (c) => {
|
|
364
376
|
try {
|
|
@@ -367,19 +379,19 @@ const b = (e, t, n) => {
|
|
|
367
379
|
throw a;
|
|
368
380
|
}
|
|
369
381
|
},
|
|
370
|
-
remove:
|
|
382
|
+
remove: s
|
|
371
383
|
}, {
|
|
372
|
-
remove:
|
|
384
|
+
remove: s
|
|
373
385
|
};
|
|
374
386
|
}
|
|
375
|
-
},
|
|
387
|
+
}, R = P({
|
|
376
388
|
eventListeners: {}
|
|
377
|
-
}),
|
|
389
|
+
}), Ce = {
|
|
378
390
|
triggerEventListener: (e, t, n) => {
|
|
379
391
|
var i;
|
|
380
|
-
const
|
|
381
|
-
for (const
|
|
382
|
-
const o = r
|
|
392
|
+
const s = R.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
393
|
+
for (const r in s) {
|
|
394
|
+
const o = s[r];
|
|
383
395
|
o.type === e && a.push(
|
|
384
396
|
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
385
397
|
c && o.remove();
|
|
@@ -389,10 +401,10 @@ const b = (e, t, n) => {
|
|
|
389
401
|
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
390
402
|
},
|
|
391
403
|
addEventListener: (e, t) => {
|
|
392
|
-
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8),
|
|
393
|
-
|
|
404
|
+
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
|
|
405
|
+
R.eventListeners[n] && delete R.eventListeners[n];
|
|
394
406
|
};
|
|
395
|
-
return
|
|
407
|
+
return R.eventListeners[n] = {
|
|
396
408
|
type: e,
|
|
397
409
|
handler: async (c) => {
|
|
398
410
|
try {
|
|
@@ -401,55 +413,50 @@ const b = (e, t, n) => {
|
|
|
401
413
|
throw a;
|
|
402
414
|
}
|
|
403
415
|
},
|
|
404
|
-
remove:
|
|
416
|
+
remove: s
|
|
405
417
|
}, {
|
|
406
|
-
remove:
|
|
418
|
+
remove: s
|
|
407
419
|
};
|
|
408
420
|
}
|
|
409
|
-
},
|
|
421
|
+
}, U = P({
|
|
410
422
|
visible: !1,
|
|
411
423
|
style: {}
|
|
412
|
-
}),
|
|
424
|
+
}), Oe = {
|
|
413
425
|
set: (e, t) => {
|
|
414
|
-
|
|
426
|
+
U.visible = e, t || (t = {}), t.transition || (t.transition = "all 0.3s"), t && (U.style = t);
|
|
415
427
|
}
|
|
416
|
-
},
|
|
417
|
-
nav: l,
|
|
418
|
-
menu: g,
|
|
419
|
-
tab: v,
|
|
420
|
-
overlay: W,
|
|
421
|
-
iframeView: P,
|
|
428
|
+
}, Fe = {
|
|
422
429
|
visible: w(!0)
|
|
423
430
|
}, G = {
|
|
424
|
-
nav:
|
|
425
|
-
menu:
|
|
426
|
-
tab:
|
|
427
|
-
overlay:
|
|
428
|
-
iframeView:
|
|
429
|
-
setVisible: (e) =>
|
|
431
|
+
nav: W,
|
|
432
|
+
menu: j,
|
|
433
|
+
tab: H,
|
|
434
|
+
overlay: Oe,
|
|
435
|
+
iframeView: Ce,
|
|
436
|
+
setVisible: (e) => Fe.visible.value = e,
|
|
430
437
|
setTheme: (e) => {
|
|
431
|
-
|
|
438
|
+
W.setTheme(e), j.setTheme(e), H.setTheme(e);
|
|
432
439
|
}
|
|
433
|
-
},
|
|
440
|
+
}, re = (e, t) => {
|
|
434
441
|
const n = e.__vccOpts || e;
|
|
435
|
-
for (const [
|
|
436
|
-
n[
|
|
442
|
+
for (const [s, c] of t)
|
|
443
|
+
n[s] = c;
|
|
437
444
|
return n;
|
|
438
445
|
};
|
|
439
446
|
var J;
|
|
440
|
-
const B = typeof window < "u",
|
|
447
|
+
const B = typeof window < "u", Re = (e) => typeof e == "string", Ne = () => {
|
|
441
448
|
};
|
|
442
449
|
B && ((J = window == null ? void 0 : window.navigator) != null && J.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
443
450
|
function ae(e) {
|
|
444
451
|
return typeof e == "function" ? e() : I(e);
|
|
445
452
|
}
|
|
446
|
-
function
|
|
453
|
+
function De(e) {
|
|
447
454
|
return e;
|
|
448
455
|
}
|
|
449
456
|
function ie(e) {
|
|
450
457
|
return ue() ? (de(e), !0) : !1;
|
|
451
458
|
}
|
|
452
|
-
function
|
|
459
|
+
function ke(e, t = !0) {
|
|
453
460
|
pe() ? me(e) : t ? e() : ne(e);
|
|
454
461
|
}
|
|
455
462
|
function oe(e) {
|
|
@@ -457,24 +464,24 @@ function oe(e) {
|
|
|
457
464
|
const n = ae(e);
|
|
458
465
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
459
466
|
}
|
|
460
|
-
const
|
|
461
|
-
function
|
|
462
|
-
let t, n,
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
465
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
467
|
+
const xe = B ? window : void 0, Ve = B ? window.document : void 0;
|
|
468
|
+
function qe(...e) {
|
|
469
|
+
let t, n, s, c;
|
|
470
|
+
if (Re(e[0]) || Array.isArray(e[0]) ? ([n, s, c] = e, t = xe) : [t, n, s, c] = e, !t)
|
|
471
|
+
return Ne;
|
|
472
|
+
Array.isArray(n) || (n = [n]), Array.isArray(s) || (s = [s]);
|
|
466
473
|
const a = [], i = () => {
|
|
467
|
-
a.forEach((
|
|
468
|
-
},
|
|
469
|
-
i(),
|
|
474
|
+
a.forEach((l) => l()), a.length = 0;
|
|
475
|
+
}, r = (l, y, m, L) => (l.addEventListener(y, m, L), () => l.removeEventListener(y, m, L)), o = M(() => [oe(t), ae(c)], ([l, y]) => {
|
|
476
|
+
i(), l && a.push(...n.flatMap((m) => s.map((L) => r(l, m, L, y))));
|
|
470
477
|
}, { immediate: !0, flush: "post" }), p = () => {
|
|
471
478
|
o(), i();
|
|
472
479
|
};
|
|
473
480
|
return ie(p), p;
|
|
474
481
|
}
|
|
475
|
-
function
|
|
476
|
-
const n = w(),
|
|
477
|
-
return
|
|
482
|
+
function Qe(e, t = !1) {
|
|
483
|
+
const n = w(), s = () => n.value = !!e();
|
|
484
|
+
return s(), ke(s, t), n;
|
|
478
485
|
}
|
|
479
486
|
const K = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, X = "__vueuse_ssr_handlers__";
|
|
480
487
|
K[X] = K[X] || {};
|
|
@@ -520,10 +527,10 @@ const Y = [
|
|
|
520
527
|
"MSFullscreenError"
|
|
521
528
|
]
|
|
522
529
|
];
|
|
523
|
-
function
|
|
524
|
-
const { document: n =
|
|
530
|
+
function Be(e, t = {}) {
|
|
531
|
+
const { document: n = Ve, autoExit: s = !1 } = t, c = n == null ? void 0 : n.querySelector("html"), a = w(!1);
|
|
525
532
|
let i = Y[0];
|
|
526
|
-
const
|
|
533
|
+
const r = Qe(() => {
|
|
527
534
|
if (n) {
|
|
528
535
|
for (const S of Y)
|
|
529
536
|
if (S[1] in n)
|
|
@@ -531,26 +538,26 @@ function qe(e, t = {}) {
|
|
|
531
538
|
} else
|
|
532
539
|
return !1;
|
|
533
540
|
return !1;
|
|
534
|
-
}), [o, p,
|
|
541
|
+
}), [o, p, l, , y] = i;
|
|
535
542
|
async function m() {
|
|
536
|
-
|
|
543
|
+
r.value && (n != null && n[l] && await n[p](), a.value = !1);
|
|
537
544
|
}
|
|
538
|
-
async function
|
|
539
|
-
if (!
|
|
545
|
+
async function L() {
|
|
546
|
+
if (!r.value)
|
|
540
547
|
return;
|
|
541
548
|
await m();
|
|
542
549
|
const S = oe(c);
|
|
543
550
|
S && (await S[o](), a.value = !0);
|
|
544
551
|
}
|
|
545
552
|
async function le() {
|
|
546
|
-
a.value ? await m() : await
|
|
553
|
+
a.value ? await m() : await L();
|
|
547
554
|
}
|
|
548
|
-
return n &&
|
|
549
|
-
a.value = !!(n != null && n[
|
|
550
|
-
}, !1),
|
|
551
|
-
isSupported:
|
|
555
|
+
return n && qe(n, y, () => {
|
|
556
|
+
a.value = !!(n != null && n[l]);
|
|
557
|
+
}, !1), s && ie(m), {
|
|
558
|
+
isSupported: r,
|
|
552
559
|
isFullscreen: a,
|
|
553
|
-
enter:
|
|
560
|
+
enter: L,
|
|
554
561
|
exit: m,
|
|
555
562
|
toggle: le
|
|
556
563
|
};
|
|
@@ -559,15 +566,15 @@ var Z;
|
|
|
559
566
|
(function(e) {
|
|
560
567
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
561
568
|
})(Z || (Z = {}));
|
|
562
|
-
var
|
|
569
|
+
var $e = Object.defineProperty, ee = Object.getOwnPropertySymbols, ze = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable, te = (e, t, n) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, je = (e, t) => {
|
|
563
570
|
for (var n in t || (t = {}))
|
|
564
|
-
|
|
571
|
+
ze.call(t, n) && te(e, n, t[n]);
|
|
565
572
|
if (ee)
|
|
566
573
|
for (var n of ee(t))
|
|
567
|
-
|
|
574
|
+
We.call(t, n) && te(e, n, t[n]);
|
|
568
575
|
return e;
|
|
569
576
|
};
|
|
570
|
-
const
|
|
577
|
+
const He = {
|
|
571
578
|
easeInSine: [0.12, 0, 0.39, 0],
|
|
572
579
|
easeOutSine: [0.61, 1, 0.88, 1],
|
|
573
580
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
@@ -593,10 +600,10 @@ const ze = {
|
|
|
593
600
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
594
601
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
595
602
|
};
|
|
596
|
-
|
|
597
|
-
linear:
|
|
598
|
-
},
|
|
599
|
-
const
|
|
603
|
+
je({
|
|
604
|
+
linear: De
|
|
605
|
+
}, He);
|
|
606
|
+
const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
|
|
600
607
|
__name: "das-micro-app",
|
|
601
608
|
props: {
|
|
602
609
|
src: {},
|
|
@@ -605,27 +612,27 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
605
612
|
},
|
|
606
613
|
emits: ["onLoaded", "onActivated", "onDeactivated"],
|
|
607
614
|
setup(e, { emit: t }) {
|
|
608
|
-
const n = e,
|
|
609
|
-
|
|
610
|
-
}, a =
|
|
611
|
-
return M(() => a.value, (
|
|
612
|
-
|
|
613
|
-
}), (
|
|
615
|
+
const n = e, s = t, c = (r) => {
|
|
616
|
+
s("onLoaded", r);
|
|
617
|
+
}, a = N(() => n.actived);
|
|
618
|
+
return M(() => a.value, (r) => {
|
|
619
|
+
r && s("onActivated"), r || s("onDeactivated");
|
|
620
|
+
}), (r, o) => (E(), D("iframe", {
|
|
614
621
|
class: "das-micro-app",
|
|
615
622
|
src: n.src,
|
|
616
623
|
entry: n.src,
|
|
617
624
|
name: n.name,
|
|
618
625
|
frameborder: "0",
|
|
619
626
|
onLoad: c
|
|
620
|
-
}, null, 40,
|
|
627
|
+
}, null, 40, Ue));
|
|
621
628
|
}
|
|
622
|
-
}),
|
|
629
|
+
}), Je = /* @__PURE__ */ re(Ge, [["__scopeId", "data-v-8ae871f6"]]), Ke = /* @__PURE__ */ x({
|
|
623
630
|
__name: "das-micro-apps",
|
|
624
631
|
setup(e) {
|
|
625
632
|
const t = w(null), n = async (a, i) => {
|
|
626
|
-
const
|
|
627
|
-
if (!
|
|
628
|
-
|
|
633
|
+
const r = f.value.find((m) => m.name === i);
|
|
634
|
+
if (!r) return;
|
|
635
|
+
r.dom = a.target, await ne(), await new Promise((m) => setTimeout(m, 50));
|
|
629
636
|
const o = () => {
|
|
630
637
|
const m = t.value.getBoundingClientRect() || {};
|
|
631
638
|
return m.width = t.value.clientWidth, m.height = t.value.clientHeight, m;
|
|
@@ -633,25 +640,25 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
633
640
|
d.sendMessageToMicroApp(i, "onLoaded", {
|
|
634
641
|
href: location.href,
|
|
635
642
|
microAppContainerRect: o(),
|
|
636
|
-
entry:
|
|
637
|
-
name:
|
|
643
|
+
entry: r.entry,
|
|
644
|
+
name: r.name
|
|
638
645
|
});
|
|
639
|
-
const { dom: p, ...
|
|
640
|
-
d.triggerMicroAppLifeCycleListener("onLoaded",
|
|
646
|
+
const { dom: p, ...l } = r;
|
|
647
|
+
d.triggerMicroAppLifeCycleListener("onLoaded", l), new ResizeObserver(() => {
|
|
641
648
|
d.sendMessageToMicroApp(i, "resize", o());
|
|
642
649
|
}).observe(t.value), d.sendMessageToMicroApp(i, "setProxyMessageStatus", { visible: !0, parentHref: location.href }), d.sendMessageToMicroApp(i, "setProxSsoStatus", { visible: !0, parentHref: location.href });
|
|
643
|
-
},
|
|
644
|
-
const
|
|
645
|
-
if (!
|
|
646
|
-
const { dom: o, ...p } =
|
|
650
|
+
}, s = (a, i) => {
|
|
651
|
+
const r = f.value.find((l) => l.name === i);
|
|
652
|
+
if (!r) return;
|
|
653
|
+
const { dom: o, ...p } = r;
|
|
647
654
|
d.sendMessageToMicroApp(i, "onActivated"), d.triggerMicroAppLifeCycleListener("onActivated", p);
|
|
648
655
|
}, c = (a, i) => {
|
|
649
|
-
const
|
|
650
|
-
if (!
|
|
651
|
-
const { dom: o, ...p } =
|
|
656
|
+
const r = f.value.find((l) => l.name === i);
|
|
657
|
+
if (!r) return;
|
|
658
|
+
const { dom: o, ...p } = r;
|
|
652
659
|
d.sendMessageToMicroApp(i, "onDeactivated"), d.triggerMicroAppLifeCycleListener("onDeactivated", p);
|
|
653
660
|
};
|
|
654
|
-
return (a, i) => (E(),
|
|
661
|
+
return (a, i) => (E(), D(
|
|
655
662
|
"div",
|
|
656
663
|
{
|
|
657
664
|
ref_key: "containerRef",
|
|
@@ -659,24 +666,24 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
659
666
|
class: "das-micro-app-container"
|
|
660
667
|
},
|
|
661
668
|
[
|
|
662
|
-
(E(!0),
|
|
669
|
+
(E(!0), D(
|
|
663
670
|
$,
|
|
664
671
|
null,
|
|
665
|
-
fe(I(f), (
|
|
672
|
+
fe(I(f), (r) => (E(), D(
|
|
666
673
|
$,
|
|
667
674
|
null,
|
|
668
675
|
[
|
|
669
|
-
|
|
676
|
+
r.loaded ? ve((E(), se(Je, {
|
|
670
677
|
key: 0,
|
|
671
|
-
src:
|
|
672
|
-
name:
|
|
673
|
-
actived:
|
|
674
|
-
onOnLoaded: (o) => n(o,
|
|
675
|
-
onOnActivated: (o) =>
|
|
676
|
-
onOnDeactivated: (o) => c(o,
|
|
678
|
+
src: r.src || "",
|
|
679
|
+
name: r.name,
|
|
680
|
+
actived: r.actived,
|
|
681
|
+
onOnLoaded: (o) => n(o, r.name),
|
|
682
|
+
onOnActivated: (o) => s(o, r.name),
|
|
683
|
+
onOnDeactivated: (o) => c(o, r.name)
|
|
677
684
|
}, null, 8, ["src", "name", "actived", "onOnLoaded", "onOnActivated", "onOnDeactivated"])), [
|
|
678
|
-
[
|
|
679
|
-
]) :
|
|
685
|
+
[Ae, r.actived]
|
|
686
|
+
]) : he("v-if", !0)
|
|
680
687
|
],
|
|
681
688
|
64
|
|
682
689
|
/* STABLE_FRAGMENT */
|
|
@@ -689,7 +696,7 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
689
696
|
/* NEED_PATCH */
|
|
690
697
|
));
|
|
691
698
|
}
|
|
692
|
-
}),
|
|
699
|
+
}), Xe = /* @__PURE__ */ re(Ke, [["__scopeId", "data-v-3abdb1e9"]]), tt = /* @__PURE__ */ x({
|
|
693
700
|
__name: "das-main-app-layout",
|
|
694
701
|
props: {
|
|
695
702
|
transitionConfig: { default: () => {
|
|
@@ -703,31 +710,31 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
703
710
|
} }
|
|
704
711
|
},
|
|
705
712
|
setup(e) {
|
|
706
|
-
const t = e, n =
|
|
713
|
+
const t = e, n = N(() => !k.value), s = N(() => ({
|
|
707
714
|
"enter-active-class": "animate__animated animate__fadeInLeft",
|
|
708
715
|
...t.transitionConfig
|
|
709
|
-
})), c =
|
|
710
|
-
return (a, i) => (E(),
|
|
711
|
-
"transition-config":
|
|
716
|
+
})), c = N(() => ({ showLayout: t.showLayout, showAside: t.showAside, showTabs: t.showTabs }));
|
|
717
|
+
return (a, i) => (E(), se(I(ye), we({
|
|
718
|
+
"transition-config": s.value,
|
|
712
719
|
"router-view-visible": n.value
|
|
713
720
|
}, c.value), {
|
|
714
|
-
header:
|
|
721
|
+
header: T(() => [
|
|
715
722
|
V(a.$slots, "header", {}, () => [
|
|
716
|
-
|
|
723
|
+
C(I(_e))
|
|
717
724
|
])
|
|
718
725
|
]),
|
|
719
|
-
aside:
|
|
726
|
+
aside: T(() => [
|
|
720
727
|
V(a.$slots, "aside", {}, () => [
|
|
721
|
-
|
|
728
|
+
C(I(Le), { menuAttr: a.menuAttr }, null, 8, ["menuAttr"])
|
|
722
729
|
])
|
|
723
730
|
]),
|
|
724
|
-
tab:
|
|
731
|
+
tab: T(() => [
|
|
725
732
|
V(a.$slots, "tab", {}, () => [
|
|
726
|
-
|
|
733
|
+
C(I(Me), { tabsAttr: a.tabsAttr }, null, 8, ["tabsAttr"])
|
|
727
734
|
])
|
|
728
735
|
]),
|
|
729
|
-
default:
|
|
730
|
-
|
|
736
|
+
default: T(() => [
|
|
737
|
+
C(Xe)
|
|
731
738
|
]),
|
|
732
739
|
_: 3
|
|
733
740
|
/* FORWARDED */
|
|
@@ -742,9 +749,9 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
742
749
|
}, 300);
|
|
743
750
|
}), (t, n) => null;
|
|
744
751
|
}
|
|
745
|
-
}),
|
|
752
|
+
}), Ye = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.startsWith(n)) ? e : `/${e}`, nt = (e, t) => {
|
|
746
753
|
if (!(e != null && e.microApps) || !Array.isArray(e.microApps)) return;
|
|
747
|
-
window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (z.value = e.microAppRouterPrefix), f.value = (e.microApps || []).filter((c) => !!c.name).map((c) => ({ ...c, entry:
|
|
754
|
+
window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (z.value = e.microAppRouterPrefix), f.value = (e.microApps || []).filter((c) => !!c.name).map((c) => ({ ...c, entry: Ye(c.entry || c.name) })), t == null || t.addRoute({
|
|
748
755
|
name: "das-micro-app",
|
|
749
756
|
path: `${z.value}/:pathMatch(.*)*`,
|
|
750
757
|
component: ce,
|
|
@@ -756,18 +763,18 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
756
763
|
const { visible: a } = c.data;
|
|
757
764
|
G.setVisible(a);
|
|
758
765
|
}), d.addEventListenerFromMicroApp("route", (c) => {
|
|
759
|
-
const { name: a, cmd: i, path:
|
|
760
|
-
i === "reload" && d.reloadMicroAppRoute(a,
|
|
766
|
+
const { name: a, cmd: i, path: r } = c.data;
|
|
767
|
+
i === "reload" && d.reloadMicroAppRoute(a, r), i === "unload" && d.unloadMicroAppRoute(a, r);
|
|
761
768
|
});
|
|
762
|
-
const { enter: n, exit:
|
|
769
|
+
const { enter: n, exit: s } = Be();
|
|
763
770
|
d.addEventListenerFromMicroApp("fullscreen", (c) => {
|
|
764
771
|
const a = c.data;
|
|
765
|
-
a && n(), a ||
|
|
772
|
+
a && n(), a || s();
|
|
766
773
|
}), d.addEventListenerFromMicroApp("location", (c) => {
|
|
767
774
|
const { cmd: a, isAutoCloseApp: i } = c.data || {};
|
|
768
775
|
a === "reload" && (i !== void 0 && (window.__isAutoCloseApp = i), location.reload());
|
|
769
776
|
});
|
|
770
|
-
},
|
|
777
|
+
}, st = (e, t) => {
|
|
771
778
|
if (!(e != null && e.microAppName)) return;
|
|
772
779
|
window.config.microAppName = e.microAppName, window.self !== window.top && e.microAppName && (window.__IN_DAS_MICRO_APP = !0);
|
|
773
780
|
const n = "das-micro-app-ghost";
|
|
@@ -777,19 +784,19 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
777
784
|
component: ce,
|
|
778
785
|
meta: { isMicroApp: !0, keepAlive: !0 }
|
|
779
786
|
});
|
|
780
|
-
const
|
|
787
|
+
const s = w(!1), c = w(!1), a = w("");
|
|
781
788
|
M(
|
|
782
789
|
() => t.currentRoute.value,
|
|
783
790
|
(i) => {
|
|
784
|
-
if (
|
|
785
|
-
|
|
791
|
+
if (s.value) {
|
|
792
|
+
s.value = !1;
|
|
786
793
|
return;
|
|
787
794
|
}
|
|
788
795
|
if (c.value) {
|
|
789
796
|
c.value = !1;
|
|
790
797
|
return;
|
|
791
798
|
}
|
|
792
|
-
const { path:
|
|
799
|
+
const { path: r, query: o, params: p, meta: l } = i;
|
|
793
800
|
if (a.value.includes(i.path)) {
|
|
794
801
|
a.value = "";
|
|
795
802
|
return;
|
|
@@ -797,45 +804,45 @@ const je = ["src", "entry", "name"], He = /* @__PURE__ */ x({
|
|
|
797
804
|
d.sendMessageToMainApp("router", {
|
|
798
805
|
cmd: "push",
|
|
799
806
|
route: {
|
|
800
|
-
path:
|
|
807
|
+
path: r,
|
|
801
808
|
query: { ...o, microAppName: e.microAppName },
|
|
802
809
|
params: p,
|
|
803
|
-
meta:
|
|
810
|
+
meta: l
|
|
804
811
|
}
|
|
805
812
|
});
|
|
806
813
|
}
|
|
807
814
|
), d.addEventListenerFromMainApp("router", async (i) => {
|
|
808
|
-
var
|
|
809
|
-
const { cmd:
|
|
810
|
-
a.value = ("/" + p + o.path).replace(/\/\//g, "/"), (
|
|
815
|
+
var l;
|
|
816
|
+
const { cmd: r, route: o, microAppName: p = "" } = i.data;
|
|
817
|
+
a.value = ("/" + p + o.path).replace(/\/\//g, "/"), (l = t == null ? void 0 : t[r]) == null || l.call(t, o);
|
|
811
818
|
}), d.addEventListenerFromMainApp("onLoaded", (i) => {
|
|
812
|
-
const { href:
|
|
813
|
-
window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF =
|
|
819
|
+
const { href: r, microAppContainerRect: o } = i.data;
|
|
820
|
+
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;
|
|
814
821
|
}), d.addEventListenerFromMainApp("onDeactivated", (i) => {
|
|
815
|
-
const { name:
|
|
822
|
+
const { name: r = "", path: o, params: p = {}, query: l = {} } = t.currentRoute.value;
|
|
816
823
|
c.value = !0, t == null || t.push({
|
|
817
824
|
name: n,
|
|
818
|
-
query: { microAppName: e.microAppName, fromQuery: JSON.stringify(
|
|
825
|
+
query: { microAppName: e.microAppName, fromQuery: JSON.stringify(l), fromPath: o },
|
|
819
826
|
params: p
|
|
820
827
|
});
|
|
821
828
|
}), d.addEventListenerFromMainApp("onActivated", (i) => {
|
|
822
|
-
const { name:
|
|
823
|
-
|
|
829
|
+
const { name: r = "", params: o = {}, query: p = {} } = t.currentRoute.value, { fromPath: l = "", fromQuery: y = "{}" } = p || {};
|
|
830
|
+
s.value = !0, t == null || t.push({ path: l, query: JSON.parse(y), params: o });
|
|
824
831
|
}), d.addEventListenerFromMainApp("sessionStorage", (i) => {
|
|
825
|
-
const { cmd:
|
|
826
|
-
|
|
832
|
+
const { cmd: r, key: o, value: p } = i.data;
|
|
833
|
+
r === "setItem" && window.sessionStorage.setItem(o, p), r === "getItem" && window.sessionStorage.getItem(o), r === "removeItem" && window.sessionStorage.removeItem(o), r === "clear" && window.sessionStorage.clear();
|
|
827
834
|
}), d.addEventListenerFromMainApp("route", (i) => {
|
|
828
|
-
const { cmd:
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}, 300)),
|
|
832
|
-
|
|
835
|
+
const { cmd: r, path: o } = i.data;
|
|
836
|
+
r === "reload" && (O.value.push(o), F.value = !1, setTimeout(() => {
|
|
837
|
+
F.value = !0, O.value = [];
|
|
838
|
+
}, 300)), r === "unload" && (O.value.push(o), F.value = !1, setTimeout(() => {
|
|
839
|
+
F.value = !0, O.value = [];
|
|
833
840
|
}, 100));
|
|
834
841
|
});
|
|
835
842
|
};
|
|
836
843
|
export {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
844
|
+
tt as DasMainAppLayout,
|
|
845
|
+
nt as initMainApp,
|
|
846
|
+
st as initMicroApp,
|
|
840
847
|
d as microFrontend
|
|
841
848
|
};
|