zxt-table 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zxt-table.css +1 -1
- package/dist/zxt-table.es.js +366 -348
- package/dist/zxt-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/zxt-table.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createElementBlock as m, openBlock as i, normalizeClass as ue, renderSlot as T, defineComponent as
|
|
1
|
+
import { createElementBlock as m, openBlock as i, normalizeClass as ue, renderSlot as T, defineComponent as y, createVNode as A, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as Ee, computed as _, mergeProps as M, withCtx as w, Fragment as B, renderList as O, createSlots as Y, resolveDynamicComponent as ze, createTextVNode as j, toDisplayString as ee, useSlots as xe, provide as Ie, onMounted as Be, nextTick as Ne, resolveDirective as Ue, normalizeStyle as qe, withDirectives as Ge, createCommentVNode as G, createElementVNode as b, reactive as We, toHandlers as Je, withModifiers as Te, useAttrs as Ke, normalizeProps as Oe, guardReactiveProps as Me } from "vue";
|
|
2
2
|
import { ElPagination as Qe, ElLink as Xe, ElCheckbox as Ye, ElSelect as et, ElOption as tt, ElInput as at, ElTableColumn as nt, ElTable as ot } from "element-plus";
|
|
3
|
-
const
|
|
3
|
+
const W = (e, t) => {
|
|
4
4
|
const a = e.__vccOpts || e;
|
|
5
|
-
for (const [
|
|
6
|
-
a[
|
|
5
|
+
for (const [s, u] of t)
|
|
6
|
+
a[s] = u;
|
|
7
7
|
return a;
|
|
8
8
|
}, lt = {
|
|
9
9
|
name: "MyButton",
|
|
@@ -21,26 +21,26 @@ const G = (e, t) => {
|
|
|
21
21
|
emits: ["click"],
|
|
22
22
|
setup(e, { emit: t }) {
|
|
23
23
|
return {
|
|
24
|
-
handleClick: (
|
|
25
|
-
t("click",
|
|
24
|
+
handleClick: (s) => {
|
|
25
|
+
t("click", s);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}, rt = ["disabled"];
|
|
30
|
-
function st(e, t, a,
|
|
30
|
+
function st(e, t, a, s, u, d) {
|
|
31
31
|
return i(), m("button", {
|
|
32
32
|
class: ue(["my-button", [`my-button--${a.type}`, { "is-disabled": a.disabled }]]),
|
|
33
33
|
disabled: a.disabled,
|
|
34
|
-
onClick: t[0] || (t[0] = (...l) =>
|
|
34
|
+
onClick: t[0] || (t[0] = (...l) => s.handleClick && s.handleClick(...l))
|
|
35
35
|
}, [
|
|
36
36
|
T(e.$slots, "default", {}, void 0, !0)
|
|
37
37
|
], 10, rt);
|
|
38
38
|
}
|
|
39
|
-
const te = /* @__PURE__ */
|
|
39
|
+
const te = /* @__PURE__ */ W(lt, [["render", st], ["__scopeId", "data-v-4480e77d"]]);
|
|
40
40
|
te.install = function(e) {
|
|
41
41
|
e.component(te.name, te);
|
|
42
42
|
};
|
|
43
|
-
const ae = /* @__PURE__ */
|
|
43
|
+
const ae = /* @__PURE__ */ y({
|
|
44
44
|
name: "JsxButton",
|
|
45
45
|
props: {
|
|
46
46
|
type: {
|
|
@@ -58,22 +58,22 @@ const ae = /* @__PURE__ */ b({
|
|
|
58
58
|
emit: t,
|
|
59
59
|
slots: a
|
|
60
60
|
}) {
|
|
61
|
-
const
|
|
61
|
+
const s = (u) => {
|
|
62
62
|
e.disabled || t("click", u);
|
|
63
63
|
};
|
|
64
|
-
return () =>
|
|
64
|
+
return () => A("button", {
|
|
65
65
|
class: ["jsx-button", `jsx-button--${e.type}`, {
|
|
66
66
|
"is-disabled": e.disabled
|
|
67
67
|
}],
|
|
68
68
|
disabled: e.disabled,
|
|
69
|
-
onClick:
|
|
69
|
+
onClick: s
|
|
70
70
|
}, [a.default?.()]);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
ae.install = function(e) {
|
|
74
74
|
e.component(ae.name, ae);
|
|
75
75
|
};
|
|
76
|
-
const it =
|
|
76
|
+
const it = y({
|
|
77
77
|
name: "ZxtPagination",
|
|
78
78
|
components: { ElPagination: Qe },
|
|
79
79
|
props: {
|
|
@@ -93,7 +93,7 @@ const it = b({
|
|
|
93
93
|
},
|
|
94
94
|
emits: ["update:modelValue", "update:pageSize", "page-change", "size-change"],
|
|
95
95
|
setup(e, { emit: t }) {
|
|
96
|
-
const a = k(e.modelValue),
|
|
96
|
+
const a = k(e.modelValue), s = k(e.pageSize);
|
|
97
97
|
return X(
|
|
98
98
|
() => e.modelValue,
|
|
99
99
|
(l) => {
|
|
@@ -102,21 +102,21 @@ const it = b({
|
|
|
102
102
|
), X(
|
|
103
103
|
() => e.pageSize,
|
|
104
104
|
(l) => {
|
|
105
|
-
|
|
105
|
+
s.value = l;
|
|
106
106
|
}
|
|
107
107
|
), {
|
|
108
108
|
currentPage: a,
|
|
109
|
-
pageSize:
|
|
109
|
+
pageSize: s,
|
|
110
110
|
handleSizeChange: (l) => {
|
|
111
|
-
|
|
111
|
+
s.value = l, a.value = 1, t("update:pageSize", l), t("size-change", { page: a.value, size: l });
|
|
112
112
|
},
|
|
113
113
|
handleCurrentChange: (l) => {
|
|
114
|
-
a.value = l, t("update:modelValue", l), t("page-change", { page: l, size:
|
|
114
|
+
a.value = l, t("update:modelValue", l), t("page-change", { page: l, size: s.value });
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
function ut(e, t, a,
|
|
119
|
+
function ut(e, t, a, s, u, d) {
|
|
120
120
|
const l = S("el-pagination");
|
|
121
121
|
return i(), V(l, {
|
|
122
122
|
"current-page": e.currentPage,
|
|
@@ -131,27 +131,27 @@ function ut(e, t, a, r, u, d) {
|
|
|
131
131
|
onCurrentChange: e.handleCurrentChange
|
|
132
132
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout", "onSizeChange", "onCurrentChange"]);
|
|
133
133
|
}
|
|
134
|
-
const Q = /* @__PURE__ */
|
|
134
|
+
const Q = /* @__PURE__ */ W(it, [["render", ut], ["__scopeId", "data-v-497aa44d"]]), ne = {
|
|
135
135
|
default: ({ cellValue: e }) => e ?? "",
|
|
136
|
-
input: ({ cellValue: e, row: t, column: a, updateRow:
|
|
136
|
+
input: ({ cellValue: e, row: t, column: a, updateRow: s }) => K(at, {
|
|
137
137
|
modelValue: e,
|
|
138
138
|
size: "small",
|
|
139
|
-
onInput: (u) =>
|
|
139
|
+
onInput: (u) => s({ ...t, [a.property]: u })
|
|
140
140
|
}),
|
|
141
|
-
select: ({ cellValue: e, row: t, column: a, updateRow:
|
|
141
|
+
select: ({ cellValue: e, row: t, column: a, updateRow: s, options: u = [] }) => K(
|
|
142
142
|
et,
|
|
143
143
|
{
|
|
144
144
|
modelValue: e,
|
|
145
145
|
size: "small",
|
|
146
|
-
onChange: (d) =>
|
|
146
|
+
onChange: (d) => s({ ...t, [a.property]: d })
|
|
147
147
|
},
|
|
148
148
|
() => u.map(
|
|
149
149
|
(d) => K(tt, { label: d.label, value: d.value, key: d.value })
|
|
150
150
|
)
|
|
151
151
|
),
|
|
152
|
-
checkbox: ({ cellValue: e, row: t, column: a, updateRow:
|
|
152
|
+
checkbox: ({ cellValue: e, row: t, column: a, updateRow: s }) => K(Ye, {
|
|
153
153
|
modelValue: !!e,
|
|
154
|
-
onChange: (u) =>
|
|
154
|
+
onChange: (u) => s({ ...t, [a.property]: u })
|
|
155
155
|
}),
|
|
156
156
|
link: ({ cellValue: e, href: t, target: a = "_blank" }) => K(Xe, { href: t, target: a }, () => e)
|
|
157
157
|
};
|
|
@@ -164,20 +164,20 @@ function dt(e, t) {
|
|
|
164
164
|
if (typeof e == "function")
|
|
165
165
|
return e(t);
|
|
166
166
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
167
|
-
const { name: a, props:
|
|
167
|
+
const { name: a, props: s = {}, attrs: u = {}, events: d = {}, content: l } = e;
|
|
168
168
|
return typeof a == "string" && ne[a] ? ne[a]({
|
|
169
169
|
...t,
|
|
170
|
-
...
|
|
170
|
+
...s,
|
|
171
171
|
...u,
|
|
172
172
|
...d
|
|
173
|
-
}) : typeof a == "object" || typeof a == "function" ? K(a, { ...
|
|
173
|
+
}) : typeof a == "object" || typeof a == "function" ? K(a, { ...s, ...u, ...d }, l) : (console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"), t.cellValue ?? "");
|
|
174
174
|
}
|
|
175
175
|
return t.cellValue ?? "";
|
|
176
176
|
}
|
|
177
177
|
function ct(e, t) {
|
|
178
178
|
ne[e] && console.warn(`[ZxtTable] 内置渲染器 ${e} 已被覆盖`), ne[e] = t;
|
|
179
179
|
}
|
|
180
|
-
const pt =
|
|
180
|
+
const pt = y({
|
|
181
181
|
name: "ZxtTableColumn",
|
|
182
182
|
components: { ElTableColumn: nt },
|
|
183
183
|
props: {
|
|
@@ -199,7 +199,7 @@ const pt = b({
|
|
|
199
199
|
}), a = (l) => {
|
|
200
200
|
const { currentPage: c, pageSize: g } = e;
|
|
201
201
|
return (c - 1) * g + l + 1;
|
|
202
|
-
},
|
|
202
|
+
}, s = _(() => {
|
|
203
203
|
const l = e.column;
|
|
204
204
|
return {
|
|
205
205
|
...l,
|
|
@@ -209,42 +209,42 @@ const pt = b({
|
|
|
209
209
|
// 优先使用 label,兼容 title
|
|
210
210
|
};
|
|
211
211
|
}), u = _(() => {
|
|
212
|
-
const { children: l, ...c } =
|
|
212
|
+
const { children: l, ...c } = s.value;
|
|
213
213
|
return c;
|
|
214
214
|
});
|
|
215
215
|
return {
|
|
216
|
-
normalizedColumn:
|
|
216
|
+
normalizedColumn: s,
|
|
217
217
|
columnProps: u,
|
|
218
218
|
renderCell: (l) => {
|
|
219
|
-
const c =
|
|
219
|
+
const c = s.value, g = l.row[c.prop], z = g ?? c.defaultValue ?? "";
|
|
220
220
|
return dt(c.cellRender, {
|
|
221
221
|
row: l.row,
|
|
222
222
|
column: c,
|
|
223
223
|
rowIndex: l.$index,
|
|
224
224
|
cellValue: z,
|
|
225
|
-
updateRow: (
|
|
225
|
+
updateRow: (f) => t(f, l.$index)
|
|
226
226
|
});
|
|
227
227
|
},
|
|
228
228
|
defaultIndexMethod: a
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
|
-
function ft(e, t, a,
|
|
232
|
+
function ft(e, t, a, s, u, d) {
|
|
233
233
|
const l = S("ZxtTableColumn", !0), c = S("el-table-column");
|
|
234
234
|
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (i(), V(c, M({ key: 0 }, e.columnProps, {
|
|
235
235
|
key: e.normalizedColumn.prop + "-group"
|
|
236
236
|
}), {
|
|
237
237
|
default: w(() => [
|
|
238
|
-
(i(!0), m(
|
|
238
|
+
(i(!0), m(B, null, O(e.normalizedColumn.children, (g, z) => (i(), V(l, {
|
|
239
239
|
key: z,
|
|
240
240
|
column: g,
|
|
241
241
|
"current-page": e.currentPage,
|
|
242
242
|
"page-size": e.pageSize
|
|
243
243
|
}, Y({ _: 2 }, [
|
|
244
|
-
O(e.$slots, (
|
|
244
|
+
O(e.$slots, (f, n) => ({
|
|
245
245
|
name: n,
|
|
246
|
-
fn: w((
|
|
247
|
-
T(e.$slots, n, M({ ref_for: !0 },
|
|
246
|
+
fn: w((C) => [
|
|
247
|
+
T(e.$slots, n, M({ ref_for: !0 }, C))
|
|
248
248
|
])
|
|
249
249
|
}))
|
|
250
250
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
@@ -269,14 +269,14 @@ function ft(e, t, a, r, u, d) {
|
|
|
269
269
|
row: g.row,
|
|
270
270
|
index: g.$index,
|
|
271
271
|
column: e.normalizedColumn
|
|
272
|
-
}) : e.normalizedColumn.cellRender ? (i(), V(
|
|
272
|
+
}) : e.normalizedColumn.cellRender ? (i(), V(ze(e.renderCell(g)), { key: 1 })) : e.normalizedColumn.formatter ? (i(), m(B, { key: 2 }, [
|
|
273
273
|
j(ee(e.normalizedColumn.formatter(
|
|
274
274
|
g.row,
|
|
275
275
|
e.normalizedColumn,
|
|
276
276
|
g.row[e.normalizedColumn.prop],
|
|
277
277
|
g.$index
|
|
278
278
|
)), 1)
|
|
279
|
-
], 64)) : (i(), m(
|
|
279
|
+
], 64)) : (i(), m(B, { key: 3 }, [
|
|
280
280
|
j(ee(g.row[e.normalizedColumn.prop]), 1)
|
|
281
281
|
], 64))
|
|
282
282
|
]),
|
|
@@ -284,7 +284,7 @@ function ft(e, t, a, r, u, d) {
|
|
|
284
284
|
} : void 0
|
|
285
285
|
]), 1040, ["index"]));
|
|
286
286
|
}
|
|
287
|
-
const mt = /* @__PURE__ */
|
|
287
|
+
const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set(["append", "empty"]), ht = y({
|
|
288
288
|
name: "ZxtTable",
|
|
289
289
|
inheritAttrs: !1,
|
|
290
290
|
components: { ZxtPagination: Q, ZxtTableColumn: mt, ElTable: ot },
|
|
@@ -333,89 +333,92 @@ const mt = /* @__PURE__ */ G(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
333
333
|
"update:row"
|
|
334
334
|
],
|
|
335
335
|
setup(e, { emit: t }) {
|
|
336
|
-
const a =
|
|
337
|
-
X(() => e.currentPage, (
|
|
338
|
-
d.value =
|
|
339
|
-
}), X(() => e.pageSize, (
|
|
340
|
-
u.value =
|
|
336
|
+
const a = xe(), s = k(null), u = k(e.pageSize), d = k(e.currentPage), l = k(!1), c = k([]), g = k(0), z = k({ prop: "", order: "" }), f = k({}), n = k({});
|
|
337
|
+
X(() => e.currentPage, (p) => {
|
|
338
|
+
d.value = p;
|
|
339
|
+
}), X(() => e.pageSize, (p) => {
|
|
340
|
+
u.value = p;
|
|
341
341
|
});
|
|
342
|
-
const
|
|
342
|
+
const C = _(() => e.height === "full" ? { height: "100%" } : {}), r = _(() => {
|
|
343
343
|
if (e.height !== "full")
|
|
344
344
|
return e.height;
|
|
345
|
-
}),
|
|
346
|
-
() =>
|
|
347
|
-
),
|
|
345
|
+
}), v = _(() => !!e.proxyConfig), L = _(() => v.value ? g.value : e.total > 0 ? e.total : e.data.length), J = _(
|
|
346
|
+
() => v.value ? c.value : e.data
|
|
347
|
+
), F = () => {
|
|
348
348
|
Ne(() => {
|
|
349
|
-
const
|
|
349
|
+
const p = s.value?.$el?.querySelector(
|
|
350
350
|
".el-table__body-wrapper .el-scrollbar__wrap"
|
|
351
351
|
);
|
|
352
|
-
|
|
352
|
+
p && (typeof p.scrollTo == "function" ? p.scrollTo({ top: 0, left: 0 }) : (p.scrollTop = 0, p.scrollLeft = 0));
|
|
353
353
|
});
|
|
354
|
-
}, E = (
|
|
355
|
-
|
|
356
|
-
}, de = (
|
|
357
|
-
|
|
358
|
-
}, ce = ({ column:
|
|
359
|
-
z.value = { prop: $, order: I },
|
|
360
|
-
}, pe = (
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
if (!
|
|
354
|
+
}, E = (p) => {
|
|
355
|
+
v.value && (d.value = p.page, u.value = p.size, Z()), F(), t("size-change", p);
|
|
356
|
+
}, de = (p) => {
|
|
357
|
+
v.value && (d.value = p.page, u.value = p.size, Z()), F(), t("page-change", p);
|
|
358
|
+
}, ce = ({ column: p, prop: $, order: I }) => {
|
|
359
|
+
z.value = { prop: $, order: I }, v.value && Z(), t("sort-change", { column: p, prop: $, order: I });
|
|
360
|
+
}, pe = (p) => {
|
|
361
|
+
f.value = p || {}, v.value && Z(), t("filter-change", f.value);
|
|
362
|
+
}, Z = async (p) => {
|
|
363
|
+
if (!v.value) return;
|
|
364
364
|
const $ = e.proxyConfig || {}, I = $.ajax?.query;
|
|
365
365
|
if (typeof I != "function") return;
|
|
366
|
-
const N = $.props || {},
|
|
366
|
+
const N = $.props || {}, ve = N.pageField || "page";
|
|
367
367
|
N.sizeField;
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
[
|
|
372
|
-
currentPage:
|
|
373
|
-
pageSize:
|
|
368
|
+
const Ce = N.sortField || "sort", _e = N.orderField || "order", we = N.filtersField || "filters";
|
|
369
|
+
p?.formData !== void 0 ? n.value = p.formData : $._formData && (n.value = $._formData);
|
|
370
|
+
const be = $.params || {}, U = {
|
|
371
|
+
[ve]: {
|
|
372
|
+
currentPage: p?.page ?? d.value,
|
|
373
|
+
pageSize: p?.pageSize ?? u.value
|
|
374
374
|
},
|
|
375
375
|
form: n.value,
|
|
376
|
-
...
|
|
376
|
+
...be
|
|
377
377
|
};
|
|
378
|
-
z.value?.prop && (U[
|
|
378
|
+
z.value?.prop && (U[Ce] = z.value.prop, U[_e] = z.value.order), f.value && Object.keys(f.value).length && (U[we] = f.value), l.value = !0;
|
|
379
379
|
try {
|
|
380
|
-
const
|
|
381
|
-
let
|
|
380
|
+
const R = await I(U), P = $.response || {}, o = P.listField || "list", h = P.totalField || "total", D = P.transform;
|
|
381
|
+
let H = [], re = 0;
|
|
382
382
|
if (typeof D == "function") {
|
|
383
|
-
const ye = D(
|
|
384
|
-
|
|
385
|
-
} else
|
|
386
|
-
c.value = Array.isArray(
|
|
383
|
+
const ye = D(R);
|
|
384
|
+
H = ye?.list ?? [], re = ye?.total ?? 0;
|
|
385
|
+
} else R && typeof R == "object" && (H = R?.[o] ?? R?.data ?? [], re = R?.[h] ?? R?.total ?? 0);
|
|
386
|
+
c.value = Array.isArray(H) ? H : [], g.value = Number(re) || 0, t("loaded", {
|
|
387
387
|
data: c.value,
|
|
388
388
|
total: g.value,
|
|
389
389
|
payload: U
|
|
390
390
|
});
|
|
391
|
-
} catch (
|
|
392
|
-
t("load-error",
|
|
391
|
+
} catch (R) {
|
|
392
|
+
t("load-error", R);
|
|
393
393
|
} finally {
|
|
394
394
|
l.value = !1;
|
|
395
395
|
}
|
|
396
|
-
}, oe = (
|
|
397
|
-
|
|
396
|
+
}, oe = (p, $) => {
|
|
397
|
+
v.value ? c.value.splice($, 1, p) : t("update:row", { index: $, row: p });
|
|
398
398
|
};
|
|
399
|
-
Ie("updateRow", oe),
|
|
400
|
-
|
|
399
|
+
Ie("updateRow", oe), Be(() => {
|
|
400
|
+
v.value && e.autoLoad && Z();
|
|
401
401
|
});
|
|
402
|
-
const fe = () =>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
402
|
+
const fe = () => s.value, me = () => s.value?.getSelectionRows?.() || [], ge = (p) => Z(p), le = () => F(), he = _(() => {
|
|
403
|
+
const p = {};
|
|
404
|
+
for (const $ in a)
|
|
405
|
+
gt.has($) || (p[$] = a[$]);
|
|
406
|
+
return p;
|
|
407
|
+
});
|
|
408
|
+
return console.log("[ZxtTable][4] props.columns =", e.columns), console.log(
|
|
409
|
+
"[ZxtTable][4] has __action__ slot col =",
|
|
410
|
+
(e.columns || []).some((p) => p?.slot === "__action__")
|
|
411
|
+
), {
|
|
412
|
+
columnSlots: he,
|
|
413
|
+
tableRef: s,
|
|
414
|
+
containerStyle: C,
|
|
415
|
+
tableHeight: r,
|
|
413
416
|
getTableRef: fe,
|
|
414
417
|
pageSize: u,
|
|
415
418
|
currentPage: d,
|
|
416
419
|
loading: l,
|
|
417
420
|
renderData: J,
|
|
418
|
-
total:
|
|
421
|
+
total: L,
|
|
419
422
|
pageSizes: _(() => e.pageSizes),
|
|
420
423
|
paginationLayout: _(() => e.paginationLayout),
|
|
421
424
|
handleSizeChange: E,
|
|
@@ -432,13 +435,13 @@ const mt = /* @__PURE__ */ G(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
432
435
|
key: 0,
|
|
433
436
|
class: "zxt-table-footer"
|
|
434
437
|
};
|
|
435
|
-
function Ct(e, t, a,
|
|
438
|
+
function Ct(e, t, a, s, u, d) {
|
|
436
439
|
const l = S("ZxtTableColumn"), c = S("el-table"), g = S("ZxtPagination"), z = Ue("loading");
|
|
437
440
|
return i(), m("div", {
|
|
438
441
|
class: ue(["zxt-table-container", { "zxt-table-container--full": e.height === "full" }]),
|
|
439
442
|
style: qe(e.containerStyle)
|
|
440
443
|
}, [
|
|
441
|
-
|
|
444
|
+
Ge((i(), V(c, M({
|
|
442
445
|
ref: "tableRef",
|
|
443
446
|
data: e.renderData,
|
|
444
447
|
height: e.tableHeight
|
|
@@ -448,16 +451,16 @@ function Ct(e, t, a, r, u, d) {
|
|
|
448
451
|
onFilterChange: e.handleFilterChange
|
|
449
452
|
}), Y({
|
|
450
453
|
default: w(() => [
|
|
451
|
-
(i(!0), m(
|
|
454
|
+
(i(!0), m(B, null, O(e.columns, (f, n) => (i(), V(l, {
|
|
452
455
|
key: n,
|
|
453
|
-
column:
|
|
456
|
+
column: f,
|
|
454
457
|
"current-page": e.currentPage,
|
|
455
458
|
"page-size": e.pageSize
|
|
456
459
|
}, Y({ _: 2 }, [
|
|
457
|
-
O(e.columnSlots, (
|
|
458
|
-
name:
|
|
459
|
-
fn: w((
|
|
460
|
-
T(e.$slots,
|
|
460
|
+
O(e.columnSlots, (C, r) => ({
|
|
461
|
+
name: r,
|
|
462
|
+
fn: w((v) => [
|
|
463
|
+
T(e.$slots, r, M({ ref_for: !0 }, v), void 0, !0)
|
|
461
464
|
])
|
|
462
465
|
}))
|
|
463
466
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
@@ -476,21 +479,21 @@ function Ct(e, t, a, r, u, d) {
|
|
|
476
479
|
]),
|
|
477
480
|
e.$slots.append ? (i(), m("div", vt, [
|
|
478
481
|
T(e.$slots, "append", {}, void 0, !0)
|
|
479
|
-
])) :
|
|
482
|
+
])) : G("", !0),
|
|
480
483
|
e.pageable ? (i(), V(g, {
|
|
481
484
|
key: 1,
|
|
482
485
|
"model-value": e.currentPage,
|
|
483
486
|
"page-size": e.pageSize,
|
|
484
|
-
"onUpdate:pageSize": t[0] || (t[0] = (
|
|
487
|
+
"onUpdate:pageSize": t[0] || (t[0] = (f) => e.pageSize = f),
|
|
485
488
|
"page-sizes": e.pageSizes,
|
|
486
489
|
total: e.total,
|
|
487
490
|
layout: e.paginationLayout,
|
|
488
491
|
onPageChange: e.handlePageChange,
|
|
489
492
|
onSizeChange: e.handleSizeChange
|
|
490
|
-
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) :
|
|
493
|
+
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : G("", !0)
|
|
491
494
|
], 6);
|
|
492
495
|
}
|
|
493
|
-
const
|
|
496
|
+
const x = /* @__PURE__ */ W(ht, [["render", Ct], ["__scopeId", "data-v-18bf8d0a"]]), q = /* @__PURE__ */ new Map();
|
|
494
497
|
class _t {
|
|
495
498
|
/**
|
|
496
499
|
* 注册自定义渲染器
|
|
@@ -544,13 +547,13 @@ class _t {
|
|
|
544
547
|
q.clear();
|
|
545
548
|
}
|
|
546
549
|
}
|
|
547
|
-
const
|
|
550
|
+
const Se = new _t();
|
|
548
551
|
function wt(e, t, a = {}) {
|
|
549
552
|
if (!e || !e.itemRender)
|
|
550
553
|
return null;
|
|
551
|
-
const { name:
|
|
552
|
-
if (
|
|
553
|
-
const u =
|
|
554
|
+
const { name: s } = e.itemRender;
|
|
555
|
+
if (s && Se.has(s)) {
|
|
556
|
+
const u = Se.get(s);
|
|
554
557
|
if (typeof u.renderItemContent == "function") {
|
|
555
558
|
const d = {
|
|
556
559
|
data: t,
|
|
@@ -561,18 +564,18 @@ function wt(e, t, a = {}) {
|
|
|
561
564
|
try {
|
|
562
565
|
return u.renderItemContent(a, d);
|
|
563
566
|
} catch (l) {
|
|
564
|
-
return console.error(`[ZxtTable] 渲染器 "${
|
|
567
|
+
return console.error(`[ZxtTable] 渲染器 "${s}" 执行出错:`, l), null;
|
|
565
568
|
}
|
|
566
569
|
}
|
|
567
570
|
}
|
|
568
571
|
return null;
|
|
569
572
|
}
|
|
570
|
-
|
|
571
|
-
e.component(
|
|
573
|
+
x.install = function(e) {
|
|
574
|
+
e.component(x.name, x);
|
|
572
575
|
};
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
var
|
|
576
|
+
x.registerRenderer = ct;
|
|
577
|
+
x.renderer = Se;
|
|
578
|
+
var bt = /* @__PURE__ */ y({
|
|
576
579
|
name: "ArrowDown",
|
|
577
580
|
__name: "arrow-down",
|
|
578
581
|
setup(e) {
|
|
@@ -580,13 +583,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
580
583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
581
584
|
viewBox: "0 0 1024 1024"
|
|
582
585
|
}, [
|
|
583
|
-
|
|
586
|
+
b("path", {
|
|
584
587
|
fill: "currentColor",
|
|
585
588
|
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
|
|
586
589
|
})
|
|
587
590
|
]));
|
|
588
591
|
}
|
|
589
|
-
}),
|
|
592
|
+
}), Le = bt, yt = /* @__PURE__ */ y({
|
|
590
593
|
name: "Check",
|
|
591
594
|
__name: "check",
|
|
592
595
|
setup(e) {
|
|
@@ -594,13 +597,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
594
597
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
598
|
viewBox: "0 0 1024 1024"
|
|
596
599
|
}, [
|
|
597
|
-
|
|
600
|
+
b("path", {
|
|
598
601
|
fill: "currentColor",
|
|
599
602
|
d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
|
|
600
603
|
})
|
|
601
604
|
]));
|
|
602
605
|
}
|
|
603
|
-
}), zt =
|
|
606
|
+
}), zt = yt, St = /* @__PURE__ */ y({
|
|
604
607
|
name: "Close",
|
|
605
608
|
__name: "close",
|
|
606
609
|
setup(e) {
|
|
@@ -608,13 +611,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
608
611
|
xmlns: "http://www.w3.org/2000/svg",
|
|
609
612
|
viewBox: "0 0 1024 1024"
|
|
610
613
|
}, [
|
|
611
|
-
|
|
614
|
+
b("path", {
|
|
612
615
|
fill: "currentColor",
|
|
613
616
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
614
617
|
})
|
|
615
618
|
]));
|
|
616
619
|
}
|
|
617
|
-
}), kt = St, $t = /* @__PURE__ */
|
|
620
|
+
}), kt = St, $t = /* @__PURE__ */ y({
|
|
618
621
|
name: "CopyDocument",
|
|
619
622
|
__name: "copy-document",
|
|
620
623
|
setup(e) {
|
|
@@ -622,17 +625,17 @@ var yt = /* @__PURE__ */ b({
|
|
|
622
625
|
xmlns: "http://www.w3.org/2000/svg",
|
|
623
626
|
viewBox: "0 0 1024 1024"
|
|
624
627
|
}, [
|
|
625
|
-
|
|
628
|
+
b("path", {
|
|
626
629
|
fill: "currentColor",
|
|
627
630
|
d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"
|
|
628
631
|
}),
|
|
629
|
-
|
|
632
|
+
b("path", {
|
|
630
633
|
fill: "currentColor",
|
|
631
634
|
d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"
|
|
632
635
|
})
|
|
633
636
|
]));
|
|
634
637
|
}
|
|
635
|
-
}), Vt = $t, Pt = /* @__PURE__ */
|
|
638
|
+
}), Vt = $t, Pt = /* @__PURE__ */ y({
|
|
636
639
|
name: "Delete",
|
|
637
640
|
__name: "delete",
|
|
638
641
|
setup(e) {
|
|
@@ -640,13 +643,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
640
643
|
xmlns: "http://www.w3.org/2000/svg",
|
|
641
644
|
viewBox: "0 0 1024 1024"
|
|
642
645
|
}, [
|
|
643
|
-
|
|
646
|
+
b("path", {
|
|
644
647
|
fill: "currentColor",
|
|
645
648
|
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
|
|
646
649
|
})
|
|
647
650
|
]));
|
|
648
651
|
}
|
|
649
|
-
}),
|
|
652
|
+
}), ke = Pt, Dt = /* @__PURE__ */ y({
|
|
650
653
|
name: "Document",
|
|
651
654
|
__name: "document",
|
|
652
655
|
setup(e) {
|
|
@@ -654,13 +657,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
654
657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
655
658
|
viewBox: "0 0 1024 1024"
|
|
656
659
|
}, [
|
|
657
|
-
|
|
660
|
+
b("path", {
|
|
658
661
|
fill: "currentColor",
|
|
659
662
|
d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
|
|
660
663
|
})
|
|
661
664
|
]));
|
|
662
665
|
}
|
|
663
|
-
}),
|
|
666
|
+
}), At = Dt, Ft = /* @__PURE__ */ y({
|
|
664
667
|
name: "Download",
|
|
665
668
|
__name: "download",
|
|
666
669
|
setup(e) {
|
|
@@ -668,13 +671,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
668
671
|
xmlns: "http://www.w3.org/2000/svg",
|
|
669
672
|
viewBox: "0 0 1024 1024"
|
|
670
673
|
}, [
|
|
671
|
-
|
|
674
|
+
b("path", {
|
|
672
675
|
fill: "currentColor",
|
|
673
676
|
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
|
|
674
677
|
})
|
|
675
678
|
]));
|
|
676
679
|
}
|
|
677
|
-
}),
|
|
680
|
+
}), $e = Ft, Rt = /* @__PURE__ */ y({
|
|
678
681
|
name: "Edit",
|
|
679
682
|
__name: "edit",
|
|
680
683
|
setup(e) {
|
|
@@ -682,17 +685,17 @@ var yt = /* @__PURE__ */ b({
|
|
|
682
685
|
xmlns: "http://www.w3.org/2000/svg",
|
|
683
686
|
viewBox: "0 0 1024 1024"
|
|
684
687
|
}, [
|
|
685
|
-
|
|
688
|
+
b("path", {
|
|
686
689
|
fill: "currentColor",
|
|
687
690
|
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
688
691
|
}),
|
|
689
|
-
|
|
692
|
+
b("path", {
|
|
690
693
|
fill: "currentColor",
|
|
691
694
|
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
692
695
|
})
|
|
693
696
|
]));
|
|
694
697
|
}
|
|
695
|
-
}),
|
|
698
|
+
}), Ve = Rt, Tt = /* @__PURE__ */ y({
|
|
696
699
|
name: "Lock",
|
|
697
700
|
__name: "lock",
|
|
698
701
|
setup(e) {
|
|
@@ -700,17 +703,17 @@ var yt = /* @__PURE__ */ b({
|
|
|
700
703
|
xmlns: "http://www.w3.org/2000/svg",
|
|
701
704
|
viewBox: "0 0 1024 1024"
|
|
702
705
|
}, [
|
|
703
|
-
|
|
706
|
+
b("path", {
|
|
704
707
|
fill: "currentColor",
|
|
705
708
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
706
709
|
}),
|
|
707
|
-
|
|
710
|
+
b("path", {
|
|
708
711
|
fill: "currentColor",
|
|
709
712
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
|
|
710
713
|
})
|
|
711
714
|
]));
|
|
712
715
|
}
|
|
713
|
-
}), Ot = Tt, Mt = /* @__PURE__ */
|
|
716
|
+
}), Ot = Tt, Mt = /* @__PURE__ */ y({
|
|
714
717
|
name: "Plus",
|
|
715
718
|
__name: "plus",
|
|
716
719
|
setup(e) {
|
|
@@ -718,13 +721,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
718
721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
719
722
|
viewBox: "0 0 1024 1024"
|
|
720
723
|
}, [
|
|
721
|
-
|
|
724
|
+
b("path", {
|
|
722
725
|
fill: "currentColor",
|
|
723
726
|
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
|
|
724
727
|
})
|
|
725
728
|
]));
|
|
726
729
|
}
|
|
727
|
-
}),
|
|
730
|
+
}), Pe = Mt, xt = /* @__PURE__ */ y({
|
|
728
731
|
name: "Refresh",
|
|
729
732
|
__name: "refresh",
|
|
730
733
|
setup(e) {
|
|
@@ -732,13 +735,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
732
735
|
xmlns: "http://www.w3.org/2000/svg",
|
|
733
736
|
viewBox: "0 0 1024 1024"
|
|
734
737
|
}, [
|
|
735
|
-
|
|
738
|
+
b("path", {
|
|
736
739
|
fill: "currentColor",
|
|
737
740
|
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
738
741
|
})
|
|
739
742
|
]));
|
|
740
743
|
}
|
|
741
|
-
}), se =
|
|
744
|
+
}), se = xt, Bt = /* @__PURE__ */ y({
|
|
742
745
|
name: "Search",
|
|
743
746
|
__name: "search",
|
|
744
747
|
setup(e) {
|
|
@@ -746,13 +749,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
746
749
|
xmlns: "http://www.w3.org/2000/svg",
|
|
747
750
|
viewBox: "0 0 1024 1024"
|
|
748
751
|
}, [
|
|
749
|
-
|
|
752
|
+
b("path", {
|
|
750
753
|
fill: "currentColor",
|
|
751
754
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
|
|
752
755
|
})
|
|
753
756
|
]));
|
|
754
757
|
}
|
|
755
|
-
}), ie =
|
|
758
|
+
}), ie = Bt, Lt = /* @__PURE__ */ y({
|
|
756
759
|
name: "Setting",
|
|
757
760
|
__name: "setting",
|
|
758
761
|
setup(e) {
|
|
@@ -760,13 +763,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
760
763
|
xmlns: "http://www.w3.org/2000/svg",
|
|
761
764
|
viewBox: "0 0 1024 1024"
|
|
762
765
|
}, [
|
|
763
|
-
|
|
766
|
+
b("path", {
|
|
764
767
|
fill: "currentColor",
|
|
765
768
|
d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
|
|
766
769
|
})
|
|
767
770
|
]));
|
|
768
771
|
}
|
|
769
|
-
}),
|
|
772
|
+
}), De = Lt, Zt = /* @__PURE__ */ y({
|
|
770
773
|
name: "Share",
|
|
771
774
|
__name: "share",
|
|
772
775
|
setup(e) {
|
|
@@ -774,13 +777,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
774
777
|
xmlns: "http://www.w3.org/2000/svg",
|
|
775
778
|
viewBox: "0 0 1024 1024"
|
|
776
779
|
}, [
|
|
777
|
-
|
|
780
|
+
b("path", {
|
|
778
781
|
fill: "currentColor",
|
|
779
782
|
d: "m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"
|
|
780
783
|
})
|
|
781
784
|
]));
|
|
782
785
|
}
|
|
783
|
-
}),
|
|
786
|
+
}), Ht = Zt, jt = /* @__PURE__ */ y({
|
|
784
787
|
name: "Unlock",
|
|
785
788
|
__name: "unlock",
|
|
786
789
|
setup(e) {
|
|
@@ -788,17 +791,17 @@ var yt = /* @__PURE__ */ b({
|
|
|
788
791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
789
792
|
viewBox: "0 0 1024 1024"
|
|
790
793
|
}, [
|
|
791
|
-
|
|
794
|
+
b("path", {
|
|
792
795
|
fill: "currentColor",
|
|
793
796
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
794
797
|
}),
|
|
795
|
-
|
|
798
|
+
b("path", {
|
|
796
799
|
fill: "currentColor",
|
|
797
800
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
|
|
798
801
|
})
|
|
799
802
|
]));
|
|
800
803
|
}
|
|
801
|
-
}), Et = jt, It = /* @__PURE__ */
|
|
804
|
+
}), Et = jt, It = /* @__PURE__ */ y({
|
|
802
805
|
name: "Upload",
|
|
803
806
|
__name: "upload",
|
|
804
807
|
setup(e) {
|
|
@@ -806,13 +809,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
806
809
|
xmlns: "http://www.w3.org/2000/svg",
|
|
807
810
|
viewBox: "0 0 1024 1024"
|
|
808
811
|
}, [
|
|
809
|
-
|
|
812
|
+
b("path", {
|
|
810
813
|
fill: "currentColor",
|
|
811
814
|
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"
|
|
812
815
|
})
|
|
813
816
|
]));
|
|
814
817
|
}
|
|
815
|
-
}),
|
|
818
|
+
}), Ae = It, Nt = /* @__PURE__ */ y({
|
|
816
819
|
name: "View",
|
|
817
820
|
__name: "view",
|
|
818
821
|
setup(e) {
|
|
@@ -820,13 +823,13 @@ var yt = /* @__PURE__ */ b({
|
|
|
820
823
|
xmlns: "http://www.w3.org/2000/svg",
|
|
821
824
|
viewBox: "0 0 1024 1024"
|
|
822
825
|
}, [
|
|
823
|
-
|
|
826
|
+
b("path", {
|
|
824
827
|
fill: "currentColor",
|
|
825
828
|
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
|
|
826
829
|
})
|
|
827
830
|
]));
|
|
828
831
|
}
|
|
829
|
-
}), Fe = Nt, Ut = /* @__PURE__ */
|
|
832
|
+
}), Fe = Nt, Ut = /* @__PURE__ */ y({
|
|
830
833
|
name: "Warning",
|
|
831
834
|
__name: "warning",
|
|
832
835
|
setup(e) {
|
|
@@ -834,14 +837,14 @@ var yt = /* @__PURE__ */ b({
|
|
|
834
837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
835
838
|
viewBox: "0 0 1024 1024"
|
|
836
839
|
}, [
|
|
837
|
-
|
|
840
|
+
b("path", {
|
|
838
841
|
fill: "currentColor",
|
|
839
842
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
|
|
840
843
|
})
|
|
841
844
|
]));
|
|
842
845
|
}
|
|
843
846
|
}), qt = Ut;
|
|
844
|
-
const
|
|
847
|
+
const Gt = y({
|
|
845
848
|
name: "ZxtForm",
|
|
846
849
|
inheritAttrs: !1,
|
|
847
850
|
props: {
|
|
@@ -852,7 +855,7 @@ const Wt = b({
|
|
|
852
855
|
},
|
|
853
856
|
emits: ["submit", "reset"],
|
|
854
857
|
setup(e, { emit: t, expose: a }) {
|
|
855
|
-
const
|
|
858
|
+
const s = k(null), u = We({}), d = {
|
|
856
859
|
input: "el-input",
|
|
857
860
|
select: "el-select",
|
|
858
861
|
date: "el-date-picker",
|
|
@@ -860,159 +863,159 @@ const Wt = b({
|
|
|
860
863
|
datetime: "el-date-picker",
|
|
861
864
|
datetimerange: "el-date-picker",
|
|
862
865
|
cascader: "el-cascader"
|
|
863
|
-
}, l = (
|
|
864
|
-
const
|
|
866
|
+
}, l = (r) => d[r] || "el-input", c = (r) => {
|
|
867
|
+
const v = r.type || "input", L = [
|
|
865
868
|
"select",
|
|
866
869
|
"date",
|
|
867
870
|
"daterange",
|
|
868
871
|
"datetime",
|
|
869
872
|
"datetimerange",
|
|
870
873
|
"cascader"
|
|
871
|
-
].includes(
|
|
872
|
-
placeholder:
|
|
873
|
-
disabled:
|
|
874
|
+
].includes(v), J = {
|
|
875
|
+
placeholder: r.placeholder || `请${L ? "选择" : "输入"}${r.label}`,
|
|
876
|
+
disabled: r.disabled,
|
|
874
877
|
style: "width: 100%",
|
|
875
878
|
"popper-class": "zxt-form-popper"
|
|
876
879
|
};
|
|
877
|
-
let
|
|
878
|
-
switch (
|
|
880
|
+
let F = {};
|
|
881
|
+
switch (v) {
|
|
879
882
|
case "date":
|
|
880
883
|
case "daterange":
|
|
881
884
|
case "datetime":
|
|
882
885
|
case "datetimerange":
|
|
883
|
-
|
|
884
|
-
type:
|
|
885
|
-
startPlaceholder:
|
|
886
|
-
endPlaceholder:
|
|
887
|
-
format:
|
|
888
|
-
valueFormat:
|
|
886
|
+
F = {
|
|
887
|
+
type: r.dateType || v,
|
|
888
|
+
startPlaceholder: r.startPlaceholder || "开始日期",
|
|
889
|
+
endPlaceholder: r.endPlaceholder || "结束日期",
|
|
890
|
+
format: r.format,
|
|
891
|
+
valueFormat: r.valueFormat
|
|
889
892
|
};
|
|
890
893
|
break;
|
|
891
894
|
case "cascader":
|
|
892
|
-
|
|
893
|
-
options:
|
|
894
|
-
props:
|
|
895
|
-
clearable:
|
|
895
|
+
F = {
|
|
896
|
+
options: r.options,
|
|
897
|
+
props: r.cascaderProps,
|
|
898
|
+
clearable: r.clearable !== !1
|
|
896
899
|
};
|
|
897
900
|
break;
|
|
898
901
|
default:
|
|
899
|
-
|
|
902
|
+
F = {};
|
|
900
903
|
}
|
|
901
904
|
const E = {
|
|
902
905
|
...J,
|
|
903
|
-
...
|
|
906
|
+
...F
|
|
904
907
|
};
|
|
905
|
-
return "clearable" in
|
|
906
|
-
}, g = _(() => e.formColumns.map((
|
|
907
|
-
...
|
|
908
|
+
return "clearable" in r && (E.clearable = r.clearable), r.props && typeof r.props == "object" && Object.assign(E, r.props), E;
|
|
909
|
+
}, g = _(() => e.formColumns.map((r) => ({
|
|
910
|
+
...r,
|
|
908
911
|
colSpan: {
|
|
909
|
-
xs:
|
|
910
|
-
sm:
|
|
911
|
-
md:
|
|
912
|
-
lg:
|
|
913
|
-
xl:
|
|
912
|
+
xs: r.xs ?? r.span ?? 24,
|
|
913
|
+
sm: r.sm ?? r.span ?? 12,
|
|
914
|
+
md: r.md ?? r.span ?? 12,
|
|
915
|
+
lg: r.lg ?? r.span ?? 12,
|
|
916
|
+
xl: r.xl ?? r.span ?? 12
|
|
914
917
|
}
|
|
915
918
|
})));
|
|
916
919
|
X(
|
|
917
920
|
() => e.initialFormData,
|
|
918
|
-
(
|
|
919
|
-
Object.keys(u).forEach((
|
|
920
|
-
delete u[
|
|
921
|
-
}), Object.assign(u,
|
|
921
|
+
(r) => {
|
|
922
|
+
Object.keys(u).forEach((v) => {
|
|
923
|
+
delete u[v];
|
|
924
|
+
}), Object.assign(u, r);
|
|
922
925
|
},
|
|
923
926
|
{ immediate: !0, deep: !0 }
|
|
924
927
|
);
|
|
925
928
|
const z = _(() => {
|
|
926
|
-
const
|
|
927
|
-
return Object.keys(
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
929
|
+
const r = { ...e.rules };
|
|
930
|
+
return Object.keys(r).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((v) => {
|
|
931
|
+
if (v.required) {
|
|
932
|
+
const L = [
|
|
930
933
|
"select",
|
|
931
934
|
"date",
|
|
932
935
|
"daterange",
|
|
933
936
|
"datetime",
|
|
934
937
|
"datetimerange",
|
|
935
938
|
"cascader"
|
|
936
|
-
].includes(
|
|
937
|
-
|
|
939
|
+
].includes(v.type);
|
|
940
|
+
r[v.prop] = [
|
|
938
941
|
{
|
|
939
942
|
required: !0,
|
|
940
|
-
message: `请${
|
|
941
|
-
trigger:
|
|
943
|
+
message: `请${L ? "选择" : "输入"}${v.label}`,
|
|
944
|
+
trigger: L ? "change" : "blur"
|
|
942
945
|
}
|
|
943
946
|
];
|
|
944
947
|
}
|
|
945
|
-
}),
|
|
946
|
-
}),
|
|
947
|
-
|
|
948
|
-
|
|
948
|
+
}), r;
|
|
949
|
+
}), f = () => {
|
|
950
|
+
s.value && s.value.validate((r) => {
|
|
951
|
+
r && t("submit", { ...u });
|
|
949
952
|
});
|
|
950
953
|
}, n = () => {
|
|
951
|
-
|
|
952
|
-
},
|
|
954
|
+
s.value && s.value.resetFields(), t("reset");
|
|
955
|
+
}, C = (r) => () => wt(r, u, {}) || null;
|
|
953
956
|
return a({
|
|
954
|
-
validate: () =>
|
|
955
|
-
resetFields: () =>
|
|
957
|
+
validate: () => s.value ? s.value.validate() : Promise.resolve(!1),
|
|
958
|
+
resetFields: () => s.value && s.value.resetFields(),
|
|
956
959
|
getFormData: () => ({ ...u }),
|
|
957
|
-
submitForm:
|
|
960
|
+
submitForm: f,
|
|
958
961
|
resetForm: n
|
|
959
962
|
}), {
|
|
960
|
-
formRef:
|
|
963
|
+
formRef: s,
|
|
961
964
|
formData: u,
|
|
962
965
|
formRules: z,
|
|
963
|
-
submitForm:
|
|
966
|
+
submitForm: f,
|
|
964
967
|
resetForm: n,
|
|
965
968
|
processedColumns: g,
|
|
966
969
|
getComponentType: l,
|
|
967
970
|
getComponentProps: c,
|
|
968
|
-
renderCustomItem:
|
|
971
|
+
renderCustomItem: C
|
|
969
972
|
};
|
|
970
973
|
}
|
|
971
|
-
}),
|
|
974
|
+
}), Wt = { class: "zxt-form-container" }, Jt = {
|
|
972
975
|
key: 0,
|
|
973
976
|
class: "form-label"
|
|
974
977
|
}, Kt = { class: "form-control" };
|
|
975
|
-
function Qt(e, t, a,
|
|
976
|
-
const l = S("el-option"), c = S("el-form-item"), g = S("el-col"), z = S("el-row"),
|
|
977
|
-
return i(), m("div",
|
|
978
|
-
|
|
978
|
+
function Qt(e, t, a, s, u, d) {
|
|
979
|
+
const l = S("el-option"), c = S("el-form-item"), g = S("el-col"), z = S("el-row"), f = S("el-form");
|
|
980
|
+
return i(), m("div", Wt, [
|
|
981
|
+
A(f, M({ ref: "formRef" }, e.$attrs, {
|
|
979
982
|
model: e.formData,
|
|
980
983
|
rules: e.formRules,
|
|
981
984
|
"label-width": e.labelWidth,
|
|
982
985
|
class: "zxt-form"
|
|
983
986
|
}), {
|
|
984
987
|
default: w(() => [
|
|
985
|
-
|
|
988
|
+
A(z, { gutter: 20 }, {
|
|
986
989
|
default: w(() => [
|
|
987
|
-
(i(!0), m(
|
|
990
|
+
(i(!0), m(B, null, O(e.processedColumns, (n, C) => (i(), V(g, M({ key: C }, { ref_for: !0 }, n.colSpan), {
|
|
988
991
|
default: w(() => [
|
|
989
|
-
|
|
992
|
+
A(c, {
|
|
990
993
|
prop: n.prop,
|
|
991
994
|
required: n.required,
|
|
992
995
|
"label-width": "0",
|
|
993
996
|
class: "custom-form-item"
|
|
994
997
|
}, {
|
|
995
998
|
default: w(() => [
|
|
996
|
-
|
|
999
|
+
b("div", {
|
|
997
1000
|
class: ue(["form-item-wrapper", { "is-action": n.isAction }])
|
|
998
1001
|
}, [
|
|
999
|
-
n.label ? (i(), m("span", Jt, ee(n.label), 1)) :
|
|
1000
|
-
|
|
1002
|
+
n.label ? (i(), m("span", Jt, ee(n.label), 1)) : G("", !0),
|
|
1003
|
+
b("div", Kt, [
|
|
1001
1004
|
n.type === "slot" ? T(e.$slots, n.slotName || n.prop, {
|
|
1002
1005
|
key: 0,
|
|
1003
1006
|
formData: e.formData,
|
|
1004
1007
|
column: n
|
|
1005
|
-
}, void 0, !0) : n.itemRender ? (i(), V(
|
|
1008
|
+
}, void 0, !0) : n.itemRender ? (i(), V(ze(e.renderCustomItem(n)), { key: 1 })) : (i(), V(ze(e.getComponentType(n.type)), M({
|
|
1006
1009
|
key: 2,
|
|
1007
1010
|
modelValue: e.formData[n.prop],
|
|
1008
|
-
"onUpdate:modelValue": (
|
|
1011
|
+
"onUpdate:modelValue": (r) => e.formData[n.prop] = r
|
|
1009
1012
|
}, { ref_for: !0 }, e.getComponentProps(n), Je(n.events || {})), {
|
|
1010
1013
|
default: w(() => [
|
|
1011
|
-
n.type === "select" ? (i(!0), m(
|
|
1012
|
-
key:
|
|
1013
|
-
label:
|
|
1014
|
-
value:
|
|
1015
|
-
}, null, 8, ["label", "value"]))), 128)) :
|
|
1014
|
+
n.type === "select" ? (i(!0), m(B, { key: 0 }, O(n.options, (r, v) => (i(), V(l, {
|
|
1015
|
+
key: v,
|
|
1016
|
+
label: r.label,
|
|
1017
|
+
value: r.value
|
|
1018
|
+
}, null, 8, ["label", "value"]))), 128)) : G("", !0)
|
|
1016
1019
|
]),
|
|
1017
1020
|
_: 2
|
|
1018
1021
|
}, 1040, ["modelValue", "onUpdate:modelValue"]))
|
|
@@ -1032,28 +1035,28 @@ function Qt(e, t, a, r, u, d) {
|
|
|
1032
1035
|
}, 16, ["model", "rules", "label-width"])
|
|
1033
1036
|
]);
|
|
1034
1037
|
}
|
|
1035
|
-
const Re = /* @__PURE__ */
|
|
1036
|
-
Plus:
|
|
1037
|
-
Delete:
|
|
1038
|
+
const Re = /* @__PURE__ */ W(Gt, [["render", Qt], ["__scopeId", "data-v-6b22a57b"]]), Xt = {
|
|
1039
|
+
Plus: Pe,
|
|
1040
|
+
Delete: ke,
|
|
1038
1041
|
Refresh: se,
|
|
1039
|
-
Download:
|
|
1042
|
+
Download: $e,
|
|
1040
1043
|
Search: ie,
|
|
1041
|
-
Edit:
|
|
1044
|
+
Edit: Ve,
|
|
1042
1045
|
View: Fe,
|
|
1043
|
-
Upload:
|
|
1044
|
-
Setting:
|
|
1046
|
+
Upload: Ae,
|
|
1047
|
+
Setting: De,
|
|
1045
1048
|
Warning: qt,
|
|
1046
1049
|
Check: zt,
|
|
1047
1050
|
Close: kt,
|
|
1048
|
-
Document:
|
|
1051
|
+
Document: At,
|
|
1049
1052
|
CopyDocument: Vt,
|
|
1050
|
-
Share:
|
|
1053
|
+
Share: Ht,
|
|
1051
1054
|
Lock: Ot,
|
|
1052
1055
|
Unlock: Et,
|
|
1053
|
-
ArrowDown:
|
|
1054
|
-
}, Yt =
|
|
1056
|
+
ArrowDown: Le
|
|
1057
|
+
}, Yt = y({
|
|
1055
1058
|
name: "ActionColumn",
|
|
1056
|
-
components: { ArrowDown:
|
|
1059
|
+
components: { ArrowDown: Le },
|
|
1057
1060
|
props: {
|
|
1058
1061
|
buttons: {
|
|
1059
1062
|
type: Array,
|
|
@@ -1070,13 +1073,15 @@ const Re = /* @__PURE__ */ G(Wt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1070
1073
|
},
|
|
1071
1074
|
emits: ["action-click"],
|
|
1072
1075
|
setup(e, { emit: t }) {
|
|
1073
|
-
const a = _(() => e.buttons.filter((n) => typeof n.visible == "function" ? n.visible(e.row) : typeof n.visible == "boolean" ? n.visible : !0)),
|
|
1076
|
+
const a = _(() => e.buttons.filter((n) => typeof n.visible == "function" ? n.visible(e.row) : typeof n.visible == "boolean" ? n.visible : !0)), s = _(
|
|
1074
1077
|
() => a.value.length > e.maxVisible
|
|
1075
1078
|
), u = _(
|
|
1076
|
-
() =>
|
|
1079
|
+
() => s.value ? a.value.slice(0, e.maxVisible) : a.value
|
|
1077
1080
|
), d = _(
|
|
1078
|
-
() =>
|
|
1079
|
-
)
|
|
1081
|
+
() => s.value ? a.value.slice(e.maxVisible) : []
|
|
1082
|
+
);
|
|
1083
|
+
console.log("[ActionColumn][5] props.buttons =", e.buttons), console.log("[ActionColumn][5] row =", e.row), console.log("[ActionColumn][5] resolvedButtons =", a.value), console.log("[ActionColumn][5] visibleButtons =", u.value), console.log("[ActionColumn][5] overflowButtons =", d.value);
|
|
1084
|
+
const l = (n) => {
|
|
1080
1085
|
if (n)
|
|
1081
1086
|
return typeof n == "object" || typeof n == "function" ? n : Xt[n];
|
|
1082
1087
|
}, c = (n) => {
|
|
@@ -1086,8 +1091,8 @@ const Re = /* @__PURE__ */ G(Wt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1086
1091
|
visibleButtons: u,
|
|
1087
1092
|
overflowButtons: d,
|
|
1088
1093
|
getIconComponent: l,
|
|
1089
|
-
handleClick: (n,
|
|
1090
|
-
c(
|
|
1094
|
+
handleClick: (n, C) => {
|
|
1095
|
+
c(C), t("action-click", { code: n.code, button: n, row: e.row });
|
|
1091
1096
|
},
|
|
1092
1097
|
handleCommand: (n) => {
|
|
1093
1098
|
t("action-click", { code: n.code, button: n, row: e.row });
|
|
@@ -1098,22 +1103,22 @@ const Re = /* @__PURE__ */ G(Wt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1098
1103
|
};
|
|
1099
1104
|
}
|
|
1100
1105
|
}), ea = { class: "action-column" };
|
|
1101
|
-
function ta(e, t, a,
|
|
1102
|
-
const l = S("el-button"), c = S("ArrowDown"), g = S("el-icon"), z = S("el-dropdown-item"),
|
|
1106
|
+
function ta(e, t, a, s, u, d) {
|
|
1107
|
+
const l = S("el-button"), c = S("ArrowDown"), g = S("el-icon"), z = S("el-dropdown-item"), f = S("el-dropdown-menu"), n = S("el-dropdown");
|
|
1103
1108
|
return i(), m("div", ea, [
|
|
1104
|
-
(i(!0), m(
|
|
1105
|
-
key:
|
|
1109
|
+
(i(!0), m(B, null, O(e.visibleButtons, (C) => (i(), V(l, {
|
|
1110
|
+
key: C.code,
|
|
1106
1111
|
class: "action-btn",
|
|
1107
|
-
type:
|
|
1108
|
-
icon: e.getIconComponent(
|
|
1112
|
+
type: C.type || "",
|
|
1113
|
+
icon: e.getIconComponent(C.icon),
|
|
1109
1114
|
size: "small",
|
|
1110
1115
|
link: "",
|
|
1111
1116
|
onMousedown: t[0] || (t[0] = Te(() => {
|
|
1112
1117
|
}, ["prevent"])),
|
|
1113
|
-
onClick: (
|
|
1118
|
+
onClick: (r) => e.handleClick(C, r)
|
|
1114
1119
|
}, {
|
|
1115
1120
|
default: w(() => [
|
|
1116
|
-
j(ee(
|
|
1121
|
+
j(ee(C.label), 1)
|
|
1117
1122
|
]),
|
|
1118
1123
|
_: 2
|
|
1119
1124
|
}, 1032, ["type", "icon", "onClick"]))), 128)),
|
|
@@ -1123,15 +1128,15 @@ function ta(e, t, a, r, u, d) {
|
|
|
1123
1128
|
onCommand: e.handleCommand
|
|
1124
1129
|
}, {
|
|
1125
1130
|
dropdown: w(() => [
|
|
1126
|
-
|
|
1131
|
+
A(f, null, {
|
|
1127
1132
|
default: w(() => [
|
|
1128
|
-
(i(!0), m(
|
|
1129
|
-
key:
|
|
1130
|
-
command:
|
|
1131
|
-
icon: e.getIconComponent(
|
|
1133
|
+
(i(!0), m(B, null, O(e.overflowButtons, (C) => (i(), V(z, {
|
|
1134
|
+
key: C.code,
|
|
1135
|
+
command: C,
|
|
1136
|
+
icon: e.getIconComponent(C.icon)
|
|
1132
1137
|
}, {
|
|
1133
1138
|
default: w(() => [
|
|
1134
|
-
j(ee(
|
|
1139
|
+
j(ee(C.label), 1)
|
|
1135
1140
|
]),
|
|
1136
1141
|
_: 2
|
|
1137
1142
|
}, 1032, ["command", "icon"]))), 128))
|
|
@@ -1140,7 +1145,7 @@ function ta(e, t, a, r, u, d) {
|
|
|
1140
1145
|
})
|
|
1141
1146
|
]),
|
|
1142
1147
|
default: w(() => [
|
|
1143
|
-
|
|
1148
|
+
A(l, {
|
|
1144
1149
|
class: "action-btn",
|
|
1145
1150
|
type: "",
|
|
1146
1151
|
size: "small",
|
|
@@ -1151,9 +1156,9 @@ function ta(e, t, a, r, u, d) {
|
|
|
1151
1156
|
}, {
|
|
1152
1157
|
default: w(() => [
|
|
1153
1158
|
t[2] || (t[2] = j(" 更多 ", -1)),
|
|
1154
|
-
|
|
1159
|
+
A(g, { class: "el-icon--right" }, {
|
|
1155
1160
|
default: w(() => [
|
|
1156
|
-
|
|
1161
|
+
A(c)
|
|
1157
1162
|
]),
|
|
1158
1163
|
_: 1
|
|
1159
1164
|
})
|
|
@@ -1162,25 +1167,25 @@ function ta(e, t, a, r, u, d) {
|
|
|
1162
1167
|
}, 8, ["onClick"])
|
|
1163
1168
|
]),
|
|
1164
1169
|
_: 1
|
|
1165
|
-
}, 8, ["onCommand"])) :
|
|
1170
|
+
}, 8, ["onCommand"])) : G("", !0)
|
|
1166
1171
|
]);
|
|
1167
1172
|
}
|
|
1168
|
-
const aa = /* @__PURE__ */
|
|
1173
|
+
const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7"]]), na = y({
|
|
1169
1174
|
name: "ZxtGrid",
|
|
1170
1175
|
inheritAttrs: !1,
|
|
1171
1176
|
components: {
|
|
1172
|
-
ZxtTable:
|
|
1177
|
+
ZxtTable: x,
|
|
1173
1178
|
ZxtForm: Re,
|
|
1174
1179
|
ActionColumn: aa,
|
|
1175
|
-
Plus:
|
|
1176
|
-
Delete:
|
|
1180
|
+
Plus: Pe,
|
|
1181
|
+
Delete: ke,
|
|
1177
1182
|
Refresh: se,
|
|
1178
|
-
Download:
|
|
1183
|
+
Download: $e,
|
|
1179
1184
|
Search: ie,
|
|
1180
|
-
Edit:
|
|
1185
|
+
Edit: Ve,
|
|
1181
1186
|
View: Fe,
|
|
1182
|
-
Upload:
|
|
1183
|
-
Setting:
|
|
1187
|
+
Upload: Ae,
|
|
1188
|
+
Setting: De
|
|
1184
1189
|
},
|
|
1185
1190
|
props: {
|
|
1186
1191
|
// 网格配置选项
|
|
@@ -1208,35 +1213,48 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1208
1213
|
},
|
|
1209
1214
|
emits: ["toolbar-click", "action-click", "submit", "reset", "page-change", "size-change"],
|
|
1210
1215
|
setup(e, { emit: t, expose: a }) {
|
|
1211
|
-
const
|
|
1216
|
+
const s = Ke(), u = xe(), d = k(null), l = k(null), c = k(1), g = k(10), z = k(null), f = k(e.gridOptions.formMode !== !1), n = k({
|
|
1212
1217
|
...e.gridOptions.formConfig?.data || {}
|
|
1213
|
-
}),
|
|
1214
|
-
Plus:
|
|
1215
|
-
Delete:
|
|
1218
|
+
}), C = {
|
|
1219
|
+
Plus: Pe,
|
|
1220
|
+
Delete: ke,
|
|
1216
1221
|
Refresh: se,
|
|
1217
|
-
Download:
|
|
1222
|
+
Download: $e,
|
|
1218
1223
|
Search: ie,
|
|
1219
|
-
Edit:
|
|
1224
|
+
Edit: Ve,
|
|
1220
1225
|
View: Fe,
|
|
1221
|
-
Upload:
|
|
1222
|
-
Setting:
|
|
1223
|
-
},
|
|
1226
|
+
Upload: Ae,
|
|
1227
|
+
Setting: De
|
|
1228
|
+
}, r = _(() => {
|
|
1224
1229
|
const o = e.gridOptions.columns || [];
|
|
1225
1230
|
console.log("cols", e.gridOptions.columns);
|
|
1226
1231
|
const h = o.find((D) => D.actionColumn);
|
|
1227
1232
|
return h ? h.actionColumn : null;
|
|
1228
|
-
}),
|
|
1233
|
+
}), v = _(() => (e.gridOptions.columns || []).map((h) => h.actionColumn ? {
|
|
1229
1234
|
...h,
|
|
1230
1235
|
slot: "__action__",
|
|
1231
1236
|
actionColumn: void 0
|
|
1232
|
-
} : h))
|
|
1237
|
+
} : h));
|
|
1238
|
+
console.log("[ZxtGrid][1] source columns =", e.gridOptions.columns), console.log(
|
|
1239
|
+
"[ZxtGrid][1] source action col =",
|
|
1240
|
+
(e.gridOptions.columns || []).find((o) => o?.actionColumn)
|
|
1241
|
+
), console.log("[ZxtGrid][2] mergedColumns =", v.value), console.log(
|
|
1242
|
+
"[ZxtGrid][2] merged action slot col =",
|
|
1243
|
+
v.value.find((o) => o?.slot === "__action__")
|
|
1244
|
+
), console.log("[ZxtGrid][3] actionColumnConfig =", r.value), console.log(
|
|
1245
|
+
"[ZxtGrid][3] buttons =",
|
|
1246
|
+
r.value?.buttons,
|
|
1247
|
+
"len=",
|
|
1248
|
+
r.value?.buttons?.length
|
|
1249
|
+
);
|
|
1250
|
+
const L = (o) => {
|
|
1233
1251
|
t("action-click", o);
|
|
1234
1252
|
}, J = _(() => {
|
|
1235
1253
|
const o = e.gridOptions.formConfig;
|
|
1236
1254
|
if (!o || !o.items) return [];
|
|
1237
1255
|
const h = [...o.items];
|
|
1238
1256
|
return h.some(
|
|
1239
|
-
(
|
|
1257
|
+
(H) => H.type === "slot" && H.slotName === "search-actions"
|
|
1240
1258
|
) || h.push({
|
|
1241
1259
|
type: "slot",
|
|
1242
1260
|
slotName: "search-actions",
|
|
@@ -1245,7 +1263,7 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1245
1263
|
isAction: !0,
|
|
1246
1264
|
...o.actionConfig
|
|
1247
1265
|
}), h;
|
|
1248
|
-
}),
|
|
1266
|
+
}), F = _(() => {
|
|
1249
1267
|
const o = /* @__PURE__ */ new Set(["search-actions"]);
|
|
1250
1268
|
return (J.value || []).forEach((h) => {
|
|
1251
1269
|
h.type === "slot" && o.add(h.slotName || h.prop);
|
|
@@ -1253,24 +1271,24 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1253
1271
|
}), E = _(() => {
|
|
1254
1272
|
const o = {};
|
|
1255
1273
|
for (const h in u)
|
|
1256
|
-
h === "search-actions" || h === "toolbar" || (
|
|
1274
|
+
h === "search-actions" || h === "toolbar" || (F.value.has(h) || h.startsWith("form-")) && (o[h] = u[h]);
|
|
1257
1275
|
return o;
|
|
1258
1276
|
}), de = _(() => {
|
|
1259
1277
|
const o = {};
|
|
1260
1278
|
for (const h in u)
|
|
1261
|
-
h !== "toolbar" && !
|
|
1279
|
+
h !== "toolbar" && !F.value.has(h) && !h.startsWith("form-") && (o[h] = u[h]);
|
|
1262
1280
|
return o;
|
|
1263
1281
|
}), ce = () => {
|
|
1264
1282
|
l.value?.submitForm();
|
|
1265
1283
|
}, pe = (o) => {
|
|
1266
1284
|
t("submit", o), e.gridOptions.proxyConfig && (n.value = { ...o }, c.value = 1, d.value?.reload?.({ formData: n.value, page: 1 }));
|
|
1267
|
-
},
|
|
1285
|
+
}, Z = () => {
|
|
1268
1286
|
l.value?.resetForm();
|
|
1269
1287
|
}, oe = () => {
|
|
1270
1288
|
t("reset"), e.gridOptions.proxyConfig && (n.value = {}, c.value = 1, d.value?.reload?.({ formData: {}, page: 1 }));
|
|
1271
1289
|
}, fe = (o) => {
|
|
1272
1290
|
if (o)
|
|
1273
|
-
return typeof o == "object" || typeof o == "function" ? o :
|
|
1291
|
+
return typeof o == "object" || typeof o == "function" ? o : C[o];
|
|
1274
1292
|
}, me = _(() => {
|
|
1275
1293
|
const o = e.gridOptions.proxyConfig;
|
|
1276
1294
|
return o ? {
|
|
@@ -1282,30 +1300,30 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1282
1300
|
formConfig: o,
|
|
1283
1301
|
toolbar: h,
|
|
1284
1302
|
formMode: D,
|
|
1285
|
-
formColumns:
|
|
1303
|
+
formColumns: H,
|
|
1286
1304
|
rules: re,
|
|
1287
1305
|
data: ye,
|
|
1288
|
-
proxyConfig:
|
|
1306
|
+
proxyConfig: He,
|
|
1289
1307
|
...je
|
|
1290
1308
|
} = e.gridOptions;
|
|
1291
1309
|
return {
|
|
1292
1310
|
...je,
|
|
1293
|
-
proxyConfig: me.value ||
|
|
1311
|
+
proxyConfig: me.value || He || null
|
|
1294
1312
|
};
|
|
1295
|
-
}), le = _(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []),
|
|
1313
|
+
}), le = _(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), he = _(() => !!e.gridOptions.proxyConfig), p = _(() => he.value ? 0 : le.value.length), $ = (o, h) => {
|
|
1296
1314
|
t("toolbar-click", { code: o, button: h, grid: d.value });
|
|
1297
1315
|
}, I = (o) => {
|
|
1298
1316
|
c.value = o.page, t("page-change", o);
|
|
1299
1317
|
}, N = (o) => {
|
|
1300
1318
|
g.value = o.size, t("size-change", o);
|
|
1301
|
-
},
|
|
1319
|
+
}, ve = () => d.value, Ce = () => l.value, _e = () => d.value?.getTableRef()?.getSelectionRows?.() || [], we = (o) => {
|
|
1302
1320
|
z.value = o ?? null;
|
|
1303
|
-
},
|
|
1304
|
-
|
|
1321
|
+
}, be = (o) => {
|
|
1322
|
+
f.value = o;
|
|
1305
1323
|
}, U = (o, h = !0) => {
|
|
1306
1324
|
const D = e.gridOptions.formConfig;
|
|
1307
1325
|
D?.data && Object.assign(D.data, o), n.value = { ...D?.data || {}, ...o }, h && e.gridOptions.proxyConfig && (c.value = 1, d.value?.reload?.({ formData: n.value, page: 1 }));
|
|
1308
|
-
},
|
|
1326
|
+
}, R = (o, ...h) => {
|
|
1309
1327
|
const D = n.value;
|
|
1310
1328
|
switch (o) {
|
|
1311
1329
|
case "query":
|
|
@@ -1321,21 +1339,21 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1321
1339
|
X(
|
|
1322
1340
|
() => e.gridOptions.formMode,
|
|
1323
1341
|
(o) => {
|
|
1324
|
-
o !== void 0 && (
|
|
1342
|
+
o !== void 0 && (f.value = o);
|
|
1325
1343
|
}
|
|
1326
|
-
),
|
|
1344
|
+
), Be(() => {
|
|
1327
1345
|
e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && d.value?.reload?.({ formData: n.value, page: 1 });
|
|
1328
1346
|
});
|
|
1329
1347
|
const P = () => d.value?.getTableRef?.();
|
|
1330
1348
|
return a({
|
|
1331
|
-
getGridRef:
|
|
1332
|
-
getFormRef:
|
|
1349
|
+
getGridRef: ve,
|
|
1350
|
+
getFormRef: Ce,
|
|
1333
1351
|
getElTableRef: P,
|
|
1334
|
-
getSelectedRows:
|
|
1335
|
-
reloadData:
|
|
1336
|
-
setFormVisible:
|
|
1352
|
+
getSelectedRows: _e,
|
|
1353
|
+
reloadData: we,
|
|
1354
|
+
setFormVisible: be,
|
|
1337
1355
|
setFormData: U,
|
|
1338
|
-
commitProxy:
|
|
1356
|
+
commitProxy: R,
|
|
1339
1357
|
clearSelection: () => P()?.clearSelection(),
|
|
1340
1358
|
toggleRowSelection: (...o) => P()?.toggleRowSelection(...o),
|
|
1341
1359
|
toggleAllSelection: () => P()?.toggleAllSelection(),
|
|
@@ -1346,28 +1364,28 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1346
1364
|
doLayout: () => P()?.doLayout(),
|
|
1347
1365
|
sort: (...o) => P()?.sort(...o)
|
|
1348
1366
|
}), {
|
|
1349
|
-
attrs:
|
|
1367
|
+
attrs: s,
|
|
1350
1368
|
gridRef: d,
|
|
1351
1369
|
searchFormRef: l,
|
|
1352
1370
|
currentPage: c,
|
|
1353
1371
|
pageSize: g,
|
|
1354
1372
|
tableData: le,
|
|
1355
1373
|
tableProps: ge,
|
|
1356
|
-
mergedColumns:
|
|
1357
|
-
actionColumnConfig:
|
|
1358
|
-
total:
|
|
1359
|
-
isFormVisible:
|
|
1374
|
+
mergedColumns: v,
|
|
1375
|
+
actionColumnConfig: r,
|
|
1376
|
+
total: p,
|
|
1377
|
+
isFormVisible: f,
|
|
1360
1378
|
searchFormColumns: J,
|
|
1361
1379
|
formFilteredSlots: E,
|
|
1362
1380
|
tableFilteredSlots: de,
|
|
1363
1381
|
getIconComponent: fe,
|
|
1364
1382
|
handleToolbarClick: $,
|
|
1365
|
-
handleActionClick:
|
|
1383
|
+
handleActionClick: L,
|
|
1366
1384
|
handlePageChange: I,
|
|
1367
1385
|
handleSizeChange: N,
|
|
1368
1386
|
handleSearch: ce,
|
|
1369
1387
|
handleSearchSubmit: pe,
|
|
1370
|
-
handleReset:
|
|
1388
|
+
handleReset: Z,
|
|
1371
1389
|
handleSearchReset: oe,
|
|
1372
1390
|
Search: ie,
|
|
1373
1391
|
Refresh: se
|
|
@@ -1380,13 +1398,13 @@ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c
|
|
|
1380
1398
|
key: 0,
|
|
1381
1399
|
class: "grid-toolbar"
|
|
1382
1400
|
};
|
|
1383
|
-
function ia(e, t, a,
|
|
1401
|
+
function ia(e, t, a, s, u, d) {
|
|
1384
1402
|
const l = S("el-button"), c = S("ZxtForm"), g = S("ActionColumn"), z = S("ZxtTable");
|
|
1385
1403
|
return i(), m("div", {
|
|
1386
1404
|
class: ue(["zxt-grid-container", { "zxt-grid-container--full": e.gridOptions.height === "full" }])
|
|
1387
1405
|
}, [
|
|
1388
1406
|
e.gridOptions.formConfig && e.isFormVisible ? (i(), m("div", oa, [
|
|
1389
|
-
|
|
1407
|
+
A(c, {
|
|
1390
1408
|
ref: "searchFormRef",
|
|
1391
1409
|
"form-columns": e.searchFormColumns,
|
|
1392
1410
|
"initial-form-data": e.gridOptions.formConfig.data,
|
|
@@ -1395,8 +1413,8 @@ function ia(e, t, a, r, u, d) {
|
|
|
1395
1413
|
onReset: e.handleSearchReset
|
|
1396
1414
|
}, Y({
|
|
1397
1415
|
"search-actions": w(() => [
|
|
1398
|
-
|
|
1399
|
-
|
|
1416
|
+
b("div", la, [
|
|
1417
|
+
A(l, {
|
|
1400
1418
|
class: "btn-search",
|
|
1401
1419
|
icon: e.Search,
|
|
1402
1420
|
onClick: e.handleSearch
|
|
@@ -1406,7 +1424,7 @@ function ia(e, t, a, r, u, d) {
|
|
|
1406
1424
|
])]),
|
|
1407
1425
|
_: 1
|
|
1408
1426
|
}, 8, ["icon", "onClick"]),
|
|
1409
|
-
|
|
1427
|
+
A(l, {
|
|
1410
1428
|
class: "btn-reset",
|
|
1411
1429
|
icon: e.Refresh,
|
|
1412
1430
|
onClick: e.handleReset
|
|
@@ -1420,34 +1438,34 @@ function ia(e, t, a, r, u, d) {
|
|
|
1420
1438
|
]),
|
|
1421
1439
|
_: 2
|
|
1422
1440
|
}, [
|
|
1423
|
-
O(e.formFilteredSlots, (
|
|
1441
|
+
O(e.formFilteredSlots, (f, n) => ({
|
|
1424
1442
|
name: n,
|
|
1425
|
-
fn: w((
|
|
1426
|
-
T(e.$slots, n, Oe(Me(
|
|
1443
|
+
fn: w((C) => [
|
|
1444
|
+
T(e.$slots, n, Oe(Me(C)), void 0, !0)
|
|
1427
1445
|
])
|
|
1428
1446
|
}))
|
|
1429
1447
|
]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
|
|
1430
|
-
])) :
|
|
1431
|
-
|
|
1448
|
+
])) : G("", !0),
|
|
1449
|
+
b("div", ra, [
|
|
1432
1450
|
e.gridOptions.toolbar ? (i(), m("div", sa, [
|
|
1433
|
-
(i(!0), m(
|
|
1451
|
+
(i(!0), m(B, null, O(e.gridOptions.toolbar.buttons, (f, n) => (i(), V(l, {
|
|
1434
1452
|
key: n,
|
|
1435
|
-
type:
|
|
1436
|
-
size:
|
|
1437
|
-
icon: e.getIconComponent(
|
|
1438
|
-
disabled:
|
|
1439
|
-
onClick: (
|
|
1453
|
+
type: f.type || "default",
|
|
1454
|
+
size: f.size || "small",
|
|
1455
|
+
icon: e.getIconComponent(f.icon),
|
|
1456
|
+
disabled: f.disabled,
|
|
1457
|
+
onClick: (C) => e.handleToolbarClick(f.code, f)
|
|
1440
1458
|
}, {
|
|
1441
1459
|
default: w(() => [
|
|
1442
|
-
j(ee(
|
|
1460
|
+
j(ee(f.name), 1)
|
|
1443
1461
|
]),
|
|
1444
1462
|
_: 2
|
|
1445
1463
|
}, 1032, ["type", "size", "icon", "disabled", "onClick"]))), 128)),
|
|
1446
1464
|
T(e.$slots, "toolbar", {
|
|
1447
1465
|
grid: e.$refs.gridRef
|
|
1448
1466
|
}, void 0, !0)
|
|
1449
|
-
])) :
|
|
1450
|
-
|
|
1467
|
+
])) : G("", !0),
|
|
1468
|
+
A(z, M({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
|
|
1451
1469
|
id: e.gridOptions.id,
|
|
1452
1470
|
columns: e.mergedColumns,
|
|
1453
1471
|
data: e.tableData,
|
|
@@ -1464,35 +1482,35 @@ function ia(e, t, a, r, u, d) {
|
|
|
1464
1482
|
}), Y({ _: 2 }, [
|
|
1465
1483
|
e.actionColumnConfig ? {
|
|
1466
1484
|
name: "__action__",
|
|
1467
|
-
fn: w(({ row:
|
|
1468
|
-
|
|
1485
|
+
fn: w(({ row: f }) => [
|
|
1486
|
+
A(g, {
|
|
1469
1487
|
buttons: e.actionColumnConfig.buttons,
|
|
1470
|
-
row:
|
|
1488
|
+
row: f,
|
|
1471
1489
|
"max-visible": e.actionColumnConfig.maxVisible || 2,
|
|
1472
1490
|
onActionClick: e.handleActionClick
|
|
1473
1491
|
}, null, 8, ["buttons", "row", "max-visible", "onActionClick"])
|
|
1474
1492
|
]),
|
|
1475
1493
|
key: "0"
|
|
1476
1494
|
} : void 0,
|
|
1477
|
-
O(e.tableFilteredSlots, (
|
|
1495
|
+
O(e.tableFilteredSlots, (f, n) => ({
|
|
1478
1496
|
name: n,
|
|
1479
|
-
fn: w((
|
|
1480
|
-
T(e.$slots, n, Oe(Me(
|
|
1497
|
+
fn: w((C) => [
|
|
1498
|
+
T(e.$slots, n, Oe(Me(C)), void 0, !0)
|
|
1481
1499
|
])
|
|
1482
1500
|
}))
|
|
1483
1501
|
]), 1040, ["id", "columns", "data", "height", "pageable", "current-page", "page-size", "page-sizes", "total", "pagination-layout", "onPageChange", "onSizeChange"])
|
|
1484
1502
|
])
|
|
1485
1503
|
], 2);
|
|
1486
1504
|
}
|
|
1487
|
-
const
|
|
1505
|
+
const Ze = /* @__PURE__ */ W(na, [["render", ia], ["__scopeId", "data-v-d7c7dfc0"]]);
|
|
1488
1506
|
Q.install = function(e) {
|
|
1489
1507
|
e.component(Q.name, Q);
|
|
1490
1508
|
};
|
|
1491
1509
|
const ua = [
|
|
1492
1510
|
te,
|
|
1493
1511
|
ae,
|
|
1494
|
-
|
|
1495
|
-
|
|
1512
|
+
x,
|
|
1513
|
+
Ze,
|
|
1496
1514
|
Re,
|
|
1497
1515
|
Q
|
|
1498
1516
|
], da = (e) => {
|
|
@@ -1503,20 +1521,20 @@ const ua = [
|
|
|
1503
1521
|
install: da,
|
|
1504
1522
|
MyButton: te,
|
|
1505
1523
|
JsxButton: ae,
|
|
1506
|
-
ZxtTable:
|
|
1507
|
-
ZxtGrid:
|
|
1524
|
+
ZxtTable: x,
|
|
1525
|
+
ZxtGrid: Ze,
|
|
1508
1526
|
ZxtForm: Re,
|
|
1509
1527
|
ZxtPagination: Q,
|
|
1510
1528
|
// 暴露渲染器 API
|
|
1511
|
-
renderer:
|
|
1512
|
-
registerRenderer:
|
|
1529
|
+
renderer: x.renderer,
|
|
1530
|
+
registerRenderer: x.registerRenderer
|
|
1513
1531
|
};
|
|
1514
1532
|
export {
|
|
1515
1533
|
ae as JsxButton,
|
|
1516
1534
|
te as MyButton,
|
|
1517
1535
|
Re as ZxtForm,
|
|
1518
|
-
|
|
1536
|
+
Ze as ZxtGrid,
|
|
1519
1537
|
Q as ZxtPagination,
|
|
1520
|
-
|
|
1538
|
+
x as ZxtTable,
|
|
1521
1539
|
fa as default
|
|
1522
1540
|
};
|