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