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