labull-framework 0.1.11 → 0.1.13
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/{chunk-index-B5pTPy31.js → chunk-index-BN-lnG-w.js} +132 -134
- package/dist/index.js +2 -2
- package/dist/magic-block.js +1015 -1037
- package/dist/style.css +1 -1
- package/dist/types/magic-block-preview.d.ts +3 -2
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-ProductShell.vue_vue_type_style_index_0_scoped_0fb37099_lang-BpRKKThg.js → chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as z, ref as S, computed as
|
|
1
|
+
import { defineComponent as z, ref as S, computed as x, watch as ae, onMounted as X, onBeforeUnmount as Y, openBlock as t, createElementBlock as l, normalizeClass as $, unref as d, createElementVNode as e, Fragment as T, withDirectives as te, withKeys as Q, withModifiers as H, vModelText as _e, createCommentVNode as _, renderList as D, toDisplayString as w, nextTick as me, createBlock as ue, resolveDynamicComponent as ke, normalizeProps as ye, mergeProps as we, createTextVNode as W, renderSlot as Z, createVNode as F, vShow as oe } from "vue";
|
|
2
2
|
import { useRouter as ne, useRoute as re, RouterView as $e } from "vue-router";
|
|
3
|
-
import { e as se, o as le, _ as J, d as ce, p as ge, f as Ce, i as ie } from "./chunk-ProductShell.
|
|
3
|
+
import { e as se, o as le, _ as J, d as ce, p as ge, f as Ce, i as ie } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
|
|
4
4
|
import { u as Pe, e as q, g as xe, i as Le, d as Ee, l as Te, a as Se } from "./chunk-index-BWpDbB19.js";
|
|
5
5
|
const Me = ["onKeydown"], Ie = {
|
|
6
6
|
key: 2,
|
|
@@ -9,44 +9,44 @@ const Me = ["onKeydown"], Ie = {
|
|
|
9
9
|
}, Oe = ["aria-selected", "onMouseenter", "onMousedown"], Ne = { class: "labull-search-path" }, Ae = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "labull-search-empty"
|
|
12
|
-
},
|
|
12
|
+
}, Ue = /* @__PURE__ */ z({
|
|
13
13
|
__name: "AppSearch",
|
|
14
14
|
setup(n) {
|
|
15
|
-
const
|
|
15
|
+
const r = (b) => typeof b == "string" && b.trim() ? b.trim() : "";
|
|
16
16
|
function m(b) {
|
|
17
|
-
const
|
|
18
|
-
for (const
|
|
19
|
-
const a =
|
|
20
|
-
!a ||
|
|
17
|
+
const u = /* @__PURE__ */ new Set(), y = [];
|
|
18
|
+
for (const P of b) {
|
|
19
|
+
const a = r(P?.path);
|
|
20
|
+
!a || u.has(a) || a.includes(":") || a.includes("*") || P.redirect || !P.components?.default || P.meta?.tab === !1 || (u.add(a), y.push({ path: a, title: r(P.meta?.title) || r(P.meta?.sub) || a }));
|
|
21
21
|
}
|
|
22
22
|
return y;
|
|
23
23
|
}
|
|
24
|
-
const c = ne(), { portrait:
|
|
25
|
-
const b =
|
|
26
|
-
return b ?
|
|
24
|
+
const c = ne(), { portrait: p } = se(), h = S(""), o = S(!1), g = S(0), L = S(null), k = S(null), C = x(() => m(c.getRoutes())), i = x(() => {
|
|
25
|
+
const b = h.value.trim().toLowerCase();
|
|
26
|
+
return b ? C.value.filter((u) => `${u.title} ${u.path}`.toLowerCase().includes(b)).slice(0, 8) : C.value.slice(0, 8);
|
|
27
27
|
});
|
|
28
|
-
ae(
|
|
28
|
+
ae(i, () => {
|
|
29
29
|
g.value = 0;
|
|
30
30
|
});
|
|
31
31
|
function E(b) {
|
|
32
|
-
b && (le(b.path),
|
|
32
|
+
b && (le(b.path), h.value = "", o.value = !1, k.value?.blur());
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
function B(b) {
|
|
35
|
+
const u = i.value.length;
|
|
36
|
+
u > 0 && (g.value = (g.value + b + u) % u), o.value = !0;
|
|
37
37
|
}
|
|
38
38
|
function M() {
|
|
39
39
|
o.value = !0, G();
|
|
40
40
|
}
|
|
41
41
|
function K() {
|
|
42
|
-
|
|
42
|
+
h.value = "", o.value = !1, k.value?.blur();
|
|
43
43
|
}
|
|
44
44
|
function G() {
|
|
45
45
|
me(() => k.value?.focus());
|
|
46
46
|
}
|
|
47
47
|
function I() {
|
|
48
|
-
if (
|
|
49
|
-
|
|
48
|
+
if (h.value) {
|
|
49
|
+
h.value = "";
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
o.value = !1, k.value?.blur();
|
|
@@ -61,72 +61,72 @@ const Me = ["onKeydown"], Ie = {
|
|
|
61
61
|
document.addEventListener("mousedown", V), window.addEventListener("keydown", R);
|
|
62
62
|
}), Y(() => {
|
|
63
63
|
document.removeEventListener("mousedown", V), window.removeEventListener("keydown", R);
|
|
64
|
-
}), ae(
|
|
64
|
+
}), ae(p, () => {
|
|
65
65
|
K();
|
|
66
|
-
}), (b,
|
|
66
|
+
}), (b, u) => (t(), l("div", {
|
|
67
67
|
ref_key: "box",
|
|
68
68
|
ref: L,
|
|
69
|
-
class: $(["labull-search-box", { "is-open": d(
|
|
69
|
+
class: $(["labull-search-box", { "is-open": d(p) && o.value }])
|
|
70
70
|
}, [
|
|
71
|
-
d(
|
|
71
|
+
d(p) && !o.value ? (t(), l("button", {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "labull-search-toggle",
|
|
74
74
|
type: "button",
|
|
75
75
|
"aria-label": "搜索页面",
|
|
76
76
|
onClick: M
|
|
77
|
-
}, [...
|
|
77
|
+
}, [...u[6] || (u[6] = [
|
|
78
78
|
e("i", { class: "pi pi-search" }, null, -1)
|
|
79
79
|
])])) : (t(), l(T, { key: 1 }, [
|
|
80
|
-
|
|
80
|
+
u[8] || (u[8] = e("i", { class: "pi pi-search" }, null, -1)),
|
|
81
81
|
te(e("input", {
|
|
82
82
|
ref_key: "input",
|
|
83
83
|
ref: k,
|
|
84
|
-
"onUpdate:modelValue":
|
|
84
|
+
"onUpdate:modelValue": u[0] || (u[0] = (y) => h.value = y),
|
|
85
85
|
class: "p-inputtext p-component labull-search-input",
|
|
86
86
|
type: "search",
|
|
87
87
|
placeholder: "搜索… [Ctrl+K]",
|
|
88
88
|
"aria-label": "搜索页面",
|
|
89
89
|
autocomplete: "off",
|
|
90
|
-
onFocus:
|
|
91
|
-
onInput:
|
|
90
|
+
onFocus: u[1] || (u[1] = (y) => o.value = !0),
|
|
91
|
+
onInput: u[2] || (u[2] = (y) => o.value = !0),
|
|
92
92
|
onKeydown: [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
u[3] || (u[3] = Q(H((y) => B(1), ["prevent"]), ["down"])),
|
|
94
|
+
u[4] || (u[4] = Q(H((y) => B(-1), ["prevent"]), ["up"])),
|
|
95
|
+
u[5] || (u[5] = Q(H((y) => E(i.value[g.value]), ["prevent"]), ["enter"])),
|
|
96
96
|
Q(H(I, ["prevent"]), ["esc"])
|
|
97
97
|
]
|
|
98
98
|
}, null, 40, Me), [
|
|
99
|
-
[_e,
|
|
99
|
+
[_e, h.value]
|
|
100
100
|
]),
|
|
101
|
-
d(
|
|
101
|
+
d(p) ? (t(), l("button", {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "labull-search-cancel",
|
|
104
104
|
type: "button",
|
|
105
105
|
"aria-label": "取消搜索",
|
|
106
106
|
onClick: K
|
|
107
|
-
}, [...
|
|
107
|
+
}, [...u[7] || (u[7] = [
|
|
108
108
|
e("i", { class: "pi pi-times" }, null, -1)
|
|
109
109
|
])])) : _("", !0)
|
|
110
110
|
], 64)),
|
|
111
|
-
o.value && (
|
|
112
|
-
(t(!0), l(T, null, D(
|
|
111
|
+
o.value && (h.value || d(p)) ? (t(), l("div", Ie, [
|
|
112
|
+
(t(!0), l(T, null, D(i.value, (y, P) => (t(), l("button", {
|
|
113
113
|
key: y.path,
|
|
114
114
|
class: "labull-search-item",
|
|
115
115
|
type: "button",
|
|
116
116
|
role: "option",
|
|
117
|
-
"aria-selected":
|
|
118
|
-
onMouseenter: (a) => g.value =
|
|
117
|
+
"aria-selected": P === g.value,
|
|
118
|
+
onMouseenter: (a) => g.value = P,
|
|
119
119
|
onMousedown: H((a) => E(y), ["prevent"])
|
|
120
120
|
}, [
|
|
121
|
-
|
|
121
|
+
u[9] || (u[9] = e("i", { class: "pi pi-file" }, null, -1)),
|
|
122
122
|
e("span", null, w(y.title), 1),
|
|
123
123
|
e("small", Ne, w(y.path), 1)
|
|
124
124
|
], 40, Oe))), 128)),
|
|
125
|
-
|
|
125
|
+
i.value.length === 0 ? (t(), l("p", Ae, "未找到匹配项")) : _("", !0)
|
|
126
126
|
])) : _("", !0)
|
|
127
127
|
], 2));
|
|
128
128
|
}
|
|
129
|
-
}), de = /* @__PURE__ */ J(
|
|
129
|
+
}), de = /* @__PURE__ */ J(Ue, [["__scopeId", "data-v-1af7a3a4"]]), Be = { class: "labull-rail" }, Ke = { class: "labull-rail__group" }, Ve = ["title"], De = { class: "labull-rail__label" }, Ge = {
|
|
130
130
|
key: 1,
|
|
131
131
|
class: "labull-rail__divider"
|
|
132
132
|
}, Re = ["title", "aria-expanded", "onClick", "onMouseenter"], je = { class: "labull-rail__label" }, He = ["title"], We = { class: "labull-rail__brand-name" }, ze = ["aria-hidden"], Fe = { class: "labull-menu__header" }, qe = { class: "labull-menu__title" }, Je = { class: "labull-menu__list" }, Qe = ["onClick"], Xe = ["aria-hidden"], Ye = { class: "labull-navsheet__head" }, Ze = { class: "labull-navsheet__title" }, et = { class: "labull-navsheet__body" }, tt = ["onClick"], lt = ["onClick"], nt = /* @__PURE__ */ z({
|
|
@@ -139,35 +139,35 @@ const Me = ["onKeydown"], Ie = {
|
|
|
139
139
|
homeIcon: {}
|
|
140
140
|
},
|
|
141
141
|
setup(n) {
|
|
142
|
-
const
|
|
142
|
+
const r = n, m = re(), { portrait: c, navOpen: p, closeNav: h } = se();
|
|
143
143
|
function o(s) {
|
|
144
144
|
return s.path || s.title;
|
|
145
145
|
}
|
|
146
146
|
function g() {
|
|
147
|
-
return !!
|
|
147
|
+
return !!r.home && m.path === r.home;
|
|
148
148
|
}
|
|
149
|
-
const L = S(!1), k = S(!1),
|
|
150
|
-
function
|
|
149
|
+
const L = S(!1), k = S(!1), C = S(null);
|
|
150
|
+
function i(s) {
|
|
151
151
|
return s.path ? m.path === s.path ? !0 : m.path.startsWith(`${s.path}/`) && s.path !== "/" : !1;
|
|
152
152
|
}
|
|
153
153
|
function E(s) {
|
|
154
|
-
return s.children?.length ? s.children.some((
|
|
154
|
+
return s.children?.length ? s.children.some((U) => i(U)) : i(s);
|
|
155
155
|
}
|
|
156
|
-
const
|
|
156
|
+
const B = x(() => r.items.find((s) => E(s)) ?? r.items[0]), M = x(() => (C.value ? r.items.find((U) => o(U) === C.value) : void 0) ?? B.value), K = x(() => I.value ? M.value : B.value), G = x(() => {
|
|
157
157
|
const s = M.value;
|
|
158
158
|
return s ? s.children?.length ? s.children : [s] : [];
|
|
159
|
-
}), I =
|
|
159
|
+
}), I = x(() => r.items.length > 0 && (k.value || L.value));
|
|
160
160
|
function R() {
|
|
161
161
|
L.value = !0;
|
|
162
162
|
}
|
|
163
163
|
function V() {
|
|
164
|
-
L.value = !1,
|
|
164
|
+
L.value = !1, C.value = null, k.value = !1;
|
|
165
165
|
}
|
|
166
166
|
function b(s) {
|
|
167
|
-
|
|
167
|
+
C.value = o(s);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
k.value = !0,
|
|
169
|
+
function u(s) {
|
|
170
|
+
k.value = !0, C.value = o(s), s.onClick?.(s);
|
|
171
171
|
}
|
|
172
172
|
function y(s) {
|
|
173
173
|
if (k.value = !1, s.onClick) {
|
|
@@ -176,39 +176,39 @@ const Me = ["onKeydown"], Ie = {
|
|
|
176
176
|
}
|
|
177
177
|
s.path && le(s.path, { title: s.title, icon: s.icon });
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
k.value = !1,
|
|
179
|
+
function P() {
|
|
180
|
+
k.value = !1, C.value = null, r.home && le(r.home);
|
|
181
181
|
}
|
|
182
182
|
function a(s) {
|
|
183
|
-
y(s),
|
|
183
|
+
y(s), h();
|
|
184
184
|
}
|
|
185
185
|
function f(s) {
|
|
186
186
|
if (s.children?.length) {
|
|
187
|
-
s.onClick?.(s),
|
|
187
|
+
s.onClick?.(s), h();
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
a(s);
|
|
191
191
|
}
|
|
192
192
|
function N() {
|
|
193
|
-
|
|
193
|
+
P(), h();
|
|
194
194
|
}
|
|
195
195
|
function A(s) {
|
|
196
|
-
s.key === "Escape" &&
|
|
196
|
+
s.key === "Escape" && p.value && h();
|
|
197
197
|
}
|
|
198
|
-
return X(() => window.addEventListener("keydown", A)), Y(() => window.removeEventListener("keydown", A)), (s,
|
|
198
|
+
return X(() => window.addEventListener("keydown", A)), Y(() => window.removeEventListener("keydown", A)), (s, U) => (t(), l("nav", {
|
|
199
199
|
class: "labull-nav",
|
|
200
200
|
"aria-label": "主导航",
|
|
201
201
|
onMouseenter: R,
|
|
202
202
|
onMouseleave: V
|
|
203
203
|
}, [
|
|
204
|
-
e("div",
|
|
204
|
+
e("div", Be, [
|
|
205
205
|
e("div", Ke, [
|
|
206
206
|
n.home ? (t(), l("button", {
|
|
207
207
|
key: 0,
|
|
208
208
|
class: $(["labull-rail__btn", { "is-active": g() }]),
|
|
209
209
|
type: "button",
|
|
210
210
|
title: n.homeTitle || "首页",
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: P
|
|
212
212
|
}, [
|
|
213
213
|
e("i", {
|
|
214
214
|
class: $(n.homeIcon || "pi pi-home")
|
|
@@ -222,7 +222,7 @@ const Me = ["onKeydown"], Ie = {
|
|
|
222
222
|
type: "button",
|
|
223
223
|
title: v.title,
|
|
224
224
|
"aria-expanded": I.value && v === M.value,
|
|
225
|
-
onClick: (O) =>
|
|
225
|
+
onClick: (O) => u(v),
|
|
226
226
|
onMouseenter: (O) => b(v)
|
|
227
227
|
}, [
|
|
228
228
|
e("i", {
|
|
@@ -249,7 +249,7 @@ const Me = ["onKeydown"], Ie = {
|
|
|
249
249
|
e("div", Je, [
|
|
250
250
|
(t(!0), l(T, null, D(G.value, (v) => (t(), l("button", {
|
|
251
251
|
key: o(v),
|
|
252
|
-
class: $(["labull-menu__item", { "is-active":
|
|
252
|
+
class: $(["labull-menu__item", { "is-active": i(v) }]),
|
|
253
253
|
type: "button",
|
|
254
254
|
onClick: (O) => y(v)
|
|
255
255
|
}, [
|
|
@@ -262,8 +262,8 @@ const Me = ["onKeydown"], Ie = {
|
|
|
262
262
|
], 10, ze),
|
|
263
263
|
d(c) ? (t(), l("div", {
|
|
264
264
|
key: 0,
|
|
265
|
-
class: $(["labull-navsheet", { "is-open": d(
|
|
266
|
-
"aria-hidden": !d(
|
|
265
|
+
class: $(["labull-navsheet", { "is-open": d(p) }]),
|
|
266
|
+
"aria-hidden": !d(p),
|
|
267
267
|
role: "dialog",
|
|
268
268
|
"aria-modal": "true",
|
|
269
269
|
"aria-label": "主导航"
|
|
@@ -274,9 +274,9 @@ const Me = ["onKeydown"], Ie = {
|
|
|
274
274
|
class: "labull-navsheet__close",
|
|
275
275
|
type: "button",
|
|
276
276
|
"aria-label": "关闭导航",
|
|
277
|
-
onClick:
|
|
278
|
-
(...v) => d(
|
|
279
|
-
}, [...
|
|
277
|
+
onClick: U[0] || (U[0] = //@ts-ignore
|
|
278
|
+
(...v) => d(h) && d(h)(...v))
|
|
279
|
+
}, [...U[1] || (U[1] = [
|
|
280
280
|
e("i", { class: "pi pi-times" }, null, -1)
|
|
281
281
|
])])
|
|
282
282
|
]),
|
|
@@ -317,7 +317,7 @@ const Me = ["onKeydown"], Ie = {
|
|
|
317
317
|
], 2)),
|
|
318
318
|
(t(!0), l(T, null, D(v.children || [], (O) => (t(), l("button", {
|
|
319
319
|
key: o(O),
|
|
320
|
-
class: $(["labull-navsheet__row labull-navsheet__row--page", { "is-active":
|
|
320
|
+
class: $(["labull-navsheet__row labull-navsheet__row--page", { "is-active": i(O) }]),
|
|
321
321
|
type: "button",
|
|
322
322
|
onClick: (Gt) => a(O)
|
|
323
323
|
}, [
|
|
@@ -341,32 +341,32 @@ const Me = ["onKeydown"], Ie = {
|
|
|
341
341
|
home: { default: "/" }
|
|
342
342
|
},
|
|
343
343
|
setup(n) {
|
|
344
|
-
const
|
|
344
|
+
const r = n, { tabs: m, active: c, activateTab: p, closeTab: h, openTab: o } = ce();
|
|
345
345
|
function g(k) {
|
|
346
|
-
|
|
346
|
+
p(k);
|
|
347
347
|
}
|
|
348
348
|
function L(k) {
|
|
349
|
-
|
|
349
|
+
h(k) || m.value.length === 0 && o(r.home);
|
|
350
350
|
}
|
|
351
|
-
return (k,
|
|
352
|
-
(t(!0), l(T, null, D(d(m), (
|
|
353
|
-
key:
|
|
354
|
-
class: $(["labull-tab", { "is-active":
|
|
351
|
+
return (k, C) => d(m).length > 0 ? (t(), l("div", st, [
|
|
352
|
+
(t(!0), l(T, null, D(d(m), (i) => (t(), l("button", {
|
|
353
|
+
key: i.key,
|
|
354
|
+
class: $(["labull-tab", { "is-active": i.key === d(c) }]),
|
|
355
355
|
type: "button",
|
|
356
356
|
role: "tab",
|
|
357
|
-
"aria-selected":
|
|
358
|
-
title:
|
|
359
|
-
onClick: (E) => g(
|
|
357
|
+
"aria-selected": i.key === d(c),
|
|
358
|
+
title: i.title,
|
|
359
|
+
onClick: (E) => g(i.key)
|
|
360
360
|
}, [
|
|
361
|
-
|
|
361
|
+
i.icon ? (t(), l("i", {
|
|
362
362
|
key: 0,
|
|
363
|
-
class: $(
|
|
363
|
+
class: $(i.icon)
|
|
364
364
|
}, null, 2)) : _("", !0),
|
|
365
|
-
e("span", null, w(
|
|
365
|
+
e("span", null, w(i.title), 1),
|
|
366
366
|
e("i", {
|
|
367
367
|
class: "pi pi-times labull-tab__close",
|
|
368
368
|
title: "关闭",
|
|
369
|
-
onClick: H((E) => L(
|
|
369
|
+
onClick: H((E) => L(i.key), ["stop"])
|
|
370
370
|
}, null, 8, ot)
|
|
371
371
|
], 10, at))), 128))
|
|
372
372
|
])) : _("", !0);
|
|
@@ -377,25 +377,25 @@ const Me = ["onKeydown"], Ie = {
|
|
|
377
377
|
tab: {}
|
|
378
378
|
},
|
|
379
379
|
setup(n) {
|
|
380
|
-
const
|
|
381
|
-
ge(
|
|
380
|
+
const r = n;
|
|
381
|
+
ge(r.tab);
|
|
382
382
|
const m = ne();
|
|
383
383
|
function c() {
|
|
384
|
-
return m.resolve(
|
|
384
|
+
return m.resolve(r.tab.key);
|
|
385
385
|
}
|
|
386
|
-
const
|
|
386
|
+
const p = x(() => {
|
|
387
387
|
const o = c().matched;
|
|
388
388
|
return o[o.length - 1]?.components?.default ?? null;
|
|
389
|
-
}),
|
|
389
|
+
}), h = x(() => {
|
|
390
390
|
const o = c().matched[c().matched.length - 1]?.props?.default;
|
|
391
|
-
return o === !0 ? c().params : typeof o == "function" ? o(m.resolve(
|
|
391
|
+
return o === !0 ? c().params : typeof o == "function" ? o(m.resolve(r.tab.key)) : o && typeof o == "object" ? o : {};
|
|
392
392
|
});
|
|
393
|
-
return (o, g) =>
|
|
393
|
+
return (o, g) => p.value ? (t(), ue(ke(p.value), ye(we({ key: 0 }, h.value)), null, 16)) : _("", !0);
|
|
394
394
|
}
|
|
395
395
|
}), rt = ["aria-expanded"], ct = { class: "labull-avatar" }, dt = { class: "labull-topbar__username" }, vt = {
|
|
396
396
|
key: 0,
|
|
397
397
|
class: "labull-user__panel"
|
|
398
|
-
}, bt = { class: "labull-user__who" },
|
|
398
|
+
}, bt = { class: "labull-user__who" }, ht = { class: "labull-user__title" }, pt = {
|
|
399
399
|
key: 0,
|
|
400
400
|
class: "labull-user__work"
|
|
401
401
|
}, ft = {
|
|
@@ -404,66 +404,66 @@ const Me = ["onKeydown"], Ie = {
|
|
|
404
404
|
}, _t = { class: "labull-user__row" }, mt = /* @__PURE__ */ z({
|
|
405
405
|
__name: "UserMenu",
|
|
406
406
|
setup(n) {
|
|
407
|
-
const { user:
|
|
407
|
+
const { user: r, logout: m } = Pe(), c = S(!1), p = S(!1), h = S(null), o = x(() => r.value?.name || "当前用户"), g = x(() => o.value.slice(0, 1));
|
|
408
408
|
function L() {
|
|
409
|
-
c.value = !1,
|
|
409
|
+
c.value = !1, p.value = !1;
|
|
410
410
|
}
|
|
411
|
-
function k(
|
|
412
|
-
c.value && !
|
|
411
|
+
function k(C) {
|
|
412
|
+
c.value && !h.value?.contains(C.target) && L();
|
|
413
413
|
}
|
|
414
|
-
return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (
|
|
414
|
+
return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (C, i) => (t(), l("div", {
|
|
415
415
|
ref_key: "box",
|
|
416
|
-
ref:
|
|
416
|
+
ref: h,
|
|
417
417
|
class: "labull-user"
|
|
418
418
|
}, [
|
|
419
419
|
e("button", {
|
|
420
420
|
class: "p-button p-button-text p-button-sm labull-topbar__user",
|
|
421
421
|
type: "button",
|
|
422
422
|
"aria-expanded": c.value,
|
|
423
|
-
onClick:
|
|
423
|
+
onClick: i[0] || (i[0] = (E) => c.value ? L() : c.value = !0)
|
|
424
424
|
}, [
|
|
425
425
|
e("span", ct, w(g.value), 1),
|
|
426
426
|
e("span", dt, w(o.value), 1),
|
|
427
|
-
|
|
427
|
+
i[4] || (i[4] = e("i", { class: "pi pi-chevron-down labull-user__caret" }, null, -1))
|
|
428
428
|
], 8, rt),
|
|
429
429
|
c.value ? (t(), l("div", vt, [
|
|
430
430
|
e("div", bt, [
|
|
431
|
-
e("span",
|
|
431
|
+
e("span", ht, [
|
|
432
432
|
W(w(o.value), 1),
|
|
433
|
-
d(
|
|
433
|
+
d(r)?.workId ? (t(), l("span", pt, "(工号 " + w(d(r).workId) + ")", 1)) : _("", !0)
|
|
434
434
|
]),
|
|
435
|
-
d(
|
|
435
|
+
d(r)?.groups?.length ? (t(), l("small", ft, w(d(r).groups.join(" / ")), 1)) : _("", !0)
|
|
436
436
|
]),
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
p.value ? (t(), l(T, { key: 1 }, [
|
|
438
|
+
i[5] || (i[5] = e("p", { class: "labull-user__ask" }, "退出后要重新登录,未保存的输入会丢。", -1)),
|
|
439
439
|
e("div", _t, [
|
|
440
440
|
e("button", {
|
|
441
441
|
class: "p-button p-button-sm p-button-text",
|
|
442
442
|
type: "button",
|
|
443
|
-
onClick:
|
|
443
|
+
onClick: i[2] || (i[2] = (E) => p.value = !1)
|
|
444
444
|
}, "取消"),
|
|
445
445
|
e("button", {
|
|
446
446
|
class: "p-button p-button-sm p-button-danger",
|
|
447
447
|
type: "button",
|
|
448
|
-
onClick:
|
|
448
|
+
onClick: i[3] || (i[3] = (E) => d(m)())
|
|
449
449
|
}, "确定退出")
|
|
450
450
|
])
|
|
451
451
|
], 64)) : (t(), l("button", {
|
|
452
452
|
key: 0,
|
|
453
453
|
class: "labull-user__item",
|
|
454
454
|
type: "button",
|
|
455
|
-
onClick:
|
|
455
|
+
onClick: i[1] || (i[1] = (E) => p.value = !0)
|
|
456
456
|
}, "退出登录"))
|
|
457
457
|
])) : _("", !0)
|
|
458
458
|
], 512));
|
|
459
459
|
}
|
|
460
|
-
}),
|
|
460
|
+
}), he = /* @__PURE__ */ J(mt, [["__scopeId", "data-v-27408f31"]]);
|
|
461
461
|
let ee = !1, j = null;
|
|
462
|
-
const
|
|
462
|
+
const pe = {
|
|
463
463
|
pass(n) {
|
|
464
464
|
return ee ? Promise.resolve(!0) : j || (j = (async () => {
|
|
465
|
-
const
|
|
466
|
-
return
|
|
465
|
+
const r = await xe();
|
|
466
|
+
return r !== "timeout" && r ? (ee = !0, !0) : (r !== "timeout" && Le(n), !1);
|
|
467
467
|
})().finally(() => {
|
|
468
468
|
j = null;
|
|
469
469
|
}), j);
|
|
@@ -473,10 +473,10 @@ const he = {
|
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
function fe() {
|
|
476
|
-
return
|
|
476
|
+
return pe.pass(q());
|
|
477
477
|
}
|
|
478
478
|
function kt() {
|
|
479
|
-
|
|
479
|
+
pe.reset();
|
|
480
480
|
}
|
|
481
481
|
const yt = {
|
|
482
482
|
key: 0,
|
|
@@ -502,7 +502,7 @@ const yt = {
|
|
|
502
502
|
}, It = { class: "labull-body" }, Ot = { class: "labull-main" }, Nt = { class: "labull-viewport" }, At = {
|
|
503
503
|
key: 0,
|
|
504
504
|
class: "labull-tabpage"
|
|
505
|
-
},
|
|
505
|
+
}, Ut = { class: "labull-tabpages" }, Bt = /* @__PURE__ */ z({
|
|
506
506
|
__name: "ProductShell",
|
|
507
507
|
props: {
|
|
508
508
|
actions: { type: Boolean, default: !0 },
|
|
@@ -513,9 +513,7 @@ const yt = {
|
|
|
513
513
|
brand: {}
|
|
514
514
|
},
|
|
515
515
|
setup(n) {
|
|
516
|
-
const
|
|
517
|
-
C(() => !!i.logo || !!i.caption);
|
|
518
|
-
const G = C(() => !!(i.side && i.side.length > 0)), I = C(() => m.meta.tab === !1);
|
|
516
|
+
const r = n, m = re(), c = ne(), { tabs: p, active: h } = ce(), { portrait: o, navOpen: g, toggleNav: L } = se(), { open: k, denied: C, unreachable: i, pass: E, recheck: B } = Ee(), M = x(() => m.path === "/login" || q() === "/login"), K = x(() => Te(q())), G = x(() => !!(r.side && r.side.length > 0)), I = x(() => m.meta.tab === !1);
|
|
519
517
|
ie({
|
|
520
518
|
resolve: (a) => {
|
|
521
519
|
const f = R(c.resolve(a));
|
|
@@ -548,28 +546,28 @@ const yt = {
|
|
|
548
546
|
if (M.value) return;
|
|
549
547
|
await fe() && await E(q());
|
|
550
548
|
}
|
|
551
|
-
function
|
|
549
|
+
function u() {
|
|
552
550
|
window.location.reload();
|
|
553
551
|
}
|
|
554
552
|
function y(a) {
|
|
555
|
-
a.persisted && (kt(),
|
|
553
|
+
a.persisted && (kt(), B(q()));
|
|
556
554
|
}
|
|
557
|
-
let
|
|
555
|
+
let P;
|
|
558
556
|
return X(() => {
|
|
559
557
|
window.addEventListener("pageshow", y), b().then(() => {
|
|
560
|
-
k.value && (V(m),
|
|
558
|
+
k.value && (V(m), P = c.afterEach((a) => V(a)));
|
|
561
559
|
});
|
|
562
560
|
}), Y(() => {
|
|
563
|
-
window.removeEventListener("pageshow", y),
|
|
561
|
+
window.removeEventListener("pageshow", y), P?.(), ie(null);
|
|
564
562
|
}), (a, f) => !d(k) && !M.value ? (t(), l("div", yt, [
|
|
565
563
|
f[5] || (f[5] = e("p", { class: "labull-gate__title" }, "正在确认登录状态…", -1)),
|
|
566
|
-
d(
|
|
567
|
-
d(
|
|
564
|
+
d(C) ? (t(), l("p", wt, [
|
|
565
|
+
d(i) ? (t(), l(T, { key: 0 }, [
|
|
568
566
|
W("连不上后端(等了 " + w(Math.round(d(Se) / 1e3)) + " 秒也没有回音)。确认后端起来之后 ", 1),
|
|
569
567
|
e("button", {
|
|
570
568
|
class: "labull-gate__link",
|
|
571
569
|
type: "button",
|
|
572
|
-
onClick:
|
|
570
|
+
onClick: u
|
|
573
571
|
}, "重试"),
|
|
574
572
|
f[1] || (f[1] = W(",或者", -1)),
|
|
575
573
|
e("a", {
|
|
@@ -615,7 +613,7 @@ const yt = {
|
|
|
615
613
|
Z(a.$slots, "actions", {}, void 0, !0),
|
|
616
614
|
n.actions ? (t(), l(T, { key: 0 }, [
|
|
617
615
|
F(de),
|
|
618
|
-
F(
|
|
616
|
+
F(he)
|
|
619
617
|
], 64)) : _("", !0)
|
|
620
618
|
])) : _("", !0)
|
|
621
619
|
])) : _("", !0),
|
|
@@ -632,14 +630,14 @@ const yt = {
|
|
|
632
630
|
I.value ? (t(), l("div", At, [
|
|
633
631
|
F(d($e))
|
|
634
632
|
])) : _("", !0),
|
|
635
|
-
te(e("div",
|
|
636
|
-
(t(!0), l(T, null, D(d(
|
|
633
|
+
te(e("div", Ut, [
|
|
634
|
+
(t(!0), l(T, null, D(d(p), (N) => te((t(), l("div", {
|
|
637
635
|
key: N.key,
|
|
638
636
|
class: "labull-tabpage"
|
|
639
637
|
}, [
|
|
640
638
|
F(ut, { tab: N }, null, 8, ["tab"])
|
|
641
639
|
])), [
|
|
642
|
-
[oe, N.key === d(
|
|
640
|
+
[oe, N.key === d(h)]
|
|
643
641
|
])), 128))
|
|
644
642
|
], 512), [
|
|
645
643
|
[oe, !I.value]
|
|
@@ -649,18 +647,18 @@ const yt = {
|
|
|
649
647
|
])
|
|
650
648
|
]));
|
|
651
649
|
}
|
|
652
|
-
}), Kt = /* @__PURE__ */ J(
|
|
653
|
-
function Dt(n,
|
|
654
|
-
for (const [c,
|
|
650
|
+
}), Kt = /* @__PURE__ */ J(Bt, [["__scopeId", "data-v-06035587"]]), Vt = { ProductShell: Kt, ProductSide: ve, ProductTabs: be, AppSearch: de, UserMenu: he };
|
|
651
|
+
function Dt(n, r = {}) {
|
|
652
|
+
for (const [c, p] of Object.entries(Vt)) n.component(c, p);
|
|
655
653
|
const m = n.config.globalProperties.$router;
|
|
656
654
|
m ? m.beforeEach(async (c) => c.path === "/login" ? !0 : await fe()) : console.warn("[labull] 没拿到 router:把 app.use(labull) 放到 app.use(router) 之后。");
|
|
657
|
-
for (const c of
|
|
655
|
+
for (const c of r.extra ?? []) n.use(c);
|
|
658
656
|
}
|
|
659
657
|
const zt = { install: (n) => Dt(n) };
|
|
660
658
|
export {
|
|
661
659
|
de as A,
|
|
662
660
|
Kt as P,
|
|
663
|
-
|
|
661
|
+
he as U,
|
|
664
662
|
ut as _,
|
|
665
663
|
ve as a,
|
|
666
664
|
be as b,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as e, a as t, C as r, b as o, c as l, d as i, e as u, f as c, g as n, h as T, l as b, i as A, j as p, u as d } from "./chunk-index-BWpDbB19.js";
|
|
2
|
-
import { A as S, P as E, a as _, b as P, _ as U, U as f, i as g, l as I } from "./chunk-index-
|
|
3
|
-
import { T as C, a as N, c as m, f as D, i as L, b as v, o as M, p as B, s as H, u as O, d as R } from "./chunk-ProductShell.
|
|
2
|
+
import { A as S, P as E, a as _, b as P, _ as U, U as f, i as g, l as I } from "./chunk-index-BN-lnG-w.js";
|
|
3
|
+
import { T as C, a as N, c as m, f as D, i as L, b as v, o as M, p as B, s as H, u as O, d as R } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
|
|
4
4
|
export {
|
|
5
5
|
e as API_BASE,
|
|
6
6
|
t as AUTH_DEADLINE_MS,
|