zxt-table 0.5.2 → 0.5.3
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 +375 -361
- package/dist/zxt-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/zxt-table.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
import { ElPagination as
|
|
1
|
+
import { createElementBlock as g, openBlock as s, normalizeClass as ie, renderSlot as Z, defineComponent as y, createVNode as D, ref as k, watch as K, resolveComponent as z, createBlock as $, h as G, inject as Te, computed as C, mergeProps as M, withCtx as b, Fragment as B, renderList as R, createSlots as ne, resolveDynamicComponent as ye, createTextVNode as j, toDisplayString as Q, provide as He, onMounted as Oe, resolveDirective as Ze, normalizeStyle as je, withDirectives as Ie, createCommentVNode as X, createElementVNode as w, reactive as Ee, toHandlers as Ne, useAttrs as Ue, useSlots as qe, normalizeProps as Re, guardReactiveProps as Ae } from "vue";
|
|
2
|
+
import { ElPagination as We, ElLink as Ge, ElCheckbox as Je, ElSelect as Ke, ElOption as Qe, ElInput as Xe, ElTableColumn as Ye, ElTable as et } from "element-plus";
|
|
3
3
|
const q = (e, t) => {
|
|
4
4
|
const a = e.__vccOpts || e;
|
|
5
|
-
for (const [l,
|
|
6
|
-
a[l] =
|
|
5
|
+
for (const [l, u] of t)
|
|
6
|
+
a[l] = u;
|
|
7
7
|
return a;
|
|
8
|
-
},
|
|
8
|
+
}, tt = {
|
|
9
9
|
name: "MyButton",
|
|
10
10
|
props: {
|
|
11
11
|
type: {
|
|
@@ -26,17 +26,17 @@ const q = (e, t) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
function
|
|
31
|
-
return s(),
|
|
32
|
-
class:
|
|
29
|
+
}, at = ["disabled"];
|
|
30
|
+
function nt(e, t, a, l, u, c) {
|
|
31
|
+
return s(), g("button", {
|
|
32
|
+
class: ie(["my-button", [`my-button--${a.type}`, { "is-disabled": a.disabled }]]),
|
|
33
33
|
disabled: a.disabled,
|
|
34
34
|
onClick: t[0] || (t[0] = (...r) => l.handleClick && l.handleClick(...r))
|
|
35
35
|
}, [
|
|
36
36
|
Z(e.$slots, "default", {}, void 0, !0)
|
|
37
|
-
], 10,
|
|
37
|
+
], 10, at);
|
|
38
38
|
}
|
|
39
|
-
const ee = /* @__PURE__ */ q(
|
|
39
|
+
const ee = /* @__PURE__ */ q(tt, [["render", nt], ["__scopeId", "data-v-4480e77d"]]);
|
|
40
40
|
ee.install = function(e) {
|
|
41
41
|
e.component(ee.name, ee);
|
|
42
42
|
};
|
|
@@ -58,10 +58,10 @@ const te = /* @__PURE__ */ y({
|
|
|
58
58
|
emit: t,
|
|
59
59
|
slots: a
|
|
60
60
|
}) {
|
|
61
|
-
const l = (
|
|
62
|
-
e.disabled || t("click",
|
|
61
|
+
const l = (u) => {
|
|
62
|
+
e.disabled || t("click", u);
|
|
63
63
|
};
|
|
64
|
-
return () =>
|
|
64
|
+
return () => D("button", {
|
|
65
65
|
class: ["jsx-button", `jsx-button--${e.type}`, {
|
|
66
66
|
"is-disabled": e.disabled
|
|
67
67
|
}],
|
|
@@ -73,9 +73,9 @@ const te = /* @__PURE__ */ y({
|
|
|
73
73
|
te.install = function(e) {
|
|
74
74
|
e.component(te.name, te);
|
|
75
75
|
};
|
|
76
|
-
const
|
|
76
|
+
const ot = y({
|
|
77
77
|
name: "ZxtPagination",
|
|
78
|
-
components: { ElPagination:
|
|
78
|
+
components: { ElPagination: We },
|
|
79
79
|
props: {
|
|
80
80
|
// 当前页码
|
|
81
81
|
modelValue: { type: Number, default: 1 },
|
|
@@ -116,7 +116,7 @@ const nt = y({
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
function
|
|
119
|
+
function rt(e, t, a, l, u, c) {
|
|
120
120
|
const r = z("el-pagination");
|
|
121
121
|
return s(), $(r, {
|
|
122
122
|
"current-page": e.currentPage,
|
|
@@ -131,31 +131,31 @@ function ot(e, t, a, l, i, c) {
|
|
|
131
131
|
onCurrentChange: e.handleCurrentChange
|
|
132
132
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout", "onSizeChange", "onCurrentChange"]);
|
|
133
133
|
}
|
|
134
|
-
const J = /* @__PURE__ */ q(
|
|
134
|
+
const J = /* @__PURE__ */ q(ot, [["render", rt], ["__scopeId", "data-v-497aa44d"]]), ae = {
|
|
135
135
|
default: ({ cellValue: e }) => e ?? "",
|
|
136
|
-
input: ({ cellValue: e, row: t, column: a, updateRow: l }) => G(
|
|
136
|
+
input: ({ cellValue: e, row: t, column: a, updateRow: l }) => G(Xe, {
|
|
137
137
|
modelValue: e,
|
|
138
138
|
size: "small",
|
|
139
|
-
onInput: (
|
|
139
|
+
onInput: (u) => l({ ...t, [a.property]: u })
|
|
140
140
|
}),
|
|
141
|
-
select: ({ cellValue: e, row: t, column: a, updateRow: l, options:
|
|
142
|
-
|
|
141
|
+
select: ({ cellValue: e, row: t, column: a, updateRow: l, options: u = [] }) => G(
|
|
142
|
+
Ke,
|
|
143
143
|
{
|
|
144
144
|
modelValue: e,
|
|
145
145
|
size: "small",
|
|
146
146
|
onChange: (c) => l({ ...t, [a.property]: c })
|
|
147
147
|
},
|
|
148
|
-
() =>
|
|
149
|
-
(c) => G(
|
|
148
|
+
() => u.map(
|
|
149
|
+
(c) => G(Qe, { label: c.label, value: c.value, key: c.value })
|
|
150
150
|
)
|
|
151
151
|
),
|
|
152
|
-
checkbox: ({ cellValue: e, row: t, column: a, updateRow: l }) => G(
|
|
152
|
+
checkbox: ({ cellValue: e, row: t, column: a, updateRow: l }) => G(Je, {
|
|
153
153
|
modelValue: !!e,
|
|
154
|
-
onChange: (
|
|
154
|
+
onChange: (u) => l({ ...t, [a.property]: u })
|
|
155
155
|
}),
|
|
156
|
-
link: ({ cellValue: e, href: t, target: a = "_blank" }) => G(
|
|
156
|
+
link: ({ cellValue: e, href: t, target: a = "_blank" }) => G(Ge, { href: t, target: a }, () => e)
|
|
157
157
|
};
|
|
158
|
-
function
|
|
158
|
+
function lt(e, t) {
|
|
159
159
|
if (!e) return null;
|
|
160
160
|
if (typeof e == "string") {
|
|
161
161
|
const a = ae[e];
|
|
@@ -164,22 +164,22 @@ function rt(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: l = {}, attrs:
|
|
167
|
+
const { name: a, props: l = {}, attrs: u = {}, events: c = {}, content: r } = e;
|
|
168
168
|
return typeof a == "string" && ae[a] ? ae[a]({
|
|
169
169
|
...t,
|
|
170
170
|
...l,
|
|
171
|
-
...
|
|
171
|
+
...u,
|
|
172
172
|
...c
|
|
173
|
-
}) : typeof a == "object" || typeof a == "function" ? G(a, { ...l, ...
|
|
173
|
+
}) : typeof a == "object" || typeof a == "function" ? G(a, { ...l, ...u, ...c }, r) : (console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"), t.cellValue ?? "");
|
|
174
174
|
}
|
|
175
175
|
return t.cellValue ?? "";
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function st(e, t) {
|
|
178
178
|
ae[e] && console.warn(`[ZxtTable] 内置渲染器 ${e} 已被覆盖`), ae[e] = t;
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const it = y({
|
|
181
181
|
name: "ZxtTableColumn",
|
|
182
|
-
components: { ElTableColumn:
|
|
182
|
+
components: { ElTableColumn: Ye },
|
|
183
183
|
props: {
|
|
184
184
|
column: {
|
|
185
185
|
type: Object,
|
|
@@ -195,10 +195,10 @@ const st = y({
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
setup(e) {
|
|
198
|
-
const t =
|
|
198
|
+
const t = Te("updateRow", () => {
|
|
199
199
|
}), a = (r) => {
|
|
200
|
-
const { currentPage: p, pageSize:
|
|
201
|
-
return (p - 1) *
|
|
200
|
+
const { currentPage: p, pageSize: m } = e;
|
|
201
|
+
return (p - 1) * m + r + 1;
|
|
202
202
|
}, l = C(() => {
|
|
203
203
|
const r = e.column;
|
|
204
204
|
return {
|
|
@@ -208,16 +208,16 @@ const st = y({
|
|
|
208
208
|
label: r.label ?? r.title
|
|
209
209
|
// 优先使用 label,兼容 title
|
|
210
210
|
};
|
|
211
|
-
}),
|
|
211
|
+
}), u = C(() => {
|
|
212
212
|
const { children: r, ...p } = l.value;
|
|
213
213
|
return p;
|
|
214
214
|
});
|
|
215
215
|
return {
|
|
216
216
|
normalizedColumn: l,
|
|
217
|
-
columnProps:
|
|
217
|
+
columnProps: u,
|
|
218
218
|
renderCell: (r) => {
|
|
219
|
-
const p = l.value,
|
|
220
|
-
return
|
|
219
|
+
const p = l.value, m = r.row[p.prop], d = m ?? p.defaultValue ?? "";
|
|
220
|
+
return lt(p.cellRender, {
|
|
221
221
|
row: r.row,
|
|
222
222
|
column: p,
|
|
223
223
|
rowIndex: r.$index,
|
|
@@ -229,58 +229,58 @@ const st = y({
|
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
|
-
function
|
|
232
|
+
function ut(e, t, a, l, u, c) {
|
|
233
233
|
const r = z("ZxtTableColumn", !0), p = z("el-table-column");
|
|
234
|
-
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (s(), $(p,
|
|
234
|
+
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (s(), $(p, M({ key: 0 }, e.columnProps, {
|
|
235
235
|
key: e.normalizedColumn.prop + "-group"
|
|
236
236
|
}), {
|
|
237
237
|
default: b(() => [
|
|
238
|
-
(s(!0),
|
|
238
|
+
(s(!0), g(B, null, R(e.normalizedColumn.children, (m, d) => (s(), $(r, {
|
|
239
239
|
key: d,
|
|
240
|
-
column:
|
|
240
|
+
column: m,
|
|
241
241
|
"current-page": e.currentPage,
|
|
242
242
|
"page-size": e.pageSize
|
|
243
243
|
}, ne({ _: 2 }, [
|
|
244
|
-
R(e.$slots, (h,
|
|
245
|
-
name:
|
|
244
|
+
R(e.$slots, (h, i) => ({
|
|
245
|
+
name: i,
|
|
246
246
|
fn: b((_) => [
|
|
247
|
-
Z(e.$slots,
|
|
247
|
+
Z(e.$slots, i, M({ ref_for: !0 }, _))
|
|
248
248
|
])
|
|
249
249
|
}))
|
|
250
250
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
251
251
|
]),
|
|
252
252
|
_: 3
|
|
253
|
-
}, 16)) : (s(), $(p,
|
|
253
|
+
}, 16)) : (s(), $(p, M({ key: 1 }, e.columnProps, {
|
|
254
254
|
key: e.normalizedColumn.prop,
|
|
255
255
|
index: e.normalizedColumn.indexMethod || e.defaultIndexMethod
|
|
256
256
|
}), ne({ _: 2 }, [
|
|
257
257
|
!["selection", "index"].includes(e.normalizedColumn.type) && (e.normalizedColumn.type !== "expand" || e.normalizedColumn.slot) ? {
|
|
258
258
|
name: "default",
|
|
259
|
-
fn: b((
|
|
259
|
+
fn: b((m) => [
|
|
260
260
|
e.normalizedColumn.slot ? Z(e.$slots, e.normalizedColumn.slot, {
|
|
261
261
|
key: 0,
|
|
262
|
-
row:
|
|
263
|
-
index:
|
|
262
|
+
row: m.row,
|
|
263
|
+
index: m.$index,
|
|
264
264
|
column: e.normalizedColumn
|
|
265
|
-
}) : e.normalizedColumn.cellRender ? (s(), $(
|
|
265
|
+
}) : e.normalizedColumn.cellRender ? (s(), $(ye(e.renderCell(m)), { key: 1 })) : e.normalizedColumn.formatter ? (s(), g(B, { key: 2 }, [
|
|
266
266
|
j(Q(e.normalizedColumn.formatter(
|
|
267
|
-
|
|
267
|
+
m.row,
|
|
268
268
|
e.normalizedColumn,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
m.row[e.normalizedColumn.prop],
|
|
270
|
+
m.$index
|
|
271
271
|
)), 1)
|
|
272
|
-
], 64)) : (s(),
|
|
273
|
-
j(Q(
|
|
272
|
+
], 64)) : (s(), g(B, { key: 3 }, [
|
|
273
|
+
j(Q(m.row[e.normalizedColumn.prop]), 1)
|
|
274
274
|
], 64))
|
|
275
275
|
]),
|
|
276
276
|
key: "0"
|
|
277
277
|
} : void 0
|
|
278
278
|
]), 1040, ["index"]));
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const dt = /* @__PURE__ */ q(it, [["render", ut]]), ct = y({
|
|
281
281
|
name: "ZxtTable",
|
|
282
282
|
inheritAttrs: !1,
|
|
283
|
-
components: { ZxtPagination: J, ZxtTableColumn:
|
|
283
|
+
components: { ZxtPagination: J, ZxtTableColumn: dt, ElTable: et },
|
|
284
284
|
props: {
|
|
285
285
|
// 表格唯一标识
|
|
286
286
|
id: { type: String, default: "" },
|
|
@@ -309,6 +309,11 @@ const ut = /* @__PURE__ */ q(st, [["render", it]]), dt = y({
|
|
|
309
309
|
proxyConfig: {
|
|
310
310
|
type: Object,
|
|
311
311
|
default: null
|
|
312
|
+
},
|
|
313
|
+
// 是否在挂载时自动加载数据(proxy 模式下)
|
|
314
|
+
autoLoad: {
|
|
315
|
+
type: Boolean,
|
|
316
|
+
default: !0
|
|
312
317
|
}
|
|
313
318
|
},
|
|
314
319
|
emits: [
|
|
@@ -321,95 +326,95 @@ const ut = /* @__PURE__ */ q(st, [["render", it]]), dt = y({
|
|
|
321
326
|
"update:row"
|
|
322
327
|
],
|
|
323
328
|
setup(e, { emit: t }) {
|
|
324
|
-
const a = k(null), l = k(e.pageSize),
|
|
329
|
+
const a = k(null), l = k(e.pageSize), u = k(e.currentPage), c = k(!1), r = k([]), p = k(0), m = k({ prop: "", order: "" }), d = k({}), h = k({});
|
|
325
330
|
K(() => e.currentPage, (v) => {
|
|
326
|
-
|
|
331
|
+
u.value = v;
|
|
327
332
|
}), K(() => e.pageSize, (v) => {
|
|
328
333
|
l.value = v;
|
|
329
334
|
});
|
|
330
|
-
const
|
|
335
|
+
const i = C(() => e.height === "full" ? { height: "100%" } : {}), _ = C(() => {
|
|
331
336
|
if (e.height !== "full")
|
|
332
337
|
return e.height;
|
|
333
|
-
}), o = C(() => !!e.proxyConfig), S = C(() => o.value ? p.value : e.total > 0 ? e.total : e.data.length),
|
|
338
|
+
}), o = C(() => !!e.proxyConfig), S = C(() => o.value ? p.value : e.total > 0 ? e.total : e.data.length), L = C(
|
|
334
339
|
() => o.value ? r.value : e.data
|
|
335
340
|
), W = (v) => {
|
|
336
|
-
o.value && (
|
|
337
|
-
},
|
|
338
|
-
o.value && (
|
|
339
|
-
}, I = ({ column: v, prop:
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
d.value = v || {}, o.value &&
|
|
343
|
-
},
|
|
341
|
+
o.value && (u.value = v.page, l.value = v.size, T()), t("size-change", v);
|
|
342
|
+
}, x = (v) => {
|
|
343
|
+
o.value && (u.value = v.page, l.value = v.size, T()), t("page-change", v);
|
|
344
|
+
}, I = ({ column: v, prop: P, order: H }) => {
|
|
345
|
+
m.value = { prop: P, order: H }, o.value && T(), t("sort-change", { column: v, prop: P, order: H });
|
|
346
|
+
}, ue = (v) => {
|
|
347
|
+
d.value = v || {}, o.value && T(), t("filter-change", d.value);
|
|
348
|
+
}, T = async (v) => {
|
|
344
349
|
if (!o.value) return;
|
|
345
|
-
const
|
|
350
|
+
const P = e.proxyConfig || {}, H = P.ajax?.query;
|
|
346
351
|
if (typeof H != "function") return;
|
|
347
|
-
const E =
|
|
352
|
+
const E = P.props || {}, fe = E.pageField || "page";
|
|
348
353
|
E.sizeField;
|
|
349
|
-
const
|
|
350
|
-
v?.formData !== void 0 ? h.value = v.formData :
|
|
351
|
-
const
|
|
352
|
-
[
|
|
353
|
-
currentPage: v?.page ??
|
|
354
|
+
const ge = E.sortField || "sort", me = E.orderField || "order", he = E.filtersField || "filters";
|
|
355
|
+
v?.formData !== void 0 ? h.value = v.formData : P._formData && (h.value = P._formData);
|
|
356
|
+
const ve = P.params || {}, N = {
|
|
357
|
+
[fe]: {
|
|
358
|
+
currentPage: v?.page ?? u.value,
|
|
354
359
|
pageSize: v?.pageSize ?? l.value
|
|
355
360
|
},
|
|
356
361
|
form: h.value,
|
|
357
|
-
...
|
|
362
|
+
...ve
|
|
358
363
|
};
|
|
359
|
-
|
|
364
|
+
m.value?.prop && (N[ge] = m.value.prop, N[me] = m.value.order), d.value && Object.keys(d.value).length && (N[he] = d.value), c.value = !0;
|
|
360
365
|
try {
|
|
361
|
-
const
|
|
362
|
-
let
|
|
363
|
-
if (typeof
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
} else
|
|
367
|
-
r.value = Array.isArray(
|
|
366
|
+
const F = await H(N), Y = P.response || {}, _e = Y.listField || "list", Ce = Y.totalField || "total", re = Y.transform;
|
|
367
|
+
let V = [], n = 0;
|
|
368
|
+
if (typeof re == "function") {
|
|
369
|
+
const f = re(F);
|
|
370
|
+
V = f?.list ?? [], n = f?.total ?? 0;
|
|
371
|
+
} else F && typeof F == "object" && (V = F?.[_e] ?? F?.data ?? [], n = F?.[Ce] ?? F?.total ?? 0);
|
|
372
|
+
r.value = Array.isArray(V) ? V : [], p.value = Number(n) || 0, t("loaded", {
|
|
368
373
|
data: r.value,
|
|
369
374
|
total: p.value,
|
|
370
375
|
payload: N
|
|
371
376
|
});
|
|
372
|
-
} catch (
|
|
373
|
-
t("load-error",
|
|
377
|
+
} catch (F) {
|
|
378
|
+
t("load-error", F);
|
|
374
379
|
} finally {
|
|
375
380
|
c.value = !1;
|
|
376
381
|
}
|
|
377
|
-
}, oe = (v,
|
|
378
|
-
o.value ? r.value.splice(
|
|
382
|
+
}, oe = (v, P) => {
|
|
383
|
+
o.value ? r.value.splice(P, 1, v) : t("update:row", { index: P, row: v });
|
|
379
384
|
};
|
|
380
|
-
|
|
381
|
-
o.value &&
|
|
385
|
+
He("updateRow", oe), Oe(() => {
|
|
386
|
+
o.value && e.autoLoad && T();
|
|
382
387
|
});
|
|
383
|
-
const
|
|
388
|
+
const de = () => a.value, ce = () => a.value?.getSelectionRows?.() || [], pe = (v) => T(v);
|
|
384
389
|
return {
|
|
385
390
|
tableRef: a,
|
|
386
|
-
containerStyle:
|
|
391
|
+
containerStyle: i,
|
|
387
392
|
tableHeight: _,
|
|
388
|
-
getTableRef:
|
|
393
|
+
getTableRef: de,
|
|
389
394
|
pageSize: l,
|
|
390
|
-
currentPage:
|
|
395
|
+
currentPage: u,
|
|
391
396
|
loading: c,
|
|
392
|
-
renderData:
|
|
397
|
+
renderData: L,
|
|
393
398
|
total: S,
|
|
394
399
|
pageSizes: C(() => e.pageSizes),
|
|
395
400
|
paginationLayout: C(() => e.paginationLayout),
|
|
396
401
|
handleSizeChange: W,
|
|
397
|
-
handlePageChange:
|
|
402
|
+
handlePageChange: x,
|
|
398
403
|
handleSortChange: I,
|
|
399
|
-
handleFilterChange:
|
|
400
|
-
reload:
|
|
401
|
-
getSelectedRows:
|
|
404
|
+
handleFilterChange: ue,
|
|
405
|
+
reload: pe,
|
|
406
|
+
getSelectedRows: ce,
|
|
402
407
|
updateRow: oe
|
|
403
408
|
};
|
|
404
409
|
}
|
|
405
410
|
});
|
|
406
|
-
function
|
|
407
|
-
const r = z("ZxtTableColumn"), p = z("el-table"),
|
|
408
|
-
return s(),
|
|
409
|
-
class:
|
|
410
|
-
style:
|
|
411
|
+
function pt(e, t, a, l, u, c) {
|
|
412
|
+
const r = z("ZxtTableColumn"), p = z("el-table"), m = z("ZxtPagination"), d = Ze("loading");
|
|
413
|
+
return s(), g("div", {
|
|
414
|
+
class: ie(["zxt-table-container", { "zxt-table-container--full": e.height === "full" }]),
|
|
415
|
+
style: je(e.containerStyle)
|
|
411
416
|
}, [
|
|
412
|
-
|
|
417
|
+
Ie((s(), $(p, M({
|
|
413
418
|
ref: "tableRef",
|
|
414
419
|
data: e.renderData,
|
|
415
420
|
height: e.tableHeight
|
|
@@ -419,8 +424,8 @@ function ct(e, t, a, l, i, c) {
|
|
|
419
424
|
onFilterChange: e.handleFilterChange
|
|
420
425
|
}), {
|
|
421
426
|
default: b(() => [
|
|
422
|
-
(s(!0),
|
|
423
|
-
key:
|
|
427
|
+
(s(!0), g(B, null, R(e.columns, (h, i) => (s(), $(r, {
|
|
428
|
+
key: i,
|
|
424
429
|
column: h,
|
|
425
430
|
"current-page": e.currentPage,
|
|
426
431
|
"page-size": e.pageSize
|
|
@@ -428,7 +433,7 @@ function ct(e, t, a, l, i, c) {
|
|
|
428
433
|
R(e.$slots, (_, o) => ({
|
|
429
434
|
name: o,
|
|
430
435
|
fn: b((S) => [
|
|
431
|
-
Z(e.$slots, o,
|
|
436
|
+
Z(e.$slots, o, M({ ref_for: !0 }, S), void 0, !0)
|
|
432
437
|
])
|
|
433
438
|
}))
|
|
434
439
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
@@ -437,7 +442,7 @@ function ct(e, t, a, l, i, c) {
|
|
|
437
442
|
}, 16, ["data", "height", "id", "onSortChange", "onFilterChange"])), [
|
|
438
443
|
[d, e.loading]
|
|
439
444
|
]),
|
|
440
|
-
e.pageable ? (s(), $(
|
|
445
|
+
e.pageable ? (s(), $(m, {
|
|
441
446
|
key: 0,
|
|
442
447
|
"model-value": e.currentPage,
|
|
443
448
|
"page-size": e.pageSize,
|
|
@@ -450,8 +455,8 @@ function ct(e, t, a, l, i, c) {
|
|
|
450
455
|
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : X("", !0)
|
|
451
456
|
], 6);
|
|
452
457
|
}
|
|
453
|
-
const
|
|
454
|
-
class
|
|
458
|
+
const O = /* @__PURE__ */ q(ct, [["render", pt], ["__scopeId", "data-v-ebf6786f"]]), U = /* @__PURE__ */ new Map();
|
|
459
|
+
class ft {
|
|
455
460
|
/**
|
|
456
461
|
* 注册自定义渲染器
|
|
457
462
|
* @param {String} name - 渲染器名称
|
|
@@ -504,14 +509,14 @@ class pt {
|
|
|
504
509
|
U.clear();
|
|
505
510
|
}
|
|
506
511
|
}
|
|
507
|
-
const
|
|
508
|
-
function
|
|
512
|
+
const be = new ft();
|
|
513
|
+
function gt(e, t, a = {}) {
|
|
509
514
|
if (!e || !e.itemRender)
|
|
510
515
|
return null;
|
|
511
516
|
const { name: l } = e.itemRender;
|
|
512
|
-
if (l &&
|
|
513
|
-
const
|
|
514
|
-
if (typeof
|
|
517
|
+
if (l && be.has(l)) {
|
|
518
|
+
const u = be.get(l);
|
|
519
|
+
if (typeof u.renderItemContent == "function") {
|
|
515
520
|
const c = {
|
|
516
521
|
data: t,
|
|
517
522
|
field: e.field || e.prop,
|
|
@@ -519,7 +524,7 @@ function ft(e, t, a = {}) {
|
|
|
519
524
|
formData: t
|
|
520
525
|
};
|
|
521
526
|
try {
|
|
522
|
-
return
|
|
527
|
+
return u.renderItemContent(a, c);
|
|
523
528
|
} catch (r) {
|
|
524
529
|
return console.error(`[ZxtTable] 渲染器 "${l}" 执行出错:`, r), null;
|
|
525
530
|
}
|
|
@@ -527,17 +532,17 @@ function ft(e, t, a = {}) {
|
|
|
527
532
|
}
|
|
528
533
|
return null;
|
|
529
534
|
}
|
|
530
|
-
|
|
531
|
-
e.component(
|
|
535
|
+
O.install = function(e) {
|
|
536
|
+
e.component(O.name, O);
|
|
532
537
|
};
|
|
533
|
-
|
|
534
|
-
|
|
538
|
+
O.registerRenderer = st;
|
|
539
|
+
O.renderer = be;
|
|
535
540
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
536
541
|
var mt = /* @__PURE__ */ y({
|
|
537
542
|
name: "ArrowDown",
|
|
538
543
|
__name: "arrow-down",
|
|
539
544
|
setup(e) {
|
|
540
|
-
return (t, a) => (s(),
|
|
545
|
+
return (t, a) => (s(), g("svg", {
|
|
541
546
|
xmlns: "http://www.w3.org/2000/svg",
|
|
542
547
|
viewBox: "0 0 1024 1024"
|
|
543
548
|
}, [
|
|
@@ -547,11 +552,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
547
552
|
})
|
|
548
553
|
]));
|
|
549
554
|
}
|
|
550
|
-
}),
|
|
555
|
+
}), xe = mt, ht = /* @__PURE__ */ y({
|
|
551
556
|
name: "Check",
|
|
552
557
|
__name: "check",
|
|
553
558
|
setup(e) {
|
|
554
|
-
return (t, a) => (s(),
|
|
559
|
+
return (t, a) => (s(), g("svg", {
|
|
555
560
|
xmlns: "http://www.w3.org/2000/svg",
|
|
556
561
|
viewBox: "0 0 1024 1024"
|
|
557
562
|
}, [
|
|
@@ -561,11 +566,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
561
566
|
})
|
|
562
567
|
]));
|
|
563
568
|
}
|
|
564
|
-
}),
|
|
569
|
+
}), vt = ht, _t = /* @__PURE__ */ y({
|
|
565
570
|
name: "Close",
|
|
566
571
|
__name: "close",
|
|
567
572
|
setup(e) {
|
|
568
|
-
return (t, a) => (s(),
|
|
573
|
+
return (t, a) => (s(), g("svg", {
|
|
569
574
|
xmlns: "http://www.w3.org/2000/svg",
|
|
570
575
|
viewBox: "0 0 1024 1024"
|
|
571
576
|
}, [
|
|
@@ -575,11 +580,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
575
580
|
})
|
|
576
581
|
]));
|
|
577
582
|
}
|
|
578
|
-
}),
|
|
583
|
+
}), Ct = _t, wt = /* @__PURE__ */ y({
|
|
579
584
|
name: "CopyDocument",
|
|
580
585
|
__name: "copy-document",
|
|
581
586
|
setup(e) {
|
|
582
|
-
return (t, a) => (s(),
|
|
587
|
+
return (t, a) => (s(), g("svg", {
|
|
583
588
|
xmlns: "http://www.w3.org/2000/svg",
|
|
584
589
|
viewBox: "0 0 1024 1024"
|
|
585
590
|
}, [
|
|
@@ -593,11 +598,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
593
598
|
})
|
|
594
599
|
]));
|
|
595
600
|
}
|
|
596
|
-
}),
|
|
601
|
+
}), yt = wt, bt = /* @__PURE__ */ y({
|
|
597
602
|
name: "Delete",
|
|
598
603
|
__name: "delete",
|
|
599
604
|
setup(e) {
|
|
600
|
-
return (t, a) => (s(),
|
|
605
|
+
return (t, a) => (s(), g("svg", {
|
|
601
606
|
xmlns: "http://www.w3.org/2000/svg",
|
|
602
607
|
viewBox: "0 0 1024 1024"
|
|
603
608
|
}, [
|
|
@@ -607,11 +612,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
607
612
|
})
|
|
608
613
|
]));
|
|
609
614
|
}
|
|
610
|
-
}),
|
|
615
|
+
}), ze = bt, zt = /* @__PURE__ */ y({
|
|
611
616
|
name: "Document",
|
|
612
617
|
__name: "document",
|
|
613
618
|
setup(e) {
|
|
614
|
-
return (t, a) => (s(),
|
|
619
|
+
return (t, a) => (s(), g("svg", {
|
|
615
620
|
xmlns: "http://www.w3.org/2000/svg",
|
|
616
621
|
viewBox: "0 0 1024 1024"
|
|
617
622
|
}, [
|
|
@@ -621,11 +626,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
621
626
|
})
|
|
622
627
|
]));
|
|
623
628
|
}
|
|
624
|
-
}),
|
|
629
|
+
}), St = zt, kt = /* @__PURE__ */ y({
|
|
625
630
|
name: "Download",
|
|
626
631
|
__name: "download",
|
|
627
632
|
setup(e) {
|
|
628
|
-
return (t, a) => (s(),
|
|
633
|
+
return (t, a) => (s(), g("svg", {
|
|
629
634
|
xmlns: "http://www.w3.org/2000/svg",
|
|
630
635
|
viewBox: "0 0 1024 1024"
|
|
631
636
|
}, [
|
|
@@ -635,11 +640,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
635
640
|
})
|
|
636
641
|
]));
|
|
637
642
|
}
|
|
638
|
-
}),
|
|
643
|
+
}), Se = kt, $t = /* @__PURE__ */ y({
|
|
639
644
|
name: "Edit",
|
|
640
645
|
__name: "edit",
|
|
641
646
|
setup(e) {
|
|
642
|
-
return (t, a) => (s(),
|
|
647
|
+
return (t, a) => (s(), g("svg", {
|
|
643
648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
644
649
|
viewBox: "0 0 1024 1024"
|
|
645
650
|
}, [
|
|
@@ -653,11 +658,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
653
658
|
})
|
|
654
659
|
]));
|
|
655
660
|
}
|
|
656
|
-
}),
|
|
661
|
+
}), ke = $t, Vt = /* @__PURE__ */ y({
|
|
657
662
|
name: "Lock",
|
|
658
663
|
__name: "lock",
|
|
659
664
|
setup(e) {
|
|
660
|
-
return (t, a) => (s(),
|
|
665
|
+
return (t, a) => (s(), g("svg", {
|
|
661
666
|
xmlns: "http://www.w3.org/2000/svg",
|
|
662
667
|
viewBox: "0 0 1024 1024"
|
|
663
668
|
}, [
|
|
@@ -671,11 +676,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
671
676
|
})
|
|
672
677
|
]));
|
|
673
678
|
}
|
|
674
|
-
}),
|
|
679
|
+
}), Pt = Vt, Dt = /* @__PURE__ */ y({
|
|
675
680
|
name: "Plus",
|
|
676
681
|
__name: "plus",
|
|
677
682
|
setup(e) {
|
|
678
|
-
return (t, a) => (s(),
|
|
683
|
+
return (t, a) => (s(), g("svg", {
|
|
679
684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
680
685
|
viewBox: "0 0 1024 1024"
|
|
681
686
|
}, [
|
|
@@ -685,11 +690,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
685
690
|
})
|
|
686
691
|
]));
|
|
687
692
|
}
|
|
688
|
-
}),
|
|
693
|
+
}), $e = Dt, Ft = /* @__PURE__ */ y({
|
|
689
694
|
name: "Refresh",
|
|
690
695
|
__name: "refresh",
|
|
691
696
|
setup(e) {
|
|
692
|
-
return (t, a) => (s(),
|
|
697
|
+
return (t, a) => (s(), g("svg", {
|
|
693
698
|
xmlns: "http://www.w3.org/2000/svg",
|
|
694
699
|
viewBox: "0 0 1024 1024"
|
|
695
700
|
}, [
|
|
@@ -699,11 +704,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
699
704
|
})
|
|
700
705
|
]));
|
|
701
706
|
}
|
|
702
|
-
}),
|
|
707
|
+
}), le = Ft, Rt = /* @__PURE__ */ y({
|
|
703
708
|
name: "Search",
|
|
704
709
|
__name: "search",
|
|
705
710
|
setup(e) {
|
|
706
|
-
return (t, a) => (s(),
|
|
711
|
+
return (t, a) => (s(), g("svg", {
|
|
707
712
|
xmlns: "http://www.w3.org/2000/svg",
|
|
708
713
|
viewBox: "0 0 1024 1024"
|
|
709
714
|
}, [
|
|
@@ -713,11 +718,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
713
718
|
})
|
|
714
719
|
]));
|
|
715
720
|
}
|
|
716
|
-
}),
|
|
721
|
+
}), se = Rt, At = /* @__PURE__ */ y({
|
|
717
722
|
name: "Setting",
|
|
718
723
|
__name: "setting",
|
|
719
724
|
setup(e) {
|
|
720
|
-
return (t, a) => (s(),
|
|
725
|
+
return (t, a) => (s(), g("svg", {
|
|
721
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
722
727
|
viewBox: "0 0 1024 1024"
|
|
723
728
|
}, [
|
|
@@ -727,11 +732,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
727
732
|
})
|
|
728
733
|
]));
|
|
729
734
|
}
|
|
730
|
-
}),
|
|
735
|
+
}), Ve = At, Ot = /* @__PURE__ */ y({
|
|
731
736
|
name: "Share",
|
|
732
737
|
__name: "share",
|
|
733
738
|
setup(e) {
|
|
734
|
-
return (t, a) => (s(),
|
|
739
|
+
return (t, a) => (s(), g("svg", {
|
|
735
740
|
xmlns: "http://www.w3.org/2000/svg",
|
|
736
741
|
viewBox: "0 0 1024 1024"
|
|
737
742
|
}, [
|
|
@@ -741,11 +746,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
741
746
|
})
|
|
742
747
|
]));
|
|
743
748
|
}
|
|
744
|
-
}),
|
|
749
|
+
}), xt = Ot, Mt = /* @__PURE__ */ y({
|
|
745
750
|
name: "Unlock",
|
|
746
751
|
__name: "unlock",
|
|
747
752
|
setup(e) {
|
|
748
|
-
return (t, a) => (s(),
|
|
753
|
+
return (t, a) => (s(), g("svg", {
|
|
749
754
|
xmlns: "http://www.w3.org/2000/svg",
|
|
750
755
|
viewBox: "0 0 1024 1024"
|
|
751
756
|
}, [
|
|
@@ -759,11 +764,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
759
764
|
})
|
|
760
765
|
]));
|
|
761
766
|
}
|
|
762
|
-
}),
|
|
767
|
+
}), Bt = Mt, Lt = /* @__PURE__ */ y({
|
|
763
768
|
name: "Upload",
|
|
764
769
|
__name: "upload",
|
|
765
770
|
setup(e) {
|
|
766
|
-
return (t, a) => (s(),
|
|
771
|
+
return (t, a) => (s(), g("svg", {
|
|
767
772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
768
773
|
viewBox: "0 0 1024 1024"
|
|
769
774
|
}, [
|
|
@@ -773,11 +778,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
773
778
|
})
|
|
774
779
|
]));
|
|
775
780
|
}
|
|
776
|
-
}),
|
|
781
|
+
}), Pe = Lt, Tt = /* @__PURE__ */ y({
|
|
777
782
|
name: "View",
|
|
778
783
|
__name: "view",
|
|
779
784
|
setup(e) {
|
|
780
|
-
return (t, a) => (s(),
|
|
785
|
+
return (t, a) => (s(), g("svg", {
|
|
781
786
|
xmlns: "http://www.w3.org/2000/svg",
|
|
782
787
|
viewBox: "0 0 1024 1024"
|
|
783
788
|
}, [
|
|
@@ -787,11 +792,11 @@ var mt = /* @__PURE__ */ y({
|
|
|
787
792
|
})
|
|
788
793
|
]));
|
|
789
794
|
}
|
|
790
|
-
}),
|
|
795
|
+
}), De = Tt, Ht = /* @__PURE__ */ y({
|
|
791
796
|
name: "Warning",
|
|
792
797
|
__name: "warning",
|
|
793
798
|
setup(e) {
|
|
794
|
-
return (t, a) => (s(),
|
|
799
|
+
return (t, a) => (s(), g("svg", {
|
|
795
800
|
xmlns: "http://www.w3.org/2000/svg",
|
|
796
801
|
viewBox: "0 0 1024 1024"
|
|
797
802
|
}, [
|
|
@@ -801,8 +806,8 @@ var mt = /* @__PURE__ */ y({
|
|
|
801
806
|
})
|
|
802
807
|
]));
|
|
803
808
|
}
|
|
804
|
-
}),
|
|
805
|
-
const
|
|
809
|
+
}), Zt = Ht;
|
|
810
|
+
const jt = y({
|
|
806
811
|
name: "ZxtForm",
|
|
807
812
|
inheritAttrs: !1,
|
|
808
813
|
props: {
|
|
@@ -813,7 +818,7 @@ const Zt = y({
|
|
|
813
818
|
},
|
|
814
819
|
emits: ["submit", "reset"],
|
|
815
820
|
setup(e, { emit: t, expose: a }) {
|
|
816
|
-
const l = k(null),
|
|
821
|
+
const l = k(null), u = Ee({}), c = {
|
|
817
822
|
input: "el-input",
|
|
818
823
|
select: "el-select",
|
|
819
824
|
date: "el-date-picker",
|
|
@@ -822,7 +827,7 @@ const Zt = y({
|
|
|
822
827
|
datetimerange: "el-date-picker",
|
|
823
828
|
cascader: "el-cascader"
|
|
824
829
|
}, r = (o) => c[o] || "el-input", p = (o) => {
|
|
825
|
-
const S = o.type || "input",
|
|
830
|
+
const S = o.type || "input", L = [
|
|
826
831
|
"select",
|
|
827
832
|
"date",
|
|
828
833
|
"daterange",
|
|
@@ -830,18 +835,18 @@ const Zt = y({
|
|
|
830
835
|
"datetimerange",
|
|
831
836
|
"cascader"
|
|
832
837
|
].includes(S), W = {
|
|
833
|
-
placeholder: o.placeholder || `请${
|
|
838
|
+
placeholder: o.placeholder || `请${L ? "选择" : "输入"}${o.label}`,
|
|
834
839
|
disabled: o.disabled,
|
|
835
840
|
style: "width: 100%",
|
|
836
841
|
"popper-class": "zxt-form-popper"
|
|
837
842
|
};
|
|
838
|
-
let
|
|
843
|
+
let x = {};
|
|
839
844
|
switch (S) {
|
|
840
845
|
case "date":
|
|
841
846
|
case "daterange":
|
|
842
847
|
case "datetime":
|
|
843
848
|
case "datetimerange":
|
|
844
|
-
|
|
849
|
+
x = {
|
|
845
850
|
type: o.dateType || S,
|
|
846
851
|
startPlaceholder: o.startPlaceholder || "开始日期",
|
|
847
852
|
endPlaceholder: o.endPlaceholder || "结束日期",
|
|
@@ -850,21 +855,21 @@ const Zt = y({
|
|
|
850
855
|
};
|
|
851
856
|
break;
|
|
852
857
|
case "cascader":
|
|
853
|
-
|
|
858
|
+
x = {
|
|
854
859
|
options: o.options,
|
|
855
860
|
props: o.cascaderProps,
|
|
856
861
|
clearable: o.clearable !== !1
|
|
857
862
|
};
|
|
858
863
|
break;
|
|
859
864
|
default:
|
|
860
|
-
|
|
865
|
+
x = {};
|
|
861
866
|
}
|
|
862
867
|
const I = {
|
|
863
868
|
...W,
|
|
864
|
-
...
|
|
869
|
+
...x
|
|
865
870
|
};
|
|
866
871
|
return "clearable" in o && (I.clearable = o.clearable), o.props && typeof o.props == "object" && Object.assign(I, o.props), I;
|
|
867
|
-
},
|
|
872
|
+
}, m = C(() => e.formColumns.map((o) => ({
|
|
868
873
|
...o,
|
|
869
874
|
colSpan: {
|
|
870
875
|
xs: o.xs ?? o.span ?? 24,
|
|
@@ -877,9 +882,9 @@ const Zt = y({
|
|
|
877
882
|
K(
|
|
878
883
|
() => e.initialFormData,
|
|
879
884
|
(o) => {
|
|
880
|
-
Object.keys(
|
|
881
|
-
delete
|
|
882
|
-
}), Object.assign(
|
|
885
|
+
Object.keys(u).forEach((S) => {
|
|
886
|
+
delete u[S];
|
|
887
|
+
}), Object.assign(u, o);
|
|
883
888
|
},
|
|
884
889
|
{ immediate: !0, deep: !0 }
|
|
885
890
|
);
|
|
@@ -887,7 +892,7 @@ const Zt = y({
|
|
|
887
892
|
const o = { ...e.rules };
|
|
888
893
|
return Object.keys(o).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((S) => {
|
|
889
894
|
if (S.required) {
|
|
890
|
-
const
|
|
895
|
+
const L = [
|
|
891
896
|
"select",
|
|
892
897
|
"date",
|
|
893
898
|
"daterange",
|
|
@@ -898,78 +903,78 @@ const Zt = y({
|
|
|
898
903
|
o[S.prop] = [
|
|
899
904
|
{
|
|
900
905
|
required: !0,
|
|
901
|
-
message: `请${
|
|
902
|
-
trigger:
|
|
906
|
+
message: `请${L ? "选择" : "输入"}${S.label}`,
|
|
907
|
+
trigger: L ? "change" : "blur"
|
|
903
908
|
}
|
|
904
909
|
];
|
|
905
910
|
}
|
|
906
911
|
}), o;
|
|
907
912
|
}), h = () => {
|
|
908
913
|
l.value && l.value.validate((o) => {
|
|
909
|
-
o && t("submit", { ...
|
|
914
|
+
o && t("submit", { ...u });
|
|
910
915
|
});
|
|
911
|
-
},
|
|
916
|
+
}, i = () => {
|
|
912
917
|
l.value && l.value.resetFields(), t("reset");
|
|
913
|
-
}, _ = (o) => () =>
|
|
918
|
+
}, _ = (o) => () => gt(o, u, {}) || null;
|
|
914
919
|
return a({
|
|
915
920
|
validate: () => l.value ? l.value.validate() : Promise.resolve(!1),
|
|
916
921
|
resetFields: () => l.value && l.value.resetFields(),
|
|
917
|
-
getFormData: () => ({ ...
|
|
922
|
+
getFormData: () => ({ ...u }),
|
|
918
923
|
submitForm: h,
|
|
919
|
-
resetForm:
|
|
924
|
+
resetForm: i
|
|
920
925
|
}), {
|
|
921
926
|
formRef: l,
|
|
922
|
-
formData:
|
|
927
|
+
formData: u,
|
|
923
928
|
formRules: d,
|
|
924
929
|
submitForm: h,
|
|
925
|
-
resetForm:
|
|
926
|
-
processedColumns:
|
|
930
|
+
resetForm: i,
|
|
931
|
+
processedColumns: m,
|
|
927
932
|
getComponentType: r,
|
|
928
933
|
getComponentProps: p,
|
|
929
934
|
renderCustomItem: _
|
|
930
935
|
};
|
|
931
936
|
}
|
|
932
|
-
}),
|
|
937
|
+
}), It = { class: "zxt-form-container" }, Et = {
|
|
933
938
|
key: 0,
|
|
934
939
|
class: "form-label"
|
|
935
|
-
},
|
|
936
|
-
function
|
|
937
|
-
const r = z("el-option"), p = z("el-form-item"),
|
|
938
|
-
return s(),
|
|
939
|
-
|
|
940
|
+
}, Nt = { class: "form-control" };
|
|
941
|
+
function Ut(e, t, a, l, u, c) {
|
|
942
|
+
const r = z("el-option"), p = z("el-form-item"), m = z("el-col"), d = z("el-row"), h = z("el-form");
|
|
943
|
+
return s(), g("div", It, [
|
|
944
|
+
D(h, M({ ref: "formRef" }, e.$attrs, {
|
|
940
945
|
model: e.formData,
|
|
941
946
|
rules: e.formRules,
|
|
942
947
|
"label-width": e.labelWidth,
|
|
943
948
|
class: "zxt-form"
|
|
944
949
|
}), {
|
|
945
950
|
default: b(() => [
|
|
946
|
-
|
|
951
|
+
D(d, { gutter: 20 }, {
|
|
947
952
|
default: b(() => [
|
|
948
|
-
(s(!0),
|
|
953
|
+
(s(!0), g(B, null, R(e.processedColumns, (i, _) => (s(), $(m, M({ key: _ }, { ref_for: !0 }, i.colSpan), {
|
|
949
954
|
default: b(() => [
|
|
950
|
-
|
|
951
|
-
prop:
|
|
952
|
-
required:
|
|
955
|
+
D(p, {
|
|
956
|
+
prop: i.prop,
|
|
957
|
+
required: i.required,
|
|
953
958
|
"label-width": "0",
|
|
954
959
|
class: "custom-form-item"
|
|
955
960
|
}, {
|
|
956
961
|
default: b(() => [
|
|
957
962
|
w("div", {
|
|
958
|
-
class:
|
|
963
|
+
class: ie(["form-item-wrapper", { "is-action": i.isAction }])
|
|
959
964
|
}, [
|
|
960
|
-
|
|
961
|
-
w("div",
|
|
962
|
-
|
|
965
|
+
i.label ? (s(), g("span", Et, Q(i.label), 1)) : X("", !0),
|
|
966
|
+
w("div", Nt, [
|
|
967
|
+
i.type === "slot" ? Z(e.$slots, i.slotName || i.prop, {
|
|
963
968
|
key: 0,
|
|
964
969
|
formData: e.formData,
|
|
965
|
-
column:
|
|
966
|
-
}, void 0, !0) :
|
|
970
|
+
column: i
|
|
971
|
+
}, void 0, !0) : i.itemRender ? (s(), $(ye(e.renderCustomItem(i)), { key: 1 })) : (s(), $(ye(e.getComponentType(i.type)), M({
|
|
967
972
|
key: 2,
|
|
968
|
-
modelValue: e.formData[
|
|
969
|
-
"onUpdate:modelValue": (o) => e.formData[
|
|
970
|
-
}, { ref_for: !0 }, e.getComponentProps(
|
|
973
|
+
modelValue: e.formData[i.prop],
|
|
974
|
+
"onUpdate:modelValue": (o) => e.formData[i.prop] = o
|
|
975
|
+
}, { ref_for: !0 }, e.getComponentProps(i), Ne(i.events || {})), {
|
|
971
976
|
default: b(() => [
|
|
972
|
-
|
|
977
|
+
i.type === "select" ? (s(!0), g(B, { key: 0 }, R(i.options, (o, S) => (s(), $(r, {
|
|
973
978
|
key: S,
|
|
974
979
|
label: o.label,
|
|
975
980
|
value: o.value
|
|
@@ -993,28 +998,28 @@ function Nt(e, t, a, l, i, c) {
|
|
|
993
998
|
}, 16, ["model", "rules", "label-width"])
|
|
994
999
|
]);
|
|
995
1000
|
}
|
|
996
|
-
const Fe = /* @__PURE__ */ q(
|
|
997
|
-
Plus:
|
|
998
|
-
Delete:
|
|
999
|
-
Refresh:
|
|
1000
|
-
Download:
|
|
1001
|
-
Search:
|
|
1002
|
-
Edit:
|
|
1003
|
-
View:
|
|
1004
|
-
Upload:
|
|
1005
|
-
Setting:
|
|
1006
|
-
Warning:
|
|
1007
|
-
Check:
|
|
1008
|
-
Close:
|
|
1009
|
-
Document:
|
|
1010
|
-
CopyDocument:
|
|
1011
|
-
Share:
|
|
1012
|
-
Lock:
|
|
1013
|
-
Unlock:
|
|
1014
|
-
ArrowDown:
|
|
1015
|
-
},
|
|
1001
|
+
const Fe = /* @__PURE__ */ q(jt, [["render", Ut], ["__scopeId", "data-v-6b22a57b"]]), qt = {
|
|
1002
|
+
Plus: $e,
|
|
1003
|
+
Delete: ze,
|
|
1004
|
+
Refresh: le,
|
|
1005
|
+
Download: Se,
|
|
1006
|
+
Search: se,
|
|
1007
|
+
Edit: ke,
|
|
1008
|
+
View: De,
|
|
1009
|
+
Upload: Pe,
|
|
1010
|
+
Setting: Ve,
|
|
1011
|
+
Warning: Zt,
|
|
1012
|
+
Check: vt,
|
|
1013
|
+
Close: Ct,
|
|
1014
|
+
Document: St,
|
|
1015
|
+
CopyDocument: yt,
|
|
1016
|
+
Share: xt,
|
|
1017
|
+
Lock: Pt,
|
|
1018
|
+
Unlock: Bt,
|
|
1019
|
+
ArrowDown: xe
|
|
1020
|
+
}, Wt = y({
|
|
1016
1021
|
name: "ActionColumn",
|
|
1017
|
-
components: { ArrowDown:
|
|
1022
|
+
components: { ArrowDown: xe },
|
|
1018
1023
|
props: {
|
|
1019
1024
|
buttons: {
|
|
1020
1025
|
type: Array,
|
|
@@ -1033,17 +1038,17 @@ const Fe = /* @__PURE__ */ q(Zt, [["render", Nt], ["__scopeId", "data-v-6b22a57b
|
|
|
1033
1038
|
setup(e, { emit: t }) {
|
|
1034
1039
|
const a = C(() => e.buttons.filter((d) => typeof d.visible == "function" ? d.visible(e.row) : typeof d.visible == "boolean" ? d.visible : !0)), l = C(
|
|
1035
1040
|
() => a.value.length > e.maxVisible
|
|
1036
|
-
),
|
|
1041
|
+
), u = C(
|
|
1037
1042
|
() => l.value ? a.value.slice(0, e.maxVisible) : a.value
|
|
1038
1043
|
), c = C(
|
|
1039
1044
|
() => l.value ? a.value.slice(e.maxVisible) : []
|
|
1040
1045
|
);
|
|
1041
1046
|
return {
|
|
1042
|
-
visibleButtons:
|
|
1047
|
+
visibleButtons: u,
|
|
1043
1048
|
overflowButtons: c,
|
|
1044
1049
|
getIconComponent: (d) => {
|
|
1045
1050
|
if (d)
|
|
1046
|
-
return typeof d == "object" || typeof d == "function" ? d :
|
|
1051
|
+
return typeof d == "object" || typeof d == "function" ? d : qt[d];
|
|
1047
1052
|
},
|
|
1048
1053
|
handleClick: (d) => {
|
|
1049
1054
|
t("action-click", { code: d.code, button: d, row: e.row });
|
|
@@ -1053,11 +1058,11 @@ const Fe = /* @__PURE__ */ q(Zt, [["render", Nt], ["__scopeId", "data-v-6b22a57b
|
|
|
1053
1058
|
}
|
|
1054
1059
|
};
|
|
1055
1060
|
}
|
|
1056
|
-
}),
|
|
1057
|
-
function
|
|
1058
|
-
const r = z("el-button"), p = z("ArrowDown"),
|
|
1059
|
-
return s(),
|
|
1060
|
-
(s(!0),
|
|
1061
|
+
}), Gt = { class: "action-column" };
|
|
1062
|
+
function Jt(e, t, a, l, u, c) {
|
|
1063
|
+
const r = z("el-button"), p = z("ArrowDown"), m = z("el-icon"), d = z("el-dropdown-item"), h = z("el-dropdown-menu"), i = z("el-dropdown");
|
|
1064
|
+
return s(), g("div", Gt, [
|
|
1065
|
+
(s(!0), g(B, null, R(e.visibleButtons, (_) => (s(), $(r, {
|
|
1061
1066
|
key: _.code,
|
|
1062
1067
|
type: _.type || "",
|
|
1063
1068
|
icon: e.getIconComponent(_.icon),
|
|
@@ -1070,15 +1075,15 @@ function Gt(e, t, a, l, i, c) {
|
|
|
1070
1075
|
]),
|
|
1071
1076
|
_: 2
|
|
1072
1077
|
}, 1032, ["type", "icon", "onClick"]))), 128)),
|
|
1073
|
-
e.overflowButtons.length ? (s(), $(
|
|
1078
|
+
e.overflowButtons.length ? (s(), $(i, {
|
|
1074
1079
|
key: 0,
|
|
1075
1080
|
trigger: "hover",
|
|
1076
1081
|
onCommand: e.handleCommand
|
|
1077
1082
|
}, {
|
|
1078
1083
|
dropdown: b(() => [
|
|
1079
|
-
|
|
1084
|
+
D(h, null, {
|
|
1080
1085
|
default: b(() => [
|
|
1081
|
-
(s(!0),
|
|
1086
|
+
(s(!0), g(B, null, R(e.overflowButtons, (_) => (s(), $(d, {
|
|
1082
1087
|
key: _.code,
|
|
1083
1088
|
command: _,
|
|
1084
1089
|
icon: e.getIconComponent(_.icon)
|
|
@@ -1093,16 +1098,16 @@ function Gt(e, t, a, l, i, c) {
|
|
|
1093
1098
|
})
|
|
1094
1099
|
]),
|
|
1095
1100
|
default: b(() => [
|
|
1096
|
-
|
|
1101
|
+
D(r, {
|
|
1097
1102
|
type: "",
|
|
1098
1103
|
size: "small",
|
|
1099
1104
|
link: ""
|
|
1100
1105
|
}, {
|
|
1101
1106
|
default: b(() => [
|
|
1102
1107
|
t[0] || (t[0] = j(" 更多 ", -1)),
|
|
1103
|
-
|
|
1108
|
+
D(m, { class: "el-icon--right" }, {
|
|
1104
1109
|
default: b(() => [
|
|
1105
|
-
|
|
1110
|
+
D(p)
|
|
1106
1111
|
]),
|
|
1107
1112
|
_: 1
|
|
1108
1113
|
})
|
|
@@ -1114,22 +1119,22 @@ function Gt(e, t, a, l, i, c) {
|
|
|
1114
1119
|
}, 8, ["onCommand"])) : X("", !0)
|
|
1115
1120
|
]);
|
|
1116
1121
|
}
|
|
1117
|
-
const
|
|
1122
|
+
const Kt = /* @__PURE__ */ q(Wt, [["render", Jt], ["__scopeId", "data-v-6d75a891"]]), Qt = y({
|
|
1118
1123
|
name: "ZxtGrid",
|
|
1119
1124
|
inheritAttrs: !1,
|
|
1120
1125
|
components: {
|
|
1121
|
-
ZxtTable:
|
|
1126
|
+
ZxtTable: O,
|
|
1122
1127
|
ZxtForm: Fe,
|
|
1123
|
-
ActionColumn:
|
|
1124
|
-
Plus:
|
|
1125
|
-
Delete:
|
|
1126
|
-
Refresh:
|
|
1127
|
-
Download:
|
|
1128
|
-
Search:
|
|
1129
|
-
Edit:
|
|
1130
|
-
View:
|
|
1131
|
-
Upload:
|
|
1132
|
-
Setting:
|
|
1128
|
+
ActionColumn: Kt,
|
|
1129
|
+
Plus: $e,
|
|
1130
|
+
Delete: ze,
|
|
1131
|
+
Refresh: le,
|
|
1132
|
+
Download: Se,
|
|
1133
|
+
Search: se,
|
|
1134
|
+
Edit: ke,
|
|
1135
|
+
View: De,
|
|
1136
|
+
Upload: Pe,
|
|
1137
|
+
Setting: Ve
|
|
1133
1138
|
},
|
|
1134
1139
|
props: {
|
|
1135
1140
|
// 网格配置选项
|
|
@@ -1157,31 +1162,33 @@ const Jt = /* @__PURE__ */ q(qt, [["render", Gt], ["__scopeId", "data-v-6d75a891
|
|
|
1157
1162
|
},
|
|
1158
1163
|
emits: ["toolbar-click", "action-click", "submit", "reset", "page-change", "size-change"],
|
|
1159
1164
|
setup(e, { emit: t, expose: a }) {
|
|
1160
|
-
const l =
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1165
|
+
const l = Ue(), u = qe(), c = k(null), r = k(null), p = k(1), m = k(10), d = k(null), h = k(e.gridOptions.formMode !== !1), i = k({
|
|
1166
|
+
...e.gridOptions.formConfig?.data || {}
|
|
1167
|
+
}), _ = {
|
|
1168
|
+
Plus: $e,
|
|
1169
|
+
Delete: ze,
|
|
1170
|
+
Refresh: le,
|
|
1171
|
+
Download: Se,
|
|
1172
|
+
Search: se,
|
|
1173
|
+
Edit: ke,
|
|
1174
|
+
View: De,
|
|
1175
|
+
Upload: Pe,
|
|
1176
|
+
Setting: Ve
|
|
1170
1177
|
}, o = C(() => {
|
|
1171
|
-
const f = (e.gridOptions.columns || []).find((
|
|
1178
|
+
const f = (e.gridOptions.columns || []).find((A) => A.actionColumn);
|
|
1172
1179
|
return f ? f.actionColumn : null;
|
|
1173
1180
|
}), S = C(() => (e.gridOptions.columns || []).map((f) => f.actionColumn ? {
|
|
1174
1181
|
...f,
|
|
1175
1182
|
slot: "__action__",
|
|
1176
1183
|
actionColumn: void 0
|
|
1177
|
-
} : f)),
|
|
1184
|
+
} : f)), L = (n) => {
|
|
1178
1185
|
t("action-click", n);
|
|
1179
1186
|
}, W = C(() => {
|
|
1180
1187
|
const n = e.gridOptions.formConfig;
|
|
1181
1188
|
if (!n || !n.items) return [];
|
|
1182
1189
|
const f = [...n.items];
|
|
1183
1190
|
return f.some(
|
|
1184
|
-
(
|
|
1191
|
+
(we) => we.type === "slot" && we.slotName === "search-actions"
|
|
1185
1192
|
) || f.push({
|
|
1186
1193
|
type: "slot",
|
|
1187
1194
|
slotName: "search-actions",
|
|
@@ -1190,71 +1197,74 @@ const Jt = /* @__PURE__ */ q(qt, [["render", Gt], ["__scopeId", "data-v-6d75a891
|
|
|
1190
1197
|
isAction: !0,
|
|
1191
1198
|
...n.actionConfig
|
|
1192
1199
|
}), f;
|
|
1193
|
-
}),
|
|
1200
|
+
}), x = C(() => {
|
|
1194
1201
|
const n = /* @__PURE__ */ new Set(["search-actions"]);
|
|
1195
1202
|
return (W.value || []).forEach((f) => {
|
|
1196
1203
|
f.type === "slot" && n.add(f.slotName || f.prop);
|
|
1197
1204
|
}), n;
|
|
1198
1205
|
}), I = C(() => {
|
|
1199
1206
|
const n = {};
|
|
1200
|
-
for (const f in
|
|
1201
|
-
f === "search-actions" || f === "toolbar" || (
|
|
1207
|
+
for (const f in u)
|
|
1208
|
+
f === "search-actions" || f === "toolbar" || (x.value.has(f) || f.startsWith("form-")) && (n[f] = u[f]);
|
|
1202
1209
|
return n;
|
|
1203
|
-
}),
|
|
1210
|
+
}), ue = C(() => {
|
|
1204
1211
|
const n = {};
|
|
1205
|
-
for (const f in
|
|
1206
|
-
f !== "toolbar" && !
|
|
1212
|
+
for (const f in u)
|
|
1213
|
+
f !== "toolbar" && !x.value.has(f) && !f.startsWith("form-") && (n[f] = u[f]);
|
|
1207
1214
|
return n;
|
|
1208
|
-
}),
|
|
1215
|
+
}), T = () => {
|
|
1209
1216
|
r.value?.submitForm();
|
|
1210
1217
|
}, oe = (n) => {
|
|
1211
|
-
t("submit", n), e.gridOptions.proxyConfig && (
|
|
1212
|
-
}, ue = () => {
|
|
1213
|
-
r.value?.resetForm();
|
|
1218
|
+
t("submit", n), e.gridOptions.proxyConfig && (i.value = { ...n }, p.value = 1, c.value?.reload?.({ formData: i.value, page: 1 }));
|
|
1214
1219
|
}, de = () => {
|
|
1215
|
-
|
|
1216
|
-
}, ce = (
|
|
1220
|
+
r.value?.resetForm();
|
|
1221
|
+
}, ce = () => {
|
|
1222
|
+
t("reset"), e.gridOptions.proxyConfig && (i.value = {}, p.value = 1, c.value?.reload?.({ formData: {}, page: 1 }));
|
|
1223
|
+
}, pe = (n) => {
|
|
1217
1224
|
if (n)
|
|
1218
1225
|
return typeof n == "object" || typeof n == "function" ? n : _[n];
|
|
1219
1226
|
}, v = C(() => {
|
|
1220
1227
|
const n = e.gridOptions.proxyConfig;
|
|
1221
1228
|
return n ? {
|
|
1222
1229
|
...n,
|
|
1223
|
-
_formData:
|
|
1230
|
+
_formData: i.value
|
|
1224
1231
|
} : null;
|
|
1225
|
-
}),
|
|
1232
|
+
}), P = C(() => {
|
|
1226
1233
|
const {
|
|
1227
1234
|
formConfig: n,
|
|
1228
1235
|
toolbar: f,
|
|
1229
|
-
formMode:
|
|
1230
|
-
formColumns:
|
|
1231
|
-
rules:
|
|
1232
|
-
data:
|
|
1233
|
-
proxyConfig:
|
|
1234
|
-
...
|
|
1236
|
+
formMode: A,
|
|
1237
|
+
formColumns: we,
|
|
1238
|
+
rules: ra,
|
|
1239
|
+
data: la,
|
|
1240
|
+
proxyConfig: Be,
|
|
1241
|
+
...Le
|
|
1235
1242
|
} = e.gridOptions;
|
|
1236
1243
|
return {
|
|
1237
|
-
...
|
|
1238
|
-
proxyConfig: v.value ||
|
|
1244
|
+
...Le,
|
|
1245
|
+
proxyConfig: v.value || Be || null
|
|
1239
1246
|
};
|
|
1240
|
-
}), H = C(() => d.value !== null ? d.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), E = C(() => !!e.gridOptions.proxyConfig),
|
|
1247
|
+
}), H = C(() => d.value !== null ? d.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), E = C(() => !!e.gridOptions.proxyConfig), fe = C(() => E.value ? 0 : H.value.length), ge = (n, f) => {
|
|
1241
1248
|
t("toolbar-click", { code: n, button: f, grid: c.value });
|
|
1242
1249
|
}, me = (n) => {
|
|
1243
1250
|
p.value = n.page, t("page-change", n);
|
|
1244
|
-
},
|
|
1245
|
-
|
|
1246
|
-
},
|
|
1251
|
+
}, he = (n) => {
|
|
1252
|
+
m.value = n.size, t("size-change", n);
|
|
1253
|
+
}, ve = () => c.value, N = () => r.value, F = () => c.value?.getTableRef()?.getSelectionRows?.() || [], Y = (n) => {
|
|
1247
1254
|
d.value = n ?? null;
|
|
1248
|
-
},
|
|
1255
|
+
}, _e = (n) => {
|
|
1249
1256
|
h.value = n;
|
|
1250
|
-
},
|
|
1251
|
-
const
|
|
1257
|
+
}, Ce = (n, f = !0) => {
|
|
1258
|
+
const A = e.gridOptions.formConfig;
|
|
1259
|
+
A?.data && Object.assign(A.data, n), i.value = { ...A?.data || {}, ...n }, f && e.gridOptions.proxyConfig && (p.value = 1, c.value?.reload?.({ formData: i.value, page: 1 }));
|
|
1260
|
+
}, re = (n, ...f) => {
|
|
1261
|
+
const A = i.value;
|
|
1252
1262
|
switch (n) {
|
|
1253
1263
|
case "query":
|
|
1254
|
-
p.value = 1, c.value?.reload?.({ formData:
|
|
1264
|
+
p.value = 1, c.value?.reload?.({ formData: A, page: 1 });
|
|
1255
1265
|
break;
|
|
1256
1266
|
case "reload":
|
|
1257
|
-
c.value?.reload?.({ formData:
|
|
1267
|
+
c.value?.reload?.({ formData: A });
|
|
1258
1268
|
break;
|
|
1259
1269
|
default:
|
|
1260
1270
|
console.warn(`[ZxtGrid] commitProxy: unknown type "${n}"`);
|
|
@@ -1265,67 +1275,70 @@ const Jt = /* @__PURE__ */ q(qt, [["render", Gt], ["__scopeId", "data-v-6d75a891
|
|
|
1265
1275
|
(n) => {
|
|
1266
1276
|
n !== void 0 && (h.value = n);
|
|
1267
1277
|
}
|
|
1268
|
-
)
|
|
1269
|
-
|
|
1278
|
+
), Oe(() => {
|
|
1279
|
+
e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && c.value?.reload?.({ formData: i.value, page: 1 });
|
|
1280
|
+
});
|
|
1281
|
+
const V = () => c.value?.getTableRef?.();
|
|
1270
1282
|
return a({
|
|
1271
|
-
getGridRef:
|
|
1283
|
+
getGridRef: ve,
|
|
1272
1284
|
getFormRef: N,
|
|
1273
|
-
getElTableRef:
|
|
1274
|
-
getSelectedRows:
|
|
1285
|
+
getElTableRef: V,
|
|
1286
|
+
getSelectedRows: F,
|
|
1275
1287
|
reloadData: Y,
|
|
1276
|
-
setFormVisible:
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1288
|
+
setFormVisible: _e,
|
|
1289
|
+
setFormData: Ce,
|
|
1290
|
+
commitProxy: re,
|
|
1291
|
+
clearSelection: () => V()?.clearSelection(),
|
|
1292
|
+
toggleRowSelection: (...n) => V()?.toggleRowSelection(...n),
|
|
1293
|
+
toggleAllSelection: () => V()?.toggleAllSelection(),
|
|
1294
|
+
toggleRowExpansion: (...n) => V()?.toggleRowExpansion(...n),
|
|
1295
|
+
setCurrentRow: (...n) => V()?.setCurrentRow(...n),
|
|
1296
|
+
clearSort: () => V()?.clearSort(),
|
|
1297
|
+
clearFilter: (...n) => V()?.clearFilter(...n),
|
|
1298
|
+
doLayout: () => V()?.doLayout(),
|
|
1299
|
+
sort: (...n) => V()?.sort(...n)
|
|
1287
1300
|
}), {
|
|
1288
1301
|
attrs: l,
|
|
1289
1302
|
gridRef: c,
|
|
1290
1303
|
searchFormRef: r,
|
|
1291
1304
|
currentPage: p,
|
|
1292
|
-
pageSize:
|
|
1305
|
+
pageSize: m,
|
|
1293
1306
|
tableData: H,
|
|
1294
|
-
tableProps:
|
|
1307
|
+
tableProps: P,
|
|
1295
1308
|
mergedColumns: S,
|
|
1296
1309
|
actionColumnConfig: o,
|
|
1297
|
-
total:
|
|
1310
|
+
total: fe,
|
|
1298
1311
|
isFormVisible: h,
|
|
1299
1312
|
searchFormColumns: W,
|
|
1300
1313
|
formFilteredSlots: I,
|
|
1301
|
-
tableFilteredSlots:
|
|
1302
|
-
getIconComponent:
|
|
1303
|
-
handleToolbarClick:
|
|
1304
|
-
handleActionClick:
|
|
1314
|
+
tableFilteredSlots: ue,
|
|
1315
|
+
getIconComponent: pe,
|
|
1316
|
+
handleToolbarClick: ge,
|
|
1317
|
+
handleActionClick: L,
|
|
1305
1318
|
handlePageChange: me,
|
|
1306
|
-
handleSizeChange:
|
|
1307
|
-
handleSearch:
|
|
1319
|
+
handleSizeChange: he,
|
|
1320
|
+
handleSearch: T,
|
|
1308
1321
|
handleSearchSubmit: oe,
|
|
1309
|
-
handleReset:
|
|
1310
|
-
handleSearchReset:
|
|
1311
|
-
Search:
|
|
1312
|
-
Refresh:
|
|
1322
|
+
handleReset: de,
|
|
1323
|
+
handleSearchReset: ce,
|
|
1324
|
+
Search: se,
|
|
1325
|
+
Refresh: le
|
|
1313
1326
|
};
|
|
1314
1327
|
}
|
|
1315
|
-
}),
|
|
1328
|
+
}), Xt = {
|
|
1316
1329
|
key: 0,
|
|
1317
1330
|
class: "grid-search-form"
|
|
1318
|
-
},
|
|
1331
|
+
}, Yt = { class: "search-btn-group" }, ea = { class: "grid-table-wrapper" }, ta = {
|
|
1319
1332
|
key: 0,
|
|
1320
1333
|
class: "grid-toolbar"
|
|
1321
1334
|
};
|
|
1322
|
-
function
|
|
1323
|
-
const r = z("el-button"), p = z("ZxtForm"),
|
|
1324
|
-
return s(),
|
|
1325
|
-
class:
|
|
1335
|
+
function aa(e, t, a, l, u, c) {
|
|
1336
|
+
const r = z("el-button"), p = z("ZxtForm"), m = z("ActionColumn"), d = z("ZxtTable");
|
|
1337
|
+
return s(), g("div", {
|
|
1338
|
+
class: ie(["zxt-grid-container", { "zxt-grid-container--full": e.gridOptions.height === "full" }])
|
|
1326
1339
|
}, [
|
|
1327
|
-
e.gridOptions.formConfig && e.isFormVisible ? (s(),
|
|
1328
|
-
|
|
1340
|
+
e.gridOptions.formConfig && e.isFormVisible ? (s(), g("div", Xt, [
|
|
1341
|
+
D(p, {
|
|
1329
1342
|
ref: "searchFormRef",
|
|
1330
1343
|
"form-columns": e.searchFormColumns,
|
|
1331
1344
|
"initial-form-data": e.gridOptions.formConfig.data,
|
|
@@ -1334,8 +1347,8 @@ function ta(e, t, a, l, i, c) {
|
|
|
1334
1347
|
onReset: e.handleSearchReset
|
|
1335
1348
|
}, ne({
|
|
1336
1349
|
"search-actions": b(() => [
|
|
1337
|
-
w("div",
|
|
1338
|
-
|
|
1350
|
+
w("div", Yt, [
|
|
1351
|
+
D(r, {
|
|
1339
1352
|
class: "btn-search",
|
|
1340
1353
|
icon: e.Search,
|
|
1341
1354
|
onClick: e.handleSearch
|
|
@@ -1345,7 +1358,7 @@ function ta(e, t, a, l, i, c) {
|
|
|
1345
1358
|
])]),
|
|
1346
1359
|
_: 1
|
|
1347
1360
|
}, 8, ["icon", "onClick"]),
|
|
1348
|
-
|
|
1361
|
+
D(r, {
|
|
1349
1362
|
class: "btn-reset",
|
|
1350
1363
|
icon: e.Refresh,
|
|
1351
1364
|
onClick: e.handleReset
|
|
@@ -1359,18 +1372,18 @@ function ta(e, t, a, l, i, c) {
|
|
|
1359
1372
|
]),
|
|
1360
1373
|
_: 2
|
|
1361
1374
|
}, [
|
|
1362
|
-
R(e.formFilteredSlots, (h,
|
|
1363
|
-
name:
|
|
1375
|
+
R(e.formFilteredSlots, (h, i) => ({
|
|
1376
|
+
name: i,
|
|
1364
1377
|
fn: b((_) => [
|
|
1365
|
-
Z(e.$slots,
|
|
1378
|
+
Z(e.$slots, i, Re(Ae(_)), void 0, !0)
|
|
1366
1379
|
])
|
|
1367
1380
|
}))
|
|
1368
1381
|
]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
|
|
1369
1382
|
])) : X("", !0),
|
|
1370
|
-
w("div",
|
|
1371
|
-
e.gridOptions.toolbar ? (s(),
|
|
1372
|
-
(s(!0),
|
|
1373
|
-
key:
|
|
1383
|
+
w("div", ea, [
|
|
1384
|
+
e.gridOptions.toolbar ? (s(), g("div", ta, [
|
|
1385
|
+
(s(!0), g(B, null, R(e.gridOptions.toolbar.buttons, (h, i) => (s(), $(r, {
|
|
1386
|
+
key: i,
|
|
1374
1387
|
type: h.type || "default",
|
|
1375
1388
|
size: h.size || "small",
|
|
1376
1389
|
icon: e.getIconComponent(h.icon),
|
|
@@ -1386,11 +1399,12 @@ function ta(e, t, a, l, i, c) {
|
|
|
1386
1399
|
grid: e.$refs.gridRef
|
|
1387
1400
|
}, void 0, !0)
|
|
1388
1401
|
])) : X("", !0),
|
|
1389
|
-
|
|
1402
|
+
D(d, M({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
|
|
1390
1403
|
id: e.gridOptions.id,
|
|
1391
1404
|
columns: e.mergedColumns,
|
|
1392
1405
|
data: e.tableData,
|
|
1393
1406
|
height: e.gridOptions.height,
|
|
1407
|
+
"auto-load": !1,
|
|
1394
1408
|
pageable: e.gridOptions.pageable !== !1,
|
|
1395
1409
|
"current-page": e.currentPage,
|
|
1396
1410
|
"page-size": e.pageSize,
|
|
@@ -1403,7 +1417,7 @@ function ta(e, t, a, l, i, c) {
|
|
|
1403
1417
|
e.actionColumnConfig ? {
|
|
1404
1418
|
name: "__action__",
|
|
1405
1419
|
fn: b(({ row: h }) => [
|
|
1406
|
-
|
|
1420
|
+
D(m, {
|
|
1407
1421
|
buttons: e.actionColumnConfig.buttons,
|
|
1408
1422
|
row: h,
|
|
1409
1423
|
"max-visible": e.actionColumnConfig.maxVisible || 2,
|
|
@@ -1412,42 +1426,42 @@ function ta(e, t, a, l, i, c) {
|
|
|
1412
1426
|
]),
|
|
1413
1427
|
key: "0"
|
|
1414
1428
|
} : void 0,
|
|
1415
|
-
R(e.tableFilteredSlots, (h,
|
|
1416
|
-
name:
|
|
1429
|
+
R(e.tableFilteredSlots, (h, i) => ({
|
|
1430
|
+
name: i,
|
|
1417
1431
|
fn: b((_) => [
|
|
1418
|
-
Z(e.$slots,
|
|
1432
|
+
Z(e.$slots, i, Re(Ae(_)), void 0, !0)
|
|
1419
1433
|
])
|
|
1420
1434
|
}))
|
|
1421
1435
|
]), 1040, ["id", "columns", "data", "height", "pageable", "current-page", "page-size", "page-sizes", "total", "pagination-layout", "onPageChange", "onSizeChange"])
|
|
1422
1436
|
])
|
|
1423
1437
|
], 2);
|
|
1424
1438
|
}
|
|
1425
|
-
const Me = /* @__PURE__ */ q(
|
|
1439
|
+
const Me = /* @__PURE__ */ q(Qt, [["render", aa], ["__scopeId", "data-v-f8b2d913"]]);
|
|
1426
1440
|
J.install = function(e) {
|
|
1427
1441
|
e.component(J.name, J);
|
|
1428
1442
|
};
|
|
1429
|
-
const
|
|
1443
|
+
const na = [
|
|
1430
1444
|
ee,
|
|
1431
1445
|
te,
|
|
1432
|
-
|
|
1446
|
+
O,
|
|
1433
1447
|
Me,
|
|
1434
1448
|
Fe,
|
|
1435
1449
|
J
|
|
1436
|
-
],
|
|
1437
|
-
|
|
1450
|
+
], oa = (e) => {
|
|
1451
|
+
na.forEach((t) => {
|
|
1438
1452
|
e.component(t.name, t);
|
|
1439
1453
|
});
|
|
1440
|
-
},
|
|
1441
|
-
install:
|
|
1454
|
+
}, ua = {
|
|
1455
|
+
install: oa,
|
|
1442
1456
|
MyButton: ee,
|
|
1443
1457
|
JsxButton: te,
|
|
1444
|
-
ZxtTable:
|
|
1458
|
+
ZxtTable: O,
|
|
1445
1459
|
ZxtGrid: Me,
|
|
1446
1460
|
ZxtForm: Fe,
|
|
1447
1461
|
ZxtPagination: J,
|
|
1448
1462
|
// 暴露渲染器 API
|
|
1449
|
-
renderer:
|
|
1450
|
-
registerRenderer:
|
|
1463
|
+
renderer: O.renderer,
|
|
1464
|
+
registerRenderer: O.registerRenderer
|
|
1451
1465
|
};
|
|
1452
1466
|
export {
|
|
1453
1467
|
te as JsxButton,
|
|
@@ -1455,6 +1469,6 @@ export {
|
|
|
1455
1469
|
Fe as ZxtForm,
|
|
1456
1470
|
Me as ZxtGrid,
|
|
1457
1471
|
J as ZxtPagination,
|
|
1458
|
-
|
|
1459
|
-
|
|
1472
|
+
O as ZxtTable,
|
|
1473
|
+
ua as default
|
|
1460
1474
|
};
|