@das-fed/web 6.3.0-beta.8 → 6.4.0-dev.1
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 +11 -9
- package/index-BqgahaIi.js +11086 -0
- package/index-BqgahaIi.js.gz +0 -0
- package/index-CC5hN73H.js +10 -0
- package/index-D4LFa1We.js +68 -0
- package/index-D4LFa1We.js.gz +0 -0
- package/index-DpLK467K.js +70 -0
- package/index-DpLK467K.js.gz +0 -0
- package/index.js +27 -2202
- package/package.json +11 -7
- package/packages/create-das-web-app/index.js +307 -289
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/index.js +29 -30
- package/packages/i18n/index.js.gz +0 -0
- package/packages/layout/index.js +301 -289
- 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-2WWk8ggi.js +9022 -0
- package/packages/main-app-framework/index-2WWk8ggi.js.gz +0 -0
- package/packages/main-app-framework/index-BqkWKMMe.js +70 -0
- package/packages/main-app-framework/index-BqkWKMMe.js.gz +0 -0
- package/packages/main-app-framework/index-CRT8yHn-.js +10 -0
- package/packages/main-app-framework/index-Twj2RXRy.js +68 -0
- package/packages/main-app-framework/index-Twj2RXRy.js.gz +0 -0
- package/packages/main-app-framework/index.js +5 -0
- package/packages/main-app-framework/style.css +1 -0
- package/packages/main-app-framework/style.css.gz +0 -0
- package/packages/micro-frontend/index.js +174 -170
- package/packages/micro-frontend/index.js.gz +0 -0
- package/packages/style/index.js +5 -2
- package/packages/theme/index.js +38 -39
- package/packages/theme/index.js.gz +0 -0
- package/style.css +1 -1
- package/style.css.gz +0 -0
- package/types/create-das-web-app/index.d.ts +1 -1
- package/types/create-das-web-app/router/index.d.ts +2 -1
- package/types/i18n/index.d.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/layout/store/index.d.ts +1 -1
- package/types/main-app-framework/business/alarm/api.d.ts +34 -0
- package/types/main-app-framework/business/alarm/components/hooks/use-handle-alarm.d.ts +7 -0
- package/types/main-app-framework/business/alarm/use-alarm.d.ts +12 -0
- package/types/main-app-framework/business/index.d.ts +4 -0
- package/types/main-app-framework/business/message-notify/index.d.ts +1 -0
- package/types/main-app-framework/business/remote-control/apis.d.ts +6 -0
- package/types/main-app-framework/business/remote-control/createServiceConnection.d.ts +3 -0
- package/types/main-app-framework/business/remote-control/index.d.ts +1 -0
- package/types/main-app-framework/business/video-link/api.d.ts +28 -0
- package/types/main-app-framework/business/video-link/index.d.ts +6 -0
- package/types/main-app-framework/business/video-link/open.d.ts +4 -0
- package/types/main-app-framework/business/video-link/video-dialog/hooks/PlayerProvider.d.ts +4 -0
- package/types/main-app-framework/business/video-link/video-dialog/hooks/index.d.ts +6 -0
- package/types/main-app-framework/components/entry-page-tip/index.d.ts +3 -0
- package/types/main-app-framework/components/entry-page-tip/src/index.d.ts +1 -0
- package/types/main-app-framework/components/entry-page-tip/src/open.d.ts +5 -0
- package/types/main-app-framework/components/entry-page-tip/theme/index.d.ts +6 -0
- package/types/main-app-framework/components/index.d.ts +3 -0
- package/types/main-app-framework/components/person-set-dialog/index.d.ts +4 -0
- package/types/main-app-framework/components/person-set-dialog/src/api.d.ts +2 -0
- package/types/main-app-framework/components/watermark/index.d.ts +3 -0
- package/types/main-app-framework/components/watermark/src/api.d.ts +1 -0
- package/types/main-app-framework/constant/index.d.ts +6 -0
- package/types/main-app-framework/index.d.ts +28 -0
- package/types/main-app-framework/init-config/get-manu-config/api.d.ts +4 -0
- package/types/main-app-framework/init-config/get-manu-config/getInstanceInfo.d.ts +1 -0
- package/types/main-app-framework/init-config/get-manu-config/index.d.ts +47 -0
- 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 -0
- package/types/main-app-framework/init-config/get-project-config/api.d.ts +4 -0
- package/types/main-app-framework/init-config/get-project-config/index.d.ts +1 -0
- package/types/main-app-framework/init-config/get-system-config/api.d.ts +8 -0
- package/types/main-app-framework/init-config/get-system-config/index.d.ts +11 -0
- package/types/main-app-framework/init-config/get-tenant-config/api.d.ts +6 -0
- package/types/main-app-framework/init-config/get-tenant-config/index.d.ts +6 -0
- package/types/main-app-framework/init-config/index.d.ts +5 -0
- package/types/main-app-framework/init-layout/apis/index.d.ts +2 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/index.d.ts +4 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/use-change-enterprises.d.ts +8 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/use-project.d.ts +1 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/use-search.d.ts +4 -0
- package/types/main-app-framework/init-layout/hooks/nav-slots/use-user-command.d.ts +4 -0
- package/types/main-app-framework/init-layout/hooks/use-entry-app.d.ts +11 -0
- package/types/main-app-framework/init-layout/hooks/use-entry-menu.d.ts +7 -0
- package/types/main-app-framework/init-layout/hooks/use-initialization.d.ts +8 -0
- package/types/main-app-framework/init-layout/hooks/use-menu.d.ts +1 -0
- package/types/main-app-framework/init-layout/hooks/use-nav.d.ts +1 -0
- package/types/main-app-framework/init-layout/hooks/use-route-reload-unload.d.ts +4 -0
- package/types/main-app-framework/init-layout/hooks/use-route-watcher.d.ts +3 -0
- package/types/main-app-framework/init-layout/hooks/use-system-confirm.d.ts +1 -0
- package/types/main-app-framework/init-layout/hooks/use-tabs.d.ts +5 -0
- package/types/main-app-framework/init-layout/index.d.ts +11 -0
- package/types/main-app-framework/init-layout/store/index.d.ts +4 -0
- package/types/main-app-framework/init-platform/api.d.ts +2 -0
- package/types/main-app-framework/init-platform/index.d.ts +4 -0
- package/types/main-app-framework/micro-apps/index.d.ts +3 -0
- package/types/main-app-framework/micro-apps/use-device-panel-watcher.d.ts +1 -0
- package/types/main-app-framework/micro-apps/use-iot-watcher.d.ts +1 -0
- package/types/main-app-framework/micro-apps/use-user-info-watcher.d.ts +3 -0
- package/types/main-app-framework/pages/app/api.d.ts +2 -0
- package/types/main-app-framework/utils/index.d.ts +3 -0
- package/types/main-app-framework/utils/src/layout-confirm.d.ts +12 -0
- package/types/main-app-framework/utils/src/set-common-info.d.ts +62 -0
- package/types/main-app-framework/utils/src/tools.d.ts +1 -0
- package/types/micro-frontend/store.d.ts +5 -5
- package/types/theme/index.d.ts +1 -1
- package/index.js.gz +0 -0
- package/types/create-das-web-app/get-global-config.d.ts +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@das-fed/web/packages/micro-frontend/style.css';
|
|
2
|
+
import { defineComponent as x, computed as T, watch as y, openBlock as I, createElementBlock as N, ref as w, Fragment as $, renderList as oe, unref as E, withDirectives as ce, createBlock as Z, vShow as le, createCommentVNode as ue, nextTick as ee, mergeProps as de, withCtx as C, renderSlot as V, createVNode as F, onActivated as pe, reactive as O, getCurrentScope as me, onScopeDispose as fe, getCurrentInstance as ve, onMounted as Ae } from "vue";
|
|
2
3
|
import { DasWebLayout as he, DasWebNav as we, DasWebMenu as ge, DasWebTabs as _e } from "@das-fed/web/packages/layout/index";
|
|
3
4
|
const ye = ["src", "entry", "name"], Me = /* @__PURE__ */ x({
|
|
4
5
|
__name: "das-micro-app",
|
|
@@ -11,10 +12,10 @@ const ye = ["src", "entry", "name"], Me = /* @__PURE__ */ x({
|
|
|
11
12
|
setup(e, { emit: t }) {
|
|
12
13
|
const n = e, r = t, c = (s) => {
|
|
13
14
|
r("onLoaded", s);
|
|
14
|
-
},
|
|
15
|
-
return
|
|
15
|
+
}, a = T(() => n.actived);
|
|
16
|
+
return y(() => a.value, (s) => {
|
|
16
17
|
s && r("onActivated"), s || r("onDeactivated");
|
|
17
|
-
}), (s,
|
|
18
|
+
}), (s, o) => (I(), N("iframe", {
|
|
18
19
|
class: "das-micro-app",
|
|
19
20
|
src: n.src,
|
|
20
21
|
entry: n.src,
|
|
@@ -28,24 +29,24 @@ const ye = ["src", "entry", "name"], Me = /* @__PURE__ */ x({
|
|
|
28
29
|
for (const [r, c] of t)
|
|
29
30
|
n[r] = c;
|
|
30
31
|
return n;
|
|
31
|
-
}, Le = /* @__PURE__ */ te(Me, [["__scopeId", "data-v-2266bab0"]]), z = w("/das-micro-app"), f = w([]), k = w(!1),
|
|
32
|
-
let A = null, h = null,
|
|
33
|
-
const
|
|
34
|
-
var c,
|
|
35
|
-
const r = f.value.find((
|
|
32
|
+
}, Le = /* @__PURE__ */ te(Me, [["__scopeId", "data-v-2266bab0"]]), z = w("/das-micro-app"), f = w([]), k = w(!1), R = w([]), D = w(!0);
|
|
33
|
+
let A = null, h = null, L = null;
|
|
34
|
+
const b = (e, t, n) => {
|
|
35
|
+
var c, a, i, s;
|
|
36
|
+
const r = f.value.find((o) => o.name === e);
|
|
36
37
|
if (r) {
|
|
37
38
|
if (r.entry.startsWith("/") || r.entry.match(location.origin)) {
|
|
38
|
-
(
|
|
39
|
+
(a = (c = r.dom) == null ? void 0 : c.contentWindow) == null || a.postMessage({ type: t, data: n });
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
(s = (i = r.dom) == null ? void 0 : i.contentWindow) == null || s.postMessage({ type: t, data: n }, r.entry);
|
|
42
43
|
}
|
|
43
44
|
}, q = (e, t) => {
|
|
44
|
-
var
|
|
45
|
+
var a;
|
|
45
46
|
const { __IN_DAS_MICRO_APP: n, __DAS_MAIN_APP_HREF: r } = window;
|
|
46
47
|
if (!n || !r) return;
|
|
47
48
|
const { origin: c } = new URL(r);
|
|
48
|
-
(
|
|
49
|
+
(a = window.top) == null || a.postMessage({ type: e, data: t }, c);
|
|
49
50
|
}, be = () => {
|
|
50
51
|
h || (h || (h = {}), window.addEventListener(
|
|
51
52
|
"message",
|
|
@@ -87,15 +88,15 @@ const I = (e, t, n) => {
|
|
|
87
88
|
}, Q = async (e) => {
|
|
88
89
|
await Promise.all(
|
|
89
90
|
f.value.filter((t) => t.loaded).map((t) => new Promise(async (n) => {
|
|
90
|
-
t.dom || await new Promise((r) =>
|
|
91
|
-
|
|
91
|
+
t.dom || await new Promise((r) => y(() => t.dom, r)), setTimeout(() => {
|
|
92
|
+
b(t.name, "sessionStorage", e), n(!0);
|
|
92
93
|
}, 0);
|
|
93
94
|
}))
|
|
94
95
|
);
|
|
95
96
|
}, d = {
|
|
96
97
|
loadMicroApp: (e) => {
|
|
97
98
|
k.value = !0;
|
|
98
|
-
const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived), r = !!t, c = !(t != null && t.loaded),
|
|
99
|
+
const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived), r = !!t, c = !(t != null && t.loaded), a = t == null ? void 0 : t.actived;
|
|
99
100
|
if (!r) {
|
|
100
101
|
n && (n.actived = !1);
|
|
101
102
|
return;
|
|
@@ -106,14 +107,14 @@ const I = (e, t, n) => {
|
|
|
106
107
|
i && (i.actived = !1), t.loaded = !0, t.actived = !0;
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
|
-
if (!
|
|
110
|
+
if (!a) {
|
|
110
111
|
n && (n.actived = !1), t.actived = !0;
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
},
|
|
114
115
|
hideMicroApp: async (e) => {
|
|
115
116
|
const t = f.value.find((n) => n.name === e);
|
|
116
|
-
t && t.loaded && (t.dom || await new Promise((n) =>
|
|
117
|
+
t && t.loaded && (t.dom || await new Promise((n) => y(() => t.dom, n)), b(e, "router", {
|
|
117
118
|
cmd: "push",
|
|
118
119
|
route: {
|
|
119
120
|
name: "das-micro-app-ghost",
|
|
@@ -137,23 +138,23 @@ const I = (e, t, n) => {
|
|
|
137
138
|
},
|
|
138
139
|
setMicroAppRoute: async (e, t, n) => {
|
|
139
140
|
const r = f.value.find((s) => s.name === t);
|
|
140
|
-
if (!r || !r.loaded || !r.actived || (r.dom || await new Promise((s) =>
|
|
141
|
-
const c = n.path || n,
|
|
141
|
+
if (!r || !r.loaded || !r.actived || (r.dom || await new Promise((s) => y(() => r.dom, s)), !r.actived)) return r;
|
|
142
|
+
const c = n.path || n, a = n.query || {}, i = n.params || {};
|
|
142
143
|
return e.push({
|
|
143
144
|
path: `/${t}${c}`,
|
|
144
|
-
query:
|
|
145
|
+
query: a,
|
|
145
146
|
// @ts-ignore
|
|
146
147
|
params: i
|
|
147
148
|
}), setTimeout(() => {
|
|
148
149
|
const { isFirstActived: s } = r;
|
|
149
|
-
|
|
150
|
+
b(t, "router", {
|
|
150
151
|
cmd: s ? "replace" : "push",
|
|
151
152
|
route: n,
|
|
152
153
|
microAppName: t
|
|
153
154
|
}), s && (r.isFirstActived = !1);
|
|
154
155
|
}, 0), r;
|
|
155
156
|
},
|
|
156
|
-
sendMessageToMicroApp:
|
|
157
|
+
sendMessageToMicroApp: b,
|
|
157
158
|
sendMessageToMainApp: q,
|
|
158
159
|
addEventListenerFromMainApp: Ee,
|
|
159
160
|
addEventListenerFromMicroApp: Se,
|
|
@@ -175,33 +176,33 @@ const I = (e, t, n) => {
|
|
|
175
176
|
},
|
|
176
177
|
addMicroAppLifeCycleListener: (e, t) => {
|
|
177
178
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
|
|
178
|
-
|
|
179
|
+
L || (L = {});
|
|
179
180
|
const r = () => {
|
|
180
|
-
|
|
181
|
+
L[n] && delete L[n];
|
|
181
182
|
};
|
|
182
|
-
return
|
|
183
|
+
return L[n] = {
|
|
183
184
|
type: e,
|
|
184
185
|
handler: async (c) => await t(c),
|
|
185
186
|
remove: r
|
|
186
187
|
}, { remove: r };
|
|
187
188
|
},
|
|
188
189
|
triggerMicroAppLifeCycleListener: (e, t, n) => {
|
|
189
|
-
var
|
|
190
|
-
const r =
|
|
190
|
+
var a;
|
|
191
|
+
const r = L, { autoRemove: c = !1 } = n || {};
|
|
191
192
|
for (const i in r) {
|
|
192
193
|
const s = r[i];
|
|
193
|
-
s.type === e && ((
|
|
194
|
+
s.type === e && ((a = s == null ? void 0 : s.handler) == null || a.call(s, t).then(() => {
|
|
194
195
|
c && s.remove();
|
|
195
196
|
}));
|
|
196
197
|
}
|
|
197
198
|
},
|
|
198
199
|
reloadMicroAppRoute: async (e, t) => {
|
|
199
200
|
const n = f.value.find((r) => r.name === e);
|
|
200
|
-
n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) =>
|
|
201
|
+
n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) => y(() => n.dom, r)), b(e, "route", { cmd: "reload", path: t })));
|
|
201
202
|
},
|
|
202
203
|
unloadMicroAppRoute: async (e, t) => {
|
|
203
204
|
const n = f.value.find((r) => r.name === e);
|
|
204
|
-
n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) =>
|
|
205
|
+
n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) => y(() => n.dom, r)), b(e, "route", { cmd: "unload", path: t })));
|
|
205
206
|
},
|
|
206
207
|
setMainAppLayoutVisible: (e) => {
|
|
207
208
|
q("layoutVisible", { visible: e });
|
|
@@ -209,36 +210,36 @@ const I = (e, t, n) => {
|
|
|
209
210
|
}, Pe = /* @__PURE__ */ x({
|
|
210
211
|
__name: "das-micro-apps",
|
|
211
212
|
setup(e) {
|
|
212
|
-
const t = w(null), n = async (
|
|
213
|
+
const t = w(null), n = async (a, i) => {
|
|
213
214
|
const s = f.value.find((m) => m.name === i);
|
|
214
215
|
if (!s) return;
|
|
215
|
-
s.dom =
|
|
216
|
-
const
|
|
216
|
+
s.dom = a.target, await ee(), await new Promise((m) => setTimeout(m, 50));
|
|
217
|
+
const o = () => {
|
|
217
218
|
const m = t.value.getBoundingClientRect() || {};
|
|
218
219
|
return m.width = t.value.clientWidth, m.height = t.value.clientHeight, m;
|
|
219
220
|
};
|
|
220
221
|
d.sendMessageToMicroApp(i, "onLoaded", {
|
|
221
222
|
href: location.href,
|
|
222
|
-
microAppContainerRect:
|
|
223
|
+
microAppContainerRect: o(),
|
|
223
224
|
entry: s.entry,
|
|
224
225
|
name: s.name
|
|
225
226
|
});
|
|
226
227
|
const { dom: p, ...l } = s;
|
|
227
228
|
d.triggerMicroAppLifeCycleListener("onLoaded", l), new ResizeObserver(() => {
|
|
228
|
-
d.sendMessageToMicroApp(i, "resize",
|
|
229
|
+
d.sendMessageToMicroApp(i, "resize", o());
|
|
229
230
|
}).observe(t.value), d.sendMessageToMicroApp(i, "setProxyMessageStatus", { visible: !0, parentHref: location.href }), d.sendMessageToMicroApp(i, "setProxSsoStatus", { visible: !0, parentHref: location.href });
|
|
230
|
-
}, r = (
|
|
231
|
+
}, r = (a, i) => {
|
|
231
232
|
const s = f.value.find((l) => l.name === i);
|
|
232
233
|
if (!s) return;
|
|
233
|
-
const { dom:
|
|
234
|
+
const { dom: o, ...p } = s;
|
|
234
235
|
d.sendMessageToMicroApp(i, "onActivated"), d.triggerMicroAppLifeCycleListener("onActivated", p);
|
|
235
|
-
}, c = (
|
|
236
|
+
}, c = (a, i) => {
|
|
236
237
|
const s = f.value.find((l) => l.name === i);
|
|
237
238
|
if (!s) return;
|
|
238
|
-
const { dom:
|
|
239
|
+
const { dom: o, ...p } = s;
|
|
239
240
|
d.sendMessageToMicroApp(i, "onDeactivated"), d.triggerMicroAppLifeCycleListener("onDeactivated", p);
|
|
240
241
|
};
|
|
241
|
-
return (
|
|
242
|
+
return (a, i) => (I(), N(
|
|
242
243
|
"div",
|
|
243
244
|
{
|
|
244
245
|
ref_key: "containerRef",
|
|
@@ -246,21 +247,21 @@ const I = (e, t, n) => {
|
|
|
246
247
|
class: "das-micro-app-container"
|
|
247
248
|
},
|
|
248
249
|
[
|
|
249
|
-
(
|
|
250
|
+
(I(!0), N(
|
|
250
251
|
$,
|
|
251
252
|
null,
|
|
252
|
-
oe(
|
|
253
|
+
oe(E(f), (s) => (I(), N(
|
|
253
254
|
$,
|
|
254
255
|
null,
|
|
255
256
|
[
|
|
256
|
-
s.loaded ? ce((
|
|
257
|
+
s.loaded ? ce((I(), Z(Le, {
|
|
257
258
|
key: 0,
|
|
258
259
|
src: s.src || "",
|
|
259
260
|
name: s.name,
|
|
260
261
|
actived: s.actived,
|
|
261
|
-
onOnLoaded: (
|
|
262
|
-
onOnActivated: (
|
|
263
|
-
onOnDeactivated: (
|
|
262
|
+
onOnLoaded: (o) => n(o, s.name),
|
|
263
|
+
onOnActivated: (o) => r(o, s.name),
|
|
264
|
+
onOnDeactivated: (o) => c(o, s.name)
|
|
264
265
|
}, null, 8, ["src", "name", "actived", "onOnLoaded", "onOnActivated", "onOnDeactivated"])), [
|
|
265
266
|
[le, s.actived]
|
|
266
267
|
]) : ue("v-if", !0)
|
|
@@ -279,39 +280,42 @@ const I = (e, t, n) => {
|
|
|
279
280
|
}), Oe = /* @__PURE__ */ te(Pe, [["__scopeId", "data-v-2e3798bc"]]), Ze = /* @__PURE__ */ x({
|
|
280
281
|
__name: "das-main-app-layout",
|
|
281
282
|
props: {
|
|
282
|
-
transitionConfig: {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
transitionConfig: { default: () => {
|
|
284
|
+
} },
|
|
285
|
+
showLayout: { type: Boolean, default: !0 },
|
|
286
|
+
showAside: { type: Boolean, default: !0 },
|
|
287
|
+
showTabs: { type: Boolean, default: !0 },
|
|
288
|
+
menuAttr: { default: () => {
|
|
289
|
+
} },
|
|
290
|
+
tabsAttr: { default: () => {
|
|
291
|
+
} }
|
|
288
292
|
},
|
|
289
293
|
setup(e) {
|
|
290
|
-
const t = e, n =
|
|
294
|
+
const t = e, n = T(() => !k.value), r = T(() => ({
|
|
291
295
|
"enter-active-class": "animate__animated animate__fadeInLeft",
|
|
292
|
-
...t.transitionConfig
|
|
293
|
-
})),
|
|
294
|
-
return (
|
|
295
|
-
"transition-config":
|
|
296
|
+
...t.transitionConfig
|
|
297
|
+
})), c = T(() => ({ showLayout: t.showLayout, showAside: t.showAside, showTabs: t.showTabs }));
|
|
298
|
+
return (a, i) => (I(), Z(E(he), de({
|
|
299
|
+
"transition-config": r.value,
|
|
296
300
|
"router-view-visible": n.value
|
|
297
|
-
},
|
|
298
|
-
header:
|
|
299
|
-
V(
|
|
300
|
-
|
|
301
|
+
}, c.value), {
|
|
302
|
+
header: C(() => [
|
|
303
|
+
V(a.$slots, "header", {}, () => [
|
|
304
|
+
F(E(we))
|
|
301
305
|
])
|
|
302
306
|
]),
|
|
303
|
-
aside:
|
|
304
|
-
V(
|
|
305
|
-
|
|
307
|
+
aside: C(() => [
|
|
308
|
+
V(a.$slots, "aside", {}, () => [
|
|
309
|
+
F(E(ge), { menuAttr: a.menuAttr }, null, 8, ["menuAttr"])
|
|
306
310
|
])
|
|
307
311
|
]),
|
|
308
|
-
tab:
|
|
309
|
-
V(
|
|
310
|
-
|
|
312
|
+
tab: C(() => [
|
|
313
|
+
V(a.$slots, "tab", {}, () => [
|
|
314
|
+
F(E(_e), { tabsAttr: a.tabsAttr }, null, 8, ["tabsAttr"])
|
|
311
315
|
])
|
|
312
316
|
]),
|
|
313
|
-
default:
|
|
314
|
-
|
|
317
|
+
default: C(() => [
|
|
318
|
+
F(Oe)
|
|
315
319
|
]),
|
|
316
320
|
_: 3
|
|
317
321
|
/* FORWARDED */
|
|
@@ -326,7 +330,7 @@ const I = (e, t, n) => {
|
|
|
326
330
|
}, 300);
|
|
327
331
|
}), (t, n) => null;
|
|
328
332
|
}
|
|
329
|
-
}), u =
|
|
333
|
+
}), u = O({
|
|
330
334
|
visible: !1,
|
|
331
335
|
logo: "",
|
|
332
336
|
items: [],
|
|
@@ -381,16 +385,16 @@ const I = (e, t, n) => {
|
|
|
381
385
|
},
|
|
382
386
|
triggerEventListener: (e, t, n) => {
|
|
383
387
|
var i;
|
|
384
|
-
const r = u.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
388
|
+
const r = u.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
385
389
|
for (const s in r) {
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
(i =
|
|
389
|
-
c &&
|
|
390
|
+
const o = r[s];
|
|
391
|
+
o.type === e && a.push(
|
|
392
|
+
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
393
|
+
c && o.remove();
|
|
390
394
|
})
|
|
391
395
|
);
|
|
392
396
|
}
|
|
393
|
-
return Promise.all(
|
|
397
|
+
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
394
398
|
},
|
|
395
399
|
addEventListener: (e, t) => {
|
|
396
400
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
|
|
@@ -401,8 +405,8 @@ const I = (e, t, n) => {
|
|
|
401
405
|
handler: async (c) => {
|
|
402
406
|
try {
|
|
403
407
|
await t(c);
|
|
404
|
-
} catch (
|
|
405
|
-
throw
|
|
408
|
+
} catch (a) {
|
|
409
|
+
throw a;
|
|
406
410
|
}
|
|
407
411
|
},
|
|
408
412
|
remove: r
|
|
@@ -410,44 +414,44 @@ const I = (e, t, n) => {
|
|
|
410
414
|
remove: r
|
|
411
415
|
};
|
|
412
416
|
}
|
|
413
|
-
},
|
|
417
|
+
}, _ = O({
|
|
414
418
|
items: [],
|
|
415
419
|
eventListeners: {}
|
|
416
420
|
}), Fe = {
|
|
417
421
|
setItems: (e) => {
|
|
418
|
-
|
|
422
|
+
_.items = e;
|
|
419
423
|
},
|
|
420
|
-
getItems: () =>
|
|
424
|
+
getItems: () => _.items,
|
|
421
425
|
setActiveItem: (e) => {
|
|
422
|
-
|
|
426
|
+
_.activeItem = e;
|
|
423
427
|
},
|
|
424
428
|
setPopupClassName: (e) => {
|
|
425
|
-
|
|
429
|
+
_.popupClassName = e;
|
|
426
430
|
},
|
|
427
431
|
triggerEventListener: (e, t, n) => {
|
|
428
432
|
var i;
|
|
429
|
-
const r =
|
|
433
|
+
const r = _.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
430
434
|
for (const s in r) {
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
(i =
|
|
434
|
-
c &&
|
|
435
|
+
const o = r[s];
|
|
436
|
+
o.type === e && a.push(
|
|
437
|
+
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
438
|
+
c && o.remove();
|
|
435
439
|
})
|
|
436
440
|
);
|
|
437
441
|
}
|
|
438
|
-
return Promise.all(
|
|
442
|
+
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
439
443
|
},
|
|
440
444
|
addEventListener: (e, t) => {
|
|
441
445
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
|
|
442
|
-
|
|
446
|
+
_.eventListeners[n] && delete _.eventListeners[n];
|
|
443
447
|
};
|
|
444
|
-
return
|
|
448
|
+
return _.eventListeners[n] = {
|
|
445
449
|
type: e,
|
|
446
450
|
handler: async (c) => {
|
|
447
451
|
try {
|
|
448
452
|
await t(c);
|
|
449
|
-
} catch (
|
|
450
|
-
throw
|
|
453
|
+
} catch (a) {
|
|
454
|
+
throw a;
|
|
451
455
|
}
|
|
452
456
|
},
|
|
453
457
|
remove: r
|
|
@@ -455,7 +459,7 @@ const I = (e, t, n) => {
|
|
|
455
459
|
remove: r
|
|
456
460
|
};
|
|
457
461
|
}
|
|
458
|
-
}, v =
|
|
462
|
+
}, v = O({
|
|
459
463
|
items: [],
|
|
460
464
|
eventListeners: {}
|
|
461
465
|
}), Re = {
|
|
@@ -476,16 +480,16 @@ const I = (e, t, n) => {
|
|
|
476
480
|
},
|
|
477
481
|
triggerEventListener: (e, t, n) => {
|
|
478
482
|
var i;
|
|
479
|
-
const r = v.eventListeners, { autoRemove: c = !1 } = n || {},
|
|
483
|
+
const r = v.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
480
484
|
for (const s in r) {
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
(i =
|
|
484
|
-
c &&
|
|
485
|
+
const o = r[s];
|
|
486
|
+
o.type === e && a.push(
|
|
487
|
+
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
488
|
+
c && o.remove();
|
|
485
489
|
})
|
|
486
490
|
);
|
|
487
491
|
}
|
|
488
|
-
return Promise.all(
|
|
492
|
+
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
489
493
|
},
|
|
490
494
|
addEventListener: (e, t) => {
|
|
491
495
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
|
|
@@ -496,8 +500,8 @@ const I = (e, t, n) => {
|
|
|
496
500
|
handler: async (c) => {
|
|
497
501
|
try {
|
|
498
502
|
await t(c);
|
|
499
|
-
} catch (
|
|
500
|
-
throw
|
|
503
|
+
} catch (a) {
|
|
504
|
+
throw a;
|
|
501
505
|
}
|
|
502
506
|
},
|
|
503
507
|
remove: r
|
|
@@ -505,33 +509,33 @@ const I = (e, t, n) => {
|
|
|
505
509
|
remove: r
|
|
506
510
|
};
|
|
507
511
|
}
|
|
508
|
-
},
|
|
512
|
+
}, P = O({
|
|
509
513
|
eventListeners: {}
|
|
510
|
-
}),
|
|
514
|
+
}), De = {
|
|
511
515
|
triggerEventListener: (e, t, n) => {
|
|
512
516
|
var i;
|
|
513
|
-
const r =
|
|
517
|
+
const r = P.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
|
|
514
518
|
for (const s in r) {
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
(i =
|
|
518
|
-
c &&
|
|
519
|
+
const o = r[s];
|
|
520
|
+
o.type === e && a.push(
|
|
521
|
+
(i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
|
|
522
|
+
c && o.remove();
|
|
519
523
|
})
|
|
520
524
|
);
|
|
521
525
|
}
|
|
522
|
-
return Promise.all(
|
|
526
|
+
return Promise.all(a).then(() => !0).catch(() => !1);
|
|
523
527
|
},
|
|
524
528
|
addEventListener: (e, t) => {
|
|
525
529
|
const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
|
|
526
|
-
|
|
530
|
+
P.eventListeners[n] && delete P.eventListeners[n];
|
|
527
531
|
};
|
|
528
|
-
return
|
|
532
|
+
return P.eventListeners[n] = {
|
|
529
533
|
type: e,
|
|
530
534
|
handler: async (c) => {
|
|
531
535
|
try {
|
|
532
536
|
await t(c);
|
|
533
|
-
} catch (
|
|
534
|
-
throw
|
|
537
|
+
} catch (a) {
|
|
538
|
+
throw a;
|
|
535
539
|
}
|
|
536
540
|
},
|
|
537
541
|
remove: r
|
|
@@ -539,26 +543,26 @@ const I = (e, t, n) => {
|
|
|
539
543
|
remove: r
|
|
540
544
|
};
|
|
541
545
|
}
|
|
542
|
-
}, W =
|
|
546
|
+
}, W = O({
|
|
543
547
|
visible: !1,
|
|
544
548
|
style: {}
|
|
545
|
-
}),
|
|
549
|
+
}), Te = {
|
|
546
550
|
set: (e, t) => {
|
|
547
551
|
W.visible = e, t || (t = {}), t.transition || (t.transition = "all 0.3s"), t && (W.style = t);
|
|
548
552
|
}
|
|
549
553
|
}, Ne = {
|
|
550
554
|
nav: u,
|
|
551
|
-
menu:
|
|
555
|
+
menu: _,
|
|
552
556
|
tab: v,
|
|
553
557
|
overlay: W,
|
|
554
|
-
iframeView:
|
|
558
|
+
iframeView: P,
|
|
555
559
|
visible: w(!0)
|
|
556
560
|
}, j = {
|
|
557
561
|
nav: Ce,
|
|
558
562
|
menu: Fe,
|
|
559
563
|
tab: Re,
|
|
560
|
-
overlay:
|
|
561
|
-
iframeView:
|
|
564
|
+
overlay: Te,
|
|
565
|
+
iframeView: De,
|
|
562
566
|
setVisible: (e) => Ne.visible.value = e
|
|
563
567
|
};
|
|
564
568
|
var H;
|
|
@@ -566,7 +570,7 @@ const B = typeof window < "u", ke = (e) => typeof e == "string", xe = () => {
|
|
|
566
570
|
};
|
|
567
571
|
B && ((H = window == null ? void 0 : window.navigator) != null && H.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
568
572
|
function re(e) {
|
|
569
|
-
return typeof e == "function" ? e() :
|
|
573
|
+
return typeof e == "function" ? e() : E(e);
|
|
570
574
|
}
|
|
571
575
|
function Ve(e) {
|
|
572
576
|
return e;
|
|
@@ -588,12 +592,12 @@ function Be(...e) {
|
|
|
588
592
|
if (ke(e[0]) || Array.isArray(e[0]) ? ([n, r, c] = e, t = Qe) : [t, n, r, c] = e, !t)
|
|
589
593
|
return xe;
|
|
590
594
|
Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
}, s = (l, g, m,
|
|
594
|
-
i(), l &&
|
|
595
|
+
const a = [], i = () => {
|
|
596
|
+
a.forEach((l) => l()), a.length = 0;
|
|
597
|
+
}, s = (l, g, m, M) => (l.addEventListener(g, m, M), () => l.removeEventListener(g, m, M)), o = y(() => [ae(t), re(c)], ([l, g]) => {
|
|
598
|
+
i(), l && a.push(...n.flatMap((m) => r.map((M) => s(l, m, M, g))));
|
|
595
599
|
}, { immediate: !0, flush: "post" }), p = () => {
|
|
596
|
-
|
|
600
|
+
o(), i();
|
|
597
601
|
};
|
|
598
602
|
return se(p), p;
|
|
599
603
|
}
|
|
@@ -646,36 +650,36 @@ const J = [
|
|
|
646
650
|
]
|
|
647
651
|
];
|
|
648
652
|
function ze(e, t = {}) {
|
|
649
|
-
const { document: n = We, autoExit: r = !1 } = t, c = n == null ? void 0 : n.querySelector("html"),
|
|
653
|
+
const { document: n = We, autoExit: r = !1 } = t, c = n == null ? void 0 : n.querySelector("html"), a = w(!1);
|
|
650
654
|
let i = J[0];
|
|
651
655
|
const s = $e(() => {
|
|
652
656
|
if (n) {
|
|
653
|
-
for (const
|
|
654
|
-
if (
|
|
655
|
-
return i =
|
|
657
|
+
for (const S of J)
|
|
658
|
+
if (S[1] in n)
|
|
659
|
+
return i = S, !0;
|
|
656
660
|
} else
|
|
657
661
|
return !1;
|
|
658
662
|
return !1;
|
|
659
|
-
}), [
|
|
663
|
+
}), [o, p, l, , g] = i;
|
|
660
664
|
async function m() {
|
|
661
|
-
s.value && (n != null && n[l] && await n[p](),
|
|
665
|
+
s.value && (n != null && n[l] && await n[p](), a.value = !1);
|
|
662
666
|
}
|
|
663
|
-
async function
|
|
667
|
+
async function M() {
|
|
664
668
|
if (!s.value)
|
|
665
669
|
return;
|
|
666
670
|
await m();
|
|
667
|
-
const
|
|
668
|
-
|
|
671
|
+
const S = ae(c);
|
|
672
|
+
S && (await S[o](), a.value = !0);
|
|
669
673
|
}
|
|
670
674
|
async function ie() {
|
|
671
|
-
|
|
675
|
+
a.value ? await m() : await M();
|
|
672
676
|
}
|
|
673
677
|
return n && Be(n, g, () => {
|
|
674
|
-
|
|
678
|
+
a.value = !!(n != null && n[l]);
|
|
675
679
|
}, !1), r && se(m), {
|
|
676
680
|
isSupported: s,
|
|
677
|
-
isFullscreen:
|
|
678
|
-
enter:
|
|
681
|
+
isFullscreen: a,
|
|
682
|
+
enter: M,
|
|
679
683
|
exit: m,
|
|
680
684
|
toggle: ie
|
|
681
685
|
};
|
|
@@ -729,22 +733,22 @@ const Ke = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.
|
|
|
729
733
|
component: ne,
|
|
730
734
|
meta: { isMicroApp: !0, keepAlive: !0 }
|
|
731
735
|
}), d.addEventListenerFromMicroApp("bodyOverlay", (c) => {
|
|
732
|
-
const { visible:
|
|
733
|
-
j.overlay.set(
|
|
736
|
+
const { visible: a, style: i } = c.data;
|
|
737
|
+
j.overlay.set(a, i);
|
|
734
738
|
}), d.addEventListenerFromMicroApp("layoutVisible", (c) => {
|
|
735
|
-
const { visible:
|
|
736
|
-
j.setVisible(
|
|
739
|
+
const { visible: a } = c.data;
|
|
740
|
+
j.setVisible(a);
|
|
737
741
|
}), d.addEventListenerFromMicroApp("route", (c) => {
|
|
738
|
-
const { name:
|
|
739
|
-
i === "reload" && d.reloadMicroAppRoute(
|
|
742
|
+
const { name: a, cmd: i, path: s } = c.data;
|
|
743
|
+
i === "reload" && d.reloadMicroAppRoute(a, s), i === "unload" && d.unloadMicroAppRoute(a, s);
|
|
740
744
|
});
|
|
741
745
|
const { enter: n, exit: r } = ze();
|
|
742
746
|
d.addEventListenerFromMicroApp("fullscreen", (c) => {
|
|
743
|
-
const
|
|
744
|
-
|
|
747
|
+
const a = c.data;
|
|
748
|
+
a && n(), a || r();
|
|
745
749
|
}), d.addEventListenerFromMicroApp("location", (c) => {
|
|
746
|
-
const { cmd:
|
|
747
|
-
|
|
750
|
+
const { cmd: a, isAutoCloseApp: i } = c.data || {};
|
|
751
|
+
a === "reload" && (i !== void 0 && (window.__isAutoCloseApp = i), location.reload());
|
|
748
752
|
});
|
|
749
753
|
}, tt = (e, t) => {
|
|
750
754
|
if (!(e != null && e.microAppName)) return;
|
|
@@ -756,8 +760,8 @@ const Ke = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.
|
|
|
756
760
|
component: ne,
|
|
757
761
|
meta: { isMicroApp: !0, keepAlive: !0 }
|
|
758
762
|
});
|
|
759
|
-
const r = w(!1), c = w(!1),
|
|
760
|
-
|
|
763
|
+
const r = w(!1), c = w(!1), a = w("");
|
|
764
|
+
y(
|
|
761
765
|
() => t.currentRoute.value,
|
|
762
766
|
(i) => {
|
|
763
767
|
if (r.value) {
|
|
@@ -768,16 +772,16 @@ const Ke = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.
|
|
|
768
772
|
c.value = !1;
|
|
769
773
|
return;
|
|
770
774
|
}
|
|
771
|
-
const { path: s, query:
|
|
772
|
-
if (
|
|
773
|
-
|
|
775
|
+
const { path: s, query: o, params: p, meta: l } = i;
|
|
776
|
+
if (a.value.includes(i.path)) {
|
|
777
|
+
a.value = "";
|
|
774
778
|
return;
|
|
775
779
|
}
|
|
776
780
|
d.sendMessageToMainApp("router", {
|
|
777
781
|
cmd: "push",
|
|
778
782
|
route: {
|
|
779
783
|
path: s,
|
|
780
|
-
query: { ...
|
|
784
|
+
query: { ...o, microAppName: e.microAppName },
|
|
781
785
|
params: p,
|
|
782
786
|
meta: l
|
|
783
787
|
}
|
|
@@ -785,30 +789,30 @@ const Ke = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.
|
|
|
785
789
|
}
|
|
786
790
|
), d.addEventListenerFromMainApp("router", async (i) => {
|
|
787
791
|
var l;
|
|
788
|
-
const { cmd: s, route:
|
|
789
|
-
|
|
792
|
+
const { cmd: s, route: o, microAppName: p = "" } = i.data;
|
|
793
|
+
a.value = ("/" + p + o.path).replace(/\/\//g, "/"), (l = t == null ? void 0 : t[s]) == null || l.call(t, o);
|
|
790
794
|
}), d.addEventListenerFromMainApp("onLoaded", (i) => {
|
|
791
|
-
const { href: s, microAppContainerRect:
|
|
792
|
-
window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF = s, window.__DAS_MICRO_APP_CONTAINER_RECT =
|
|
795
|
+
const { href: s, microAppContainerRect: o } = i.data;
|
|
796
|
+
window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF = s, window.__DAS_MICRO_APP_CONTAINER_RECT = o;
|
|
793
797
|
}), d.addEventListenerFromMainApp("onDeactivated", (i) => {
|
|
794
|
-
const { name: s = "", path:
|
|
798
|
+
const { name: s = "", path: o, params: p = {}, query: l = {} } = t.currentRoute.value;
|
|
795
799
|
c.value = !0, t == null || t.push({
|
|
796
800
|
name: n,
|
|
797
|
-
query: { microAppName: e.microAppName, fromQuery: JSON.stringify(l), fromPath:
|
|
801
|
+
query: { microAppName: e.microAppName, fromQuery: JSON.stringify(l), fromPath: o },
|
|
798
802
|
params: p
|
|
799
803
|
});
|
|
800
804
|
}), d.addEventListenerFromMainApp("onActivated", (i) => {
|
|
801
|
-
const { name: s = "", params:
|
|
802
|
-
r.value = !0, t == null || t.push({ path: l, query: JSON.parse(g), params:
|
|
805
|
+
const { name: s = "", params: o = {}, query: p = {} } = t.currentRoute.value, { fromPath: l = "", fromQuery: g = "{}" } = p || {};
|
|
806
|
+
r.value = !0, t == null || t.push({ path: l, query: JSON.parse(g), params: o });
|
|
803
807
|
}), d.addEventListenerFromMainApp("sessionStorage", (i) => {
|
|
804
|
-
const { cmd: s, key:
|
|
805
|
-
s === "setItem" && window.sessionStorage.setItem(
|
|
808
|
+
const { cmd: s, key: o, value: p } = i.data;
|
|
809
|
+
s === "setItem" && window.sessionStorage.setItem(o, p), s === "getItem" && window.sessionStorage.getItem(o), s === "removeItem" && window.sessionStorage.removeItem(o), s === "clear" && window.sessionStorage.clear();
|
|
806
810
|
}), d.addEventListenerFromMainApp("route", (i) => {
|
|
807
|
-
const { cmd: s, path:
|
|
808
|
-
s === "reload" && (
|
|
809
|
-
D.value = !0,
|
|
810
|
-
}, 300)), s === "unload" && (
|
|
811
|
-
D.value = !0,
|
|
811
|
+
const { cmd: s, path: o } = i.data;
|
|
812
|
+
s === "reload" && (R.value.push(o), D.value = !1, setTimeout(() => {
|
|
813
|
+
D.value = !0, R.value = [];
|
|
814
|
+
}, 300)), s === "unload" && (R.value.push(o), D.value = !1, setTimeout(() => {
|
|
815
|
+
D.value = !0, R.value = [];
|
|
812
816
|
}, 100));
|
|
813
817
|
});
|
|
814
818
|
};
|