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