@wapri/element-pro 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/CheckCard/Group.vue.d.ts +54 -0
- package/dist/CheckCard/context.d.ts +12 -0
- package/dist/CheckCard/index.d.ts +443 -0
- package/dist/CheckCard/index.vue.d.ts +53 -0
- package/dist/CheckCard/selection.d.ts +4 -0
- package/dist/CheckCard/types.d.ts +29 -0
- package/dist/ConfigProvider/context.d.ts +11 -0
- package/dist/ConfigProvider/index.d.ts +50 -0
- package/dist/ConfigProvider/index.vue.d.ts +28 -0
- package/dist/CropperUpload/CropperDialog.vue.d.ts +23 -0
- package/dist/CropperUpload/index.d.ts +241 -0
- package/dist/CropperUpload/index.vue.d.ts +81 -0
- package/dist/CropperUpload/types.d.ts +137 -0
- package/dist/CropperUpload/utils.d.ts +42 -0
- package/dist/DateQuickSelect/index.d.ts +65 -0
- package/dist/DateQuickSelect/index.vue.d.ts +55 -0
- package/dist/DateQuickSelect/types.d.ts +19 -0
- package/dist/DateQuickSelect/utils.d.ts +9 -0
- package/dist/DrawerForm/index.d.ts +201 -0
- package/dist/DrawerForm/index.vue.d.ts +76 -0
- package/dist/Ellipsis/index.d.ts +35 -0
- package/dist/Ellipsis/types.d.ts +23 -0
- package/dist/Layout/components/SidebarTrigger.vue.d.ts +21 -0
- package/dist/Layout/index.d.ts +147 -0
- package/dist/Layout/index.vue.d.ts +65 -0
- package/dist/Layout/types.d.ts +24 -0
- package/dist/MainContent/index.d.ts +115 -0
- package/dist/MainContent/index.vue.d.ts +51 -0
- package/dist/MainContent/types.d.ts +17 -0
- package/dist/ModalForm/index.d.ts +201 -0
- package/dist/ModalForm/index.vue.d.ts +76 -0
- package/dist/ProTable/components/ProTablePagination.vue.d.ts +43 -0
- package/dist/ProTable/components/ProTableSearchForm.vue.d.ts +34 -0
- package/dist/ProTable/components/ProTableSelectedFilters.vue.d.ts +21 -0
- package/dist/ProTable/components/ProTableSelectionActions.vue.d.ts +36 -0
- package/dist/ProTable/components/ProTableToolbar.vue.d.ts +47 -0
- package/dist/ProTable/composables/useProTableData.d.ts +34 -0
- package/dist/ProTable/composables/useProTableSelection.d.ts +10 -0
- package/dist/ProTable/composables/useStickyTable.d.ts +18 -0
- package/dist/ProTable/index.d.ts +412 -0
- package/dist/ProTable/index.vue.d.ts +54 -0
- package/dist/ProTable/types.d.ts +265 -0
- package/dist/ProTable/utils.d.ts +25 -0
- package/dist/ShareButton/index.d.ts +157 -0
- package/dist/ShareButton/index.vue.d.ts +60 -0
- package/dist/ShareButton/steps.d.ts +13 -0
- package/dist/ShareButton/types.d.ts +34 -0
- package/dist/Sidebar/components/SidebarGroup.vue.d.ts +53 -0
- package/dist/Sidebar/components/SidebarIcon.vue.d.ts +23 -0
- package/dist/Sidebar/components/SidebarItem.vue.d.ts +33 -0
- package/dist/Sidebar/components/SidebarItemContent.vue.d.ts +27 -0
- package/dist/Sidebar/components/SidebarLink.vue.d.ts +54 -0
- package/dist/Sidebar/components/SidebarLogo.vue.d.ts +48 -0
- package/dist/Sidebar/composables/useActiveMenuScroll.d.ts +18 -0
- package/dist/Sidebar/context.d.ts +10 -0
- package/dist/Sidebar/index.d.ts +350 -0
- package/dist/Sidebar/index.vue.d.ts +72 -0
- package/dist/Sidebar/types.d.ts +154 -0
- package/dist/Sidebar/utils.d.ts +16 -0
- package/dist/SvgIcon/iconfont.d.ts +11 -0
- package/dist/SvgIcon/index.d.ts +35 -0
- package/dist/SvgIcon/index.vue.d.ts +38 -0
- package/dist/TagSelector/index.d.ts +51 -0
- package/dist/TagSelector/index.vue.d.ts +49 -0
- package/dist/TagSelector/types.d.ts +6 -0
- package/dist/VH100/index.d.ts +40 -0
- package/dist/VH100/index.vue.d.ts +26 -0
- package/dist/constant/index.d.ts +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +3985 -0
- package/dist/shared/overlayForm/types.d.ts +25 -0
- package/dist/shared/overlayForm/useOverlayForm.d.ts +18 -0
- package/dist/style.css +1 -0
- package/dist/utils/install.d.ts +10 -0
- package/package.json +39 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3985 @@
|
|
|
1
|
+
import { inject as lt, computed as d, defineComponent as ae, ref as q, openBlock as i, createElementBlock as C, withKeys as It, withModifiers as Be, normalizeClass as k, createBlock as x, unref as l, Fragment as X, renderSlot as z, createElementVNode as F, createCommentVNode as I, createTextVNode as te, toDisplayString as H, provide as wt, renderList as pe, mergeProps as fe, watch as he, createSlots as Fe, withCtx as $, createVNode as L, normalizeProps as nt, guardReactiveProps as ot, onMounted as Ue, onBeforeUnmount as De, h as ze, nextTick as Re, useSlots as Zt, reactive as Mt, resolveDynamicComponent as Oe, isVNode as Ze, resolveComponent as Jt, shallowRef as St, normalizeStyle as Te, withDirectives as ea, vShow as ta, isRef as Ft, useAttrs as aa, Transition as la, Teleport as ul } from "vue";
|
|
2
|
+
import { useFormItem as na, ElSkeleton as cl, ElDialog as oa, ElForm as $t, ElButton as de, ElDrawer as dl, ElDatePicker as fl, ElPagination as vl, ElRow as pl, ElCol as hl, ElFormItem as Ot, ElTreeSelect as ml, ElCascader as bl, ElSelect as yl, ElOption as gl, ElInputNumber as kl, ElSwitch as wl, ElInput as Dt, ElTag as Sl, ElTabs as $l, ElTabPane as Cl, ElBadge as Lt, ElDropdown as xl, ElIcon as Ce, ElDropdownMenu as Tl, ElDropdownItem as Rl, ElAlert as Pl, ElTable as Al, ElTableColumn as zt, ElPopover as _l, ElMenuItem as El, ElSubMenu as Bl, ElScrollbar as Vl, ElMenu as Il, ElButtonGroup as qt, ElTooltip as Qe, ElMessage as ra, ElUpload as Ml } from "element-plus";
|
|
3
|
+
import { dayjs as dt, isEmpty as ia, os as Fl, copy as Ol } from "@wapri/gutils";
|
|
4
|
+
import * as Dl from "@element-plus/icons-vue";
|
|
5
|
+
import { Search as Ll, RefreshLeft as sa, ArrowDown as Je, ArrowUp as zl, Download as ql, Refresh as ua, Menu as Ie, Operation as Nl, Loading as jl, ZoomOut as Hl, ZoomIn as Ul } from "@element-plus/icons-vue";
|
|
6
|
+
import { useVh100 as Wl } from "@wapri/ghooks";
|
|
7
|
+
import { VueCropper as Kl } from "vue-cropper";
|
|
8
|
+
const ca = "wa-ui", mt = Symbol("ElementProConfigProvider"), Yl = {
|
|
9
|
+
size: d(() => "default"),
|
|
10
|
+
prefix: d(() => ca),
|
|
11
|
+
iconfont: d(() => {
|
|
12
|
+
})
|
|
13
|
+
};
|
|
14
|
+
function me() {
|
|
15
|
+
return lt(mt, Yl);
|
|
16
|
+
}
|
|
17
|
+
const da = Symbol("CheckCardGroup");
|
|
18
|
+
function Gl(e, a) {
|
|
19
|
+
return Array.isArray(e) ? e.includes(a) : e === a;
|
|
20
|
+
}
|
|
21
|
+
function Ql(e, a, t) {
|
|
22
|
+
if (!t) return e === a ? null : a;
|
|
23
|
+
const n = Array.isArray(e) ? e : e === null ? [] : [e];
|
|
24
|
+
return n.includes(a) ? n.filter((o) => o !== a) : [...n, a];
|
|
25
|
+
}
|
|
26
|
+
const Xl = ["aria-checked", "aria-disabled", "aria-busy", "tabindex", "onKeydown"], Zl = ["src", "alt"], Jl = ["src"], fa = /* @__PURE__ */ ae({
|
|
27
|
+
name: "CheckCard",
|
|
28
|
+
__name: "index",
|
|
29
|
+
props: {
|
|
30
|
+
checked: { type: Boolean, default: void 0 },
|
|
31
|
+
defaultChecked: { type: Boolean, default: !1 },
|
|
32
|
+
value: {},
|
|
33
|
+
title: {},
|
|
34
|
+
description: {},
|
|
35
|
+
avatar: {},
|
|
36
|
+
cover: {},
|
|
37
|
+
disabled: { type: Boolean },
|
|
38
|
+
loading: { type: Boolean },
|
|
39
|
+
bordered: { type: Boolean, default: void 0 },
|
|
40
|
+
size: {}
|
|
41
|
+
},
|
|
42
|
+
emits: ["update:checked", "change"],
|
|
43
|
+
setup(e, { emit: a }) {
|
|
44
|
+
const t = e, n = a, o = lt(da, void 0), { prefix: f, size: p } = me(), { form: u, formItem: v } = na(), h = q(t.defaultChecked), m = d(
|
|
45
|
+
() => o ? t.value !== void 0 && Gl(o.value.value, t.value) : t.checked ?? h.value
|
|
46
|
+
), w = d(() => t.loading || (o == null ? void 0 : o.loading.value)), M = d(
|
|
47
|
+
() => t.disabled || (o == null ? void 0 : o.disabled.value) || (u == null ? void 0 : u.disabled) || w.value || !!(o && t.value === void 0)
|
|
48
|
+
), P = d(() => t.bordered ?? (o == null ? void 0 : o.bordered.value) ?? !0), _ = d(() => t.size ?? (o == null ? void 0 : o.size.value) ?? p.value), S = d(() => `${f.value}-check-card`), A = (T) => {
|
|
49
|
+
if (M.value) return;
|
|
50
|
+
const U = T.target;
|
|
51
|
+
if (U instanceof Element && U !== T.currentTarget && U.closest('a, button, input, select, textarea, [contenteditable="true"]'))
|
|
52
|
+
return;
|
|
53
|
+
const B = !m.value;
|
|
54
|
+
o && t.value !== void 0 ? o.toggle(t.value) : (t.checked === void 0 && (h.value = B), v == null || v.validate("change").catch(() => {
|
|
55
|
+
})), n("update:checked", B), n("change", B);
|
|
56
|
+
};
|
|
57
|
+
return (T, U) => (i(), C("div", {
|
|
58
|
+
class: k([
|
|
59
|
+
S.value,
|
|
60
|
+
`${S.value}--${_.value}`,
|
|
61
|
+
{ [`${S.value}--checked`]: m.value, [`${S.value}--disabled`]: M.value, [`${S.value}--borderless`]: !P.value }
|
|
62
|
+
]),
|
|
63
|
+
role: "checkbox",
|
|
64
|
+
"aria-checked": m.value,
|
|
65
|
+
"aria-disabled": !!M.value,
|
|
66
|
+
"aria-busy": !!w.value,
|
|
67
|
+
tabindex: M.value ? -1 : 0,
|
|
68
|
+
onClick: A,
|
|
69
|
+
onKeydown: [
|
|
70
|
+
It(Be(A, ["self", "prevent"]), ["space"]),
|
|
71
|
+
It(Be(A, ["self", "prevent"]), ["enter"])
|
|
72
|
+
]
|
|
73
|
+
}, [
|
|
74
|
+
w.value ? (i(), x(l(cl), {
|
|
75
|
+
key: 0,
|
|
76
|
+
rows: 2,
|
|
77
|
+
animated: ""
|
|
78
|
+
})) : (i(), C(X, { key: 1 }, [
|
|
79
|
+
T.$slots.cover || e.cover ? (i(), C("div", {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: k(`${S.value}__cover`)
|
|
82
|
+
}, [
|
|
83
|
+
z(T.$slots, "cover", {}, () => [
|
|
84
|
+
F("img", {
|
|
85
|
+
src: e.cover,
|
|
86
|
+
alt: e.title || ""
|
|
87
|
+
}, null, 8, Zl)
|
|
88
|
+
])
|
|
89
|
+
], 2)) : (i(), C(X, { key: 1 }, [
|
|
90
|
+
T.$slots.avatar || e.avatar ? (i(), C("div", {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: k(`${S.value}__avatar`)
|
|
93
|
+
}, [
|
|
94
|
+
z(T.$slots, "avatar", {}, () => [
|
|
95
|
+
F("img", {
|
|
96
|
+
src: e.avatar,
|
|
97
|
+
alt: ""
|
|
98
|
+
}, null, 8, Jl)
|
|
99
|
+
])
|
|
100
|
+
], 2)) : I("", !0),
|
|
101
|
+
F("div", {
|
|
102
|
+
class: k(`${S.value}__content`)
|
|
103
|
+
}, [
|
|
104
|
+
T.$slots.title || e.title || T.$slots.extra ? (i(), C("div", {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: k(`${S.value}__header`)
|
|
107
|
+
}, [
|
|
108
|
+
F("div", {
|
|
109
|
+
class: k(`${S.value}__title`)
|
|
110
|
+
}, [
|
|
111
|
+
z(T.$slots, "title", {}, () => [
|
|
112
|
+
te(H(e.title), 1)
|
|
113
|
+
])
|
|
114
|
+
], 2),
|
|
115
|
+
T.$slots.extra ? (i(), C("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: k(`${S.value}__extra`),
|
|
118
|
+
onClick: U[0] || (U[0] = Be(() => {
|
|
119
|
+
}, ["stop"])),
|
|
120
|
+
onKeydown: U[1] || (U[1] = Be(() => {
|
|
121
|
+
}, ["stop"]))
|
|
122
|
+
}, [
|
|
123
|
+
z(T.$slots, "extra")
|
|
124
|
+
], 34)) : I("", !0)
|
|
125
|
+
], 2)) : I("", !0),
|
|
126
|
+
T.$slots.default || T.$slots.description || e.description ? (i(), C("div", {
|
|
127
|
+
key: 1,
|
|
128
|
+
class: k(`${S.value}__description`)
|
|
129
|
+
}, [
|
|
130
|
+
z(T.$slots, "default", {}, () => [
|
|
131
|
+
z(T.$slots, "description", {}, () => [
|
|
132
|
+
te(H(e.description), 1)
|
|
133
|
+
])
|
|
134
|
+
])
|
|
135
|
+
], 2)) : I("", !0)
|
|
136
|
+
], 2)
|
|
137
|
+
], 64))
|
|
138
|
+
], 64))
|
|
139
|
+
], 42, Xl));
|
|
140
|
+
}
|
|
141
|
+
}), en = ["aria-disabled", "aria-busy"], tn = /* @__PURE__ */ ae({
|
|
142
|
+
name: "CheckCardGroup",
|
|
143
|
+
__name: "Group",
|
|
144
|
+
props: {
|
|
145
|
+
modelValue: {},
|
|
146
|
+
defaultValue: { default: null },
|
|
147
|
+
multiple: { type: Boolean, default: !1 },
|
|
148
|
+
disabled: { type: Boolean, default: !1 },
|
|
149
|
+
loading: { type: Boolean, default: !1 },
|
|
150
|
+
bordered: { type: Boolean, default: !0 },
|
|
151
|
+
size: {},
|
|
152
|
+
options: {}
|
|
153
|
+
},
|
|
154
|
+
emits: ["update:modelValue", "change"],
|
|
155
|
+
setup(e, { emit: a }) {
|
|
156
|
+
const t = e, n = a, { form: o, formItem: f } = na(), { prefix: p, size: u } = me(), r = q(Array.isArray(t.defaultValue) ? [...t.defaultValue] : t.defaultValue), h = d(() => t.modelValue === void 0 ? r.value : t.modelValue), m = d(() => t.disabled || !!(o != null && o.disabled)), w = d(
|
|
157
|
+
() => {
|
|
158
|
+
var P;
|
|
159
|
+
return (P = t.options) == null ? void 0 : P.map((_) => typeof _ == "object" ? _ : { value: _, title: String(_) });
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
return wt(da, {
|
|
163
|
+
value: h,
|
|
164
|
+
disabled: m,
|
|
165
|
+
toggle: (P) => {
|
|
166
|
+
if (m.value || t.loading) return;
|
|
167
|
+
const _ = Ql(h.value, P, t.multiple);
|
|
168
|
+
t.modelValue === void 0 && (r.value = _), n("update:modelValue", _), n("change", _), f == null || f.validate("change").catch(() => {
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
loading: d(() => t.loading),
|
|
172
|
+
bordered: d(() => t.bordered),
|
|
173
|
+
size: d(() => t.size ?? u.value)
|
|
174
|
+
}), (P, _) => (i(), C("div", {
|
|
175
|
+
class: k(`${l(p)}-check-card-group`),
|
|
176
|
+
role: "group",
|
|
177
|
+
"aria-disabled": m.value,
|
|
178
|
+
"aria-busy": e.loading
|
|
179
|
+
}, [
|
|
180
|
+
z(P.$slots, "default", {}, () => [
|
|
181
|
+
(i(!0), C(X, null, pe(w.value, (S) => (i(), x(fa, fe({
|
|
182
|
+
key: S.value
|
|
183
|
+
}, { ref_for: !0 }, S), null, 16))), 128))
|
|
184
|
+
])
|
|
185
|
+
], 10, en));
|
|
186
|
+
}
|
|
187
|
+
}), Nt = (e, a) => {
|
|
188
|
+
const t = a;
|
|
189
|
+
t != null && t.name && e.component(t.name, t);
|
|
190
|
+
}, be = (e, a) => {
|
|
191
|
+
if (e.install = (t) => {
|
|
192
|
+
Nt(t, e);
|
|
193
|
+
for (const n of Object.values(a ?? {}))
|
|
194
|
+
Nt(t, n);
|
|
195
|
+
}, a)
|
|
196
|
+
for (const [t, n] of Object.entries(a))
|
|
197
|
+
e[t] = n;
|
|
198
|
+
return e;
|
|
199
|
+
}, an = be(tn), ln = be(fa, { Group: an });
|
|
200
|
+
function va(e, a) {
|
|
201
|
+
const t = q(), n = q(!1);
|
|
202
|
+
let o = 0;
|
|
203
|
+
he(
|
|
204
|
+
() => e.open,
|
|
205
|
+
() => {
|
|
206
|
+
o += 1;
|
|
207
|
+
},
|
|
208
|
+
{ flush: "sync" }
|
|
209
|
+
);
|
|
210
|
+
const f = async () => {
|
|
211
|
+
var w;
|
|
212
|
+
if (n.value || !e.open || !t.value) return !1;
|
|
213
|
+
n.value = !0;
|
|
214
|
+
const m = o;
|
|
215
|
+
try {
|
|
216
|
+
if (!await t.value.validate().catch(() => !1) || m !== o) return !1;
|
|
217
|
+
const P = await ((w = e.onFinish) == null ? void 0 : w.call(e, e.model));
|
|
218
|
+
return m !== o || P === !1 ? !1 : (a("finish", e.model), a("update:open", !1), !0);
|
|
219
|
+
} catch (M) {
|
|
220
|
+
return a("finishFailed", M), !1;
|
|
221
|
+
} finally {
|
|
222
|
+
n.value = !1;
|
|
223
|
+
}
|
|
224
|
+
}, p = () => {
|
|
225
|
+
n.value || (a("cancel"), a("update:open", !1));
|
|
226
|
+
}, u = () => {
|
|
227
|
+
var m;
|
|
228
|
+
return (m = t.value) == null ? void 0 : m.resetFields();
|
|
229
|
+
};
|
|
230
|
+
return { formRef: t, submitting: n, submit: f, cancel: p, closed: () => {
|
|
231
|
+
e.resetOnClose && !e.open && u();
|
|
232
|
+
}, resetFields: u, validate: () => {
|
|
233
|
+
var m;
|
|
234
|
+
return (m = t.value) == null ? void 0 : m.validate();
|
|
235
|
+
}, clearValidate: (m) => {
|
|
236
|
+
var w;
|
|
237
|
+
return (w = t.value) == null ? void 0 : w.clearValidate(m);
|
|
238
|
+
} };
|
|
239
|
+
}
|
|
240
|
+
const nn = /* @__PURE__ */ ae({
|
|
241
|
+
name: "ModalForm",
|
|
242
|
+
inheritAttrs: !1,
|
|
243
|
+
__name: "index",
|
|
244
|
+
props: {
|
|
245
|
+
modalProps: {},
|
|
246
|
+
open: { type: Boolean, default: !1 },
|
|
247
|
+
model: {},
|
|
248
|
+
title: {},
|
|
249
|
+
formProps: {},
|
|
250
|
+
onFinish: {},
|
|
251
|
+
submitText: { default: "确定" },
|
|
252
|
+
cancelText: { default: "取消" },
|
|
253
|
+
submitter: { type: Boolean, default: !0 },
|
|
254
|
+
resetOnClose: { type: Boolean, default: !1 }
|
|
255
|
+
},
|
|
256
|
+
emits: ["update:open", "finish", "finishFailed", "cancel"],
|
|
257
|
+
setup(e, { expose: a, emit: t }) {
|
|
258
|
+
const n = e, o = t, { prefix: f } = me(), { formRef: p, submitting: u, submit: v, cancel: r, closed: h, resetFields: m, validate: w, clearValidate: M } = va(
|
|
259
|
+
n,
|
|
260
|
+
o
|
|
261
|
+
);
|
|
262
|
+
return a({ submit: v, resetFields: m, validate: w, clearValidate: M }), (P, _) => {
|
|
263
|
+
var S, A;
|
|
264
|
+
return i(), x(l(oa), fe({ width: "520px" }, { ...P.$attrs, ...e.modalProps }, {
|
|
265
|
+
class: [`${l(f)}-modal-form`, P.$attrs.class],
|
|
266
|
+
title: e.title ?? ((S = e.modalProps) == null ? void 0 : S.title),
|
|
267
|
+
"model-value": e.open,
|
|
268
|
+
"before-close": l(u) ? () => {
|
|
269
|
+
} : (A = e.modalProps) == null ? void 0 : A.beforeClose,
|
|
270
|
+
"onUpdate:modelValue": _[0] || (_[0] = (T) => {
|
|
271
|
+
T || l(r)();
|
|
272
|
+
}),
|
|
273
|
+
onClosed: l(h)
|
|
274
|
+
}), Fe({
|
|
275
|
+
default: $(() => [
|
|
276
|
+
L(l($t), fe({
|
|
277
|
+
ref_key: "formRef",
|
|
278
|
+
ref: p
|
|
279
|
+
}, e.formProps, {
|
|
280
|
+
model: e.model,
|
|
281
|
+
onSubmit: Be(l(v), ["prevent"])
|
|
282
|
+
}), {
|
|
283
|
+
default: $(() => [
|
|
284
|
+
z(P.$slots, "default", {
|
|
285
|
+
model: e.model,
|
|
286
|
+
submitting: l(u)
|
|
287
|
+
})
|
|
288
|
+
]),
|
|
289
|
+
_: 3
|
|
290
|
+
}, 16, ["model", "onSubmit"])
|
|
291
|
+
]),
|
|
292
|
+
_: 2
|
|
293
|
+
}, [
|
|
294
|
+
P.$slots.header ? {
|
|
295
|
+
name: "header",
|
|
296
|
+
fn: $((T) => [
|
|
297
|
+
z(P.$slots, "header", nt(ot(T)))
|
|
298
|
+
]),
|
|
299
|
+
key: "0"
|
|
300
|
+
} : void 0,
|
|
301
|
+
P.$slots.footer || e.submitter ? {
|
|
302
|
+
name: "footer",
|
|
303
|
+
fn: $(() => [
|
|
304
|
+
z(P.$slots, "footer", {
|
|
305
|
+
submit: l(v),
|
|
306
|
+
cancel: l(r),
|
|
307
|
+
submitting: l(u)
|
|
308
|
+
}, () => [
|
|
309
|
+
L(l(de), {
|
|
310
|
+
disabled: l(u),
|
|
311
|
+
onClick: l(r)
|
|
312
|
+
}, {
|
|
313
|
+
default: $(() => [
|
|
314
|
+
te(H(e.cancelText), 1)
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["disabled", "onClick"]),
|
|
318
|
+
L(l(de), {
|
|
319
|
+
type: "primary",
|
|
320
|
+
loading: l(u),
|
|
321
|
+
onClick: l(v)
|
|
322
|
+
}, {
|
|
323
|
+
default: $(() => [
|
|
324
|
+
te(H(e.submitText), 1)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
}, 8, ["loading", "onClick"])
|
|
328
|
+
])
|
|
329
|
+
]),
|
|
330
|
+
key: "1"
|
|
331
|
+
} : void 0
|
|
332
|
+
]), 1040, ["class", "title", "model-value", "before-close", "onClosed"]);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}), on = be(nn), rn = /* @__PURE__ */ ae({
|
|
336
|
+
name: "DrawerForm",
|
|
337
|
+
inheritAttrs: !1,
|
|
338
|
+
__name: "index",
|
|
339
|
+
props: {
|
|
340
|
+
drawerProps: {},
|
|
341
|
+
open: { type: Boolean, default: !1 },
|
|
342
|
+
model: {},
|
|
343
|
+
title: {},
|
|
344
|
+
formProps: {},
|
|
345
|
+
onFinish: {},
|
|
346
|
+
submitText: { default: "确定" },
|
|
347
|
+
cancelText: { default: "取消" },
|
|
348
|
+
submitter: { type: Boolean, default: !0 },
|
|
349
|
+
resetOnClose: { type: Boolean, default: !1 }
|
|
350
|
+
},
|
|
351
|
+
emits: ["update:open", "finish", "finishFailed", "cancel"],
|
|
352
|
+
setup(e, { expose: a, emit: t }) {
|
|
353
|
+
const n = e, o = t, { prefix: f } = me(), { formRef: p, submitting: u, submit: v, cancel: r, closed: h, resetFields: m, validate: w, clearValidate: M } = va(
|
|
354
|
+
n,
|
|
355
|
+
o
|
|
356
|
+
);
|
|
357
|
+
return a({ submit: v, resetFields: m, validate: w, clearValidate: M }), (P, _) => {
|
|
358
|
+
var S, A;
|
|
359
|
+
return i(), x(l(dl), fe({ size: "520px" }, { destroyOnClose: !0, ...P.$attrs, ...e.drawerProps }, {
|
|
360
|
+
class: [`${l(f)}-drawer-form`, P.$attrs.class],
|
|
361
|
+
title: e.title ?? ((S = e.drawerProps) == null ? void 0 : S.title),
|
|
362
|
+
"model-value": e.open,
|
|
363
|
+
"before-close": l(u) ? () => {
|
|
364
|
+
} : (A = e.drawerProps) == null ? void 0 : A.beforeClose,
|
|
365
|
+
"onUpdate:modelValue": _[0] || (_[0] = (T) => {
|
|
366
|
+
T || l(r)();
|
|
367
|
+
}),
|
|
368
|
+
onClosed: l(h)
|
|
369
|
+
}), Fe({
|
|
370
|
+
default: $(() => [
|
|
371
|
+
L(l($t), fe({
|
|
372
|
+
ref_key: "formRef",
|
|
373
|
+
ref: p
|
|
374
|
+
}, e.formProps, {
|
|
375
|
+
model: e.model,
|
|
376
|
+
onSubmit: Be(l(v), ["prevent"])
|
|
377
|
+
}), {
|
|
378
|
+
default: $(() => [
|
|
379
|
+
z(P.$slots, "default", {
|
|
380
|
+
model: e.model,
|
|
381
|
+
submitting: l(u)
|
|
382
|
+
})
|
|
383
|
+
]),
|
|
384
|
+
_: 3
|
|
385
|
+
}, 16, ["model", "onSubmit"])
|
|
386
|
+
]),
|
|
387
|
+
_: 2
|
|
388
|
+
}, [
|
|
389
|
+
P.$slots.header ? {
|
|
390
|
+
name: "header",
|
|
391
|
+
fn: $((T) => [
|
|
392
|
+
z(P.$slots, "header", nt(ot(T)))
|
|
393
|
+
]),
|
|
394
|
+
key: "0"
|
|
395
|
+
} : void 0,
|
|
396
|
+
P.$slots.footer || e.submitter ? {
|
|
397
|
+
name: "footer",
|
|
398
|
+
fn: $(() => [
|
|
399
|
+
z(P.$slots, "footer", {
|
|
400
|
+
submit: l(v),
|
|
401
|
+
cancel: l(r),
|
|
402
|
+
submitting: l(u)
|
|
403
|
+
}, () => [
|
|
404
|
+
L(l(de), {
|
|
405
|
+
disabled: l(u),
|
|
406
|
+
onClick: l(r)
|
|
407
|
+
}, {
|
|
408
|
+
default: $(() => [
|
|
409
|
+
te(H(e.cancelText), 1)
|
|
410
|
+
]),
|
|
411
|
+
_: 1
|
|
412
|
+
}, 8, ["disabled", "onClick"]),
|
|
413
|
+
L(l(de), {
|
|
414
|
+
type: "primary",
|
|
415
|
+
loading: l(u),
|
|
416
|
+
onClick: l(v)
|
|
417
|
+
}, {
|
|
418
|
+
default: $(() => [
|
|
419
|
+
te(H(e.submitText), 1)
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
}, 8, ["loading", "onClick"])
|
|
423
|
+
])
|
|
424
|
+
]),
|
|
425
|
+
key: "1"
|
|
426
|
+
} : void 0
|
|
427
|
+
]), 1040, ["class", "title", "model-value", "before-close", "onClosed"]);
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
}), sn = be(rn), Xe = "...", un = ae({
|
|
431
|
+
name: "Ellipsis",
|
|
432
|
+
props: {
|
|
433
|
+
content: { type: String, default: "" },
|
|
434
|
+
direction: { type: String, default: "end" },
|
|
435
|
+
rows: { type: Number, default: 1 },
|
|
436
|
+
expandText: { type: null, default: void 0 },
|
|
437
|
+
collapseText: { type: null, default: void 0 },
|
|
438
|
+
stopPropagationForActionButtons: { type: Array, default: () => [] },
|
|
439
|
+
defaultExpanded: { type: Boolean, default: !1 }
|
|
440
|
+
},
|
|
441
|
+
emits: {
|
|
442
|
+
expand: (e, a) => !0,
|
|
443
|
+
contentClick: (e) => !0
|
|
444
|
+
},
|
|
445
|
+
setup(e, { emit: a }) {
|
|
446
|
+
const { prefix: t } = me(), n = q(), o = q(), f = q(), p = q(), u = q(
|
|
447
|
+
0
|
|
448
|
+
/* Prepare */
|
|
449
|
+
), v = q(!1), r = q(0), h = q(0), m = q(0), w = q(0);
|
|
450
|
+
let M, P = 0;
|
|
451
|
+
const _ = d(() => `${t.value}-ellipsis`), S = d(() => e.content ?? ""), A = d(() => Array.from(S.value)), T = d(() => {
|
|
452
|
+
const j = e.rows ?? 1;
|
|
453
|
+
return Number.isFinite(j) ? Math.max(1, Math.floor(j)) : 1;
|
|
454
|
+
}), U = d(() => e.direction ?? "end"), B = d(() => Math.ceil((h.value + m.value) / 2));
|
|
455
|
+
function J(j) {
|
|
456
|
+
var K;
|
|
457
|
+
return ((K = e.stopPropagationForActionButtons) == null ? void 0 : K.includes(j)) ?? !1;
|
|
458
|
+
}
|
|
459
|
+
function O(j, K) {
|
|
460
|
+
J(K) && j.stopPropagation();
|
|
461
|
+
}
|
|
462
|
+
function Z(j, K) {
|
|
463
|
+
O(K, "click"), v.value = j, a("expand", j, { event: K });
|
|
464
|
+
}
|
|
465
|
+
function le(j) {
|
|
466
|
+
const K = j ? e.expandText : e.collapseText;
|
|
467
|
+
if (K == null || K === "") return null;
|
|
468
|
+
const ie = j ? "expand" : "collapse";
|
|
469
|
+
return ze(
|
|
470
|
+
"button",
|
|
471
|
+
{
|
|
472
|
+
type: "button",
|
|
473
|
+
class: `${_.value}__action ${_.value}__action--${ie}`,
|
|
474
|
+
"aria-label": ie === "expand" ? "展开" : "收起",
|
|
475
|
+
onClick: (Y) => Z(j, Y),
|
|
476
|
+
onMousedown: (Y) => O(Y, "mousedown"),
|
|
477
|
+
onMouseup: (Y) => O(Y, "mouseup"),
|
|
478
|
+
onTouchstart: (Y) => O(Y, "touchstart"),
|
|
479
|
+
onTouchend: (Y) => O(Y, "touchend")
|
|
480
|
+
},
|
|
481
|
+
[K]
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
function N(j) {
|
|
485
|
+
const K = A.value.slice(0, j).join(""), ie = A.value.slice(A.value.length - j).join(""), Y = le(!0);
|
|
486
|
+
return U.value === "start" ? [Y, Xe, ie] : U.value === "middle" ? [K, Xe, Y, Xe, ie] : [K, Xe, Y];
|
|
487
|
+
}
|
|
488
|
+
function V(j) {
|
|
489
|
+
var Y;
|
|
490
|
+
if (j !== w.value || u.value !== 1) return;
|
|
491
|
+
const K = m.value - h.value, ie = ((Y = p.value) == null ? void 0 : Y.offsetHeight) ?? 0;
|
|
492
|
+
if (K > 1)
|
|
493
|
+
ie > r.value ? m.value = B.value : h.value = B.value;
|
|
494
|
+
else {
|
|
495
|
+
ie > r.value ? m.value = h.value : h.value = m.value, u.value = 2;
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
Re(() => V(j));
|
|
499
|
+
}
|
|
500
|
+
function G(j) {
|
|
501
|
+
var we, Se;
|
|
502
|
+
if (j !== w.value || u.value !== 0) return;
|
|
503
|
+
const K = ((we = o.value) == null ? void 0 : we.offsetHeight) ?? 0, Y = (((Se = f.value) == null ? void 0 : Se.offsetHeight) ?? 0) * (T.value + 0.5);
|
|
504
|
+
if (K <= Y) {
|
|
505
|
+
u.value = 3;
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
r.value = Y, u.value = 1, Re(() => V(j));
|
|
509
|
+
}
|
|
510
|
+
function W() {
|
|
511
|
+
const j = w.value + 1;
|
|
512
|
+
w.value = j, h.value = 0, m.value = U.value === "middle" ? Math.ceil(A.value.length / 2) : A.value.length, u.value = 0, Re(() => G(j));
|
|
513
|
+
}
|
|
514
|
+
function re(j) {
|
|
515
|
+
j.target === j.currentTarget && a("contentClick", j);
|
|
516
|
+
}
|
|
517
|
+
return he(
|
|
518
|
+
() => [S.value, T.value, U.value, e.expandText, e.collapseText, v.value],
|
|
519
|
+
W,
|
|
520
|
+
{ flush: "post" }
|
|
521
|
+
), Ue(() => {
|
|
522
|
+
v.value = e.defaultExpanded ?? !1, typeof ResizeObserver < "u" && (M = new ResizeObserver((j) => {
|
|
523
|
+
var ie;
|
|
524
|
+
const K = (ie = j[0]) == null ? void 0 : ie.contentRect.width;
|
|
525
|
+
K === void 0 || K === P || (P = K, W());
|
|
526
|
+
}), n.value && (P = n.value.clientWidth, M.observe(n.value))), W();
|
|
527
|
+
}), De(() => M == null ? void 0 : M.disconnect()), () => {
|
|
528
|
+
const j = v.value || u.value === 3 ? [S.value, u.value === 2 ? le(!1) : null] : u.value === 2 ? N(B.value) : null;
|
|
529
|
+
return ze(
|
|
530
|
+
"div",
|
|
531
|
+
{
|
|
532
|
+
ref: n,
|
|
533
|
+
class: _.value,
|
|
534
|
+
onClick: re
|
|
535
|
+
},
|
|
536
|
+
[
|
|
537
|
+
u.value === 0 ? ze("span", { ref: o, class: `${_.value}__measure` }, [S.value, le(!0)]) : null,
|
|
538
|
+
u.value === 0 ? ze("span", { ref: f, class: `${_.value}__measure` }, " ") : null,
|
|
539
|
+
u.value === 1 ? ze(
|
|
540
|
+
"span",
|
|
541
|
+
{ ref: p, class: `${_.value}__measure` },
|
|
542
|
+
N(B.value)
|
|
543
|
+
) : null,
|
|
544
|
+
j
|
|
545
|
+
]
|
|
546
|
+
);
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
}), cn = be(un);
|
|
550
|
+
function pa(e) {
|
|
551
|
+
return e === "dateRange" || e === "timeRange";
|
|
552
|
+
}
|
|
553
|
+
function bt(e, a) {
|
|
554
|
+
return typeof a == "string" ? e === a : Array.isArray(e) && e.length === 2 && e[0] === a[0] && e[1] === a[1];
|
|
555
|
+
}
|
|
556
|
+
function ha({
|
|
557
|
+
valueType: e,
|
|
558
|
+
config: a,
|
|
559
|
+
valueFormat: t
|
|
560
|
+
}) {
|
|
561
|
+
if (a === !1) return [];
|
|
562
|
+
const n = t ?? (e === "time" || e === "timeRange" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD"), o = pa(e), f = (r) => r.format(n), p = (r) => {
|
|
563
|
+
const h = dt().subtract(r, "day");
|
|
564
|
+
return o ? [f(h.startOf("day")), f(h.endOf("day"))] : f(h.startOf("day"));
|
|
565
|
+
}, u = (r) => [
|
|
566
|
+
f(
|
|
567
|
+
dt().subtract(r - 1, "day").startOf("day")
|
|
568
|
+
),
|
|
569
|
+
f(dt().endOf("day"))
|
|
570
|
+
], v = [];
|
|
571
|
+
return a.showYesterday === !0 && v.push({ key: "yesterday", label: "昨天", value: p(1) }), a.showToday !== !1 && v.push({ key: "today", label: "今天", value: p(0) }), o && (a.recentDays ?? [7, 30]).filter((r) => Number.isInteger(r) && r > 0).forEach((r) => {
|
|
572
|
+
v.push({ key: `recent-${r}`, label: `近 ${r} 天`, value: u(r) });
|
|
573
|
+
}), v;
|
|
574
|
+
}
|
|
575
|
+
const dn = /* @__PURE__ */ ae({
|
|
576
|
+
name: "DateQuickSelect",
|
|
577
|
+
__name: "index",
|
|
578
|
+
props: {
|
|
579
|
+
modelValue: {},
|
|
580
|
+
valueType: {},
|
|
581
|
+
quickSelect: { type: [Object, Boolean], default: !1 },
|
|
582
|
+
quickSelection: {},
|
|
583
|
+
datePickerProps: { default: () => ({}) },
|
|
584
|
+
placeholder: {},
|
|
585
|
+
clearable: { type: Boolean, default: !0 }
|
|
586
|
+
},
|
|
587
|
+
emits: ["update:modelValue", "quickSelect"],
|
|
588
|
+
setup(e, { emit: a }) {
|
|
589
|
+
const t = e, n = a, { prefix: o } = me(), f = d(() => {
|
|
590
|
+
const _ = t.datePickerProps.valueFormat;
|
|
591
|
+
return typeof _ == "string" ? _ : t.valueType === "time" || t.valueType === "timeRange" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
592
|
+
}), p = d(
|
|
593
|
+
() => ha({
|
|
594
|
+
valueType: t.valueType,
|
|
595
|
+
config: t.quickSelect ?? !1,
|
|
596
|
+
valueFormat: f.value
|
|
597
|
+
})
|
|
598
|
+
), u = d(() => pa(t.valueType)), v = d(() => t.valueType === "date" ? "date" : t.valueType === "dateRange" ? "daterange" : t.valueType === "time" ? "datetime" : "datetimerange"), r = d(() => t.valueType !== "timeRange" || t.datePickerProps.defaultTime !== void 0 ? t.datePickerProps : {
|
|
599
|
+
defaultTime: [new Date(2e3, 0, 1, 0, 0, 0), new Date(2e3, 0, 1, 23, 59, 59)],
|
|
600
|
+
...t.datePickerProps
|
|
601
|
+
}), h = d(() => t.quickSelection ? void 0 : t.modelValue), m = d(
|
|
602
|
+
() => typeof t.datePickerProps.startPlaceholder == "string" ? t.datePickerProps.startPlaceholder : t.valueType === "timeRange" ? "开始日期时间" : "开始日期"
|
|
603
|
+
), w = d(
|
|
604
|
+
() => typeof t.datePickerProps.endPlaceholder == "string" ? t.datePickerProps.endPlaceholder : t.valueType === "timeRange" ? "结束日期时间" : "结束日期"
|
|
605
|
+
);
|
|
606
|
+
function M(_) {
|
|
607
|
+
return t.quickSelection !== void 0 && bt(t.quickSelection.value, _.value);
|
|
608
|
+
}
|
|
609
|
+
function P(_) {
|
|
610
|
+
if (typeof _ == "string") {
|
|
611
|
+
n("update:modelValue", _);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
if (Array.isArray(_) && _.length === 2) {
|
|
615
|
+
const [S, A] = _;
|
|
616
|
+
if (typeof S == "string" && typeof A == "string") {
|
|
617
|
+
n("update:modelValue", [S, A]);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
n("update:modelValue", void 0);
|
|
622
|
+
}
|
|
623
|
+
return (_, S) => (i(), C("div", {
|
|
624
|
+
class: k(`${l(o)}-date-quick-select`)
|
|
625
|
+
}, [
|
|
626
|
+
p.value.length ? (i(), C("div", {
|
|
627
|
+
key: 0,
|
|
628
|
+
class: k(`${l(o)}-date-quick-select-options`)
|
|
629
|
+
}, [
|
|
630
|
+
(i(!0), C(X, null, pe(p.value, (A) => (i(), x(l(de), {
|
|
631
|
+
key: A.key,
|
|
632
|
+
type: "info",
|
|
633
|
+
class: k([`${l(o)}-date-quick-select-item`, M(A) && "is-selected"]),
|
|
634
|
+
"aria-pressed": M(A),
|
|
635
|
+
round: "",
|
|
636
|
+
onClick: (T) => n("quickSelect", A)
|
|
637
|
+
}, {
|
|
638
|
+
default: $(() => [
|
|
639
|
+
te(H(A.label), 1)
|
|
640
|
+
]),
|
|
641
|
+
_: 2
|
|
642
|
+
}, 1032, ["class", "aria-pressed", "onClick"]))), 128))
|
|
643
|
+
], 2)) : I("", !0),
|
|
644
|
+
L(l(fl), fe(r.value, {
|
|
645
|
+
"model-value": h.value,
|
|
646
|
+
type: v.value,
|
|
647
|
+
"value-format": f.value,
|
|
648
|
+
placeholder: u.value ? void 0 : e.placeholder,
|
|
649
|
+
"start-placeholder": u.value ? m.value : void 0,
|
|
650
|
+
"end-placeholder": u.value ? w.value : void 0,
|
|
651
|
+
clearable: e.clearable,
|
|
652
|
+
"onUpdate:modelValue": P
|
|
653
|
+
}), null, 16, ["model-value", "type", "value-format", "placeholder", "start-placeholder", "end-placeholder", "clearable"])
|
|
654
|
+
], 2));
|
|
655
|
+
}
|
|
656
|
+
}), ma = be(dn), ba = /* @__PURE__ */ ae({
|
|
657
|
+
name: "ProTablePagination",
|
|
658
|
+
__name: "ProTablePagination",
|
|
659
|
+
props: {
|
|
660
|
+
page: {},
|
|
661
|
+
pageSize: {},
|
|
662
|
+
total: {},
|
|
663
|
+
pagination: { type: [Boolean, Object], default: void 0 }
|
|
664
|
+
},
|
|
665
|
+
emits: ["change", "pageSizeChange"],
|
|
666
|
+
setup(e, { emit: a }) {
|
|
667
|
+
const t = e, n = a, { prefix: o } = me(), f = d(
|
|
668
|
+
() => {
|
|
669
|
+
var r;
|
|
670
|
+
return t.pagination !== !1 ? ((r = t.pagination) == null ? void 0 : r.pageSizeOptions) ?? [10, 20, 50, 100] : [];
|
|
671
|
+
}
|
|
672
|
+
), p = d(() => {
|
|
673
|
+
var h, m;
|
|
674
|
+
if (t.pagination === !1) return "";
|
|
675
|
+
const r = [];
|
|
676
|
+
return ((h = t.pagination) == null ? void 0 : h.showTotal) !== !1 && r.push("total"), r.push("sizes", "prev", "pager", "next"), ((m = t.pagination) == null ? void 0 : m.showQuickJumper) !== !1 && r.push("jumper"), r.join(", ");
|
|
677
|
+
});
|
|
678
|
+
function u(r) {
|
|
679
|
+
n("change", r);
|
|
680
|
+
}
|
|
681
|
+
function v(r) {
|
|
682
|
+
n("pageSizeChange", r);
|
|
683
|
+
}
|
|
684
|
+
return (r, h) => e.pagination !== !1 ? (i(), C("div", {
|
|
685
|
+
key: 0,
|
|
686
|
+
class: k(`${l(o)}-pro-table__pagination`)
|
|
687
|
+
}, [
|
|
688
|
+
L(l(vl), {
|
|
689
|
+
"current-page": e.page,
|
|
690
|
+
"page-size": e.pageSize,
|
|
691
|
+
total: e.total,
|
|
692
|
+
"page-sizes": f.value,
|
|
693
|
+
layout: p.value,
|
|
694
|
+
background: "",
|
|
695
|
+
onCurrentChange: u,
|
|
696
|
+
onSizeChange: v
|
|
697
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout"])
|
|
698
|
+
], 2)) : I("", !0);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
function fn(e) {
|
|
702
|
+
return typeof e == "object" && e !== null;
|
|
703
|
+
}
|
|
704
|
+
function He(e, a) {
|
|
705
|
+
const t = Array.isArray(a) ? a : [a];
|
|
706
|
+
let n = e;
|
|
707
|
+
for (const o of t) {
|
|
708
|
+
if (!fn(n)) return;
|
|
709
|
+
n = n[o];
|
|
710
|
+
}
|
|
711
|
+
return n;
|
|
712
|
+
}
|
|
713
|
+
function et(e) {
|
|
714
|
+
return Array.isArray(e) ? e.join(".") : e;
|
|
715
|
+
}
|
|
716
|
+
function tt(e) {
|
|
717
|
+
return e ? Array.isArray(e) ? e : Object.entries(e).map(([a, t]) => {
|
|
718
|
+
const n = Number.isNaN(Number(a)) ? a : Number(a);
|
|
719
|
+
return typeof t == "object" && t !== null ? { value: n, ...t } : { value: n, text: String(t) };
|
|
720
|
+
}) : [];
|
|
721
|
+
}
|
|
722
|
+
function ya(e) {
|
|
723
|
+
return tt(e).map((a) => {
|
|
724
|
+
var t;
|
|
725
|
+
return {
|
|
726
|
+
label: a.text,
|
|
727
|
+
value: a.value,
|
|
728
|
+
disabled: a.disabled,
|
|
729
|
+
children: (t = a.children) != null && t.length ? ya(a.children) : void 0
|
|
730
|
+
};
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function ga(e, a) {
|
|
734
|
+
var t;
|
|
735
|
+
for (const n of e) {
|
|
736
|
+
if (n.value === a) return [n];
|
|
737
|
+
if ((t = n.children) != null && t.length) {
|
|
738
|
+
const o = ga(n.children, a);
|
|
739
|
+
if (o) return [n, ...o];
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return null;
|
|
743
|
+
}
|
|
744
|
+
function jt(e, a) {
|
|
745
|
+
const t = ga(e, a);
|
|
746
|
+
return t ? t.map((n) => n.text).join(" / ") : null;
|
|
747
|
+
}
|
|
748
|
+
function yt(e, a = "-", t) {
|
|
749
|
+
if (e == null || e === "")
|
|
750
|
+
return a === !1 ? "" : a;
|
|
751
|
+
const n = tt(t);
|
|
752
|
+
if (Array.isArray(e)) {
|
|
753
|
+
const o = e.map((f) => typeof f == "string" || typeof f == "number" ? jt(n, f) ?? String(f) : null).filter((f) => f !== null);
|
|
754
|
+
return o.length > 0 ? o.join(" ~ ") : JSON.stringify(e);
|
|
755
|
+
}
|
|
756
|
+
if (typeof e == "boolean") {
|
|
757
|
+
const o = n.find((f) => String(f.value) === String(e));
|
|
758
|
+
return o ? o.text : e ? "是" : "否";
|
|
759
|
+
}
|
|
760
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
761
|
+
const o = jt(n, e);
|
|
762
|
+
if (o) return o;
|
|
763
|
+
}
|
|
764
|
+
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
765
|
+
}
|
|
766
|
+
function ka(e, a, t) {
|
|
767
|
+
const n = typeof t == "function" ? t(e, a) : t ? He(e, t) : He(e, "id");
|
|
768
|
+
return typeof n == "string" || typeof n == "number" ? n : a;
|
|
769
|
+
}
|
|
770
|
+
const vn = /* @__PURE__ */ ae({
|
|
771
|
+
name: "TagSelector",
|
|
772
|
+
__name: "index",
|
|
773
|
+
props: {
|
|
774
|
+
modelValue: {},
|
|
775
|
+
options: {},
|
|
776
|
+
multiple: { type: Boolean, default: !1 },
|
|
777
|
+
showAll: { type: Boolean, default: !0 },
|
|
778
|
+
allText: { default: "全部" }
|
|
779
|
+
},
|
|
780
|
+
emits: ["update:modelValue"],
|
|
781
|
+
setup(e, { emit: a }) {
|
|
782
|
+
const t = e, n = a, { prefix: o } = me(), f = d(() => Array.isArray(t.modelValue) ? t.modelValue : []), p = d(
|
|
783
|
+
() => Array.isArray(t.modelValue) ? t.modelValue.length === 0 : t.modelValue === void 0 || t.modelValue === null || t.modelValue === ""
|
|
784
|
+
);
|
|
785
|
+
function u(h) {
|
|
786
|
+
return t.multiple ? f.value.includes(h) : t.modelValue === h;
|
|
787
|
+
}
|
|
788
|
+
function v(h) {
|
|
789
|
+
if (!t.multiple) {
|
|
790
|
+
n("update:modelValue", t.modelValue === h ? void 0 : h);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
n(
|
|
794
|
+
"update:modelValue",
|
|
795
|
+
f.value.includes(h) ? f.value.filter((m) => m !== h) : [...f.value, h]
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
function r() {
|
|
799
|
+
n("update:modelValue", t.multiple ? [] : void 0);
|
|
800
|
+
}
|
|
801
|
+
return (h, m) => (i(), C("div", {
|
|
802
|
+
class: k(`${l(o)}-tag-selector`)
|
|
803
|
+
}, [
|
|
804
|
+
e.showAll ? (i(), x(l(de), {
|
|
805
|
+
key: 0,
|
|
806
|
+
type: "info",
|
|
807
|
+
class: k([`${l(o)}-tag-selector-item`, p.value && "is-selected"]),
|
|
808
|
+
"aria-pressed": p.value,
|
|
809
|
+
round: "",
|
|
810
|
+
onClick: r
|
|
811
|
+
}, {
|
|
812
|
+
default: $(() => [
|
|
813
|
+
te(H(e.allText), 1)
|
|
814
|
+
]),
|
|
815
|
+
_: 1
|
|
816
|
+
}, 8, ["class", "aria-pressed"])) : I("", !0),
|
|
817
|
+
(i(!0), C(X, null, pe(e.options, (w) => (i(), x(l(de), {
|
|
818
|
+
key: String(w.value),
|
|
819
|
+
type: "info",
|
|
820
|
+
class: k([`${l(o)}-tag-selector-item`, u(w.value) && "is-selected"]),
|
|
821
|
+
"aria-pressed": u(w.value),
|
|
822
|
+
disabled: w.disabled,
|
|
823
|
+
round: "",
|
|
824
|
+
onClick: (M) => v(w.value)
|
|
825
|
+
}, {
|
|
826
|
+
default: $(() => [
|
|
827
|
+
te(H(w.text), 1)
|
|
828
|
+
]),
|
|
829
|
+
_: 2
|
|
830
|
+
}, 1032, ["class", "aria-pressed", "disabled", "onClick"]))), 128))
|
|
831
|
+
], 2));
|
|
832
|
+
}
|
|
833
|
+
}), wa = be(vn), Sa = /* @__PURE__ */ ae({
|
|
834
|
+
name: "ProTableSearchForm",
|
|
835
|
+
__name: "ProTableSearchForm",
|
|
836
|
+
props: {
|
|
837
|
+
columns: {},
|
|
838
|
+
modelValue: {},
|
|
839
|
+
search: { type: [Boolean, Object] },
|
|
840
|
+
form: {},
|
|
841
|
+
loading: { type: Boolean },
|
|
842
|
+
collapsed: { type: Boolean },
|
|
843
|
+
collapseActionInModeBar: { type: Boolean }
|
|
844
|
+
},
|
|
845
|
+
emits: ["submit", "reset", "fieldChange", "update:collapsed"],
|
|
846
|
+
setup(e, { expose: a, emit: t }) {
|
|
847
|
+
const n = e, o = t, { prefix: f } = me(), p = Zt(), u = Mt({}), v = Mt({});
|
|
848
|
+
let r = !0;
|
|
849
|
+
const h = q(!1), m = d({
|
|
850
|
+
get: () => n.collapsed ?? h.value,
|
|
851
|
+
set: (b) => {
|
|
852
|
+
h.value = b, o("update:collapsed", b);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
he(
|
|
856
|
+
() => n.modelValue,
|
|
857
|
+
(b) => {
|
|
858
|
+
b && (Object.keys(u).forEach((g) => delete u[g]), Object.entries(b).forEach(([g, c]) => {
|
|
859
|
+
u[g] = c;
|
|
860
|
+
}));
|
|
861
|
+
},
|
|
862
|
+
{ deep: !0 }
|
|
863
|
+
);
|
|
864
|
+
const w = d(
|
|
865
|
+
() => n.columns.filter((b) => !b.hideInForm && b.search !== !1)
|
|
866
|
+
), M = d(() => {
|
|
867
|
+
var b, g, c, ee, ve, ye;
|
|
868
|
+
return {
|
|
869
|
+
searchText: n.search !== !1 ? ((b = n.search) == null ? void 0 : b.searchText) ?? ((g = n.form) == null ? void 0 : g.searchText) ?? "查询" : "查询",
|
|
870
|
+
resetText: n.search !== !1 ? ((c = n.search) == null ? void 0 : c.resetText) ?? ((ee = n.form) == null ? void 0 : ee.resetText) ?? "重置" : "重置",
|
|
871
|
+
labelWidth: n.search !== !1 ? ((ve = n.search) == null ? void 0 : ve.labelWidth) ?? ((ye = n.form) == null ? void 0 : ye.labelWidth) ?? void 0 : void 0
|
|
872
|
+
};
|
|
873
|
+
}), P = d(
|
|
874
|
+
() => w.value.length > 0 && (M.value.searchText !== "" || M.value.resetText !== "" || !!(p.searchActionLeft || p.searchActionRight) || w.value.length > 3)
|
|
875
|
+
);
|
|
876
|
+
function _(b) {
|
|
877
|
+
return b == null || b === "" ? !1 : !Array.isArray(b) || b.length > 0;
|
|
878
|
+
}
|
|
879
|
+
function S(b) {
|
|
880
|
+
return et(b.dataIndex);
|
|
881
|
+
}
|
|
882
|
+
const A = d(
|
|
883
|
+
() => w.value.some((b) => _(u[S(b)]))
|
|
884
|
+
), T = d(() => !m.value || A.value);
|
|
885
|
+
function U() {
|
|
886
|
+
m.value = !m.value;
|
|
887
|
+
}
|
|
888
|
+
function B(b, g) {
|
|
889
|
+
const { col: c, labelWidth: ee, requestNow: ve, ...ye } = b.fieldProps ?? {};
|
|
890
|
+
return { ...ye, ...g };
|
|
891
|
+
}
|
|
892
|
+
function J(b) {
|
|
893
|
+
var g;
|
|
894
|
+
return { ...(g = b.fieldProps) == null ? void 0 : g.col, ...b.colProps };
|
|
895
|
+
}
|
|
896
|
+
function O(b) {
|
|
897
|
+
var ee, ve, ye, $e, ke, ne, Ye;
|
|
898
|
+
const g = ((ee = b.inputProps) == null ? void 0 : ee.placeholder) ?? ((ve = b.inputNumberProps) == null ? void 0 : ve.placeholder) ?? ((ye = b.selectProps) == null ? void 0 : ye.placeholder) ?? (($e = b.treeSelectProps) == null ? void 0 : $e.placeholder) ?? ((ke = b.cascaderProps) == null ? void 0 : ke.placeholder) ?? ((ne = b.datePickerProps) == null ? void 0 : ne.placeholder) ?? ((Ye = b.fieldProps) == null ? void 0 : Ye.placeholder);
|
|
899
|
+
if (typeof g == "string") return g;
|
|
900
|
+
const c = b.valueType ?? "text";
|
|
901
|
+
return c === "select" || c === "treeSelect" || c === "cascader" ? "全部" : c === "date" || c === "dateRange" ? "请选择日期" : c === "time" ? "请选择日期时间" : `请输入${b.title}`;
|
|
902
|
+
}
|
|
903
|
+
function Z(b) {
|
|
904
|
+
var c, ee, ve, ye, $e, ke;
|
|
905
|
+
const g = ((c = b.inputProps) == null ? void 0 : c.clearable) ?? ((ee = b.selectProps) == null ? void 0 : ee.clearable) ?? ((ve = b.treeSelectProps) == null ? void 0 : ve.clearable) ?? ((ye = b.cascaderProps) == null ? void 0 : ye.clearable) ?? (($e = b.datePickerProps) == null ? void 0 : $e.clearable) ?? ((ke = b.fieldProps) == null ? void 0 : ke.clearable);
|
|
906
|
+
return typeof g == "boolean" ? g : !0;
|
|
907
|
+
}
|
|
908
|
+
function le(b) {
|
|
909
|
+
const g = u[S(b)];
|
|
910
|
+
return typeof g == "string" ? g : "";
|
|
911
|
+
}
|
|
912
|
+
function N(b) {
|
|
913
|
+
const g = u[S(b)];
|
|
914
|
+
return typeof g == "number" ? g : void 0;
|
|
915
|
+
}
|
|
916
|
+
function V(b) {
|
|
917
|
+
return u[S(b)] === !0;
|
|
918
|
+
}
|
|
919
|
+
function G(b) {
|
|
920
|
+
return ya(b.valueEnum);
|
|
921
|
+
}
|
|
922
|
+
function W(b) {
|
|
923
|
+
var c;
|
|
924
|
+
const g = (c = b.treeSelectProps) == null ? void 0 : c.data;
|
|
925
|
+
return Array.isArray(g) ? g : G(b);
|
|
926
|
+
}
|
|
927
|
+
function re(b) {
|
|
928
|
+
var c;
|
|
929
|
+
const g = (c = b.cascaderProps) == null ? void 0 : c.options;
|
|
930
|
+
return Array.isArray(g) ? g : G(b);
|
|
931
|
+
}
|
|
932
|
+
function j() {
|
|
933
|
+
return { ...u };
|
|
934
|
+
}
|
|
935
|
+
function K(b) {
|
|
936
|
+
(ia(b) ? Object.keys(u) : b).forEach((c) => delete u[c]), Object.keys(v).forEach((c) => delete v[c]);
|
|
937
|
+
}
|
|
938
|
+
function ie() {
|
|
939
|
+
r = !0, K(), o("reset");
|
|
940
|
+
}
|
|
941
|
+
function Y(b) {
|
|
942
|
+
return b.valueType ?? "text";
|
|
943
|
+
}
|
|
944
|
+
function we(b) {
|
|
945
|
+
const g = u[S(b)];
|
|
946
|
+
return typeof g == "string" || typeof g == "number" ? g : void 0;
|
|
947
|
+
}
|
|
948
|
+
function Se(b) {
|
|
949
|
+
const g = u[S(b)];
|
|
950
|
+
return Array.isArray(g) ? g.filter((c) => typeof c == "string" || typeof c == "number") : void 0;
|
|
951
|
+
}
|
|
952
|
+
function qe(b) {
|
|
953
|
+
const g = u[S(b)];
|
|
954
|
+
if (typeof g == "string") return g;
|
|
955
|
+
if (Array.isArray(g) && g.length === 2 && typeof g[0] == "string" && typeof g[1] == "string")
|
|
956
|
+
return [g[0], g[1]];
|
|
957
|
+
}
|
|
958
|
+
function Ve(b) {
|
|
959
|
+
const g = Y(b);
|
|
960
|
+
return g === "date" || g === "dateRange" || g === "time" || g === "timeRange";
|
|
961
|
+
}
|
|
962
|
+
function Le(b) {
|
|
963
|
+
const g = Y(b);
|
|
964
|
+
if (g === "date" || g === "dateRange" || g === "time" || g === "timeRange") return g;
|
|
965
|
+
}
|
|
966
|
+
function Ne(b) {
|
|
967
|
+
return Le(b) ?? "date";
|
|
968
|
+
}
|
|
969
|
+
function Pe(b) {
|
|
970
|
+
return !Ve(b) || !b.dateQuickSelect ? !1 : typeof b.dateQuickSelect == "object" ? b.dateQuickSelect : {};
|
|
971
|
+
}
|
|
972
|
+
function y(b) {
|
|
973
|
+
var c;
|
|
974
|
+
const g = (c = b.datePickerProps) == null ? void 0 : c.valueFormat;
|
|
975
|
+
return typeof g == "string" ? g : Y(b) === "time" || Y(b) === "timeRange" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
976
|
+
}
|
|
977
|
+
function D(b) {
|
|
978
|
+
const g = Pe(b), c = Le(b);
|
|
979
|
+
return c ? ha({ valueType: c, config: g, valueFormat: y(b) }) : [];
|
|
980
|
+
}
|
|
981
|
+
function Q() {
|
|
982
|
+
return { quickDateSelections: { ...v } };
|
|
983
|
+
}
|
|
984
|
+
function oe() {
|
|
985
|
+
o("submit", { ...u }, Q());
|
|
986
|
+
}
|
|
987
|
+
function se(b, g) {
|
|
988
|
+
var ee;
|
|
989
|
+
const c = S(b);
|
|
990
|
+
u[c] = g, o("fieldChange", c, g, Q()), ((ee = b.fieldProps) == null ? void 0 : ee.requestNow) === !0 && oe();
|
|
991
|
+
}
|
|
992
|
+
function xe(b) {
|
|
993
|
+
var c;
|
|
994
|
+
const g = ((c = b.renderFormItem) == null ? void 0 : c.call(b, u[S(b)], b, (ee) => se(b, ee))) ?? null;
|
|
995
|
+
return Ze(g) ? g : ze("span", null, String(g ?? ""));
|
|
996
|
+
}
|
|
997
|
+
function Ae(b, g) {
|
|
998
|
+
return D(b).find((c) => bt(g, c.value));
|
|
999
|
+
}
|
|
1000
|
+
function We(b) {
|
|
1001
|
+
Object.entries(b).forEach(([g, c]) => {
|
|
1002
|
+
u[g] = c;
|
|
1003
|
+
const ee = w.value.find((ye) => S(ye) === g), ve = ee ? Ae(ee, c) : void 0;
|
|
1004
|
+
ve !== void 0 ? v[g] = ve : delete v[g];
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
function rt(b, g) {
|
|
1008
|
+
v[S(b)] = g, se(b, g.value);
|
|
1009
|
+
}
|
|
1010
|
+
function it(b, g) {
|
|
1011
|
+
delete v[S(b)], se(b, g);
|
|
1012
|
+
}
|
|
1013
|
+
function ge(b) {
|
|
1014
|
+
var c, ee, ve;
|
|
1015
|
+
const g = ((c = b.colProps) == null ? void 0 : c.span) ?? ((ve = (ee = b.fieldProps) == null ? void 0 : ee.col) == null ? void 0 : ve.span);
|
|
1016
|
+
return typeof g == "number" ? g : Y(b) === "tag" || Pe(b) !== !1 ? 24 : 8;
|
|
1017
|
+
}
|
|
1018
|
+
const Ke = d(() => m.value ? [] : w.value);
|
|
1019
|
+
return he(
|
|
1020
|
+
() => n.modelValue,
|
|
1021
|
+
(b) => {
|
|
1022
|
+
Object.keys(u).forEach((g) => delete u[g]), Object.assign(u, b), r ? (w.value.forEach((g) => {
|
|
1023
|
+
const c = S(g), ee = Ae(g, b[c]);
|
|
1024
|
+
ee !== void 0 ? v[c] = ee : delete v[c];
|
|
1025
|
+
}), r = !1) : Object.entries(v).forEach(([g, c]) => {
|
|
1026
|
+
bt(b[g], c.value) || delete v[g];
|
|
1027
|
+
});
|
|
1028
|
+
},
|
|
1029
|
+
{ deep: !0, immediate: !0 }
|
|
1030
|
+
), a({
|
|
1031
|
+
getFieldsValue: j,
|
|
1032
|
+
getRequestContext: Q,
|
|
1033
|
+
setFieldsValue: We,
|
|
1034
|
+
resetFields: K
|
|
1035
|
+
}), (b, g) => e.search !== !1 ? (i(), x(l($t), {
|
|
1036
|
+
key: 0,
|
|
1037
|
+
class: k([`${l(f)}-pro-table__search`, m.value && `${l(f)}-pro-table__search--collapsed`]),
|
|
1038
|
+
"label-width": M.value.labelWidth,
|
|
1039
|
+
onSubmit: Be(oe, ["prevent"])
|
|
1040
|
+
}, {
|
|
1041
|
+
default: $(() => [
|
|
1042
|
+
L(l(pl), {
|
|
1043
|
+
gutter: 0,
|
|
1044
|
+
class: k([
|
|
1045
|
+
m.value && `${l(f)}-pro-table__search-row--collapsed`,
|
|
1046
|
+
m.value && !A.value && `${l(f)}-pro-table__search-row--collapsed-empty`
|
|
1047
|
+
])
|
|
1048
|
+
}, {
|
|
1049
|
+
default: $(() => [
|
|
1050
|
+
(i(!0), C(X, null, pe(Ke.value, (c) => (i(), x(l(hl), fe({
|
|
1051
|
+
key: S(c)
|
|
1052
|
+
}, { ref_for: !0 }, J(c), {
|
|
1053
|
+
span: ge(c),
|
|
1054
|
+
class: `${l(f)}-pro-table__search-col`
|
|
1055
|
+
}), {
|
|
1056
|
+
default: $(() => {
|
|
1057
|
+
var ee, ve;
|
|
1058
|
+
return [
|
|
1059
|
+
L(l(Ot), fe({ ref_for: !0 }, c.formItemProps, {
|
|
1060
|
+
label: c.title,
|
|
1061
|
+
"label-width": ((ee = c.formItemProps) == null ? void 0 : ee.labelWidth) ?? ((ve = c == null ? void 0 : c.fieldProps) == null ? void 0 : ve.labelWidth) ?? "72px"
|
|
1062
|
+
}), {
|
|
1063
|
+
default: $(() => {
|
|
1064
|
+
var ye, $e, ke;
|
|
1065
|
+
return [
|
|
1066
|
+
Y(c) === "treeSelect" ? (i(), x(l(ml), fe({
|
|
1067
|
+
key: 0,
|
|
1068
|
+
ref_for: !0
|
|
1069
|
+
}, B(c, c.treeSelectProps), {
|
|
1070
|
+
"model-value": le(c) || void 0,
|
|
1071
|
+
data: W(c),
|
|
1072
|
+
placeholder: O(c),
|
|
1073
|
+
clearable: Z(c),
|
|
1074
|
+
"check-strictly": "",
|
|
1075
|
+
"node-key": "value",
|
|
1076
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1077
|
+
}), null, 16, ["model-value", "data", "placeholder", "clearable", "onUpdate:modelValue"])) : Y(c) === "cascader" ? (i(), x(l(bl), fe({
|
|
1078
|
+
key: 1,
|
|
1079
|
+
ref_for: !0
|
|
1080
|
+
}, B(c, c.cascaderProps), {
|
|
1081
|
+
"model-value": Se(c),
|
|
1082
|
+
options: re(c),
|
|
1083
|
+
placeholder: O(c),
|
|
1084
|
+
clearable: Z(c),
|
|
1085
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1086
|
+
}), null, 16, ["model-value", "options", "placeholder", "clearable", "onUpdate:modelValue"])) : Y(c) === "select" ? (i(), x(l(yl), fe({
|
|
1087
|
+
key: 2,
|
|
1088
|
+
ref_for: !0
|
|
1089
|
+
}, B(c, c.selectProps), {
|
|
1090
|
+
"model-value": le(c) === "" ? void 0 : we(c),
|
|
1091
|
+
placeholder: O(c),
|
|
1092
|
+
clearable: Z(c),
|
|
1093
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1094
|
+
}), {
|
|
1095
|
+
default: $(() => [
|
|
1096
|
+
(i(!0), C(X, null, pe(l(tt)(c.valueEnum), (ne) => (i(), x(l(gl), {
|
|
1097
|
+
key: String(ne.value),
|
|
1098
|
+
label: ne.text,
|
|
1099
|
+
value: ne.value,
|
|
1100
|
+
disabled: ne.disabled
|
|
1101
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1102
|
+
]),
|
|
1103
|
+
_: 2
|
|
1104
|
+
}, 1040, ["model-value", "placeholder", "clearable", "onUpdate:modelValue"])) : Y(c) === "tag" ? (i(), x(l(wa), {
|
|
1105
|
+
key: 3,
|
|
1106
|
+
"model-value": Se(c) ?? we(c),
|
|
1107
|
+
options: l(tt)(c.valueEnum),
|
|
1108
|
+
multiple: (ye = c.tagProps) == null ? void 0 : ye.multiple,
|
|
1109
|
+
"show-all": ($e = c.tagProps) == null ? void 0 : $e.showAll,
|
|
1110
|
+
"all-text": (ke = c.tagProps) == null ? void 0 : ke.allText,
|
|
1111
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1112
|
+
}, null, 8, ["model-value", "options", "multiple", "show-all", "all-text", "onUpdate:modelValue"])) : Ve(c) ? (i(), x(l(ma), {
|
|
1113
|
+
key: 4,
|
|
1114
|
+
"model-value": qe(c),
|
|
1115
|
+
"value-type": Ne(c),
|
|
1116
|
+
"quick-select": Pe(c),
|
|
1117
|
+
"quick-selection": v[S(c)],
|
|
1118
|
+
"date-picker-props": B(c, c.datePickerProps),
|
|
1119
|
+
placeholder: O(c),
|
|
1120
|
+
clearable: Z(c),
|
|
1121
|
+
"onUpdate:modelValue": (ne) => it(c, ne),
|
|
1122
|
+
onQuickSelect: (ne) => rt(c, ne)
|
|
1123
|
+
}, null, 8, ["model-value", "value-type", "quick-select", "quick-selection", "date-picker-props", "placeholder", "clearable", "onUpdate:modelValue", "onQuickSelect"])) : Y(c) === "digit" ? (i(), x(l(kl), fe({
|
|
1124
|
+
key: 5,
|
|
1125
|
+
ref_for: !0
|
|
1126
|
+
}, B(c, c.inputNumberProps), {
|
|
1127
|
+
"model-value": N(c),
|
|
1128
|
+
placeholder: O(c),
|
|
1129
|
+
controls: !1,
|
|
1130
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1131
|
+
}), null, 16, ["model-value", "placeholder", "onUpdate:modelValue"])) : Y(c) === "switch" ? (i(), x(l(wl), fe({
|
|
1132
|
+
key: 6,
|
|
1133
|
+
ref_for: !0
|
|
1134
|
+
}, B(c, c.switchProps), {
|
|
1135
|
+
"model-value": V(c),
|
|
1136
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1137
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : Y(c) === "customer" ? (i(), x(Oe(xe(c)), { key: 7 })) : Y(c) === "textarea" ? (i(), x(l(Dt), fe({
|
|
1138
|
+
key: 8,
|
|
1139
|
+
ref_for: !0
|
|
1140
|
+
}, B(c, c.inputProps), {
|
|
1141
|
+
"model-value": le(c),
|
|
1142
|
+
type: "textarea",
|
|
1143
|
+
rows: 1,
|
|
1144
|
+
placeholder: O(c),
|
|
1145
|
+
clearable: Z(c),
|
|
1146
|
+
autosize: "",
|
|
1147
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1148
|
+
}), null, 16, ["model-value", "placeholder", "clearable", "onUpdate:modelValue"])) : (i(), x(l(Dt), fe({
|
|
1149
|
+
key: 9,
|
|
1150
|
+
ref_for: !0
|
|
1151
|
+
}, B(c, c.inputProps), {
|
|
1152
|
+
"model-value": le(c),
|
|
1153
|
+
type: Y(c) === "password" ? "password" : "text",
|
|
1154
|
+
placeholder: O(c),
|
|
1155
|
+
clearable: Z(c),
|
|
1156
|
+
"show-password": Y(c) === "password",
|
|
1157
|
+
"onUpdate:modelValue": (ne) => se(c, ne)
|
|
1158
|
+
}), null, 16, ["model-value", "type", "placeholder", "clearable", "show-password", "onUpdate:modelValue"]))
|
|
1159
|
+
];
|
|
1160
|
+
}),
|
|
1161
|
+
_: 2
|
|
1162
|
+
}, 1040, ["label", "label-width"])
|
|
1163
|
+
];
|
|
1164
|
+
}),
|
|
1165
|
+
_: 2
|
|
1166
|
+
}, 1040, ["span", "class"]))), 128)),
|
|
1167
|
+
m.value && l(p).selectedFilters ? (i(), C("div", {
|
|
1168
|
+
key: 0,
|
|
1169
|
+
class: k(`${l(f)}-pro-table__search-selected-filters`)
|
|
1170
|
+
}, [
|
|
1171
|
+
z(b.$slots, "selectedFilters")
|
|
1172
|
+
], 2)) : I("", !0),
|
|
1173
|
+
P.value ? (i(), x(l(Ot), {
|
|
1174
|
+
key: 1,
|
|
1175
|
+
class: k(`${l(f)}-pro-table__search-actions`)
|
|
1176
|
+
}, {
|
|
1177
|
+
default: $(() => [
|
|
1178
|
+
l(p).searchActionLeft ? z(b.$slots, "searchActionLeft", { key: 0 }) : I("", !0),
|
|
1179
|
+
T.value && M.value.searchText !== "" ? (i(), x(l(de), {
|
|
1180
|
+
key: 1,
|
|
1181
|
+
type: "primary",
|
|
1182
|
+
icon: l(Ll),
|
|
1183
|
+
loading: e.loading,
|
|
1184
|
+
onClick: oe
|
|
1185
|
+
}, {
|
|
1186
|
+
default: $(() => [
|
|
1187
|
+
te(H(M.value.searchText), 1)
|
|
1188
|
+
]),
|
|
1189
|
+
_: 1
|
|
1190
|
+
}, 8, ["icon", "loading"])) : I("", !0),
|
|
1191
|
+
T.value && M.value.resetText !== "" ? (i(), x(l(de), {
|
|
1192
|
+
key: 2,
|
|
1193
|
+
icon: l(sa),
|
|
1194
|
+
loading: e.loading,
|
|
1195
|
+
onClick: ie
|
|
1196
|
+
}, {
|
|
1197
|
+
default: $(() => [
|
|
1198
|
+
te(H(M.value.resetText), 1)
|
|
1199
|
+
]),
|
|
1200
|
+
_: 1
|
|
1201
|
+
}, 8, ["icon", "loading"])) : I("", !0),
|
|
1202
|
+
l(p).searchActionRight ? z(b.$slots, "searchActionRight", { key: 3 }) : I("", !0),
|
|
1203
|
+
w.value.length > 3 && !(e.collapseActionInModeBar && m.value && !A.value) ? (i(), x(l(de), {
|
|
1204
|
+
key: 4,
|
|
1205
|
+
type: "primary",
|
|
1206
|
+
icon: m.value ? l(Je) : l(zl),
|
|
1207
|
+
plain: "",
|
|
1208
|
+
circle: "",
|
|
1209
|
+
"aria-label": m.value ? "展开" : "收起",
|
|
1210
|
+
title: m.value ? "展开" : "收起",
|
|
1211
|
+
onClick: U
|
|
1212
|
+
}, null, 8, ["icon", "aria-label", "title"])) : I("", !0)
|
|
1213
|
+
]),
|
|
1214
|
+
_: 3
|
|
1215
|
+
}, 8, ["class"])) : I("", !0)
|
|
1216
|
+
]),
|
|
1217
|
+
_: 3
|
|
1218
|
+
}, 8, ["class"])
|
|
1219
|
+
]),
|
|
1220
|
+
_: 3
|
|
1221
|
+
}, 8, ["class", "label-width"])) : I("", !0);
|
|
1222
|
+
}
|
|
1223
|
+
}), pn = /* @__PURE__ */ ae({
|
|
1224
|
+
name: "ProTableSelectedFilters",
|
|
1225
|
+
__name: "ProTableSelectedFilters",
|
|
1226
|
+
props: {
|
|
1227
|
+
columns: {},
|
|
1228
|
+
searchValues: {},
|
|
1229
|
+
quickDateSelections: {},
|
|
1230
|
+
title: {}
|
|
1231
|
+
},
|
|
1232
|
+
emits: ["clear", "clearAll"],
|
|
1233
|
+
setup(e, { emit: a }) {
|
|
1234
|
+
const t = e, n = a, { prefix: o } = me();
|
|
1235
|
+
function f(v, r) {
|
|
1236
|
+
return typeof r == "string" ? v === r : Array.isArray(v) && v.length === r.length && v.every((h, m) => h === r[m]);
|
|
1237
|
+
}
|
|
1238
|
+
function p(v, r, h) {
|
|
1239
|
+
var w;
|
|
1240
|
+
const m = (w = t.quickDateSelections) == null ? void 0 : w[h];
|
|
1241
|
+
return m && f(v, m.value) ? m.label : yt(v, !1, r.valueEnum);
|
|
1242
|
+
}
|
|
1243
|
+
const u = d(() => {
|
|
1244
|
+
const v = [];
|
|
1245
|
+
return t.columns.forEach((r) => {
|
|
1246
|
+
if (r.hideInForm || r.search === !1) return;
|
|
1247
|
+
const h = et(r.dataIndex), m = t.searchValues[h];
|
|
1248
|
+
m == null || m === "" || Array.isArray(m) && m.length === 0 || v.push({
|
|
1249
|
+
key: h,
|
|
1250
|
+
title: r.title,
|
|
1251
|
+
displayValue: p(m, r, h)
|
|
1252
|
+
});
|
|
1253
|
+
}), v;
|
|
1254
|
+
});
|
|
1255
|
+
return (v, r) => u.value.length ? (i(), C("div", {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
class: k(`${l(o)}-pro-table__selected-filters`)
|
|
1258
|
+
}, [
|
|
1259
|
+
F("span", {
|
|
1260
|
+
class: k(`${l(o)}-pro-table__selected-filters-title`)
|
|
1261
|
+
}, H(e.title ?? "已筛选"), 3),
|
|
1262
|
+
F("div", {
|
|
1263
|
+
class: k(`${l(o)}-pro-table__selected-filters-content`)
|
|
1264
|
+
}, [
|
|
1265
|
+
(i(!0), C(X, null, pe(u.value, (h) => (i(), x(l(Sl), {
|
|
1266
|
+
key: h.key,
|
|
1267
|
+
type: "primary",
|
|
1268
|
+
effect: "light",
|
|
1269
|
+
class: k(`${l(o)}-pro-table__selected-filters-tag`),
|
|
1270
|
+
closable: "",
|
|
1271
|
+
onClose: (m) => n("clear", h.key)
|
|
1272
|
+
}, {
|
|
1273
|
+
default: $(() => [
|
|
1274
|
+
te(H(h.title) + ":" + H(h.displayValue), 1)
|
|
1275
|
+
]),
|
|
1276
|
+
_: 2
|
|
1277
|
+
}, 1032, ["class", "onClose"]))), 128))
|
|
1278
|
+
], 2)
|
|
1279
|
+
], 2)) : I("", !0);
|
|
1280
|
+
}
|
|
1281
|
+
}), Ct = (e, a) => {
|
|
1282
|
+
const t = e.__vccOpts || e;
|
|
1283
|
+
for (const [n, o] of a)
|
|
1284
|
+
t[n] = o;
|
|
1285
|
+
return t;
|
|
1286
|
+
}, $a = /* @__PURE__ */ Ct(pn, [["__scopeId", "data-v-428a6a9c"]]), hn = /* @__PURE__ */ ae({
|
|
1287
|
+
name: "ProTableSelectionActions",
|
|
1288
|
+
__name: "ProTableSelectionActions",
|
|
1289
|
+
props: {
|
|
1290
|
+
selectedRowKeys: {},
|
|
1291
|
+
selectedRows: {}
|
|
1292
|
+
},
|
|
1293
|
+
emits: ["clear"],
|
|
1294
|
+
setup(e, { emit: a }) {
|
|
1295
|
+
const t = e, n = a, { prefix: o } = me();
|
|
1296
|
+
return (f, p) => (i(), C("div", {
|
|
1297
|
+
class: k(`${l(o)}-pro-table__selection-actions`),
|
|
1298
|
+
role: "status"
|
|
1299
|
+
}, [
|
|
1300
|
+
F("span", {
|
|
1301
|
+
class: k(`${l(o)}-pro-table__selection-count`)
|
|
1302
|
+
}, "已选 " + H(t.selectedRowKeys.length) + " 项", 3),
|
|
1303
|
+
F("div", {
|
|
1304
|
+
class: k(`${l(o)}-pro-table__selection-action-list`)
|
|
1305
|
+
}, [
|
|
1306
|
+
z(f.$slots, "default", {
|
|
1307
|
+
selectedRowKeys: t.selectedRowKeys,
|
|
1308
|
+
selectedRows: t.selectedRows,
|
|
1309
|
+
clearSelected: () => n("clear")
|
|
1310
|
+
}, void 0, !0)
|
|
1311
|
+
], 2),
|
|
1312
|
+
L(l(de), {
|
|
1313
|
+
link: "",
|
|
1314
|
+
type: "primary",
|
|
1315
|
+
class: k(`${l(o)}-pro-table__selection-clear`),
|
|
1316
|
+
onClick: p[0] || (p[0] = (u) => n("clear"))
|
|
1317
|
+
}, {
|
|
1318
|
+
default: $(() => [...p[1] || (p[1] = [
|
|
1319
|
+
te(" 取消选择 ", -1)
|
|
1320
|
+
])]),
|
|
1321
|
+
_: 1
|
|
1322
|
+
}, 8, ["class"])
|
|
1323
|
+
], 2));
|
|
1324
|
+
}
|
|
1325
|
+
}), Ca = /* @__PURE__ */ Ct(hn, [["__scopeId", "data-v-3ba12e5a"]]), mn = { key: 1 }, xa = /* @__PURE__ */ ae({
|
|
1326
|
+
name: "ProTableToolbar",
|
|
1327
|
+
__name: "ProTableToolbar",
|
|
1328
|
+
props: {
|
|
1329
|
+
headerTitle: { type: [Object, String, Number, Boolean, null, Array] },
|
|
1330
|
+
headerSubtitle: { type: [Object, String, Number, Boolean, null, Array] },
|
|
1331
|
+
toolbarItems: {},
|
|
1332
|
+
showReload: { type: Boolean },
|
|
1333
|
+
headerAlert: {},
|
|
1334
|
+
loading: { type: Boolean },
|
|
1335
|
+
download: { type: [Boolean, String, Object] }
|
|
1336
|
+
},
|
|
1337
|
+
emits: ["reload", "download"],
|
|
1338
|
+
setup(e, { emit: a }) {
|
|
1339
|
+
const t = a, { prefix: n, size: o } = me(), f = d(() => `${n.value}-pro-table__toolbar--${o.value}`);
|
|
1340
|
+
return (p, u) => {
|
|
1341
|
+
var r;
|
|
1342
|
+
const v = Jt("ElAlert");
|
|
1343
|
+
return i(), C(X, null, [
|
|
1344
|
+
F("div", {
|
|
1345
|
+
class: k([`${l(n)}-pro-table__toolbar`, f.value])
|
|
1346
|
+
}, [
|
|
1347
|
+
F("div", {
|
|
1348
|
+
class: k(`${l(n)}-pro-table__toolbar-title`)
|
|
1349
|
+
}, [
|
|
1350
|
+
F("div", {
|
|
1351
|
+
class: k(`${l(n)}-pro-table__toolbar-title-main`)
|
|
1352
|
+
}, [
|
|
1353
|
+
z(p.$slots, "headerTitle", {}, () => [
|
|
1354
|
+
te(H(e.headerTitle), 1)
|
|
1355
|
+
])
|
|
1356
|
+
], 2),
|
|
1357
|
+
p.$slots.headerSubtitle || e.headerSubtitle ? (i(), C("div", {
|
|
1358
|
+
key: 0,
|
|
1359
|
+
class: k(`${l(n)}-pro-table__toolbar-title-sub`)
|
|
1360
|
+
}, [
|
|
1361
|
+
z(p.$slots, "headerSubtitle", {}, () => [
|
|
1362
|
+
te(H(e.headerSubtitle || ""), 1)
|
|
1363
|
+
])
|
|
1364
|
+
], 2)) : I("", !0)
|
|
1365
|
+
], 2),
|
|
1366
|
+
F("div", {
|
|
1367
|
+
class: k(`${l(n)}-pro-table__toolbar-actions`)
|
|
1368
|
+
}, [
|
|
1369
|
+
z(p.$slots, "toolbar", {}, () => [
|
|
1370
|
+
(i(!0), C(X, null, pe(e.toolbarItems, (h, m) => (i(), C(X, { key: m }, [
|
|
1371
|
+
Ze(h) ? (i(), x(Oe(h), { key: 0 })) : (i(), C("span", mn, H(h), 1))
|
|
1372
|
+
], 64))), 128))
|
|
1373
|
+
]),
|
|
1374
|
+
e.download !== void 0 && e.download !== !1 ? (i(), x(l(de), {
|
|
1375
|
+
key: 0,
|
|
1376
|
+
icon: l(ql),
|
|
1377
|
+
onClick: u[0] || (u[0] = (h) => t("download"))
|
|
1378
|
+
}, {
|
|
1379
|
+
default: $(() => [
|
|
1380
|
+
Ze(e.download) ? (i(), x(Oe(e.download), { key: 0 })) : (i(), C(X, { key: 1 }, [
|
|
1381
|
+
te(H(e.download === !0 ? "导出" : e.download), 1)
|
|
1382
|
+
], 64))
|
|
1383
|
+
]),
|
|
1384
|
+
_: 1
|
|
1385
|
+
}, 8, ["icon"])) : I("", !0),
|
|
1386
|
+
e.showReload ? (i(), x(l(de), {
|
|
1387
|
+
key: 1,
|
|
1388
|
+
icon: l(ua),
|
|
1389
|
+
circle: "",
|
|
1390
|
+
loading: e.loading,
|
|
1391
|
+
onClick: u[1] || (u[1] = (h) => t("reload"))
|
|
1392
|
+
}, null, 8, ["icon", "loading"])) : I("", !0)
|
|
1393
|
+
], 2)
|
|
1394
|
+
], 2),
|
|
1395
|
+
(r = e.headerAlert) != null && r.type ? (i(), x(v, fe({ key: 0 }, e.headerAlert, {
|
|
1396
|
+
class: `${l(n)}-pro-table__toolbar-alert`
|
|
1397
|
+
}), null, 16, ["class"])) : I("", !0)
|
|
1398
|
+
], 64);
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
}), bn = 10;
|
|
1402
|
+
function Ht(e) {
|
|
1403
|
+
return (e || []).reduce((a, t) => {
|
|
1404
|
+
if (!t.hideInForm && t.search !== !1 && t.initialValue !== void 0) {
|
|
1405
|
+
const n = Array.isArray(t.dataIndex) ? t.dataIndex.join(".") : t.dataIndex;
|
|
1406
|
+
a[n] = t.initialValue;
|
|
1407
|
+
}
|
|
1408
|
+
return a;
|
|
1409
|
+
}, {});
|
|
1410
|
+
}
|
|
1411
|
+
function yn(e, a) {
|
|
1412
|
+
var O, Z, le, N;
|
|
1413
|
+
const t = St(e.defaultData ?? e.dataSource ?? []), n = q(!!e.request && !e.manualRequest), o = q(null), f = q(Ht(e.columns)), p = q({ quickDateSelections: {} }), u = q({}), v = q({}), r = q({
|
|
1414
|
+
current: e.pagination === !1 ? 1 : ((O = e.pagination) == null ? void 0 : O.current) ?? 1,
|
|
1415
|
+
pageSize: e.pagination === !1 ? Number.MAX_SAFE_INTEGER : ((Z = e.pagination) == null ? void 0 : Z.pageSize) ?? bn,
|
|
1416
|
+
total: ((le = e.dataSource) == null ? void 0 : le.length) ?? ((N = e.defaultData) == null ? void 0 : N.length) ?? 0
|
|
1417
|
+
});
|
|
1418
|
+
let h = 0, m = !1;
|
|
1419
|
+
function w() {
|
|
1420
|
+
const V = Object.assign(
|
|
1421
|
+
{
|
|
1422
|
+
current: r.value.current,
|
|
1423
|
+
pageSize: r.value.pageSize
|
|
1424
|
+
},
|
|
1425
|
+
{ tabActiveKey: a == null ? void 0 : a.value },
|
|
1426
|
+
e.params ?? {},
|
|
1427
|
+
f.value
|
|
1428
|
+
);
|
|
1429
|
+
return e.beforeSearchSubmit ? e.beforeSearchSubmit(V) : V;
|
|
1430
|
+
}
|
|
1431
|
+
function M() {
|
|
1432
|
+
var G;
|
|
1433
|
+
const V = [];
|
|
1434
|
+
t.value = V, r.value.total = 0, (G = e.onDataSourceChange) == null || G.call(e, V);
|
|
1435
|
+
}
|
|
1436
|
+
async function P() {
|
|
1437
|
+
var G, W, re, j;
|
|
1438
|
+
if (!e.request) {
|
|
1439
|
+
const K = e.dataSource ?? e.defaultData ?? [];
|
|
1440
|
+
t.value = K, r.value.total = K.length, (G = e.onDataSourceChange) == null || G.call(e, K);
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
const V = ++h;
|
|
1444
|
+
n.value = !0, o.value = null;
|
|
1445
|
+
try {
|
|
1446
|
+
const K = await e.request(w(), u.value, v.value, p.value);
|
|
1447
|
+
if (m || V !== h) return;
|
|
1448
|
+
const ie = K.success === !1 ? [] : K.data;
|
|
1449
|
+
t.value = ie, r.value.total = K.total ?? ie.length, (W = e.onLoad) == null || W.call(e, ie), (re = e.onDataSourceChange) == null || re.call(e, ie);
|
|
1450
|
+
} catch (K) {
|
|
1451
|
+
if (m || V !== h) return;
|
|
1452
|
+
const ie = K instanceof Error ? K : new Error(String(K));
|
|
1453
|
+
o.value = ie, M(), (j = e.onRequestError) == null || j.call(e, ie);
|
|
1454
|
+
} finally {
|
|
1455
|
+
!m && V === h && (n.value = !1);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
async function _(V, G) {
|
|
1459
|
+
var W;
|
|
1460
|
+
f.value = { ...V }, p.value = G ?? { quickDateSelections: {} }, r.value.current = 1, (W = e.onSubmit) == null || W.call(e, w()), await P();
|
|
1461
|
+
}
|
|
1462
|
+
async function S() {
|
|
1463
|
+
var V;
|
|
1464
|
+
f.value = Ht(e.columns), p.value = { quickDateSelections: {} }, r.value.current = 1, (V = e.onReset) == null || V.call(e), await P();
|
|
1465
|
+
}
|
|
1466
|
+
async function A(V) {
|
|
1467
|
+
if (!V || !(V in f.value)) return;
|
|
1468
|
+
const G = { ...f.value };
|
|
1469
|
+
delete G[V], f.value = G;
|
|
1470
|
+
const W = { ...p.value.quickDateSelections };
|
|
1471
|
+
delete W[V], p.value = { quickDateSelections: W }, r.value.current = 1, await P();
|
|
1472
|
+
}
|
|
1473
|
+
async function T(V = !1) {
|
|
1474
|
+
V && (r.value.current = 1), await P();
|
|
1475
|
+
}
|
|
1476
|
+
async function U() {
|
|
1477
|
+
await S();
|
|
1478
|
+
}
|
|
1479
|
+
function B(V) {
|
|
1480
|
+
V.current !== void 0 && (r.value.current = Math.max(1, V.current)), V.pageSize !== void 0 && e.pagination !== !1 && (r.value.pageSize = Math.max(1, V.pageSize)), V.total !== void 0 && (r.value.total = Math.max(0, V.total));
|
|
1481
|
+
}
|
|
1482
|
+
function J(V) {
|
|
1483
|
+
return {
|
|
1484
|
+
reload: T,
|
|
1485
|
+
reloadAndRest: U,
|
|
1486
|
+
reset: S,
|
|
1487
|
+
clearSelected: () => {
|
|
1488
|
+
},
|
|
1489
|
+
setPageInfo: B,
|
|
1490
|
+
toggleRowExpansion: () => {
|
|
1491
|
+
},
|
|
1492
|
+
expandAll: () => {
|
|
1493
|
+
},
|
|
1494
|
+
collapseAll: () => {
|
|
1495
|
+
},
|
|
1496
|
+
formRef: V
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
return he(
|
|
1500
|
+
() => e.params,
|
|
1501
|
+
() => {
|
|
1502
|
+
T(!0);
|
|
1503
|
+
},
|
|
1504
|
+
{ deep: !0 }
|
|
1505
|
+
), he(
|
|
1506
|
+
() => e.dataSource,
|
|
1507
|
+
(V) => {
|
|
1508
|
+
!e.request && V && (t.value = V, r.value.total = V.length);
|
|
1509
|
+
},
|
|
1510
|
+
{ deep: !0 }
|
|
1511
|
+
), a && he(a, () => {
|
|
1512
|
+
T(!0);
|
|
1513
|
+
}), Ue(() => {
|
|
1514
|
+
e.manualRequest || P();
|
|
1515
|
+
}), De(() => {
|
|
1516
|
+
m = !0, h += 1;
|
|
1517
|
+
}), {
|
|
1518
|
+
dataSource: t,
|
|
1519
|
+
loading: n,
|
|
1520
|
+
error: o,
|
|
1521
|
+
searchValues: f,
|
|
1522
|
+
sort: u,
|
|
1523
|
+
filter: v,
|
|
1524
|
+
requestContext: p,
|
|
1525
|
+
pageInfo: r,
|
|
1526
|
+
getRequestParams: w,
|
|
1527
|
+
load: P,
|
|
1528
|
+
submitSearch: _,
|
|
1529
|
+
resetSearch: S,
|
|
1530
|
+
removeSearchField: A,
|
|
1531
|
+
reload: T,
|
|
1532
|
+
reloadAndRest: U,
|
|
1533
|
+
setPageInfo: B,
|
|
1534
|
+
getAction: J
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
function gn(e, a, t) {
|
|
1538
|
+
const n = q(
|
|
1539
|
+
a !== void 0 && a !== !1 ? [...a.selectedRowKeys ?? []] : []
|
|
1540
|
+
), o = St([]), f = d(() => n.value.length > 0);
|
|
1541
|
+
function p() {
|
|
1542
|
+
var r;
|
|
1543
|
+
a !== void 0 && a !== !1 && ((r = a.onChange) == null || r.call(a, n.value, o.value));
|
|
1544
|
+
}
|
|
1545
|
+
function u(r) {
|
|
1546
|
+
o.value = r;
|
|
1547
|
+
const h = /* @__PURE__ */ new Set();
|
|
1548
|
+
r.forEach((m, w) => {
|
|
1549
|
+
h.add(ka(m, w, t));
|
|
1550
|
+
}), n.value = [...h], p();
|
|
1551
|
+
}
|
|
1552
|
+
function v() {
|
|
1553
|
+
n.value = [], o.value = [], p();
|
|
1554
|
+
}
|
|
1555
|
+
return { selectedRowKeys: n, selectedRows: o, hasSelection: f, setSelection: u, clearSelected: v };
|
|
1556
|
+
}
|
|
1557
|
+
function kn(e) {
|
|
1558
|
+
return e ? e === !0 ? { offsetHeader: 0, offsetScroll: 0 } : { offsetHeader: 0, offsetScroll: 0, ...e } : !1;
|
|
1559
|
+
}
|
|
1560
|
+
function Ut(e) {
|
|
1561
|
+
return !e || !e.getContainer ? window : e.getContainer();
|
|
1562
|
+
}
|
|
1563
|
+
function wn(e, a) {
|
|
1564
|
+
return e === window ? window.innerHeight - a : e.getBoundingClientRect().bottom - a;
|
|
1565
|
+
}
|
|
1566
|
+
function Sn(e) {
|
|
1567
|
+
return e === window ? 0 : e.getBoundingClientRect().top;
|
|
1568
|
+
}
|
|
1569
|
+
function $n(e) {
|
|
1570
|
+
return e.querySelector(".el-table__body-wrapper .el-scrollbar__wrap") || e.querySelector(".el-table__body-wrapper");
|
|
1571
|
+
}
|
|
1572
|
+
function Cn(e) {
|
|
1573
|
+
return e.querySelector(".el-table__header-wrapper");
|
|
1574
|
+
}
|
|
1575
|
+
function xn(e, a, t, n) {
|
|
1576
|
+
const o = d(() => kn(e.value)), f = d(() => o.value !== !1), p = q(), u = q(0), v = q(!1);
|
|
1577
|
+
let r = !1, h = null, m = null, w = null;
|
|
1578
|
+
const M = d(() => f.value ? `${n.value}-pro-table__table-wrap--sticky` : ""), P = d(() => {
|
|
1579
|
+
const O = o.value;
|
|
1580
|
+
if (O)
|
|
1581
|
+
return {
|
|
1582
|
+
"--sticky-offset-header": `${O.offsetHeader ?? 0}px`,
|
|
1583
|
+
"--sticky-offset-scroll": `${O.offsetScroll ?? 0}px`
|
|
1584
|
+
};
|
|
1585
|
+
});
|
|
1586
|
+
function _() {
|
|
1587
|
+
var O;
|
|
1588
|
+
return ((O = a.value) == null ? void 0 : O.querySelector(".el-table")) ?? null;
|
|
1589
|
+
}
|
|
1590
|
+
function S() {
|
|
1591
|
+
const O = a.value, Z = h, le = o.value;
|
|
1592
|
+
if (!O || !Z || !le) {
|
|
1593
|
+
v.value = !1;
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
if (!(Z.scrollWidth > Z.clientWidth + 1)) {
|
|
1597
|
+
v.value = !1;
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
const V = O.getBoundingClientRect(), G = le.offsetScroll ?? 0, W = Ut(le), re = wn(W, G), j = Sn(W);
|
|
1601
|
+
v.value = V.top < re && V.bottom > j;
|
|
1602
|
+
}
|
|
1603
|
+
function A() {
|
|
1604
|
+
if (!h) {
|
|
1605
|
+
u.value = 0, v.value = !1;
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
u.value = h.scrollWidth, S();
|
|
1609
|
+
}
|
|
1610
|
+
function T() {
|
|
1611
|
+
if (r) return;
|
|
1612
|
+
const O = p.value;
|
|
1613
|
+
!h || !O || (r = !0, O.scrollLeft = h.scrollLeft, r = !1);
|
|
1614
|
+
}
|
|
1615
|
+
function U() {
|
|
1616
|
+
if (r) return;
|
|
1617
|
+
const O = p.value, Z = _();
|
|
1618
|
+
if (!h || !O) return;
|
|
1619
|
+
r = !0, h.scrollLeft = O.scrollLeft;
|
|
1620
|
+
const le = Z ? Cn(Z) : null;
|
|
1621
|
+
le && (le.scrollLeft = O.scrollLeft), r = !1;
|
|
1622
|
+
}
|
|
1623
|
+
function B() {
|
|
1624
|
+
h && (h.removeEventListener("scroll", T), h = null), w == null || w.disconnect(), w = null, m && (m.removeEventListener("scroll", S), m = null), window.removeEventListener("resize", A), u.value = 0, v.value = !1;
|
|
1625
|
+
}
|
|
1626
|
+
function J() {
|
|
1627
|
+
if (B(), !f.value) return;
|
|
1628
|
+
const O = _();
|
|
1629
|
+
O && (h = $n(O), h && h.addEventListener("scroll", T, { passive: !0 }), typeof ResizeObserver < "u" && O && (w = new ResizeObserver(() => A()), w.observe(O), h && w.observe(h)), m = Ut(o.value), m.addEventListener("scroll", S, { passive: !0 }), window.addEventListener("resize", A, { passive: !0 }), A());
|
|
1630
|
+
}
|
|
1631
|
+
return Ue(() => {
|
|
1632
|
+
Re(() => J());
|
|
1633
|
+
}), he(
|
|
1634
|
+
[f, t],
|
|
1635
|
+
() => {
|
|
1636
|
+
Re(() => J());
|
|
1637
|
+
},
|
|
1638
|
+
{ flush: "post" }
|
|
1639
|
+
), De(() => {
|
|
1640
|
+
B();
|
|
1641
|
+
}), {
|
|
1642
|
+
stickyEnabled: f,
|
|
1643
|
+
stickyConfig: o,
|
|
1644
|
+
stickyWrapClass: M,
|
|
1645
|
+
stickyWrapStyle: P,
|
|
1646
|
+
stickyScrollRef: p,
|
|
1647
|
+
stickyScrollWidth: u,
|
|
1648
|
+
stickyScrollVisible: v,
|
|
1649
|
+
onStickyScroll: U
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
const Tn = ["title", "aria-label"], Rn = { key: 1 }, Pn = /* @__PURE__ */ ae({
|
|
1653
|
+
name: "ProTable",
|
|
1654
|
+
__name: "index",
|
|
1655
|
+
props: {
|
|
1656
|
+
columns: { default: () => [] },
|
|
1657
|
+
dataSource: {},
|
|
1658
|
+
defaultData: {},
|
|
1659
|
+
request: {},
|
|
1660
|
+
params: {},
|
|
1661
|
+
pagination: { type: [Boolean, Object], default: () => ({}) },
|
|
1662
|
+
rowKey: {},
|
|
1663
|
+
rowSelection: { type: [Boolean, Object] },
|
|
1664
|
+
search: { type: [Boolean, Object], default: () => ({}) },
|
|
1665
|
+
form: {},
|
|
1666
|
+
tabs: {},
|
|
1667
|
+
tabMore: {},
|
|
1668
|
+
modes: { default: () => ["table"] },
|
|
1669
|
+
listProps: { default: () => ({ columns: 3, gap: "12px" }) },
|
|
1670
|
+
tabActiveKey: {},
|
|
1671
|
+
defaultTabActiveKey: {},
|
|
1672
|
+
headerTitle: { type: [Object, String, Number, Boolean, null, Array] },
|
|
1673
|
+
headerSubtitle: { type: [Object, String, Number, Boolean, null, Array] },
|
|
1674
|
+
headerAlert: {},
|
|
1675
|
+
download: { type: [Boolean, String, Object] },
|
|
1676
|
+
selectedFiltersTitle: {},
|
|
1677
|
+
toolBarRender: {},
|
|
1678
|
+
options: { type: [Boolean, Object], default: () => ({}) },
|
|
1679
|
+
beforeSearchSubmit: {},
|
|
1680
|
+
manualRequest: { type: Boolean },
|
|
1681
|
+
columnEmptyText: { type: [String, Boolean], default: "-" },
|
|
1682
|
+
loading: { type: Boolean },
|
|
1683
|
+
onLoad: {},
|
|
1684
|
+
onRequestError: {},
|
|
1685
|
+
onSubmit: {},
|
|
1686
|
+
onReset: {},
|
|
1687
|
+
onFieldChange: {},
|
|
1688
|
+
onTabChange: {},
|
|
1689
|
+
onModeChange: {},
|
|
1690
|
+
onDataSourceChange: {},
|
|
1691
|
+
onDownload: {},
|
|
1692
|
+
actionRef: {},
|
|
1693
|
+
sticky: { type: [Boolean, Object], default: !0 },
|
|
1694
|
+
showRequestError: { type: Boolean, default: !1 },
|
|
1695
|
+
tableProps: {}
|
|
1696
|
+
},
|
|
1697
|
+
setup(e, { expose: a }) {
|
|
1698
|
+
var Et, Bt;
|
|
1699
|
+
const t = e, { prefix: n, size: o } = me(), f = d(() => `${n.value}-pro-table__${o.value}`), p = Zt(), u = q(), v = q(), { tabActiveKey: r, defaultTabActiveKey: h, tabs: m, rowSelection: w, rowKey: M, showRequestError: P, tableProps: _ } = t || {};
|
|
1700
|
+
function S(s) {
|
|
1701
|
+
const E = s.filter((ue, R) => s.indexOf(ue) === R);
|
|
1702
|
+
return E.length ? E : ["table"];
|
|
1703
|
+
}
|
|
1704
|
+
const A = d(() => S(t.modes)), T = q(A.value[0]), U = d(() => {
|
|
1705
|
+
var s;
|
|
1706
|
+
return ((s = t.tabMore) == null ? void 0 : s.options) ?? [];
|
|
1707
|
+
}), B = q(
|
|
1708
|
+
r ?? h ?? ((Et = m == null ? void 0 : m[0]) == null ? void 0 : Et.key) ?? ((Bt = U.value[0]) == null ? void 0 : Bt.key) ?? ""
|
|
1709
|
+
), {
|
|
1710
|
+
dataSource: J,
|
|
1711
|
+
loading: O,
|
|
1712
|
+
error: Z,
|
|
1713
|
+
searchValues: le,
|
|
1714
|
+
sort: N,
|
|
1715
|
+
filter: V,
|
|
1716
|
+
requestContext: G,
|
|
1717
|
+
pageInfo: W,
|
|
1718
|
+
load: re,
|
|
1719
|
+
getRequestParams: j,
|
|
1720
|
+
submitSearch: K,
|
|
1721
|
+
resetSearch: ie,
|
|
1722
|
+
removeSearchField: Y,
|
|
1723
|
+
reload: we,
|
|
1724
|
+
setPageInfo: Se,
|
|
1725
|
+
getAction: qe
|
|
1726
|
+
} = yn(t, B), {
|
|
1727
|
+
stickyEnabled: Ve,
|
|
1728
|
+
stickyWrapClass: Le,
|
|
1729
|
+
stickyWrapStyle: Ne,
|
|
1730
|
+
stickyScrollRef: Pe,
|
|
1731
|
+
stickyScrollWidth: y,
|
|
1732
|
+
stickyScrollVisible: D,
|
|
1733
|
+
onStickyScroll: Q
|
|
1734
|
+
} = xn(
|
|
1735
|
+
d(() => t.sticky),
|
|
1736
|
+
v,
|
|
1737
|
+
d(() => [J.value, T.value]),
|
|
1738
|
+
n
|
|
1739
|
+
), oe = q(), se = q(!1), xe = {
|
|
1740
|
+
getFieldsValue: () => {
|
|
1741
|
+
var s;
|
|
1742
|
+
return ((s = oe.value) == null ? void 0 : s.getFieldsValue()) ?? { ...le.value };
|
|
1743
|
+
},
|
|
1744
|
+
getFieldValue: (s) => xe.getFieldsValue()[s],
|
|
1745
|
+
setFieldsValue: (s) => {
|
|
1746
|
+
if (oe.value) {
|
|
1747
|
+
oe.value.setFieldsValue(s);
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
le.value = { ...le.value, ...s };
|
|
1751
|
+
},
|
|
1752
|
+
setFieldValue: (s, E) => {
|
|
1753
|
+
xe.setFieldsValue({ [s]: E });
|
|
1754
|
+
},
|
|
1755
|
+
submit: () => {
|
|
1756
|
+
var s;
|
|
1757
|
+
return K(xe.getFieldsValue(), (s = oe.value) == null ? void 0 : s.getRequestContext());
|
|
1758
|
+
},
|
|
1759
|
+
resetFields: (s) => {
|
|
1760
|
+
var E;
|
|
1761
|
+
(E = oe.value) == null || E.resetFields(s);
|
|
1762
|
+
}
|
|
1763
|
+
}, { selectedRowKeys: Ae, selectedRows: We, setSelection: rt, clearSelected: it } = gn(
|
|
1764
|
+
J,
|
|
1765
|
+
w,
|
|
1766
|
+
M
|
|
1767
|
+
), ge = qe(xe);
|
|
1768
|
+
function Ke() {
|
|
1769
|
+
var s;
|
|
1770
|
+
(s = u.value) == null || s.clearSelection(), it();
|
|
1771
|
+
}
|
|
1772
|
+
ge.clearSelected = Ke;
|
|
1773
|
+
const b = d(() => {
|
|
1774
|
+
var s, E;
|
|
1775
|
+
return ((E = (s = t.tableProps) == null ? void 0 : s.treeProps) == null ? void 0 : E.children) ?? "children";
|
|
1776
|
+
});
|
|
1777
|
+
function g(s) {
|
|
1778
|
+
return typeof s == "object" && s !== null;
|
|
1779
|
+
}
|
|
1780
|
+
function c(s, E) {
|
|
1781
|
+
s.forEach((ue) => {
|
|
1782
|
+
const R = Reflect.get(ue, b.value);
|
|
1783
|
+
!Array.isArray(R) || !R.length || (E(ue), c(R.filter(g), E));
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
function ee(s, E) {
|
|
1787
|
+
var ue;
|
|
1788
|
+
(ue = u.value) == null || ue.toggleRowExpansion(s, E);
|
|
1789
|
+
}
|
|
1790
|
+
function ve() {
|
|
1791
|
+
c(J.value, (s) => ee(s, !0));
|
|
1792
|
+
}
|
|
1793
|
+
function ye() {
|
|
1794
|
+
c(J.value, (s) => ee(s, !1));
|
|
1795
|
+
}
|
|
1796
|
+
ge.toggleRowExpansion = ee, ge.expandAll = ve, ge.collapseAll = ye;
|
|
1797
|
+
function $e(s) {
|
|
1798
|
+
s && (Ft(s) ? s.value = ge : s.current = ge);
|
|
1799
|
+
}
|
|
1800
|
+
function ke(s) {
|
|
1801
|
+
s && (Ft(s) ? s.value === ge && (s.value = void 0) : s.current === ge && (s.current = void 0));
|
|
1802
|
+
}
|
|
1803
|
+
he(
|
|
1804
|
+
() => t.actionRef,
|
|
1805
|
+
(s, E) => {
|
|
1806
|
+
ke(E), $e(s);
|
|
1807
|
+
},
|
|
1808
|
+
{ immediate: !0 }
|
|
1809
|
+
), De(() => {
|
|
1810
|
+
ke(t.actionRef);
|
|
1811
|
+
}), a(ge);
|
|
1812
|
+
const ne = d(() => t.columns.some((s) => !s.hideInForm && s.search !== !1)), Ye = d(() => t.search !== !1 && ne.value), Tt = d(() => t.rowSelection !== !1 && t.rowSelection !== void 0), Fa = d(() => t.columns.filter((s) => !s.hideInTable)), Oa = d(
|
|
1813
|
+
() => {
|
|
1814
|
+
var s, E;
|
|
1815
|
+
return Tt.value && t.rowSelection !== !1 && !!(((s = t.rowSelection) == null ? void 0 : s.alwaysShowActions) ?? ((E = t.rowSelection) == null ? void 0 : E.alwaysShowAlert));
|
|
1816
|
+
}
|
|
1817
|
+
), Da = d(() => {
|
|
1818
|
+
var s;
|
|
1819
|
+
return t.options !== !1 && ((s = t.options) == null ? void 0 : s.reload) !== !1;
|
|
1820
|
+
}), La = d(() => t.pagination !== !1), za = d(() => t.loading === !0), Rt = d(() => U.value.length > 0), qa = d(() => {
|
|
1821
|
+
var s;
|
|
1822
|
+
return (((s = t.tabs) == null ? void 0 : s.length) ?? 0) > 0 || Rt.value;
|
|
1823
|
+
}), Pt = d(() => U.value.find((s) => s.key === B.value)), st = d(() => {
|
|
1824
|
+
var s, E;
|
|
1825
|
+
return ((s = Pt.value) == null ? void 0 : s.tab) ?? ((E = t.tabMore) == null ? void 0 : E.text) ?? "更多状态";
|
|
1826
|
+
}), je = d(() => A.value.length > 1), Na = d(() => je.value || !!(p.selectModeBefore || p.selectModeAfter));
|
|
1827
|
+
function ja(s) {
|
|
1828
|
+
return s == null || s === "" ? !1 : !Array.isArray(s) || s.length > 0;
|
|
1829
|
+
}
|
|
1830
|
+
const At = d(
|
|
1831
|
+
() => t.columns.some((s) => s.hideInForm || s.search === !1 ? !1 : ja(le.value[et(s.dataIndex)]))
|
|
1832
|
+
), Ha = d(() => !!(p.searchActionLeft || p.searchActionRight)), Ua = d(
|
|
1833
|
+
() => Ye.value && (!je.value || !se.value || At.value || Ha.value)
|
|
1834
|
+
), Wa = d(() => {
|
|
1835
|
+
var ce, _e;
|
|
1836
|
+
const s = (ce = t.listProps) == null ? void 0 : ce.columns, E = (_e = t.listProps) == null ? void 0 : _e.gap, ue = typeof s == "number" && Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 3, R = typeof E == "number" && Number.isFinite(E) ? `${E}px` : E || "12px";
|
|
1837
|
+
return {
|
|
1838
|
+
gridTemplateColumns: `repeat(${ue}, minmax(0, 1fr))`,
|
|
1839
|
+
gap: R
|
|
1840
|
+
};
|
|
1841
|
+
});
|
|
1842
|
+
he(
|
|
1843
|
+
A,
|
|
1844
|
+
(s) => {
|
|
1845
|
+
s.includes(T.value) || (T.value = s[0]);
|
|
1846
|
+
},
|
|
1847
|
+
{ deep: !0 }
|
|
1848
|
+
);
|
|
1849
|
+
const Ka = d(() => {
|
|
1850
|
+
if (!t.toolBarRender) return [];
|
|
1851
|
+
const s = t.toolBarRender(ge, {
|
|
1852
|
+
selectedRowKeys: Ae.value,
|
|
1853
|
+
selectedRows: We.value
|
|
1854
|
+
});
|
|
1855
|
+
return s === !1 ? [] : s;
|
|
1856
|
+
}), _t = d(() => {
|
|
1857
|
+
const s = t.rowKey;
|
|
1858
|
+
return typeof s == "string" ? s : typeof s == "function" ? (E) => String(s(E, 0)) : "id";
|
|
1859
|
+
});
|
|
1860
|
+
he(
|
|
1861
|
+
() => t.tabActiveKey,
|
|
1862
|
+
(s) => {
|
|
1863
|
+
s !== void 0 && s !== B.value && (B.value = s);
|
|
1864
|
+
}
|
|
1865
|
+
), he(
|
|
1866
|
+
() => [
|
|
1867
|
+
J.value,
|
|
1868
|
+
t.rowSelection !== !1 && t.rowSelection !== void 0 ? t.rowSelection.selectedRowKeys : void 0,
|
|
1869
|
+
T.value
|
|
1870
|
+
],
|
|
1871
|
+
([s, E, ue]) => {
|
|
1872
|
+
if (ue !== "table" || !(E != null && E.length) || !u.value) return;
|
|
1873
|
+
const R = new Set(E);
|
|
1874
|
+
s.forEach((ce) => {
|
|
1875
|
+
var Vt;
|
|
1876
|
+
const _e = _t.value, ct = typeof _e == "function" ? _e(ce) : He(ce, _e);
|
|
1877
|
+
(typeof ct == "string" || typeof ct == "number") && R.has(ct) && ((Vt = u.value) == null || Vt.toggleRowSelection(ce, !0));
|
|
1878
|
+
});
|
|
1879
|
+
},
|
|
1880
|
+
{ flush: "post" }
|
|
1881
|
+
);
|
|
1882
|
+
function Ya(s) {
|
|
1883
|
+
var E;
|
|
1884
|
+
(E = t.onTabChange) == null || E.call(t, s);
|
|
1885
|
+
}
|
|
1886
|
+
function Ga(s) {
|
|
1887
|
+
var ue;
|
|
1888
|
+
const E = U.value.find((R) => R.key === s);
|
|
1889
|
+
!E || E.disabled || E.key === B.value || (B.value = E.key, (ue = t.onTabChange) == null || ue.call(t, E.key));
|
|
1890
|
+
}
|
|
1891
|
+
function Qa(s) {
|
|
1892
|
+
var E;
|
|
1893
|
+
s !== T.value && (T.value = s, (E = t.onModeChange) == null || E.call(t, s));
|
|
1894
|
+
}
|
|
1895
|
+
function Xa(s, E) {
|
|
1896
|
+
return ka(s, E, t.rowKey);
|
|
1897
|
+
}
|
|
1898
|
+
function Za(s, E) {
|
|
1899
|
+
K(s, E);
|
|
1900
|
+
}
|
|
1901
|
+
function Ja() {
|
|
1902
|
+
ie();
|
|
1903
|
+
}
|
|
1904
|
+
async function el(s, E, ue) {
|
|
1905
|
+
var R;
|
|
1906
|
+
await ((R = t.onFieldChange) == null ? void 0 : R.call(t, s, E, ue));
|
|
1907
|
+
}
|
|
1908
|
+
function tl(s) {
|
|
1909
|
+
Y(s);
|
|
1910
|
+
}
|
|
1911
|
+
function al() {
|
|
1912
|
+
ie();
|
|
1913
|
+
}
|
|
1914
|
+
function ll(s) {
|
|
1915
|
+
Se({ current: s }), re();
|
|
1916
|
+
}
|
|
1917
|
+
function nl(s) {
|
|
1918
|
+
Se({ current: 1, pageSize: s }), re();
|
|
1919
|
+
}
|
|
1920
|
+
function ol(s) {
|
|
1921
|
+
rt(s);
|
|
1922
|
+
}
|
|
1923
|
+
function rl(s) {
|
|
1924
|
+
const { prop: E, order: ue } = s;
|
|
1925
|
+
if (!E) return;
|
|
1926
|
+
const R = ue === "ascending" ? "ascend" : ue === "descending" ? "descend" : null;
|
|
1927
|
+
N.value = { ...N.value, [E]: R }, re();
|
|
1928
|
+
}
|
|
1929
|
+
function Ge(s) {
|
|
1930
|
+
return et(s.dataIndex);
|
|
1931
|
+
}
|
|
1932
|
+
function ut(s, E, ue) {
|
|
1933
|
+
const R = He(E, s.dataIndex);
|
|
1934
|
+
if (s.render) return s.render(R, E, ue);
|
|
1935
|
+
if (s.renderText)
|
|
1936
|
+
return yt(s.renderText(R, E, ue), t.columnEmptyText, s.valueEnum);
|
|
1937
|
+
if (s.valueType === "money") {
|
|
1938
|
+
const ce = typeof R == "number" ? R : typeof R == "string" && R !== "" && !Number.isNaN(Number(R)) ? Number(R) : null;
|
|
1939
|
+
if (ce !== null) return `¥${ce.toFixed(2)}`;
|
|
1940
|
+
}
|
|
1941
|
+
return yt(R, t.columnEmptyText, s.valueEnum);
|
|
1942
|
+
}
|
|
1943
|
+
function il(s) {
|
|
1944
|
+
return Ze(s);
|
|
1945
|
+
}
|
|
1946
|
+
function sl() {
|
|
1947
|
+
if (t.onDownload)
|
|
1948
|
+
return t.onDownload(j(), N.value, V.value, G.value);
|
|
1949
|
+
}
|
|
1950
|
+
return (s, E) => {
|
|
1951
|
+
var ue;
|
|
1952
|
+
return i(), C("div", null, [
|
|
1953
|
+
L(xa, {
|
|
1954
|
+
"header-title": e.headerTitle,
|
|
1955
|
+
"header-subtitle": e.headerSubtitle,
|
|
1956
|
+
"toolbar-items": Ka.value,
|
|
1957
|
+
"show-reload": Da.value,
|
|
1958
|
+
"header-alert": t.headerAlert,
|
|
1959
|
+
loading: l(O),
|
|
1960
|
+
download: t.download,
|
|
1961
|
+
onReload: E[0] || (E[0] = (R) => l(we)()),
|
|
1962
|
+
onDownload: sl
|
|
1963
|
+
}, Fe({
|
|
1964
|
+
headerTitle: $(() => [
|
|
1965
|
+
z(s.$slots, "headerTitle", {}, () => [
|
|
1966
|
+
te(H(e.headerTitle || ""), 1)
|
|
1967
|
+
])
|
|
1968
|
+
]),
|
|
1969
|
+
headerSubtitle: $(() => [
|
|
1970
|
+
z(s.$slots, "headerSubtitle", {}, () => [
|
|
1971
|
+
te(H(e.headerSubtitle || ""), 1)
|
|
1972
|
+
])
|
|
1973
|
+
]),
|
|
1974
|
+
_: 2
|
|
1975
|
+
}, [
|
|
1976
|
+
l(p).toolbar ? {
|
|
1977
|
+
name: "toolbar",
|
|
1978
|
+
fn: $(() => [
|
|
1979
|
+
z(s.$slots, "toolbar")
|
|
1980
|
+
]),
|
|
1981
|
+
key: "0"
|
|
1982
|
+
} : void 0
|
|
1983
|
+
]), 1032, ["header-title", "header-subtitle", "toolbar-items", "show-reload", "header-alert", "loading", "download"]),
|
|
1984
|
+
l(p).tableInfo ? z(s.$slots, "tableInfo", { key: 0 }) : I("", !0),
|
|
1985
|
+
F("section", {
|
|
1986
|
+
class: k([`${l(n)}-pro-table`, l(Ve) && `${l(n)}-pro-table--sticky`, `${f.value}`]),
|
|
1987
|
+
style: Te(l(Ne))
|
|
1988
|
+
}, [
|
|
1989
|
+
qa.value ? (i(), C("div", {
|
|
1990
|
+
key: 0,
|
|
1991
|
+
class: k(`${l(n)}-pro-table__tabs-row`)
|
|
1992
|
+
}, [
|
|
1993
|
+
(ue = l(m)) != null && ue.length ? (i(), x(l($l), {
|
|
1994
|
+
key: 0,
|
|
1995
|
+
modelValue: B.value,
|
|
1996
|
+
"onUpdate:modelValue": E[1] || (E[1] = (R) => B.value = R),
|
|
1997
|
+
class: k(`${l(n)}-pro-table__tabs`),
|
|
1998
|
+
onTabChange: Ya
|
|
1999
|
+
}, {
|
|
2000
|
+
default: $(() => [
|
|
2001
|
+
(i(!0), C(X, null, pe(l(m), (R) => (i(), x(l(Cl), {
|
|
2002
|
+
key: String(R.key),
|
|
2003
|
+
name: R.key,
|
|
2004
|
+
label: R.tab,
|
|
2005
|
+
disabled: R.disabled,
|
|
2006
|
+
lazy: ""
|
|
2007
|
+
}, {
|
|
2008
|
+
label: $(() => [
|
|
2009
|
+
F("span", {
|
|
2010
|
+
class: k(`${l(n)}-pro-table__tab-label`)
|
|
2011
|
+
}, [
|
|
2012
|
+
F("span", null, H(R.tab), 1),
|
|
2013
|
+
R.count !== void 0 ? (i(), x(l(Lt), {
|
|
2014
|
+
key: 0,
|
|
2015
|
+
value: R.count,
|
|
2016
|
+
type: "danger"
|
|
2017
|
+
}, null, 8, ["value"])) : I("", !0)
|
|
2018
|
+
], 2)
|
|
2019
|
+
]),
|
|
2020
|
+
_: 2
|
|
2021
|
+
}, 1032, ["name", "label", "disabled"]))), 128))
|
|
2022
|
+
]),
|
|
2023
|
+
_: 1
|
|
2024
|
+
}, 8, ["modelValue", "class"])) : I("", !0),
|
|
2025
|
+
Rt.value ? (i(), x(l(xl), {
|
|
2026
|
+
key: 1,
|
|
2027
|
+
class: k(`${l(n)}-pro-table__tabs-more`),
|
|
2028
|
+
trigger: "click",
|
|
2029
|
+
onCommand: Ga
|
|
2030
|
+
}, {
|
|
2031
|
+
dropdown: $(() => [
|
|
2032
|
+
L(l(Tl), null, {
|
|
2033
|
+
default: $(() => [
|
|
2034
|
+
(i(!0), C(X, null, pe(U.value, (R) => (i(), x(l(Rl), {
|
|
2035
|
+
key: String(R.key),
|
|
2036
|
+
command: R.key,
|
|
2037
|
+
disabled: R.disabled,
|
|
2038
|
+
class: k(R.key === B.value && `${l(n)}-pro-table__tab-more-option--active`)
|
|
2039
|
+
}, {
|
|
2040
|
+
default: $(() => [
|
|
2041
|
+
F("span", {
|
|
2042
|
+
class: k(`${l(n)}-pro-table__tab-more-option`)
|
|
2043
|
+
}, [
|
|
2044
|
+
F("span", null, H(R.tab), 1),
|
|
2045
|
+
R.count !== void 0 ? (i(), x(l(Lt), {
|
|
2046
|
+
key: 0,
|
|
2047
|
+
value: R.count,
|
|
2048
|
+
type: "danger"
|
|
2049
|
+
}, null, 8, ["value"])) : I("", !0)
|
|
2050
|
+
], 2)
|
|
2051
|
+
]),
|
|
2052
|
+
_: 2
|
|
2053
|
+
}, 1032, ["command", "disabled", "class"]))), 128))
|
|
2054
|
+
]),
|
|
2055
|
+
_: 1
|
|
2056
|
+
})
|
|
2057
|
+
]),
|
|
2058
|
+
default: $(() => [
|
|
2059
|
+
F("button", {
|
|
2060
|
+
type: "button",
|
|
2061
|
+
class: k([
|
|
2062
|
+
`${l(n)}-pro-table__tabs-more-trigger`,
|
|
2063
|
+
Pt.value && `${l(n)}-pro-table__tabs-more-trigger--active`
|
|
2064
|
+
]),
|
|
2065
|
+
title: st.value,
|
|
2066
|
+
"aria-label": st.value
|
|
2067
|
+
}, [
|
|
2068
|
+
F("span", {
|
|
2069
|
+
class: k(`${l(n)}-pro-table__tabs-more-trigger-text`)
|
|
2070
|
+
}, H(st.value), 3),
|
|
2071
|
+
L(l(Ce), null, {
|
|
2072
|
+
default: $(() => [
|
|
2073
|
+
L(l(Je))
|
|
2074
|
+
]),
|
|
2075
|
+
_: 1
|
|
2076
|
+
})
|
|
2077
|
+
], 10, Tn)
|
|
2078
|
+
]),
|
|
2079
|
+
_: 1
|
|
2080
|
+
}, 8, ["class"])) : I("", !0)
|
|
2081
|
+
], 2)) : I("", !0),
|
|
2082
|
+
l(p).tabSub ? (i(), C("div", {
|
|
2083
|
+
key: 1,
|
|
2084
|
+
class: k(`${l(n)}-pro-table__tabs-search`)
|
|
2085
|
+
}, [
|
|
2086
|
+
z(s.$slots, "tabSub")
|
|
2087
|
+
], 2)) : I("", !0),
|
|
2088
|
+
Ua.value ? (i(), x(Sa, {
|
|
2089
|
+
key: 2,
|
|
2090
|
+
ref_key: "searchFormRef",
|
|
2091
|
+
ref: oe,
|
|
2092
|
+
columns: e.columns,
|
|
2093
|
+
"model-value": l(le),
|
|
2094
|
+
search: e.search,
|
|
2095
|
+
form: e.form,
|
|
2096
|
+
collapsed: se.value,
|
|
2097
|
+
"collapse-action-in-mode-bar": je.value,
|
|
2098
|
+
onSubmit: Za,
|
|
2099
|
+
onReset: Ja,
|
|
2100
|
+
onFieldChange: el,
|
|
2101
|
+
"onUpdate:collapsed": E[2] || (E[2] = (R) => se.value = R)
|
|
2102
|
+
}, Fe({
|
|
2103
|
+
selectedFilters: $(() => [
|
|
2104
|
+
L($a, {
|
|
2105
|
+
class: k(`${l(n)}-pro-table__selected-filters--inline`),
|
|
2106
|
+
columns: e.columns,
|
|
2107
|
+
"search-values": l(le),
|
|
2108
|
+
"quick-date-selections": l(G).quickDateSelections,
|
|
2109
|
+
title: e.selectedFiltersTitle,
|
|
2110
|
+
onClear: tl,
|
|
2111
|
+
onClearAll: al
|
|
2112
|
+
}, null, 8, ["class", "columns", "search-values", "quick-date-selections", "title"])
|
|
2113
|
+
]),
|
|
2114
|
+
_: 2
|
|
2115
|
+
}, [
|
|
2116
|
+
l(p).searchActionLeft || l(p).searchActionRight ? {
|
|
2117
|
+
name: "searchActionLeft",
|
|
2118
|
+
fn: $(() => [
|
|
2119
|
+
z(s.$slots, "searchActionLeft")
|
|
2120
|
+
]),
|
|
2121
|
+
key: "0"
|
|
2122
|
+
} : void 0,
|
|
2123
|
+
l(p).searchActionLeft || l(p).searchActionRight ? {
|
|
2124
|
+
name: "searchActionRight",
|
|
2125
|
+
fn: $(() => [
|
|
2126
|
+
z(s.$slots, "searchActionRight")
|
|
2127
|
+
]),
|
|
2128
|
+
key: "1"
|
|
2129
|
+
} : void 0
|
|
2130
|
+
]), 1032, ["columns", "model-value", "search", "form", "collapsed", "collapse-action-in-mode-bar"])) : I("", !0),
|
|
2131
|
+
Oa.value || l(Ae).length ? (i(), x(Ca, {
|
|
2132
|
+
key: 3,
|
|
2133
|
+
"selected-row-keys": l(Ae),
|
|
2134
|
+
"selected-rows": l(We),
|
|
2135
|
+
onClear: Ke
|
|
2136
|
+
}, Fe({ _: 2 }, [
|
|
2137
|
+
l(p).selectionActions ? {
|
|
2138
|
+
name: "default",
|
|
2139
|
+
fn: $(({ selectedRowKeys: R, selectedRows: ce, clearSelected: _e }) => [
|
|
2140
|
+
z(s.$slots, "selectionActions", {
|
|
2141
|
+
selectedRowKeys: R,
|
|
2142
|
+
selectedRows: ce,
|
|
2143
|
+
clearSelected: _e
|
|
2144
|
+
})
|
|
2145
|
+
]),
|
|
2146
|
+
key: "0"
|
|
2147
|
+
} : void 0
|
|
2148
|
+
]), 1032, ["selected-row-keys", "selected-rows"])) : I("", !0),
|
|
2149
|
+
l(Z) && l(P) ? (i(), x(l(Pl), {
|
|
2150
|
+
key: 4,
|
|
2151
|
+
class: k(`${l(n)}-pro-table__error`),
|
|
2152
|
+
type: "error",
|
|
2153
|
+
title: l(Z).message,
|
|
2154
|
+
closable: !1,
|
|
2155
|
+
"show-icon": ""
|
|
2156
|
+
}, null, 8, ["class", "title"])) : I("", !0),
|
|
2157
|
+
l(p).tableTitle ? (i(), C("div", {
|
|
2158
|
+
key: 5,
|
|
2159
|
+
class: k(`${l(n)}-pro-table__search-table`)
|
|
2160
|
+
}, [
|
|
2161
|
+
z(s.$slots, "tableTitle")
|
|
2162
|
+
], 2)) : I("", !0),
|
|
2163
|
+
Na.value ? (i(), C("div", {
|
|
2164
|
+
key: 6,
|
|
2165
|
+
class: k(`${l(n)}-pro-table__mode-bar`)
|
|
2166
|
+
}, [
|
|
2167
|
+
z(s.$slots, "selectModeBefore", {
|
|
2168
|
+
mode: T.value,
|
|
2169
|
+
modes: A.value,
|
|
2170
|
+
dataSource: l(J),
|
|
2171
|
+
action: l(ge)
|
|
2172
|
+
}),
|
|
2173
|
+
je.value ? (i(), C("div", {
|
|
2174
|
+
key: 0,
|
|
2175
|
+
class: k(`${l(n)}-pro-table__mode-selector`),
|
|
2176
|
+
role: "group",
|
|
2177
|
+
"aria-label": "选择数据展示模式"
|
|
2178
|
+
}, [
|
|
2179
|
+
(i(!0), C(X, null, pe(A.value, (R) => (i(), x(l(de), {
|
|
2180
|
+
key: R,
|
|
2181
|
+
class: k(`${l(n)}-pro-table__mode-button`),
|
|
2182
|
+
type: T.value === R ? "primary" : "default",
|
|
2183
|
+
icon: R === "table" ? l(Ie) : l(Nl),
|
|
2184
|
+
plain: "",
|
|
2185
|
+
circle: "",
|
|
2186
|
+
"aria-label": R === "table" ? "表格模式" : "列表模式",
|
|
2187
|
+
"aria-pressed": T.value === R,
|
|
2188
|
+
title: R === "table" ? "表格模式" : "列表模式",
|
|
2189
|
+
onClick: (ce) => Qa(R)
|
|
2190
|
+
}, null, 8, ["class", "type", "icon", "aria-label", "aria-pressed", "title", "onClick"]))), 128))
|
|
2191
|
+
], 2)) : I("", !0),
|
|
2192
|
+
je.value && se.value && !At.value ? (i(), x(l(de), {
|
|
2193
|
+
key: 1,
|
|
2194
|
+
class: k(`${l(n)}-pro-table__search-toggle`),
|
|
2195
|
+
type: "primary",
|
|
2196
|
+
icon: l(Je),
|
|
2197
|
+
plain: "",
|
|
2198
|
+
circle: "",
|
|
2199
|
+
"aria-label": "展开搜索",
|
|
2200
|
+
title: "展开搜索",
|
|
2201
|
+
onClick: E[3] || (E[3] = (R) => se.value = !1)
|
|
2202
|
+
}, null, 8, ["class", "icon"])) : I("", !0),
|
|
2203
|
+
z(s.$slots, "selectModeAfter", {
|
|
2204
|
+
mode: T.value,
|
|
2205
|
+
modes: A.value,
|
|
2206
|
+
dataSource: l(J),
|
|
2207
|
+
action: l(ge)
|
|
2208
|
+
})
|
|
2209
|
+
], 2)) : I("", !0),
|
|
2210
|
+
F("div", {
|
|
2211
|
+
ref_key: "tableWrapRef",
|
|
2212
|
+
ref: v,
|
|
2213
|
+
class: k([`${l(n)}-pro-table__table-wrap`, l(Le)])
|
|
2214
|
+
}, [
|
|
2215
|
+
T.value === "table" ? (i(), x(l(Al), fe({
|
|
2216
|
+
key: 0,
|
|
2217
|
+
ref_key: "tableRef",
|
|
2218
|
+
ref: u
|
|
2219
|
+
}, l(_), {
|
|
2220
|
+
data: l(J),
|
|
2221
|
+
"row-key": _t.value,
|
|
2222
|
+
onSelectionChange: ol,
|
|
2223
|
+
onSortChange: rl
|
|
2224
|
+
}), {
|
|
2225
|
+
empty: $(() => [
|
|
2226
|
+
z(s.$slots, "empty", {}, () => [
|
|
2227
|
+
E[5] || (E[5] = te("暂无数据", -1))
|
|
2228
|
+
])
|
|
2229
|
+
]),
|
|
2230
|
+
default: $(() => [
|
|
2231
|
+
Tt.value ? (i(), x(l(zt), {
|
|
2232
|
+
key: 0,
|
|
2233
|
+
type: "selection",
|
|
2234
|
+
width: "48"
|
|
2235
|
+
})) : I("", !0),
|
|
2236
|
+
(i(!0), C(X, null, pe(Fa.value, (R) => (i(), x(l(zt), fe({
|
|
2237
|
+
key: Ge(R)
|
|
2238
|
+
}, { ref_for: !0 }, R.columnProps, {
|
|
2239
|
+
prop: Ge(R),
|
|
2240
|
+
label: R.title,
|
|
2241
|
+
width: (typeof R.width == "number", R.width),
|
|
2242
|
+
fixed: R.fixed,
|
|
2243
|
+
"show-overflow-tooltip": R.ellipsis === !0,
|
|
2244
|
+
sortable: R.sorter ? "custom" : !1
|
|
2245
|
+
}), {
|
|
2246
|
+
default: $((ce) => [
|
|
2247
|
+
l(p)[Ge(R)] ? z(s.$slots, Ge(R), {
|
|
2248
|
+
key: 0,
|
|
2249
|
+
value: l(He)(ce.row, R.dataIndex),
|
|
2250
|
+
record: ce.row,
|
|
2251
|
+
index: ce.$index
|
|
2252
|
+
}) : (i(), C(X, { key: 1 }, [
|
|
2253
|
+
il(ut(R, ce.row, ce.$index)) ? (i(), x(Oe(ut(R, ce.row, ce.$index)), { key: 0 })) : (i(), C("span", Rn, H(ut(R, ce.row, ce.$index)), 1))
|
|
2254
|
+
], 64))
|
|
2255
|
+
]),
|
|
2256
|
+
_: 2
|
|
2257
|
+
}, 1040, ["prop", "label", "width", "fixed", "show-overflow-tooltip", "sortable"]))), 128))
|
|
2258
|
+
]),
|
|
2259
|
+
_: 3
|
|
2260
|
+
}, 16, ["data", "row-key"])) : (i(), C("div", {
|
|
2261
|
+
key: 1,
|
|
2262
|
+
class: k(`${l(n)}-pro-table__list`),
|
|
2263
|
+
style: Te(Wa.value)
|
|
2264
|
+
}, [
|
|
2265
|
+
l(ia)(l(J)) ? (i(), C("div", {
|
|
2266
|
+
key: 0,
|
|
2267
|
+
class: k(`${l(n)}-pro-table__list-empty`)
|
|
2268
|
+
}, [
|
|
2269
|
+
z(s.$slots, "empty", {}, () => [
|
|
2270
|
+
E[6] || (E[6] = te("暂无数据", -1))
|
|
2271
|
+
])
|
|
2272
|
+
], 2)) : (i(!0), C(X, { key: 1 }, pe(l(J), (R, ce) => (i(), C("div", {
|
|
2273
|
+
key: Xa(R, ce),
|
|
2274
|
+
class: k(`${l(n)}-pro-table__list-item`)
|
|
2275
|
+
}, [
|
|
2276
|
+
z(s.$slots, "itemRender", {
|
|
2277
|
+
item: R,
|
|
2278
|
+
record: R,
|
|
2279
|
+
index: ce,
|
|
2280
|
+
dataSource: l(J),
|
|
2281
|
+
mode: T.value,
|
|
2282
|
+
action: l(ge)
|
|
2283
|
+
})
|
|
2284
|
+
], 2))), 128))
|
|
2285
|
+
], 6)),
|
|
2286
|
+
l(O) || za.value ? (i(), C("div", {
|
|
2287
|
+
key: 2,
|
|
2288
|
+
class: k(`${l(n)}-pro-table__loading`),
|
|
2289
|
+
role: "status"
|
|
2290
|
+
}, [
|
|
2291
|
+
L(l(Ce), { class: "is-loading" }, {
|
|
2292
|
+
default: $(() => [
|
|
2293
|
+
L(l(jl))
|
|
2294
|
+
]),
|
|
2295
|
+
_: 1
|
|
2296
|
+
}),
|
|
2297
|
+
E[7] || (E[7] = F("span", null, "加载中…", -1))
|
|
2298
|
+
], 2)) : I("", !0)
|
|
2299
|
+
], 2),
|
|
2300
|
+
F("div", {
|
|
2301
|
+
class: k(`${l(n)}-pro-table__sticky-footer`)
|
|
2302
|
+
}, [
|
|
2303
|
+
ea(F("div", {
|
|
2304
|
+
ref_key: "stickyScrollRef",
|
|
2305
|
+
ref: Pe,
|
|
2306
|
+
class: k(`${l(n)}-pro-table__sticky-scroll`),
|
|
2307
|
+
onScroll: E[4] || (E[4] = //@ts-ignore
|
|
2308
|
+
(...R) => l(Q) && l(Q)(...R))
|
|
2309
|
+
}, [
|
|
2310
|
+
F("div", {
|
|
2311
|
+
class: k(`${l(n)}-pro-table__sticky-scroll-thumb`),
|
|
2312
|
+
style: Te({ width: `${l(y)}px` })
|
|
2313
|
+
}, null, 6)
|
|
2314
|
+
], 34), [
|
|
2315
|
+
[ta, l(Ve) && l(D)]
|
|
2316
|
+
]),
|
|
2317
|
+
La.value ? (i(), x(ba, {
|
|
2318
|
+
key: 0,
|
|
2319
|
+
page: l(W).current,
|
|
2320
|
+
"page-size": l(W).pageSize,
|
|
2321
|
+
total: l(W).total,
|
|
2322
|
+
pagination: e.pagination,
|
|
2323
|
+
onChange: ll,
|
|
2324
|
+
onPageSizeChange: nl
|
|
2325
|
+
}, null, 8, ["page", "page-size", "total", "pagination"])) : I("", !0)
|
|
2326
|
+
], 2)
|
|
2327
|
+
], 6)
|
|
2328
|
+
]);
|
|
2329
|
+
};
|
|
2330
|
+
}
|
|
2331
|
+
}), An = be(Pn, {
|
|
2332
|
+
ProTablePagination: ba,
|
|
2333
|
+
ProTableSearchForm: Sa,
|
|
2334
|
+
ProTableSelectedFilters: $a,
|
|
2335
|
+
ProTableSelectionActions: Ca,
|
|
2336
|
+
ProTableToolbar: xa
|
|
2337
|
+
}), _n = /* @__PURE__ */ ae({
|
|
2338
|
+
name: "VH100",
|
|
2339
|
+
__name: "index",
|
|
2340
|
+
props: {
|
|
2341
|
+
stype: {},
|
|
2342
|
+
class: {}
|
|
2343
|
+
},
|
|
2344
|
+
setup(e) {
|
|
2345
|
+
const a = e, t = Wl(), { prefix: n } = me();
|
|
2346
|
+
return (o, f) => (i(), C("div", {
|
|
2347
|
+
style: Te({ height: l(t) + "px" }),
|
|
2348
|
+
class: k([`${l(n)}-vh100`, a.class])
|
|
2349
|
+
}, [
|
|
2350
|
+
z(o.$slots, "default")
|
|
2351
|
+
], 6));
|
|
2352
|
+
}
|
|
2353
|
+
}), En = be(_n), Bn = /* @__PURE__ */ ae({
|
|
2354
|
+
name: "ConfigProvider",
|
|
2355
|
+
__name: "index",
|
|
2356
|
+
props: {
|
|
2357
|
+
size: {},
|
|
2358
|
+
prefix: {},
|
|
2359
|
+
iconfont: {}
|
|
2360
|
+
},
|
|
2361
|
+
setup(e) {
|
|
2362
|
+
const a = e, t = lt(mt, void 0);
|
|
2363
|
+
return wt(mt, {
|
|
2364
|
+
size: d(() => a.size ?? (t == null ? void 0 : t.size.value) ?? "default"),
|
|
2365
|
+
prefix: d(() => a.prefix ?? (t == null ? void 0 : t.prefix.value) ?? ca),
|
|
2366
|
+
iconfont: d(() => a.iconfont ?? (t == null ? void 0 : t.iconfont.value))
|
|
2367
|
+
}), (n, o) => z(n.$slots, "default");
|
|
2368
|
+
}
|
|
2369
|
+
}), Vn = be(Bn), In = "wa-ui-iconfont", gt = "data-iconfont-url", ft = /* @__PURE__ */ new Map();
|
|
2370
|
+
let Wt = 0;
|
|
2371
|
+
const Mn = (e) => Array.from(document.querySelectorAll(`script[${gt}]`)).find(
|
|
2372
|
+
(a) => a.getAttribute(gt) === e
|
|
2373
|
+
);
|
|
2374
|
+
function Fn(e) {
|
|
2375
|
+
if (typeof document > "u" || !e) return Promise.resolve();
|
|
2376
|
+
const a = ft.get(e);
|
|
2377
|
+
if (a) return a;
|
|
2378
|
+
if (Mn(e)) return Promise.resolve();
|
|
2379
|
+
const t = new Promise((n, o) => {
|
|
2380
|
+
const f = document.createElement("script");
|
|
2381
|
+
Wt += 1, f.id = `${In}-${Wt}`, f.setAttribute(gt, e), f.src = e, f.async = !0, f.onload = () => n(), f.onerror = () => {
|
|
2382
|
+
ft.delete(e), o(new Error(`[element-pro] 图标集加载失败:${e}`));
|
|
2383
|
+
}, document.head.appendChild(f);
|
|
2384
|
+
});
|
|
2385
|
+
return ft.set(e, t), t;
|
|
2386
|
+
}
|
|
2387
|
+
function On(e) {
|
|
2388
|
+
if (typeof document > "u") return;
|
|
2389
|
+
const a = document.getElementById(e);
|
|
2390
|
+
if (!(!a || a.tagName.toLowerCase() !== "symbol"))
|
|
2391
|
+
return {
|
|
2392
|
+
content: a.innerHTML,
|
|
2393
|
+
viewBox: a.getAttribute("viewBox") ?? void 0
|
|
2394
|
+
};
|
|
2395
|
+
}
|
|
2396
|
+
const Dn = ["viewBox", "aria-hidden", "role", "innerHTML"], Ln = /* @__PURE__ */ ae({
|
|
2397
|
+
name: "SvgIcon",
|
|
2398
|
+
inheritAttrs: !1,
|
|
2399
|
+
__name: "index",
|
|
2400
|
+
props: {
|
|
2401
|
+
name: {},
|
|
2402
|
+
size: { default: "1em" },
|
|
2403
|
+
color: {},
|
|
2404
|
+
src: {}
|
|
2405
|
+
},
|
|
2406
|
+
setup(e) {
|
|
2407
|
+
const a = e, t = aa(), { prefix: n, iconfont: o } = me(), f = q(), p = q(), u = /* @__PURE__ */ new WeakMap(), v = d(() => a.src ?? o.value), r = d(() => a.name.startsWith("icon-") ? a.name : `icon-${a.name}`), h = d(() => typeof a.size == "number" ? `${a.size}px` : a.size), m = d(() => Array.isArray(a.color) ? a.color : a.color ? [a.color] : []), w = d(() => ({
|
|
2408
|
+
width: h.value,
|
|
2409
|
+
height: h.value
|
|
2410
|
+
})), M = d(() => t["aria-label"] === void 0 && t.title === void 0);
|
|
2411
|
+
function P() {
|
|
2412
|
+
var U;
|
|
2413
|
+
const T = (U = f.value) == null ? void 0 : U.querySelectorAll("path, circle, ellipse, polygon, polyline, rect");
|
|
2414
|
+
T && T.forEach((B, J) => {
|
|
2415
|
+
u.has(B) || u.set(B, B.getAttribute("fill"));
|
|
2416
|
+
const O = m.value[Math.min(J, m.value.length - 1)];
|
|
2417
|
+
if (O) {
|
|
2418
|
+
B.setAttribute("fill", O);
|
|
2419
|
+
return;
|
|
2420
|
+
}
|
|
2421
|
+
const Z = u.get(B);
|
|
2422
|
+
Z === null ? B.removeAttribute("fill") : Z !== void 0 && B.setAttribute("fill", Z);
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
async function _() {
|
|
2426
|
+
await Re(), P();
|
|
2427
|
+
}
|
|
2428
|
+
async function S() {
|
|
2429
|
+
p.value = On(r.value), await _();
|
|
2430
|
+
}
|
|
2431
|
+
async function A() {
|
|
2432
|
+
try {
|
|
2433
|
+
v.value && await Fn(v.value);
|
|
2434
|
+
for (let T = 0; T < 20 && !p.value; T += 1)
|
|
2435
|
+
await S(), p.value || await new Promise((U) => window.setTimeout(U, 50));
|
|
2436
|
+
} catch {
|
|
2437
|
+
p.value = void 0;
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
return he([r, v], () => {
|
|
2441
|
+
A();
|
|
2442
|
+
}), he(m, () => {
|
|
2443
|
+
Re(P);
|
|
2444
|
+
}), Ue(() => {
|
|
2445
|
+
A();
|
|
2446
|
+
}), (T, U) => {
|
|
2447
|
+
var B, J;
|
|
2448
|
+
return i(), C("svg", fe({
|
|
2449
|
+
ref_key: "iconRef",
|
|
2450
|
+
ref: f
|
|
2451
|
+
}, T.$attrs, {
|
|
2452
|
+
class: `${l(n)}-svg-icon`,
|
|
2453
|
+
style: w.value,
|
|
2454
|
+
viewBox: (B = p.value) == null ? void 0 : B.viewBox,
|
|
2455
|
+
"aria-hidden": M.value ? "true" : void 0,
|
|
2456
|
+
role: M.value ? void 0 : "img",
|
|
2457
|
+
innerHTML: (J = p.value) == null ? void 0 : J.content
|
|
2458
|
+
}), null, 16, Dn);
|
|
2459
|
+
};
|
|
2460
|
+
}
|
|
2461
|
+
}), zn = /* @__PURE__ */ Ct(Ln, [["__scopeId", "data-v-1b31e6ab"]]), qn = be(zn), Ta = /* @__PURE__ */ ae({
|
|
2462
|
+
name: "MainContent",
|
|
2463
|
+
__name: "index",
|
|
2464
|
+
props: {
|
|
2465
|
+
mode: { default: "classic" },
|
|
2466
|
+
collapse: { type: Boolean, default: !1 },
|
|
2467
|
+
sidebarHide: { type: Boolean, default: !1 },
|
|
2468
|
+
mobile: { type: Boolean, default: !1 },
|
|
2469
|
+
withoutAnimation: { type: Boolean, default: !1 },
|
|
2470
|
+
hasTagsView: { type: Boolean, default: !1 }
|
|
2471
|
+
},
|
|
2472
|
+
setup(e) {
|
|
2473
|
+
const a = e, t = d(() => ({
|
|
2474
|
+
"is-grouped": a.mode === "grouped",
|
|
2475
|
+
"is-collapsed": a.collapse,
|
|
2476
|
+
"is-mobile": a.mobile,
|
|
2477
|
+
"is-sidebar-hidden": a.sidebarHide,
|
|
2478
|
+
"without-animation": a.withoutAnimation,
|
|
2479
|
+
"has-tags-view": a.hasTagsView
|
|
2480
|
+
}));
|
|
2481
|
+
return (n, o) => (i(), C("div", {
|
|
2482
|
+
class: k(["wa-ui-main-content", t.value])
|
|
2483
|
+
}, [
|
|
2484
|
+
z(n.$slots, "default")
|
|
2485
|
+
], 2));
|
|
2486
|
+
}
|
|
2487
|
+
}), Me = /* @__PURE__ */ ae({
|
|
2488
|
+
__name: "SidebarIcon",
|
|
2489
|
+
props: {
|
|
2490
|
+
icon: {},
|
|
2491
|
+
renderIcon: { type: Function }
|
|
2492
|
+
},
|
|
2493
|
+
setup(e) {
|
|
2494
|
+
const a = e, t = { ...Dl };
|
|
2495
|
+
function n(v) {
|
|
2496
|
+
return v.split("-").filter(Boolean).map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join("");
|
|
2497
|
+
}
|
|
2498
|
+
function o(v) {
|
|
2499
|
+
if (Object.prototype.hasOwnProperty.call(t, v)) return v;
|
|
2500
|
+
const r = v.startsWith("el-icon-") ? v.slice(8) : v;
|
|
2501
|
+
if (Object.prototype.hasOwnProperty.call(t, r)) return r;
|
|
2502
|
+
const h = n(r);
|
|
2503
|
+
return Object.prototype.hasOwnProperty.call(t, h) ? h : "";
|
|
2504
|
+
}
|
|
2505
|
+
const f = d(() => a.icon ? o(a.icon) : ""), p = d(
|
|
2506
|
+
() => f.value ? t[f.value] : void 0
|
|
2507
|
+
), u = d(() => {
|
|
2508
|
+
const v = a.icon, r = a.renderIcon;
|
|
2509
|
+
if (!(!v || !r || f.value))
|
|
2510
|
+
return ae({
|
|
2511
|
+
name: "WaSidebarCustomIcon",
|
|
2512
|
+
setup: () => () => r(v)
|
|
2513
|
+
});
|
|
2514
|
+
});
|
|
2515
|
+
return (v, r) => p.value ? (i(), x(l(Ce), {
|
|
2516
|
+
key: 0,
|
|
2517
|
+
class: "wa-ui-sidebar__icon"
|
|
2518
|
+
}, {
|
|
2519
|
+
default: $(() => [
|
|
2520
|
+
(i(), x(Oe(p.value)))
|
|
2521
|
+
]),
|
|
2522
|
+
_: 1
|
|
2523
|
+
})) : u.value ? (i(), x(Oe(u.value), { key: 1 })) : I("", !0);
|
|
2524
|
+
}
|
|
2525
|
+
});
|
|
2526
|
+
function at(e) {
|
|
2527
|
+
return typeof e == "string" && /^(https?:|mailto:|tel:)/.test(e);
|
|
2528
|
+
}
|
|
2529
|
+
function Kt(e) {
|
|
2530
|
+
if (!e) return e;
|
|
2531
|
+
const a = e.replace("//", "/");
|
|
2532
|
+
return a.endsWith("/") ? a.slice(0, -1) : a;
|
|
2533
|
+
}
|
|
2534
|
+
function Nn(e, a) {
|
|
2535
|
+
if (!a) return e || "/";
|
|
2536
|
+
if (at(a)) return a;
|
|
2537
|
+
if (a.startsWith("/")) return Kt(a);
|
|
2538
|
+
const t = e ? e.startsWith("/") ? e : `/${e}` : "";
|
|
2539
|
+
return Kt(`${t}/${a}`);
|
|
2540
|
+
}
|
|
2541
|
+
function jn(e) {
|
|
2542
|
+
if (e)
|
|
2543
|
+
try {
|
|
2544
|
+
const a = JSON.parse(e);
|
|
2545
|
+
return a && typeof a == "object" && !Array.isArray(a) ? a : void 0;
|
|
2546
|
+
} catch {
|
|
2547
|
+
return;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
function Ra(e, a, t) {
|
|
2551
|
+
if (at(a)) return a;
|
|
2552
|
+
if (at(e)) return e;
|
|
2553
|
+
const n = Nn(e, a), o = jn(t);
|
|
2554
|
+
return o ? { path: n, query: o } : n;
|
|
2555
|
+
}
|
|
2556
|
+
function kt(e) {
|
|
2557
|
+
return typeof e == "string" ? e : e.path;
|
|
2558
|
+
}
|
|
2559
|
+
function Hn(e) {
|
|
2560
|
+
const a = [], t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
2561
|
+
return (e || []).forEach((o) => {
|
|
2562
|
+
var u;
|
|
2563
|
+
if (!o || o.hidden) return;
|
|
2564
|
+
const f = o.path == null ? "" : String(o.path), p = ((u = o.meta) == null ? void 0 : u.title) || "";
|
|
2565
|
+
if (f !== "" && f !== "/") {
|
|
2566
|
+
if (t.has(f)) return;
|
|
2567
|
+
t.add(f);
|
|
2568
|
+
}
|
|
2569
|
+
if (p) {
|
|
2570
|
+
if (n.has(p)) return;
|
|
2571
|
+
n.add(p);
|
|
2572
|
+
}
|
|
2573
|
+
a.push(o);
|
|
2574
|
+
}), a;
|
|
2575
|
+
}
|
|
2576
|
+
const Un = ["href"], Ee = /* @__PURE__ */ ae({
|
|
2577
|
+
__name: "SidebarLink",
|
|
2578
|
+
props: {
|
|
2579
|
+
to: {},
|
|
2580
|
+
external: { type: Boolean, default: void 0 },
|
|
2581
|
+
linkComponent: { default: "router-link" }
|
|
2582
|
+
},
|
|
2583
|
+
setup(e) {
|
|
2584
|
+
const a = e, t = d(() => a.external ?? (typeof a.to == "string" && at(a.to))), n = d(() => typeof a.to == "string" ? a.to : a.to.path);
|
|
2585
|
+
return (o, f) => t.value ? (i(), C("a", {
|
|
2586
|
+
key: 0,
|
|
2587
|
+
href: n.value,
|
|
2588
|
+
target: "_blank",
|
|
2589
|
+
rel: "noopener noreferrer"
|
|
2590
|
+
}, [
|
|
2591
|
+
z(o.$slots, "default")
|
|
2592
|
+
], 8, Un)) : (i(), x(Oe(e.linkComponent), {
|
|
2593
|
+
key: 1,
|
|
2594
|
+
to: e.to
|
|
2595
|
+
}, {
|
|
2596
|
+
default: $(() => [
|
|
2597
|
+
z(o.$slots, "default")
|
|
2598
|
+
]),
|
|
2599
|
+
_: 3
|
|
2600
|
+
}, 8, ["to"]));
|
|
2601
|
+
}
|
|
2602
|
+
}), Pa = Symbol("WaSidebarThemeStyle");
|
|
2603
|
+
function Aa() {
|
|
2604
|
+
return lt(Pa, void 0);
|
|
2605
|
+
}
|
|
2606
|
+
const Wn = { class: "wa-ui-sidebar-popper__title" }, Kn = { class: "wa-ui-sidebar__link-grid wa-ui-sidebar__link-grid--popper" }, Yn = ["title"], Gn = ["aria-label"], Qn = { class: "wa-ui-sidebar__group-title" }, Xn = ["aria-expanded"], Zn = { class: "wa-ui-sidebar__group-title" }, Jn = { class: "wa-ui-sidebar__link-grid" }, eo = ["title"], to = { class: "wa-ui-sidebar__group-title" }, ao = /* @__PURE__ */ ae({
|
|
2607
|
+
__name: "SidebarGroup",
|
|
2608
|
+
props: {
|
|
2609
|
+
item: {},
|
|
2610
|
+
activeMenu: {},
|
|
2611
|
+
collapse: { type: Boolean, default: !1 },
|
|
2612
|
+
renderIcon: {},
|
|
2613
|
+
linkComponent: { default: "router-link" }
|
|
2614
|
+
},
|
|
2615
|
+
setup(e) {
|
|
2616
|
+
const a = e, t = q(!0), n = Aa(), o = d(() => {
|
|
2617
|
+
const P = [], _ = /* @__PURE__ */ new Set(), S = (A) => {
|
|
2618
|
+
var U;
|
|
2619
|
+
if (!A || A.hidden || !((U = A.meta) != null && U.title)) return;
|
|
2620
|
+
const T = `${A.path}::${A.meta.title}`;
|
|
2621
|
+
_.has(T) || (_.add(T), P.push(A));
|
|
2622
|
+
};
|
|
2623
|
+
return (a.item.children || []).forEach((A) => {
|
|
2624
|
+
if (!A || A.hidden) return;
|
|
2625
|
+
const T = (A.children || []).filter((U) => {
|
|
2626
|
+
var B;
|
|
2627
|
+
return !U.hidden && ((B = U.meta) == null ? void 0 : B.title);
|
|
2628
|
+
});
|
|
2629
|
+
T.length ? T.forEach(S) : S(A);
|
|
2630
|
+
}), P;
|
|
2631
|
+
}), f = d(() => !a.item.hidden && o.value.length > 0), p = d(() => o.value.length === 1 && !(a.item.alwaysShow ?? !0)), u = d(() => o.value[0]), v = d(() => {
|
|
2632
|
+
var _;
|
|
2633
|
+
const P = p.value ? (_ = u.value) == null ? void 0 : _.meta : a.item.meta;
|
|
2634
|
+
return (P == null ? void 0 : P.title) || "";
|
|
2635
|
+
}), r = d(() => {
|
|
2636
|
+
var _;
|
|
2637
|
+
const P = p.value ? (_ = u.value) == null ? void 0 : _.meta : a.item.meta;
|
|
2638
|
+
return (P == null ? void 0 : P.icon) || "";
|
|
2639
|
+
});
|
|
2640
|
+
function h(P, _) {
|
|
2641
|
+
return Ra(a.item.path, P, _);
|
|
2642
|
+
}
|
|
2643
|
+
function m(P) {
|
|
2644
|
+
return a.activeMenu === kt(h(P.path));
|
|
2645
|
+
}
|
|
2646
|
+
const w = d(() => a.activeMenu === kt(h(a.item.path)));
|
|
2647
|
+
function M() {
|
|
2648
|
+
t.value = !t.value;
|
|
2649
|
+
}
|
|
2650
|
+
return he(
|
|
2651
|
+
() => a.activeMenu,
|
|
2652
|
+
() => {
|
|
2653
|
+
o.value.some((P) => m(P)) && (t.value = !0);
|
|
2654
|
+
},
|
|
2655
|
+
{ immediate: !0 }
|
|
2656
|
+
), (P, _) => f.value ? (i(), C("section", {
|
|
2657
|
+
key: 0,
|
|
2658
|
+
class: k(["wa-ui-sidebar__group", { "is-collapsed": e.collapse, "is-open": t.value }])
|
|
2659
|
+
}, [
|
|
2660
|
+
e.collapse ? (i(), C(X, { key: 0 }, [
|
|
2661
|
+
p.value && u.value ? (i(), x(Ee, {
|
|
2662
|
+
key: 0,
|
|
2663
|
+
class: k(["wa-ui-sidebar__group-trigger", { "is-active": m(u.value) }]),
|
|
2664
|
+
to: h(u.value.path, u.value.query),
|
|
2665
|
+
"link-component": e.linkComponent,
|
|
2666
|
+
"aria-label": v.value
|
|
2667
|
+
}, {
|
|
2668
|
+
default: $(() => [
|
|
2669
|
+
r.value ? (i(), x(Me, {
|
|
2670
|
+
key: 0,
|
|
2671
|
+
icon: r.value,
|
|
2672
|
+
"render-icon": e.renderIcon
|
|
2673
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2674
|
+
default: $(() => [
|
|
2675
|
+
L(l(Ie))
|
|
2676
|
+
]),
|
|
2677
|
+
_: 1
|
|
2678
|
+
}))
|
|
2679
|
+
]),
|
|
2680
|
+
_: 1
|
|
2681
|
+
}, 8, ["class", "to", "link-component", "aria-label"])) : o.value.length ? (i(), x(l(_l), {
|
|
2682
|
+
key: 1,
|
|
2683
|
+
placement: "right-start",
|
|
2684
|
+
trigger: "hover",
|
|
2685
|
+
"popper-class": "wa-ui-sidebar-popper",
|
|
2686
|
+
"popper-style": l(n),
|
|
2687
|
+
"open-delay": 120
|
|
2688
|
+
}, {
|
|
2689
|
+
reference: $(() => [
|
|
2690
|
+
F("button", {
|
|
2691
|
+
type: "button",
|
|
2692
|
+
class: "wa-ui-sidebar__group-trigger",
|
|
2693
|
+
"aria-label": v.value
|
|
2694
|
+
}, [
|
|
2695
|
+
r.value ? (i(), x(Me, {
|
|
2696
|
+
key: 0,
|
|
2697
|
+
icon: r.value,
|
|
2698
|
+
"render-icon": e.renderIcon
|
|
2699
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2700
|
+
default: $(() => [
|
|
2701
|
+
L(l(Ie))
|
|
2702
|
+
]),
|
|
2703
|
+
_: 1
|
|
2704
|
+
}))
|
|
2705
|
+
], 8, Gn)
|
|
2706
|
+
]),
|
|
2707
|
+
default: $(() => [
|
|
2708
|
+
F("div", Wn, H(v.value), 1),
|
|
2709
|
+
F("div", Kn, [
|
|
2710
|
+
(i(!0), C(X, null, pe(o.value, (S) => (i(), x(Ee, {
|
|
2711
|
+
key: S.path,
|
|
2712
|
+
class: k(["wa-ui-sidebar__link", { "is-active": m(S) }]),
|
|
2713
|
+
to: h(S.path, S.query),
|
|
2714
|
+
"link-component": e.linkComponent
|
|
2715
|
+
}, {
|
|
2716
|
+
default: $(() => {
|
|
2717
|
+
var A, T;
|
|
2718
|
+
return [
|
|
2719
|
+
F("span", {
|
|
2720
|
+
title: (A = S.meta) == null ? void 0 : A.title
|
|
2721
|
+
}, H((T = S.meta) == null ? void 0 : T.title), 9, Yn)
|
|
2722
|
+
];
|
|
2723
|
+
}),
|
|
2724
|
+
_: 2
|
|
2725
|
+
}, 1032, ["class", "to", "link-component"]))), 128))
|
|
2726
|
+
])
|
|
2727
|
+
]),
|
|
2728
|
+
_: 1
|
|
2729
|
+
}, 8, ["popper-style"])) : e.item.meta ? (i(), x(Ee, {
|
|
2730
|
+
key: 2,
|
|
2731
|
+
class: k(["wa-ui-sidebar__group-trigger", { "is-active": w.value }]),
|
|
2732
|
+
to: h(e.item.path, e.item.query),
|
|
2733
|
+
"link-component": e.linkComponent,
|
|
2734
|
+
"aria-label": v.value
|
|
2735
|
+
}, {
|
|
2736
|
+
default: $(() => [
|
|
2737
|
+
r.value ? (i(), x(Me, {
|
|
2738
|
+
key: 0,
|
|
2739
|
+
icon: r.value,
|
|
2740
|
+
"render-icon": e.renderIcon
|
|
2741
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2742
|
+
default: $(() => [
|
|
2743
|
+
L(l(Ie))
|
|
2744
|
+
]),
|
|
2745
|
+
_: 1
|
|
2746
|
+
}))
|
|
2747
|
+
]),
|
|
2748
|
+
_: 1
|
|
2749
|
+
}, 8, ["class", "to", "link-component", "aria-label"])) : I("", !0)
|
|
2750
|
+
], 64)) : p.value && u.value ? (i(), x(Ee, {
|
|
2751
|
+
key: 1,
|
|
2752
|
+
class: k(["wa-ui-sidebar__group-header wa-ui-sidebar__group-direct-link", { "is-active": m(u.value) }]),
|
|
2753
|
+
to: h(u.value.path, u.value.query),
|
|
2754
|
+
"link-component": e.linkComponent
|
|
2755
|
+
}, {
|
|
2756
|
+
default: $(() => [
|
|
2757
|
+
F("span", Qn, [
|
|
2758
|
+
r.value ? (i(), x(Me, {
|
|
2759
|
+
key: 0,
|
|
2760
|
+
icon: r.value,
|
|
2761
|
+
"render-icon": e.renderIcon
|
|
2762
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2763
|
+
default: $(() => [
|
|
2764
|
+
L(l(Ie))
|
|
2765
|
+
]),
|
|
2766
|
+
_: 1
|
|
2767
|
+
})),
|
|
2768
|
+
te(" " + H(v.value), 1)
|
|
2769
|
+
])
|
|
2770
|
+
]),
|
|
2771
|
+
_: 1
|
|
2772
|
+
}, 8, ["class", "to", "link-component"])) : o.value.length ? (i(), C(X, { key: 2 }, [
|
|
2773
|
+
F("button", {
|
|
2774
|
+
type: "button",
|
|
2775
|
+
class: "wa-ui-sidebar__group-header",
|
|
2776
|
+
"aria-expanded": t.value,
|
|
2777
|
+
onClick: M
|
|
2778
|
+
}, [
|
|
2779
|
+
F("span", Zn, [
|
|
2780
|
+
r.value ? (i(), x(Me, {
|
|
2781
|
+
key: 0,
|
|
2782
|
+
icon: r.value,
|
|
2783
|
+
"render-icon": e.renderIcon
|
|
2784
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2785
|
+
default: $(() => [
|
|
2786
|
+
L(l(Ie))
|
|
2787
|
+
]),
|
|
2788
|
+
_: 1
|
|
2789
|
+
})),
|
|
2790
|
+
te(" " + H(v.value), 1)
|
|
2791
|
+
]),
|
|
2792
|
+
L(l(Ce), {
|
|
2793
|
+
class: k(["wa-ui-sidebar__group-arrow", { "is-open": t.value }])
|
|
2794
|
+
}, {
|
|
2795
|
+
default: $(() => [
|
|
2796
|
+
L(l(Je))
|
|
2797
|
+
]),
|
|
2798
|
+
_: 1
|
|
2799
|
+
}, 8, ["class"])
|
|
2800
|
+
], 8, Xn),
|
|
2801
|
+
L(la, { name: "wa-ui-sidebar-collapse" }, {
|
|
2802
|
+
default: $(() => [
|
|
2803
|
+
ea(F("div", Jn, [
|
|
2804
|
+
(i(!0), C(X, null, pe(o.value, (S) => (i(), x(Ee, {
|
|
2805
|
+
key: S.path,
|
|
2806
|
+
class: k(["wa-ui-sidebar__link", { "is-active": m(S) }]),
|
|
2807
|
+
to: h(S.path, S.query),
|
|
2808
|
+
"link-component": e.linkComponent
|
|
2809
|
+
}, {
|
|
2810
|
+
default: $(() => {
|
|
2811
|
+
var A, T;
|
|
2812
|
+
return [
|
|
2813
|
+
F("span", {
|
|
2814
|
+
title: (A = S.meta) == null ? void 0 : A.title
|
|
2815
|
+
}, H((T = S.meta) == null ? void 0 : T.title), 9, eo)
|
|
2816
|
+
];
|
|
2817
|
+
}),
|
|
2818
|
+
_: 2
|
|
2819
|
+
}, 1032, ["class", "to", "link-component"]))), 128))
|
|
2820
|
+
], 512), [
|
|
2821
|
+
[ta, t.value]
|
|
2822
|
+
])
|
|
2823
|
+
]),
|
|
2824
|
+
_: 1
|
|
2825
|
+
})
|
|
2826
|
+
], 64)) : e.item.meta ? (i(), x(Ee, {
|
|
2827
|
+
key: 3,
|
|
2828
|
+
class: k(["wa-ui-sidebar__group-header wa-ui-sidebar__group-direct-link", { "is-active": w.value }]),
|
|
2829
|
+
to: h(e.item.path, e.item.query),
|
|
2830
|
+
"link-component": e.linkComponent
|
|
2831
|
+
}, {
|
|
2832
|
+
default: $(() => [
|
|
2833
|
+
F("span", to, [
|
|
2834
|
+
r.value ? (i(), x(Me, {
|
|
2835
|
+
key: 0,
|
|
2836
|
+
icon: r.value,
|
|
2837
|
+
"render-icon": e.renderIcon
|
|
2838
|
+
}, null, 8, ["icon", "render-icon"])) : (i(), x(l(Ce), { key: 1 }, {
|
|
2839
|
+
default: $(() => [
|
|
2840
|
+
L(l(Ie))
|
|
2841
|
+
]),
|
|
2842
|
+
_: 1
|
|
2843
|
+
})),
|
|
2844
|
+
te(" " + H(v.value), 1)
|
|
2845
|
+
])
|
|
2846
|
+
]),
|
|
2847
|
+
_: 1
|
|
2848
|
+
}, 8, ["class", "to", "link-component"])) : I("", !0)
|
|
2849
|
+
], 2)) : I("", !0);
|
|
2850
|
+
}
|
|
2851
|
+
}), lo = ["title"], Yt = /* @__PURE__ */ ae({
|
|
2852
|
+
__name: "SidebarItemContent",
|
|
2853
|
+
props: {
|
|
2854
|
+
icon: {},
|
|
2855
|
+
title: {},
|
|
2856
|
+
renderIcon: { type: Function }
|
|
2857
|
+
},
|
|
2858
|
+
setup(e) {
|
|
2859
|
+
return (a, t) => (i(), C(X, null, [
|
|
2860
|
+
L(Me, {
|
|
2861
|
+
icon: e.icon,
|
|
2862
|
+
"render-icon": e.renderIcon
|
|
2863
|
+
}, null, 8, ["icon", "render-icon"]),
|
|
2864
|
+
e.title ? (i(), C("span", {
|
|
2865
|
+
key: 0,
|
|
2866
|
+
class: "wa-ui-sidebar__item-title",
|
|
2867
|
+
title: e.title
|
|
2868
|
+
}, H(e.title), 9, lo)) : I("", !0)
|
|
2869
|
+
], 64));
|
|
2870
|
+
}
|
|
2871
|
+
}), no = { key: 0 }, _a = /* @__PURE__ */ ae({
|
|
2872
|
+
name: "WaSidebarItem",
|
|
2873
|
+
__name: "SidebarItem",
|
|
2874
|
+
props: {
|
|
2875
|
+
item: {},
|
|
2876
|
+
isNest: { type: Boolean, default: !1 },
|
|
2877
|
+
basePath: { default: "" },
|
|
2878
|
+
renderIcon: {},
|
|
2879
|
+
linkComponent: { default: "router-link" }
|
|
2880
|
+
},
|
|
2881
|
+
setup(e) {
|
|
2882
|
+
const a = e, t = Aa(), n = d(() => (a.item.children || []).filter((v) => !v.hidden)), o = d(() => {
|
|
2883
|
+
const v = n.value;
|
|
2884
|
+
if (v.length === 1) return v[0];
|
|
2885
|
+
if (v.length === 0) return { ...a.item, path: "", noShowingChildren: !0 };
|
|
2886
|
+
}), f = d(() => {
|
|
2887
|
+
var r;
|
|
2888
|
+
if (a.item.alwaysShow ?? !0) return !1;
|
|
2889
|
+
const v = n.value;
|
|
2890
|
+
return v.length === 0 ? !0 : v.length === 1 && !((r = v[0].children) != null && r.length);
|
|
2891
|
+
});
|
|
2892
|
+
function p(v, r) {
|
|
2893
|
+
return Ra(a.basePath, v, r);
|
|
2894
|
+
}
|
|
2895
|
+
function u(v) {
|
|
2896
|
+
return kt(p(v));
|
|
2897
|
+
}
|
|
2898
|
+
return (v, r) => {
|
|
2899
|
+
const h = Jt("SidebarItem", !0);
|
|
2900
|
+
return e.item.hidden ? I("", !0) : (i(), C("div", no, [
|
|
2901
|
+
f.value && o.value ? (i(), C(X, { key: 0 }, [
|
|
2902
|
+
o.value.meta ? (i(), x(Ee, {
|
|
2903
|
+
key: 0,
|
|
2904
|
+
to: p(o.value.path, o.value.query),
|
|
2905
|
+
"link-component": e.linkComponent
|
|
2906
|
+
}, {
|
|
2907
|
+
default: $(() => [
|
|
2908
|
+
L(l(El), {
|
|
2909
|
+
index: u(o.value.path),
|
|
2910
|
+
class: k({ "wa-ui-sidebar__item--leaf": !e.isNest })
|
|
2911
|
+
}, {
|
|
2912
|
+
default: $(() => {
|
|
2913
|
+
var m;
|
|
2914
|
+
return [
|
|
2915
|
+
L(Yt, {
|
|
2916
|
+
icon: o.value.meta.icon || ((m = e.item.meta) == null ? void 0 : m.icon),
|
|
2917
|
+
title: o.value.meta.title,
|
|
2918
|
+
"render-icon": e.renderIcon
|
|
2919
|
+
}, null, 8, ["icon", "title", "render-icon"])
|
|
2920
|
+
];
|
|
2921
|
+
}),
|
|
2922
|
+
_: 1
|
|
2923
|
+
}, 8, ["index", "class"])
|
|
2924
|
+
]),
|
|
2925
|
+
_: 1
|
|
2926
|
+
}, 8, ["to", "link-component"])) : I("", !0)
|
|
2927
|
+
], 64)) : (i(), x(l(Bl), {
|
|
2928
|
+
key: 1,
|
|
2929
|
+
index: u(e.item.path),
|
|
2930
|
+
"popper-class": "wa-ui-sidebar-submenu-popper",
|
|
2931
|
+
"popper-style": l(t)
|
|
2932
|
+
}, {
|
|
2933
|
+
title: $(() => [
|
|
2934
|
+
e.item.meta ? (i(), x(Yt, {
|
|
2935
|
+
key: 0,
|
|
2936
|
+
icon: e.item.meta.icon,
|
|
2937
|
+
title: e.item.meta.title,
|
|
2938
|
+
"render-icon": e.renderIcon
|
|
2939
|
+
}, null, 8, ["icon", "title", "render-icon"])) : I("", !0)
|
|
2940
|
+
]),
|
|
2941
|
+
default: $(() => [
|
|
2942
|
+
(i(!0), C(X, null, pe(e.item.children, (m, w) => (i(), x(h, {
|
|
2943
|
+
key: `${m.path}-${w}`,
|
|
2944
|
+
"is-nest": "",
|
|
2945
|
+
item: m,
|
|
2946
|
+
"base-path": u(m.path),
|
|
2947
|
+
"render-icon": e.renderIcon,
|
|
2948
|
+
"link-component": e.linkComponent,
|
|
2949
|
+
class: "wa-ui-sidebar__nest-item"
|
|
2950
|
+
}, null, 8, ["item", "base-path", "render-icon", "link-component"]))), 128))
|
|
2951
|
+
]),
|
|
2952
|
+
_: 1
|
|
2953
|
+
}, 8, ["index", "popper-style"]))
|
|
2954
|
+
]));
|
|
2955
|
+
};
|
|
2956
|
+
}
|
|
2957
|
+
}), oo = ["src", "alt"], ro = {
|
|
2958
|
+
key: 1,
|
|
2959
|
+
class: "wa-ui-sidebar__logo-title"
|
|
2960
|
+
}, io = {
|
|
2961
|
+
key: 2,
|
|
2962
|
+
class: "wa-ui-sidebar__brand"
|
|
2963
|
+
}, so = {
|
|
2964
|
+
key: 0,
|
|
2965
|
+
class: "wa-ui-sidebar__brand-name"
|
|
2966
|
+
}, uo = {
|
|
2967
|
+
key: 1,
|
|
2968
|
+
class: "wa-ui-sidebar__brand-divider",
|
|
2969
|
+
"aria-hidden": "true"
|
|
2970
|
+
}, Ea = /* @__PURE__ */ ae({
|
|
2971
|
+
__name: "SidebarLogo",
|
|
2972
|
+
props: {
|
|
2973
|
+
collapse: { type: Boolean, default: !1 },
|
|
2974
|
+
grouped: { type: Boolean, default: !1 },
|
|
2975
|
+
logo: { default: "" },
|
|
2976
|
+
title: { default: "" },
|
|
2977
|
+
subtitle: { default: "" },
|
|
2978
|
+
portal: { default: "merchant" },
|
|
2979
|
+
to: { default: "/index" },
|
|
2980
|
+
linkComponent: { default: "router-link" }
|
|
2981
|
+
},
|
|
2982
|
+
setup(e) {
|
|
2983
|
+
const a = e, t = d(
|
|
2984
|
+
() => a.portal === "platform" ? "wa-ui-sidebar__brand-portal--platform" : "wa-ui-sidebar__brand-portal--merchant"
|
|
2985
|
+
), n = d(() => !a.collapse && !!(a.title || a.subtitle));
|
|
2986
|
+
return (o, f) => (i(), C("div", {
|
|
2987
|
+
class: k(["wa-ui-sidebar__logo", { "is-collapsed": e.collapse, "is-grouped": e.grouped }])
|
|
2988
|
+
}, [
|
|
2989
|
+
L(Ee, {
|
|
2990
|
+
class: "wa-ui-sidebar__logo-link",
|
|
2991
|
+
to: e.to,
|
|
2992
|
+
"link-component": e.linkComponent
|
|
2993
|
+
}, {
|
|
2994
|
+
default: $(() => [
|
|
2995
|
+
e.logo ? (i(), C("img", {
|
|
2996
|
+
key: 0,
|
|
2997
|
+
src: e.logo,
|
|
2998
|
+
alt: e.title,
|
|
2999
|
+
class: "wa-ui-sidebar__logo-img"
|
|
3000
|
+
}, null, 8, oo)) : e.collapse && e.title ? (i(), C("h1", ro, H(e.title), 1)) : I("", !0),
|
|
3001
|
+
n.value ? (i(), C("span", io, [
|
|
3002
|
+
e.title ? (i(), C("strong", so, H(e.title), 1)) : I("", !0),
|
|
3003
|
+
e.title && e.subtitle ? (i(), C("i", uo)) : I("", !0),
|
|
3004
|
+
e.subtitle ? (i(), C("small", {
|
|
3005
|
+
key: 2,
|
|
3006
|
+
class: k(["wa-ui-sidebar__brand-portal", t.value])
|
|
3007
|
+
}, [
|
|
3008
|
+
F("span", null, H(e.subtitle), 1)
|
|
3009
|
+
], 2)) : I("", !0)
|
|
3010
|
+
])) : I("", !0)
|
|
3011
|
+
]),
|
|
3012
|
+
_: 1
|
|
3013
|
+
}, 8, ["to", "link-component"])
|
|
3014
|
+
], 2));
|
|
3015
|
+
}
|
|
3016
|
+
}), co = [
|
|
3017
|
+
".wa-ui-sidebar__link.is-active",
|
|
3018
|
+
".wa-ui-sidebar__group-direct-link.is-active",
|
|
3019
|
+
".wa-ui-sidebar__group-trigger.is-active",
|
|
3020
|
+
".el-menu-item.is-active"
|
|
3021
|
+
].join(", "), fo = 180, Gt = 12;
|
|
3022
|
+
function vo(e) {
|
|
3023
|
+
const a = l(e == null ? void 0 : e.wrapRef);
|
|
3024
|
+
return a instanceof HTMLElement ? a : void 0;
|
|
3025
|
+
}
|
|
3026
|
+
function po(e) {
|
|
3027
|
+
const { scrollbarRef: a, activeMenu: t, menuCount: n, collapse: o } = e;
|
|
3028
|
+
let f = 0;
|
|
3029
|
+
function p(r, h) {
|
|
3030
|
+
const m = r.getBoundingClientRect(), w = h.getBoundingClientRect();
|
|
3031
|
+
if (w.top >= m.top + Gt && w.bottom <= m.bottom - Gt) return;
|
|
3032
|
+
const P = r.scrollTop, S = w.top - m.top + P - (r.clientHeight - w.height) / 2, A = Math.max(0, r.scrollHeight - r.clientHeight);
|
|
3033
|
+
r.scrollTop = Math.min(A, Math.max(0, S));
|
|
3034
|
+
}
|
|
3035
|
+
function u() {
|
|
3036
|
+
const r = vo(a.value);
|
|
3037
|
+
if (!r) return;
|
|
3038
|
+
const h = r.querySelector(co);
|
|
3039
|
+
h && p(r, h);
|
|
3040
|
+
}
|
|
3041
|
+
function v() {
|
|
3042
|
+
window.clearTimeout(f), Re(() => {
|
|
3043
|
+
u(), f = window.setTimeout(u, fo);
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
return he([t, n, o], v, { flush: "post" }), Ue(v), De(() => {
|
|
3047
|
+
window.clearTimeout(f);
|
|
3048
|
+
}), { alignActiveMenu: u };
|
|
3049
|
+
}
|
|
3050
|
+
const ho = "var(--wa-ui-sidebar-active-color)", Ba = /* @__PURE__ */ ae({
|
|
3051
|
+
name: "Sidebar",
|
|
3052
|
+
__name: "index",
|
|
3053
|
+
props: {
|
|
3054
|
+
menus: { default: () => [] },
|
|
3055
|
+
activeMenu: { default: "" },
|
|
3056
|
+
collapse: { type: Boolean, default: !1 },
|
|
3057
|
+
mode: { default: "classic" },
|
|
3058
|
+
theme: { default: "dark" },
|
|
3059
|
+
variables: {},
|
|
3060
|
+
showLogo: { type: Boolean, default: !0 },
|
|
3061
|
+
logo: { default: "" },
|
|
3062
|
+
title: { default: "" },
|
|
3063
|
+
subtitle: { default: "" },
|
|
3064
|
+
portal: { default: "merchant" },
|
|
3065
|
+
logoTo: { default: "/index" },
|
|
3066
|
+
linkComponent: { default: "router-link" },
|
|
3067
|
+
renderIcon: {}
|
|
3068
|
+
},
|
|
3069
|
+
setup(e) {
|
|
3070
|
+
const a = e, t = {
|
|
3071
|
+
menuColor: "--wa-ui-sidebar-menu-color",
|
|
3072
|
+
menuLightColor: "--wa-ui-sidebar-menu-light-color",
|
|
3073
|
+
menuColorActive: "--wa-ui-sidebar-menu-color-active",
|
|
3074
|
+
menuBackground: "--wa-ui-sidebar-menu-background",
|
|
3075
|
+
menuLightBackground: "--wa-ui-sidebar-menu-light-background",
|
|
3076
|
+
subMenuBackground: "--wa-ui-sidebar-sub-menu-background",
|
|
3077
|
+
subMenuHover: "--wa-ui-sidebar-sub-menu-hover",
|
|
3078
|
+
logoTitleColor: "--wa-ui-sidebar-logo-title-color",
|
|
3079
|
+
logoLightTitleColor: "--wa-ui-sidebar-logo-light-title-color",
|
|
3080
|
+
activeColor: "--wa-ui-sidebar-active-color",
|
|
3081
|
+
activeColorLight: "--wa-ui-sidebar-active-color-light",
|
|
3082
|
+
activeColorDarkBg: "--wa-ui-sidebar-active-color-dark-bg",
|
|
3083
|
+
width: "--wa-ui-sidebar-width",
|
|
3084
|
+
groupedWidth: "--wa-ui-sidebar-grouped-width",
|
|
3085
|
+
collapsedWidth: "--wa-ui-sidebar-collapsed-width"
|
|
3086
|
+
}, n = q(), o = d(() => Hn(a.menus)), f = d(() => o.value.length), p = d(() => a.collapse), u = d(() => a.mode === "grouped"), v = d(() => u.value ? "light" : a.theme), r = d(
|
|
3087
|
+
() => v.value === "dark" ? "var(--wa-ui-sidebar-menu-background)" : "var(--wa-ui-sidebar-menu-light-background)"
|
|
3088
|
+
), h = d(
|
|
3089
|
+
() => v.value === "dark" ? "var(--wa-ui-sidebar-menu-color)" : "var(--wa-ui-sidebar-menu-light-color)"
|
|
3090
|
+
), m = d(() => [
|
|
3091
|
+
`theme-${v.value}`,
|
|
3092
|
+
{
|
|
3093
|
+
"has-logo": a.showLogo,
|
|
3094
|
+
"is-grouped": u.value,
|
|
3095
|
+
"is-collapsed": p.value
|
|
3096
|
+
}
|
|
3097
|
+
]), w = d(() => {
|
|
3098
|
+
const M = a.variables, P = {};
|
|
3099
|
+
if (!M) return P;
|
|
3100
|
+
for (const [_, S] of Object.entries(t)) {
|
|
3101
|
+
const A = M[_];
|
|
3102
|
+
A && (P[S] = A);
|
|
3103
|
+
}
|
|
3104
|
+
return P;
|
|
3105
|
+
});
|
|
3106
|
+
return wt(Pa, w), po({
|
|
3107
|
+
scrollbarRef: n,
|
|
3108
|
+
activeMenu: d(() => a.activeMenu),
|
|
3109
|
+
menuCount: f,
|
|
3110
|
+
collapse: p
|
|
3111
|
+
}), (M, P) => (i(), C("div", {
|
|
3112
|
+
class: k(["wa-ui-sidebar", m.value]),
|
|
3113
|
+
style: Te(w.value)
|
|
3114
|
+
}, [
|
|
3115
|
+
e.showLogo ? z(M.$slots, "logo", {
|
|
3116
|
+
key: 0,
|
|
3117
|
+
collapse: p.value,
|
|
3118
|
+
grouped: u.value
|
|
3119
|
+
}, () => [
|
|
3120
|
+
L(Ea, {
|
|
3121
|
+
collapse: p.value,
|
|
3122
|
+
grouped: u.value,
|
|
3123
|
+
logo: e.logo,
|
|
3124
|
+
title: e.title,
|
|
3125
|
+
subtitle: e.subtitle,
|
|
3126
|
+
portal: e.portal,
|
|
3127
|
+
to: e.logoTo,
|
|
3128
|
+
"link-component": e.linkComponent
|
|
3129
|
+
}, null, 8, ["collapse", "grouped", "logo", "title", "subtitle", "portal", "to", "link-component"])
|
|
3130
|
+
]) : I("", !0),
|
|
3131
|
+
L(l(Vl), {
|
|
3132
|
+
ref_key: "scrollbarRef",
|
|
3133
|
+
ref: n,
|
|
3134
|
+
class: "wa-ui-sidebar__scroll",
|
|
3135
|
+
"wrap-class": "wa-ui-sidebar__scroll-wrap"
|
|
3136
|
+
}, {
|
|
3137
|
+
default: $(() => [
|
|
3138
|
+
u.value ? (i(), C("nav", {
|
|
3139
|
+
key: 0,
|
|
3140
|
+
class: k(["wa-ui-sidebar__nav", { "is-collapsed": p.value }])
|
|
3141
|
+
}, [
|
|
3142
|
+
(i(!0), C(X, null, pe(o.value, (_, S) => (i(), x(ao, {
|
|
3143
|
+
key: `${_.path}-${S}`,
|
|
3144
|
+
item: _,
|
|
3145
|
+
"active-menu": e.activeMenu,
|
|
3146
|
+
collapse: p.value,
|
|
3147
|
+
"render-icon": e.renderIcon,
|
|
3148
|
+
"link-component": e.linkComponent
|
|
3149
|
+
}, null, 8, ["item", "active-menu", "collapse", "render-icon", "link-component"]))), 128))
|
|
3150
|
+
], 2)) : (i(), x(l(Il), {
|
|
3151
|
+
key: 1,
|
|
3152
|
+
class: "wa-ui-sidebar__menu",
|
|
3153
|
+
"default-active": e.activeMenu,
|
|
3154
|
+
collapse: p.value,
|
|
3155
|
+
"background-color": r.value,
|
|
3156
|
+
"text-color": h.value,
|
|
3157
|
+
"active-text-color": ho,
|
|
3158
|
+
"unique-opened": "",
|
|
3159
|
+
"collapse-transition": !1,
|
|
3160
|
+
mode: "vertical"
|
|
3161
|
+
}, {
|
|
3162
|
+
default: $(() => [
|
|
3163
|
+
(i(!0), C(X, null, pe(o.value, (_, S) => (i(), x(_a, {
|
|
3164
|
+
key: `${_.path}-${S}`,
|
|
3165
|
+
item: _,
|
|
3166
|
+
"base-path": _.path,
|
|
3167
|
+
"render-icon": e.renderIcon,
|
|
3168
|
+
"link-component": e.linkComponent
|
|
3169
|
+
}, null, 8, ["item", "base-path", "render-icon", "link-component"]))), 128))
|
|
3170
|
+
]),
|
|
3171
|
+
_: 1
|
|
3172
|
+
}, 8, ["default-active", "collapse", "background-color", "text-color"]))
|
|
3173
|
+
]),
|
|
3174
|
+
_: 1
|
|
3175
|
+
}, 512)
|
|
3176
|
+
], 6));
|
|
3177
|
+
}
|
|
3178
|
+
}), mo = /* @__PURE__ */ ae({
|
|
3179
|
+
name: "SidebarTrigger",
|
|
3180
|
+
__name: "SidebarTrigger",
|
|
3181
|
+
props: {
|
|
3182
|
+
collapse: { type: Boolean }
|
|
3183
|
+
},
|
|
3184
|
+
emits: ["click"],
|
|
3185
|
+
setup(e) {
|
|
3186
|
+
return (a, t) => (i(), C("button", {
|
|
3187
|
+
class: k(["wa-ui-layout__trigger", { "is-active": !e.collapse }]),
|
|
3188
|
+
type: "button",
|
|
3189
|
+
onClick: t[0] || (t[0] = (n) => a.$emit("click"))
|
|
3190
|
+
}, [...t[1] || (t[1] = [
|
|
3191
|
+
F("svg", {
|
|
3192
|
+
viewBox: "0 0 1024 1024",
|
|
3193
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3194
|
+
"aria-hidden": "true"
|
|
3195
|
+
}, [
|
|
3196
|
+
F("path", { d: "M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" })
|
|
3197
|
+
], -1)
|
|
3198
|
+
])], 2));
|
|
3199
|
+
}
|
|
3200
|
+
}), bo = {
|
|
3201
|
+
key: 1,
|
|
3202
|
+
class: "wa-ui-layout__main"
|
|
3203
|
+
}, yo = /* @__PURE__ */ ae({
|
|
3204
|
+
name: "Layout",
|
|
3205
|
+
__name: "index",
|
|
3206
|
+
props: {
|
|
3207
|
+
sidebar: { default: void 0 },
|
|
3208
|
+
header: { default: void 0 },
|
|
3209
|
+
sidebarHidden: { type: Boolean, default: !1 },
|
|
3210
|
+
trigger: { type: Boolean, default: !0 },
|
|
3211
|
+
mobile: { type: Boolean, default: !1 },
|
|
3212
|
+
withoutAnimation: { type: Boolean, default: !1 },
|
|
3213
|
+
hasTagsView: { type: Boolean, default: !1 }
|
|
3214
|
+
},
|
|
3215
|
+
emits: ["toggleSidebar"],
|
|
3216
|
+
setup(e, { emit: a }) {
|
|
3217
|
+
const t = e, n = a, o = d(() => t.sidebar ?? {}), f = d(() => {
|
|
3218
|
+
var r;
|
|
3219
|
+
return ((r = t.sidebar) == null ? void 0 : r.mode) ?? "classic";
|
|
3220
|
+
}), p = d(() => {
|
|
3221
|
+
var r;
|
|
3222
|
+
return !!((r = t.sidebar) != null && r.collapse);
|
|
3223
|
+
}), u = d(() => {
|
|
3224
|
+
var r;
|
|
3225
|
+
return !!((r = t.header) != null && r.fixed);
|
|
3226
|
+
}), v = d(() => ({
|
|
3227
|
+
"is-grouped": f.value === "grouped",
|
|
3228
|
+
"is-collapsed": p.value,
|
|
3229
|
+
"is-mobile": t.mobile,
|
|
3230
|
+
"is-sidebar-hidden": t.sidebarHidden,
|
|
3231
|
+
"without-animation": t.withoutAnimation
|
|
3232
|
+
}));
|
|
3233
|
+
return (r, h) => (i(), C("div", {
|
|
3234
|
+
class: k(["wa-ui-layout", v.value])
|
|
3235
|
+
}, [
|
|
3236
|
+
e.sidebarHidden ? I("", !0) : (i(), x(Ba, fe({
|
|
3237
|
+
key: 0,
|
|
3238
|
+
class: "wa-ui-layout__sidebar"
|
|
3239
|
+
}, o.value), Fe({ _: 2 }, [
|
|
3240
|
+
r.$slots.logo ? {
|
|
3241
|
+
name: "logo",
|
|
3242
|
+
fn: $((m) => [
|
|
3243
|
+
z(r.$slots, "logo", nt(ot(m)))
|
|
3244
|
+
]),
|
|
3245
|
+
key: "0"
|
|
3246
|
+
} : void 0
|
|
3247
|
+
]), 1040)),
|
|
3248
|
+
L(Ta, {
|
|
3249
|
+
class: "wa-ui-layout__content",
|
|
3250
|
+
mode: f.value,
|
|
3251
|
+
collapse: p.value,
|
|
3252
|
+
"sidebar-hide": e.sidebarHidden,
|
|
3253
|
+
mobile: e.mobile,
|
|
3254
|
+
"without-animation": e.withoutAnimation,
|
|
3255
|
+
"has-tags-view": e.hasTagsView
|
|
3256
|
+
}, {
|
|
3257
|
+
default: $(() => [
|
|
3258
|
+
z(r.$slots, "trigger", {}, () => [
|
|
3259
|
+
e.trigger && !e.sidebarHidden ? (i(), x(mo, {
|
|
3260
|
+
key: 0,
|
|
3261
|
+
collapse: p.value,
|
|
3262
|
+
onClick: h[0] || (h[0] = (m) => n("toggleSidebar"))
|
|
3263
|
+
}, null, 8, ["collapse"])) : I("", !0)
|
|
3264
|
+
]),
|
|
3265
|
+
r.$slots.header ? (i(), C("div", {
|
|
3266
|
+
key: 0,
|
|
3267
|
+
class: k(["wa-ui-layout__header", { "is-fixed": u.value }])
|
|
3268
|
+
}, [
|
|
3269
|
+
z(r.$slots, "header")
|
|
3270
|
+
], 2)) : I("", !0),
|
|
3271
|
+
r.$slots.main ? (i(), C("section", bo, [
|
|
3272
|
+
z(r.$slots, "main")
|
|
3273
|
+
])) : I("", !0)
|
|
3274
|
+
]),
|
|
3275
|
+
_: 3
|
|
3276
|
+
}, 8, ["mode", "collapse", "sidebar-hide", "mobile", "without-animation", "has-tags-view"]),
|
|
3277
|
+
z(r.$slots, "default")
|
|
3278
|
+
], 2));
|
|
3279
|
+
}
|
|
3280
|
+
}), go = be(yo), ko = be(Ta), vt = /\*\*(.+?)\*\*/g;
|
|
3281
|
+
function wo(e) {
|
|
3282
|
+
const a = [];
|
|
3283
|
+
let t = 0;
|
|
3284
|
+
vt.lastIndex = 0;
|
|
3285
|
+
let n = vt.exec(e);
|
|
3286
|
+
for (; n; ) {
|
|
3287
|
+
const o = n.index;
|
|
3288
|
+
o > t && a.push({ text: e.slice(t, o), bold: !1 }), a.push({ text: n[1], bold: !0 }), t = o + n[0].length, n = vt.exec(e);
|
|
3289
|
+
}
|
|
3290
|
+
return t < e.length && a.push({ text: e.slice(t), bold: !1 }), a.length ? a : [{ text: e, bold: !1 }];
|
|
3291
|
+
}
|
|
3292
|
+
const So = { key: 0 }, $o = /* @__PURE__ */ ae({
|
|
3293
|
+
name: "ShareButton",
|
|
3294
|
+
inheritAttrs: !1,
|
|
3295
|
+
__name: "index",
|
|
3296
|
+
props: {
|
|
3297
|
+
link: {},
|
|
3298
|
+
text: { default: "分享" },
|
|
3299
|
+
disabled: { type: Boolean, default: !1 },
|
|
3300
|
+
forceGuide: { type: Boolean, default: !1 },
|
|
3301
|
+
guideTitle: { default: "微信内无法直接唤起 App" },
|
|
3302
|
+
showArrow: { type: Boolean, default: !0 },
|
|
3303
|
+
guideSteps: { default: () => ["点右上角 **···**", "选择 **在浏览器中打开**", "在 **Safari/Chrome** 中即可正常拉起"] },
|
|
3304
|
+
actionText: { default: "复制链接,到浏览器打开" }
|
|
3305
|
+
},
|
|
3306
|
+
emits: ["share", "copy"],
|
|
3307
|
+
setup(e, { emit: a }) {
|
|
3308
|
+
const t = e, n = a, { prefix: o } = me(), f = d(() => `${o.value}-share-button`), p = q(!1), u = q(null);
|
|
3309
|
+
let v = "";
|
|
3310
|
+
const r = () => t.forceGuide || Fl.isWeixin(), h = d(() => u.value === !0 ? "已复制,请到浏览器打开" : u.value === !1 ? "复制失败,请手动复制地址栏链接" : "");
|
|
3311
|
+
function m() {
|
|
3312
|
+
typeof document > "u" || (v = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
3313
|
+
}
|
|
3314
|
+
function w() {
|
|
3315
|
+
typeof document > "u" || (document.body.style.overflow = v);
|
|
3316
|
+
}
|
|
3317
|
+
function M() {
|
|
3318
|
+
try {
|
|
3319
|
+
u.value = !!Ol(t.link);
|
|
3320
|
+
} catch {
|
|
3321
|
+
u.value = !1;
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
function P() {
|
|
3325
|
+
p.value = !0, m(), M();
|
|
3326
|
+
}
|
|
3327
|
+
function _() {
|
|
3328
|
+
p.value = !1, u.value = null, w();
|
|
3329
|
+
}
|
|
3330
|
+
function S() {
|
|
3331
|
+
if (!t.disabled) {
|
|
3332
|
+
if (n("share", t.link), r()) {
|
|
3333
|
+
P();
|
|
3334
|
+
return;
|
|
3335
|
+
}
|
|
3336
|
+
window.location.href = t.link;
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
function A() {
|
|
3340
|
+
M(), u.value && n("copy", t.link);
|
|
3341
|
+
}
|
|
3342
|
+
return De(() => {
|
|
3343
|
+
w();
|
|
3344
|
+
}), (T, U) => (i(), C(X, null, [
|
|
3345
|
+
L(l(de), fe(T.$attrs, {
|
|
3346
|
+
class: f.value,
|
|
3347
|
+
disabled: e.disabled,
|
|
3348
|
+
onClick: S
|
|
3349
|
+
}), {
|
|
3350
|
+
default: $(() => [
|
|
3351
|
+
z(T.$slots, "default", {}, () => [
|
|
3352
|
+
te(H(e.text), 1)
|
|
3353
|
+
])
|
|
3354
|
+
]),
|
|
3355
|
+
_: 3
|
|
3356
|
+
}, 16, ["class", "disabled"]),
|
|
3357
|
+
(i(), x(ul, { to: "body" }, [
|
|
3358
|
+
L(la, {
|
|
3359
|
+
name: `${f.value}-fade`
|
|
3360
|
+
}, {
|
|
3361
|
+
default: $(() => [
|
|
3362
|
+
p.value ? (i(), C("div", {
|
|
3363
|
+
key: 0,
|
|
3364
|
+
class: k(`${f.value}__mask`),
|
|
3365
|
+
onClick: _
|
|
3366
|
+
}, [
|
|
3367
|
+
e.showArrow ? (i(), C("span", {
|
|
3368
|
+
key: 0,
|
|
3369
|
+
class: k(`${f.value}__arrow`),
|
|
3370
|
+
"aria-hidden": "true"
|
|
3371
|
+
}, [...U[0] || (U[0] = [
|
|
3372
|
+
F("svg", { viewBox: "0 0 40 40" }, [
|
|
3373
|
+
F("path", { d: "M8 32 30 10" }),
|
|
3374
|
+
F("path", { d: "M19 10h11v11" })
|
|
3375
|
+
], -1)
|
|
3376
|
+
])], 2)) : I("", !0),
|
|
3377
|
+
F("div", {
|
|
3378
|
+
class: k(`${f.value}__content`)
|
|
3379
|
+
}, [
|
|
3380
|
+
F("div", {
|
|
3381
|
+
class: k(`${f.value}__title`)
|
|
3382
|
+
}, H(e.guideTitle), 3),
|
|
3383
|
+
F("ol", {
|
|
3384
|
+
class: k(`${f.value}__steps`)
|
|
3385
|
+
}, [
|
|
3386
|
+
(i(!0), C(X, null, pe(e.guideSteps, (B, J) => (i(), C("li", {
|
|
3387
|
+
key: J,
|
|
3388
|
+
class: k(`${f.value}__step`)
|
|
3389
|
+
}, [
|
|
3390
|
+
(i(!0), C(X, null, pe(l(wo)(B), (O, Z) => (i(), C(X, { key: Z }, [
|
|
3391
|
+
O.bold ? (i(), C("strong", So, H(O.text), 1)) : (i(), C(X, { key: 1 }, [
|
|
3392
|
+
te(H(O.text), 1)
|
|
3393
|
+
], 64))
|
|
3394
|
+
], 64))), 128))
|
|
3395
|
+
], 2))), 128))
|
|
3396
|
+
], 2),
|
|
3397
|
+
h.value ? (i(), C("p", {
|
|
3398
|
+
key: 0,
|
|
3399
|
+
class: k(`${f.value}__status`)
|
|
3400
|
+
}, H(h.value), 3)) : I("", !0)
|
|
3401
|
+
], 2),
|
|
3402
|
+
F("div", {
|
|
3403
|
+
class: k(`${f.value}__footer`)
|
|
3404
|
+
}, [
|
|
3405
|
+
L(l(de), {
|
|
3406
|
+
type: "primary",
|
|
3407
|
+
size: "large",
|
|
3408
|
+
class: k(`${f.value}__action`),
|
|
3409
|
+
onClick: Be(A, ["stop"])
|
|
3410
|
+
}, {
|
|
3411
|
+
default: $(() => [
|
|
3412
|
+
te(H(e.actionText), 1)
|
|
3413
|
+
]),
|
|
3414
|
+
_: 1
|
|
3415
|
+
}, 8, ["class"])
|
|
3416
|
+
], 2)
|
|
3417
|
+
], 2)) : I("", !0)
|
|
3418
|
+
]),
|
|
3419
|
+
_: 1
|
|
3420
|
+
}, 8, ["name"])
|
|
3421
|
+
]))
|
|
3422
|
+
], 64));
|
|
3423
|
+
}
|
|
3424
|
+
}), Co = be($o), xo = be(Ba), Xo = be(_a), Zo = be(Ea), To = ["image/jpeg", "image/png", "image/webp"], Ro = {
|
|
3425
|
+
"image/jpeg": "jpg",
|
|
3426
|
+
"image/png": "png",
|
|
3427
|
+
"image/webp": "webp"
|
|
3428
|
+
}, Va = (e) => e.type.startsWith("image/"), xt = (e) => To.includes(e.type) ? e.type : "image/png", Po = (e) => {
|
|
3429
|
+
const a = xt(e).replace("image/", "");
|
|
3430
|
+
return a === "jpeg" || a === "webp" ? a : "png";
|
|
3431
|
+
}, Ia = (e, a) => {
|
|
3432
|
+
const t = Ro[a] ?? "png", n = e.name.replace(/\.[^.]+$/, "");
|
|
3433
|
+
return n ? `${n}.${t}` : `cropped.${t}`;
|
|
3434
|
+
}, Ao = (e, a, t) => new Promise((n, o) => {
|
|
3435
|
+
const f = t ?? xt(a);
|
|
3436
|
+
e.toBlob((p) => {
|
|
3437
|
+
if (!p) {
|
|
3438
|
+
o(new Error("裁剪失败,图片过大无法生成文件"));
|
|
3439
|
+
return;
|
|
3440
|
+
}
|
|
3441
|
+
const u = p.type || f;
|
|
3442
|
+
n(new File([p], Ia(a, u), { type: u }));
|
|
3443
|
+
}, f);
|
|
3444
|
+
}), _o = (e, a) => {
|
|
3445
|
+
const t = e.type || xt(a);
|
|
3446
|
+
return new File([e], Ia(a, t), { type: t });
|
|
3447
|
+
}, Eo = (e) => new Promise((a, t) => {
|
|
3448
|
+
const n = URL.createObjectURL(e), o = new Image(), f = () => URL.revokeObjectURL(n);
|
|
3449
|
+
o.onload = () => {
|
|
3450
|
+
const p = document.createElement("canvas");
|
|
3451
|
+
p.width = o.naturalWidth, p.height = o.naturalHeight;
|
|
3452
|
+
const u = p.getContext("2d");
|
|
3453
|
+
if (f(), !u) {
|
|
3454
|
+
t(new Error("裁剪失败,当前环境不支持 canvas"));
|
|
3455
|
+
return;
|
|
3456
|
+
}
|
|
3457
|
+
u.drawImage(o, 0, 0), a(p);
|
|
3458
|
+
}, o.onerror = () => {
|
|
3459
|
+
f(), t(new Error("裁剪失败,未能读取裁剪结果"));
|
|
3460
|
+
}, o.src = n;
|
|
3461
|
+
}), Bo = (e, a, t) => {
|
|
3462
|
+
if (e.width === a && e.height === t) return e;
|
|
3463
|
+
const n = document.createElement("canvas");
|
|
3464
|
+
n.width = a, n.height = t;
|
|
3465
|
+
const o = n.getContext("2d");
|
|
3466
|
+
return o ? (o.drawImage(e, 0, 0, a, t), n) : e;
|
|
3467
|
+
}, pt = (e, a) => Object.assign(e, { uid: a.uid }), Vo = (e) => {
|
|
3468
|
+
const a = document.createElement("canvas");
|
|
3469
|
+
a.width = e.width, a.height = e.height;
|
|
3470
|
+
const t = a.getContext("2d");
|
|
3471
|
+
return t ? (t.save(), t.beginPath(), t.ellipse(e.width / 2, e.height / 2, e.width / 2, e.height / 2, 0, 0, Math.PI * 2), t.closePath(), t.clip(), t.drawImage(e, 0, 0), t.restore(), a) : e;
|
|
3472
|
+
}, Ma = (e) => {
|
|
3473
|
+
if (!e || e <= 0) return [1, 1];
|
|
3474
|
+
if (Number.isInteger(e)) return [e, 1];
|
|
3475
|
+
for (const a of [2, 3, 4, 5, 7, 8, 9, 16]) {
|
|
3476
|
+
const t = Math.round(e * a);
|
|
3477
|
+
if (t > 0 && Math.abs(t / a - e) < 1e-6)
|
|
3478
|
+
return [t, a];
|
|
3479
|
+
}
|
|
3480
|
+
return [e, 1];
|
|
3481
|
+
}, Qt = (e) => {
|
|
3482
|
+
if (!e) return "自由";
|
|
3483
|
+
const [a, t] = Ma(e);
|
|
3484
|
+
return Number.isInteger(a) && Number.isInteger(t) ? `${a}:${t}` : e.toFixed(2);
|
|
3485
|
+
}, Io = (e) => {
|
|
3486
|
+
const a = Number(e);
|
|
3487
|
+
if (!Number.isNaN(a)) return a;
|
|
3488
|
+
const [t, n] = String(e).split("/").map((o) => Number(o.trim()));
|
|
3489
|
+
return t > 0 && n > 0 ? t / n : 0;
|
|
3490
|
+
}, Mo = ["accept"], Fo = ["src"], Oo = 0.1, Xt = 0.9, Do = 180, ht = 260, Lo = /* @__PURE__ */ ae({
|
|
3491
|
+
name: "CropperDialog",
|
|
3492
|
+
__name: "CropperDialog",
|
|
3493
|
+
props: {
|
|
3494
|
+
visible: { type: Boolean },
|
|
3495
|
+
file: {},
|
|
3496
|
+
ratios: {},
|
|
3497
|
+
aspectRatio: {},
|
|
3498
|
+
cropperOptions: {},
|
|
3499
|
+
accept: {},
|
|
3500
|
+
preview: { type: Boolean },
|
|
3501
|
+
outputWidth: {},
|
|
3502
|
+
circle: { type: Boolean },
|
|
3503
|
+
title: {},
|
|
3504
|
+
confirmText: {},
|
|
3505
|
+
cancelText: {},
|
|
3506
|
+
reselectText: {},
|
|
3507
|
+
canvasHeight: {}
|
|
3508
|
+
},
|
|
3509
|
+
emits: ["confirm", "cancel", "error", "reselect"],
|
|
3510
|
+
setup(e, { emit: a }) {
|
|
3511
|
+
const t = e, n = a, { prefix: o } = me(), f = d(() => `${o.value}-cropper-upload`), p = St(), u = q(), v = q(!1), r = q(!1), h = q(0), m = q(""), w = q(), M = (y) => {
|
|
3512
|
+
m.value && URL.revokeObjectURL(m.value), m.value = y ? URL.createObjectURL(y) : "", v.value = !1, w.value = void 0;
|
|
3513
|
+
};
|
|
3514
|
+
he(
|
|
3515
|
+
() => t.file,
|
|
3516
|
+
(y) => {
|
|
3517
|
+
M(y);
|
|
3518
|
+
},
|
|
3519
|
+
{ immediate: !0 }
|
|
3520
|
+
), De(() => {
|
|
3521
|
+
M();
|
|
3522
|
+
});
|
|
3523
|
+
const P = d(() => Io(t.aspectRatio));
|
|
3524
|
+
he(
|
|
3525
|
+
() => t.visible,
|
|
3526
|
+
(y) => {
|
|
3527
|
+
if (!y) return;
|
|
3528
|
+
v.value = !1, r.value = !1;
|
|
3529
|
+
const D = t.ratios.findIndex((Q) => Q === P.value);
|
|
3530
|
+
h.value = D === -1 ? 0 : D;
|
|
3531
|
+
}
|
|
3532
|
+
);
|
|
3533
|
+
const _ = d(() => t.ratios.filter((y) => y >= 0)), S = d(() => _.value.length > 1), A = d(() => _.value[h.value] ?? 0), T = d(() => A.value > 0), U = d(() => Ma(A.value)), B = d(() => t.cropperOptions ?? {}), J = d(() => t.circle ? "png" : t.file ? Po(t.file) : "png"), O = d(() => t.preview ? "900px" : "680px"), Z = async () => {
|
|
3534
|
+
await Re();
|
|
3535
|
+
const y = p.value;
|
|
3536
|
+
if (!y) return;
|
|
3537
|
+
const D = y.scale || 1, Q = (y.trueWidth || 0) * D, oe = (y.trueHeight || 0) * D;
|
|
3538
|
+
if (!Q || !oe) {
|
|
3539
|
+
y.goAutoCrop();
|
|
3540
|
+
return;
|
|
3541
|
+
}
|
|
3542
|
+
const se = A.value, xe = se > 0 ? Math.min(Q, oe * se) : Q, Ae = se > 0 ? xe / se : oe;
|
|
3543
|
+
y.goAutoCrop(xe * Xt, Ae * Xt);
|
|
3544
|
+
}, le = (y) => {
|
|
3545
|
+
if (y === "success") {
|
|
3546
|
+
v.value = !0, Z();
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
v.value = !1, n("error", y instanceof Error ? y : new Error("图片加载失败,请更换图片后重试"));
|
|
3550
|
+
}, N = (y) => {
|
|
3551
|
+
w.value = y;
|
|
3552
|
+
}, V = d(() => {
|
|
3553
|
+
const y = w.value;
|
|
3554
|
+
return !(y != null && y.w) || !(y != null && y.h) ? 1 : Math.min(Do / y.w, ht / y.h);
|
|
3555
|
+
}), G = d(() => {
|
|
3556
|
+
const y = w.value;
|
|
3557
|
+
if (!(y != null && y.w) || !(y != null && y.h)) {
|
|
3558
|
+
const D = A.value || 1;
|
|
3559
|
+
return { width: `${Math.round(ht * D)}px`, height: `${ht}px` };
|
|
3560
|
+
}
|
|
3561
|
+
return {
|
|
3562
|
+
width: `${Math.round(y.w * V.value)}px`,
|
|
3563
|
+
height: `${Math.round(y.h * V.value)}px`
|
|
3564
|
+
};
|
|
3565
|
+
}), W = d(() => {
|
|
3566
|
+
const y = w.value;
|
|
3567
|
+
if (!(!(y != null && y.w) || !(y != null && y.h)))
|
|
3568
|
+
return { width: `${y.w}px`, height: `${y.h}px`, transform: `scale(${V.value})` };
|
|
3569
|
+
}), re = d(() => {
|
|
3570
|
+
const y = Number(t.outputWidth ?? 0);
|
|
3571
|
+
return Number.isFinite(y) && y > 0 ? Math.round(y) : 0;
|
|
3572
|
+
}), j = d(() => {
|
|
3573
|
+
const y = w.value;
|
|
3574
|
+
return !re.value || !(y != null && y.w) || !(y != null && y.h) ? 0 : Math.round(re.value / (y.w / y.h));
|
|
3575
|
+
}), K = d(() => {
|
|
3576
|
+
const y = w.value;
|
|
3577
|
+
if (!(y != null && y.w) || !(y != null && y.h)) return "";
|
|
3578
|
+
if (re.value)
|
|
3579
|
+
return `${re.value} × ${j.value}`;
|
|
3580
|
+
const D = Number(B.value.enlarge ?? 1), Q = B.value.high === !1 ? 1 : window.devicePixelRatio || 1, oe = D !== 1 ? Math.abs(D) : Q;
|
|
3581
|
+
return `${Math.round(y.w * oe)} × ${Math.round(y.h * oe)}`;
|
|
3582
|
+
}), ie = d(() => {
|
|
3583
|
+
const y = A.value > 0 ? `固定 ${Qt(A.value)}` : "自由比例";
|
|
3584
|
+
return K.value ? `${y},确认后输出 ${K.value}` : y;
|
|
3585
|
+
}), Y = (y) => {
|
|
3586
|
+
const D = p.value;
|
|
3587
|
+
if (!D) return;
|
|
3588
|
+
const Q = Math.min(D.trueWidth || 0, D.trueHeight || 0);
|
|
3589
|
+
if (!Q) {
|
|
3590
|
+
D.changeScale(y);
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
D.changeScale(y * Oo * (D.scale || 1) * Q / 20);
|
|
3594
|
+
}, we = (y) => {
|
|
3595
|
+
var D, Q;
|
|
3596
|
+
y ? (D = p.value) == null || D.rotateRight() : (Q = p.value) == null || Q.rotateLeft();
|
|
3597
|
+
}, Se = (y) => {
|
|
3598
|
+
y !== h.value && (h.value = y, Z());
|
|
3599
|
+
}, qe = () => {
|
|
3600
|
+
var y;
|
|
3601
|
+
r.value || (y = u.value) == null || y.click();
|
|
3602
|
+
}, Ve = (y) => {
|
|
3603
|
+
var oe;
|
|
3604
|
+
const D = y.target, Q = (oe = D.files) == null ? void 0 : oe[0];
|
|
3605
|
+
if (D.value = "", !!Q) {
|
|
3606
|
+
if (!Va(Q)) {
|
|
3607
|
+
ra.warning("请选择图片文件");
|
|
3608
|
+
return;
|
|
3609
|
+
}
|
|
3610
|
+
n("reselect", Q);
|
|
3611
|
+
}
|
|
3612
|
+
}, Le = async (y) => {
|
|
3613
|
+
const D = await Eo(y), Q = re.value || D.width, oe = re.value ? j.value || Math.round(Q / (D.width / D.height)) : D.height, se = re.value ? Bo(D, Q, oe) : D;
|
|
3614
|
+
return t.circle ? Vo(se) : se;
|
|
3615
|
+
}, Ne = async () => {
|
|
3616
|
+
const y = p.value;
|
|
3617
|
+
if (!(!y || !t.file || r.value)) {
|
|
3618
|
+
r.value = !0;
|
|
3619
|
+
try {
|
|
3620
|
+
const D = await new Promise((oe) => y.getCropBlob(oe));
|
|
3621
|
+
if (!D) throw new Error("裁剪失败,未能生成图片");
|
|
3622
|
+
const Q = t.circle || re.value ? await Ao(await Le(D), t.file, t.circle ? "image/png" : void 0) : _o(D, t.file);
|
|
3623
|
+
n("confirm", Q);
|
|
3624
|
+
} catch (D) {
|
|
3625
|
+
n("error", D instanceof Error ? D : new Error(String(D)));
|
|
3626
|
+
} finally {
|
|
3627
|
+
r.value = !1;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
}, Pe = () => {
|
|
3631
|
+
n("cancel");
|
|
3632
|
+
};
|
|
3633
|
+
return (y, D) => (i(), x(l(oa), {
|
|
3634
|
+
class: "wa-ui-cropper-upload__dialog",
|
|
3635
|
+
"model-value": e.visible,
|
|
3636
|
+
title: e.title,
|
|
3637
|
+
width: O.value,
|
|
3638
|
+
"close-on-click-modal": !1,
|
|
3639
|
+
"append-to-body": "",
|
|
3640
|
+
onClose: Pe
|
|
3641
|
+
}, {
|
|
3642
|
+
footer: $(() => [
|
|
3643
|
+
L(l(de), { onClick: Pe }, {
|
|
3644
|
+
default: $(() => [
|
|
3645
|
+
te(H(e.cancelText), 1)
|
|
3646
|
+
]),
|
|
3647
|
+
_: 1
|
|
3648
|
+
}),
|
|
3649
|
+
L(l(de), {
|
|
3650
|
+
type: "primary",
|
|
3651
|
+
loading: r.value,
|
|
3652
|
+
disabled: !v.value,
|
|
3653
|
+
onClick: Ne
|
|
3654
|
+
}, {
|
|
3655
|
+
default: $(() => [
|
|
3656
|
+
te(H(e.confirmText), 1)
|
|
3657
|
+
]),
|
|
3658
|
+
_: 1
|
|
3659
|
+
}, 8, ["loading", "disabled"])
|
|
3660
|
+
]),
|
|
3661
|
+
default: $(() => [
|
|
3662
|
+
F("div", {
|
|
3663
|
+
class: k(`${f.value}-panel`)
|
|
3664
|
+
}, [
|
|
3665
|
+
F("div", {
|
|
3666
|
+
class: k(`${f.value}-main`)
|
|
3667
|
+
}, [
|
|
3668
|
+
F("div", {
|
|
3669
|
+
class: k(["wa-ui-cropper-upload__canvas", { "wa-ui-cropper-upload__canvas--circle": e.circle }]),
|
|
3670
|
+
style: Te({ "--wa-ui-cropper-upload-canvas-height": e.canvasHeight })
|
|
3671
|
+
}, [
|
|
3672
|
+
e.visible ? (i(), x(l(Kl), {
|
|
3673
|
+
key: 0,
|
|
3674
|
+
ref_key: "cropperRef",
|
|
3675
|
+
ref: p,
|
|
3676
|
+
class: "wa-ui-cropper-upload__cropper",
|
|
3677
|
+
img: m.value,
|
|
3678
|
+
"output-type": J.value,
|
|
3679
|
+
"output-size": B.value.outputSize ?? 1,
|
|
3680
|
+
"auto-crop": "",
|
|
3681
|
+
fixed: T.value,
|
|
3682
|
+
"fixed-number": U.value,
|
|
3683
|
+
"can-move": B.value.canMove ?? !0,
|
|
3684
|
+
"can-move-box": B.value.canMoveBox ?? !0,
|
|
3685
|
+
"can-scale": B.value.canScale ?? !0,
|
|
3686
|
+
"fixed-box": B.value.fixedBox ?? !1,
|
|
3687
|
+
"center-box": B.value.centerBox ?? !0,
|
|
3688
|
+
info: B.value.info ?? !0,
|
|
3689
|
+
mode: B.value.mode ?? "contain",
|
|
3690
|
+
high: B.value.high ?? !0,
|
|
3691
|
+
enlarge: B.value.enlarge ?? 1,
|
|
3692
|
+
"max-img-size": B.value.maxImgSize ?? 4096,
|
|
3693
|
+
"fill-color": B.value.fillColor ?? "",
|
|
3694
|
+
onImgLoad: le,
|
|
3695
|
+
onRealTime: N
|
|
3696
|
+
}, null, 8, ["img", "output-type", "output-size", "fixed", "fixed-number", "can-move", "can-move-box", "can-scale", "fixed-box", "center-box", "info", "mode", "high", "enlarge", "max-img-size", "fill-color"])) : I("", !0)
|
|
3697
|
+
], 6),
|
|
3698
|
+
F("div", {
|
|
3699
|
+
class: k(`${f.value}-toolbar`)
|
|
3700
|
+
}, [
|
|
3701
|
+
L(l(de), {
|
|
3702
|
+
disabled: r.value,
|
|
3703
|
+
onClick: qe
|
|
3704
|
+
}, {
|
|
3705
|
+
default: $(() => [
|
|
3706
|
+
te(H(e.reselectText), 1)
|
|
3707
|
+
]),
|
|
3708
|
+
_: 1
|
|
3709
|
+
}, 8, ["disabled"]),
|
|
3710
|
+
L(l(qt), null, {
|
|
3711
|
+
default: $(() => [
|
|
3712
|
+
L(l(Qe), {
|
|
3713
|
+
content: "缩小",
|
|
3714
|
+
placement: "top"
|
|
3715
|
+
}, {
|
|
3716
|
+
default: $(() => [
|
|
3717
|
+
L(l(de), {
|
|
3718
|
+
icon: l(Hl),
|
|
3719
|
+
onClick: D[0] || (D[0] = (Q) => Y(-1))
|
|
3720
|
+
}, null, 8, ["icon"])
|
|
3721
|
+
]),
|
|
3722
|
+
_: 1
|
|
3723
|
+
}),
|
|
3724
|
+
L(l(Qe), {
|
|
3725
|
+
content: "放大",
|
|
3726
|
+
placement: "top"
|
|
3727
|
+
}, {
|
|
3728
|
+
default: $(() => [
|
|
3729
|
+
L(l(de), {
|
|
3730
|
+
icon: l(Ul),
|
|
3731
|
+
onClick: D[1] || (D[1] = (Q) => Y(1))
|
|
3732
|
+
}, null, 8, ["icon"])
|
|
3733
|
+
]),
|
|
3734
|
+
_: 1
|
|
3735
|
+
}),
|
|
3736
|
+
L(l(Qe), {
|
|
3737
|
+
content: "逆时针旋转 90°",
|
|
3738
|
+
placement: "top"
|
|
3739
|
+
}, {
|
|
3740
|
+
default: $(() => [
|
|
3741
|
+
L(l(de), {
|
|
3742
|
+
icon: l(sa),
|
|
3743
|
+
onClick: D[2] || (D[2] = (Q) => we(!1))
|
|
3744
|
+
}, null, 8, ["icon"])
|
|
3745
|
+
]),
|
|
3746
|
+
_: 1
|
|
3747
|
+
}),
|
|
3748
|
+
L(l(Qe), {
|
|
3749
|
+
content: "顺时针旋转 90°",
|
|
3750
|
+
placement: "top"
|
|
3751
|
+
}, {
|
|
3752
|
+
default: $(() => [
|
|
3753
|
+
L(l(de), {
|
|
3754
|
+
icon: l(ua),
|
|
3755
|
+
onClick: D[3] || (D[3] = (Q) => we(!0))
|
|
3756
|
+
}, null, 8, ["icon"])
|
|
3757
|
+
]),
|
|
3758
|
+
_: 1
|
|
3759
|
+
})
|
|
3760
|
+
]),
|
|
3761
|
+
_: 1
|
|
3762
|
+
}),
|
|
3763
|
+
S.value ? (i(), x(l(qt), { key: 0 }, {
|
|
3764
|
+
default: $(() => [
|
|
3765
|
+
(i(!0), C(X, null, pe(_.value, (Q, oe) => (i(), x(l(de), {
|
|
3766
|
+
key: oe,
|
|
3767
|
+
type: oe === h.value ? "primary" : void 0,
|
|
3768
|
+
onClick: (se) => Se(oe)
|
|
3769
|
+
}, {
|
|
3770
|
+
default: $(() => [
|
|
3771
|
+
te(H(l(Qt)(Q)), 1)
|
|
3772
|
+
]),
|
|
3773
|
+
_: 2
|
|
3774
|
+
}, 1032, ["type", "onClick"]))), 128))
|
|
3775
|
+
]),
|
|
3776
|
+
_: 1
|
|
3777
|
+
})) : I("", !0),
|
|
3778
|
+
F("input", {
|
|
3779
|
+
ref_key: "fileInputRef",
|
|
3780
|
+
ref: u,
|
|
3781
|
+
class: "wa-ui-cropper-upload__file",
|
|
3782
|
+
type: "file",
|
|
3783
|
+
accept: e.accept,
|
|
3784
|
+
onChange: Ve
|
|
3785
|
+
}, null, 40, Mo)
|
|
3786
|
+
], 2)
|
|
3787
|
+
], 2),
|
|
3788
|
+
e.preview ? (i(), C("aside", {
|
|
3789
|
+
key: 0,
|
|
3790
|
+
class: k(`${f.value}-preview`)
|
|
3791
|
+
}, [
|
|
3792
|
+
F("p", {
|
|
3793
|
+
class: k(`${f.value}-preview__title`)
|
|
3794
|
+
}, "预览", 2),
|
|
3795
|
+
F("div", {
|
|
3796
|
+
class: k([`${f.value}-preview__frame`, { [`${f.value}-preview__frame--circle`]: e.circle }]),
|
|
3797
|
+
style: Te(G.value)
|
|
3798
|
+
}, [
|
|
3799
|
+
w.value ? (i(), C("div", {
|
|
3800
|
+
key: 0,
|
|
3801
|
+
class: k(`${f.value}-preview__inner`),
|
|
3802
|
+
style: Te(W.value)
|
|
3803
|
+
}, [
|
|
3804
|
+
F("img", {
|
|
3805
|
+
src: w.value.url,
|
|
3806
|
+
style: Te(w.value.img),
|
|
3807
|
+
alt: ""
|
|
3808
|
+
}, null, 12, Fo)
|
|
3809
|
+
], 6)) : I("", !0)
|
|
3810
|
+
], 6),
|
|
3811
|
+
F("p", {
|
|
3812
|
+
class: k(`${f.value}-preview__hint`)
|
|
3813
|
+
}, H(ie.value), 3)
|
|
3814
|
+
], 2)) : I("", !0)
|
|
3815
|
+
], 2)
|
|
3816
|
+
]),
|
|
3817
|
+
_: 1
|
|
3818
|
+
}, 8, ["model-value", "title", "width"]));
|
|
3819
|
+
}
|
|
3820
|
+
}), zo = /* @__PURE__ */ ae({
|
|
3821
|
+
name: "CropperUpload",
|
|
3822
|
+
inheritAttrs: !1,
|
|
3823
|
+
__name: "index",
|
|
3824
|
+
props: {
|
|
3825
|
+
beforeUpload: {},
|
|
3826
|
+
cropper: { type: Boolean, default: !0 },
|
|
3827
|
+
aspectRatio: { default: 1 },
|
|
3828
|
+
ratios: { default: () => [1, 4 / 3, 16 / 9, 9 / 16] },
|
|
3829
|
+
cropperOptions: { default: () => ({}) },
|
|
3830
|
+
preview: { type: Boolean, default: !0 },
|
|
3831
|
+
outputWidth: {},
|
|
3832
|
+
circle: { type: Boolean, default: !1 },
|
|
3833
|
+
canvasHeight: { default: "420px" },
|
|
3834
|
+
title: { default: "裁剪图片" },
|
|
3835
|
+
confirmText: { default: "确定" },
|
|
3836
|
+
cancelText: { default: "取消" },
|
|
3837
|
+
reselectText: { default: "重新选择" }
|
|
3838
|
+
},
|
|
3839
|
+
emits: ["crop", "cancel", "error", "reselect"],
|
|
3840
|
+
setup(e, { expose: a, emit: t }) {
|
|
3841
|
+
const n = e, o = t, { prefix: f } = me(), p = d(() => `${f.value}-cropper-upload`), u = aa(), v = q(), r = d(() => u.accept ?? "image/*"), h = q(!1), m = q();
|
|
3842
|
+
let w;
|
|
3843
|
+
const M = q([]), P = d(() => u.fileList), _ = d(() => P.value ?? M.value), S = (N) => {
|
|
3844
|
+
P.value || (M.value = N);
|
|
3845
|
+
}, A = (N) => (m.value = N, h.value = !0, new Promise((V) => {
|
|
3846
|
+
w = V;
|
|
3847
|
+
})), T = (N) => {
|
|
3848
|
+
h.value = !1, w == null || w(N), w = void 0;
|
|
3849
|
+
}, U = (N) => {
|
|
3850
|
+
w && (m.value = N, o("reselect", N));
|
|
3851
|
+
}, B = (N) => {
|
|
3852
|
+
const V = m.value;
|
|
3853
|
+
T(N), V && o("crop", N, V);
|
|
3854
|
+
}, J = () => {
|
|
3855
|
+
if (!w) return;
|
|
3856
|
+
const N = m.value;
|
|
3857
|
+
T(null), N && o("cancel", N);
|
|
3858
|
+
}, O = (N) => {
|
|
3859
|
+
ra.error(N.message), o("error", N), T(null);
|
|
3860
|
+
}, Z = (N, V) => {
|
|
3861
|
+
var re;
|
|
3862
|
+
const G = _.value, W = G.find((j) => j.uid === N);
|
|
3863
|
+
W && ((re = W.url) != null && re.startsWith("blob:") && URL.revokeObjectURL(W.url), W.name = V.name, W.size = V.size, W.raw = W.raw ? pt(V, W.raw) : V, W.url = URL.createObjectURL(V), S([...G]));
|
|
3864
|
+
}, le = async (N) => {
|
|
3865
|
+
const V = N.uid;
|
|
3866
|
+
let G = N;
|
|
3867
|
+
if (n.cropper && Va(N)) {
|
|
3868
|
+
const W = await A(N);
|
|
3869
|
+
if (!W) return !1;
|
|
3870
|
+
G = pt(W, N), Z(V, W);
|
|
3871
|
+
}
|
|
3872
|
+
if (n.beforeUpload) {
|
|
3873
|
+
const W = await n.beforeUpload(G);
|
|
3874
|
+
if (W === !1 || W === null || W === void 0) return !1;
|
|
3875
|
+
if (W instanceof Blob) {
|
|
3876
|
+
const re = W instanceof File ? W : new File([W], G.name, { type: G.type });
|
|
3877
|
+
G = pt(re, G), Z(V, re);
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
return G;
|
|
3881
|
+
};
|
|
3882
|
+
return a({ uploadRef: v }), (N, V) => (i(), C(X, null, [
|
|
3883
|
+
L(l(Ml), fe({
|
|
3884
|
+
ref_key: "uploadRef",
|
|
3885
|
+
ref: v
|
|
3886
|
+
}, N.$attrs, {
|
|
3887
|
+
class: [p.value, { [`${p.value}--circle`]: e.circle }],
|
|
3888
|
+
"file-list": _.value,
|
|
3889
|
+
"before-upload": le,
|
|
3890
|
+
"onUpdate:fileList": S
|
|
3891
|
+
}), Fe({
|
|
3892
|
+
default: $(() => [
|
|
3893
|
+
z(N.$slots, "default")
|
|
3894
|
+
]),
|
|
3895
|
+
_: 2
|
|
3896
|
+
}, [
|
|
3897
|
+
N.$slots.trigger ? {
|
|
3898
|
+
name: "trigger",
|
|
3899
|
+
fn: $((G) => [
|
|
3900
|
+
z(N.$slots, "trigger", nt(ot(G)))
|
|
3901
|
+
]),
|
|
3902
|
+
key: "0"
|
|
3903
|
+
} : void 0,
|
|
3904
|
+
N.$slots.tip ? {
|
|
3905
|
+
name: "tip",
|
|
3906
|
+
fn: $(() => [
|
|
3907
|
+
z(N.$slots, "tip")
|
|
3908
|
+
]),
|
|
3909
|
+
key: "1"
|
|
3910
|
+
} : void 0
|
|
3911
|
+
]), 1040, ["class", "file-list"]),
|
|
3912
|
+
L(Lo, {
|
|
3913
|
+
visible: h.value,
|
|
3914
|
+
file: m.value,
|
|
3915
|
+
ratios: e.ratios,
|
|
3916
|
+
"aspect-ratio": e.aspectRatio,
|
|
3917
|
+
"cropper-options": e.cropperOptions,
|
|
3918
|
+
accept: r.value,
|
|
3919
|
+
preview: e.preview,
|
|
3920
|
+
"output-width": e.outputWidth,
|
|
3921
|
+
circle: e.circle,
|
|
3922
|
+
"canvas-height": e.canvasHeight,
|
|
3923
|
+
title: e.title,
|
|
3924
|
+
"confirm-text": e.confirmText,
|
|
3925
|
+
"cancel-text": e.cancelText,
|
|
3926
|
+
"reselect-text": e.reselectText,
|
|
3927
|
+
onConfirm: B,
|
|
3928
|
+
onReselect: U,
|
|
3929
|
+
onCancel: J,
|
|
3930
|
+
onError: O
|
|
3931
|
+
}, null, 8, ["visible", "file", "ratios", "aspect-ratio", "cropper-options", "accept", "preview", "output-width", "circle", "canvas-height", "title", "confirm-text", "cancel-text", "reselect-text"])
|
|
3932
|
+
], 64));
|
|
3933
|
+
}
|
|
3934
|
+
}), qo = be(zo), No = "3.0.0", jo = [
|
|
3935
|
+
Vn,
|
|
3936
|
+
qn,
|
|
3937
|
+
An,
|
|
3938
|
+
En,
|
|
3939
|
+
on,
|
|
3940
|
+
sn,
|
|
3941
|
+
ln,
|
|
3942
|
+
cn,
|
|
3943
|
+
ma,
|
|
3944
|
+
wa,
|
|
3945
|
+
xo,
|
|
3946
|
+
ko,
|
|
3947
|
+
go,
|
|
3948
|
+
Co,
|
|
3949
|
+
qo
|
|
3950
|
+
], Ho = (e) => {
|
|
3951
|
+
for (const a of jo)
|
|
3952
|
+
e.use(a);
|
|
3953
|
+
}, Jo = {
|
|
3954
|
+
install: Ho,
|
|
3955
|
+
version: No
|
|
3956
|
+
};
|
|
3957
|
+
export {
|
|
3958
|
+
ln as CheckCard,
|
|
3959
|
+
an as CheckCardGroup,
|
|
3960
|
+
Vn as ConfigProvider,
|
|
3961
|
+
qo as CropperUpload,
|
|
3962
|
+
ma as DateQuickSelect,
|
|
3963
|
+
sn as DrawerForm,
|
|
3964
|
+
cn as Ellipsis,
|
|
3965
|
+
go as Layout,
|
|
3966
|
+
ko as MainContent,
|
|
3967
|
+
on as ModalForm,
|
|
3968
|
+
An as ProTable,
|
|
3969
|
+
Co as ShareButton,
|
|
3970
|
+
xo as Sidebar,
|
|
3971
|
+
Xo as SidebarItem,
|
|
3972
|
+
Zo as SidebarLogo,
|
|
3973
|
+
qn as SvgIcon,
|
|
3974
|
+
wa as TagSelector,
|
|
3975
|
+
En as VH100,
|
|
3976
|
+
Jo as default,
|
|
3977
|
+
ga as findEnumPath,
|
|
3978
|
+
yt as formatCellValue,
|
|
3979
|
+
et as getDataIndexKey,
|
|
3980
|
+
He as getDataIndexValue,
|
|
3981
|
+
ka as getRecordKey,
|
|
3982
|
+
tt as getValueEnumOptions,
|
|
3983
|
+
ya as toTreeOptions,
|
|
3984
|
+
No as version
|
|
3985
|
+
};
|