@morningfast/platform 0.0.10 → 0.0.12
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/dist/assets/main/style.css +4 -4
- package/dist/assets/sub/style.css +1 -1
- package/dist/chunks/Login-BKuPkkY9.js +242 -0
- package/dist/chunks/{SystemConfig-C7yyDmB8.js → SystemConfig-DGZUwXWB.js} +1 -1
- package/dist/chunks/{main-BRpmAK9d.js → main-BVdwJu-s.js} +580 -513
- package/dist/chunks/{route-items-DZFRXefX.js → route-items-84k92f3O.js} +192 -165
- package/dist/chunks/system-DZaKDrG6.js +160 -0
- package/dist/index.js +8 -8
- package/dist/main/index.d.ts +3 -0
- package/dist/main/layouts/components/AppBrandLogo.vue.d.ts +14 -0
- package/dist/main/stores/app.d.ts +12 -3
- package/dist/main.js +6 -6
- package/dist/sub.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/Login-BivuNuD7.js +0 -209
- package/dist/chunks/system-BbMsTIBR.js +0 -160
|
@@ -3,7 +3,7 @@ import { n as t, r as n, s as r, t as i } from "./config-Cd-9BYBy.js";
|
|
|
3
3
|
import { useRoute as a } from "vue-router";
|
|
4
4
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, onBeforeUnmount as h, onMounted as g, openBlock as _, reactive as v, ref as y, resolveComponent as b, toDisplayString as x, unref as S, watch as C, withCtx as w } from "vue";
|
|
5
5
|
import { defineStore as T } from "pinia";
|
|
6
|
-
import { Link as
|
|
6
|
+
import { Link as ee, RefreshRight as E, WarningFilled as D } from "@element-plus/icons-vue";
|
|
7
7
|
import { addGlobalUncaughtErrorHandler as O, registerMicroApps as k, start as A } from "qiankun";
|
|
8
8
|
//#region src/main/utils/theme.ts
|
|
9
9
|
var j = "theme-color", M = "theme-mode", N = "theme-position", P = [
|
|
@@ -91,33 +91,33 @@ function ie(e) {
|
|
|
91
91
|
function ae() {
|
|
92
92
|
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function oe(e) {
|
|
95
95
|
return e === "dark" || e === "system" && ae();
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let t =
|
|
97
|
+
function se(e) {
|
|
98
|
+
let t = oe(e);
|
|
99
99
|
document.documentElement.classList.toggle("dark", t), document.documentElement.style.colorScheme = t ? "dark" : "light";
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function L(e) {
|
|
102
102
|
let t = document.documentElement, n = t.classList.contains("dark");
|
|
103
|
-
t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3",
|
|
103
|
+
t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3", B(e, n ? "#000000" : "#ffffff", .3)), t.style.setProperty("--el-color-primary-light-5", B(e, n ? "#000000" : "#ffffff", .5)), t.style.setProperty("--el-color-primary-light-7", B(e, n ? "#000000" : "#ffffff", .7)), t.style.setProperty("--el-color-primary-light-8", B(e, n ? "#000000" : "#ffffff", .8)), t.style.setProperty("--el-color-primary-light-9", B(e, n ? "#000000" : "#ffffff", .9)), t.style.setProperty("--el-color-primary-dark-2", B(e, n ? "#ffffff" : "#000000", .2));
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
105
|
+
function ce() {
|
|
106
|
+
se(I()), L(F()), R(re());
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function R(e) {
|
|
109
109
|
document.documentElement.setAttribute("data-theme-position", e);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function z(e = 50) {
|
|
112
112
|
return new Promise((t) => {
|
|
113
113
|
setTimeout(() => {
|
|
114
|
-
|
|
114
|
+
L(F()), t();
|
|
115
115
|
}, e);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
async function
|
|
118
|
+
async function le(e, t) {
|
|
119
119
|
if (!document.startViewTransition) {
|
|
120
|
-
t(), await
|
|
120
|
+
t(), await z();
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
let n = e.clientX, r = e.clientY, i = Math.hypot(Math.max(n, innerWidth - n), Math.max(r, innerHeight - r));
|
|
@@ -132,16 +132,16 @@ async function se(e, t) {
|
|
|
132
132
|
fill: "both",
|
|
133
133
|
pseudoElement: c ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
134
134
|
});
|
|
135
|
-
}), await
|
|
135
|
+
}), await z();
|
|
136
136
|
} catch {
|
|
137
|
-
t(), await
|
|
137
|
+
t(), await z();
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
let [r, i, a] =
|
|
140
|
+
function B(e, t, n) {
|
|
141
|
+
let [r, i, a] = V(e), [o, s, c] = V(t), l = (e, t) => Math.round(e * (1 - n) + t * n);
|
|
142
142
|
return `rgb(${l(r, o)}, ${l(i, s)}, ${l(a, c)})`;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function V(e) {
|
|
145
145
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
|
|
146
146
|
return [
|
|
147
147
|
r >> 16 & 255,
|
|
@@ -151,201 +151,229 @@ function U(e) {
|
|
|
151
151
|
}
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/main/stores/app.ts
|
|
154
|
-
var
|
|
155
|
-
let e = y(localStorage.getItem(
|
|
156
|
-
function
|
|
154
|
+
var H = "sidebar-collapsed", U = "menu-search-placement", W = "layout-mode", G = "top-menu-path", ue = "(max-width: 768px)", K = null, q = T("app", () => {
|
|
155
|
+
let e = y(localStorage.getItem(H) === "true"), t = y(!1), n = y(de()), r = y(!1), i = y("theme"), a = y(I()), s = y(F()), c = y(re()), l = y(pe(localStorage.getItem(W))), u = y(localStorage.getItem(U) || "header"), d = y(localStorage.getItem(G) || ""), f = y(!0), p = o(() => oe(a.value)), m = o(() => l.value === "top" ? ["header"] : ["header", "sidebar"]), h = o(() => l.value !== "top" && u.value === "sidebar");
|
|
156
|
+
function g() {
|
|
157
|
+
if (n.value) {
|
|
158
|
+
t.value = !t.value;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
157
161
|
e.value = !e.value;
|
|
158
162
|
}
|
|
159
|
-
function
|
|
160
|
-
e.value = t, localStorage.setItem(
|
|
163
|
+
function _(t) {
|
|
164
|
+
e.value = t, localStorage.setItem(H, String(e.value));
|
|
161
165
|
}
|
|
162
|
-
function
|
|
163
|
-
n.value = e, t.value = !0;
|
|
164
|
-
}
|
|
165
|
-
function _() {
|
|
166
|
+
function v() {
|
|
166
167
|
t.value = !1;
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
function b(e) {
|
|
172
|
-
r.value = e, ne(e), R(e), z(i.value);
|
|
169
|
+
function b(e = "theme") {
|
|
170
|
+
i.value = e, r.value = !0;
|
|
173
171
|
}
|
|
174
172
|
function x() {
|
|
175
|
-
|
|
173
|
+
r.value = !1;
|
|
176
174
|
}
|
|
177
175
|
function S(e) {
|
|
178
|
-
|
|
176
|
+
r.value = e;
|
|
179
177
|
}
|
|
180
178
|
function C(e) {
|
|
181
|
-
a.value = e,
|
|
179
|
+
a.value = e, ne(e), se(e), L(s.value);
|
|
182
180
|
}
|
|
183
|
-
function w(
|
|
184
|
-
|
|
181
|
+
function w() {
|
|
182
|
+
C(ae() && a.value === "system" || p.value ? "light" : "dark");
|
|
185
183
|
}
|
|
186
184
|
function T(e) {
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
s.value = e, te(e), L(e);
|
|
186
|
+
}
|
|
187
|
+
function ee(e) {
|
|
188
|
+
c.value = e, ie(e), R(e);
|
|
189
189
|
}
|
|
190
190
|
function E(e) {
|
|
191
|
-
l.value = e, localStorage.setItem(
|
|
191
|
+
l.value = e, localStorage.setItem(W, e), e === "top" && u.value === "sidebar" && D("header");
|
|
192
|
+
}
|
|
193
|
+
function D(e) {
|
|
194
|
+
let t = l.value === "top" ? "header" : e;
|
|
195
|
+
u.value = t, localStorage.setItem(U, t);
|
|
192
196
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
197
|
+
function O(e) {
|
|
198
|
+
d.value = e, localStorage.setItem(G, e);
|
|
199
|
+
}
|
|
200
|
+
function k() {
|
|
201
|
+
ce(), fe();
|
|
195
202
|
}
|
|
196
203
|
return {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
204
|
+
closeMobileSidebar: v,
|
|
205
|
+
closeSettings: x,
|
|
206
|
+
initializePreferences: k,
|
|
207
|
+
isDark: p,
|
|
208
|
+
isMobileViewport: n,
|
|
209
|
+
layoutMode: l,
|
|
210
|
+
menuSearchPlacement: u,
|
|
211
|
+
menuSearchPlacementOptions: m,
|
|
212
|
+
mobileSidebarVisible: t,
|
|
213
|
+
openSettings: b,
|
|
214
|
+
isSidebarMenuSearch: h,
|
|
215
|
+
settingsActiveTab: i,
|
|
216
|
+
selectedTopMenuPath: d,
|
|
217
|
+
setLayoutMode: E,
|
|
218
|
+
setMenuSearchPlacement: D,
|
|
219
|
+
setSelectedTopMenuPath: O,
|
|
220
|
+
setSettingsVisible: S,
|
|
221
|
+
setSidebarCollapsed: _,
|
|
222
|
+
setThemeColor: T,
|
|
223
|
+
setThemeColorPosition: ee,
|
|
224
|
+
setThemeMode: C,
|
|
225
|
+
settingsVisible: r,
|
|
216
226
|
sidebarCollapsed: e,
|
|
217
|
-
shortcutTipVisible:
|
|
218
|
-
themeColor:
|
|
219
|
-
themeColorPosition:
|
|
220
|
-
themeMode:
|
|
221
|
-
toggleDarkMode:
|
|
222
|
-
toggleSidebar:
|
|
227
|
+
shortcutTipVisible: f,
|
|
228
|
+
themeColor: s,
|
|
229
|
+
themeColorPosition: c,
|
|
230
|
+
themeMode: a,
|
|
231
|
+
toggleDarkMode: w,
|
|
232
|
+
toggleSidebar: g
|
|
223
233
|
};
|
|
224
|
-
})
|
|
225
|
-
function
|
|
226
|
-
return
|
|
234
|
+
});
|
|
235
|
+
function de() {
|
|
236
|
+
return typeof window > "u" ? !1 : window.matchMedia(ue).matches;
|
|
237
|
+
}
|
|
238
|
+
function fe() {
|
|
239
|
+
if (typeof window > "u" || K) return;
|
|
240
|
+
let e = window.matchMedia(ue), t = q(), n = () => {
|
|
241
|
+
t.isMobileViewport = e.matches, e.matches || t.closeMobileSidebar();
|
|
242
|
+
};
|
|
243
|
+
n(), e.addEventListener("change", n), K = () => {
|
|
244
|
+
e.removeEventListener("change", n), K = null;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function pe(e) {
|
|
248
|
+
return e === "side" || e === "top" || e === "mix" ? e : "default";
|
|
227
249
|
}
|
|
228
|
-
|
|
229
|
-
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/main/micro-apps/status.ts
|
|
252
|
+
var J = v({}), Y = v({});
|
|
253
|
+
function me() {
|
|
254
|
+
return J;
|
|
230
255
|
}
|
|
231
|
-
function
|
|
256
|
+
function he(e) {
|
|
257
|
+
return Y[e];
|
|
258
|
+
}
|
|
259
|
+
function ge(e) {
|
|
232
260
|
return n(t()).find((t) => e === t.activeRule || e.startsWith(`${t.activeRule}/`));
|
|
233
261
|
}
|
|
234
|
-
function
|
|
235
|
-
return
|
|
262
|
+
function _e(e) {
|
|
263
|
+
return J[e.name] || (J[e.name] = {
|
|
236
264
|
name: e.name,
|
|
237
265
|
title: e.title,
|
|
238
266
|
entry: e.entry,
|
|
239
267
|
activeRule: e.activeRule,
|
|
240
268
|
status: "idle",
|
|
241
269
|
updatedAt: Date.now()
|
|
242
|
-
},
|
|
270
|
+
}, J[e.name]);
|
|
243
271
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
272
|
+
function ve(e) {
|
|
273
|
+
we(e, {
|
|
246
274
|
status: "loading",
|
|
247
275
|
message: void 0
|
|
248
276
|
});
|
|
249
277
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
278
|
+
function ye(e) {
|
|
279
|
+
we(e, {
|
|
252
280
|
status: "mounted",
|
|
253
281
|
message: void 0
|
|
254
282
|
});
|
|
255
283
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
284
|
+
function be(e, t) {
|
|
285
|
+
Te(e, {
|
|
258
286
|
status: "error",
|
|
259
|
-
message:
|
|
287
|
+
message: X(t)
|
|
260
288
|
});
|
|
261
289
|
}
|
|
262
|
-
function
|
|
263
|
-
let n =
|
|
264
|
-
return n ? (n.status = "error", n.message =
|
|
290
|
+
function xe(e, t) {
|
|
291
|
+
let n = J[e];
|
|
292
|
+
return n ? (n.status = "error", n.message = X(t), n.updatedAt = Date.now(), !0) : !1;
|
|
265
293
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
294
|
+
function Se(e, t, n) {
|
|
295
|
+
Y[t] = {
|
|
268
296
|
path: t,
|
|
269
297
|
name: e.name,
|
|
270
298
|
title: e.title,
|
|
271
299
|
entry: e.entry,
|
|
272
300
|
activeRule: e.activeRule,
|
|
273
|
-
message:
|
|
301
|
+
message: X(n),
|
|
274
302
|
updatedAt: Date.now()
|
|
275
303
|
};
|
|
276
304
|
}
|
|
277
|
-
function
|
|
278
|
-
delete
|
|
305
|
+
function Ce(e) {
|
|
306
|
+
delete Y[e];
|
|
279
307
|
}
|
|
280
|
-
function
|
|
281
|
-
let n =
|
|
308
|
+
function we(e, t) {
|
|
309
|
+
let n = J[e];
|
|
282
310
|
n && (n.status = t.status, n.message = t.message, n.updatedAt = Date.now());
|
|
283
311
|
}
|
|
284
|
-
function
|
|
285
|
-
let n =
|
|
312
|
+
function Te(e, t) {
|
|
313
|
+
let n = _e(e);
|
|
286
314
|
n.title = e.title, n.entry = e.entry, n.activeRule = e.activeRule, n.status = t.status, n.message = t.message, n.updatedAt = Date.now();
|
|
287
315
|
}
|
|
288
|
-
function
|
|
289
|
-
let t =
|
|
290
|
-
return t ?
|
|
316
|
+
function X(e) {
|
|
317
|
+
let t = Ee(e);
|
|
318
|
+
return t ? Oe(De(t)) : "子应用入口不可访问、服务未启动,或加载过程中发生异常。";
|
|
291
319
|
}
|
|
292
|
-
function
|
|
320
|
+
function Ee(e) {
|
|
293
321
|
return e instanceof Error ? e.message : typeof e == "string" ? e : "";
|
|
294
322
|
}
|
|
295
|
-
function
|
|
323
|
+
function De(e) {
|
|
296
324
|
return e.trim().replace(/^(application ['"][^'"]+['"] died in status [A-Z_]+:\s*)\1+/, "$1");
|
|
297
325
|
}
|
|
298
|
-
function
|
|
326
|
+
function Oe(e) {
|
|
299
327
|
let t = e.trim(), n = t.toLowerCase(), r = t.match(/application ['"]([^'"]+)['"]/)?.[1], i = r ? `子应用“${r}”` : "子应用";
|
|
300
|
-
return n.includes("cannot use import statement outside a module") ? `${i}
|
|
328
|
+
return n.includes("cannot use import statement outside a module") ? `${i}入口已响应,但加载失败。请确认子应用服务已启动,并确认入口地址指向子应用服务。` : n.includes("unexpected token <") ? `${i}入口返回了 HTML,但 qiankun 正在按脚本解析。请检查入口地址是否填错、子应用服务是否启动,以及访问入口时是否被重定向到了登录页或 404 页面。` : n.includes("failed to fetch") || n.includes("networkerror") || n.includes("load failed") || n.includes("loading source code") || n.includes("loading_source_code") ? `${i}入口资源加载失败。请确认子应用服务已启动、入口地址可直接访问,并检查浏览器控制台是否有跨域、404 或网络连接错误。` : n.includes("application died in status not_mounted") ? `${i}加载后挂载失败。请检查子应用是否正确导出了 qiankun 生命周期,并确认挂载容器和路由基座配置正确。` : t;
|
|
301
329
|
}
|
|
302
330
|
//#endregion
|
|
303
331
|
//#region src/main/micro-apps/types.ts
|
|
304
|
-
var
|
|
305
|
-
function
|
|
306
|
-
if (
|
|
307
|
-
|
|
332
|
+
var ke = "morningfast:theme-change", Ae = !1, je = !1;
|
|
333
|
+
function Me() {
|
|
334
|
+
if (Ae) {
|
|
335
|
+
Ne();
|
|
308
336
|
return;
|
|
309
337
|
}
|
|
310
|
-
|
|
338
|
+
Ae = !0;
|
|
311
339
|
let e = n(t());
|
|
312
|
-
e.forEach(
|
|
340
|
+
e.forEach(_e), k(e.map((e) => ({
|
|
313
341
|
name: e.name,
|
|
314
342
|
entry: e.entry,
|
|
315
343
|
container: e.container,
|
|
316
344
|
activeRule: e.activeRule,
|
|
317
|
-
props:
|
|
345
|
+
props: Fe(e)
|
|
318
346
|
})), {
|
|
319
347
|
beforeLoad: [async (e) => {
|
|
320
|
-
|
|
348
|
+
Ce(window.location.pathname), ve(e.name);
|
|
321
349
|
}],
|
|
322
350
|
afterMount: [async (e) => {
|
|
323
|
-
|
|
351
|
+
Ce(window.location.pathname), ye(e.name);
|
|
324
352
|
}]
|
|
325
353
|
}), O((t) => {
|
|
326
|
-
let n = t instanceof ErrorEvent ? t.error || t.message : t, r =
|
|
327
|
-
if (r &&
|
|
354
|
+
let n = t instanceof ErrorEvent ? t.error || t.message : t, r = Pe(n) || Pe(t);
|
|
355
|
+
if (r && xe(r, n)) {
|
|
328
356
|
let t = e.find((e) => e.name === r);
|
|
329
|
-
t &&
|
|
357
|
+
t && Se(t, window.location.pathname, n);
|
|
330
358
|
return;
|
|
331
359
|
}
|
|
332
360
|
e.forEach((e) => {
|
|
333
|
-
(window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (
|
|
361
|
+
(window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (be(e, n), Se(e, window.location.pathname, n));
|
|
334
362
|
});
|
|
335
|
-
}),
|
|
363
|
+
}), Ne(), Ie();
|
|
336
364
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
365
|
+
function Ne() {
|
|
366
|
+
je || document.querySelector("#micro-app-container") && (je = !0, A({
|
|
339
367
|
prefetch: !1,
|
|
340
368
|
sandbox: { experimentalStyleIsolation: !0 },
|
|
341
369
|
urlRerouteOnly: !0
|
|
342
370
|
}));
|
|
343
371
|
}
|
|
344
|
-
function
|
|
372
|
+
function Pe(e) {
|
|
345
373
|
return (e instanceof Error ? e.message : String(e || "")).match(/application ['"]?([^'"\s]+)['"]?/i)?.[1];
|
|
346
374
|
}
|
|
347
|
-
function
|
|
348
|
-
let t =
|
|
375
|
+
function Fe(e) {
|
|
376
|
+
let t = q();
|
|
349
377
|
return {
|
|
350
378
|
basePath: e.activeRule,
|
|
351
379
|
app: r(e),
|
|
@@ -353,61 +381,61 @@ function ke(e) {
|
|
|
353
381
|
env: "production",
|
|
354
382
|
apiBaseUrl: "/api"
|
|
355
383
|
},
|
|
356
|
-
theme:
|
|
357
|
-
getRuntimeProps: () => ({ theme:
|
|
384
|
+
theme: Z(t.isDark),
|
|
385
|
+
getRuntimeProps: () => ({ theme: Z(t.isDark) })
|
|
358
386
|
};
|
|
359
387
|
}
|
|
360
|
-
function
|
|
361
|
-
let e =
|
|
388
|
+
function Ie() {
|
|
389
|
+
let e = q();
|
|
362
390
|
C(() => [
|
|
363
391
|
e.isDark,
|
|
364
392
|
e.themeColor,
|
|
365
393
|
e.themeColorPosition
|
|
366
394
|
], () => {
|
|
367
395
|
window.setTimeout(() => {
|
|
368
|
-
|
|
396
|
+
Le(Z(e.isDark));
|
|
369
397
|
}, 0);
|
|
370
398
|
});
|
|
371
399
|
}
|
|
372
|
-
function
|
|
373
|
-
window.dispatchEvent(new CustomEvent(
|
|
400
|
+
function Le(e) {
|
|
401
|
+
window.dispatchEvent(new CustomEvent(ke, { detail: e }));
|
|
374
402
|
}
|
|
375
|
-
function
|
|
403
|
+
function Z(e) {
|
|
376
404
|
let t = getComputedStyle(document.documentElement);
|
|
377
405
|
return {
|
|
378
|
-
colorPrimary:
|
|
379
|
-
colorPrimaryLight3:
|
|
380
|
-
colorPrimaryLight5:
|
|
381
|
-
colorPrimaryLight7:
|
|
382
|
-
colorPrimaryLight8:
|
|
383
|
-
colorPrimaryLight9:
|
|
384
|
-
colorPrimaryDark2:
|
|
406
|
+
colorPrimary: Q(t, "--el-color-primary", "#409EFF"),
|
|
407
|
+
colorPrimaryLight3: Q(t, "--el-color-primary-light-3", "#79bbff"),
|
|
408
|
+
colorPrimaryLight5: Q(t, "--el-color-primary-light-5", "#a0cfff"),
|
|
409
|
+
colorPrimaryLight7: Q(t, "--el-color-primary-light-7", "#c6e2ff"),
|
|
410
|
+
colorPrimaryLight8: Q(t, "--el-color-primary-light-8", "#d9ecff"),
|
|
411
|
+
colorPrimaryLight9: Q(t, "--el-color-primary-light-9", "#ecf5ff"),
|
|
412
|
+
colorPrimaryDark2: Q(t, "--el-color-primary-dark-2", "#337ecc"),
|
|
385
413
|
mode: e ? "dark" : "light"
|
|
386
414
|
};
|
|
387
415
|
}
|
|
388
|
-
function
|
|
416
|
+
function Q(e, t, n) {
|
|
389
417
|
return e.getPropertyValue(t).trim() || n;
|
|
390
418
|
}
|
|
391
419
|
//#endregion
|
|
392
420
|
//#region src/main/pages/micro/MicroAppView.vue?vue&type=script&setup=true&lang.ts
|
|
393
|
-
var
|
|
421
|
+
var Re = { class: "micro-app-page" }, ze = {
|
|
394
422
|
key: 0,
|
|
395
423
|
class: "micro-app-page__state micro-app-page__state--error"
|
|
396
|
-
},
|
|
424
|
+
}, Be = { class: "micro-app-page__body" }, Ve = { class: "micro-app-page__meta" }, He = { key: 0 }, Ue = { key: 1 }, We = { class: "micro-app-page__actions" }, Ge = ["id"], Ke = /* @__PURE__ */ e(/* @__PURE__ */ p({
|
|
397
425
|
name: "MicroAppView",
|
|
398
426
|
__name: "MicroAppView",
|
|
399
427
|
setup(e) {
|
|
400
|
-
let t = a(), n =
|
|
428
|
+
let t = a(), n = me(), r = y(""), p = null, v = o(() => ge(t.path)), T = o(() => {
|
|
401
429
|
let e = v.value;
|
|
402
430
|
return e ? n[e.name] : void 0;
|
|
403
|
-
}), O = o(() =>
|
|
431
|
+
}), O = o(() => he(t.path)), k = o(() => T.value?.title || v.value?.title || O.value?.title || "未知子应用"), A = o(() => T.value?.entry || v.value?.entry || O.value?.entry || "-"), j = o(() => "子应用暂时无法访问,请稍后重试。"), M = o(() => T.value?.status === "error" || !!O.value || !!r.value || !v.value);
|
|
404
432
|
C(() => t.path, () => {
|
|
405
433
|
m(() => {
|
|
406
|
-
|
|
434
|
+
Me(), N();
|
|
407
435
|
});
|
|
408
436
|
}, { immediate: !0 }), g(() => {
|
|
409
437
|
m(() => {
|
|
410
|
-
|
|
438
|
+
Me(), N();
|
|
411
439
|
});
|
|
412
440
|
}), C(() => T.value?.status, (e) => {
|
|
413
441
|
e === "mounted" && (P(), r.value = "");
|
|
@@ -430,46 +458,45 @@ var Me = { class: "micro-app-page" }, Ne = {
|
|
|
430
458
|
e && e !== "-" && window.open(e, "_blank", "noopener,noreferrer");
|
|
431
459
|
}
|
|
432
460
|
return (e, t) => {
|
|
433
|
-
let n = b("el-icon"),
|
|
434
|
-
return _(), l("div",
|
|
435
|
-
default: w(() => [f(S(
|
|
461
|
+
let n = b("el-icon"), r = b("el-button");
|
|
462
|
+
return _(), l("div", Re, [M.value ? (_(), l("div", ze, [f(n, { class: "micro-app-page__icon" }, {
|
|
463
|
+
default: w(() => [f(S(D))]),
|
|
436
464
|
_: 1
|
|
437
|
-
}), u("div",
|
|
438
|
-
t[
|
|
439
|
-
u("
|
|
440
|
-
u("dl", Ie, [
|
|
465
|
+
}), u("div", Be, [
|
|
466
|
+
t[5] ||= u("p", { class: "micro-app-page__title" }, "子应用加载失败", -1),
|
|
467
|
+
u("dl", Ve, [
|
|
441
468
|
u("div", null, [t[0] ||= u("dt", null, "应用", -1), u("dd", null, x(k.value), 1)]),
|
|
442
|
-
S(!1) ? (_(), l("div",
|
|
443
|
-
|
|
469
|
+
S(!1) ? (_(), l("div", He, [t[1] ||= u("dt", null, "入口", -1), u("dd", null, x(A.value), 1)])) : c("", !0),
|
|
470
|
+
j.value ? (_(), l("div", Ue, [t[2] ||= u("dt", null, "原因", -1), u("dd", null, x(j.value), 1)])) : c("", !0)
|
|
444
471
|
]),
|
|
445
|
-
u("div",
|
|
472
|
+
u("div", We, [f(r, {
|
|
446
473
|
type: "primary",
|
|
447
|
-
icon: S(
|
|
474
|
+
icon: S(E),
|
|
448
475
|
onClick: F
|
|
449
476
|
}, {
|
|
450
|
-
default: w(() => [...t[
|
|
477
|
+
default: w(() => [...t[3] ||= [d("重新加载", -1)]]),
|
|
451
478
|
_: 1
|
|
452
|
-
}, 8, ["icon"]), S(!1) && (T.value?.entry || v.value?.entry) ? (_(), s(
|
|
479
|
+
}, 8, ["icon"]), S(!1) && (T.value?.entry || v.value?.entry) ? (_(), s(r, {
|
|
453
480
|
key: 0,
|
|
454
|
-
icon: S(
|
|
481
|
+
icon: S(ee),
|
|
455
482
|
onClick: I
|
|
456
483
|
}, {
|
|
457
|
-
default: w(() => [...t[
|
|
484
|
+
default: w(() => [...t[4] ||= [d(" 打开入口 ", -1)]]),
|
|
458
485
|
_: 1
|
|
459
486
|
}, 8, ["icon"])) : c("", !0)])
|
|
460
487
|
])])) : c("", !0), u("section", {
|
|
461
488
|
id: S(i),
|
|
462
489
|
class: "micro-app-page__container"
|
|
463
|
-
}, null, 8,
|
|
490
|
+
}, null, 8, Ge)]);
|
|
464
491
|
};
|
|
465
492
|
}
|
|
466
|
-
}), [["__scopeId", "data-v-
|
|
493
|
+
}), [["__scopeId", "data-v-944de23f"]]);
|
|
467
494
|
//#endregion
|
|
468
495
|
//#region src/main/router/route-items.ts
|
|
469
|
-
function
|
|
470
|
-
return e.map((e) =>
|
|
496
|
+
function $(e, t) {
|
|
497
|
+
return e.map((e) => qe(e, t));
|
|
471
498
|
}
|
|
472
|
-
function
|
|
499
|
+
function qe(e, t) {
|
|
473
500
|
let n = {
|
|
474
501
|
path: e.path,
|
|
475
502
|
name: e.name,
|
|
@@ -480,7 +507,7 @@ function We(e, t) {
|
|
|
480
507
|
hidden: e.hidden
|
|
481
508
|
}
|
|
482
509
|
};
|
|
483
|
-
return e.redirect && (n.redirect = e.redirect), e.componentKey && (n.component = t[e.componentKey]), e.microApp && (n.component =
|
|
510
|
+
return e.redirect && (n.redirect = e.redirect), e.componentKey && (n.component = t[e.componentKey]), e.microApp && (n.component = Ke), e.children?.length && (n.children = $(e.children, t)), n;
|
|
484
511
|
}
|
|
485
512
|
//#endregion
|
|
486
|
-
export { P as a,
|
|
513
|
+
export { P as a, le as i, Ke as n, q as r, $ as t };
|