@gopowerteam/table-render 0.0.150 → 0.0.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.mjs CHANGED
@@ -1,61 +1,61 @@
1
- var ve = Object.defineProperty;
2
- var xe = (e, t, r) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var k = (e, t, r) => (xe(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import { ref as h, getCurrentInstance as A, onMounted as q, onUpdated as Se, reactive as ke, createVNode as s, Fragment as B, createTextVNode as $, h as Ce, render as Te, defineComponent as E, isVNode as Me, mergeProps as ne, nextTick as X, getCurrentScope as Oe, onScopeDispose as _e, unref as Re, computed as O, watchEffect as $e, withDirectives as Ye, resolveDirective as qe, readonly as Ee } from "vue";
5
- import { Button as M, Tag as ze, Dropdown as Z, Descriptions as je, DescriptionsItem as Le, Divider as Pe, Space as p, Pagination as De, Transfer as Ae, Table as Be } from "@arco-design/web-vue";
6
- import { useModal as z, onSubmit as Ie, ModalProvider as Ke } from "@gopowerteam/modal-render";
7
- import * as We from "exceljs";
8
- import j from "dayjs";
9
- import { FormRender as ae } from "@gopowerteam/form-render";
10
- import { TableRenderResolver as cr } from "./resolver.mjs";
11
- function Fe(e, t, r) {
12
- const [u, ...n] = t.index ? t.index.split(".").reverse() : [t.key], a = n.reverse().reduce((l, d) => l == null ? void 0 : l[d], e);
13
- a[u] = r;
14
- }
15
- function Ve(e) {
16
- const t = h([]), r = (n) => {
17
- const a = e.filter((l) => l.formatter);
18
- return a.length > 0 ? n.map((l) => (a.forEach((d) => {
19
- d.formatter && Fe(l, d, d.formatter(l));
20
- }), l)) : n;
1
+ var Oe = Object.defineProperty;
2
+ var Re = (e, t, r) => t in e ? Oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var M = (e, t, r) => (Re(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import { ref as h, getCurrentInstance as K, onMounted as L, onUpdated as Ee, reactive as $e, createVNode as o, Fragment as V, createTextVNode as z, getCurrentScope as qe, onScopeDispose as je, unref as Ye, readonly as fe, computed as R, watchEffect as ze, watch as Pe, h as Le, render as Ae, defineComponent as A, isVNode as De, mergeProps as se, nextTick as re, withDirectives as Be, resolveDirective as Ie } from "vue";
5
+ import { Button as j, Tag as We, Dropdown as ne, Message as Ke, Descriptions as Ve, DescriptionsItem as Fe, Divider as Ne, Space as ae, Pagination as Ue, Transfer as He, Table as Ge } from "@arco-design/web-vue";
6
+ import { useModal as D, onSubmit as Je, ModalProvider as Qe } from "@gopowerteam/modal-render";
7
+ import * as Xe from "exceljs";
8
+ import B from "dayjs";
9
+ import { FormRender as oe } from "@gopowerteam/form-render";
10
+ import { TableRenderResolver as xr } from "./resolver.mjs";
11
+ function Ze(e, t, r) {
12
+ const [u, ...a] = t.index ? t.index.split(".").reverse() : [t.key], n = a.reverse().reduce((l, c) => l == null ? void 0 : l[c], e);
13
+ n[u] = r;
14
+ }
15
+ function pe(e) {
16
+ const t = h([]), r = (a) => {
17
+ const n = e.filter((l) => l.formatter);
18
+ return n.length > 0 ? a.map((l) => (n.forEach((c) => {
19
+ c.formatter && Ze(l, c, c.formatter(l));
20
+ }), l)) : a;
21
21
  };
22
- return [t, (n) => {
23
- t.value = r(n);
22
+ return [t, (a) => {
23
+ t.value = r(a);
24
24
  }];
25
25
  }
26
- function Ne(e) {
26
+ function et(e) {
27
27
  return e.filter((t) => t.form).map((t) => ({
28
28
  key: t.key,
29
29
  title: t.title,
30
30
  ...typeof t.form == "boolean" ? {} : t.form
31
31
  }));
32
32
  }
33
- function rr(e) {
34
- const t = A(), r = h();
33
+ function yr(e) {
34
+ const t = K(), r = h();
35
35
  function u() {
36
- var a, l;
37
- const n = (l = (a = t == null ? void 0 : t.proxy) == null ? void 0 : a.$refs) == null ? void 0 : l[e];
38
- n && (r.value = n);
36
+ var n, l;
37
+ const a = (l = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$refs) == null ? void 0 : l[e];
38
+ a && (r.value = a);
39
39
  }
40
- return q(u), Se(u), r;
40
+ return L(u), Ee(u), r;
41
41
  }
42
- function Ue(e) {
42
+ function tt(e) {
43
43
  return (t, r) => e[t](r);
44
44
  }
45
- class P {
45
+ class W {
46
46
  /**
47
47
  * 构造函数
48
48
  * @param index
49
49
  * @param size
50
50
  */
51
51
  constructor(t = 1, r = 10) {
52
- k(this, "data", ke({
52
+ M(this, "data", $e({
53
53
  index: 1,
54
54
  size: 10,
55
55
  total: 0
56
56
  }));
57
- k(this, "pageSizeOpts", [10, 20, 30, 40, 50]);
58
- k(this, "pageLayouts", ["PrevJump", "PrevPage", "JumpNumber", "NextPage", "NextJump", "Sizes", "FullJump", "Total"]);
57
+ M(this, "pageSizeOpts", [10, 20, 30, 40, 50]);
58
+ M(this, "pageLayouts", ["PrevJump", "PrevPage", "JumpNumber", "NextPage", "NextJump", "Sizes", "FullJump", "Total"]);
59
59
  this.pageIndex = t, this.pageSize = r;
60
60
  }
61
61
  get pageIndex() {
@@ -102,108 +102,108 @@ class P {
102
102
  this.total = (r = t.data) == null ? void 0 : r.totalElements;
103
103
  }
104
104
  }
105
- const Ge = Symbol.for("RenderColumnType");
106
- function g(e, t, r) {
105
+ const rt = Symbol.for("RenderColumnType");
106
+ function x(e, t, r) {
107
107
  return t.$type = e, t.$disableColumnMode = r == null ? void 0 : r.disableColumnMode, t.$disableViewMode = r == null ? void 0 : r.disableViewMode, t;
108
108
  }
109
- function v(e, t) {
109
+ function C(e, t) {
110
110
  return t.index ? t.index.split(".").reduce((r, u) => r == null ? void 0 : r[u], e) : [t.key].reduce((r, u) => r == null ? void 0 : r[u], e);
111
111
  }
112
- function Y(e) {
112
+ function P(e) {
113
113
  return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
114
114
  }
115
- function He(e) {
116
- return g("button", (r, u, n) => {
117
- const a = z(), l = Array.isArray(e) ? e : "buttons" in e ? e.buttons : [e], d = (i, f) => typeof i == "function" ? i(r) : i === void 0 ? f : i;
118
- async function m(i) {
119
- if (await (i.confirm === !0 ? new Promise((o) => {
120
- a.confirm({
115
+ function nt(e) {
116
+ return x("button", (r, u, a) => {
117
+ const n = D(), l = Array.isArray(e) ? e : "buttons" in e ? e.buttons : [e], c = (f, i) => typeof f == "function" ? f(r) : f === void 0 ? i : f;
118
+ async function m(f) {
119
+ if (await (f.confirm === !0 ? new Promise((s) => {
120
+ n.confirm({
121
121
  title: "提示信息",
122
- content: i.confirmText ?? "您确定要执行该操作?",
123
- onOk: () => o(!0),
124
- onCancel: () => o(!1)
122
+ content: f.confirmText ?? "您确定要执行该操作?",
123
+ onOk: () => s(!0),
124
+ onCancel: () => s(!1)
125
125
  });
126
- }) : Promise.resolve(!0)) && (i != null && i.onClick)) {
127
- const o = i.onClick(r);
128
- Y(o) && i.autoReload !== !1 && o.then(() => {
129
- n != null && n.emits && (n == null || n.emits("reload"));
130
- }), !Y(o) && i.autoReload === !0 && n != null && n.emits && (n == null || n.emits("reload"));
126
+ }) : Promise.resolve(!0)) && (f != null && f.onClick)) {
127
+ const s = f.onClick(r);
128
+ P(s) && f.autoReload !== !1 && s.then(() => {
129
+ a != null && a.emits && (a == null || a.emits("reload"));
130
+ }), !P(s) && f.autoReload === !0 && a != null && a.emits && (a == null || a.emits("reload"));
131
131
  }
132
132
  }
133
- return s(B, null, [l.filter((i) => d(i.visiable, !0)).map((i) => s(M, {
134
- onClick: () => m(i),
135
- type: i.type || "text",
136
- shape: i.shape,
133
+ return o(V, null, [l.filter((f) => c(f.visiable, !0)).map((f) => o(j, {
134
+ onClick: () => m(f),
135
+ type: f.type || "text",
136
+ shape: f.shape,
137
137
  size: "mini",
138
- disabled: d(i.disabled, !1)
138
+ disabled: c(f.disabled, !1)
139
139
  }, {
140
- icon: i.icon,
141
- default: () => (typeof i.content == "function" ? i.content(r) : i.content) || ""
140
+ icon: f.icon,
141
+ default: () => (typeof f.content == "function" ? f.content(r) : f.content) || ""
142
142
  }))]);
143
143
  }, {
144
144
  disableViewMode: !0
145
145
  });
146
146
  }
147
- const Je = {
147
+ const at = {
148
148
  thousands: !0,
149
149
  inputUnit: "元",
150
150
  outputUnit: "元"
151
- }, ee = {
151
+ }, le = {
152
152
  分: 10 ** 0,
153
153
  元: 10 ** 2,
154
154
  万: 10 ** 6
155
155
  };
156
- function Qe(e) {
156
+ function lt(e) {
157
157
  e = {
158
- ...Je,
158
+ ...at,
159
159
  ...e || {}
160
160
  };
161
- const t = (a) => {
162
- if (a == null)
161
+ const t = (n) => {
162
+ if (n == null)
163
163
  return;
164
164
  if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
165
- return a;
166
- const l = ee[e.inputUnit] / ee[e.outputUnit], d = parseFloat((a * l).toFixed(10));
167
- return (e == null ? void 0 : e.precision) === void 0 ? d : d.toFixed(e == null ? void 0 : e.precision);
168
- }, r = (a) => {
169
- if (a == null)
165
+ return n;
166
+ const l = le[e.inputUnit] / le[e.outputUnit], c = parseFloat((n * l).toFixed(10));
167
+ return (e == null ? void 0 : e.precision) === void 0 ? c : c.toFixed(e == null ? void 0 : e.precision);
168
+ }, r = (n) => {
169
+ if (n == null)
170
170
  return;
171
- const l = a.toString().split(".");
171
+ const l = n.toString().split(".");
172
172
  return l[0] = l[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), l.join(".");
173
- }, u = (a) => {
174
- if ((e == null ? void 0 : e.zeroString) !== void 0 && Number(a) === 0)
173
+ }, u = (n) => {
174
+ if ((e == null ? void 0 : e.zeroString) !== void 0 && Number(n) === 0)
175
175
  return e == null ? void 0 : e.zeroString;
176
- if ((e == null ? void 0 : e.nullString) !== void 0 && isNaN(Number(a)))
176
+ if ((e == null ? void 0 : e.nullString) !== void 0 && isNaN(Number(n)))
177
177
  return e == null ? void 0 : e.nullString;
178
- const l = t(Number(a));
178
+ const l = t(Number(n));
179
179
  return e != null && e.thousands ? r(l) : l;
180
180
  };
181
- return g("dict", (a, l) => {
182
- const d = v(a, l);
183
- return s("div", null, [typeof (e == null ? void 0 : e.prefix) == "string" ? s("span", null, [e.prefix]) : typeof (e == null ? void 0 : e.prefix) == "function" ? s("span", null, [e.prefix()]) : void 0, s("span", {
181
+ return x("dict", (n, l) => {
182
+ const c = C(n, l);
183
+ return o("div", null, [typeof (e == null ? void 0 : e.prefix) == "string" ? o("span", null, [e.prefix]) : typeof (e == null ? void 0 : e.prefix) == "function" ? o("span", null, [e.prefix()]) : void 0, o("span", {
184
184
  class: "currency_value"
185
- }, [u(d)]), typeof (e == null ? void 0 : e.suffix) == "string" ? s("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? s("span", null, [e.suffix()]) : void 0]);
185
+ }, [u(c)]), typeof (e == null ? void 0 : e.suffix) == "string" ? o("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? o("span", null, [e.suffix()]) : void 0]);
186
186
  });
187
187
  }
188
- var Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ze = { exports: {} };
188
+ var ut = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ct = { exports: {} };
189
189
  (function(e, t) {
190
190
  (function(r, u) {
191
- e.exports = u(j);
192
- })(Xe, function(r) {
191
+ e.exports = u(B);
192
+ })(ut, function(r) {
193
193
  function u(l) {
194
194
  return l && typeof l == "object" && "default" in l ? l : {
195
195
  default: l
196
196
  };
197
197
  }
198
- var n = u(r), a = {
198
+ var a = u(r), n = {
199
199
  name: "zh-cn",
200
200
  weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
201
201
  weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
202
202
  weekdaysMin: "日_一_二_三_四_五_六".split("_"),
203
203
  months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
204
204
  monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
205
- ordinal: function(l, d) {
206
- return d === "W" ? l + "周" : l + "日";
205
+ ordinal: function(l, c) {
206
+ return c === "W" ? l + "周" : l + "日";
207
207
  },
208
208
  weekStart: 1,
209
209
  yearStart: 4,
@@ -234,121 +234,121 @@ var Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
234
234
  y: "1 年",
235
235
  yy: "%d 年"
236
236
  },
237
- meridiem: function(l, d) {
238
- var m = 100 * l + d;
237
+ meridiem: function(l, c) {
238
+ var m = 100 * l + c;
239
239
  return m < 600 ? "凌晨" : m < 900 ? "早上" : m < 1100 ? "上午" : m < 1300 ? "中午" : m < 1800 ? "下午" : "晚上";
240
240
  }
241
241
  };
242
- return n.default.locale(a, null, !0), a;
242
+ return a.default.locale(n, null, !0), n;
243
243
  });
244
- })(Ze);
245
- j.locale("zh-cn");
246
- const pe = {
244
+ })(ct);
245
+ B.locale("zh-cn");
246
+ const dt = {
247
247
  date: "YYYY-MM-DD",
248
248
  datetime: "YYYY-MM-DD HH:mm:ss",
249
249
  time: "HH:mm:ss",
250
250
  week: "ddd"
251
251
  };
252
- function et(e) {
253
- return g("date", (r, u) => {
254
- const n = v(r, u), a = typeof (e == null ? void 0 : e.format) == "function" ? e == null ? void 0 : e.format() : pe[(e == null ? void 0 : e.format) || "datetime"], l = j(n);
255
- return s("span", null, [l.isValid() && l.format(a)]);
252
+ function it(e) {
253
+ return x("date", (r, u) => {
254
+ const a = C(r, u), n = typeof (e == null ? void 0 : e.format) == "function" ? e == null ? void 0 : e.format() : dt[(e == null ? void 0 : e.format) || "datetime"], l = B(a);
255
+ return o("span", null, [l.isValid() && l.format(n)]);
256
256
  });
257
257
  }
258
- const tt = {
258
+ const ft = {
259
259
  success: "arcoblue",
260
260
  warning: "orange",
261
261
  error: "red"
262
262
  };
263
- function rt(e) {
263
+ function st(e) {
264
264
  return e instanceof Map ? e : e.dict;
265
265
  }
266
- function nt(e) {
266
+ function ot(e) {
267
267
  const t = e instanceof Map ? !1 : e.tag;
268
- return typeof t == "string" ? tt[t] : t;
268
+ return typeof t == "string" ? ft[t] : t;
269
269
  }
270
- function at(e) {
271
- const t = rt(e), r = nt(e);
272
- return g("dict", (n, a) => {
273
- const l = v(n, a);
274
- return r ? s(ze, {
270
+ function mt(e) {
271
+ const t = st(e), r = ot(e);
272
+ return x("dict", (a, n) => {
273
+ const l = C(a, n);
274
+ return r ? o(We, {
275
275
  color: r === !0 ? void 0 : r
276
276
  }, {
277
277
  default: () => [t.get(l) || l]
278
- }) : s("span", null, [t.get(l) || l]);
278
+ }) : o("span", null, [t.get(l) || l]);
279
279
  });
280
280
  }
281
- function lt(e) {
282
- const t = z();
283
- async function r(n, a) {
284
- n.confirm && !await new Promise((d, m) => {
281
+ function yt(e) {
282
+ const t = D();
283
+ async function r(a, n) {
284
+ a.confirm && !await new Promise((c, m) => {
285
285
  t.open("confirm", {
286
286
  title: "确认",
287
- content: n.confirmText || "是否确认执行该操作?",
288
- onOk: () => d(!0),
289
- onCancel: () => d(!1)
287
+ content: a.confirmText || "是否确认执行该操作?",
288
+ onOk: () => c(!0),
289
+ onCancel: () => c(!1)
290
290
  });
291
- }) || n.onClick(a);
291
+ }) || a.onClick(n);
292
292
  }
293
- return g("dropdown", (n, a) => {
294
- const l = e.options.filter((d) => typeof d.visiable == "function" ? d.visiable(n) : d.visiable !== !1);
295
- return s(Z, {
293
+ return x("dropdown", (a, n) => {
294
+ const l = e.options.filter((c) => typeof c.visiable == "function" ? c.visiable(a) : c.visiable !== !1);
295
+ return o(ne, {
296
296
  trigger: (e == null ? void 0 : e.trigger) || "click"
297
297
  }, {
298
- default: () => s(M, {
298
+ default: () => o(j, {
299
299
  disabled: l.length === 0,
300
300
  type: "text"
301
301
  }, {
302
302
  default: () => [(e == null ? void 0 : e.content) || "操作"]
303
303
  }),
304
- content: () => l.map((d) => s(Z.Option, {
305
- onClick: () => r(d, n)
304
+ content: () => l.map((c) => o(ne.Option, {
305
+ onClick: () => r(c, a)
306
306
  }, {
307
- default: () => [typeof d.content == "function" ? d.content(n) : d.content]
307
+ default: () => [typeof c.content == "function" ? c.content(a) : c.content]
308
308
  }))
309
309
  });
310
310
  });
311
311
  }
312
- const ut = {
312
+ const bt = {
313
313
  size: 30
314
314
  };
315
- function dt(e) {
315
+ function ht(e) {
316
316
  e = {
317
- ...ut,
317
+ ...bt,
318
318
  ...e || {}
319
319
  };
320
- function t(n, a) {
321
- var d;
322
- const l = (d = document.getElementById(n)) == null ? void 0 : d.getBoundingClientRect();
320
+ function t(a, n) {
321
+ var c;
322
+ const l = (c = document.getElementById(a)) == null ? void 0 : c.getBoundingClientRect();
323
323
  if (l) {
324
324
  const m = new Image(100, 100);
325
- m.id = `IMAGE_${n}_PREVIEW`, m.src = a, m.setAttribute("style", ["position:fixed;", `top:${l.top}px;`, `left:${l.left + l.width}px;`, "min-width:400px;", "height:auto;", "z-index:100;"].join("")), document.body.appendChild(m);
325
+ m.id = `IMAGE_${a}_PREVIEW`, m.src = n, m.setAttribute("style", ["position:fixed;", `top:${l.top}px;`, `left:${l.left + l.width}px;`, "min-width:400px;", "height:auto;", "z-index:100;"].join("")), document.body.appendChild(m);
326
326
  }
327
327
  }
328
- function r(n) {
329
- const a = document.getElementById(`IMAGE_${n}_PREVIEW`);
330
- a == null || a.remove();
328
+ function r(a) {
329
+ const n = document.getElementById(`IMAGE_${a}_PREVIEW`);
330
+ n == null || n.remove();
331
331
  }
332
- return g("image", (n, a, l) => {
333
- const d = v(n, a), m = Math.random().toString(32).slice(2).toUpperCase(), i = {
332
+ return x("image", (a, n, l) => {
333
+ const c = C(a, n), m = Math.random().toString(32).slice(2).toUpperCase(), f = {
334
334
  maxWidth: "100%",
335
335
  maxHeight: "100%",
336
336
  borderRadius: e == null ? void 0 : e.radius,
337
337
  objectFit: "contain",
338
338
  transform: `rotate(${(e == null ? void 0 : e.rotate) || 0}deg)`,
339
339
  cursor: e != null && e.preview ? "pointer" : "unset"
340
- }, f = `${a.index || a.key}_parsed`;
340
+ }, i = `${n.index || n.key}_parsed`;
341
341
  if (e != null && e.parse) {
342
- const o = e == null ? void 0 : e.parse(d, n);
343
- Y(o) ? o.then((y) => n[f] = y ?? "") : n[f] = o ?? "";
342
+ const s = e == null ? void 0 : e.parse(c, a);
343
+ P(s) ? s.then((y) => a[i] = y ?? "") : a[i] = s ?? "";
344
344
  }
345
- if (e != null && e.parse && !n[f] === void 0)
346
- return s("div", null, [$("Loading...")]);
345
+ if (e != null && e.parse && !a[i] === void 0)
346
+ return o("div", null, [z("Loading...")]);
347
347
  {
348
- const o = n[f] || d;
349
- return o ? s("div", {
348
+ const s = a[i] || c;
349
+ return s ? o("div", {
350
350
  id: m,
351
- onMouseenter: () => (e == null ? void 0 : e.preview) && !(l != null && l.previewing) && t(m, o),
351
+ onMouseenter: () => (e == null ? void 0 : e.preview) && !(l != null && l.previewing) && t(m, s),
352
352
  onMouseleave: () => (e == null ? void 0 : e.preview) && !(l != null && l.previewing) && r(m),
353
353
  style: {
354
354
  display: "flex",
@@ -356,46 +356,286 @@ function dt(e) {
356
356
  alignItems: "center",
357
357
  height: `${e == null ? void 0 : e.size}px`
358
358
  }
359
- }, [s("img", {
359
+ }, [o("img", {
360
360
  alt: "image",
361
- style: i,
362
- src: o
363
- }, null)]) : s(B, null, null);
361
+ style: f,
362
+ src: s
363
+ }, null)]) : o(V, null, null);
364
364
  }
365
365
  });
366
366
  }
367
- const ct = " ";
368
- function it(e) {
367
+ function F(e) {
368
+ return qe() ? (je(e), !0) : !1;
369
+ }
370
+ function _(e) {
371
+ return typeof e == "function" ? e() : Ye(e);
372
+ }
373
+ const N = typeof window < "u" && typeof document < "u";
374
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
375
+ const gt = Object.prototype.toString, wt = (e) => gt.call(e) === "[object Object]", vt = () => {
376
+ };
377
+ function xt(e) {
378
+ let t;
379
+ function r() {
380
+ return t || (t = e()), t;
381
+ }
382
+ return r.reset = async () => {
383
+ const u = t;
384
+ t = void 0, u && await u;
385
+ }, r;
386
+ }
387
+ function St(e, t) {
388
+ var r;
389
+ if (typeof e == "number")
390
+ return e + t;
391
+ const u = ((r = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : r[0]) || "", a = e.slice(u.length), n = Number.parseFloat(u) + t;
392
+ return Number.isNaN(n) ? e : n + a;
393
+ }
394
+ function Ct(e, t, r = {}) {
395
+ const {
396
+ immediate: u = !0
397
+ } = r, a = h(!1);
398
+ let n = null;
399
+ function l() {
400
+ n && (clearTimeout(n), n = null);
401
+ }
402
+ function c() {
403
+ a.value = !1, l();
404
+ }
405
+ function m(...f) {
406
+ l(), a.value = !0, n = setTimeout(() => {
407
+ a.value = !1, n = null, e(...f);
408
+ }, _(t));
409
+ }
410
+ return u && (a.value = !0, N && m()), F(c), {
411
+ isPending: fe(a),
412
+ start: m,
413
+ stop: c
414
+ };
415
+ }
416
+ function kt(e) {
417
+ var t;
418
+ const r = _(e);
419
+ return (t = r == null ? void 0 : r.$el) != null ? t : r;
420
+ }
421
+ const U = N ? window : void 0, me = N ? window.navigator : void 0;
422
+ function ye(...e) {
423
+ let t, r, u, a;
424
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, u, a] = e, t = U) : [t, r, u, a] = e, !t)
425
+ return vt;
426
+ Array.isArray(r) || (r = [r]), Array.isArray(u) || (u = [u]);
427
+ const n = [], l = () => {
428
+ n.forEach((i) => i()), n.length = 0;
429
+ }, c = (i, s, y, w) => (i.addEventListener(s, y, w), () => i.removeEventListener(s, y, w)), m = Pe(
430
+ () => [kt(t), _(a)],
431
+ ([i, s]) => {
432
+ if (l(), !i)
433
+ return;
434
+ const y = wt(s) ? { ...s } : s;
435
+ n.push(
436
+ ...r.flatMap((w) => u.map((k) => c(i, w, k, y)))
437
+ );
438
+ },
439
+ { immediate: !0, flush: "post" }
440
+ ), f = () => {
441
+ m(), l();
442
+ };
443
+ return F(f), f;
444
+ }
445
+ function Tt() {
446
+ const e = h(!1), t = K();
447
+ return t && L(() => {
448
+ e.value = !0;
449
+ }, t), e;
450
+ }
451
+ function H(e) {
452
+ const t = Tt();
453
+ return R(() => (t.value, !!e()));
454
+ }
455
+ function q(e, t = {}) {
456
+ const { window: r = U } = t, u = H(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
457
+ let a;
458
+ const n = h(!1), l = (f) => {
459
+ n.value = f.matches;
460
+ }, c = () => {
461
+ a && ("removeEventListener" in a ? a.removeEventListener("change", l) : a.removeListener(l));
462
+ }, m = ze(() => {
463
+ u.value && (c(), a = r.matchMedia(_(e)), "addEventListener" in a ? a.addEventListener("change", l) : a.addListener(l), n.value = a.matches);
464
+ });
465
+ return F(() => {
466
+ m(), c(), a = void 0;
467
+ }), n;
468
+ }
469
+ function Mt(e, t = {}) {
470
+ function r(i, s) {
471
+ let y = _(e[_(i)]);
472
+ return s != null && (y = St(y, s)), typeof y == "number" && (y = `${y}px`), y;
473
+ }
474
+ const { window: u = U, strategy: a = "min-width" } = t;
475
+ function n(i) {
476
+ return u ? u.matchMedia(i).matches : !1;
477
+ }
478
+ const l = (i) => q(() => `(min-width: ${r(i)})`, t), c = (i) => q(() => `(max-width: ${r(i)})`, t), m = Object.keys(e).reduce((i, s) => (Object.defineProperty(i, s, {
479
+ get: () => a === "min-width" ? l(s) : c(s),
480
+ enumerable: !0,
481
+ configurable: !0
482
+ }), i), {});
483
+ function f() {
484
+ const i = Object.keys(e).map((s) => [s, l(s)]);
485
+ return R(() => i.filter(([, s]) => s.value).map(([s]) => s));
486
+ }
487
+ return Object.assign(m, {
488
+ greaterOrEqual: l,
489
+ smallerOrEqual: c,
490
+ greater(i) {
491
+ return q(() => `(min-width: ${r(i, 0.1)})`, t);
492
+ },
493
+ smaller(i) {
494
+ return q(() => `(max-width: ${r(i, -0.1)})`, t);
495
+ },
496
+ between(i, s) {
497
+ return q(() => `(min-width: ${r(i)}) and (max-width: ${r(s, -0.1)})`, t);
498
+ },
499
+ isGreater(i) {
500
+ return n(`(min-width: ${r(i, 0.1)})`);
501
+ },
502
+ isGreaterOrEqual(i) {
503
+ return n(`(min-width: ${r(i)})`);
504
+ },
505
+ isSmaller(i) {
506
+ return n(`(max-width: ${r(i, -0.1)})`);
507
+ },
508
+ isSmallerOrEqual(i) {
509
+ return n(`(max-width: ${r(i)})`);
510
+ },
511
+ isInBetween(i, s) {
512
+ return n(`(min-width: ${r(i)}) and (max-width: ${r(s, -0.1)})`);
513
+ },
514
+ current: f,
515
+ active() {
516
+ const i = f();
517
+ return R(() => i.value.length === 0 ? "" : i.value.at(-1));
518
+ }
519
+ });
520
+ }
521
+ function ue(e, t = {}) {
522
+ const {
523
+ controls: r = !1,
524
+ navigator: u = me
525
+ } = t, a = H(() => u && "permissions" in u);
526
+ let n;
527
+ const l = typeof e == "string" ? { name: e } : e, c = h(), m = () => {
528
+ n && (c.value = n.state);
529
+ }, f = xt(async () => {
530
+ if (a.value) {
531
+ if (!n)
532
+ try {
533
+ n = await u.permissions.query(l), ye(n, "change", m), m();
534
+ } catch {
535
+ c.value = "prompt";
536
+ }
537
+ return n;
538
+ }
539
+ });
540
+ return f(), r ? {
541
+ state: c,
542
+ isSupported: a,
543
+ query: f
544
+ } : c;
545
+ }
546
+ function _t(e = {}) {
547
+ const {
548
+ navigator: t = me,
549
+ read: r = !1,
550
+ source: u,
551
+ copiedDuring: a = 1500,
552
+ legacy: n = !1
553
+ } = e, l = H(() => t && "clipboard" in t), c = ue("clipboard-read"), m = ue("clipboard-write"), f = R(() => l.value || n), i = h(""), s = h(!1), y = Ct(() => s.value = !1, a);
554
+ function w() {
555
+ l.value && E(c.value) ? t.clipboard.readText().then((g) => {
556
+ i.value = g;
557
+ }) : i.value = I();
558
+ }
559
+ f.value && r && ye(["copy", "cut"], w);
560
+ async function k(g = _(u)) {
561
+ f.value && g != null && (l.value && E(m.value) ? await t.clipboard.writeText(g) : S(g), i.value = g, s.value = !0, y.start());
562
+ }
563
+ function S(g) {
564
+ const v = document.createElement("textarea");
565
+ v.value = g ?? "", v.style.position = "absolute", v.style.opacity = "0", document.body.appendChild(v), v.select(), document.execCommand("copy"), v.remove();
566
+ }
567
+ function I() {
568
+ var g, v, O;
569
+ return (O = (v = (g = document == null ? void 0 : document.getSelection) == null ? void 0 : g.call(document)) == null ? void 0 : v.toString()) != null ? O : "";
570
+ }
571
+ function E(g) {
572
+ return g === "granted" || g === "prompt";
573
+ }
574
+ return {
575
+ isSupported: f,
576
+ text: i,
577
+ copied: s,
578
+ copy: k
579
+ };
580
+ }
581
+ const Ot = " ";
582
+ function Rt(e) {
369
583
  return e == null ? void 0 : e.replace(/(\d{3})\d*(\d{4})/g, "$1****$2");
370
584
  }
371
- function ft(e, t) {
372
- return e == null ? void 0 : e.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? ct).replace(/M/g, "*");
585
+ function ce(e, t) {
586
+ return e == null ? void 0 : e.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? Ot).replace(/M/g, "*");
373
587
  }
374
- function st(e) {
375
- return g("phone", (r, u) => {
376
- const n = v(r, u), a = ft(e != null && e.safe ? it(n) : n, e == null ? void 0 : e.separator);
377
- return e != null && e.callable ? s("a", {
378
- style: "text-decoration:none;",
588
+ function Et(e) {
589
+ const t = _t();
590
+ return x("phone", (u, a) => {
591
+ const n = C(u, a), l = ce(Rt(n), e == null ? void 0 : e.separator), c = ce(n, e == null ? void 0 : e.separator);
592
+ function m(s) {
593
+ if (e != null && e.safe && e.noSafeWhenHover) {
594
+ const y = s.target;
595
+ y.innerText = c;
596
+ }
597
+ }
598
+ function f(s) {
599
+ if (e != null && e.safe && e.noSafeWhenHover) {
600
+ const y = s.target;
601
+ y.innerText = l;
602
+ }
603
+ }
604
+ function i() {
605
+ t.copy(n).then(() => {
606
+ Ke.success({
607
+ content: "复制成功",
608
+ duration: 1e3
609
+ });
610
+ });
611
+ }
612
+ return e != null && e.callable ? o("a", {
613
+ style: "text-decoration:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;",
379
614
  href: `tel:${n}`
380
- }, [a]) : s("span", null, [a]);
615
+ }, [e != null && e.safe ? l : c]) : o("a", {
616
+ onClick: i,
617
+ style: "text-decoration:none;use-select:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;",
618
+ onMouseenter: m,
619
+ onMouseleave: f
620
+ }, [e != null && e.safe ? l : c]);
381
621
  });
382
622
  }
383
- function ot(e) {
384
- return g("render", (r) => e(r));
623
+ function $t(e) {
624
+ return x("render", (r) => e(r));
385
625
  }
386
- function mt(e) {
387
- return g("tag", (r, u) => {
388
- const n = (e == null ? void 0 : e.maxCount) || 5, a = e != null && e.formatter ? e.formatter(r) : v(r, u), l = (e == null ? void 0 : e.textColors) || ["#F87335"], d = (e == null ? void 0 : e.backgroundColors) || ["#FFF4E8"], m = a.length > n, i = e == null ? void 0 : e.minWidth;
389
- return s("div", {
626
+ function qt(e) {
627
+ return x("tag", (r, u) => {
628
+ const a = (e == null ? void 0 : e.maxCount) || 5, n = e != null && e.formatter ? e.formatter(r) : C(r, u), l = (e == null ? void 0 : e.textColors) || ["#F87335"], c = (e == null ? void 0 : e.backgroundColors) || ["#FFF4E8"], m = n.length > a, f = e == null ? void 0 : e.minWidth;
629
+ return o("div", {
390
630
  style: {
391
631
  display: "flex",
392
632
  flexWrap: "wrap"
393
633
  }
394
- }, [a.slice(0, n).map((f, o) => {
395
- const y = typeof l == "function" ? l(f, o) : l[o % l.length], w = typeof d == "function" ? d(f, o) : d[o % d.length];
396
- return s("span", {
634
+ }, [n.slice(0, a).map((i, s) => {
635
+ const y = typeof l == "function" ? l(i, s) : l[s % l.length], w = typeof c == "function" ? c(i, s) : c[s % c.length];
636
+ return o("span", {
397
637
  style: {
398
- minWidth: i ? `${i}px` : "unset",
638
+ minWidth: f ? `${f}px` : "unset",
399
639
  textAlign: "center",
400
640
  margin: "2px",
401
641
  padding: "2px 5px",
@@ -404,21 +644,21 @@ function mt(e) {
404
644
  color: y,
405
645
  backgroundColor: w
406
646
  }
407
- }, [f]);
647
+ }, [i]);
408
648
  }), m && "..."]);
409
649
  });
410
650
  }
411
- function te(e) {
651
+ function de(e) {
412
652
  if (typeof e == "string")
413
653
  return e;
414
654
  if (typeof e == "number")
415
655
  return `${e}px`;
416
656
  }
417
- function bt(e, t, r) {
418
- var u, n;
419
- return typeof e == "function" ? (u = e(r)) == null ? void 0 : u.toString() : typeof (e == null ? void 0 : e.content) == "function" ? (n = e == null ? void 0 : e.content(r)) == null ? void 0 : n.toString() : typeof (e == null ? void 0 : e.content) == "string" ? e == null ? void 0 : e.content : v(r, t);
657
+ function jt(e, t, r) {
658
+ var u, a;
659
+ return typeof e == "function" ? (u = e(r)) == null ? void 0 : u.toString() : typeof (e == null ? void 0 : e.content) == "function" ? (a = e == null ? void 0 : e.content(r)) == null ? void 0 : a.toString() : typeof (e == null ? void 0 : e.content) == "string" ? e == null ? void 0 : e.content : C(r, t);
420
660
  }
421
- function yt(e, t) {
661
+ function Yt(e, t) {
422
662
  if (typeof e != "function") {
423
663
  if (typeof (e == null ? void 0 : e.color) == "function")
424
664
  return e == null ? void 0 : e.color(t);
@@ -426,103 +666,103 @@ function yt(e, t) {
426
666
  return e == null ? void 0 : e.color;
427
667
  }
428
668
  }
429
- function ht(e, t) {
669
+ function zt(e, t) {
430
670
  if (typeof e != "function")
431
- return typeof (e == null ? void 0 : e.size) == "function" ? te(e == null ? void 0 : e.size(t)) : te(e == null ? void 0 : e.size);
671
+ return typeof (e == null ? void 0 : e.size) == "function" ? de(e == null ? void 0 : e.size(t)) : de(e == null ? void 0 : e.size);
432
672
  }
433
- function gt(e, t) {
673
+ function Pt(e, t) {
434
674
  let r = "";
435
- const u = yt(e, t), n = ht(e, t);
436
- return u && (r += `color:${u};`), n && (r += `font-size:${n};`), r;
437
- }
438
- function wt(e) {
439
- return g("text", (r, u) => {
440
- const n = bt(e || {}, u, r), a = gt(e || {}, r);
441
- return s("span", {
442
- style: a
443
- }, [n]);
675
+ const u = Yt(e, t), a = zt(e, t);
676
+ return u && (r += `color:${u};`), a && (r += `font-size:${a};`), r;
677
+ }
678
+ function Lt(e) {
679
+ return x("text", (r, u) => {
680
+ const a = jt(e || {}, u, r), n = Pt(e || {}, r);
681
+ return o("span", {
682
+ style: n
683
+ }, [a]);
444
684
  });
445
685
  }
446
- function vt() {
686
+ function At() {
447
687
  return {
448
- dropdown: lt,
449
- text: wt,
450
- dict: at,
451
- tag: mt,
452
- render: ot,
453
- phone: st,
454
- image: dt,
455
- currency: Qe,
456
- date: et,
457
- button: He
688
+ dropdown: yt,
689
+ text: Lt,
690
+ dict: mt,
691
+ tag: qt,
692
+ render: $t,
693
+ phone: Et,
694
+ image: ht,
695
+ currency: lt,
696
+ date: it,
697
+ button: nt
458
698
  };
459
699
  }
460
- function I(e, t) {
700
+ function G(e, t) {
461
701
  if (!(e != null && e.render))
462
702
  return;
463
703
  const r = e.render({
464
- ...vt()
704
+ ...At()
465
705
  // ...(Table?.$override?.table || {}),
466
706
  });
467
707
  return {
468
708
  render: ({
469
709
  record: u
470
710
  }) => r(u, e, t),
471
- [Ge]: r.$type,
711
+ [rt]: r.$type,
472
712
  disableColumnMode: r.$disableColumnMode,
473
713
  disableViewMode: r.$disableViewMode,
474
714
  isRender: r.$type === "render",
475
715
  type: r.$type
476
716
  };
477
717
  }
478
- function re({
718
+ function ie({
479
719
  columns: e,
480
720
  columnsOptions: t,
481
721
  columnsGroups: r,
482
722
  pageMode: u,
483
- collapsedColumns: n,
484
- events: a
723
+ collapsedColumns: a,
724
+ events: n
485
725
  }) {
486
- const l = e.map((d) => ({
726
+ const l = e.map((c) => ({
487
727
  ...t || {},
488
- ...d
489
- })).map((d) => kt(d, u, n, a)).filter(Boolean);
490
- return St(l, r);
491
- }
492
- function xt(e, t) {
493
- const r = [], u = (a) => {
494
- if ("children" in a && (a.children = a.children.map(u)), "key" in a) {
495
- const l = t.find((d) => {
728
+ ...c
729
+ })).map((c) => It(c, u, a, n)).filter(Boolean);
730
+ return Bt(l, r);
731
+ }
732
+ function Dt(e, t) {
733
+ const r = [], u = (n) => {
734
+ if ("children" in n && (n.children = n.children.map(u)), "key" in n) {
735
+ const l = t.find((c) => {
496
736
  var m;
497
- return ((m = Object.getOwnPropertyDescriptor(d, "key")) == null ? void 0 : m.value) === a.key;
737
+ return ((m = Object.getOwnPropertyDescriptor(c, "key")) == null ? void 0 : m.value) === n.key;
498
738
  });
499
739
  if (l)
500
740
  return r.push(l), l;
501
741
  }
502
- return a;
503
- }, n = u(e);
504
- if (r != null && r.length && n) {
505
- const a = Math.min(...r.map((l) => t.indexOf(l)));
742
+ return n;
743
+ }, a = u(e);
744
+ if (r != null && r.length && a) {
745
+ const n = Math.min(...r.map((l) => t.indexOf(l)));
506
746
  r.forEach((l) => {
507
- const d = t.indexOf(l);
508
- t.splice(d, 1);
509
- }), t.splice(a, 0, n);
747
+ const c = t.indexOf(l);
748
+ t.splice(c, 1);
749
+ }), t.splice(n, 0, a);
510
750
  }
511
751
  }
512
- function St(e, t = []) {
752
+ function Bt(e, t = []) {
513
753
  return t.forEach((r) => {
514
- xt(r, e);
754
+ Dt(r, e);
515
755
  }), e;
516
756
  }
517
- function kt(e, t, r, u) {
757
+ function It(e, t, r, u) {
518
758
  const {
519
- render: n,
520
- disableColumnMode: a
521
- } = I(e, {
759
+ render: a,
760
+ disableColumnMode: n
761
+ } = G(e, {
522
762
  previewing: !1,
523
763
  emits: u
524
764
  }) || {};
525
- if (!(a || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((l) => l.key === e.key && l.collapsed === !0))
765
+ if (!(n || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((l) => l.key === e.key && l.collapsed === !0))
526
766
  return {
527
767
  dataIndex: e.index || e.key,
528
768
  title: e.title,
@@ -538,13 +778,13 @@ function kt(e, t, r, u) {
538
778
  tooltip: !0,
539
779
  ...e.extraProps,
540
780
  key: e.key,
541
- render: n
781
+ render: a
542
782
  };
543
783
  }
544
- function Ct() {
545
- return new We.Workbook();
784
+ function Wt() {
785
+ return new Xe.Workbook();
546
786
  }
547
- function Tt(e, t = "Sheet1") {
787
+ function Kt(e, t = "Sheet1") {
548
788
  return e.addWorksheet(t, {
549
789
  headerFooter: {
550
790
  firstHeader: "",
@@ -552,55 +792,55 @@ function Tt(e, t = "Sheet1") {
552
792
  }
553
793
  });
554
794
  }
555
- function Mt(e, t) {
795
+ function Vt(e, t) {
556
796
  e.columns = t;
557
797
  }
558
- function Ot(e, t) {
798
+ function Ft(e, t) {
559
799
  e.addRows(t);
560
800
  }
561
- async function _t({
801
+ async function Nt({
562
802
  columns: e,
563
803
  rows: t,
564
804
  filename: r
565
805
  }) {
566
- const u = Ct(), n = Tt(u);
567
- Mt(n, e), Ot(n, t);
568
- const a = await u.xlsx.writeBuffer(), l = new Blob([a]);
569
- Rt(l, r || `${j().format("YYYY-MM-DD HH:mm:ss")}.xlsx`);
806
+ const u = Wt(), a = Kt(u);
807
+ Vt(a, e), Ft(a, t);
808
+ const n = await u.xlsx.writeBuffer(), l = new Blob([n]);
809
+ Ut(l, r || `${B().format("YYYY-MM-DD HH:mm:ss")}.xlsx`);
570
810
  }
571
- function Rt(e, t) {
811
+ function Ut(e, t) {
572
812
  const r = document.createElement("a");
573
813
  r.download = t || "download", r.href = URL.createObjectURL(e), r.click(), setTimeout(() => {
574
814
  URL.revokeObjectURL(r.href);
575
815
  }, 1e3);
576
816
  }
577
- function $t(e, t) {
817
+ function Ht(e, t) {
578
818
  const r = {};
579
- return e.filter((n) => n.exportable !== !1).map((n) => ({
580
- options: n,
581
- render: I(n),
582
- content: typeof n.exportable == "object" ? n.exportable.content : void 0
583
- })).forEach((n) => {
584
- var d;
585
- const a = (d = n.render) == null ? void 0 : d.render, l = () => {
819
+ return e.filter((a) => a.exportable !== !1).map((a) => ({
820
+ options: a,
821
+ render: G(a),
822
+ content: typeof a.exportable == "object" ? a.exportable.content : void 0
823
+ })).forEach((a) => {
824
+ var c;
825
+ const n = (c = a.render) == null ? void 0 : c.render, l = () => {
586
826
  var m;
587
827
  switch (!0) {
588
- case !!n.content:
589
- return n.content && n.content(t);
590
- case !!a: {
591
- const i = document.createElement("div"), f = Ce(() => a && a({
828
+ case !!a.content:
829
+ return a.content && a.content(t);
830
+ case !!n: {
831
+ const f = document.createElement("div"), i = Le(() => n && n({
592
832
  record: t
593
833
  }));
594
- return Te(f, i), (m = f.el) == null ? void 0 : m.innerText;
834
+ return Ae(i, f), (m = i.el) == null ? void 0 : m.innerText;
595
835
  }
596
836
  default:
597
- return v(t, n.options);
837
+ return C(t, a.options);
598
838
  }
599
839
  };
600
- r[n.options.key] = l();
840
+ r[a.options.key] = l();
601
841
  }), r;
602
842
  }
603
- function Yt(e) {
843
+ function Gt(e) {
604
844
  switch (!0) {
605
845
  case typeof e == "number":
606
846
  return e / 6;
@@ -610,31 +850,31 @@ function Yt(e) {
610
850
  return 30;
611
851
  }
612
852
  }
613
- function qt(e, t, r) {
614
- const u = e.filter((a) => a.exportable !== !1).map((a) => {
615
- var l, d;
853
+ function Jt(e, t, r) {
854
+ const u = e.filter((n) => n.exportable !== !1).map((n) => {
855
+ var l, c;
616
856
  return {
617
- key: a.key,
618
- header: ((l = a.exportable) == null ? void 0 : l.header) || a.title,
619
- width: ((d = a.exportable) == null ? void 0 : d.width) || Yt(a.width)
857
+ key: n.key,
858
+ header: ((l = n.exportable) == null ? void 0 : l.header) || n.title,
859
+ width: ((c = n.exportable) == null ? void 0 : c.width) || Gt(n.width)
620
860
  };
621
- }), n = t.map((a) => $t(e, a));
622
- _t({
861
+ }), a = t.map((n) => Ht(e, n));
862
+ Nt({
623
863
  columns: u,
624
- rows: n,
864
+ rows: a,
625
865
  filename: r
626
866
  });
627
867
  }
628
- function Et() {
868
+ function Qt() {
629
869
  return {
630
- exportExcel: qt
870
+ exportExcel: Jt
631
871
  };
632
872
  }
633
- class K {
873
+ class J {
634
874
  constructor(t) {
635
- k(this, "sort", {});
636
- k(this, "defaultSort", {});
637
- k(this, "before", (t) => {
875
+ M(this, "sort", {});
876
+ M(this, "defaultSort", {});
877
+ M(this, "before", (t) => {
638
878
  t.paramsQuery = {
639
879
  ...t.paramsQuery || {},
640
880
  sort: this.stringify(this.sort)
@@ -656,8 +896,8 @@ class K {
656
896
  */
657
897
  remove(t) {
658
898
  const r = Object.entries(this.sort).filter(([u]) => u !== t);
659
- this.sort = {}, r && r.forEach(([u, n]) => {
660
- this.sort[u] = n;
899
+ this.sort = {}, r && r.forEach(([u, a]) => {
900
+ this.sort[u] = a;
661
901
  });
662
902
  }
663
903
  /**
@@ -670,35 +910,35 @@ class K {
670
910
  * 转换排序对象为字符串
671
911
  */
672
912
  stringify(t) {
673
- return typeof t != "object" ? [] : (t instanceof K && (t = t.sort), Object.entries(t).map(([r, u]) => `${r},${u}`));
913
+ return typeof t != "object" ? [] : (t instanceof J && (t = t.sort), Object.entries(t).map(([r, u]) => `${r},${u}`));
674
914
  }
675
915
  }
676
- const zt = 300;
677
- function jt(e) {
916
+ const Xt = 300;
917
+ function Zt(e) {
678
918
  const t = e, r = t == null ? void 0 : t.querySelector(".arco-scrollbar-container.arco-table-body");
679
919
  if (!r)
680
920
  return;
681
- let u, n = !1, a;
921
+ let u, a = !1, n;
682
922
  r.addEventListener("mousedown", () => {
683
923
  console.log("mousedown"), u = setTimeout(() => {
684
- u && (r.style.cursor = "grab", r.style.userSelect = "none", n = !0);
685
- }, zt);
924
+ u && (r.style.cursor = "grab", r.style.userSelect = "none", a = !0);
925
+ }, Xt);
686
926
  }), r.addEventListener("mouseup", () => {
687
- clearTimeout(u), u && (u = void 0, n = !1, r.style.cursor = "", r.style.userSelect = "", a = void 0);
927
+ clearTimeout(u), u && (u = void 0, a = !1, r.style.cursor = "", r.style.userSelect = "", n = void 0);
688
928
  }), r.addEventListener("mousemove", (l) => {
689
- if (n)
690
- if (a === void 0)
691
- a = l.clientX;
929
+ if (a)
930
+ if (n === void 0)
931
+ n = l.clientX;
692
932
  else {
693
- const d = a - l.clientX;
694
- a = l.clientX, r.scrollLeft += d;
933
+ const c = n - l.clientX;
934
+ n = l.clientX, r.scrollLeft += c;
695
935
  }
696
936
  });
697
937
  }
698
- function Lt(e) {
699
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Me(e);
938
+ function pt(e) {
939
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !De(e);
700
940
  }
701
- const Pt = /* @__PURE__ */ E({
941
+ const er = /* @__PURE__ */ A({
702
942
  props: {
703
943
  record: {
704
944
  type: Object,
@@ -732,60 +972,60 @@ const Pt = /* @__PURE__ */ E({
732
972
  }
733
973
  },
734
974
  setup(e) {
735
- const t = A(), r = h(0), u = e.columns.filter((a) => typeof a.visiable == "boolean" ? a.visiable : typeof a.visiable == "function" ? a.visiable() : !0).map((a) => ({
736
- options: a,
737
- renderer: I(a, {
975
+ const t = K(), r = h(0), u = e.columns.filter((n) => typeof n.visiable == "boolean" ? n.visiable : typeof n.visiable == "function" ? n.visiable() : !0).map((n) => ({
976
+ options: n,
977
+ renderer: G(n, {
738
978
  previewing: !0
739
979
  })
740
980
  })).filter(({
741
- options: a
981
+ options: n
742
982
  }) => {
743
983
  var l;
744
- return !((l = e.exclude) != null && l.includes(a.key));
984
+ return !((l = e.exclude) != null && l.includes(n.key));
745
985
  }).filter(({
746
- renderer: a
747
- }) => !(a != null && a.disableViewMode));
748
- function n() {
749
- var a;
986
+ renderer: n
987
+ }) => !(n != null && n.disableViewMode));
988
+ function a() {
989
+ var n;
750
990
  if (t) {
751
- const l = (a = t.proxy) == null ? void 0 : a.$el;
991
+ const l = (n = t.proxy) == null ? void 0 : n.$el;
752
992
  r.value = Math.floor(l.offsetWidth / e.minWidth);
753
993
  }
754
994
  }
755
- return q(() => {
756
- n();
995
+ return L(() => {
996
+ a();
757
997
  }), () => {
758
- let a;
759
- return s("div", {
998
+ let n;
999
+ return o("div", {
760
1000
  class: "preview-container"
761
- }, [s(je, {
1001
+ }, [o(Ve, {
762
1002
  column: r.value,
763
1003
  bordered: !0,
764
1004
  align: "left",
765
1005
  layout: e.layout
766
- }, Lt(a = u.map((l) => s(Le, {
1006
+ }, pt(n = u.map((l) => o(Fe, {
767
1007
  label: l.options.title
768
1008
  }, {
769
1009
  default: () => {
770
- var d, m;
771
- return [(d = l.renderer) != null && d.render ? (m = l.renderer) == null ? void 0 : m.render({
1010
+ var c, m;
1011
+ return [(c = l.renderer) != null && c.render ? (m = l.renderer) == null ? void 0 : m.render({
772
1012
  record: e.record
773
- }) : v(e.record, l.options)];
1013
+ }) : C(e.record, l.options)];
774
1014
  }
775
- }))) ? a : {
776
- default: () => [a]
1015
+ }))) ? n : {
1016
+ default: () => [n]
777
1017
  })]);
778
1018
  };
779
1019
  }
780
1020
  });
781
- function Dt(e, t, {
1021
+ function tr(e, t, {
782
1022
  tableForm: r,
783
1023
  tableEvents: u
784
1024
  }) {
785
- const n = e.refreshable || e.exportable || t.slots.actions, a = !!(r != null && r.length) && n;
786
- return n || a ? () => s(B, null, [a && s(Pe, {
1025
+ const a = e.refreshable || e.exportable || t.slots.actions, n = !!(r != null && r.length) && a;
1026
+ return a || n ? () => o(V, null, [n && o(Ne, {
787
1027
  margin: 0
788
- }, null), n && s("div", {
1028
+ }, null), a && o("div", {
789
1029
  class: "table-actions",
790
1030
  style: {
791
1031
  display: "flex",
@@ -794,42 +1034,42 @@ function Dt(e, t, {
794
1034
  flexDirection: e.actionsPosition === "right" ? "row" : "row-reverse",
795
1035
  alignItems: "center"
796
1036
  }
797
- }, [s("div", {
1037
+ }, [o("div", {
798
1038
  class: "built-in"
799
- }, [s(p, null, {
800
- default: () => [e.refreshable && s(M, {
1039
+ }, [o(ae, null, {
1040
+ default: () => [e.refreshable && o(j, {
801
1041
  type: "primary",
802
1042
  onClick: () => u("reload")
803
1043
  }, {
804
- default: () => [$("刷新")]
805
- }), e.exportable && s(M, {
1044
+ default: () => [z("刷新")]
1045
+ }), e.exportable && o(j, {
806
1046
  type: "primary",
807
1047
  onClick: () => u("export")
808
1048
  }, {
809
- default: () => [$("导出")]
810
- }), e.collapsable && s(M, {
1049
+ default: () => [z("导出")]
1050
+ }), e.collapsable && o(j, {
811
1051
  type: "primary",
812
1052
  onClick: () => u("collapse")
813
1053
  }, {
814
- default: () => [$("显示")]
1054
+ default: () => [z("显示")]
815
1055
  })]
816
- })]), s("div", {
1056
+ })]), o("div", {
817
1057
  class: "customs"
818
- }, [s(p, null, {
1058
+ }, [o(ae, null, {
819
1059
  default: () => [t.slots.actions && t.slots.actions()]
820
1060
  })])])]) : () => {
821
1061
  };
822
1062
  }
823
- function At(e, t, {
1063
+ function rr(e, t, {
824
1064
  tableForm: r,
825
1065
  tableEvents: u,
826
- formInstance: n
1066
+ formInstance: a
827
1067
  }) {
828
- return r != null && r.length ? () => s("div", {
1068
+ return r != null && r.length ? () => o("div", {
829
1069
  class: "table-form"
830
- }, [s(ae, ne({
1070
+ }, [o(oe, se({
831
1071
  form: r,
832
- ref: (a) => n && (n.value = a),
1072
+ ref: (n) => a && (a.value = n),
833
1073
  searchable: !0,
834
1074
  onSubmit: () => u("reload", {
835
1075
  reset: !0
@@ -837,202 +1077,110 @@ function At(e, t, {
837
1077
  }, e.formOptions), null)]) : () => {
838
1078
  };
839
1079
  }
840
- function Bt(e, t, {
1080
+ function nr(e, t, {
841
1081
  tableSource: r
842
1082
  }) {
843
1083
  const u = h([]);
844
- function n() {
1084
+ function a() {
845
1085
  u.value = [], t.emit("update:radio-key", null), t.emit("update:radio-row", null), t.emit("update:checkbox-keys", []), t.emit("update:checkbox-rows", []);
846
1086
  }
847
- function a() {
848
- X(() => {
849
- e.checkboxRows !== void 0 && (u.value = [...e.checkboxRows.map((i) => i[e.rowKey])]), e.checkboxKeys !== void 0 && (u.value = [...e.checkboxKeys]), e.radioKey && (u.value = [e.radioKey]), e.radioRow && (u.value = [e.radioRow[e.rowKey]]);
1087
+ function n() {
1088
+ re(() => {
1089
+ e.checkboxRows !== void 0 && (u.value = [...e.checkboxRows.map((f) => f[e.rowKey])]), e.checkboxKeys !== void 0 && (u.value = [...e.checkboxKeys]), e.radioKey && (u.value = [e.radioKey]), e.radioRow && (u.value = [e.radioRow[e.rowKey]]);
850
1090
  });
851
1091
  }
852
1092
  function l() {
853
- const i = typeof e.selection == "string" ? {
1093
+ const f = typeof e.selection == "string" ? {
854
1094
  type: e.selection
855
1095
  } : e.selection;
856
- switch (i == null ? void 0 : i.type) {
1096
+ switch (f == null ? void 0 : f.type) {
857
1097
  case "radio":
858
1098
  return {
859
1099
  title: "选择",
860
- ...i,
1100
+ ...f,
861
1101
  selectedRowKeys: u.value
862
1102
  };
863
1103
  case "checkbox":
864
1104
  return {
865
1105
  showCheckedAll: !0,
866
1106
  selectedRowKeys: u.value,
867
- ...i
1107
+ ...f
868
1108
  };
869
1109
  }
870
1110
  }
871
- function d(i, f, o) {
1111
+ function c(f, i, s) {
872
1112
  const {
873
1113
  type: y
874
1114
  } = l() || {};
875
1115
  switch (y) {
876
1116
  case "radio":
877
- t.emit("update:radio-key", f), t.emit("update:radio-row", o);
1117
+ t.emit("update:radio-key", i), t.emit("update:radio-row", s);
878
1118
  break;
879
1119
  case "checkbox":
880
- t.emit("update:checkbox-keys", i), t.emit("update:checkbox-rows", i.map((w) => {
881
- var _;
882
- return r.value.find((x) => x[e.rowKey] === w) || ((_ = e.checkboxRows) == null ? void 0 : _.find((x) => x[e.rowKey] === w));
1120
+ t.emit("update:checkbox-keys", f), t.emit("update:checkbox-rows", f.map((w) => {
1121
+ var k;
1122
+ return r.value.find((S) => S[e.rowKey] === w) || ((k = e.checkboxRows) == null ? void 0 : k.find((S) => S[e.rowKey] === w));
883
1123
  }));
884
1124
  break;
885
1125
  }
886
1126
  }
887
1127
  function m() {
888
- X(() => {
889
- t.emit("update:checkbox-keys", u.value), t.emit("update:checkbox-rows", u.value.map((i) => {
890
- var f;
891
- return r.value.find((o) => o[e.rowKey] === i) || ((f = e.checkboxRows) == null ? void 0 : f.find((o) => o[e.rowKey] === i));
1128
+ re(() => {
1129
+ t.emit("update:checkbox-keys", u.value), t.emit("update:checkbox-rows", u.value.map((f) => {
1130
+ var i;
1131
+ return r.value.find((s) => s[e.rowKey] === f) || ((i = e.checkboxRows) == null ? void 0 : i.find((s) => s[e.rowKey] === f));
892
1132
  }));
893
1133
  });
894
1134
  }
895
- return a(), {
1135
+ return n(), {
896
1136
  selectedRowKeys: u,
897
1137
  rowSelection: l(),
898
- onSelect: d,
1138
+ onSelect: c,
899
1139
  onSelectAll: m,
900
- resetSelection: n,
901
- reloadSelection: a
1140
+ resetSelection: a,
1141
+ reloadSelection: n
902
1142
  };
903
1143
  }
904
- function It(e) {
905
- return Oe() ? (_e(e), !0) : !1;
906
- }
907
- function D(e) {
908
- return typeof e == "function" ? e() : Re(e);
909
- }
910
- const Kt = typeof window < "u" && typeof document < "u";
911
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
912
- function Wt(e, t) {
913
- var r;
914
- if (typeof e == "number")
915
- return e + t;
916
- const u = ((r = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : r[0]) || "", n = e.slice(u.length), a = Number.parseFloat(u) + t;
917
- return Number.isNaN(a) ? e : a + n;
918
- }
919
- const le = Kt ? window : void 0;
920
- function Ft() {
921
- const e = h(!1), t = A();
922
- return t && q(() => {
923
- e.value = !0;
924
- }, t), e;
925
- }
926
- function Vt(e) {
927
- const t = Ft();
928
- return O(() => (t.value, !!e()));
929
- }
930
- function T(e, t = {}) {
931
- const { window: r = le } = t, u = Vt(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
932
- let n;
933
- const a = h(!1), l = (i) => {
934
- a.value = i.matches;
935
- }, d = () => {
936
- n && ("removeEventListener" in n ? n.removeEventListener("change", l) : n.removeListener(l));
937
- }, m = $e(() => {
938
- u.value && (d(), n = r.matchMedia(D(e)), "addEventListener" in n ? n.addEventListener("change", l) : n.addListener(l), a.value = n.matches);
939
- });
940
- return It(() => {
941
- m(), d(), n = void 0;
942
- }), a;
943
- }
944
- function Nt(e, t = {}) {
945
- function r(f, o) {
946
- let y = D(e[D(f)]);
947
- return o != null && (y = Wt(y, o)), typeof y == "number" && (y = `${y}px`), y;
948
- }
949
- const { window: u = le, strategy: n = "min-width" } = t;
950
- function a(f) {
951
- return u ? u.matchMedia(f).matches : !1;
952
- }
953
- const l = (f) => T(() => `(min-width: ${r(f)})`, t), d = (f) => T(() => `(max-width: ${r(f)})`, t), m = Object.keys(e).reduce((f, o) => (Object.defineProperty(f, o, {
954
- get: () => n === "min-width" ? l(o) : d(o),
955
- enumerable: !0,
956
- configurable: !0
957
- }), f), {});
958
- function i() {
959
- const f = Object.keys(e).map((o) => [o, l(o)]);
960
- return O(() => f.filter(([, o]) => o.value).map(([o]) => o));
961
- }
962
- return Object.assign(m, {
963
- greaterOrEqual: l,
964
- smallerOrEqual: d,
965
- greater(f) {
966
- return T(() => `(min-width: ${r(f, 0.1)})`, t);
967
- },
968
- smaller(f) {
969
- return T(() => `(max-width: ${r(f, -0.1)})`, t);
970
- },
971
- between(f, o) {
972
- return T(() => `(min-width: ${r(f)}) and (max-width: ${r(o, -0.1)})`, t);
973
- },
974
- isGreater(f) {
975
- return a(`(min-width: ${r(f, 0.1)})`);
976
- },
977
- isGreaterOrEqual(f) {
978
- return a(`(min-width: ${r(f)})`);
979
- },
980
- isSmaller(f) {
981
- return a(`(max-width: ${r(f, -0.1)})`);
982
- },
983
- isSmallerOrEqual(f) {
984
- return a(`(max-width: ${r(f)})`);
985
- },
986
- isInBetween(f, o) {
987
- return a(`(min-width: ${r(f)}) and (max-width: ${r(o, -0.1)})`);
988
- },
989
- current: i,
990
- active() {
991
- const f = i();
992
- return O(() => f.value.length === 0 ? "" : f.value.at(-1));
993
- }
994
- });
995
- }
996
- function Ut(e, t, {
1144
+ function ar(e, t, {
997
1145
  pageService: r,
998
1146
  tableEvents: u
999
1147
  }) {
1000
- function n(d) {
1001
- r && (r.pageIndex = d, u("reload"));
1148
+ function a(c) {
1149
+ r && (r.pageIndex = c, u("reload"));
1002
1150
  }
1003
- function a(d) {
1004
- r && (r.pageSize = d, u("reload"));
1151
+ function n(c) {
1152
+ r && (r.pageSize = c, u("reload"));
1005
1153
  }
1006
- const l = Nt({
1154
+ const l = Mt({
1007
1155
  mobile: 0,
1008
1156
  tablet: 640,
1009
1157
  desktop: 1024
1010
1158
  });
1011
- return r ? () => s("div", {
1159
+ return r ? () => o("div", {
1012
1160
  class: "table-pagination",
1013
1161
  style: {
1014
1162
  padding: "10px 0"
1015
1163
  }
1016
- }, [s(De, {
1164
+ }, [o(Ue, {
1017
1165
  current: r.pageIndex,
1018
- "onUpdate:current": (d) => r.pageIndex = d,
1166
+ "onUpdate:current": (c) => r.pageIndex = c,
1019
1167
  "page-size": r.pageSize,
1020
- "onUpdate:page-size": (d) => r.pageSize = d,
1168
+ "onUpdate:page-size": (c) => r.pageSize = c,
1021
1169
  total: r.total,
1022
1170
  "page-size-options": r.pageSizeOpts,
1023
1171
  "hide-on-single-page": !e.alwayShowPagination,
1024
1172
  "show-total": !0,
1025
1173
  "show-page-size": !0,
1026
1174
  simple: l.smaller("desktop").value,
1027
- onChange: (d) => n(d),
1028
- onPageSizeChange: (d) => a(d),
1175
+ onChange: (c) => a(c),
1176
+ onPageSizeChange: (c) => n(c),
1029
1177
  style: {
1030
1178
  justifyContent: "flex-end"
1031
1179
  }
1032
1180
  }, null)]) : () => {
1033
1181
  };
1034
1182
  }
1035
- const Gt = /* @__PURE__ */ E({
1183
+ const lr = /* @__PURE__ */ A({
1036
1184
  props: {
1037
1185
  collapsedColumns: {
1038
1186
  type: Array,
@@ -1040,33 +1188,33 @@ const Gt = /* @__PURE__ */ E({
1040
1188
  }
1041
1189
  },
1042
1190
  setup(e) {
1043
- const t = z(), r = h(e.collapsedColumns.map((n) => ({
1044
- label: n.title,
1045
- value: n.key,
1191
+ const t = D(), r = h(e.collapsedColumns.map((a) => ({
1192
+ label: a.title,
1193
+ value: a.key,
1046
1194
  disabled: !1
1047
- }))), u = h(e.collapsedColumns.filter((n) => n.collapsed).map((n) => n.key));
1048
- return Ie(() => {
1049
- const n = e.collapsedColumns.map((a) => ({
1050
- key: a.key,
1051
- title: a.title,
1052
- collapsed: u.value.includes(a.key)
1195
+ }))), u = h(e.collapsedColumns.filter((a) => a.collapsed).map((a) => a.key));
1196
+ return Je(() => {
1197
+ const a = e.collapsedColumns.map((n) => ({
1198
+ key: n.key,
1199
+ title: n.title,
1200
+ collapsed: u.value.includes(n.key)
1053
1201
  }));
1054
- t.close(n);
1055
- }), () => s("div", {
1202
+ t.close(a);
1203
+ }), () => o("div", {
1056
1204
  class: "table-collapsed-render"
1057
- }, [s(Ae, {
1205
+ }, [o(He, {
1058
1206
  data: r.value,
1059
1207
  "default-value": u.value,
1060
- onChange: (n) => u.value = [...n],
1208
+ onChange: (a) => u.value = [...a],
1061
1209
  title: ["显示列", "隐藏列"],
1062
1210
  style: {
1063
1211
  justifyContent: "center"
1064
1212
  }
1065
1213
  }, {
1066
- default: () => [Ye(s("template", null, null), [[qe("slot"), "source"]])]
1214
+ default: () => [Be(o("template", null, null), [[Ie("slot"), "source"]])]
1067
1215
  })]);
1068
1216
  }
1069
- }), Ht = /* @__PURE__ */ E({
1217
+ }), ur = /* @__PURE__ */ A({
1070
1218
  props: {
1071
1219
  value: {
1072
1220
  type: Object,
@@ -1082,20 +1230,20 @@ const Gt = /* @__PURE__ */ E({
1082
1230
  }
1083
1231
  },
1084
1232
  setup(e) {
1085
- const t = z();
1233
+ const t = D();
1086
1234
  function r(u) {
1087
1235
  e.onSubmit && e.onSubmit(u), t.close(u);
1088
1236
  }
1089
- return console.log(e.value), () => s("div", {
1237
+ return console.log(e.value), () => o("div", {
1090
1238
  class: "edit-form-container"
1091
- }, [s(ae, {
1239
+ }, [o(oe, {
1092
1240
  name: "form",
1093
1241
  value: e.value,
1094
1242
  form: e.form,
1095
1243
  onSubmit: r
1096
1244
  }, null)]);
1097
1245
  }
1098
- }), Jt = /* @__PURE__ */ E({
1246
+ }), cr = /* @__PURE__ */ A({
1099
1247
  props: {
1100
1248
  // 数据主键
1101
1249
  rowKey: {
@@ -1234,24 +1382,24 @@ const Gt = /* @__PURE__ */ E({
1234
1382
  },
1235
1383
  expose: ["preview", "export", "edit", "reload", "tableSource", "formSource", "update:radio-key", "update:radio-row", "update:checkbox-keys", "update:checkbox-rows", "formInstance", "resetSelection", "reloadSelection", "reloadColumns", "change"],
1236
1384
  setup(e, t) {
1237
- const r = Math.random().toString(32).slice(2).toUpperCase(), u = h(), n = h(), a = h(), l = h(), [d, m] = Ve(e.columns), i = h(!1), f = e.form ?? Ne(e.columns), o = _(), y = ue(), w = h(e.columns.map((c) => ({
1238
- key: c.key,
1239
- title: c.title,
1240
- collapsed: !!c.collapsed
1385
+ const r = Math.random().toString(32).slice(2).toUpperCase(), u = h(), a = h(), n = h(), l = h(), [c, m] = pe(e.columns), f = h(!1), i = e.form ?? et(e.columns), s = k(), y = I(), w = h(e.columns.map((d) => ({
1386
+ key: d.key,
1387
+ title: d.title,
1388
+ collapsed: !!d.collapsed
1241
1389
  })));
1242
- function _() {
1390
+ function k() {
1243
1391
  switch (!0) {
1244
1392
  case (typeof e.pageable == "string" && e.pageable === "server"):
1245
- return new P();
1393
+ return new W();
1246
1394
  case (typeof e.pageable == "boolean" && e.pageable === !0):
1247
- return new P();
1395
+ return new W();
1248
1396
  case (typeof e.pageable == "object" && !!e.pageable.reset):
1249
1397
  return e.pageable;
1250
1398
  case (typeof e.pageable == "object" && (!!e.pageable.index || !!e.pageable.size)):
1251
- return new P(e.pageable.index, e.pageable.size);
1399
+ return new W(e.pageable.index, e.pageable.size);
1252
1400
  }
1253
1401
  }
1254
- const x = (() => {
1402
+ const S = (() => {
1255
1403
  switch (!0) {
1256
1404
  case typeof e.pageable == "string":
1257
1405
  return e.pageable;
@@ -1261,213 +1409,213 @@ const Gt = /* @__PURE__ */ E({
1261
1409
  return "server";
1262
1410
  }
1263
1411
  })();
1264
- function ue() {
1265
- const c = e.columns.find((b) => !!b.sortable);
1266
- if (c || e.sortable)
1267
- return new K({
1412
+ function I() {
1413
+ const d = e.columns.find((b) => !!b.sortable);
1414
+ if (d || e.sortable)
1415
+ return new J({
1268
1416
  ...e.sortable || {},
1269
- ...c ? {
1270
- [c.key]: c.sortable
1417
+ ...d ? {
1418
+ [d.key]: d.sortable
1271
1419
  } : {}
1272
1420
  });
1273
1421
  }
1274
- function W(c) {
1422
+ function E(d) {
1275
1423
  const {
1276
1424
  exportExcel: b
1277
- } = Et();
1278
- b((c == null ? void 0 : c.columns) || e.columns, (c == null ? void 0 : c.source) || d.value, (c == null ? void 0 : c.filename) || (typeof e.exportable == "object" ? e.exportable.filename : void 0));
1425
+ } = Qt();
1426
+ b((d == null ? void 0 : d.columns) || e.columns, (d == null ? void 0 : d.source) || c.value, (d == null ? void 0 : d.filename) || (typeof e.exportable == "object" ? e.exportable.filename : void 0));
1279
1427
  }
1280
- function F(c) {
1428
+ function g(d) {
1281
1429
  let b;
1282
1430
  switch (!0) {
1283
- case !!(c != null && c.key):
1284
- b = d.value.find((S) => S[e.rowKey] === (c == null ? void 0 : c.key));
1431
+ case !!(d != null && d.key):
1432
+ b = c.value.find((T) => T[e.rowKey] === (d == null ? void 0 : d.key));
1285
1433
  break;
1286
- case !!(c != null && c.record):
1287
- b = c == null ? void 0 : c.record;
1434
+ case !!(d != null && d.record):
1435
+ b = d == null ? void 0 : d.record;
1288
1436
  break;
1289
1437
  }
1290
1438
  if (!b)
1291
1439
  throw new Error("未找到需要预览的数据");
1292
- return a.value.open(Pt, {
1440
+ return n.value.open(er, {
1293
1441
  record: b,
1294
1442
  columns: e.columns
1295
1443
  }, {
1296
- title: (c == null ? void 0 : c.title) || "详情",
1297
- mode: (c == null ? void 0 : c.mode) || "dialog"
1444
+ title: (d == null ? void 0 : d.title) || "详情",
1445
+ mode: (d == null ? void 0 : d.mode) || "dialog"
1298
1446
  });
1299
1447
  }
1300
- function V(c) {
1448
+ function v(d) {
1301
1449
  let b;
1302
1450
  switch (!0) {
1303
- case !!(c != null && c.key):
1304
- b = d.value.find((S) => S[e.rowKey] === (c == null ? void 0 : c.key));
1451
+ case !!(d != null && d.key):
1452
+ b = c.value.find((T) => T[e.rowKey] === (d == null ? void 0 : d.key));
1305
1453
  break;
1306
- case !!(c != null && c.record):
1307
- b = c == null ? void 0 : c.record;
1454
+ case !!(d != null && d.record):
1455
+ b = d == null ? void 0 : d.record;
1308
1456
  break;
1309
1457
  }
1310
1458
  if (!b)
1311
1459
  throw new Error("未找到需要编辑的数据");
1312
- return a.value.open(Ht, {
1460
+ return n.value.open(ur, {
1313
1461
  value: b,
1314
- form: c == null ? void 0 : c.form,
1315
- onSubmit: c.onSubmit
1462
+ form: d == null ? void 0 : d.form,
1463
+ onSubmit: d.onSubmit
1316
1464
  }, {
1317
- title: (c == null ? void 0 : c.title) || "编辑",
1318
- mode: (c == null ? void 0 : c.mode) || "dialog",
1465
+ title: (d == null ? void 0 : d.title) || "编辑",
1466
+ mode: (d == null ? void 0 : d.mode) || "dialog",
1319
1467
  footer: !0,
1320
1468
  form: "form"
1321
1469
  });
1322
1470
  }
1323
- function L(c) {
1324
- var H, J;
1471
+ function O(d) {
1472
+ var p, ee;
1325
1473
  if (!e.dataLoad)
1326
1474
  return Promise.reject();
1327
- c != null && c.reset && (o && o.reset(), y && y.reset(), (H = u.value) == null || H.resetSorters());
1475
+ d != null && d.reset && (s && s.reset(), y && y.reset(), (p = u.value) == null || p.resetSorters());
1328
1476
  const b = {
1329
- ...((J = n.value) == null ? void 0 : J.formSource) || {}
1477
+ ...((ee = a.value) == null ? void 0 : ee.formSource) || {}
1330
1478
  };
1331
- Object.keys(b).forEach((Q) => {
1332
- [null, void 0, ""].includes(b[Q]) && delete b[Q];
1479
+ Object.keys(b).forEach((te) => {
1480
+ [null, void 0, ""].includes(b[te]) && delete b[te];
1333
1481
  });
1334
- const S = e.dataLoad({
1482
+ const T = e.dataLoad({
1335
1483
  form: b,
1336
- page: o,
1484
+ page: s,
1337
1485
  sort: y,
1338
1486
  update: m
1339
1487
  });
1340
- return Y(S) ? (i.value = !0, Promise.resolve(S).finally(() => {
1341
- i.value = !1;
1342
- }), S) : Promise.resolve();
1488
+ return P(T) ? (f.value = !0, Promise.resolve(T).finally(() => {
1489
+ f.value = !1;
1490
+ }), T) : Promise.resolve();
1343
1491
  }
1344
- function de() {
1345
- a.value.open(Gt, {
1492
+ function be() {
1493
+ n.value.open(lr, {
1346
1494
  collapsedColumns: w.value
1347
1495
  }, {
1348
1496
  title: "显示列",
1349
1497
  size: "small",
1350
1498
  footer: !0
1351
- }).then((c) => {
1352
- w.value = c;
1499
+ }).then((d) => {
1500
+ w.value = d;
1353
1501
  });
1354
1502
  }
1355
- const ce = (c, {
1503
+ const he = (d, {
1356
1504
  type: b
1357
1505
  }) => {
1358
1506
  switch (b) {
1359
1507
  case "drag": {
1360
- m(c), t.emit("change", c);
1508
+ m(d), t.emit("change", d);
1361
1509
  break;
1362
1510
  }
1363
1511
  }
1364
- }, C = Ue({
1365
- reload: L,
1366
- preview: F,
1367
- export: W,
1368
- edit: V,
1369
- collapse: de
1512
+ }, $ = tt({
1513
+ reload: O,
1514
+ preview: g,
1515
+ export: E,
1516
+ edit: v,
1517
+ collapse: be
1370
1518
  });
1371
- function ie(c, b) {
1372
- !y || x === "client" || (b ? y.update(c, b === "descend" ? "desc" : "asc") : y.remove(c), C("reload"));
1519
+ function ge(d, b) {
1520
+ !y || S === "client" || (b ? y.update(d, b === "descend" ? "desc" : "asc") : y.remove(d), $("reload"));
1373
1521
  }
1374
- const N = h(re({
1522
+ const Q = h(ie({
1375
1523
  columns: e.columns,
1376
1524
  columnsOptions: e.columnsOptions,
1377
1525
  columnsGroups: e.columnsGroups,
1378
- pageMode: x,
1526
+ pageMode: S,
1379
1527
  collapsedColumns: w,
1380
- events: C
1381
- })), R = {
1382
- tableEvents: C,
1383
- tableForm: f,
1384
- tableSource: d,
1385
- formInstance: n,
1386
- pageService: o,
1528
+ events: $
1529
+ })), Y = {
1530
+ tableEvents: $,
1531
+ tableForm: i,
1532
+ tableSource: c,
1533
+ formInstance: a,
1534
+ pageService: s,
1387
1535
  formOptions: e.formOptions
1388
- }, fe = At(e, t, R), se = Dt(e, t, R), oe = Ut(e, t, R), {
1389
- selectedRowKeys: U,
1390
- rowSelection: G,
1391
- onSelect: me,
1392
- onSelectAll: be,
1393
- reloadSelection: ye,
1394
- resetSelection: he
1395
- } = Bt(e, t, R), ge = O(() => ({
1536
+ }, we = rr(e, t, Y), ve = tr(e, t, Y), xe = ar(e, t, Y), {
1537
+ selectedRowKeys: X,
1538
+ rowSelection: Z,
1539
+ onSelect: Se,
1540
+ onSelectAll: Ce,
1541
+ reloadSelection: ke,
1542
+ resetSelection: Te
1543
+ } = nr(e, t, Y), Me = R(() => ({
1396
1544
  rowKey: e.rowKey,
1397
1545
  size: e.size,
1398
1546
  bordered: e.bordered,
1399
1547
  hoverable: e.hoverable,
1400
1548
  stripe: e.stripe,
1401
1549
  scroll: {
1402
- x: e.columns.reduce((c, b) => c += typeof b.width != "number" ? Math.max(b.title.length * 16, 80) : b.width, 0),
1550
+ x: e.columns.reduce((d, b) => d += typeof b.width != "number" ? Math.max(b.title.length * 16, 80) : b.width, 0),
1403
1551
  y: e.height ?? "100%"
1404
1552
  },
1405
- rowSelection: G,
1553
+ rowSelection: Z,
1406
1554
  draggable: e.draggable ? {
1407
1555
  type: "handle",
1408
1556
  width: 40
1409
1557
  } : void 0,
1410
1558
  pagination: e.pageable === void 0 || e.pageable === "client",
1411
- selectedKeys: U.value,
1559
+ selectedKeys: X.value,
1412
1560
  expandable: e.expandable
1413
1561
  }));
1414
- function we() {
1415
- N.value = re({
1562
+ function _e() {
1563
+ Q.value = ie({
1416
1564
  columns: e.columns,
1417
1565
  columnsOptions: e.columnsOptions,
1418
1566
  columnsGroups: e.columnsGroups,
1419
- pageMode: x,
1567
+ pageMode: S,
1420
1568
  collapsedColumns: w,
1421
- events: C
1569
+ events: $
1422
1570
  });
1423
1571
  }
1424
- return q(() => {
1425
- l.value && (l.value.id = `table-${r}`), e.autoLoad && L(), e.grabbable && l.value && jt(l.value);
1572
+ return L(() => {
1573
+ l.value && (l.value.id = `table-${r}`), e.autoLoad && O(), e.grabbable && l.value && Zt(l.value);
1426
1574
  }), {
1427
1575
  tableId: r,
1428
1576
  tableInstance: u,
1429
- tableSource: d,
1430
- tableOptions: ge,
1431
- tableColumns: N,
1432
- tableEvents: C,
1433
- tableForm: f,
1434
- tableLoading: i,
1435
- modalInstance: a,
1577
+ tableSource: c,
1578
+ tableOptions: Me,
1579
+ tableColumns: Q,
1580
+ tableEvents: $,
1581
+ tableForm: i,
1582
+ tableLoading: f,
1583
+ modalInstance: n,
1436
1584
  tableRenderElement: l,
1437
- formSource: Ee(O(() => {
1438
- var c;
1439
- return (c = n == null ? void 0 : n.value) == null ? void 0 : c.formSource;
1585
+ formSource: fe(R(() => {
1586
+ var d;
1587
+ return (d = a == null ? void 0 : a.value) == null ? void 0 : d.formSource;
1440
1588
  })),
1441
- formInstance: n,
1442
- reload: L,
1443
- preview: F,
1444
- edit: V,
1445
- export: W,
1446
- onSorterChange: ie,
1447
- onTableChange: ce,
1589
+ formInstance: a,
1590
+ reload: O,
1591
+ preview: g,
1592
+ edit: v,
1593
+ export: E,
1594
+ onSorterChange: ge,
1595
+ onTableChange: he,
1448
1596
  renders: {
1449
- renderTableForm: fe,
1450
- renderTableActions: se,
1451
- renderTablePagination: oe
1597
+ renderTableForm: we,
1598
+ renderTableActions: ve,
1599
+ renderTablePagination: xe
1452
1600
  },
1453
1601
  tableSelection: {
1454
- selectedRowKeys: U,
1455
- rowSelection: G,
1456
- onSelect: me,
1457
- onSelectAll: be
1602
+ selectedRowKeys: X,
1603
+ rowSelection: Z,
1604
+ onSelect: Se,
1605
+ onSelectAll: Ce
1458
1606
  },
1459
- resetSelection: he,
1460
- reloadSelection: ye,
1461
- reloadColumns: we
1607
+ resetSelection: Te,
1608
+ reloadSelection: ke,
1609
+ reloadColumns: _e
1462
1610
  };
1463
1611
  },
1464
1612
  render() {
1465
1613
  this.reloadColumns();
1466
- const e = () => s("div", {
1614
+ const e = () => o("div", {
1467
1615
  class: "table-body"
1468
- }, [s("div", {
1616
+ }, [o("div", {
1469
1617
  class: "table-body-wrapper"
1470
- }, [s(Be, ne({
1618
+ }, [o(Ge, se({
1471
1619
  loading: this.tableLoading,
1472
1620
  data: this.tableSource,
1473
1621
  columns: this.tableColumns,
@@ -1480,38 +1628,38 @@ const Gt = /* @__PURE__ */ E({
1480
1628
  selectedKeys: this.tableSelection.selectedRowKeys.value,
1481
1629
  "onUpdate:selectedKeys": (t) => this.tableSelection.selectedRowKeys.value = t
1482
1630
  }, this.tableOptions), null)])]);
1483
- return s("div", {
1631
+ return o("div", {
1484
1632
  class: {
1485
1633
  "table-render": !0,
1486
1634
  "auto-fill": this.autoFill
1487
1635
  },
1488
1636
  ref: (t) => this.tableRenderElement = t
1489
- }, [s(Ke, {
1637
+ }, [o(Qe, {
1490
1638
  ref: (t) => this.modalInstance = t
1491
1639
  }, {
1492
- default: () => [s("div", {
1640
+ default: () => [o("div", {
1493
1641
  class: "table-render-content"
1494
1642
  }, [this.renders.renderTableForm(), this.renders.renderTableActions(), this.$slots.header && this.$slots.header(), e(), this.renders.renderTablePagination()])]
1495
1643
  })]);
1496
1644
  }
1497
1645
  });
1498
- function nr(e) {
1646
+ function br(e) {
1499
1647
  return e;
1500
1648
  }
1501
- function ar(e) {
1649
+ function hr(e) {
1502
1650
  return e;
1503
1651
  }
1504
- const lr = {
1652
+ const gr = {
1505
1653
  install(e, t) {
1506
- e.component("TableRender", Jt);
1654
+ e.component("TableRender", cr);
1507
1655
  }
1508
1656
  };
1509
1657
  export {
1510
- Jt as TableRender,
1511
- cr as TableRenderResolver,
1512
- lr as default,
1513
- nr as defineColumns,
1514
- ar as defineTableLoad,
1515
- Ue as useEvents,
1516
- rr as useTable
1658
+ cr as TableRender,
1659
+ xr as TableRenderResolver,
1660
+ gr as default,
1661
+ br as defineColumns,
1662
+ hr as defineTableLoad,
1663
+ tt as useEvents,
1664
+ yr as useTable
1517
1665
  };