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