vue3-smart-table 2.1.0 → 2.1.2

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,7 +1,7 @@
1
1
  var pe = Object.defineProperty;
2
2
  var fe = (t, e, r) => e in t ? pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var j = (t, e, r) => fe(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { ref as A, watch as N, computed as E, defineComponent as O, h as b, resolveComponent as T, createBlock as B, openBlock as w, mergeProps as S, withKeys as G, withCtx as M, createElementBlock as $, Fragment as I, renderList as J, resolveDirective as de, withDirectives as me, createTextVNode as ne, toDisplayString as P, renderSlot as ge, createCommentVNode as ye, resolveDynamicComponent as he, unref as oe, normalizeClass as Ce, normalizeStyle as be } from "vue";
4
+ import { ref as O, watch as N, computed as E, defineComponent as z, h as b, resolveComponent as T, createBlock as B, openBlock as w, mergeProps as S, withKeys as G, withCtx as $, createElementBlock as A, Fragment as I, renderList as J, resolveDirective as de, withDirectives as me, createTextVNode as ne, toDisplayString as P, renderSlot as ge, createCommentVNode as ye, resolveDynamicComponent as he, unref as oe, normalizeClass as Ce, normalizeStyle as be } from "vue";
5
5
  import { ElImage as U, ElTag as ve, ElMessage as R, ElButton as we } from "element-plus";
6
6
  import { CopyDocument as ke, DocumentCopy as _e } from "@element-plus/icons-vue";
7
7
  function se(t) {
@@ -27,7 +27,7 @@ function re(t, e) {
27
27
  });
28
28
  }
29
29
  function Be(t, e) {
30
- const { cacheKey: r, storage: l = localStorage } = e || {}, a = r ? l.getItem(r) : null, p = A(
30
+ const { cacheKey: r, storage: l = localStorage } = e || {}, a = r ? l.getItem(r) : null, p = O(
31
31
  re(
32
32
  t,
33
33
  a ? JSON.parse(a) : []
@@ -35,9 +35,9 @@ function Be(t, e) {
35
35
  );
36
36
  return N(
37
37
  p,
38
- (c) => {
38
+ (u) => {
39
39
  if (!r) return;
40
- const y = c.map((d) => ({
40
+ const y = u.map((d) => ({
41
41
  key: d.key,
42
42
  visible: d.visible,
43
43
  columnOpts: d.columnOpts
@@ -55,13 +55,13 @@ function Be(t, e) {
55
55
  * 主动设置列配置
56
56
  * 常用于:列设置弹窗 / 拖拽排序完成
57
57
  */
58
- setColumns(c) {
58
+ setColumns(u) {
59
59
  p.value = re(
60
60
  t,
61
- c
61
+ u
62
62
  ), r && l.setItem(
63
63
  r,
64
- JSON.stringify(c)
64
+ JSON.stringify(u)
65
65
  );
66
66
  },
67
67
  /**
@@ -73,30 +73,30 @@ function Be(t, e) {
73
73
  };
74
74
  }
75
75
  function Ee(t, e = 10, r = []) {
76
- const a = "*:*:*", p = (n) => {
77
- if (!n) return !0;
78
- const f = Array.isArray(n) ? n : [n];
76
+ const a = "*:*:*", p = (o) => {
77
+ if (!o) return !0;
78
+ const f = Array.isArray(o) ? o : [o];
79
79
  return r.some(
80
80
  (h) => h === a || f.includes(h)
81
81
  );
82
- }, c = E(() => t.some((n) => p(n.permission))), y = E(() => t.filter((f) => p(f.permission)).slice(0, e).reduce(
82
+ }, u = E(() => t.some((o) => p(o.permission))), y = E(() => t.filter((f) => p(f.permission)).slice(0, e).reduce(
83
83
  (f, h) => f + (h.width ?? 55),
84
84
  0
85
- )), d = (n, f) => p(n.permission) && (n.visible ? n.visible(f) : !0), g = (n) => t.filter((h) => d(h, n)).slice(0, e).reduce(
86
- (h, z) => h + (z.width ?? 55),
85
+ )), d = (o, f) => p(o.permission) && (o.visible ? o.visible(f) : !0), g = (o) => t.filter((h) => d(h, o)).slice(0, e).reduce(
86
+ (h, M) => h + (M.width ?? 55),
87
87
  0
88
88
  );
89
89
  return {
90
- hasAnyButton: c,
90
+ hasAnyButton: u,
91
91
  optWidth: y,
92
- hasAnyVisibleButton: (n) => n != null && n.length ? n.some(
92
+ hasAnyVisibleButton: (o) => o != null && o.length ? o.some(
93
93
  (f) => t.some((h) => d(h, f))
94
94
  ) : !1,
95
- getMaxOptWidth: (n) => n != null && n.length ? n.reduce(
95
+ getMaxOptWidth: (o) => o != null && o.length ? o.reduce(
96
96
  (f, h) => Math.max(f, g(h)),
97
97
  0
98
98
  ) : y.value,
99
- getVisibleButtons: (n) => t.filter((f) => d(f, n)).slice(0, e)
99
+ getVisibleButtons: (o) => t.filter((f) => d(f, o)).slice(0, e)
100
100
  };
101
101
  }
102
102
  class Se {
@@ -132,7 +132,7 @@ function Y() {
132
132
  return q || (q = new Se()), q;
133
133
  }
134
134
  function Q(t) {
135
- return O({
135
+ return z({
136
136
  props: ["row", "col", "index", "onCellChange", "onCellBlur", "onCellEnter", "onClick"],
137
137
  setup(e) {
138
138
  return () => b(t, e);
@@ -140,7 +140,7 @@ function Q(t) {
140
140
  });
141
141
  }
142
142
  function V(t) {
143
- return O({
143
+ return z({
144
144
  props: ["row", "col", "index", "onCellChange", "onCellBlur", "onCellEnter", "onClick"],
145
145
  setup(e) {
146
146
  return () => t(e);
@@ -187,10 +187,10 @@ function k(t, e) {
187
187
  }
188
188
  function X(t, e, r) {
189
189
  if (!t || !e) return;
190
- const l = e.split("."), a = l.pop(), p = l.reduce((c, y) => (c[y] || (c[y] = {}), c[y]), t);
190
+ const l = e.split("."), a = l.pop(), p = l.reduce((u, y) => (u[y] || (u[y] = {}), u[y]), t);
191
191
  p[a] = r;
192
192
  }
193
- const Ve = /* @__PURE__ */ O({
193
+ const Ve = /* @__PURE__ */ z({
194
194
  __name: "input",
195
195
  props: {
196
196
  row: {},
@@ -201,8 +201,8 @@ const Ve = /* @__PURE__ */ O({
201
201
  onCellEnter: { type: Function }
202
202
  },
203
203
  setup(t) {
204
- const e = t, r = A(k(e.row, e.col.key)), l = E(() => {
205
- const i = e.col.props || {}, { onBlur: o, onFocus: s, onChange: n, onInput: f, onClear: h, onEnter: z, ...K } = i;
204
+ const e = t, r = O(k(e.row, e.col.key)), l = E(() => {
205
+ const i = e.col.props || {}, { onBlur: n, onFocus: s, onChange: o, onInput: f, onClear: h, onEnter: M, ...K } = i;
206
206
  return {
207
207
  placeholder: "",
208
208
  size: "small",
@@ -214,32 +214,32 @@ const Ve = /* @__PURE__ */ O({
214
214
  X(e.row, e.col.key, i);
215
215
  });
216
216
  const a = (i) => {
217
- var o, s, n;
218
- (o = e.onCellChange) == null || o.call(e, e.row, e.col), (n = (s = e.col.props) == null ? void 0 : s.onChange) == null || n.call(s, i, e.row, e.col);
217
+ var n, s, o;
218
+ (n = e.onCellChange) == null || n.call(e, e.row, e.col), (o = (s = e.col.props) == null ? void 0 : s.onChange) == null || o.call(s, i, e.row, e.col);
219
219
  }, p = (i) => {
220
- var o, s, n;
221
- (o = e.onCellBlur) == null || o.call(e, e.row, e.col), (n = (s = e.col.props) == null ? void 0 : s.onBlur) == null || n.call(s, i, e.row, e.col);
222
- }, c = (i) => {
223
- var o, s;
224
- (s = (o = e.col.props) == null ? void 0 : o.onFocus) == null || s.call(o, i, e.row, e.col);
220
+ var n, s, o;
221
+ (n = e.onCellBlur) == null || n.call(e, e.row, e.col), (o = (s = e.col.props) == null ? void 0 : s.onBlur) == null || o.call(s, i, e.row, e.col);
222
+ }, u = (i) => {
223
+ var n, s;
224
+ (s = (n = e.col.props) == null ? void 0 : n.onFocus) == null || s.call(n, i, e.row, e.col);
225
225
  }, y = (i) => {
226
- var o, s;
227
- (s = (o = e.col.props) == null ? void 0 : o.onInput) == null || s.call(o, i, e.row, e.col);
226
+ var n, s;
227
+ (s = (n = e.col.props) == null ? void 0 : n.onInput) == null || s.call(n, i, e.row, e.col);
228
228
  }, d = (i) => {
229
- var o, s, n;
230
- (o = e.onCellEnter) == null || o.call(e, e.row, e.col), (n = (s = e.col.props) == null ? void 0 : s.onEnter) == null || n.call(s, i, e.row, e.col);
229
+ var n, s, o;
230
+ (n = e.onCellEnter) == null || n.call(e, e.row, e.col), (o = (s = e.col.props) == null ? void 0 : s.onEnter) == null || o.call(s, i, e.row, e.col);
231
231
  }, g = () => {
232
- var i, o;
233
- (o = (i = e.col.props) == null ? void 0 : i.onClear) == null || o.call(i, e.row, e.col);
232
+ var i, n;
233
+ (n = (i = e.col.props) == null ? void 0 : i.onClear) == null || n.call(i, e.row, e.col);
234
234
  };
235
- return (i, o) => {
235
+ return (i, n) => {
236
236
  const s = T("el-input");
237
237
  return w(), B(s, S({
238
238
  modelValue: r.value,
239
- "onUpdate:modelValue": o[0] || (o[0] = (n) => r.value = n)
239
+ "onUpdate:modelValue": n[0] || (n[0] = (o) => r.value = o)
240
240
  }, l.value, {
241
241
  onBlur: p,
242
- onFocus: c,
242
+ onFocus: u,
243
243
  onChange: a,
244
244
  onInput: y,
245
245
  onKeyup: G(d, ["enter"]),
@@ -247,7 +247,7 @@ const Ve = /* @__PURE__ */ O({
247
247
  }), null, 16, ["modelValue"]);
248
248
  };
249
249
  }
250
- }), Fe = /* @__PURE__ */ O({
250
+ }), Fe = /* @__PURE__ */ z({
251
251
  __name: "inputNumber",
252
252
  props: {
253
253
  row: {},
@@ -258,46 +258,46 @@ const Ve = /* @__PURE__ */ O({
258
258
  onCellEnter: { type: Function }
259
259
  },
260
260
  setup(t) {
261
- const e = t, r = A(k(e.row, e.col.key)), l = E(() => {
262
- const d = e.col.props || {}, { onBlur: g, onFocus: i, onChange: o, onEnter: s, ...n } = d;
261
+ const e = t, r = O(k(e.row, e.col.key)), l = E(() => {
262
+ const d = e.col.props || {}, { onBlur: g, onFocus: i, onChange: n, onEnter: s, ...o } = d;
263
263
  return {
264
264
  min: 0,
265
265
  max: 99999,
266
266
  controls: !1,
267
267
  size: "small",
268
- ...n
268
+ ...o
269
269
  };
270
270
  });
271
271
  N(r, (d) => {
272
272
  X(e.row, e.col.key, d);
273
273
  });
274
274
  const a = (d, g) => {
275
- var i, o, s;
276
- (i = e.onCellChange) == null || i.call(e, e.row, e.col), (s = (o = e.col.props) == null ? void 0 : o.onChange) == null || s.call(o, d, g, e.row, e.col);
275
+ var i, n, s;
276
+ (i = e.onCellChange) == null || i.call(e, e.row, e.col), (s = (n = e.col.props) == null ? void 0 : n.onChange) == null || s.call(n, d, g, e.row, e.col);
277
277
  }, p = (d) => {
278
- var g, i, o;
279
- (g = e.onCellBlur) == null || g.call(e, e.row, e.col), (o = (i = e.col.props) == null ? void 0 : i.onBlur) == null || o.call(i, d, e.row, e.col);
280
- }, c = (d) => {
278
+ var g, i, n;
279
+ (g = e.onCellBlur) == null || g.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onBlur) == null || n.call(i, d, e.row, e.col);
280
+ }, u = (d) => {
281
281
  var g, i;
282
282
  (i = (g = e.col.props) == null ? void 0 : g.onFocus) == null || i.call(g, d, e.row, e.col);
283
283
  }, y = (d) => {
284
- var g, i, o;
285
- (g = e.onCellEnter) == null || g.call(e, e.row, e.col), (o = (i = e.col.props) == null ? void 0 : i.onEnter) == null || o.call(i, d, e.row, e.col);
284
+ var g, i, n;
285
+ (g = e.onCellEnter) == null || g.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onEnter) == null || n.call(i, d, e.row, e.col);
286
286
  };
287
287
  return (d, g) => {
288
288
  const i = T("el-input-number");
289
289
  return w(), B(i, S({
290
290
  modelValue: r.value,
291
- "onUpdate:modelValue": g[0] || (g[0] = (o) => r.value = o)
291
+ "onUpdate:modelValue": g[0] || (g[0] = (n) => r.value = n)
292
292
  }, l.value, {
293
293
  onBlur: p,
294
- onFocus: c,
294
+ onFocus: u,
295
295
  onChange: a,
296
296
  onKeyup: G(y, ["enter"])
297
297
  }), null, 16, ["modelValue"]);
298
298
  };
299
299
  }
300
- }), Te = /* @__PURE__ */ O({
300
+ }), Te = /* @__PURE__ */ z({
301
301
  __name: "select",
302
302
  props: {
303
303
  row: {},
@@ -308,8 +308,8 @@ const Ve = /* @__PURE__ */ O({
308
308
  onCellEnter: { type: Function }
309
309
  },
310
310
  setup(t) {
311
- const e = t, r = A(k(e.row, e.col.key)), l = E(() => {
312
- const o = e.col.props || {}, { options: s, onChange: n, onBlur: f, onFocus: h, onVisibleChange: z, onClear: K, onEnter: ee, ...D } = o;
311
+ const e = t, r = O(k(e.row, e.col.key)), l = E(() => {
312
+ const n = e.col.props || {}, { options: s, onChange: o, onBlur: f, onFocus: h, onVisibleChange: M, onClear: K, onEnter: ee, ...D } = n;
313
313
  return {
314
314
  placeholder: "请选择",
315
315
  size: "small",
@@ -317,43 +317,43 @@ const Ve = /* @__PURE__ */ O({
317
317
  ...D
318
318
  };
319
319
  }), a = E(() => (e.col.props || {}).options || []);
320
- N(r, (o) => {
321
- X(e.row, e.col.key, o);
320
+ N(r, (n) => {
321
+ X(e.row, e.col.key, n);
322
322
  });
323
- const p = (o) => {
324
- var s, n, f;
325
- (s = e.onCellChange) == null || s.call(e, e.row, e.col), (f = (n = e.col.props) == null ? void 0 : n.onChange) == null || f.call(n, o, e.row, e.col);
326
- }, c = (o) => {
327
- var s, n, f;
328
- (s = e.onCellBlur) == null || s.call(e, e.row, e.col), (f = (n = e.col.props) == null ? void 0 : n.onBlur) == null || f.call(n, o, e.row, e.col);
329
- }, y = (o) => {
330
- var s, n;
331
- (n = (s = e.col.props) == null ? void 0 : s.onFocus) == null || n.call(s, o, e.row, e.col);
332
- }, d = (o) => {
333
- var s, n;
334
- (n = (s = e.col.props) == null ? void 0 : s.onVisibleChange) == null || n.call(s, o, e.row, e.col);
323
+ const p = (n) => {
324
+ var s, o, f;
325
+ (s = e.onCellChange) == null || s.call(e, e.row, e.col), (f = (o = e.col.props) == null ? void 0 : o.onChange) == null || f.call(o, n, e.row, e.col);
326
+ }, u = (n) => {
327
+ var s, o, f;
328
+ (s = e.onCellBlur) == null || s.call(e, e.row, e.col), (f = (o = e.col.props) == null ? void 0 : o.onBlur) == null || f.call(o, n, e.row, e.col);
329
+ }, y = (n) => {
330
+ var s, o;
331
+ (o = (s = e.col.props) == null ? void 0 : s.onFocus) == null || o.call(s, n, e.row, e.col);
332
+ }, d = (n) => {
333
+ var s, o;
334
+ (o = (s = e.col.props) == null ? void 0 : s.onVisibleChange) == null || o.call(s, n, e.row, e.col);
335
335
  }, g = () => {
336
- var o, s;
337
- (s = (o = e.col.props) == null ? void 0 : o.onClear) == null || s.call(o, e.row, e.col);
338
- }, i = (o) => {
339
- var s, n, f;
340
- (s = e.onCellEnter) == null || s.call(e, e.row, e.col), (f = (n = e.col.props) == null ? void 0 : n.onEnter) == null || f.call(n, o, e.row, e.col);
336
+ var n, s;
337
+ (s = (n = e.col.props) == null ? void 0 : n.onClear) == null || s.call(n, e.row, e.col);
338
+ }, i = (n) => {
339
+ var s, o, f;
340
+ (s = e.onCellEnter) == null || s.call(e, e.row, e.col), (f = (o = e.col.props) == null ? void 0 : o.onEnter) == null || f.call(o, n, e.row, e.col);
341
341
  };
342
- return (o, s) => {
343
- const n = T("el-option"), f = T("el-select");
342
+ return (n, s) => {
343
+ const o = T("el-option"), f = T("el-select");
344
344
  return w(), B(f, S({
345
345
  modelValue: r.value,
346
346
  "onUpdate:modelValue": s[0] || (s[0] = (h) => r.value = h)
347
347
  }, l.value, {
348
348
  onChange: p,
349
- onBlur: c,
349
+ onBlur: u,
350
350
  onFocus: y,
351
351
  onVisibleChange: d,
352
352
  onClear: g,
353
353
  onKeyup: G(i, ["enter"])
354
354
  }), {
355
- default: M(() => [
356
- (w(!0), $(I, null, J(a.value, (h) => (w(), B(n, {
355
+ default: $(() => [
356
+ (w(!0), A(I, null, J(a.value, (h) => (w(), B(o, {
357
357
  key: h.value,
358
358
  label: h.label,
359
359
  value: h.value,
@@ -376,22 +376,22 @@ const Ve = /* @__PURE__ */ O({
376
376
  ...a,
377
377
  ...l,
378
378
  onClick: (p) => {
379
- var c, y;
380
- (c = t.onClick) == null || c.call(t, t.row, t.col), (y = e.onClick) == null || y.call(e, p, t.row, t.col);
379
+ var u, y;
380
+ (u = t.onClick) == null || u.call(t, t.row, t.col), (y = e.onClick) == null || y.call(e, p, t.row, t.col);
381
381
  }
382
382
  }, () => e.label || r);
383
383
  }), Re = V((t) => {
384
- const e = t.col.props || {}, r = k(t.row, t.col.key), { href: l, blank: a, label: p, ...c } = e;
384
+ const e = t.col.props || {}, r = k(t.row, t.col.key), { href: l, blank: a, label: p, ...u } = e;
385
385
  return b("a", {
386
386
  href: l || r || "#",
387
387
  target: a ? "_blank" : "_self",
388
388
  rel: a ? "noopener noreferrer" : void 0,
389
389
  style: "color:#409EFF;cursor:pointer;text-decoration:none;",
390
- ...c
390
+ ...u
391
391
  }, p || r);
392
392
  }), Ie = V((t) => {
393
- var c;
394
- const e = k(t.row, t.col.key), r = ((c = t.col) == null ? void 0 : c.props) || {}, { style: l, class: a, ...p } = r;
393
+ var u;
394
+ const e = k(t.row, t.col.key), r = ((u = t.col) == null ? void 0 : u.props) || {}, { style: l, class: a, ...p } = r;
395
395
  return b("div", {
396
396
  class: a || "line-clamp-2",
397
397
  style: l,
@@ -399,7 +399,7 @@ const Ve = /* @__PURE__ */ O({
399
399
  ...p
400
400
  });
401
401
  }), Ne = V((t) => {
402
- const e = k(t.row, t.col.key) ?? "", r = t.col.props ?? {}, { iconColor: l, copyTitle: a, successText: p, errorText: c, lineClamp: y, textStyles: d, textClass: g, ...i } = r, o = {
402
+ const e = k(t.row, t.col.key) ?? "", r = t.col.props ?? {}, { iconColor: l, copyTitle: a, successText: p, errorText: u, lineClamp: y, textStyles: d, textClass: g, ...i } = r, n = {
403
403
  position: "absolute",
404
404
  right: "-5px",
405
405
  top: "50%",
@@ -432,7 +432,7 @@ const Ve = /* @__PURE__ */ O({
432
432
  }, e),
433
433
  e && b("span", {
434
434
  class: "st_copy_btn",
435
- style: o,
435
+ style: n,
436
436
  title: a || "复制",
437
437
  onClick: () => {
438
438
  if (e)
@@ -441,16 +441,16 @@ const Ve = /* @__PURE__ */ O({
441
441
  navigator.clipboard.writeText(e).then(() => {
442
442
  R.success(p ?? "复制成功");
443
443
  }).catch(() => {
444
- R.error(c ?? "复制失败");
444
+ R.error(u ?? "复制失败");
445
445
  });
446
446
  else {
447
- const n = document.createElement("textarea");
448
- n.value = e, n.style.position = "fixed", n.style.opacity = "0", document.body.appendChild(n), n.select();
447
+ const o = document.createElement("textarea");
448
+ o.value = e, o.style.position = "fixed", o.style.opacity = "0", document.body.appendChild(o), o.select();
449
449
  const f = document.execCommand("copy");
450
- document.body.removeChild(n), f ? R.success(p ?? "复制成功") : R.error(c ?? "复制失败");
450
+ document.body.removeChild(o), f ? R.success(p ?? "复制成功") : R.error(u ?? "复制失败");
451
451
  }
452
452
  } catch {
453
- R.error(c ?? "复制失败");
453
+ R.error(u ?? "复制失败");
454
454
  }
455
455
  }
456
456
  }, [b(_e, {
@@ -460,24 +460,24 @@ const Ve = /* @__PURE__ */ O({
460
460
  );
461
461
  }), Ke = V((t) => {
462
462
  var f;
463
- const e = k(t.row, t.col.key) ?? "", r = ((f = t.col) == null ? void 0 : f.props) || {}, { width: l, height: a, fit: p, previewSrcList: c, placeholder: y, style: d, ...g } = r, o = e ? Array.isArray(e) ? e.filter((h) => h && typeof h == "string") : [e] : [];
464
- if (o.length === 0)
463
+ const e = k(t.row, t.col.key) ?? "", r = ((f = t.col) == null ? void 0 : f.props) || {}, { width: l, height: a, fit: p, previewSrcList: u, placeholder: y, style: d, ...g } = r, n = e ? Array.isArray(e) ? e.filter((h) => h && typeof h == "string") : [e] : [];
464
+ if (n.length === 0)
465
465
  return y || "";
466
466
  const s = {
467
467
  width: l || "80px",
468
468
  height: a || "80px",
469
- marginRight: o.length > 1 ? "4px" : "0",
469
+ marginRight: n.length > 1 ? "4px" : "0",
470
470
  ...typeof d == "object" ? d : {}
471
- }, n = {
472
- previewSrcList: c || o,
471
+ }, o = {
472
+ previewSrcList: u || n,
473
473
  previewTeleported: !0,
474
474
  fit: p || "contain",
475
475
  style: s,
476
476
  ...g
477
477
  };
478
- return o.length === 1 ? b(U, {
479
- src: o[0],
480
- ...n
478
+ return n.length === 1 ? b(U, {
479
+ src: n[0],
480
+ ...o
481
481
  }) : b(
482
482
  "div",
483
483
  {
@@ -486,30 +486,30 @@ const Ve = /* @__PURE__ */ O({
486
486
  },
487
487
  [
488
488
  b(U, {
489
- src: o[0],
490
- ...n
489
+ src: n[0],
490
+ ...o
491
491
  }),
492
- o.length > 1 && b("span", {
492
+ n.length > 1 && b("span", {
493
493
  class: "st_img_total",
494
494
  style: "position: absolute; top: 0; right: 0; ",
495
- title: `${o.length}`
495
+ title: `${n.length}`
496
496
  }, [b(ke, { style: "width: 1em; height: 1em; " })])
497
497
  ]
498
498
  );
499
499
  }), We = V((t) => {
500
500
  const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { options: l = [], showValue: a = !1, ...p } = r;
501
501
  if (e == null || e === "") return "";
502
- const c = Array.isArray(e) ? e.map(String) : [String(e)], y = l.filter((i) => c.includes(String(i.value))), d = c.filter((i) => !l.some((o) => String(o.value) === i)), g = y.map((i) => {
503
- const { listClass: o, cssClass: s, tagProps: n, ...f } = i;
502
+ const u = Array.isArray(e) ? e.map(String) : [String(e)], y = l.filter((i) => u.includes(String(i.value))), d = u.filter((i) => !l.some((n) => String(n.value) === i)), g = y.map((i) => {
503
+ const { listClass: n, cssClass: s, tagProps: o, ...f } = i;
504
504
  return b(
505
505
  ve,
506
506
  {
507
507
  key: i.value,
508
- type: o,
508
+ type: n,
509
509
  class: s,
510
510
  disableTransitions: !0,
511
511
  ...p,
512
- ...n
512
+ ...o
513
513
  },
514
514
  { default: () => i.label + " " }
515
515
  );
@@ -525,10 +525,10 @@ function De(t) {
525
525
  const Le = V((t) => {
526
526
  var y;
527
527
  const { col: e, row: r, index: l } = t, a = k(t.row, t.col.key) ?? "", p = t.col.props || {};
528
- let c = a;
529
- return De(e) && (c = ((y = e.formatter) == null ? void 0 : y.call(e, a, r, l)) ?? a), b("span", { ...p }, c);
528
+ let u = a;
529
+ return De(e) && (u = ((y = e.formatter) == null ? void 0 : y.call(e, a, r, l)) ?? a), b("span", { ...p }, u);
530
530
  }), Pe = V((t) => {
531
- const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { style: l, size: a, class: p, ...c } = r;
531
+ const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { style: l, size: a, class: p, ...u } = r;
532
532
  if (!e) return "";
533
533
  const y = a ? `${a}px` : "20px";
534
534
  return /^https?:\/\//.test(e) ? b(U, {
@@ -537,7 +537,7 @@ const Le = V((t) => {
537
537
  previewTeleported: !0,
538
538
  fit: "contain",
539
539
  style: { width: "40px", height: "40px", ...typeof l == "object" ? l : {} },
540
- ...c
540
+ ...u
541
541
  }) : /^\s*<svg[\s\S]*<\/svg>\s*$/.test(e) ? b("div", {
542
542
  innerHTML: e,
543
543
  class: p,
@@ -547,14 +547,14 @@ const Le = V((t) => {
547
547
  display: "inline-block",
548
548
  ...typeof l == "object" ? l : {}
549
549
  },
550
- ...c
550
+ ...u
551
551
  }) : b("i", {
552
552
  class: [e, p].filter(Boolean).join(" "),
553
553
  style: {
554
554
  fontSize: y,
555
555
  ...typeof l == "object" ? l : {}
556
556
  },
557
- ...c
557
+ ...u
558
558
  });
559
559
  }), ie = {
560
560
  input: Me,
@@ -646,7 +646,7 @@ function tt(t) {
646
646
  function nt() {
647
647
  return Z().getConfig();
648
648
  }
649
- const Je = ["title"], ot = /* @__PURE__ */ O({
649
+ const Je = ["title"], ot = /* @__PURE__ */ z({
650
650
  __name: "index",
651
651
  props: {
652
652
  data: { default: () => [] },
@@ -663,74 +663,74 @@ const Je = ["title"], ot = /* @__PURE__ */ O({
663
663
  Z().init();
664
664
  const { columns: p } = Be(l.columns, {
665
665
  cacheKey: l.cacheKey ?? ""
666
- }), c = A(!1);
666
+ }), u = O(!1);
667
667
  N(
668
668
  p,
669
- (u) => {
670
- c.value && a("update:columns", u), c.value = !0;
669
+ (c) => {
670
+ u.value && a("update:columns", c), u.value = !0;
671
671
  },
672
672
  { deep: !0, immediate: !0 }
673
673
  );
674
674
  const y = E(
675
- () => p.value.filter((u) => se(u.type) ? !0 : u.visible !== !1)
676
- ), d = (u, m) => u.type === "selection" ? `selection-${m}` : u.type === "index" ? `index-${m}` : u.type === "operation" ? `operation-${u.key}-${m}` : `${u.key}-${m}`, g = E(
677
- () => p.value.filter((u) => u.type === "operation")
678
- ), i = (u) => {
679
- var _, W;
680
- const m = (_ = l.pagination) == null ? void 0 : _.page, v = (W = l.pagination) == null ? void 0 : W.size;
681
- return m && v ? (m - 1) * v + u + 1 : u + 1;
682
- }, o = E(() => {
683
- const u = Y(), m = {};
684
- return u.names().forEach((v) => {
685
- const _ = u.get(v);
686
- _ && (m[v] = _);
687
- }), m;
688
- }), s = E(() => {
689
- const u = /* @__PURE__ */ new Map();
690
- return g.value.forEach((m) => {
675
+ () => p.value.filter((c) => c.type === "operation")
676
+ ), d = E(() => {
677
+ const c = /* @__PURE__ */ new Map();
678
+ return y.value.forEach((m) => {
691
679
  const v = Ee(
692
680
  m.buttons || [],
693
681
  m.maxbtn ?? 10,
694
682
  l.permissions || []
695
683
  );
696
- u.set(m.key, v);
697
- }), u;
698
- }), n = (u) => s.value.get(u.key), f = (u) => {
684
+ c.set(m.key, v);
685
+ }), c;
686
+ }), g = (c) => d.value.get(c.key), i = (c) => {
687
+ var _;
688
+ if (!xe(c)) return !1;
689
+ const m = g(c);
690
+ return !m || !(c.buttons || []).length ? !1 : (_ = l.data) != null && _.length ? m.hasAnyVisibleButton(l.data) : m.hasAnyButton.value;
691
+ }, n = (c) => {
699
692
  var v;
700
- const m = n(u);
693
+ const m = g(c);
701
694
  return m ? (v = l.data) != null && v.length ? m.getMaxOptWidth(l.data) : m.optWidth.value : 0;
702
- }, h = (u, m) => {
703
- const v = n(u);
704
- return v ? (u.buttons || []).length ? v.getVisibleButtons(m) : [] : [];
705
- }, z = (u) => {
706
- var _;
707
- if (!xe(u)) return !1;
708
- const m = n(u);
709
- return !m || !(u.buttons || []).length ? !1 : (_ = l.data) != null && _.length ? m.hasAnyVisibleButton(l.data) : m.hasAnyButton.value;
710
- }, K = (u, m) => {
711
- a("cellChange", u, m);
712
- }, ee = (u, m) => {
713
- a("cellBlur", u, m);
714
- }, D = (u, m) => {
715
- a("cellEnter", u, m);
716
- }, ae = (u, m) => {
717
- m && a("cellClick", u, m);
718
- }, te = A();
695
+ }, s = (c, m) => {
696
+ const v = g(c);
697
+ return v ? (c.buttons || []).length ? v.getVisibleButtons(m) : [] : [];
698
+ }, o = E(
699
+ () => p.value.filter((c) => c.type === "operation" ? i(c) : se(c.type) ? !0 : c.visible !== !1)
700
+ ), f = (c, m) => c.type === "selection" ? `selection-${m}` : c.type === "index" ? `index-${m}` : c.type === "operation" ? `operation-${c.key}-${m}` : `${c.key}-${m}`, h = (c) => {
701
+ var _, W;
702
+ const m = (_ = l.pagination) == null ? void 0 : _.page, v = (W = l.pagination) == null ? void 0 : W.size;
703
+ return m && v ? (m - 1) * v + c + 1 : c + 1;
704
+ }, M = E(() => {
705
+ const c = Y(), m = {};
706
+ return c.names().forEach((v) => {
707
+ const _ = c.get(v);
708
+ _ && (m[v] = _);
709
+ }), m;
710
+ }), K = (c, m) => {
711
+ a("cellChange", c, m);
712
+ }, ee = (c, m) => {
713
+ a("cellBlur", c, m);
714
+ }, D = (c, m) => {
715
+ a("cellEnter", c, m);
716
+ }, ae = (c, m) => {
717
+ m && a("cellClick", c, m);
718
+ }, te = O();
719
719
  return e({
720
720
  tableRef: te
721
- }), (u, m) => {
721
+ }), (c, m) => {
722
722
  const v = T("el-table-column"), _ = T("el-button"), W = T("el-table"), ce = de("loading");
723
723
  return me((w(), B(W, S({
724
724
  ref_key: "tableRef",
725
725
  ref: te
726
- }, u.$attrs, {
726
+ }, c.$attrs, {
727
727
  data: t.data,
728
728
  "row-key": t.rowKey,
729
729
  class: "smart_table"
730
730
  }), {
731
- default: M(() => [
732
- (w(!0), $(I, null, J(y.value, (C, ue) => (w(), $(I, {
733
- key: d(C, ue)
731
+ default: $(() => [
732
+ (w(!0), A(I, null, J(o.value, (C, ue) => (w(), A(I, {
733
+ key: f(C, ue)
734
734
  }, [
735
735
  C.type === "selection" ? (w(), B(v, S({
736
736
  key: 0,
@@ -741,26 +741,26 @@ const Je = ["title"], ot = /* @__PURE__ */ O({
741
741
  label: C.label || "#",
742
742
  align: "center"
743
743
  }, { ref_for: !0 }, C.columnProps), {
744
- default: M(({ $index: x }) => [
745
- ne(P(i(x)), 1)
744
+ default: $(({ $index: x }) => [
745
+ ne(P(h(x)), 1)
746
746
  ]),
747
747
  _: 1
748
- }, 16, ["label"])) : C.type === "operation" && z(C) ? (w(), B(v, S({
748
+ }, 16, ["label"])) : C.type === "operation" ? (w(), B(v, S({
749
749
  key: 2,
750
750
  label: C.label || "操作",
751
751
  align: "center"
752
752
  }, { ref_for: !0 }, {
753
753
  ...C.columnProps,
754
- width: f(C)
754
+ width: n(C)
755
755
  }), {
756
- default: M(({ row: x }) => [
757
- (w(!0), $(I, null, J(h(C, x), (F) => (w(), B(_, {
756
+ default: $(({ row: x }) => [
757
+ (w(!0), A(I, null, J(s(C, x), (F) => (w(), B(_, {
758
758
  key: F.label,
759
759
  type: F.type || "primary",
760
760
  link: "",
761
761
  onClick: (L) => F.action(x)
762
762
  }, {
763
- default: M(() => [
763
+ default: $(() => [
764
764
  ne(P(F.label), 1)
765
765
  ]),
766
766
  _: 2
@@ -769,18 +769,19 @@ const Je = ["title"], ot = /* @__PURE__ */ O({
769
769
  _: 2
770
770
  }, 1040, ["label"])) : (w(), B(v, S({
771
771
  key: 3,
772
+ prop: C.key,
772
773
  label: C.label,
773
774
  align: "center"
774
775
  }, { ref_for: !0 }, C.columnProps || {}), {
775
- default: M((x) => {
776
+ default: $((x) => {
776
777
  var F, L;
777
778
  return [
778
- C.type === "slot" ? (w(), $(I, { key: 0 }, [
779
- x.$index >= 0 ? ge(u.$slots, C.slot || C.key, S({
779
+ C.type === "slot" ? (w(), A(I, { key: 0 }, [
780
+ x.$index >= 0 ? ge(c.$slots, C.slot || C.key, S({
780
781
  key: 0,
781
782
  ref_for: !0
782
783
  }, x)) : ye("", !0)
783
- ], 64)) : C.type && o.value[C.type] ? (w(), B(he(o.value[C.type]), {
784
+ ], 64)) : C.type && M.value[C.type] ? (w(), B(he(M.value[C.type]), {
784
785
  key: 1,
785
786
  row: x.row,
786
787
  col: C,
@@ -789,7 +790,7 @@ const Je = ["title"], ot = /* @__PURE__ */ O({
789
790
  onCellBlur: ee,
790
791
  onCellEnter: D,
791
792
  onClick: ae
792
- }, null, 40, ["row", "col", "index"])) : (w(), $("span", {
793
+ }, null, 40, ["row", "col", "index"])) : (w(), A("span", {
793
794
  key: 2,
794
795
  style: be(((F = C.props) == null ? void 0 : F.style) || ""),
795
796
  class: Ce(((L = C.props) == null ? void 0 : L.class) || ""),
@@ -798,7 +799,7 @@ const Je = ["title"], ot = /* @__PURE__ */ O({
798
799
  ];
799
800
  }),
800
801
  _: 2
801
- }, 1040, ["label"]))
802
+ }, 1040, ["prop", "label"]))
802
803
  ], 64))), 128))
803
804
  ]),
804
805
  _: 3