zxt-table 0.4.6 → 0.5.1

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