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