zxt-table 0.6.5 → 0.6.6
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 +432 -423
- package/dist/zxt-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/zxt-table.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as g, openBlock as s, normalizeClass as ue, renderSlot as M, defineComponent as b, createVNode as F, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as Ie, computed as w, mergeProps as L, withCtx as _, Fragment as H, renderList as O, createSlots as Y, resolveDynamicComponent as be, createTextVNode as j, toDisplayString as ee, useSlots as Be, provide as Ne, onMounted as Le, nextTick as xe, resolveDirective as Ue, normalizeStyle as qe, withDirectives as We, createCommentVNode as G, createElementVNode as y, reactive as Ge, toHandlers as Je, withModifiers as Te, useAttrs as Ke, normalizeProps as Me, guardReactiveProps as Oe } 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, ElIcon as lt, ElDropdownMenu as rt, ElDropdownItem as st, ElDropdown as it, ElButton as ut } from "element-plus";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
for (const [
|
|
6
|
-
|
|
7
|
-
return
|
|
3
|
+
const J = (e, t) => {
|
|
4
|
+
const n = e.__vccOpts || e;
|
|
5
|
+
for (const [l, u] of t)
|
|
6
|
+
n[l] = u;
|
|
7
|
+
return n;
|
|
8
8
|
}, dt = {
|
|
9
9
|
name: "MyButton",
|
|
10
10
|
props: {
|
|
@@ -21,22 +21,22 @@ const G = (e, t) => {
|
|
|
21
21
|
emits: ["click"],
|
|
22
22
|
setup(e, { emit: t }) {
|
|
23
23
|
return {
|
|
24
|
-
handleClick: (
|
|
25
|
-
t("click",
|
|
24
|
+
handleClick: (l) => {
|
|
25
|
+
t("click", l);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}, ct = ["disabled"];
|
|
30
|
-
function pt(e, t,
|
|
31
|
-
return
|
|
32
|
-
class: ue(["my-button", [`my-button--${
|
|
33
|
-
disabled:
|
|
34
|
-
onClick: t[0] || (t[0] = (...
|
|
30
|
+
function pt(e, t, n, l, u, d) {
|
|
31
|
+
return s(), g("button", {
|
|
32
|
+
class: ue(["my-button", [`my-button--${n.type}`, { "is-disabled": n.disabled }]]),
|
|
33
|
+
disabled: n.disabled,
|
|
34
|
+
onClick: t[0] || (t[0] = (...r) => l.handleClick && l.handleClick(...r))
|
|
35
35
|
}, [
|
|
36
|
-
|
|
36
|
+
M(e.$slots, "default", {}, void 0, !0)
|
|
37
37
|
], 10, ct);
|
|
38
38
|
}
|
|
39
|
-
const te = /* @__PURE__ */
|
|
39
|
+
const te = /* @__PURE__ */ J(dt, [["render", pt], ["__scopeId", "data-v-4480e77d"]]);
|
|
40
40
|
te.install = function(e) {
|
|
41
41
|
e.component(te.name, te);
|
|
42
42
|
};
|
|
@@ -56,9 +56,9 @@ const ae = /* @__PURE__ */ b({
|
|
|
56
56
|
emits: ["click"],
|
|
57
57
|
setup(e, {
|
|
58
58
|
emit: t,
|
|
59
|
-
slots:
|
|
59
|
+
slots: n
|
|
60
60
|
}) {
|
|
61
|
-
const
|
|
61
|
+
const l = (u) => {
|
|
62
62
|
e.disabled || t("click", u);
|
|
63
63
|
};
|
|
64
64
|
return () => F("button", {
|
|
@@ -66,8 +66,8 @@ const ae = /* @__PURE__ */ b({
|
|
|
66
66
|
"is-disabled": e.disabled
|
|
67
67
|
}],
|
|
68
68
|
disabled: e.disabled,
|
|
69
|
-
onClick:
|
|
70
|
-
}, [
|
|
69
|
+
onClick: l
|
|
70
|
+
}, [n.default?.()]);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
ae.install = function(e) {
|
|
@@ -93,32 +93,32 @@ const ft = b({
|
|
|
93
93
|
},
|
|
94
94
|
emits: ["update:modelValue", "update:pageSize", "page-change", "size-change"],
|
|
95
95
|
setup(e, { emit: t }) {
|
|
96
|
-
const
|
|
96
|
+
const n = k(e.modelValue), l = k(e.pageSize);
|
|
97
97
|
return X(
|
|
98
98
|
() => e.modelValue,
|
|
99
|
-
(
|
|
100
|
-
|
|
99
|
+
(r) => {
|
|
100
|
+
n.value = r;
|
|
101
101
|
}
|
|
102
102
|
), X(
|
|
103
103
|
() => e.pageSize,
|
|
104
|
-
(
|
|
105
|
-
|
|
104
|
+
(r) => {
|
|
105
|
+
l.value = r;
|
|
106
106
|
}
|
|
107
107
|
), {
|
|
108
|
-
currentPage:
|
|
109
|
-
pageSize:
|
|
110
|
-
handleSizeChange: (
|
|
111
|
-
|
|
108
|
+
currentPage: n,
|
|
109
|
+
pageSize: l,
|
|
110
|
+
handleSizeChange: (r) => {
|
|
111
|
+
l.value = r, n.value = 1, t("update:pageSize", r), t("size-change", { page: n.value, size: r });
|
|
112
112
|
},
|
|
113
|
-
handleCurrentChange: (
|
|
114
|
-
|
|
113
|
+
handleCurrentChange: (r) => {
|
|
114
|
+
n.value = r, t("update:modelValue", r), t("page-change", { page: r, size: l.value });
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
function mt(e, t,
|
|
120
|
-
const
|
|
121
|
-
return
|
|
119
|
+
function mt(e, t, n, l, u, d) {
|
|
120
|
+
const r = S("el-pagination");
|
|
121
|
+
return s(), V(r, {
|
|
122
122
|
"current-page": e.currentPage,
|
|
123
123
|
"onUpdate:currentPage": t[0] || (t[0] = (c) => e.currentPage = c),
|
|
124
124
|
"page-size": e.pageSize,
|
|
@@ -131,46 +131,46 @@ function mt(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__ */ J(ft, [["render", mt], ["__scopeId", "data-v-497aa44d"]]), ne = {
|
|
135
135
|
default: ({ cellValue: e }) => e ?? "",
|
|
136
|
-
input: ({ cellValue: e, row: t, column:
|
|
136
|
+
input: ({ cellValue: e, row: t, column: n, updateRow: l }) => K(at, {
|
|
137
137
|
modelValue: e,
|
|
138
138
|
size: "small",
|
|
139
|
-
onInput: (u) =>
|
|
139
|
+
onInput: (u) => l({ ...t, [n.property]: u })
|
|
140
140
|
}),
|
|
141
|
-
select: ({ cellValue: e, row: t, column:
|
|
141
|
+
select: ({ cellValue: e, row: t, column: n, updateRow: l, options: u = [] }) => K(
|
|
142
142
|
et,
|
|
143
143
|
{
|
|
144
144
|
modelValue: e,
|
|
145
145
|
size: "small",
|
|
146
|
-
onChange: (d) =>
|
|
146
|
+
onChange: (d) => l({ ...t, [n.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:
|
|
152
|
+
checkbox: ({ cellValue: e, row: t, column: n, updateRow: l }) => K(Ye, {
|
|
153
153
|
modelValue: !!e,
|
|
154
|
-
onChange: (u) =>
|
|
154
|
+
onChange: (u) => l({ ...t, [n.property]: u })
|
|
155
155
|
}),
|
|
156
|
-
link: ({ cellValue: e, href: t, target:
|
|
156
|
+
link: ({ cellValue: e, href: t, target: n = "_blank" }) => K(Xe, { href: t, target: n }, () => e)
|
|
157
157
|
};
|
|
158
158
|
function gt(e, t) {
|
|
159
159
|
if (!e) return null;
|
|
160
160
|
if (typeof e == "string") {
|
|
161
|
-
const
|
|
162
|
-
return
|
|
161
|
+
const n = ne[e];
|
|
162
|
+
return n ? n(t) : (console.warn(`[ZxtTable] 未找到内置渲染器: ${e}`), t.cellValue ?? "");
|
|
163
163
|
}
|
|
164
164
|
if (typeof e == "function")
|
|
165
165
|
return e(t);
|
|
166
166
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
167
|
-
const { name:
|
|
168
|
-
return typeof
|
|
167
|
+
const { name: n, props: l = {}, attrs: u = {}, events: d = {}, content: r } = e;
|
|
168
|
+
return typeof n == "string" && ne[n] ? ne[n]({
|
|
169
169
|
...t,
|
|
170
|
-
...
|
|
170
|
+
...l,
|
|
171
171
|
...u,
|
|
172
172
|
...d
|
|
173
|
-
}) : typeof
|
|
173
|
+
}) : typeof n == "object" || typeof n == "function" ? K(n, { ...l, ...u, ...d }, r) : (console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"), t.cellValue ?? "");
|
|
174
174
|
}
|
|
175
175
|
return t.cellValue ?? "";
|
|
176
176
|
}
|
|
@@ -195,96 +195,96 @@ const vt = b({
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
setup(e) {
|
|
198
|
-
const t =
|
|
199
|
-
}),
|
|
200
|
-
const { currentPage: c, pageSize:
|
|
201
|
-
return (c - 1) *
|
|
202
|
-
},
|
|
203
|
-
const
|
|
198
|
+
const t = Ie("updateRow", () => {
|
|
199
|
+
}), n = (r) => {
|
|
200
|
+
const { currentPage: c, pageSize: p } = e;
|
|
201
|
+
return (c - 1) * p + r + 1;
|
|
202
|
+
}, l = w(() => {
|
|
203
|
+
const r = e.column;
|
|
204
204
|
return {
|
|
205
|
-
...
|
|
206
|
-
prop:
|
|
205
|
+
...r,
|
|
206
|
+
prop: r.prop ?? r.field,
|
|
207
207
|
// 优先使用 prop,兼容 field
|
|
208
|
-
label:
|
|
208
|
+
label: r.label ?? r.title
|
|
209
209
|
// 优先使用 label,兼容 title
|
|
210
210
|
};
|
|
211
211
|
}), u = w(() => {
|
|
212
|
-
const { children:
|
|
212
|
+
const { children: r, ...c } = l.value;
|
|
213
213
|
return c;
|
|
214
214
|
});
|
|
215
215
|
return {
|
|
216
|
-
normalizedColumn:
|
|
216
|
+
normalizedColumn: l,
|
|
217
217
|
columnProps: u,
|
|
218
|
-
renderCell: (
|
|
219
|
-
const c =
|
|
218
|
+
renderCell: (r) => {
|
|
219
|
+
const c = l.value, p = r.row[c.prop], z = p ?? c.defaultValue ?? "";
|
|
220
220
|
return gt(c.cellRender, {
|
|
221
|
-
row:
|
|
221
|
+
row: r.row,
|
|
222
222
|
column: c,
|
|
223
|
-
rowIndex:
|
|
223
|
+
rowIndex: r.$index,
|
|
224
224
|
cellValue: z,
|
|
225
|
-
updateRow: (
|
|
225
|
+
updateRow: (f) => t(f, r.$index)
|
|
226
226
|
});
|
|
227
227
|
},
|
|
228
|
-
defaultIndexMethod:
|
|
228
|
+
defaultIndexMethod: n
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
|
-
function Ct(e, t,
|
|
233
|
-
const
|
|
234
|
-
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (
|
|
232
|
+
function Ct(e, t, n, l, u, d) {
|
|
233
|
+
const r = S("ZxtTableColumn", !0), c = S("el-table-column");
|
|
234
|
+
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (s(), V(c, L({ key: 0 }, e.columnProps, {
|
|
235
235
|
key: e.normalizedColumn.prop + "-group"
|
|
236
236
|
}), {
|
|
237
237
|
default: _(() => [
|
|
238
|
-
(
|
|
238
|
+
(s(!0), g(H, null, O(e.normalizedColumn.children, (p, z) => (s(), V(r, {
|
|
239
239
|
key: z,
|
|
240
|
-
column:
|
|
240
|
+
column: p,
|
|
241
241
|
"current-page": e.currentPage,
|
|
242
242
|
"page-size": e.pageSize
|
|
243
243
|
}, Y({ _: 2 }, [
|
|
244
|
-
|
|
245
|
-
name:
|
|
246
|
-
fn: _((
|
|
247
|
-
|
|
244
|
+
O(e.$slots, (f, i) => ({
|
|
245
|
+
name: i,
|
|
246
|
+
fn: _((C) => [
|
|
247
|
+
M(e.$slots, i, L({ ref_for: !0 }, C))
|
|
248
248
|
])
|
|
249
249
|
}))
|
|
250
250
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
251
251
|
]),
|
|
252
252
|
_: 3
|
|
253
|
-
}, 16)) : (
|
|
253
|
+
}, 16)) : (s(), V(c, L({ key: 1 }, e.columnProps, {
|
|
254
254
|
key: e.normalizedColumn.prop,
|
|
255
255
|
index: e.normalizedColumn.indexMethod || e.defaultIndexMethod
|
|
256
256
|
}), Y({ _: 2 }, [
|
|
257
257
|
e.normalizedColumn.headerSlot ? {
|
|
258
258
|
name: "header",
|
|
259
|
-
fn: _((
|
|
260
|
-
|
|
259
|
+
fn: _((p) => [
|
|
260
|
+
M(e.$slots, e.normalizedColumn.headerSlot, L({ column: e.normalizedColumn }, p))
|
|
261
261
|
]),
|
|
262
262
|
key: "0"
|
|
263
263
|
} : void 0,
|
|
264
264
|
!["selection", "index"].includes(e.normalizedColumn.type) && (e.normalizedColumn.type !== "expand" || e.normalizedColumn.slot) ? {
|
|
265
265
|
name: "default",
|
|
266
|
-
fn: _((
|
|
267
|
-
e.normalizedColumn.slot ?
|
|
266
|
+
fn: _((p) => [
|
|
267
|
+
e.normalizedColumn.slot ? M(e.$slots, e.normalizedColumn.slot, {
|
|
268
268
|
key: 0,
|
|
269
|
-
row:
|
|
270
|
-
index:
|
|
269
|
+
row: p.row,
|
|
270
|
+
index: p.$index,
|
|
271
271
|
column: e.normalizedColumn
|
|
272
|
-
}) : e.normalizedColumn.cellRender ? (
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
}) : e.normalizedColumn.cellRender ? (s(), V(be(e.renderCell(p)), { key: 1 })) : e.normalizedColumn.formatter ? (s(), g(H, { key: 2 }, [
|
|
273
|
+
j(ee(e.normalizedColumn.formatter(
|
|
274
|
+
p.row,
|
|
275
275
|
e.normalizedColumn,
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
p.row[e.normalizedColumn.prop],
|
|
277
|
+
p.$index
|
|
278
278
|
)), 1)
|
|
279
|
-
], 64)) : (
|
|
280
|
-
|
|
279
|
+
], 64)) : (s(), g(H, { key: 3 }, [
|
|
280
|
+
j(ee(p.row[e.normalizedColumn.prop]), 1)
|
|
281
281
|
], 64))
|
|
282
282
|
]),
|
|
283
283
|
key: "1"
|
|
284
284
|
} : void 0
|
|
285
285
|
]), 1040, ["index"]));
|
|
286
286
|
}
|
|
287
|
-
const wt = /* @__PURE__ */
|
|
287
|
+
const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set(["append", "empty"]), yt = b({
|
|
288
288
|
name: "ZxtTable",
|
|
289
289
|
inheritAttrs: !1,
|
|
290
290
|
components: { ZxtPagination: Q, ZxtTableColumn: wt, ElTable: ot },
|
|
@@ -333,92 +333,92 @@ const wt = /* @__PURE__ */ G(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
333
333
|
"update:row"
|
|
334
334
|
],
|
|
335
335
|
setup(e, { emit: t }) {
|
|
336
|
-
const
|
|
337
|
-
X(() => e.currentPage, (
|
|
338
|
-
d.value =
|
|
339
|
-
}), X(() => e.pageSize, (
|
|
340
|
-
u.value =
|
|
336
|
+
const n = Be(), l = k(null), u = k(e.pageSize), d = k(e.currentPage), r = k(!1), c = k([]), p = k(0), z = k({ prop: "", order: "" }), f = k({}), i = k({});
|
|
337
|
+
X(() => e.currentPage, (m) => {
|
|
338
|
+
d.value = m;
|
|
339
|
+
}), X(() => e.pageSize, (m) => {
|
|
340
|
+
u.value = m;
|
|
341
341
|
});
|
|
342
|
-
const
|
|
342
|
+
const C = w(() => e.height === "full" ? { height: "100%" } : {}), a = w(() => {
|
|
343
343
|
if (e.height !== "full")
|
|
344
344
|
return e.height;
|
|
345
|
-
}),
|
|
346
|
-
() =>
|
|
347
|
-
),
|
|
348
|
-
|
|
349
|
-
const
|
|
345
|
+
}), v = w(() => !!e.proxyConfig), R = w(() => v.value ? p.value : e.total > 0 ? e.total : e.data.length), B = w(
|
|
346
|
+
() => v.value ? c.value : e.data
|
|
347
|
+
), A = () => {
|
|
348
|
+
xe(() => {
|
|
349
|
+
const m = l.value?.$el?.querySelector(
|
|
350
350
|
".el-table__body-wrapper .el-scrollbar__wrap"
|
|
351
351
|
);
|
|
352
|
-
|
|
352
|
+
m && (typeof m.scrollTo == "function" ? m.scrollTo({ top: 0, left: 0 }) : (m.scrollTop = 0, m.scrollLeft = 0));
|
|
353
353
|
});
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
}, de = (
|
|
357
|
-
|
|
358
|
-
}, ce = ({ column:
|
|
359
|
-
z.value = { prop: $, order:
|
|
360
|
-
}, pe = (
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
if (!
|
|
364
|
-
const $ = e.proxyConfig || {},
|
|
365
|
-
if (typeof
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
const ve =
|
|
369
|
-
|
|
370
|
-
const _e = $.params || {},
|
|
354
|
+
}, I = (m) => {
|
|
355
|
+
v.value && (d.value = m.page, u.value = m.size, E()), A(), t("size-change", m);
|
|
356
|
+
}, de = (m) => {
|
|
357
|
+
v.value && (d.value = m.page, u.value = m.size, E()), A(), t("page-change", m);
|
|
358
|
+
}, ce = ({ column: m, prop: $, order: N }) => {
|
|
359
|
+
z.value = { prop: $, order: N }, v.value && E(), t("sort-change", { column: m, prop: $, order: N });
|
|
360
|
+
}, pe = (m) => {
|
|
361
|
+
f.value = m || {}, v.value && E(), t("filter-change", f.value);
|
|
362
|
+
}, E = async (m) => {
|
|
363
|
+
if (!v.value) return;
|
|
364
|
+
const $ = e.proxyConfig || {}, N = $.ajax?.query;
|
|
365
|
+
if (typeof N != "function") return;
|
|
366
|
+
const U = $.props || {}, he = U.pageField || "page";
|
|
367
|
+
U.sizeField;
|
|
368
|
+
const ve = U.sortField || "sort", Ce = U.orderField || "order", we = U.filtersField || "filters";
|
|
369
|
+
m?.formData !== void 0 ? i.value = m.formData : $._formData && (i.value = $._formData);
|
|
370
|
+
const _e = $.params || {}, q = {
|
|
371
371
|
[he]: {
|
|
372
|
-
currentPage:
|
|
373
|
-
pageSize:
|
|
372
|
+
currentPage: m?.page ?? d.value,
|
|
373
|
+
pageSize: m?.pageSize ?? u.value
|
|
374
374
|
},
|
|
375
|
-
form:
|
|
375
|
+
form: i.value,
|
|
376
376
|
..._e
|
|
377
377
|
};
|
|
378
|
-
z.value?.prop && (
|
|
378
|
+
z.value?.prop && (q[ve] = z.value.prop, q[Ce] = z.value.order), f.value && Object.keys(f.value).length && (q[we] = f.value), r.value = !0;
|
|
379
379
|
try {
|
|
380
|
-
const
|
|
380
|
+
const T = await N(q), P = $.response || {}, o = P.listField || "list", h = P.totalField || "total", D = P.transform;
|
|
381
381
|
let Z = [], re = 0;
|
|
382
382
|
if (typeof D == "function") {
|
|
383
|
-
const ye = D(
|
|
383
|
+
const ye = D(T);
|
|
384
384
|
Z = ye?.list ?? [], re = ye?.total ?? 0;
|
|
385
|
-
} else
|
|
386
|
-
c.value = Array.isArray(Z) ? Z : [],
|
|
385
|
+
} else T && typeof T == "object" && (Z = T?.[o] ?? T?.data ?? [], re = T?.[h] ?? T?.total ?? 0);
|
|
386
|
+
c.value = Array.isArray(Z) ? Z : [], p.value = Number(re) || 0, t("loaded", {
|
|
387
387
|
data: c.value,
|
|
388
|
-
total:
|
|
389
|
-
payload:
|
|
388
|
+
total: p.value,
|
|
389
|
+
payload: q
|
|
390
390
|
});
|
|
391
|
-
} catch (
|
|
392
|
-
t("load-error",
|
|
391
|
+
} catch (T) {
|
|
392
|
+
t("load-error", T);
|
|
393
393
|
} finally {
|
|
394
|
-
|
|
394
|
+
r.value = !1;
|
|
395
395
|
}
|
|
396
|
-
}, oe = (
|
|
397
|
-
|
|
396
|
+
}, oe = (m, $) => {
|
|
397
|
+
v.value ? c.value.splice($, 1, m) : t("update:row", { index: $, row: m });
|
|
398
398
|
};
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
Ne("updateRow", oe), Le(() => {
|
|
400
|
+
v.value && e.autoLoad && E();
|
|
401
401
|
});
|
|
402
|
-
const fe = () =>
|
|
402
|
+
const fe = () => l.value, me = () => l.value?.getSelectionRows?.() || [], ge = (m) => E(m), le = () => A();
|
|
403
403
|
return {
|
|
404
404
|
columnSlots: w(() => {
|
|
405
|
-
const
|
|
406
|
-
for (const $ in
|
|
407
|
-
_t.has($) || (
|
|
408
|
-
return
|
|
405
|
+
const m = {};
|
|
406
|
+
for (const $ in n)
|
|
407
|
+
_t.has($) || (m[$] = n[$]);
|
|
408
|
+
return m;
|
|
409
409
|
}),
|
|
410
|
-
tableRef:
|
|
411
|
-
containerStyle:
|
|
412
|
-
tableHeight:
|
|
410
|
+
tableRef: l,
|
|
411
|
+
containerStyle: C,
|
|
412
|
+
tableHeight: a,
|
|
413
413
|
getTableRef: fe,
|
|
414
414
|
pageSize: u,
|
|
415
415
|
currentPage: d,
|
|
416
|
-
loading:
|
|
417
|
-
renderData:
|
|
418
|
-
total:
|
|
416
|
+
loading: r,
|
|
417
|
+
renderData: B,
|
|
418
|
+
total: R,
|
|
419
419
|
pageSizes: w(() => e.pageSizes),
|
|
420
420
|
paginationLayout: w(() => e.paginationLayout),
|
|
421
|
-
handleSizeChange:
|
|
421
|
+
handleSizeChange: I,
|
|
422
422
|
handlePageChange: de,
|
|
423
423
|
handleSortChange: ce,
|
|
424
424
|
handleFilterChange: pe,
|
|
@@ -432,13 +432,13 @@ const wt = /* @__PURE__ */ G(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
432
432
|
key: 0,
|
|
433
433
|
class: "zxt-table-footer"
|
|
434
434
|
};
|
|
435
|
-
function zt(e, t,
|
|
436
|
-
const
|
|
437
|
-
return
|
|
435
|
+
function zt(e, t, n, l, u, d) {
|
|
436
|
+
const r = S("ZxtTableColumn"), c = S("el-table"), p = S("ZxtPagination"), z = Ue("loading");
|
|
437
|
+
return s(), g("div", {
|
|
438
438
|
class: ue(["zxt-table-container", { "zxt-table-container--full": e.height === "full" }]),
|
|
439
439
|
style: qe(e.containerStyle)
|
|
440
440
|
}, [
|
|
441
|
-
We((
|
|
441
|
+
We((s(), V(c, L({
|
|
442
442
|
ref: "tableRef",
|
|
443
443
|
data: e.renderData,
|
|
444
444
|
height: e.tableHeight
|
|
@@ -448,16 +448,16 @@ function zt(e, t, a, r, u, d) {
|
|
|
448
448
|
onFilterChange: e.handleFilterChange
|
|
449
449
|
}), Y({
|
|
450
450
|
default: _(() => [
|
|
451
|
-
(
|
|
452
|
-
key:
|
|
453
|
-
column:
|
|
451
|
+
(s(!0), g(H, null, O(e.columns, (f, i) => (s(), V(r, {
|
|
452
|
+
key: i,
|
|
453
|
+
column: f,
|
|
454
454
|
"current-page": e.currentPage,
|
|
455
455
|
"page-size": e.pageSize
|
|
456
456
|
}, Y({ _: 2 }, [
|
|
457
|
-
|
|
458
|
-
name:
|
|
459
|
-
fn: _((
|
|
460
|
-
|
|
457
|
+
O(e.columnSlots, (C, a) => ({
|
|
458
|
+
name: a,
|
|
459
|
+
fn: _((v) => [
|
|
460
|
+
M(e.$slots, a, L({ ref_for: !0 }, v), void 0, !0)
|
|
461
461
|
])
|
|
462
462
|
}))
|
|
463
463
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
@@ -467,30 +467,30 @@ function zt(e, t, a, r, u, d) {
|
|
|
467
467
|
e.$slots.empty ? {
|
|
468
468
|
name: "empty",
|
|
469
469
|
fn: _(() => [
|
|
470
|
-
|
|
470
|
+
M(e.$slots, "empty", {}, void 0, !0)
|
|
471
471
|
]),
|
|
472
472
|
key: "0"
|
|
473
473
|
} : void 0
|
|
474
474
|
]), 1040, ["data", "height", "id", "onSortChange", "onFilterChange"])), [
|
|
475
475
|
[z, e.loading]
|
|
476
476
|
]),
|
|
477
|
-
e.$slots.append ? (
|
|
478
|
-
|
|
479
|
-
])) :
|
|
480
|
-
e.pageable ? (
|
|
477
|
+
e.$slots.append ? (s(), g("div", bt, [
|
|
478
|
+
M(e.$slots, "append", {}, void 0, !0)
|
|
479
|
+
])) : G("", !0),
|
|
480
|
+
e.pageable ? (s(), V(p, {
|
|
481
481
|
key: 1,
|
|
482
482
|
"model-value": e.currentPage,
|
|
483
483
|
"page-size": e.pageSize,
|
|
484
|
-
"onUpdate:pageSize": t[0] || (t[0] = (
|
|
484
|
+
"onUpdate:pageSize": t[0] || (t[0] = (f) => e.pageSize = f),
|
|
485
485
|
"page-sizes": e.pageSizes,
|
|
486
486
|
total: e.total,
|
|
487
487
|
layout: e.paginationLayout,
|
|
488
488
|
onPageChange: e.handlePageChange,
|
|
489
489
|
onSizeChange: e.handleSizeChange
|
|
490
|
-
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) :
|
|
490
|
+
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : G("", !0)
|
|
491
491
|
], 6);
|
|
492
492
|
}
|
|
493
|
-
const
|
|
493
|
+
const x = /* @__PURE__ */ J(yt, [["render", zt], ["__scopeId", "data-v-cfbfc1e6"]]), W = /* @__PURE__ */ new Map();
|
|
494
494
|
class St {
|
|
495
495
|
/**
|
|
496
496
|
* 注册自定义渲染器
|
|
@@ -504,8 +504,8 @@ class St {
|
|
|
504
504
|
* }
|
|
505
505
|
* })
|
|
506
506
|
*/
|
|
507
|
-
add(t,
|
|
508
|
-
return !t || typeof t != "string" ? (console.warn("[ZxtTable] 渲染器名称必须是字符串"), this) : !
|
|
507
|
+
add(t, n) {
|
|
508
|
+
return !t || typeof t != "string" ? (console.warn("[ZxtTable] 渲染器名称必须是字符串"), this) : !n || typeof n != "object" ? (console.warn("[ZxtTable] 渲染器配置必须是对象"), this) : (W.has(t) && console.warn(`[ZxtTable] 渲染器 "${t}" 已存在,将被覆盖`), W.set(t, n), this);
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
* 获取渲染器
|
|
@@ -513,14 +513,14 @@ class St {
|
|
|
513
513
|
* @returns {Object|undefined}
|
|
514
514
|
*/
|
|
515
515
|
get(t) {
|
|
516
|
-
return
|
|
516
|
+
return W.get(t);
|
|
517
517
|
}
|
|
518
518
|
/**
|
|
519
519
|
* 删除渲染器
|
|
520
520
|
* @param {String} name - 渲染器名称
|
|
521
521
|
*/
|
|
522
522
|
delete(t) {
|
|
523
|
-
return
|
|
523
|
+
return W.delete(t);
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
526
|
* 检查渲染器是否存在
|
|
@@ -528,29 +528,29 @@ class St {
|
|
|
528
528
|
* @returns {Boolean}
|
|
529
529
|
*/
|
|
530
530
|
has(t) {
|
|
531
|
-
return
|
|
531
|
+
return W.has(t);
|
|
532
532
|
}
|
|
533
533
|
/**
|
|
534
534
|
* 获取所有渲染器名称
|
|
535
535
|
* @returns {Array<String>}
|
|
536
536
|
*/
|
|
537
537
|
getAll() {
|
|
538
|
-
return Array.from(
|
|
538
|
+
return Array.from(W.keys());
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
541
|
* 清空所有自定义渲染器
|
|
542
542
|
*/
|
|
543
543
|
clear() {
|
|
544
|
-
|
|
544
|
+
W.clear();
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
const ze = new St();
|
|
548
|
-
function kt(e, t,
|
|
548
|
+
function kt(e, t, n = {}) {
|
|
549
549
|
if (!e || !e.itemRender)
|
|
550
550
|
return null;
|
|
551
|
-
const { name:
|
|
552
|
-
if (
|
|
553
|
-
const u = ze.get(
|
|
551
|
+
const { name: l } = e.itemRender;
|
|
552
|
+
if (l && ze.has(l)) {
|
|
553
|
+
const u = ze.get(l);
|
|
554
554
|
if (typeof u.renderItemContent == "function") {
|
|
555
555
|
const d = {
|
|
556
556
|
data: t,
|
|
@@ -559,24 +559,24 @@ function kt(e, t, a = {}) {
|
|
|
559
559
|
formData: t
|
|
560
560
|
};
|
|
561
561
|
try {
|
|
562
|
-
return u.renderItemContent(
|
|
563
|
-
} catch (
|
|
564
|
-
return console.error(`[ZxtTable] 渲染器 "${
|
|
562
|
+
return u.renderItemContent(n, d);
|
|
563
|
+
} catch (r) {
|
|
564
|
+
return console.error(`[ZxtTable] 渲染器 "${l}" 执行出错:`, r), null;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
return null;
|
|
569
569
|
}
|
|
570
|
-
|
|
571
|
-
e.component(
|
|
570
|
+
x.install = function(e) {
|
|
571
|
+
e.component(x.name, x);
|
|
572
572
|
};
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
x.registerRenderer = ht;
|
|
574
|
+
x.renderer = ze;
|
|
575
575
|
var $t = /* @__PURE__ */ b({
|
|
576
576
|
name: "ArrowDown",
|
|
577
577
|
__name: "arrow-down",
|
|
578
578
|
setup(e) {
|
|
579
|
-
return (t,
|
|
579
|
+
return (t, n) => (s(), g("svg", {
|
|
580
580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
581
581
|
viewBox: "0 0 1024 1024"
|
|
582
582
|
}, [
|
|
@@ -586,11 +586,11 @@ var $t = /* @__PURE__ */ b({
|
|
|
586
586
|
})
|
|
587
587
|
]));
|
|
588
588
|
}
|
|
589
|
-
}),
|
|
589
|
+
}), He = $t, Vt = /* @__PURE__ */ b({
|
|
590
590
|
name: "Check",
|
|
591
591
|
__name: "check",
|
|
592
592
|
setup(e) {
|
|
593
|
-
return (t,
|
|
593
|
+
return (t, n) => (s(), g("svg", {
|
|
594
594
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
595
|
viewBox: "0 0 1024 1024"
|
|
596
596
|
}, [
|
|
@@ -604,7 +604,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
604
604
|
name: "Close",
|
|
605
605
|
__name: "close",
|
|
606
606
|
setup(e) {
|
|
607
|
-
return (t,
|
|
607
|
+
return (t, n) => (s(), g("svg", {
|
|
608
608
|
xmlns: "http://www.w3.org/2000/svg",
|
|
609
609
|
viewBox: "0 0 1024 1024"
|
|
610
610
|
}, [
|
|
@@ -618,7 +618,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
618
618
|
name: "CopyDocument",
|
|
619
619
|
__name: "copy-document",
|
|
620
620
|
setup(e) {
|
|
621
|
-
return (t,
|
|
621
|
+
return (t, n) => (s(), g("svg", {
|
|
622
622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
623
623
|
viewBox: "0 0 1024 1024"
|
|
624
624
|
}, [
|
|
@@ -636,7 +636,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
636
636
|
name: "Delete",
|
|
637
637
|
__name: "delete",
|
|
638
638
|
setup(e) {
|
|
639
|
-
return (t,
|
|
639
|
+
return (t, n) => (s(), g("svg", {
|
|
640
640
|
xmlns: "http://www.w3.org/2000/svg",
|
|
641
641
|
viewBox: "0 0 1024 1024"
|
|
642
642
|
}, [
|
|
@@ -650,7 +650,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
650
650
|
name: "Document",
|
|
651
651
|
__name: "document",
|
|
652
652
|
setup(e) {
|
|
653
|
-
return (t,
|
|
653
|
+
return (t, n) => (s(), g("svg", {
|
|
654
654
|
xmlns: "http://www.w3.org/2000/svg",
|
|
655
655
|
viewBox: "0 0 1024 1024"
|
|
656
656
|
}, [
|
|
@@ -664,7 +664,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
664
664
|
name: "Download",
|
|
665
665
|
__name: "download",
|
|
666
666
|
setup(e) {
|
|
667
|
-
return (t,
|
|
667
|
+
return (t, n) => (s(), g("svg", {
|
|
668
668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
669
669
|
viewBox: "0 0 1024 1024"
|
|
670
670
|
}, [
|
|
@@ -678,7 +678,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
678
678
|
name: "Edit",
|
|
679
679
|
__name: "edit",
|
|
680
680
|
setup(e) {
|
|
681
|
-
return (t,
|
|
681
|
+
return (t, n) => (s(), g("svg", {
|
|
682
682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
683
683
|
viewBox: "0 0 1024 1024"
|
|
684
684
|
}, [
|
|
@@ -696,7 +696,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
696
696
|
name: "Lock",
|
|
697
697
|
__name: "lock",
|
|
698
698
|
setup(e) {
|
|
699
|
-
return (t,
|
|
699
|
+
return (t, n) => (s(), g("svg", {
|
|
700
700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
701
701
|
viewBox: "0 0 1024 1024"
|
|
702
702
|
}, [
|
|
@@ -710,11 +710,11 @@ var $t = /* @__PURE__ */ b({
|
|
|
710
710
|
})
|
|
711
711
|
]));
|
|
712
712
|
}
|
|
713
|
-
}), Ht = xt,
|
|
713
|
+
}), Ht = xt, Et = /* @__PURE__ */ b({
|
|
714
714
|
name: "Plus",
|
|
715
715
|
__name: "plus",
|
|
716
716
|
setup(e) {
|
|
717
|
-
return (t,
|
|
717
|
+
return (t, n) => (s(), g("svg", {
|
|
718
718
|
xmlns: "http://www.w3.org/2000/svg",
|
|
719
719
|
viewBox: "0 0 1024 1024"
|
|
720
720
|
}, [
|
|
@@ -724,11 +724,11 @@ var $t = /* @__PURE__ */ b({
|
|
|
724
724
|
})
|
|
725
725
|
]));
|
|
726
726
|
}
|
|
727
|
-
}), Ve =
|
|
727
|
+
}), Ve = Et, Zt = /* @__PURE__ */ b({
|
|
728
728
|
name: "Refresh",
|
|
729
729
|
__name: "refresh",
|
|
730
730
|
setup(e) {
|
|
731
|
-
return (t,
|
|
731
|
+
return (t, n) => (s(), g("svg", {
|
|
732
732
|
xmlns: "http://www.w3.org/2000/svg",
|
|
733
733
|
viewBox: "0 0 1024 1024"
|
|
734
734
|
}, [
|
|
@@ -738,11 +738,11 @@ var $t = /* @__PURE__ */ b({
|
|
|
738
738
|
})
|
|
739
739
|
]));
|
|
740
740
|
}
|
|
741
|
-
}), se =
|
|
741
|
+
}), se = Zt, jt = /* @__PURE__ */ b({
|
|
742
742
|
name: "Search",
|
|
743
743
|
__name: "search",
|
|
744
744
|
setup(e) {
|
|
745
|
-
return (t,
|
|
745
|
+
return (t, n) => (s(), g("svg", {
|
|
746
746
|
xmlns: "http://www.w3.org/2000/svg",
|
|
747
747
|
viewBox: "0 0 1024 1024"
|
|
748
748
|
}, [
|
|
@@ -756,7 +756,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
756
756
|
name: "Setting",
|
|
757
757
|
__name: "setting",
|
|
758
758
|
setup(e) {
|
|
759
|
-
return (t,
|
|
759
|
+
return (t, n) => (s(), g("svg", {
|
|
760
760
|
xmlns: "http://www.w3.org/2000/svg",
|
|
761
761
|
viewBox: "0 0 1024 1024"
|
|
762
762
|
}, [
|
|
@@ -770,7 +770,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
770
770
|
name: "Share",
|
|
771
771
|
__name: "share",
|
|
772
772
|
setup(e) {
|
|
773
|
-
return (t,
|
|
773
|
+
return (t, n) => (s(), g("svg", {
|
|
774
774
|
xmlns: "http://www.w3.org/2000/svg",
|
|
775
775
|
viewBox: "0 0 1024 1024"
|
|
776
776
|
}, [
|
|
@@ -784,7 +784,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
784
784
|
name: "Unlock",
|
|
785
785
|
__name: "unlock",
|
|
786
786
|
setup(e) {
|
|
787
|
-
return (t,
|
|
787
|
+
return (t, n) => (s(), g("svg", {
|
|
788
788
|
xmlns: "http://www.w3.org/2000/svg",
|
|
789
789
|
viewBox: "0 0 1024 1024"
|
|
790
790
|
}, [
|
|
@@ -802,7 +802,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
802
802
|
name: "Upload",
|
|
803
803
|
__name: "upload",
|
|
804
804
|
setup(e) {
|
|
805
|
-
return (t,
|
|
805
|
+
return (t, n) => (s(), g("svg", {
|
|
806
806
|
xmlns: "http://www.w3.org/2000/svg",
|
|
807
807
|
viewBox: "0 0 1024 1024"
|
|
808
808
|
}, [
|
|
@@ -816,7 +816,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
816
816
|
name: "View",
|
|
817
817
|
__name: "view",
|
|
818
818
|
setup(e) {
|
|
819
|
-
return (t,
|
|
819
|
+
return (t, n) => (s(), g("svg", {
|
|
820
820
|
xmlns: "http://www.w3.org/2000/svg",
|
|
821
821
|
viewBox: "0 0 1024 1024"
|
|
822
822
|
}, [
|
|
@@ -830,7 +830,7 @@ var $t = /* @__PURE__ */ b({
|
|
|
830
830
|
name: "Warning",
|
|
831
831
|
__name: "warning",
|
|
832
832
|
setup(e) {
|
|
833
|
-
return (t,
|
|
833
|
+
return (t, n) => (s(), g("svg", {
|
|
834
834
|
xmlns: "http://www.w3.org/2000/svg",
|
|
835
835
|
viewBox: "0 0 1024 1024"
|
|
836
836
|
}, [
|
|
@@ -851,8 +851,8 @@ const Xt = b({
|
|
|
851
851
|
labelWidth: { type: String, default: "100px" }
|
|
852
852
|
},
|
|
853
853
|
emits: ["submit", "reset"],
|
|
854
|
-
setup(e, { emit: t, expose:
|
|
855
|
-
const
|
|
854
|
+
setup(e, { emit: t, expose: n }) {
|
|
855
|
+
const l = k(null), u = Ge({}), d = {
|
|
856
856
|
input: "el-input",
|
|
857
857
|
select: "el-select",
|
|
858
858
|
date: "el-date-picker",
|
|
@@ -860,122 +860,122 @@ const Xt = b({
|
|
|
860
860
|
datetime: "el-date-picker",
|
|
861
861
|
datetimerange: "el-date-picker",
|
|
862
862
|
cascader: "el-cascader"
|
|
863
|
-
},
|
|
864
|
-
const
|
|
863
|
+
}, r = (a) => d[a] || "el-input", c = (a) => {
|
|
864
|
+
const v = a.type || "input", R = [
|
|
865
865
|
"select",
|
|
866
866
|
"date",
|
|
867
867
|
"daterange",
|
|
868
868
|
"datetime",
|
|
869
869
|
"datetimerange",
|
|
870
870
|
"cascader"
|
|
871
|
-
].includes(
|
|
872
|
-
placeholder:
|
|
873
|
-
disabled:
|
|
871
|
+
].includes(v), B = {
|
|
872
|
+
placeholder: a.placeholder || `请${R ? "选择" : "输入"}${a.label}`,
|
|
873
|
+
disabled: a.disabled,
|
|
874
874
|
style: "width: 100%",
|
|
875
875
|
"popper-class": "zxt-form-popper"
|
|
876
876
|
};
|
|
877
|
-
let
|
|
878
|
-
switch (
|
|
877
|
+
let A = {};
|
|
878
|
+
switch (v) {
|
|
879
879
|
case "date":
|
|
880
880
|
case "daterange":
|
|
881
881
|
case "datetime":
|
|
882
882
|
case "datetimerange":
|
|
883
|
-
|
|
884
|
-
type:
|
|
885
|
-
startPlaceholder:
|
|
886
|
-
endPlaceholder:
|
|
887
|
-
format:
|
|
888
|
-
valueFormat:
|
|
883
|
+
A = {
|
|
884
|
+
type: a.dateType || v,
|
|
885
|
+
startPlaceholder: a.startPlaceholder || "开始日期",
|
|
886
|
+
endPlaceholder: a.endPlaceholder || "结束日期",
|
|
887
|
+
format: a.format,
|
|
888
|
+
valueFormat: a.valueFormat
|
|
889
889
|
};
|
|
890
890
|
break;
|
|
891
891
|
case "cascader":
|
|
892
|
-
|
|
893
|
-
options:
|
|
894
|
-
props:
|
|
895
|
-
clearable:
|
|
892
|
+
A = {
|
|
893
|
+
options: a.options,
|
|
894
|
+
props: a.cascaderProps,
|
|
895
|
+
clearable: a.clearable !== !1
|
|
896
896
|
};
|
|
897
897
|
break;
|
|
898
898
|
default:
|
|
899
|
-
|
|
899
|
+
A = {};
|
|
900
900
|
}
|
|
901
|
-
const
|
|
902
|
-
...
|
|
903
|
-
...
|
|
901
|
+
const I = {
|
|
902
|
+
...B,
|
|
903
|
+
...A
|
|
904
904
|
};
|
|
905
|
-
return "clearable" in
|
|
906
|
-
},
|
|
907
|
-
...
|
|
905
|
+
return "clearable" in a && (I.clearable = a.clearable), a.props && typeof a.props == "object" && Object.assign(I, a.props), I;
|
|
906
|
+
}, p = w(() => e.formColumns.map((a) => ({
|
|
907
|
+
...a,
|
|
908
908
|
colSpan: {
|
|
909
|
-
xs:
|
|
910
|
-
sm:
|
|
911
|
-
md:
|
|
912
|
-
lg:
|
|
913
|
-
xl:
|
|
909
|
+
xs: a.xs ?? a.span ?? 24,
|
|
910
|
+
sm: a.sm ?? a.span ?? 12,
|
|
911
|
+
md: a.md ?? a.span ?? 12,
|
|
912
|
+
lg: a.lg ?? a.span ?? 12,
|
|
913
|
+
xl: a.xl ?? a.span ?? 12
|
|
914
914
|
}
|
|
915
915
|
})));
|
|
916
916
|
X(
|
|
917
917
|
() => e.initialFormData,
|
|
918
|
-
(
|
|
919
|
-
Object.keys(u).forEach((
|
|
920
|
-
delete u[
|
|
921
|
-
}), Object.assign(u,
|
|
918
|
+
(a) => {
|
|
919
|
+
Object.keys(u).forEach((v) => {
|
|
920
|
+
delete u[v];
|
|
921
|
+
}), Object.assign(u, a);
|
|
922
922
|
},
|
|
923
923
|
{ immediate: !0, deep: !0 }
|
|
924
924
|
);
|
|
925
925
|
const z = w(() => {
|
|
926
|
-
const
|
|
927
|
-
return Object.keys(
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
926
|
+
const a = { ...e.rules };
|
|
927
|
+
return Object.keys(a).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((v) => {
|
|
928
|
+
if (v.required) {
|
|
929
|
+
const R = [
|
|
930
930
|
"select",
|
|
931
931
|
"date",
|
|
932
932
|
"daterange",
|
|
933
933
|
"datetime",
|
|
934
934
|
"datetimerange",
|
|
935
935
|
"cascader"
|
|
936
|
-
].includes(
|
|
937
|
-
|
|
936
|
+
].includes(v.type);
|
|
937
|
+
a[v.prop] = [
|
|
938
938
|
{
|
|
939
939
|
required: !0,
|
|
940
|
-
message: `请${
|
|
941
|
-
trigger:
|
|
940
|
+
message: `请${R ? "选择" : "输入"}${v.label}`,
|
|
941
|
+
trigger: R ? "change" : "blur"
|
|
942
942
|
}
|
|
943
943
|
];
|
|
944
944
|
}
|
|
945
|
-
}),
|
|
946
|
-
}),
|
|
947
|
-
|
|
948
|
-
|
|
945
|
+
}), a;
|
|
946
|
+
}), f = () => {
|
|
947
|
+
l.value && l.value.validate((a) => {
|
|
948
|
+
a && t("submit", { ...u });
|
|
949
949
|
});
|
|
950
|
-
},
|
|
951
|
-
|
|
952
|
-
},
|
|
953
|
-
return
|
|
954
|
-
validate: () =>
|
|
955
|
-
resetFields: () =>
|
|
950
|
+
}, i = () => {
|
|
951
|
+
l.value && l.value.resetFields(), t("reset");
|
|
952
|
+
}, C = (a) => () => kt(a, u, {}) || null;
|
|
953
|
+
return n({
|
|
954
|
+
validate: () => l.value ? l.value.validate() : Promise.resolve(!1),
|
|
955
|
+
resetFields: () => l.value && l.value.resetFields(),
|
|
956
956
|
getFormData: () => ({ ...u }),
|
|
957
|
-
submitForm:
|
|
958
|
-
resetForm:
|
|
957
|
+
submitForm: f,
|
|
958
|
+
resetForm: i
|
|
959
959
|
}), {
|
|
960
|
-
formRef:
|
|
960
|
+
formRef: l,
|
|
961
961
|
formData: u,
|
|
962
962
|
formRules: z,
|
|
963
|
-
submitForm:
|
|
964
|
-
resetForm:
|
|
965
|
-
processedColumns:
|
|
966
|
-
getComponentType:
|
|
963
|
+
submitForm: f,
|
|
964
|
+
resetForm: i,
|
|
965
|
+
processedColumns: p,
|
|
966
|
+
getComponentType: r,
|
|
967
967
|
getComponentProps: c,
|
|
968
|
-
renderCustomItem:
|
|
968
|
+
renderCustomItem: C
|
|
969
969
|
};
|
|
970
970
|
}
|
|
971
971
|
}), Yt = { class: "zxt-form-container" }, ea = {
|
|
972
972
|
key: 0,
|
|
973
973
|
class: "form-label"
|
|
974
974
|
}, ta = { class: "form-control" };
|
|
975
|
-
function aa(e, t,
|
|
976
|
-
const
|
|
977
|
-
return
|
|
978
|
-
F(
|
|
975
|
+
function aa(e, t, n, l, u, d) {
|
|
976
|
+
const r = S("el-option"), c = S("el-form-item"), p = S("el-col"), z = S("el-row"), f = S("el-form");
|
|
977
|
+
return s(), g("div", Yt, [
|
|
978
|
+
F(f, L({ ref: "formRef" }, e.$attrs, {
|
|
979
979
|
model: e.formData,
|
|
980
980
|
rules: e.formRules,
|
|
981
981
|
"label-width": e.labelWidth,
|
|
@@ -984,35 +984,35 @@ function aa(e, t, a, r, u, d) {
|
|
|
984
984
|
default: _(() => [
|
|
985
985
|
F(z, { gutter: 20 }, {
|
|
986
986
|
default: _(() => [
|
|
987
|
-
(
|
|
987
|
+
(s(!0), g(H, null, O(e.processedColumns, (i, C) => (s(), V(p, L({ key: C }, { ref_for: !0 }, i.colSpan), {
|
|
988
988
|
default: _(() => [
|
|
989
989
|
F(c, {
|
|
990
|
-
prop:
|
|
991
|
-
required:
|
|
990
|
+
prop: i.prop,
|
|
991
|
+
required: i.required,
|
|
992
992
|
"label-width": "0",
|
|
993
993
|
class: "custom-form-item"
|
|
994
994
|
}, {
|
|
995
995
|
default: _(() => [
|
|
996
996
|
y("div", {
|
|
997
|
-
class: ue(["form-item-wrapper", { "is-action":
|
|
997
|
+
class: ue(["form-item-wrapper", { "is-action": i.isAction }])
|
|
998
998
|
}, [
|
|
999
|
-
|
|
999
|
+
i.label ? (s(), g("span", ea, ee(i.label), 1)) : G("", !0),
|
|
1000
1000
|
y("div", ta, [
|
|
1001
|
-
|
|
1001
|
+
i.type === "slot" ? M(e.$slots, i.slotName || i.prop, {
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
formData: e.formData,
|
|
1004
|
-
column:
|
|
1005
|
-
}, void 0, !0) :
|
|
1004
|
+
column: i
|
|
1005
|
+
}, void 0, !0) : i.itemRender ? (s(), V(be(e.renderCustomItem(i)), { key: 1 })) : (s(), V(be(e.getComponentType(i.type)), L({
|
|
1006
1006
|
key: 2,
|
|
1007
|
-
modelValue: e.formData[
|
|
1008
|
-
"onUpdate:modelValue": (
|
|
1009
|
-
}, { ref_for: !0 }, e.getComponentProps(
|
|
1007
|
+
modelValue: e.formData[i.prop],
|
|
1008
|
+
"onUpdate:modelValue": (a) => e.formData[i.prop] = a
|
|
1009
|
+
}, { ref_for: !0 }, e.getComponentProps(i), Je(i.events || {})), {
|
|
1010
1010
|
default: _(() => [
|
|
1011
|
-
|
|
1012
|
-
key:
|
|
1013
|
-
label:
|
|
1014
|
-
value:
|
|
1015
|
-
}, null, 8, ["label", "value"]))), 128)) :
|
|
1011
|
+
i.type === "select" ? (s(!0), g(H, { key: 0 }, O(i.options, (a, v) => (s(), V(r, {
|
|
1012
|
+
key: v,
|
|
1013
|
+
label: a.label,
|
|
1014
|
+
value: a.value
|
|
1015
|
+
}, null, 8, ["label", "value"]))), 128)) : G("", !0)
|
|
1016
1016
|
]),
|
|
1017
1017
|
_: 2
|
|
1018
1018
|
}, 1040, ["modelValue", "onUpdate:modelValue"]))
|
|
@@ -1032,7 +1032,7 @@ function aa(e, t, a, r, u, d) {
|
|
|
1032
1032
|
}, 16, ["model", "rules", "label-width"])
|
|
1033
1033
|
]);
|
|
1034
1034
|
}
|
|
1035
|
-
const Re = /* @__PURE__ */
|
|
1035
|
+
const Re = /* @__PURE__ */ J(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b"]]), na = {
|
|
1036
1036
|
Plus: Ve,
|
|
1037
1037
|
Delete: Se,
|
|
1038
1038
|
Refresh: se,
|
|
@@ -1050,7 +1050,7 @@ const Re = /* @__PURE__ */ G(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b
|
|
|
1050
1050
|
Share: Ut,
|
|
1051
1051
|
Lock: Ht,
|
|
1052
1052
|
Unlock: Wt,
|
|
1053
|
-
ArrowDown:
|
|
1053
|
+
ArrowDown: He
|
|
1054
1054
|
}, oa = b({
|
|
1055
1055
|
name: "ActionColumn",
|
|
1056
1056
|
components: {
|
|
@@ -1059,7 +1059,7 @@ const Re = /* @__PURE__ */ G(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b
|
|
|
1059
1059
|
ElDropdownItem: st,
|
|
1060
1060
|
ElDropdownMenu: rt,
|
|
1061
1061
|
ElIcon: lt,
|
|
1062
|
-
ArrowDown:
|
|
1062
|
+
ArrowDown: He
|
|
1063
1063
|
},
|
|
1064
1064
|
props: {
|
|
1065
1065
|
buttons: {
|
|
@@ -1077,68 +1077,76 @@ const Re = /* @__PURE__ */ G(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b
|
|
|
1077
1077
|
},
|
|
1078
1078
|
emits: ["action-click"],
|
|
1079
1079
|
setup(e, { emit: t }) {
|
|
1080
|
-
const
|
|
1081
|
-
() =>
|
|
1082
|
-
), u = w(
|
|
1083
|
-
() => r.value ? a.value.slice(0, e.maxVisible) : a.value
|
|
1080
|
+
const n = k(null), l = w(() => e.buttons.filter((a) => typeof a.visible == "function" ? a.visible(e.row) : typeof a.visible == "boolean" ? a.visible : !0)), u = w(
|
|
1081
|
+
() => l.value.length > e.maxVisible
|
|
1084
1082
|
), d = w(
|
|
1085
|
-
() =>
|
|
1086
|
-
),
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1083
|
+
() => u.value ? l.value.slice(0, e.maxVisible) : l.value
|
|
1084
|
+
), r = w(
|
|
1085
|
+
() => u.value ? l.value.slice(e.maxVisible) : []
|
|
1086
|
+
), c = (a) => {
|
|
1087
|
+
if (a)
|
|
1088
|
+
return typeof a == "object" || typeof a == "function" ? a : na[a];
|
|
1089
|
+
}, p = (a) => {
|
|
1090
|
+
a?.currentTarget?.blur?.();
|
|
1091
1091
|
};
|
|
1092
1092
|
return {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1093
|
+
moreTriggerRef: n,
|
|
1094
|
+
visibleButtons: d,
|
|
1095
|
+
overflowButtons: r,
|
|
1096
|
+
getIconComponent: c,
|
|
1097
|
+
handleClick: (a, v) => {
|
|
1098
|
+
p(v), t("action-click", { code: a.code, button: a, row: e.row });
|
|
1098
1099
|
},
|
|
1099
|
-
handleCommand: (
|
|
1100
|
-
t("action-click", { code:
|
|
1100
|
+
handleCommand: (a) => {
|
|
1101
|
+
t("action-click", { code: a.code, button: a, row: e.row });
|
|
1101
1102
|
},
|
|
1102
|
-
handleTriggerClick: (
|
|
1103
|
-
|
|
1103
|
+
handleTriggerClick: (a) => {
|
|
1104
|
+
p(a);
|
|
1105
|
+
},
|
|
1106
|
+
handleMoreDropdownVisible: (a) => {
|
|
1107
|
+
a || xe(() => {
|
|
1108
|
+
const v = n.value, R = v?.$el ?? v, B = document.activeElement;
|
|
1109
|
+
R && B && typeof R.contains == "function" && R.contains(B) && B.blur();
|
|
1110
|
+
});
|
|
1104
1111
|
}
|
|
1105
1112
|
};
|
|
1106
1113
|
}
|
|
1107
|
-
}), la = { class: "action-column" };
|
|
1108
|
-
function ra(e, t,
|
|
1109
|
-
const
|
|
1110
|
-
return
|
|
1111
|
-
(
|
|
1112
|
-
key:
|
|
1114
|
+
}), la = { class: "action-column zxt-grid-action-column" };
|
|
1115
|
+
function ra(e, t, n, l, u, d) {
|
|
1116
|
+
const r = S("el-button"), c = S("ArrowDown"), p = S("el-icon"), z = S("el-dropdown-item"), f = S("el-dropdown-menu"), i = S("el-dropdown");
|
|
1117
|
+
return s(), g("div", la, [
|
|
1118
|
+
(s(!0), g(H, null, O(e.visibleButtons, (C) => (s(), V(r, {
|
|
1119
|
+
key: C.code,
|
|
1113
1120
|
class: "action-btn",
|
|
1114
|
-
type:
|
|
1115
|
-
icon: e.getIconComponent(
|
|
1121
|
+
type: C.type || "",
|
|
1122
|
+
icon: e.getIconComponent(C.icon),
|
|
1116
1123
|
size: "small",
|
|
1117
1124
|
link: "",
|
|
1118
1125
|
onMousedown: t[0] || (t[0] = Te(() => {
|
|
1119
1126
|
}, ["prevent"])),
|
|
1120
|
-
onClick: (
|
|
1127
|
+
onClick: (a) => e.handleClick(C, a)
|
|
1121
1128
|
}, {
|
|
1122
1129
|
default: _(() => [
|
|
1123
|
-
|
|
1130
|
+
j(ee(C.label), 1)
|
|
1124
1131
|
]),
|
|
1125
1132
|
_: 2
|
|
1126
1133
|
}, 1032, ["type", "icon", "onClick"]))), 128)),
|
|
1127
|
-
e.overflowButtons.length ? (
|
|
1134
|
+
e.overflowButtons.length ? (s(), V(i, {
|
|
1128
1135
|
key: 0,
|
|
1129
1136
|
trigger: "hover",
|
|
1130
|
-
onCommand: e.handleCommand
|
|
1137
|
+
onCommand: e.handleCommand,
|
|
1138
|
+
onVisibleChange: e.handleMoreDropdownVisible
|
|
1131
1139
|
}, {
|
|
1132
1140
|
dropdown: _(() => [
|
|
1133
|
-
F(
|
|
1141
|
+
F(f, null, {
|
|
1134
1142
|
default: _(() => [
|
|
1135
|
-
(
|
|
1136
|
-
key:
|
|
1137
|
-
command:
|
|
1138
|
-
icon: e.getIconComponent(
|
|
1143
|
+
(s(!0), g(H, null, O(e.overflowButtons, (C) => (s(), V(z, {
|
|
1144
|
+
key: C.code,
|
|
1145
|
+
command: C,
|
|
1146
|
+
icon: e.getIconComponent(C.icon)
|
|
1139
1147
|
}, {
|
|
1140
1148
|
default: _(() => [
|
|
1141
|
-
|
|
1149
|
+
j(ee(C.label), 1)
|
|
1142
1150
|
]),
|
|
1143
1151
|
_: 2
|
|
1144
1152
|
}, 1032, ["command", "icon"]))), 128))
|
|
@@ -1147,8 +1155,9 @@ function ra(e, t, a, r, u, d) {
|
|
|
1147
1155
|
})
|
|
1148
1156
|
]),
|
|
1149
1157
|
default: _(() => [
|
|
1150
|
-
F(
|
|
1151
|
-
|
|
1158
|
+
F(r, {
|
|
1159
|
+
ref: "moreTriggerRef",
|
|
1160
|
+
class: "action-btn zxt-grid-action-more",
|
|
1152
1161
|
type: "",
|
|
1153
1162
|
size: "small",
|
|
1154
1163
|
link: "",
|
|
@@ -1157,8 +1166,8 @@ function ra(e, t, a, r, u, d) {
|
|
|
1157
1166
|
onClick: e.handleTriggerClick
|
|
1158
1167
|
}, {
|
|
1159
1168
|
default: _(() => [
|
|
1160
|
-
t[2] || (t[2] =
|
|
1161
|
-
F(
|
|
1169
|
+
t[2] || (t[2] = j(" 更多 ", -1)),
|
|
1170
|
+
F(p, { class: "el-icon--right" }, {
|
|
1162
1171
|
default: _(() => [
|
|
1163
1172
|
F(c)
|
|
1164
1173
|
]),
|
|
@@ -1169,14 +1178,14 @@ function ra(e, t, a, r, u, d) {
|
|
|
1169
1178
|
}, 8, ["onClick"])
|
|
1170
1179
|
]),
|
|
1171
1180
|
_: 1
|
|
1172
|
-
}, 8, ["onCommand"])) :
|
|
1181
|
+
}, 8, ["onCommand", "onVisibleChange"])) : G("", !0)
|
|
1173
1182
|
]);
|
|
1174
1183
|
}
|
|
1175
|
-
const sa = /* @__PURE__ */
|
|
1184
|
+
const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d"]]), ia = b({
|
|
1176
1185
|
name: "ZxtGrid",
|
|
1177
1186
|
inheritAttrs: !1,
|
|
1178
1187
|
components: {
|
|
1179
|
-
ZxtTable:
|
|
1188
|
+
ZxtTable: x,
|
|
1180
1189
|
ZxtForm: Re,
|
|
1181
1190
|
ActionColumn: sa,
|
|
1182
1191
|
Plus: Ve,
|
|
@@ -1214,10 +1223,10 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1214
1223
|
}
|
|
1215
1224
|
},
|
|
1216
1225
|
emits: ["toolbar-click", "action-click", "submit", "reset", "page-change", "size-change"],
|
|
1217
|
-
setup(e, { emit: t, expose:
|
|
1218
|
-
const
|
|
1226
|
+
setup(e, { emit: t, expose: n }) {
|
|
1227
|
+
const l = Ke(), u = Be(), d = k(null), r = k(null), c = k(1), p = k(10), z = k(null), f = k(e.gridOptions.formMode !== !1), i = k({
|
|
1219
1228
|
...e.gridOptions.formConfig?.data || {}
|
|
1220
|
-
}),
|
|
1229
|
+
}), C = {
|
|
1221
1230
|
Plus: Ve,
|
|
1222
1231
|
Delete: Se,
|
|
1223
1232
|
Refresh: se,
|
|
@@ -1227,16 +1236,16 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1227
1236
|
View: Fe,
|
|
1228
1237
|
Upload: De,
|
|
1229
1238
|
Setting: Pe
|
|
1230
|
-
},
|
|
1239
|
+
}, a = w(() => {
|
|
1231
1240
|
const h = (e.gridOptions.columns || []).find((D) => D.actionColumn);
|
|
1232
1241
|
return h ? h.actionColumn : null;
|
|
1233
|
-
}),
|
|
1242
|
+
}), v = w(() => (e.gridOptions.columns || []).map((h) => h.actionColumn ? {
|
|
1234
1243
|
...h,
|
|
1235
1244
|
slot: "zxtActionInternal",
|
|
1236
1245
|
actionColumn: void 0
|
|
1237
|
-
} : h)),
|
|
1246
|
+
} : h)), R = (o) => {
|
|
1238
1247
|
t("action-click", o);
|
|
1239
|
-
},
|
|
1248
|
+
}, B = w(() => {
|
|
1240
1249
|
const o = e.gridOptions.formConfig;
|
|
1241
1250
|
if (!o || !o.items) return [];
|
|
1242
1251
|
const h = [...o.items];
|
|
@@ -1250,37 +1259,37 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1250
1259
|
isAction: !0,
|
|
1251
1260
|
...o.actionConfig
|
|
1252
1261
|
}), h;
|
|
1253
|
-
}),
|
|
1262
|
+
}), A = w(() => {
|
|
1254
1263
|
const o = /* @__PURE__ */ new Set(["search-actions"]);
|
|
1255
|
-
return (
|
|
1264
|
+
return (B.value || []).forEach((h) => {
|
|
1256
1265
|
h.type === "slot" && o.add(h.slotName || h.prop);
|
|
1257
1266
|
}), o;
|
|
1258
|
-
}),
|
|
1267
|
+
}), I = w(() => {
|
|
1259
1268
|
const o = {};
|
|
1260
1269
|
for (const h in u)
|
|
1261
|
-
h === "search-actions" || h === "toolbar" || (
|
|
1270
|
+
h === "search-actions" || h === "toolbar" || (A.value.has(h) || h.startsWith("form-")) && (o[h] = u[h]);
|
|
1262
1271
|
return o;
|
|
1263
1272
|
}), de = w(() => {
|
|
1264
1273
|
const o = {};
|
|
1265
1274
|
for (const h in u)
|
|
1266
|
-
h !== "toolbar" && !
|
|
1275
|
+
h !== "toolbar" && !A.value.has(h) && !h.startsWith("form-") && (o[h] = u[h]);
|
|
1267
1276
|
return o;
|
|
1268
1277
|
}), ce = () => {
|
|
1269
|
-
|
|
1278
|
+
r.value?.submitForm();
|
|
1270
1279
|
}, pe = (o) => {
|
|
1271
|
-
t("submit", o), e.gridOptions.proxyConfig && (
|
|
1272
|
-
},
|
|
1273
|
-
|
|
1280
|
+
t("submit", o), e.gridOptions.proxyConfig && (i.value = { ...o }, c.value = 1, d.value?.reload?.({ formData: i.value, page: 1 }));
|
|
1281
|
+
}, E = () => {
|
|
1282
|
+
r.value?.resetForm();
|
|
1274
1283
|
}, oe = () => {
|
|
1275
|
-
t("reset"), e.gridOptions.proxyConfig && (
|
|
1284
|
+
t("reset"), e.gridOptions.proxyConfig && (i.value = {}, c.value = 1, d.value?.reload?.({ formData: {}, page: 1 }));
|
|
1276
1285
|
}, fe = (o) => {
|
|
1277
1286
|
if (o)
|
|
1278
|
-
return typeof o == "object" || typeof o == "function" ? o :
|
|
1287
|
+
return typeof o == "object" || typeof o == "function" ? o : C[o];
|
|
1279
1288
|
}, me = w(() => {
|
|
1280
1289
|
const o = e.gridOptions.proxyConfig;
|
|
1281
1290
|
return o ? {
|
|
1282
1291
|
...o,
|
|
1283
|
-
_formData:
|
|
1292
|
+
_formData: i.value
|
|
1284
1293
|
} : null;
|
|
1285
1294
|
}), ge = w(() => {
|
|
1286
1295
|
const {
|
|
@@ -1291,27 +1300,27 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1291
1300
|
rules: re,
|
|
1292
1301
|
data: ye,
|
|
1293
1302
|
proxyConfig: Ze,
|
|
1294
|
-
...
|
|
1303
|
+
...je
|
|
1295
1304
|
} = e.gridOptions;
|
|
1296
1305
|
return {
|
|
1297
|
-
...
|
|
1306
|
+
...je,
|
|
1298
1307
|
proxyConfig: me.value || Ze || null
|
|
1299
1308
|
};
|
|
1300
|
-
}), le = w(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), Ae = w(() => !!e.gridOptions.proxyConfig),
|
|
1309
|
+
}), le = w(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), Ae = w(() => !!e.gridOptions.proxyConfig), m = w(() => Ae.value ? 0 : le.value.length), $ = (o, h) => {
|
|
1301
1310
|
t("toolbar-click", { code: o, button: h, grid: d.value });
|
|
1302
|
-
}, I = (o) => {
|
|
1303
|
-
c.value = o.page, t("page-change", o);
|
|
1304
1311
|
}, N = (o) => {
|
|
1305
|
-
|
|
1306
|
-
},
|
|
1312
|
+
c.value = o.page, t("page-change", o);
|
|
1313
|
+
}, U = (o) => {
|
|
1314
|
+
p.value = o.size, t("size-change", o);
|
|
1315
|
+
}, he = () => d.value, ve = () => r.value, Ce = () => d.value?.getTableRef()?.getSelectionRows?.() || [], we = (o) => {
|
|
1307
1316
|
z.value = o ?? null;
|
|
1308
1317
|
}, _e = (o) => {
|
|
1309
|
-
|
|
1310
|
-
},
|
|
1318
|
+
f.value = o;
|
|
1319
|
+
}, q = (o, h = !0) => {
|
|
1311
1320
|
const D = e.gridOptions.formConfig;
|
|
1312
|
-
D?.data && Object.assign(D.data, o),
|
|
1313
|
-
},
|
|
1314
|
-
const D =
|
|
1321
|
+
D?.data && Object.assign(D.data, o), i.value = { ...D?.data || {}, ...o }, h && e.gridOptions.proxyConfig && (c.value = 1, d.value?.reload?.({ formData: i.value, page: 1 }));
|
|
1322
|
+
}, T = (o, ...h) => {
|
|
1323
|
+
const D = i.value;
|
|
1315
1324
|
switch (o) {
|
|
1316
1325
|
case "query":
|
|
1317
1326
|
c.value = 1, d.value?.reload?.({ formData: D, page: 1 });
|
|
@@ -1326,21 +1335,21 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1326
1335
|
X(
|
|
1327
1336
|
() => e.gridOptions.formMode,
|
|
1328
1337
|
(o) => {
|
|
1329
|
-
o !== void 0 && (
|
|
1338
|
+
o !== void 0 && (f.value = o);
|
|
1330
1339
|
}
|
|
1331
1340
|
), Le(() => {
|
|
1332
|
-
e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && d.value?.reload?.({ formData:
|
|
1341
|
+
e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && d.value?.reload?.({ formData: i.value, page: 1 });
|
|
1333
1342
|
});
|
|
1334
1343
|
const P = () => d.value?.getTableRef?.();
|
|
1335
|
-
return
|
|
1344
|
+
return n({
|
|
1336
1345
|
getGridRef: he,
|
|
1337
1346
|
getFormRef: ve,
|
|
1338
1347
|
getElTableRef: P,
|
|
1339
1348
|
getSelectedRows: Ce,
|
|
1340
1349
|
reloadData: we,
|
|
1341
1350
|
setFormVisible: _e,
|
|
1342
|
-
setFormData:
|
|
1343
|
-
commitProxy:
|
|
1351
|
+
setFormData: q,
|
|
1352
|
+
commitProxy: T,
|
|
1344
1353
|
clearSelection: () => P()?.clearSelection(),
|
|
1345
1354
|
toggleRowSelection: (...o) => P()?.toggleRowSelection(...o),
|
|
1346
1355
|
toggleAllSelection: () => P()?.toggleAllSelection(),
|
|
@@ -1351,28 +1360,28 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1351
1360
|
doLayout: () => P()?.doLayout(),
|
|
1352
1361
|
sort: (...o) => P()?.sort(...o)
|
|
1353
1362
|
}), {
|
|
1354
|
-
attrs:
|
|
1363
|
+
attrs: l,
|
|
1355
1364
|
gridRef: d,
|
|
1356
|
-
searchFormRef:
|
|
1365
|
+
searchFormRef: r,
|
|
1357
1366
|
currentPage: c,
|
|
1358
|
-
pageSize:
|
|
1367
|
+
pageSize: p,
|
|
1359
1368
|
tableData: le,
|
|
1360
1369
|
tableProps: ge,
|
|
1361
|
-
mergedColumns:
|
|
1362
|
-
actionColumnConfig:
|
|
1363
|
-
total:
|
|
1364
|
-
isFormVisible:
|
|
1365
|
-
searchFormColumns:
|
|
1366
|
-
formFilteredSlots:
|
|
1370
|
+
mergedColumns: v,
|
|
1371
|
+
actionColumnConfig: a,
|
|
1372
|
+
total: m,
|
|
1373
|
+
isFormVisible: f,
|
|
1374
|
+
searchFormColumns: B,
|
|
1375
|
+
formFilteredSlots: I,
|
|
1367
1376
|
tableFilteredSlots: de,
|
|
1368
1377
|
getIconComponent: fe,
|
|
1369
1378
|
handleToolbarClick: $,
|
|
1370
|
-
handleActionClick:
|
|
1371
|
-
handlePageChange:
|
|
1372
|
-
handleSizeChange:
|
|
1379
|
+
handleActionClick: R,
|
|
1380
|
+
handlePageChange: N,
|
|
1381
|
+
handleSizeChange: U,
|
|
1373
1382
|
handleSearch: ce,
|
|
1374
1383
|
handleSearchSubmit: pe,
|
|
1375
|
-
handleReset:
|
|
1384
|
+
handleReset: E,
|
|
1376
1385
|
handleSearchReset: oe,
|
|
1377
1386
|
Search: ie,
|
|
1378
1387
|
Refresh: se
|
|
@@ -1385,12 +1394,12 @@ const sa = /* @__PURE__ */ G(oa, [["render", ra], ["__scopeId", "data-v-bb5b85d9
|
|
|
1385
1394
|
key: 0,
|
|
1386
1395
|
class: "grid-toolbar"
|
|
1387
1396
|
};
|
|
1388
|
-
function fa(e, t,
|
|
1389
|
-
const
|
|
1390
|
-
return
|
|
1397
|
+
function fa(e, t, n, l, u, d) {
|
|
1398
|
+
const r = S("el-button"), c = S("ZxtForm"), p = S("ActionColumn"), z = S("ZxtTable");
|
|
1399
|
+
return s(), g("div", {
|
|
1391
1400
|
class: ue(["zxt-grid-container", { "zxt-grid-container--full": e.gridOptions.height === "full" }])
|
|
1392
1401
|
}, [
|
|
1393
|
-
e.gridOptions.formConfig && e.isFormVisible ? (
|
|
1402
|
+
e.gridOptions.formConfig && e.isFormVisible ? (s(), g("div", ua, [
|
|
1394
1403
|
F(c, {
|
|
1395
1404
|
ref: "searchFormRef",
|
|
1396
1405
|
"form-columns": e.searchFormColumns,
|
|
@@ -1401,23 +1410,23 @@ function fa(e, t, a, r, u, d) {
|
|
|
1401
1410
|
}, Y({
|
|
1402
1411
|
"search-actions": _(() => [
|
|
1403
1412
|
y("div", da, [
|
|
1404
|
-
F(
|
|
1413
|
+
F(r, {
|
|
1405
1414
|
class: "btn-search",
|
|
1406
1415
|
icon: e.Search,
|
|
1407
1416
|
onClick: e.handleSearch
|
|
1408
1417
|
}, {
|
|
1409
1418
|
default: _(() => [...t[0] || (t[0] = [
|
|
1410
|
-
|
|
1419
|
+
j(" 查询 ", -1)
|
|
1411
1420
|
])]),
|
|
1412
1421
|
_: 1
|
|
1413
1422
|
}, 8, ["icon", "onClick"]),
|
|
1414
|
-
F(
|
|
1423
|
+
F(r, {
|
|
1415
1424
|
class: "btn-reset",
|
|
1416
1425
|
icon: e.Refresh,
|
|
1417
1426
|
onClick: e.handleReset
|
|
1418
1427
|
}, {
|
|
1419
1428
|
default: _(() => [...t[1] || (t[1] = [
|
|
1420
|
-
|
|
1429
|
+
j(" 重置 ", -1)
|
|
1421
1430
|
])]),
|
|
1422
1431
|
_: 1
|
|
1423
1432
|
}, 8, ["icon", "onClick"])
|
|
@@ -1425,34 +1434,34 @@ function fa(e, t, a, r, u, d) {
|
|
|
1425
1434
|
]),
|
|
1426
1435
|
_: 2
|
|
1427
1436
|
}, [
|
|
1428
|
-
|
|
1429
|
-
name:
|
|
1430
|
-
fn: _((
|
|
1431
|
-
|
|
1437
|
+
O(e.formFilteredSlots, (f, i) => ({
|
|
1438
|
+
name: i,
|
|
1439
|
+
fn: _((C) => [
|
|
1440
|
+
M(e.$slots, i, Me(Oe(C)), void 0, !0)
|
|
1432
1441
|
])
|
|
1433
1442
|
}))
|
|
1434
1443
|
]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
|
|
1435
|
-
])) :
|
|
1444
|
+
])) : G("", !0),
|
|
1436
1445
|
y("div", ca, [
|
|
1437
|
-
e.gridOptions.toolbar ? (
|
|
1438
|
-
(
|
|
1439
|
-
key:
|
|
1440
|
-
type:
|
|
1441
|
-
size:
|
|
1442
|
-
icon: e.getIconComponent(
|
|
1443
|
-
disabled:
|
|
1444
|
-
onClick: (
|
|
1446
|
+
e.gridOptions.toolbar ? (s(), g("div", pa, [
|
|
1447
|
+
(s(!0), g(H, null, O(e.gridOptions.toolbar.buttons, (f, i) => (s(), V(r, {
|
|
1448
|
+
key: i,
|
|
1449
|
+
type: f.type || "default",
|
|
1450
|
+
size: f.size || "small",
|
|
1451
|
+
icon: e.getIconComponent(f.icon),
|
|
1452
|
+
disabled: f.disabled,
|
|
1453
|
+
onClick: (C) => e.handleToolbarClick(f.code, f)
|
|
1445
1454
|
}, {
|
|
1446
1455
|
default: _(() => [
|
|
1447
|
-
|
|
1456
|
+
j(ee(f.name), 1)
|
|
1448
1457
|
]),
|
|
1449
1458
|
_: 2
|
|
1450
1459
|
}, 1032, ["type", "size", "icon", "disabled", "onClick"]))), 128)),
|
|
1451
|
-
|
|
1460
|
+
M(e.$slots, "toolbar", {
|
|
1452
1461
|
grid: e.$refs.gridRef
|
|
1453
1462
|
}, void 0, !0)
|
|
1454
|
-
])) :
|
|
1455
|
-
F(z,
|
|
1463
|
+
])) : G("", !0),
|
|
1464
|
+
F(z, L({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
|
|
1456
1465
|
id: e.gridOptions.id,
|
|
1457
1466
|
columns: e.mergedColumns,
|
|
1458
1467
|
data: e.tableData,
|
|
@@ -1469,35 +1478,35 @@ function fa(e, t, a, r, u, d) {
|
|
|
1469
1478
|
}), Y({ _: 2 }, [
|
|
1470
1479
|
e.actionColumnConfig ? {
|
|
1471
1480
|
name: "zxtActionInternal",
|
|
1472
|
-
fn: _(({ row:
|
|
1473
|
-
F(
|
|
1481
|
+
fn: _(({ row: f }) => [
|
|
1482
|
+
F(p, {
|
|
1474
1483
|
buttons: e.actionColumnConfig.buttons,
|
|
1475
|
-
row:
|
|
1484
|
+
row: f,
|
|
1476
1485
|
"max-visible": e.actionColumnConfig.maxVisible || 2,
|
|
1477
1486
|
onActionClick: e.handleActionClick
|
|
1478
1487
|
}, null, 8, ["buttons", "row", "max-visible", "onActionClick"])
|
|
1479
1488
|
]),
|
|
1480
1489
|
key: "0"
|
|
1481
1490
|
} : void 0,
|
|
1482
|
-
|
|
1483
|
-
name:
|
|
1484
|
-
fn: _((
|
|
1485
|
-
|
|
1491
|
+
O(e.tableFilteredSlots, (f, i) => ({
|
|
1492
|
+
name: i,
|
|
1493
|
+
fn: _((C) => [
|
|
1494
|
+
M(e.$slots, i, Me(Oe(C)), void 0, !0)
|
|
1486
1495
|
])
|
|
1487
1496
|
}))
|
|
1488
1497
|
]), 1040, ["id", "columns", "data", "height", "pageable", "current-page", "page-size", "page-sizes", "total", "pagination-layout", "onPageChange", "onSizeChange"])
|
|
1489
1498
|
])
|
|
1490
1499
|
], 2);
|
|
1491
1500
|
}
|
|
1492
|
-
const
|
|
1501
|
+
const Ee = /* @__PURE__ */ J(ia, [["render", fa], ["__scopeId", "data-v-0948a778"]]);
|
|
1493
1502
|
Q.install = function(e) {
|
|
1494
1503
|
e.component(Q.name, Q);
|
|
1495
1504
|
};
|
|
1496
1505
|
const ma = [
|
|
1497
1506
|
te,
|
|
1498
1507
|
ae,
|
|
1499
|
-
|
|
1500
|
-
|
|
1508
|
+
x,
|
|
1509
|
+
Ee,
|
|
1501
1510
|
Re,
|
|
1502
1511
|
Q
|
|
1503
1512
|
], ga = (e) => {
|
|
@@ -1508,20 +1517,20 @@ const ma = [
|
|
|
1508
1517
|
install: ga,
|
|
1509
1518
|
MyButton: te,
|
|
1510
1519
|
JsxButton: ae,
|
|
1511
|
-
ZxtTable:
|
|
1512
|
-
ZxtGrid:
|
|
1520
|
+
ZxtTable: x,
|
|
1521
|
+
ZxtGrid: Ee,
|
|
1513
1522
|
ZxtForm: Re,
|
|
1514
1523
|
ZxtPagination: Q,
|
|
1515
1524
|
// 暴露渲染器 API
|
|
1516
|
-
renderer:
|
|
1517
|
-
registerRenderer:
|
|
1525
|
+
renderer: x.renderer,
|
|
1526
|
+
registerRenderer: x.registerRenderer
|
|
1518
1527
|
};
|
|
1519
1528
|
export {
|
|
1520
1529
|
ae as JsxButton,
|
|
1521
1530
|
te as MyButton,
|
|
1522
1531
|
Re as ZxtForm,
|
|
1523
|
-
|
|
1532
|
+
Ee as ZxtGrid,
|
|
1524
1533
|
Q as ZxtPagination,
|
|
1525
|
-
|
|
1534
|
+
x as ZxtTable,
|
|
1526
1535
|
Ca as default
|
|
1527
1536
|
};
|