zxt-table 0.4.5 → 0.4.6

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