@gx-design-vue/pro-table 0.2.0-beta.129 → 0.2.0-beta.130

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/pro-table.js CHANGED
@@ -1,29 +1,29 @@
1
1
  /*!
2
2
  * Gx Design Pro
3
- * Version: 0.2.0-beta.128
3
+ * Version: 0.2.0-beta.129
4
4
  * Author: gx12358
5
5
  * Copyright (C) 2024 gx12358
6
6
  * License: MIT License
7
7
  * Description: Gx Design Pro Table
8
- * Date Created: 2025-12-05
8
+ * Date Created: 2025-12-06
9
9
  * Homepage:
10
10
  * Contact: gx12358@gmail.com
11
11
  */
12
- import { defineComponent as te, ref as P, watch as z, cloneVNode as He, reactive as pe, watchEffect as ze, computed as C, createVNode as s, Fragment as De, isVNode as X, mergeProps as E, h as Tt, unref as p, createTextVNode as je, renderSlot as al, onActivated as nl, nextTick as ol, getCurrentInstance as sl, toRaw as Ce, onUnmounted as il, onDeactivated as ul, onMounted as rl, toRef as ie, isRef as Qe } from "vue";
13
- import { UpOutlined as cl, DownOutlined as dl, SettingOutlined as $t, VerticalAlignTopOutlined as fl, VerticalAlignMiddleOutlined as hl, VerticalAlignBottomOutlined as ml, InfoCircleOutlined as vl, ColumnHeightOutlined as gl, FullscreenExitOutlined as pl, FullscreenOutlined as yl, ReloadOutlined as bl, CopyOutlined as Cl } from "@ant-design/icons-vue";
14
- import { useProAppContext as Rt } from "@gx-design-vue/pro-app";
15
- import { useContext as xl, useProStyle as qe, unit as yt, useProConfigContext as Sl } from "@gx-design-vue/pro-provider";
16
- import { isArray as H, isBoolean as Z, classNames as ue, isNumber as Me, filterEmpty as Ft, getPrefixCls as at, getRandomNumber as lt, genColumnKey as Bt, isDeepEqualReact as We, cloneDeep as U, compareArray as wl, isObject as G, runFunction as Tl, convertValueBoolean as Te, getSortIndex as $l, isFunction as Ae, handleCurrentPage as Rl, deepMerge as Oe, arrayRepeat as Fl, isString as Pt, handleShowIndex as Bl, getSlot as bt, handleEmptyField as Pl, getSlotsProps as kl, getTextWidth as Il, getSlotVNode as Al, useDeepMerge as Ol } from "@gx-design-vue/pro-utils";
17
- import { useDebounceFn as Dl, useFullscreen as kt, useWindowSize as jl } from "@vueuse/core";
18
- import { Grid as nt, DatePicker as It, Space as ge, Input as Ye, TimePicker as Nl, TreeSelect as Ml, Select as El, InputNumber as Xe, Button as Ct, Spin as At, Popover as zl, Checkbox as Kl, Tooltip as ce, Tree as Yl, Dropdown as Ll, Menu as Le, theme as Wl, Pagination as Vl, Table as Hl, message as ql, Empty as Gl } from "ant-design-vue";
19
- import { omit as Ee, cloneDeep as Ot, pick as xt } from "lodash-es";
20
- import { tableProps as _l } from "ant-design-vue/es/table/Table";
12
+ import { defineComponent as Te, ref as O, watch as z, cloneVNode as Qe, reactive as Oe, watchEffect as dt, computed as S, createVNode as c, Fragment as Ye, isVNode as V, mergeProps as M, h as ft, unref as T, onActivated as Et, nextTick as Lt, getCurrentInstance as Wt, toRaw as ye, onUnmounted as kt, onDeactivated as Ht, onMounted as qt, toRef as q, isRef as ke } from "vue";
13
+ import { UpOutlined as Vt, DownOutlined as Kt, InfoCircleOutlined as Gt, FullscreenExitOutlined as Qt, FullscreenOutlined as Xt, ReloadOutlined as _t, CopyOutlined as Ut } from "@ant-design/icons-vue";
14
+ import { useProAppContext as mt } from "@gx-design-vue/pro-app";
15
+ import { useBreakpoint as vt, useMemo as Pe, tryOnUnmounted as Jt } from "@gx-design-vue/pro-hooks";
16
+ import { useContext as Zt, useProStyle as Xe, unit as it, useProConfigContext as ea } from "@gx-design-vue/pro-provider";
17
+ import { isArray as L, isBoolean as de, classNames as Z, isNumber as Be, filterEmpty as ht, getPrefixCls as pt, isObject as k, keysOf as gt, isDeepEqualReact as Ge, cloneDeep as _, compareArray as ta, runFunction as aa, getSortIndex as la, isFunction as De, convertValueBoolean as Me, handleCurrentPage as na, deepMerge as xe, arrayRepeat as ia, useDeepMerge as Ee, isString as yt, getRandomNumber as oa, handleShowIndex as ua, getSlot as ot, getSlotsProps as sa, handleEmptyField as ra, getTextWidth as ca, getSlotVNode as da } from "@gx-design-vue/pro-utils";
18
+ import { useDebounceFn as fa, useFullscreen as bt, useWindowSize as ma } from "@vueuse/core";
19
+ import { Grid as va, DatePicker as Ct, Space as ut, Input as Ne, TimePicker as ha, TreeSelect as pa, Select as ga, InputNumber as He, Button as st, Spin as St, Tooltip as we, theme as ya, Pagination as ba, Table as Ca, message as Sa, Empty as xa } from "ant-design-vue";
20
+ import { omit as Le, cloneDeep as xt, pick as rt } from "lodash-es";
21
+ import { tableProps as wa } from "ant-design-vue/es/table/Table";
21
22
  import "ant-design-vue/es/_util/props-util";
22
- import { warning as Ql } from "ant-design-vue/es/vc-util/warning";
23
- import q from "dayjs";
24
- import { useMemo as Ve, tryOnUnmounted as Xl } from "@gx-design-vue/pro-hooks";
25
- const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], Dt = {
26
- ...Ee(_l(), Ul),
23
+ import { warning as Ta } from "ant-design-vue/es/vc-util/warning";
24
+ import W from "dayjs";
25
+ const Ra = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], wt = {
26
+ ...Le(wa(), Ra),
27
27
  transformCellText: Function,
28
28
  /**
29
29
  * @Author gx12358
@@ -43,8 +43,8 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
43
43
  type: Object,
44
44
  default: void 0
45
45
  }
46
- }, { provideContext: Jl, useInjectContext: de } = xl("pro-table"), re = {
47
- ...Dt,
46
+ }, { provideContext: $a, useInjectContext: _e } = Zt("pro-table"), be = {
47
+ ...wt,
48
48
  rowSelection: {
49
49
  type: Object,
50
50
  default: void 0
@@ -91,7 +91,7 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
91
91
  search: {
92
92
  type: [Object, Boolean],
93
93
  default: () => ({
94
- type: "auto",
94
+ autoRequest: !0,
95
95
  resetText: "重置",
96
96
  searchText: "查询"
97
97
  })
@@ -136,16 +136,11 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
136
136
  style: {}
137
137
  })
138
138
  },
139
- /**
140
- * @Author gx12358
141
- * @DateTime 2022/2/8
142
- * @lastTime 2022/2/8
143
- * @description 渲染按钮工具栏,支持返回一个 dom 数组,会自动增加 margin-right
144
- */
145
- toolBarBtn: {
146
- type: [Object, Function, Boolean, Array],
147
- default: () => {
148
- }
139
+ actionProps: {
140
+ type: Object,
141
+ default: () => ({
142
+ placement: "right"
143
+ })
149
144
  },
150
145
  // 表格标题
151
146
  headerTitle: {
@@ -174,21 +169,6 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
174
169
  type: [Object, Boolean],
175
170
  default: !1
176
171
  },
177
- /**
178
- * @Author gx12358
179
- * @DateTime 2022/2/8
180
- * @lastTime 2022/2/8
181
- * @description 列状态配置,可以配置是否浮动和是否展示
182
- */
183
- columnsState: {
184
- type: Object
185
- },
186
- // table 工具栏 额外的元素
187
- optionsExtra: {
188
- type: [Function, Object, Array],
189
- default: () => {
190
- }
191
- },
192
172
  /**
193
173
  * @Author gx12358
194
174
  * @DateTime 2022/2/8
@@ -318,9 +298,8 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
318
298
  onSizeChange: Function,
319
299
  onLoadingChange: Function,
320
300
  onRequestError: Function,
321
- onBeforeSearchSubmit: Function,
322
- onColumnsStateChange: Function
323
- }, Zl = /* @__PURE__ */ te({
301
+ onBeforeSearchSubmit: Function
302
+ }, Fa = /* @__PURE__ */ Te({
324
303
  name: "RequestSelect",
325
304
  props: {
326
305
  fetch: Function,
@@ -339,55 +318,55 @@ const Ul = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
339
318
  }
340
319
  },
341
320
  setup(e, {
342
- slots: a
321
+ slots: l
343
322
  }) {
344
- const l = P([]), n = P(e.loading ?? !1), u = P("init"), o = Dl(e.fetch, e.debounceTime || 10);
323
+ const a = O([]), n = O(e.loading ?? !1), s = O("init"), u = fa(e.fetch, e.debounceTime || 10);
345
324
  return z([() => e.fetch, () => e.manual], () => {
346
- if (u.value !== "init" && n.value) return;
325
+ if (s.value !== "init" && n.value) return;
347
326
  const d = e.manual ?? !1;
348
- e.fetch && !d && (n.value = !0, o().then((h) => {
349
- l.value = Ot(h), u.value = "success";
327
+ e.fetch && !d && (n.value = !0, u().then((h) => {
328
+ a.value = xt(h), s.value = "success";
350
329
  }).catch((h) => {
351
- console.error(h), u.value = "error";
330
+ console.error(h), s.value = "error";
352
331
  }).finally(() => {
353
332
  n.value = !1;
354
333
  }));
355
334
  }, {
356
335
  immediate: !0
357
336
  }), () => {
358
- const d = a.default?.();
359
- return He(H(d) ? d[0] : d, {
360
- options: l.value,
337
+ const d = l.default?.();
338
+ return Qe(L(d) ? d[0] : d, {
339
+ options: a.value,
361
340
  notFoundContent: e.notFoundContent?.(n.value)
362
341
  });
363
342
  };
364
343
  }
365
344
  });
366
- function ea(e, a) {
367
- const l = pe({});
345
+ function Pa(e, l) {
346
+ const a = Oe({});
368
347
  function n() {
369
348
  Object.keys(e).forEach((d) => {
370
- u(d, e[d]);
349
+ s(d, e[d]);
371
350
  });
372
- const o = a.find((d) => d.valueType === "dateRange");
373
- o && u(o.name || "", e[o.rangeStartName || "start"] ? [
374
- e[o.rangeStartName || "start"],
375
- e[o.rangeEndName || "end"]
351
+ const u = l.find((d) => d.valueType === "dateRange");
352
+ u && s(u.name || "", e[u.rangeStartName || "start"] ? [
353
+ e[u.rangeStartName || "start"],
354
+ e[u.rangeEndName || "end"]
376
355
  ] : []);
377
356
  }
378
- ze(() => {
357
+ dt(() => {
379
358
  n();
380
359
  });
381
- function u(o, d) {
382
- l[o] = d;
360
+ function s(u, d) {
361
+ a[u] = d;
383
362
  }
384
363
  return {
385
- formState: l,
364
+ formState: a,
386
365
  resetFormState: n,
387
- changeFormState: u
366
+ changeFormState: s
388
367
  };
389
368
  }
390
- const ta = (e) => ({
369
+ const Da = (e) => ({
391
370
  [`${e.componentCls}-search`]: {
392
371
  position: "relative",
393
372
  display: "flex",
@@ -473,7 +452,7 @@ const ta = (e) => ({
473
452
  justifyContent: "center",
474
453
  alignItems: "center"
475
454
  }
476
- }), Ue = [
455
+ }), qe = [
477
456
  { value: "xxl", span: 4 },
478
457
  { value: "xl", span: 3 },
479
458
  { value: "lg", span: 2 },
@@ -481,871 +460,447 @@ const ta = (e) => ({
481
460
  { value: "sm", span: 2 },
482
461
  { value: "xs", span: 1 }
483
462
  ];
484
- function ve(e, a) {
485
- return typeof a == "function" ? a(q(e)) : q(e).format(a);
463
+ function ce(e, l) {
464
+ return typeof l == "function" ? l(W(e)) : W(e).format(l);
486
465
  }
487
- function Ie(e, a) {
488
- return a ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
466
+ function Fe(e, l) {
467
+ return l ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
489
468
  }
490
- const St = (e, a, l = "string") => {
491
- if (H(e)) {
492
- const [n, u] = e;
493
- let o, d;
494
- if (Array.isArray(a) ? (o = a[0], d = a[1]) : typeof a == "object" && a.type === "mask" ? (o = a.format, d = a.format) : (o = a, d = a), l === "string") {
495
- const h = n ? ve(n, o) : "", x = u ? ve(u, d) : "";
496
- return [h, x];
469
+ const ct = (e, l, a = "string") => {
470
+ if (L(e)) {
471
+ const [n, s] = e;
472
+ let u, d;
473
+ if (Array.isArray(l) ? (u = l[0], d = l[1]) : typeof l == "object" && l.type === "mask" ? (u = l.format, d = l.format) : (u = l, d = l), a === "string") {
474
+ const h = n ? ce(n, u) : "", y = s ? ce(s, d) : "";
475
+ return [h, y];
497
476
  }
498
- return [q(n), q(u)];
477
+ return [W(n), W(s)];
499
478
  }
500
479
  };
501
- function la(e) {
502
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !X(e);
480
+ function Oa(e) {
481
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !V(e);
503
482
  }
504
483
  const {
505
- useBreakpoint: aa
506
- } = nt, {
507
- MonthPicker: na,
508
- RangePicker: oa,
509
- YearPicker: sa,
510
- WeekPicker: ia,
511
- QuarterPicker: ua
512
- } = It;
513
- function ra(e) {
514
- let a = e.reduce((l, n) => n.order !== void 0 ? Math.max(l, n.order) : l, 0);
515
- return e.forEach((l) => {
516
- l.order === void 0 && (a += 1, l.order = a);
517
- }), e.sort((l, n) => l.order - n.order), e;
484
+ useBreakpoint: Ba
485
+ } = va, {
486
+ MonthPicker: Ia,
487
+ RangePicker: ja,
488
+ YearPicker: Aa,
489
+ WeekPicker: Na,
490
+ QuarterPicker: za
491
+ } = Ct;
492
+ function Ya(e) {
493
+ let l = e.reduce((a, n) => n.order !== void 0 ? Math.max(a, n.order) : a, 0);
494
+ return e.forEach((a) => {
495
+ a.order === void 0 && (l += 1, a.order = l);
496
+ }), e.sort((a, n) => a.order - n.order), e;
518
497
  }
519
- const ca = {
520
- modal: re.modalScroll,
498
+ const Ma = {
499
+ modalScroll: be.modalScroll,
521
500
  searchMap: {
522
501
  type: Array,
523
502
  default: () => []
524
503
  },
525
- loading: re.loading,
526
- cardBordered: re.cardBordered,
504
+ loading: be.loading,
505
+ cardBordered: be.cardBordered,
527
506
  prefixCls: String,
528
- defaultParams: Object,
507
+ defaultState: Object,
529
508
  onSearch: Function
530
- }, jt = /* @__PURE__ */ te({
509
+ }, Ea = /* @__PURE__ */ Te({
531
510
  name: "ProTableForm",
532
- props: ca,
511
+ inheritAttrs: !1,
512
+ props: Ma,
533
513
  setup(e, {
534
- slots: a,
535
- expose: l
514
+ slots: l,
515
+ expose: a
536
516
  }) {
537
517
  const {
538
518
  wrapSSR: n,
539
- hashId: u
540
- } = qe("ProTableForm", [ta], e.prefixCls), o = Rt(), d = aa(), {
541
- manualSearch: h,
542
- searchConfig: x,
543
- searchActions: T
544
- } = de(), {
545
- formState: i,
546
- resetFormState: y,
547
- changeFormState: c
548
- } = ea(e.defaultParams || {}, e.searchMap || []), m = P(x.value?.collapsed ?? x.value?.defaultCollapsed), b = C(() => Z(T.value?.reset) ? T.value?.reset : h.value), v = C(() => k(x.value?.span)), F = C(() => x.value?.label);
549
- z(() => x.value?.collapsed, (t) => {
550
- m.value = t;
519
+ hashId: s
520
+ } = Xe("ProTableForm", [Da], e.prefixCls), u = mt(), d = Ba(), {
521
+ autoRequest: h,
522
+ searchConfig: y,
523
+ searchActions: P
524
+ } = _e(), {
525
+ formState: o,
526
+ resetFormState: R,
527
+ changeFormState: v
528
+ } = Pa(e.defaultState || {}, e.searchMap || []), f = O(y.value?.collapsed ?? y.value?.defaultCollapsed), p = S(() => de(P.value?.reset) ? P.value?.reset : !h.value), w = S(() => K(y.value?.span)), F = S(() => y.value?.label);
529
+ z(() => y.value?.collapsed, (t) => {
530
+ f.value = t;
551
531
  });
552
- function k(t) {
553
- let f = 4;
554
- for (let R = 0; R < Ue.length; R += 1) {
555
- const $ = Ue[R].value;
556
- if (d.value[$]) {
557
- f = t?.[$] || (e.modal ? 3 : Ue[R].span);
532
+ function K(t) {
533
+ let r = 4;
534
+ for (let C = 0; C < qe.length; C += 1) {
535
+ const b = qe[C].value;
536
+ if (d.value[b]) {
537
+ r = t?.[b] || (e.modalScroll ? 3 : qe[C].span);
558
538
  break;
559
539
  }
560
540
  }
561
- return f;
541
+ return r;
562
542
  }
563
- const I = (t) => {
564
- m.value = t;
565
- }, M = (t, f, R) => (t + 1) % f === 0 ? {
566
- ...R,
543
+ const le = (t) => {
544
+ f.value = t;
545
+ }, fe = (t, r, C) => (t + 1) % r === 0 ? {
546
+ ...C,
567
547
  marginRight: 0
568
548
  } : {
569
- ...R,
549
+ ...C,
570
550
  marginRight: "2%"
571
- }, Y = () => {
572
- const t = Ot(i), f = e.searchMap.find((w) => w.valueType === "text") || "", R = e.searchMap.find((w) => w.valueType === "dateRange") || "", $ = e.searchMap.find((w) => w.valueType === "treeSelect");
573
- return f && (t[f.name] = i[f.name] || f.initialValue || ""), R && (t[R.rangeStartName || "start"] = t[R.name] ? t[R.name][0] : "", t[R.rangeEndName || "end"] = t[R.name] ? t[R.name][1] : "", delete t[R.name]), $ && ($?.name && H(i[$?.name]) && (t[$.name] = i[$.name].length ? i[$.name].map((w) => w[$.valueKey === "text" ? "label" : "value"]).join() : ""), $?.name && H(t[$?.name]) && (t[$.name] = t[$.name].length ? t[$.name].map((w) => w[$.valueKey === "text" ? "label" : "value"]) : "")), t;
574
- }, L = (t = !1, f) => {
575
- (!h.value || t) && e.onSearch?.(Y(), t ? f ? "reset" : "submit" : void 0);
576
- }, O = (t, f, R) => {
577
- const $ = i[f.name || ""];
578
- switch (f.valueType) {
551
+ }, oe = () => {
552
+ const t = xt(o), r = e.searchMap.find((g) => g.valueType === "text") || "", C = e.searchMap.find((g) => g.valueType === "dateRange") || "", b = e.searchMap.find((g) => g.valueType === "treeSelect");
553
+ return r && (t[r.name] = o[r.name] || r.initialValue || ""), C && (t[C.rangeStartName || "start"] = t[C.name] ? t[C.name][0] : "", t[C.rangeEndName || "end"] = t[C.name] ? t[C.name][1] : "", delete t[C.name]), b && (b?.name && L(o[b?.name]) && (t[b.name] = o[b.name].length ? o[b.name].map((g) => g[b.valueKey === "text" ? "label" : "value"]).join() : ""), b?.name && L(t[b?.name]) && (t[b.name] = t[b.name].length ? t[b.name].map((g) => g[b.valueKey === "text" ? "label" : "value"]) : "")), t;
554
+ }, G = (t = !1, r) => {
555
+ (h.value || t) && e.onSearch?.(oe(), t ? r ? "reset" : "submit" : void 0);
556
+ }, I = (t, r, C) => {
557
+ const b = o[r.name || ""];
558
+ switch (r.valueType) {
579
559
  case "text":
580
- c(f.name || "", t || "");
560
+ v(r.name || "", t || "");
581
561
  break;
582
562
  case "number":
583
- c(f.name || "", t || void 0);
563
+ v(r.name || "", t || void 0);
584
564
  break;
585
565
  case "numberRange":
586
- Me(R?.key) && ($[R.key] = t, c(f.name || "", $ || []));
566
+ Be(C?.key) && (b[C.key] = t, v(r.name || "", b || []));
587
567
  break;
588
568
  case "select":
589
- c(f.name || "", t ?? void 0);
569
+ v(r.name || "", t ?? void 0);
590
570
  break;
591
571
  case "treeSelect":
592
- c(f.name || "", t ?? (f.field?.treeCheckable || f.field?.multiple ? [] : null));
572
+ v(r.name || "", t ?? (r.field?.treeCheckable || r.field?.multiple ? [] : null));
593
573
  break;
594
574
  case "date":
595
- c(f.name || "", t ? ve(t, Ie(f.valueFormat, f.showTime)) : null);
575
+ v(r.name || "", t ? ce(t, Fe(r.valueFormat, r.showTime)) : null);
596
576
  break;
597
577
  case "dateWeek":
598
- c(f.name || "", t ? ve(t, "YYYY-wo") : null);
578
+ v(r.name || "", t ? ce(t, "YYYY-wo") : null);
599
579
  break;
600
580
  case "dateMonth":
601
- c(f.name || "", t ? ve(t, "YYYY-MM") : null);
581
+ v(r.name || "", t ? ce(t, "YYYY-MM") : null);
602
582
  break;
603
583
  case "dateQuarter":
604
- c(f.name || "", t ? ve(t, "YYYY-QQ") : null);
584
+ v(r.name || "", t ? ce(t, "YYYY-QQ") : null);
605
585
  break;
606
586
  case "dateYear":
607
- c(f.name || "", t ? ve(t, "YYYY") : null);
587
+ v(r.name || "", t ? ce(t, "YYYY") : null);
608
588
  break;
609
589
  case "dateRange":
610
- c(f.name || "", t && H(t) && t.length === 2 ? St(t, Ie(f.valueFormat, f.showTime)) : null);
590
+ v(r.name || "", t && L(t) && t.length === 2 ? ct(t, Fe(r.valueFormat, r.showTime)) : null);
611
591
  break;
612
592
  case "time":
613
- c(f.name || "", t ? ve(t, f.valueFormat || "HH:mm:ss") : null);
593
+ v(r.name || "", t ? ce(t, r.valueFormat || "HH:mm:ss") : null);
614
594
  break;
615
595
  }
616
- f.valueType === "treeSelect" || f.valueType, L();
617
- }, N = (t = !0) => {
618
- y(), L(!0, t);
596
+ r.valueType === "treeSelect" || r.valueType, G();
597
+ }, ue = (t = !0) => {
598
+ R(), G(!0, t);
619
599
  };
620
- l({
621
- getFormState: () => Y(),
622
- resetForm: N
600
+ a({
601
+ getFormState: () => oe(),
602
+ resetForm: ue
623
603
  });
624
- const j = () => {
625
- const t = o?.emptyText?.value;
604
+ const A = () => {
605
+ const t = u?.emptyText?.value;
626
606
  if (t) {
627
- const f = X(t), R = f ? Tt(t) : Ft(t || []);
628
- return s("div", {
629
- class: ue(`${e.prefixCls}-search-empty-text`, u.value)
630
- }, [f ? R : H(R) ? R.map(($) => He($)) : void 0]);
607
+ const r = V(t), C = r ? ft(t) : ht(t || []);
608
+ return c("div", {
609
+ class: Z(`${e.prefixCls}-search-empty-text`, s.value)
610
+ }, [r ? C : L(C) ? C.map((b) => Qe(b)) : void 0]);
631
611
  }
632
- }, J = () => (h.value || b.value) && s(ge, null, {
633
- default: () => [b.value && s(Ct, {
634
- onClick: () => N()
612
+ }, U = () => (!h.value || p.value) && c(ut, null, {
613
+ default: () => [p.value && c(st, {
614
+ onClick: () => ue()
635
615
  }, {
636
- default: () => [T.value?.resetText || "重置"]
637
- }), h.value && s(Ct, {
616
+ default: () => [P.value?.resetText || "重置"]
617
+ }), !h.value && c(st, {
638
618
  loading: e.loading,
639
619
  type: "primary",
640
- onClick: () => L(!0)
620
+ onClick: () => G(!0)
641
621
  }, {
642
- default: () => [T.value?.searchText || "查询"]
622
+ default: () => [P.value?.searchText || "查询"]
643
623
  })]
644
- }), le = ({
624
+ }), ne = ({
645
625
  formItemStyle: t,
646
- collapsed: f,
647
- collapseRender: R = !0
648
- }) => s("div", {
626
+ collapsed: r,
627
+ collapseRender: C = !0
628
+ }) => c("div", {
649
629
  style: t,
650
- class: `${e.prefixCls}-search-collapse-buttons ${u.value}`
651
- }, [s(ge, {
630
+ class: `${e.prefixCls}-search-collapse-buttons ${s.value}`
631
+ }, [c(ut, {
652
632
  size: 16
653
633
  }, {
654
- default: () => [J(), x.value?.collapseRender !== !1 && R && s(De, null, [typeof x.value?.collapseRender == "function" ? x.value?.collapseRender(f) : s("span", {
655
- class: `${e.prefixCls}-a ${u.value}`,
656
- onClick: () => I(!f)
657
- }, [f ? "收起" : "展开", f ? s(cl, null, null) : s(dl, null, null)])])]
634
+ default: () => [U(), y.value?.collapseRender !== !1 && C && c(Ye, null, [typeof y.value?.collapseRender == "function" ? y.value?.collapseRender(r) : c("span", {
635
+ class: `${e.prefixCls}-a ${s.value}`,
636
+ onClick: () => le(!r)
637
+ }, [r ? "收起" : "展开", r ? c(Vt, null, null) : c(Kt, null, null)])])]
658
638
  })]);
659
- function ae(t) {
660
- return t === void 0 ? void 0 : t ? s(At, {
639
+ function J(t) {
640
+ return t === void 0 ? void 0 : t ? c(St, {
661
641
  size: "small",
662
- indicator: o?.indicator?.value
663
- }, null) : j();
642
+ indicator: u?.indicator?.value
643
+ }, null) : A();
664
644
  }
665
- function ee(t, f) {
666
- return s(Zl, E(t.request, {
645
+ function ee(t, r) {
646
+ return c(Fa, M(t.request, {
667
647
  loading: t.loading,
668
- notFoundContent: ae
669
- }), la(f) ? f : {
670
- default: () => [f]
648
+ notFoundContent: J
649
+ }), Oa(r) ? r : {
650
+ default: () => [r]
671
651
  });
672
652
  }
673
- const ye = (t) => {
674
- let f;
675
- const R = h.value ? Ye : Ye.Search, $ = Ee(t.field || {}, "rules");
676
- let w = null;
653
+ const me = (t) => {
654
+ let r;
655
+ const C = h.value ? Ne.Search : Ne, b = Le(t.field || {}, "rules");
656
+ let g = null;
677
657
  switch (t.valueType) {
678
658
  case "text":
679
- f = s(R, E({
659
+ r = c(C, M({
680
660
  style: {
681
661
  width: "100%"
682
662
  },
683
- value: i[t.name],
663
+ value: o[t.name],
684
664
  placeholder: t.placeholder || "请输入",
685
665
  allowClear: t.allowClear ?? !0,
686
- onChange: (r) => O(r.target.value, t),
687
- onSearch: (r) => L()
688
- }, $), null);
666
+ onChange: (i) => I(i.target.value, t),
667
+ onSearch: (i) => G()
668
+ }, b), null);
689
669
  break;
690
670
  case "number":
691
- f = s(Xe, E({
671
+ r = c(He, M({
692
672
  style: {
693
673
  width: "100%"
694
674
  },
695
- value: i[t.name],
675
+ value: o[t.name],
696
676
  placeholder: t.placeholder || "请输入",
697
- onChange: (r) => O(r, t)
698
- }, $), null);
677
+ onChange: (i) => I(i, t)
678
+ }, b), null);
699
679
  break;
700
680
  case "numberRange":
701
- f = s(Ye.Group, {
681
+ r = c(Ne.Group, {
702
682
  compact: !0,
703
- class: ue(u.value, `${e.prefixCls}-search-input-compact`)
683
+ class: Z(s.value, `${e.prefixCls}-search-input-compact`)
704
684
  }, {
705
- default: () => [s(Xe, {
706
- value: i[t.name]?.[0],
707
- onChange: (r) => O(r, t, {
685
+ default: () => [c(He, {
686
+ value: o[t.name]?.[0],
687
+ onChange: (i) => I(i, t, {
708
688
  key: 0
709
689
  }),
710
- placeholder: H(t.placeholder) && t.placeholder?.[0] || "请输入"
711
- }, null), s(Ye, {
690
+ placeholder: L(t.placeholder) && t.placeholder?.[0] || "请输入"
691
+ }, null), c(Ne, {
712
692
  disabled: !0,
713
693
  placeholder: "~"
714
- }, null), s(Xe, {
715
- value: i[t.name]?.[1],
716
- onChange: (r) => O(r, t, {
694
+ }, null), c(He, {
695
+ value: o[t.name]?.[1],
696
+ onChange: (i) => I(i, t, {
717
697
  key: 1
718
698
  }),
719
- placeholder: H(t.placeholder) && t.placeholder?.[1] || "请输入"
699
+ placeholder: L(t.placeholder) && t.placeholder?.[1] || "请输入"
720
700
  }, null)]
721
701
  });
722
702
  break;
723
703
  case "select":
724
- w = s(El, E({
704
+ g = c(ga, M({
725
705
  style: {
726
706
  width: "100%"
727
707
  },
728
- value: t.loading ? void 0 : i[t.name],
708
+ value: t.loading ? void 0 : o[t.name],
729
709
  optionFilterProp: "label",
730
710
  placeholder: t.placeholder || "请选择",
731
711
  showSearch: t.showSearch,
732
712
  allowClear: t.allowClear ?? !0,
733
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
734
- notFoundContent: ae(t.loading),
735
- onChange: (r) => O(r, t),
713
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
714
+ notFoundContent: J(t.loading),
715
+ onChange: (i) => I(i, t),
736
716
  options: t.loading ? [] : t?.valueEnum || []
737
- }, $), null);
717
+ }, b), null);
738
718
  break;
739
719
  case "treeSelect":
740
- w = s(Ml, E({
720
+ g = c(pa, M({
741
721
  style: {
742
722
  width: "100%"
743
723
  },
744
- value: i[t.name],
724
+ value: o[t.name],
745
725
  placeholder: t.placeholder || "请选择",
746
726
  allowClear: t.allowClear ?? !0,
747
727
  treeData: t.loading ? [] : t.valueEnum || [],
748
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
749
- notFoundContent: ae(t.loading),
750
- onChange: (r) => O(r, t)
751
- }, $), null);
728
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
729
+ notFoundContent: J(t.loading),
730
+ onChange: (i) => I(i, t)
731
+ }, b), null);
752
732
  break;
753
733
  case "date":
754
- f = s(It, E({
734
+ r = c(Ct, M({
755
735
  style: {
756
736
  width: "100%"
757
737
  },
758
- value: i[t.name] ? q(i[t.name]) : void 0,
759
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
738
+ value: o[t.name] ? W(o[t.name]) : void 0,
739
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
760
740
  placeholder: t.placeholder || "请选择",
761
741
  allowClear: t.allowClear ?? !0,
762
- format: Ie(t.valueFormat, t.showTime),
742
+ format: Fe(t.valueFormat, t.showTime),
763
743
  showTime: t.showTime,
764
744
  showToday: t.showToday || !0,
765
- onChange: (r) => O(r, t)
766
- }, $), null);
745
+ onChange: (i) => I(i, t)
746
+ }, b), null);
767
747
  break;
768
748
  case "dateWeek":
769
- f = s(ia, E({
749
+ r = c(Na, M({
770
750
  style: {
771
751
  width: "100%"
772
752
  },
773
- value: i[t.name] ? q(i[t.name], t.valueFormat || "YYYY-wo") : void 0,
774
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
753
+ value: o[t.name] ? W(o[t.name], t.valueFormat || "YYYY-wo") : void 0,
754
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
775
755
  allowClear: t.allowClear ?? !0,
776
756
  placeholder: t.placeholder || "请选择",
777
- onChange: (r) => O(r, t)
778
- }, $), null);
757
+ onChange: (i) => I(i, t)
758
+ }, b), null);
779
759
  break;
780
760
  case "dateMonth":
781
- f = s(na, E({
761
+ r = c(Ia, M({
782
762
  style: {
783
763
  width: "100%"
784
764
  },
785
- value: i[t.name] ? q(i[t.name], t.valueFormat || "YYYY-MM") : void 0,
786
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
765
+ value: o[t.name] ? W(o[t.name], t.valueFormat || "YYYY-MM") : void 0,
766
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
787
767
  allowClear: t.allowClear ?? !0,
788
768
  placeholder: t.placeholder || "请选择",
789
- onChange: (r) => O(r, t)
790
- }, $), null);
769
+ onChange: (i) => I(i, t)
770
+ }, b), null);
791
771
  break;
792
772
  case "dateQuarter":
793
- f = s(ua, E({
773
+ r = c(za, M({
794
774
  style: {
795
775
  width: "100%"
796
776
  },
797
- value: i[t.name] ? q(i[t.name], t.valueFormat || "YYYY-QQ") : void 0,
798
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
777
+ value: o[t.name] ? W(o[t.name], t.valueFormat || "YYYY-QQ") : void 0,
778
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
799
779
  allowClear: t.allowClear ?? !0,
800
780
  placeholder: t.placeholder || "请选择",
801
- onChange: (r) => O(r, t)
802
- }, $), null);
781
+ onChange: (i) => I(i, t)
782
+ }, b), null);
803
783
  break;
804
784
  case "dateYear":
805
- f = s(sa, E({
785
+ r = c(Aa, M({
806
786
  style: {
807
787
  width: "100%"
808
788
  },
809
- value: i[t.name] ? q(i[t.name], t.valueFormat || "YYYY") : void 0,
810
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
789
+ value: o[t.name] ? W(o[t.name], t.valueFormat || "YYYY") : void 0,
790
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
811
791
  allowClear: t.allowClear ?? !0,
812
792
  placeholder: t.placeholder || "请选择",
813
- onChange: (r) => O(r, t)
814
- }, $), null);
793
+ onChange: (i) => I(i, t)
794
+ }, b), null);
815
795
  break;
816
796
  case "dateRange":
817
- f = s(oa, E({
797
+ r = c(ja, M({
818
798
  style: {
819
799
  width: "100%"
820
800
  },
821
- value: i[t.name] && H(i[t.name]) && i[t.name]?.length === 2 ? St(i[t.name], Ie(t.valueFormat, t.showTime), "dayjs") : void 0,
822
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
801
+ value: o[t.name] && L(o[t.name]) && o[t.name]?.length === 2 ? ct(o[t.name], Fe(t.valueFormat, t.showTime), "dayjs") : void 0,
802
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
823
803
  placeholder: t.placeholder || ["开始日期", "结束日期"],
824
- format: Ie(t.valueFormat, t.showTime),
804
+ format: Fe(t.valueFormat, t.showTime),
825
805
  showTime: t.showTime,
826
- onChange: (r) => O(r, t)
827
- }, $), null);
806
+ onChange: (i) => I(i, t)
807
+ }, b), null);
828
808
  break;
829
809
  case "time":
830
- f = s(Nl, E({
810
+ r = c(ha, M({
831
811
  style: {
832
812
  width: "100%"
833
813
  },
834
- value: i[t.name] ? q(i[t.name], t.valueFormat || "HH:mm:ss") : void 0,
835
- getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
814
+ value: o[t.name] ? W(o[t.name], t.valueFormat || "HH:mm:ss") : void 0,
815
+ getPopupContainer: (i) => i && i.parentNode ? i.parentNode : i,
836
816
  placeholder: t.placeholder || "请选择",
837
817
  allowClear: t.allowClear || t.allowClear === !1 ? t.allowClear : !0,
838
818
  use12Hours: t.use12Hours,
839
819
  format: t.valueFormat || "HH:mm:ss",
840
- onChange: (r) => O(r, t)
841
- }, $), null);
820
+ onChange: (i) => I(i, t)
821
+ }, b), null);
842
822
  break;
843
823
  }
844
- return t.valueType && ["select", "treeSelect"].includes(t.valueType) && (f = t.request ? ee(t, w) : w), f;
845
- }, fe = ({
824
+ return t.valueType && ["select", "treeSelect"].includes(t.valueType) && (r = t.request ? ee(t, g) : g), r;
825
+ }, ve = ({
846
826
  formItemStyle: t = {},
847
- item: f
827
+ item: r
848
828
  }) => {
849
- const R = X(f) ? f.props?.label : f.label, $ = (X(f) ? f.props?.labelWidth : f.labelWidth) || F.value?.width, w = (X(f) ? f.props?.labelAlign : f.labelAlign) || F.value?.align;
850
- return s("div", {
829
+ const C = V(r) ? r.props?.label : r.label, b = (V(r) ? r.props?.labelWidth : r.labelWidth) || F.value?.width, g = (V(r) ? r.props?.labelAlign : r.labelAlign) || F.value?.align;
830
+ return c("div", {
851
831
  class: `${e.prefixCls}-search-item`,
852
832
  style: {
853
833
  ...t,
854
- gap: F.value?.gap ? yt(F.value?.gap) : void 0
834
+ gap: F.value?.gap ? it(F.value?.gap) : void 0
855
835
  }
856
- }, [R && s("div", {
857
- class: ue(`${e.prefixCls}-search-item-label`, F.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, w && `${e.prefixCls}-search-item-label-${w}`),
836
+ }, [C && c("div", {
837
+ class: Z(`${e.prefixCls}-search-item-label`, F.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, g && `${e.prefixCls}-search-item-label-${g}`),
858
838
  style: {
859
- width: $ ? yt($) : void 0
839
+ width: b ? it(b) : void 0
860
840
  }
861
- }, [R]), s("div", {
862
- class: ue(`${e.prefixCls}-search-item-children`)
863
- }, [X(f) ? f : ye(f)])]);
864
- }, $e = () => {
865
- let t = a.default?.() || [];
841
+ }, [C]), c("div", {
842
+ class: Z(`${e.prefixCls}-search-item-children`)
843
+ }, [V(r) ? r : me(r)])]);
844
+ }, Q = () => {
845
+ let t = l.default?.() || [];
866
846
  t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
867
- const f = ra([...e.searchMap, ...t.map(($) => ({
868
- ...$,
869
- order: $.props?.order || void 0
870
- }))]), R = {
871
- width: `${(100 - (v.value - 1) * 2) / v.value}%`
847
+ const r = Ya([...e.searchMap, ...t.map((b) => ({
848
+ ...b,
849
+ order: b.props?.order || void 0
850
+ }))]), C = {
851
+ width: `${(100 - (w.value - 1) * 2) / w.value}%`
872
852
  };
873
- return f.map(($, w) => {
874
- const r = M(w, v.value, R);
875
- return f.length < v.value || m.value ? s(De, null, [fe({
876
- formItemStyle: r,
877
- item: $
878
- }), w === f.length - 1 && le({
853
+ return r.map((b, g) => {
854
+ const i = fe(g, w.value, C);
855
+ return r.length < w.value || f.value ? c(Ye, null, [ve({
856
+ formItemStyle: i,
857
+ item: b
858
+ }), g === r.length - 1 && ne({
879
859
  formItemStyle: {
880
860
  flex: 1,
881
861
  justifyContent: "flex-end"
882
862
  },
883
- collapsed: m.value,
884
- collapseRender: !!m.value
885
- })]) : s(De, null, [w < v.value - 1 && fe({
886
- formItemStyle: r,
887
- item: $
888
- }), w === v.value - 1 && (v.value - 1 === 0 || f.length === v.value) && fe({
889
- formItemStyle: r,
890
- item: $
891
- }), w === v.value - 1 && f.length >= v.value && le({
863
+ collapsed: f.value,
864
+ collapseRender: !!f.value
865
+ })]) : c(Ye, null, [g < w.value - 1 && ve({
866
+ formItemStyle: i,
867
+ item: b
868
+ }), g === w.value - 1 && (w.value - 1 === 0 || r.length === w.value) && ve({
869
+ formItemStyle: i,
870
+ item: b
871
+ }), g === w.value - 1 && r.length >= w.value && ne({
892
872
  formItemStyle: {
893
873
  flex: 1,
894
874
  justifyContent: "flex-end"
895
875
  },
896
876
  collapsed: !1,
897
- collapseRender: f.length !== v.value
877
+ collapseRender: r.length !== w.value
898
878
  })]);
899
879
  });
900
880
  };
901
881
  return () => {
902
882
  const t = e.cardBordered && `${e.prefixCls}-search-border`;
903
- return n(s("div", {
904
- class: ue(u.value, `${e.prefixCls}-search`, t, u.value, x.value?.className)
905
- }, [$e()]));
883
+ return n(c("div", {
884
+ class: Z(s.value, `${e.prefixCls}-search`, t, s.value, y.value?.className)
885
+ }, [Q()]));
906
886
  };
907
887
  }
908
- });
909
- jt.inheritAttrs = !1;
910
- const Ne = (e) => {
911
- const a = P(null);
912
- return a.value = e, (...l) => a.value?.(...l);
913
- }, da = (e) => ({
914
- [`${e.componentCls}`]: {
915
- width: "auto",
916
- "&-title": {
917
- display: "flex",
918
- alignItems: "center",
919
- justifyContent: "space-between",
920
- height: 32
921
- },
922
- "&-overlay": {
923
- [`${e.antCls}-popover-inner-content`]: {
924
- width: "200px",
925
- paddingBlock: 0,
926
- paddingInline: 0,
927
- paddingBlockEnd: 8
928
- },
929
- [`${e.antCls}-tree-node-content-wrapper:hover`]: {
930
- backgroundColor: "transparent"
931
- },
932
- [`${e.antCls}-tree-draggable-icon`]: { cursor: "grab" },
933
- [`${e.antCls}-tree-switcher`]: { display: "none" },
934
- [`${e.antCls}-tree-treenode`]: {
935
- alignItems: "center",
936
- "&:hover": {
937
- [`${e.componentCls}-list-item-option`]: {
938
- display: "block"
939
- }
940
- },
941
- [`${e.antCls}-tree-checkbox`]: {
942
- marginInlineEnd: "4px",
943
- alignSelf: "flex-start"
944
- },
945
- [`${e.antCls}-tree-title`]: {
946
- width: "100%"
947
- }
948
- }
949
- }
950
- },
951
- [`${e.componentCls}-action-rest-button`]: {
952
- color: e.colorPrimary
953
- },
954
- [`${e.componentCls}-list`]: {
955
- display: "flex",
956
- flexDirection: "column",
957
- width: "100%",
958
- paddingBlockStart: 8,
959
- [`&${e.componentCls}-list-group`]: {
960
- paddingBlockStart: 0
961
- },
962
- "&-title": {
963
- marginBlockStart: "6px",
964
- marginBlockEnd: "6px",
965
- paddingInlineStart: "24px",
966
- color: e.colorTextSecondary,
967
- fontSize: "12px"
968
- },
969
- "&-item": {
970
- display: "flex",
971
- alignItems: "center",
972
- maxHeight: 24,
973
- justifyContent: "space-between",
974
- "&-title": {
975
- textOverflow: "ellipsis",
976
- overflow: "hidden",
977
- wordBreak: "break-all",
978
- whiteSpace: "nowrap"
979
- },
980
- "&-option": {
981
- display: "none",
982
- float: "right",
983
- cursor: "pointer",
984
- "> span": {
985
- "> span.anticon": {
986
- color: e.colorPrimary
987
- }
988
- },
989
- "> span + span": {
990
- marginInlineStart: 4
991
- }
992
- }
993
- }
994
- }
995
- }), Je = ({
996
- title: e,
997
- show: a,
998
- treeKey: l,
999
- fixed: n
1000
- }, {
1001
- slots: u
1002
- }) => {
1003
- const {
1004
- cacheColumns: o,
1005
- settingsAction: d
1006
- } = de();
1007
- return a ? s(ce, {
1008
- title: e
1009
- }, {
1010
- default: () => [s("span", {
1011
- onClick: (h) => {
1012
- h.stopPropagation(), h.preventDefault();
1013
- const x = p(o)?.find((c) => c.uuid === l)?.key || "", T = d?.columnsMap[x] || {};
1014
- if (typeof T.disable == "boolean" ? T.disable : T.disable?.icon) return;
1015
- const y = {
1016
- ...d?.columnsMap,
1017
- [x]: {
1018
- ...T,
1019
- fixed: n
1020
- }
1021
- };
1022
- d?.setColumnsMap(y, "fixed");
1023
- }
1024
- }, [u.default?.()])]
1025
- }) : null;
1026
- }, fa = /* @__PURE__ */ te({
1027
- props: {
1028
- treeKey: String,
1029
- hashId: String,
1030
- className: String,
1031
- title: [String, Function, Object, Boolean],
1032
- autoScroll: [Boolean],
1033
- fixed: [Boolean, String]
1034
- },
1035
- setup(e) {
1036
- const {
1037
- cacheColumns: a
1038
- } = de(), l = C(() => p(a)?.find((u) => u.uuid === e.treeKey)?.key || ""), n = C(() => l.value === "action" && e.autoScroll);
1039
- return () => {
1040
- const u = s("span", {
1041
- class: [`${e.className}-list-item-option`, e.hashId]
1042
- }, [s(Je, {
1043
- treeKey: e.treeKey || "",
1044
- fixed: "left",
1045
- title: "固定在列首",
1046
- show: e.fixed !== "left" && !n.value
1047
- }, {
1048
- default: () => [s(fl, null, null)]
1049
- }), s(Je, {
1050
- treeKey: e.treeKey || "",
1051
- fixed: void 0,
1052
- title: "不固定",
1053
- show: !!e.fixed && !n.value
1054
- }, {
1055
- default: () => [s(hl, null, null)]
1056
- }), s(Je, {
1057
- treeKey: e.treeKey || "",
1058
- fixed: "right",
1059
- title: "固定在列尾",
1060
- show: e.fixed !== "right"
1061
- }, {
1062
- default: () => [s(ml, null, null)]
1063
- })]);
1064
- return s("span", {
1065
- class: [`${e.className}-list-item`, e.hashId],
1066
- key: e.treeKey
1067
- }, [s("div", {
1068
- class: [`${e.className}-list-item-title`, e.hashId]
1069
- }, [e.title]), u]);
1070
- };
1071
- }
1072
- }), Ze = /* @__PURE__ */ te({
1073
- props: {
1074
- list: Array,
1075
- keys: Array,
1076
- hashId: String,
1077
- className: String,
1078
- title: String,
1079
- checkable: Boolean,
1080
- draggable: Boolean,
1081
- showTitle: {
1082
- type: Boolean,
1083
- default: !0
1084
- }
1085
- },
1086
- setup(e) {
1087
- const a = P(lt().uuid(15)), l = C(() => e.list && e.list.length > 0), n = P([]), u = P([]), {
1088
- cacheColumns: o,
1089
- slots: d,
1090
- settingsAction: h
1091
- } = de(), x = (c, m) => c.map(({
1092
- key: b,
1093
- children: v,
1094
- uuid: F,
1095
- ...k
1096
- }) => {
1097
- const I = h?.columnsMap[b || "null"] || {
1098
- show: !0
1099
- };
1100
- let M = !1;
1101
- I.show !== !1 && m?.show !== !1 && !v && (M = !0);
1102
- const Y = {
1103
- key: F || "",
1104
- ...Ee(k, ["dataIndex"]),
1105
- checked: M,
1106
- selectable: !1,
1107
- disabled: I.disable === !0,
1108
- disableCheckbox: typeof I.disable == "boolean" ? I.disable : I.disable?.checkbox,
1109
- isLeaf: !0
1110
- };
1111
- return v && (Y.children = x(v, I)), Y;
1112
- });
1113
- ze(() => {
1114
- const c = x(e.list || []);
1115
- n.value = c, u.value = c.filter((m) => m.checked).map((m) => m.key), h?.operationType.value === "fixed" && (a.value = lt().uuid(15));
1116
- });
1117
- const T = Ne((c, m, b) => {
1118
- const v = p(o).find((N) => N.uuid === c)?.key || "", F = p(o).find((N) => N.uuid === m)?.key || "", k = {
1119
- ...h?.columnsMap
1120
- }, I = [...h.sortKeyColumns.value], M = I.findIndex((N) => N === v), Y = I.findIndex((N) => N === F), L = b > M;
1121
- if (M < 0)
1122
- return;
1123
- const O = I[M];
1124
- I.splice(M, 1), b === 0 ? I.unshift(O) : I.splice(L ? Y : Y + 1, 0, O), I.forEach((N, j) => {
1125
- k[N] = {
1126
- ...k[N] || {},
1127
- order: j
1128
- };
1129
- }), h?.setColumnsMap(k, "drop"), h?.setSortKeyColumns(I);
1130
- }), i = Ne((c) => {
1131
- const m = c.node.key, b = p(o).find((I) => I.uuid === m)?.key || "", F = {
1132
- ...h?.columnsMap[b] || {}
1133
- };
1134
- F.show = c.checked;
1135
- const k = {
1136
- ...h?.columnsMap,
1137
- [b]: F
1138
- };
1139
- h?.setColumnsMap(k, "show");
1140
- }), y = (c) => {
1141
- const m = p(o).find((b) => b.uuid === c.key);
1142
- return c.title || al(d, "headerCell", {
1143
- title: m.title,
1144
- column: m
1145
- }, () => [m.title]);
1146
- };
1147
- return () => l.value ? s(De, null, [e.showTitle && s("span", {
1148
- class: [`${e.className}-list-title`, e.hashId]
1149
- }, [e.title]), s(Yl, {
1150
- key: a.value,
1151
- draggable: e.draggable && !!n.value?.length && n.value?.length > 1,
1152
- checkable: e.checkable,
1153
- blockNode: !0,
1154
- showLine: !1,
1155
- checkedKeys: u.value,
1156
- height: 280,
1157
- onDrop: (c) => {
1158
- const m = c.node.key, b = c.dragNode.key, {
1159
- dropPosition: v,
1160
- dropToGap: F
1161
- } = c, k = v === -1 || !F ? v + 1 : v;
1162
- T(b, m, k);
1163
- },
1164
- onCheck: (c, m) => i(m),
1165
- treeData: n.value
1166
- }, {
1167
- title: (c) => {
1168
- const m = {
1169
- ...c,
1170
- children: void 0,
1171
- title: y(c),
1172
- autoScroll: h?.autoScroll?.value
1173
- };
1174
- return s(fa, E({
1175
- hashId: e.hashId,
1176
- className: e.className
1177
- }, m, {
1178
- treeKey: m.key
1179
- }), null);
1180
- }
1181
- })]) : null;
1182
- }
1183
- }), ha = /* @__PURE__ */ te({
1184
- props: {
1185
- hashId: String,
1186
- className: String,
1187
- draggable: Boolean,
1188
- checkable: Boolean
1189
- },
1190
- setup(e) {
1191
- const {
1192
- columns: a
1193
- } = de(), l = P([]), n = P([]), u = P([]), o = P([]);
1194
- z(() => a.value, (x) => {
1195
- l.value = [], n.value = [], u.value = [], x.forEach((T) => {
1196
- if (T.hideInSetting)
1197
- return;
1198
- const {
1199
- fixed: i,
1200
- show: y,
1201
- uuid: c
1202
- } = T;
1203
- if ((y || y === void 0) && c && o.value.push(c), i === "left") {
1204
- n.value.push(T);
1205
- return;
1206
- }
1207
- if (i === "right") {
1208
- l.value.push(T);
1209
- return;
1210
- }
1211
- u.value.push(T);
1212
- });
1213
- }, {
1214
- immediate: !0
1215
- });
1216
- const d = C(() => l.value && l.value.length > 0), h = C(() => n.value && n.value.length > 0);
1217
- return () => s("div", {
1218
- class: {
1219
- [`${e.hashId}`]: !0,
1220
- [`${e.className}-list`]: !0,
1221
- [`${e.className}-list-group`]: d.value || h.value
1222
- }
1223
- }, [s(Ze, {
1224
- title: "固定在左侧",
1225
- list: n.value,
1226
- keys: o.value,
1227
- hashId: e.hashId,
1228
- draggable: e.draggable,
1229
- checkable: e.checkable,
1230
- className: e.className
1231
- }, null), s(Ze, {
1232
- list: u.value,
1233
- keys: o.value,
1234
- hashId: e.hashId,
1235
- draggable: e.draggable,
1236
- checkable: e.checkable,
1237
- title: "不固定",
1238
- showTitle: h.value || d.value,
1239
- className: e.className
1240
- }, null), s(Ze, {
1241
- title: "固定在右侧",
1242
- list: l.value,
1243
- keys: o.value,
1244
- hashId: e.hashId,
1245
- draggable: e.draggable,
1246
- checkable: e.checkable,
1247
- className: e.className
1248
- }, null)]);
1249
- }
1250
- }), ma = /* @__PURE__ */ te({
1251
- props: {
1252
- draggable: {
1253
- type: Boolean,
1254
- default: void 0
1255
- },
1256
- checkable: {
1257
- type: Boolean,
1258
- default: void 0
1259
- },
1260
- checkedReset: Boolean,
1261
- extra: [Function, Object, String, Boolean]
1262
- },
1263
- setup(e) {
1264
- const a = at({
1265
- suffixCls: "table-column-setting",
1266
- isPor: !0
1267
- }), {
1268
- wrapSSR: l,
1269
- hashId: n
1270
- } = qe("ColumnSetting", [da], a), {
1271
- columns: u,
1272
- settingsAction: o
1273
- } = de(), d = Ne((y = !0) => {
1274
- const c = {}, m = (b) => {
1275
- b.forEach(({
1276
- key: v,
1277
- fixed: F,
1278
- index: k,
1279
- children: I
1280
- }) => {
1281
- const M = Bt(v, k);
1282
- M && (c[M] = {
1283
- show: y,
1284
- fixed: F
1285
- }), I && m(I);
1286
- });
1287
- };
1288
- m(u.value), o?.setColumnsMap(c, "show");
1289
- }), h = Ne((y) => {
1290
- y.target.checked ? d() : d(!1);
1291
- }), x = Ne(() => {
1292
- o?.setColumnsMap(o?.cacheColumnsMap, "fixed");
1293
- }), T = C(() => (
1294
- // @ts-ignore
1295
- Object.values(o?.columnsMap).filter((y) => !y || y.show === !1)
1296
- )), i = C(() => p(T).length > 0 && p(T).length !== u.value.length);
1297
- return () => l(s(zl, {
1298
- arrowPointAtCenter: !0,
1299
- title: s("div", {
1300
- class: [`${a}-title`, n.value]
1301
- }, [s(Kl, {
1302
- indeterminate: i.value,
1303
- checked: p(T).length === 0 && p(T).length !== u.value.length,
1304
- onChange: (y) => h(y)
1305
- }, {
1306
- default: () => [je("列展示")]
1307
- }), e.checkedReset ? s("a", {
1308
- onClick: x,
1309
- class: [`${a}-action-rest-button`, n.value]
1310
- }, [je("重置")]) : null, e?.extra ? s(ge, {
1311
- size: 12,
1312
- align: "center"
1313
- }, {
1314
- default: () => [e.extra]
1315
- }) : null]),
1316
- overlayClassName: `${a}-overlay ${n.value}`,
1317
- trigger: "click",
1318
- placement: "bottomRight",
1319
- content: s(ha, {
1320
- hashId: n.value,
1321
- checkable: e.checkable ?? !0,
1322
- draggable: e.draggable ?? !0,
1323
- className: a
1324
- }, null)
1325
- }, {
1326
- default: () => [s(ce, {
1327
- title: "列设置"
1328
- }, {
1329
- default: () => [s($t, null, null)]
1330
- })]
1331
- }));
1332
- }
1333
- }), va = (e) => ({
888
+ }), La = (e) => ({
1334
889
  [`${e.componentCls}`]: {
1335
890
  lineHeight: 1,
1336
891
  "&-container": {
1337
892
  display: "flex",
1338
893
  alignItems: "center",
1339
894
  justifyContent: "space-between",
1340
- paddingBottom: e.paddingMD,
895
+ gap: e.padding,
896
+ paddingBottom: e.padding,
1341
897
  "&-mobile": {
1342
898
  flexDirection: "column",
1343
899
  flexWrap: "wrap",
1344
900
  alignItems: "flex-start",
1345
901
  [`${e.componentCls}-left`]: {
1346
902
  flexWrap: "wrap",
1347
- width: "100%",
1348
- marginBottom: 16
903
+ maxWidth: "100%"
1349
904
  },
1350
905
  [`${e.componentCls}-right`]: {
1351
906
  width: "100%"
@@ -1358,601 +913,538 @@ const Ne = (e) => {
1358
913
  justifyContent: "flex-start",
1359
914
  color: e.colorTextHeading,
1360
915
  fontWeight: "500",
1361
- fontSize: e.fontSizeLG,
1362
- gap: 4
916
+ fontSize: e.fontSizeLG
1363
917
  },
1364
918
  "&-left": {
1365
919
  display: "flex",
920
+ flexWrap: "wrap",
1366
921
  alignItems: "center",
1367
- justifyContent: "flex-start"
922
+ gap: e.marginXS,
923
+ justifyContent: "flex-start",
924
+ [`${e.antCls}-tabs`]: {
925
+ width: "100%"
926
+ },
927
+ "&-has-tabs": {
928
+ overflow: "hidden"
929
+ }
1368
930
  },
1369
931
  "&-right": {
932
+ flex: 1,
1370
933
  display: "flex",
1371
- justifyContent: "flex-end"
934
+ flexWrap: "wrap",
935
+ justifyContent: "flex-end",
936
+ gap: e.marginXS
937
+ },
938
+ "&-setting-items": {
939
+ display: "flex",
940
+ gap: e.marginXS,
941
+ lineHeight: "32px",
942
+ alignItems: "center"
943
+ },
944
+ "&-setting-item": {
945
+ color: e.colorIconHover,
946
+ fontSize: e.fontSizeLG,
947
+ cursor: "pointer",
948
+ "> span": { display: "block", width: "100%", height: "100%" },
949
+ "&:hover": {
950
+ color: e.colorPrimary
951
+ }
1372
952
  }
1373
953
  }
1374
954
  });
1375
- function wt(e) {
1376
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !X(e);
1377
- }
1378
- const {
1379
- useBreakpoint: ga
1380
- } = nt;
1381
- function pa(e) {
1382
- if (X(e))
955
+ function Wa(e) {
956
+ if (V(e))
1383
957
  return e;
1384
958
  if (e) {
1385
- const a = e, {
1386
- icon: l,
959
+ const l = e, {
960
+ icon: a,
1387
961
  tooltip: n,
1388
- onClick: u,
1389
- key: o
1390
- } = a;
1391
- return l && n ? s(ce, {
1392
- title: n
962
+ onClick: s,
963
+ key: u
964
+ } = l;
965
+ return a && n ? c(we, {
966
+ title: n,
967
+ key: u
1393
968
  }, {
1394
- default: () => [s("span", {
1395
- key: o,
969
+ default: () => [c("span", {
970
+ key: u,
1396
971
  onClick: () => {
1397
- u && u(o);
972
+ s && s(u);
1398
973
  }
1399
- }, [l])]
1400
- }) : l;
974
+ }, [a])]
975
+ }) : a;
1401
976
  }
1402
977
  return null;
1403
978
  }
1404
- const Nt = /* @__PURE__ */ te({
979
+ const Tt = /* @__PURE__ */ Te({
1405
980
  props: {
1406
- actions: re.toolBarBtn,
981
+ actions: [Array],
1407
982
  settings: [Array],
1408
- titleTip: re.titleTip,
983
+ titleTip: be.titleTip,
1409
984
  prefixCls: String,
1410
- headerTitle: re.headerTitle,
1411
- titleTipText: re.titleTipText,
1412
- optionsExtra: re.optionsExtra
985
+ headerTitle: be.headerTitle,
986
+ titleTipText: be.titleTipText,
987
+ actionsPlacement: String
1413
988
  },
1414
989
  setup(e) {
1415
990
  const {
1416
- wrapSSR: a,
1417
- hashId: l
1418
- } = qe("ListToolBar", [va], e.prefixCls), n = ga(), {
1419
- isMobile: u
1420
- } = de(), o = C(() => !!(e.titleTip || e.headerTitle || e.actions?.length)), d = C(() => !!(e.settings?.length || e.optionsExtra)), h = C(() => !!(e.titleTip || e.headerTitle)), x = C(() => {
1421
- let c;
1422
- return Array.isArray(e.actions) ? e.actions?.length < 1 ? null : s(ge, {
1423
- align: "center"
1424
- }, wt(c = e.actions.map((m, b) => X(m) ? He(m, {
1425
- key: b,
1426
- ...m?.props
1427
- }) : s("template", {
1428
- key: b
1429
- }, [m]))) ? c : {
1430
- default: () => [c]
1431
- }) : e.actions;
1432
- }), T = Ve(() => !o.value && d.value ? s("div", {
1433
- class: `${e.prefixCls}-left ${l.value}`
1434
- }, null) : h.value ? s(ge, {
1435
- class: `${e.prefixCls}-left ${l.value}`
1436
- }, {
1437
- default: () => [s("div", {
1438
- class: `${e.prefixCls}-title ${l.value}`
1439
- }, [e.headerTitle, e.titleTip && s(ce, {
991
+ wrapSSR: l,
992
+ hashId: a
993
+ } = Xe("ListToolBar", [La], e.prefixCls), n = vt(), {
994
+ isMobile: s
995
+ } = _e(), u = S(() => !!(e.titleTip || e.headerTitle)), d = Pe(() => {
996
+ if (!Array.isArray(e.actions) || e.actions?.length < 1)
997
+ return {
998
+ left: null,
999
+ right: null
1000
+ };
1001
+ const v = e.actions.filter((p) => V(p)).filter((p) => (p?.props?.placement || e.actionsPlacement) === "left"), f = e.actions.filter((p) => V(p)).filter((p) => (p?.props?.placement || e.actionsPlacement) === "right");
1002
+ return {
1003
+ left: v.length ? c("div", {
1004
+ class: `${e.prefixCls}-actions ${a.value}`
1005
+ }, [v]) : null,
1006
+ right: f.length ? c("div", {
1007
+ class: `${e.prefixCls}-actions ${a.value}`
1008
+ }, [f]) : null
1009
+ };
1010
+ }, [() => e.actions, () => e.actionsPlacement]), h = S(() => !!(e.titleTip || e.headerTitle || d.value.left)), y = S(() => !!(e.settings?.length || d.value.right)), P = Pe(() => {
1011
+ if (!h.value && y.value)
1012
+ return c("div", {
1013
+ class: `${e.prefixCls}-left ${a.value}`
1014
+ }, null);
1015
+ const v = d.value.left;
1016
+ return u.value ? c("div", {
1017
+ class: `${e.prefixCls}-left ${a.value}`
1018
+ }, [c("div", {
1019
+ class: `${e.prefixCls}-title ${a.value}`
1020
+ }, [e.headerTitle, e.titleTip && c(we, {
1440
1021
  title: e.titleTipText
1441
1022
  }, {
1442
- default: () => [Z(e.titleTip) && e.titleTip ? s(vl, null, null) : e.titleTip]
1443
- })]), x.value && s("div", {
1444
- class: `${e.prefixCls}-actions ${l.value}`
1445
- }, [x.value])]
1446
- }) : s(ge, {
1447
- class: `${e.prefixCls}-left ${l.value}`
1448
- }, {
1449
- default: () => [x.value && s("div", {
1450
- class: `${e.prefixCls}-actions`
1451
- }, [x.value])]
1452
- }), [() => o.value, () => d.value, () => h.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.titleTip]), i = Ve(() => {
1453
- let c;
1454
- return d.value ? s(ge, {
1455
- size: 16,
1456
- class: `${e.prefixCls}-right ${l.value}`,
1457
- align: n.value.lg ? "center" : "end",
1458
- direction: n.value.lg ? "horizontal" : "vertical"
1459
- }, {
1460
- default: () => [e.optionsExtra, e.settings?.length ? s(ge, {
1461
- size: 12,
1462
- align: "center",
1463
- class: `${e.prefixCls}-setting-items`
1464
- }, wt(c = e.settings.map((m, b) => {
1465
- const v = pa(m);
1466
- return s("div", {
1467
- key: b,
1468
- class: `${e.prefixCls}-setting-item`
1469
- }, [v]);
1470
- })) ? c : {
1471
- default: () => [c]
1472
- }) : null]
1473
- }) : null;
1474
- }, [() => n.value, () => d.value, () => e.prefixCls, () => h.value, () => x.value, () => e.settings]), y = Ve(() => {
1475
- if (!d.value && !o.value) return null;
1476
- const c = {
1477
- [`${l.value}`]: !0,
1023
+ default: () => [de(e.titleTip) && e.titleTip ? c(Gt, null, null) : e.titleTip]
1024
+ })]), v]) : c("div", {
1025
+ class: `${e.prefixCls}-left ${a.value}`
1026
+ }, [v]);
1027
+ }, [() => h.value, () => y.value, () => u.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.titleTip]), o = Pe(() => {
1028
+ if (!y.value) return null;
1029
+ const v = d.value.right;
1030
+ return c("div", {
1031
+ class: `${e.prefixCls}-right ${a.value}`,
1032
+ style: {
1033
+ alignItems: n.value.lg ? "center" : "flex-end",
1034
+ flexDirection: n.value.lg ? "row" : "column"
1035
+ }
1036
+ }, [v, e.settings?.length ? c("div", {
1037
+ class: Z(`${e.prefixCls}-setting-items`, a.value)
1038
+ }, [e.settings.map((f, p) => {
1039
+ const w = Wa(f);
1040
+ return c("div", {
1041
+ key: p,
1042
+ class: Z(`${e.prefixCls}-setting-item`, a.value)
1043
+ }, [w]);
1044
+ })]) : null]);
1045
+ }, [() => n.value, () => y.value, () => e.prefixCls, () => u.value, () => d.value, () => e.settings]), R = Pe(() => {
1046
+ if (!y.value && !h.value) return null;
1047
+ const v = {
1048
+ [`${a.value}`]: !0,
1478
1049
  [`${e.prefixCls}-container`]: !0,
1479
- [`${e.prefixCls}-container-mobile`]: u.value
1050
+ [`${e.prefixCls}-container-mobile`]: s.value
1480
1051
  };
1481
- return s("div", {
1482
- class: c
1483
- }, [T.value, i.value]);
1484
- }, [() => u.value, () => o.value, () => d.value, () => T.value, () => e.prefixCls, () => i.value]);
1485
- return () => a(s("div", {
1486
- class: `${e.prefixCls} ${l.value}`
1487
- }, [y.value]));
1052
+ return c("div", {
1053
+ class: v
1054
+ }, [P.value, o.value]);
1055
+ }, [() => s.value, () => h.value, () => y.value, () => P.value, () => e.prefixCls, () => o.value]);
1056
+ return () => l(c("div", {
1057
+ class: `${e.prefixCls} ${a.value}`
1058
+ }, [R.value]));
1488
1059
  }
1489
1060
  });
1490
- Nt.inheritAttrs = !1;
1491
- const ya = () => {
1492
- const {
1493
- action: e,
1494
- tableSize: a
1495
- } = de();
1496
- return s(Ll, {
1497
- overlay: s(Le, {
1498
- selectedKeys: [a.value],
1499
- onClick: ({
1500
- key: l
1501
- }) => {
1502
- e.setTableSize?.(l);
1503
- },
1504
- style: {
1505
- width: 80
1506
- }
1507
- }, {
1508
- default: () => [s(Le.Item, {
1509
- key: "large"
1510
- }, {
1511
- default: () => [je("默认")]
1512
- }), s(Le.Item, {
1513
- key: "middle"
1514
- }, {
1515
- default: () => [je("中等")]
1516
- }), s(Le.Item, {
1517
- key: "small"
1518
- }, {
1519
- default: () => [je("紧凑")]
1520
- })]
1521
- }),
1522
- trigger: ["click"]
1523
- }, {
1524
- default: () => [s(ce, {
1525
- title: "表格密度"
1526
- }, {
1527
- default: () => [s(gl, null, null)]
1528
- })]
1529
- });
1530
- }, Mt = /* @__PURE__ */ te({
1061
+ Tt.inheritAttrs = !1;
1062
+ const Rt = /* @__PURE__ */ Te({
1531
1063
  setup() {
1532
1064
  const {
1533
1065
  isFullscreen: e
1534
- } = kt();
1535
- return () => e.value ? s(ce, {
1066
+ } = bt();
1067
+ return () => e.value ? c(we, {
1536
1068
  title: "退出全屏"
1537
1069
  }, {
1538
- default: () => [s(pl, null, null)]
1539
- }) : s(ce, {
1070
+ default: () => [c(Qt, null, null)]
1071
+ }) : c(we, {
1540
1072
  title: "全屏"
1541
1073
  }, {
1542
- default: () => [s(yl, null, null)]
1074
+ default: () => [c(Xt, null, null)]
1543
1075
  });
1544
1076
  }
1545
1077
  });
1546
- function ba() {
1078
+ function ka() {
1547
1079
  return {
1548
1080
  reload: {
1549
1081
  text: "刷新",
1550
- icon: s(bl, null, null)
1551
- },
1552
- density: {
1553
- text: "表格密度",
1554
- icon: s(ya, null, null)
1555
- },
1556
- setting: {
1557
- text: "列设置",
1558
- icon: s($t, null, null)
1082
+ icon: c(_t, null, null)
1559
1083
  },
1560
1084
  fullScreen: {
1561
1085
  text: "全屏",
1562
- icon: s(Mt, null, null)
1086
+ icon: c(Rt, null, null)
1563
1087
  }
1564
1088
  };
1565
1089
  }
1566
- function Ca(e, a) {
1567
- return Object.keys(e).filter((l) => l).map((l) => {
1568
- const n = e[l];
1090
+ function Ha(e, l) {
1091
+ return gt(e).filter((a) => a).map((a) => {
1092
+ const n = e[a];
1569
1093
  if (!n)
1570
1094
  return null;
1571
- let u = n === !0 ? a[l] : () => n?.();
1572
- if (typeof u != "function" && (u = () => {
1573
- }), l === "setting")
1574
- return s(ma, E(e[l], {
1575
- key: l
1576
- }), null);
1577
- if (l === "fullScreen")
1578
- return s("span", {
1579
- key: l,
1580
- onClick: u
1581
- }, [s(Mt, null, null)]);
1582
- const o = ba()[l];
1583
- return o ? s("span", {
1584
- key: l,
1585
- onClick: u
1586
- }, [s(ce, {
1587
- title: o.text
1095
+ let s = n === !0 ? l[a] : () => n?.();
1096
+ if (typeof s != "function" && (s = () => {
1097
+ }), a === "fullScreen")
1098
+ return c("span", {
1099
+ key: a,
1100
+ onClick: s
1101
+ }, [c(Rt, null, null)]);
1102
+ const u = ka()[a];
1103
+ return u ? c("span", {
1104
+ key: a,
1105
+ onClick: s
1106
+ }, [c(we, {
1107
+ title: u.text
1588
1108
  }, {
1589
- default: () => [o.icon]
1109
+ default: () => [u.icon]
1590
1110
  })]) : null;
1591
- }).filter((l) => l);
1111
+ }).filter((a) => a);
1592
1112
  }
1593
- const xa = {
1113
+ const qa = {
1594
1114
  options: [Boolean, Object, Array],
1115
+ actionsPlacement: [String],
1595
1116
  titleTip: [Function, Boolean, Object, String],
1596
1117
  settingExtra: [Function, Boolean, Object, Array],
1597
- optionsExtra: [Function, Boolean, Object, Array],
1598
1118
  titleTipText: [String],
1599
- toolBarBtn: [Function, Boolean, Object, Array],
1119
+ actionsRender: [Array],
1600
1120
  headerTitle: [Function, Boolean, Object, Array, String]
1601
- }, Sa = /* @__PURE__ */ te({
1602
- props: xa,
1121
+ }, Va = /* @__PURE__ */ Te({
1122
+ props: qa,
1603
1123
  inheritAttrs: !1,
1604
1124
  setup(e) {
1605
- const a = at({
1125
+ const l = pt({
1606
1126
  suffixCls: "table-list-toolbar",
1607
1127
  isPor: !0
1608
1128
  }), {
1609
- action: l
1610
- } = de(), n = Ve(() => {
1611
- const u = {
1612
- reload: () => l?.reload(),
1613
- density: !0,
1614
- setting: !0,
1615
- fullScreen: () => l?.toggle()
1616
- };
1617
- if (e.options === !1 || Object.keys(e.options)?.length === 0) return [];
1618
- const o = {
1619
- ...u,
1620
- ...e.options
1621
- };
1622
- return o.setting !== !1 && e.settingExtra && (o.setting = {}, o.setting.extra = e.settingExtra), Ca(o, {
1129
+ action: a
1130
+ } = _e(), n = Pe(() => {
1131
+ const s = {
1132
+ reload: () => a?.reload(),
1133
+ fullScreen: () => a?.toggle()
1134
+ }, u = k(e.options) ? e.options : {};
1135
+ return Ha({
1136
+ reload: () => a?.reload(),
1137
+ fullScreen: () => a?.toggle(),
1623
1138
  ...u
1139
+ }, {
1140
+ ...s
1624
1141
  });
1625
- }, [() => l, () => e.options]);
1142
+ }, [() => e.options]);
1626
1143
  return () => {
1627
- const u = e.toolBarBtn || [];
1628
- return s(Nt, {
1629
- prefixCls: a,
1630
- optionsExtra: e.optionsExtra,
1144
+ const s = e.actionsRender || [];
1145
+ return c(Tt, {
1146
+ prefixCls: l,
1631
1147
  headerTitle: e.headerTitle,
1632
- actions: u,
1633
- settings: p(n),
1148
+ actions: s,
1149
+ actionsPlacement: e.actionsPlacement,
1150
+ settings: T(n),
1634
1151
  titleTip: e.titleTip,
1635
1152
  titleTipText: e.titleTipText
1636
1153
  }, null);
1637
1154
  };
1638
1155
  }
1639
1156
  });
1640
- function wa(e) {
1641
- return sl();
1157
+ function Ka(e) {
1158
+ return Wt();
1642
1159
  }
1643
- function Ta(e, a = !0, l) {
1644
- wa() ? nl(e, l) : a ? e() : ol(e);
1160
+ function Ga(e, l = !0, a) {
1161
+ Ka() ? Et(e, a) : l ? e() : Lt(e);
1645
1162
  }
1646
- function $a(e) {
1647
- const a = C(() => e.draggable), l = C(() => e.neverScroll), n = C(() => e.autoScroll);
1163
+ function Qa(e) {
1164
+ const l = S(() => e.draggable), a = S(() => e.neverScroll), n = S(() => e.autoScroll);
1648
1165
  return {
1649
- draggable: a,
1650
- neverScroll: l,
1166
+ draggable: l,
1167
+ neverScroll: a,
1651
1168
  autoScroll: n
1652
1169
  };
1653
1170
  }
1654
- function Ra({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: u, neverScroll: o }) {
1655
- const d = P([]), h = P([]);
1171
+ function Xa({ scroll: e, columns: l, breakpoint: a, draggable: n, autoScroll: s, neverScroll: u }) {
1172
+ const d = O([]);
1656
1173
  z([
1657
1174
  () => e.value,
1658
- () => a.value,
1659
1175
  () => l.value,
1176
+ () => a.value,
1660
1177
  () => n.value,
1661
- () => l.value,
1662
- () => u.value,
1663
- () => o.value
1178
+ () => a.value,
1179
+ () => s.value,
1180
+ () => u.value
1664
1181
  ], () => {
1665
- const b = i(Ce(a.value));
1666
- We(b, Ce(d.value)) || (d.value = U(b)), We(b, Ce(h.value)) || (h.value = U(b));
1182
+ const f = P(ye(l.value));
1183
+ Ge(f, ye(d.value)) || (d.value = _(f));
1667
1184
  }, {
1668
1185
  deep: !0,
1669
1186
  immediate: !0
1670
1187
  });
1671
- const x = C(() => {
1672
- const b = T(p(d).filter((k) => k.fixed === "left")), v = T(p(d).filter((k) => k.fixed !== "left" && k.fixed !== "right")), F = T(p(d).filter((k) => k.fixed === "right"));
1188
+ const h = S(() => {
1189
+ const f = y(T(d).filter((F) => F.fixed === "left")), p = y(T(d).filter((F) => F.fixed !== "left" && F.fixed !== "right")), w = y(T(d).filter((F) => F.fixed === "right"));
1673
1190
  return [
1674
- ...b,
1675
- ...v,
1676
- ...F
1191
+ ...f,
1192
+ ...p,
1193
+ ...w
1677
1194
  ];
1678
1195
  });
1679
- function T(b) {
1680
- return b.sort((v, F) => wl(v, F, "order", 0));
1196
+ function y(f) {
1197
+ return f.sort((p, w) => ta(p, w, "order", 0));
1681
1198
  }
1682
- function i(b) {
1683
- return U(b).map((v, F) => {
1684
- if (v.dataIndex === "action" || F === b.length - 1 ? v.resizable = !1 : v.resizable = Z(v.resizable) ? v.resizable : !!(Me(v.width) && p(n)), !v.width || p(o))
1685
- return v;
1686
- if (v.dataIndex === "action" && p(u))
1687
- if (p(e)?.x || !p(l))
1688
- v.width = v.width || 100, v.fixed = "right";
1199
+ function P(f) {
1200
+ return _(f).map((p, w) => {
1201
+ if (p.dataIndex === "action" || w === f.length - 1 ? p.resizable = !1 : p.resizable = de(p.resizable) ? p.resizable : !!(Be(p.width) && T(n)), !p.width || T(u))
1202
+ return p;
1203
+ if (p.dataIndex === "action" && T(s))
1204
+ if (T(e)?.x || !T(a))
1205
+ p.width = p.width || 100, p.fixed = "right";
1689
1206
  else {
1690
- const k = p(a).find((I) => I.dataIndex === v.dataIndex);
1691
- v.width = k?.width || "", v.fixed = k?.fixed;
1207
+ const F = T(l).find((K) => K.dataIndex === p.dataIndex);
1208
+ p.width = F?.width || "", p.fixed = F?.fixed;
1692
1209
  }
1693
- return v;
1210
+ return p;
1694
1211
  });
1695
1212
  }
1696
- function y(b, v) {
1697
- d.value = d.value.map((F) => (F.uuid === v.uuid && (F.width = b), F));
1213
+ function o(f, p) {
1214
+ d.value = d.value.map((w) => (w.uuid === p.uuid && (w.width = f), w));
1698
1215
  }
1699
- function c(b) {
1700
- if (b.length <= 0) {
1216
+ function R(f) {
1217
+ if (f.length <= 0) {
1701
1218
  d.value = [];
1702
1219
  return;
1703
1220
  }
1704
- We(i(b), Ce(d.value)) || (d.value = i(b));
1221
+ Ge(P(f), ye(d.value)) || (d.value = P(f));
1705
1222
  }
1706
- function m(b) {
1707
- c(U(Ce(a.value)).map((v) => {
1708
- const F = v.key ? {
1709
- show: b[v.key]?.show,
1710
- fixed: b[v.key]?.fixed,
1711
- order: b[v.key]?.order
1223
+ function v(f) {
1224
+ R(_(ye(l.value)).map((p) => {
1225
+ const w = p.key ? {
1226
+ show: f[p.key]?.show,
1227
+ fixed: f[p.key]?.fixed,
1228
+ order: f[p.key]?.order
1712
1229
  } : {};
1713
- return { ...v, ...F };
1230
+ return { ...p, ...w };
1714
1231
  }));
1715
1232
  }
1716
1233
  return {
1717
- breakpoint: l,
1718
- proColumns: x,
1719
- cacheProColumns: h,
1720
- setColumns: c,
1721
- changeColumns: m,
1722
- resizeColumnWidth: y
1234
+ breakpoint: a,
1235
+ proColumns: h,
1236
+ setColumns: R,
1237
+ changeColumns: v,
1238
+ resizeColumnWidth: o
1723
1239
  };
1724
1240
  }
1725
- function Fa({ columns: e, columnsState: a, changeColumns: l }) {
1726
- const n = P(void 0), u = pe({}), o = pe({}), d = pe({}), h = P([]);
1727
- z(() => e.value, () => {
1728
- p(e)?.forEach(({ show: y, key: c, fixed: m }, b) => {
1729
- const v = Bt(c, b);
1730
- v && (d[v] = { show: y === void 0 ? !0 : y, fixed: m });
1731
- });
1732
- const i = p(e).map((y) => y.key);
1733
- T(i);
1734
- }, { deep: !0, immediate: !0 }), ze(() => {
1735
- const i = {
1736
- ...p(a)?.value,
1737
- ...p(d)
1738
- };
1739
- Object.assign(u, i), Object.assign(o, i);
1740
- });
1741
- function x(i, y) {
1742
- n.value = y, Object.assign(u, i), l?.(u, y === "fixed");
1743
- }
1744
- function T(i) {
1745
- h.value = i;
1746
- }
1747
- return {
1748
- columnsMap: u,
1749
- operationType: n,
1750
- setColumnsMap: x,
1751
- sortKeyColumns: h,
1752
- cacheColumnsMap: o,
1753
- setSortKeyColumns: T
1754
- };
1755
- }
1756
- function Ba(e, a) {
1757
- const l = C(() => a), n = P(), u = P(e);
1758
- function o() {
1241
+ function _a(e, l) {
1242
+ const a = S(() => l), n = O(), s = O(e);
1243
+ function u() {
1759
1244
  n.value && clearTimeout(n.value);
1760
1245
  }
1761
1246
  async function d(...h) {
1762
- return l.value === 0 || l.value === void 0 ? u.value(...h) : (o(), new Promise(async (x) => {
1763
- h[0]?.immediate ? x(await u.value(...h)) : n.value = setTimeout(async () => {
1764
- x(await u.value(...h));
1765
- }, l.value);
1247
+ return a.value === 0 || a.value === void 0 ? s.value(...h) : (u(), new Promise(async (y) => {
1248
+ h[0]?.immediate ? y(await s.value(...h)) : n.value = setTimeout(async () => {
1249
+ y(await s.value(...h));
1250
+ }, a.value);
1766
1251
  }));
1767
1252
  }
1768
- return Xl(o), {
1769
- cancel: o,
1253
+ return Jt(u), {
1254
+ cancel: u,
1770
1255
  run: d
1771
1256
  };
1772
1257
  }
1773
- function Pa(e) {
1774
- const a = C(() => e.rowKey), l = C(() => e.polling), n = C(() => e.debounceTime), u = C(() => e.dataSource);
1258
+ function Ua(e) {
1259
+ const l = S(() => e.rowKey), a = S(() => e.polling), n = S(() => e.debounceTime), s = S(() => e.dataSource);
1775
1260
  return {
1776
- rowKey: a,
1777
- polling: l,
1261
+ rowKey: l,
1262
+ polling: a,
1778
1263
  request: e.request,
1779
1264
  postData: e.postData,
1780
1265
  debounceTime: n,
1781
- dataSource: u
1266
+ dataSource: s
1782
1267
  };
1783
1268
  }
1784
- function ka({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, waitRequest: o, debounceTime: d }, { search: h, columns: x, loading: T, setLoading: i, setColumns: y, removeRowKeys: c, syncSelectedRows: m, formParamsRef: b, setPagination: v, paginationInfo: F, onBeforeSearchSubmit: k, hasCustomRender: I }, M) {
1785
- const Y = P(), L = P(!0), O = P(!1), N = P(!1), j = P([]), J = P(), le = C(() => G(h.value) ? h.value?.manualRequest : !1), ae = async (w = {}) => {
1786
- const { pagination: r, filters: D = {}, sorter: W = {}, removeKeys: he = [], isPolling: ne = !1, extra: me } = w;
1787
- if (!l || !Ae(l) || p(o) && T.value || O.value)
1788
- return u.value || [];
1789
- if (O.value = !0, !ne || p(o) || L.value ? i(!0) : t(!0), p(o)) {
1790
- L.value = !1, O.value = !1;
1269
+ function Ja({ rowKey: e, polling: l, request: a, postData: n, dataSource: s, waitRequest: u, debounceTime: d }, { search: h, columns: y, loading: P, setLoading: o, setColumns: R, removeRowKeys: v, syncSelectedRows: f, formState: p, setPagination: w, paginationInfo: F, onBeforeSearchSubmit: K, hasCustomRender: le }, fe) {
1270
+ const oe = O(), G = O(!0), I = O(!1), ue = O(!1), A = O([]), U = O(), ne = S(() => k(h.value) ? h.value?.autoRequest ?? !0 : !0), J = async (g = {}) => {
1271
+ const { pagination: i, filters: B = {}, sorter: X = {}, removeKeys: se = [], isPolling: te = !1, extra: re } = g;
1272
+ if (!a || !De(a) || T(u) && P.value || I.value)
1273
+ return s.value || [];
1274
+ if (I.value = !0, !te || T(u) || G.value ? o(!0) : t(!0), T(u)) {
1275
+ G.value = !1, I.value = !1;
1791
1276
  return;
1792
1277
  }
1793
- r && v(r);
1278
+ i && w(i);
1794
1279
  try {
1795
- let V = {};
1796
- if (Z(r) && !r || Z(F))
1797
- V = {};
1280
+ let E = {};
1281
+ if (de(i) && !i || de(F))
1282
+ E = {};
1798
1283
  else {
1799
- const { current: se = 1, pageSize: Se = 10, total: be } = p(F) || {};
1800
- V.pageNum = Rl({ current: se, pageSize: Se, total: be }, he.length), he.length && c(he), V.pageSize = Se;
1284
+ const { current: ae = 1, pageSize: pe = 10, total: ge } = T(F) || {};
1285
+ E.pageNum = na({ current: ae, pageSize: pe, total: ge }, se.length), se.length && v(se), E.pageSize = pe;
1801
1286
  }
1802
- const Re = G(W) ? Object.keys(W).length ? [W] : [] : W;
1803
- y(p(x).map((se) => {
1804
- const Se = Re.find((be) => (be?.columnKey || be?.field) === se.dataIndex);
1287
+ const he = k(X) ? Object.keys(X).length ? [X] : [] : X;
1288
+ R(T(y).map((ae) => {
1289
+ const pe = he.find((ge) => (ge?.columnKey || ge?.field) === ae.dataIndex);
1805
1290
  return {
1806
- ...se,
1807
- sortOrder: Se?.order
1291
+ ...ae,
1292
+ sortOrder: pe?.order
1808
1293
  };
1809
1294
  }));
1810
- let Fe = {
1811
- ...V || {},
1812
- ...w.params,
1813
- ...b
1295
+ let Ce = {
1296
+ ...E,
1297
+ ...g.params,
1298
+ ...ye(p)
1814
1299
  };
1815
- k && Ae(k) && (Fe = await k({
1816
- params: Fe,
1817
- sorter: Re,
1818
- filter: D,
1819
- extra: me
1300
+ K && De(K) && (Ce = await K({
1301
+ params: Ce,
1302
+ sorter: he,
1303
+ filter: B,
1304
+ extra: re
1820
1305
  }));
1821
- let oe = [];
1822
- const xe = await l?.({
1823
- params: U(Ce(Fe)),
1824
- sorter: Re,
1825
- filter: D,
1826
- extra: me
1306
+ let ie = [];
1307
+ const Se = await a?.({
1308
+ params: _(ye(Ce)),
1309
+ sorter: he,
1310
+ filter: B,
1311
+ extra: re
1827
1312
  });
1828
- if (O.value = !1, xe && xe?.success) {
1829
- oe = xe.data || [], n && Ae(n) && (oe = await n?.(oe)), m(oe);
1830
- const se = xe.total || oe?.length || 0;
1831
- return se !== p(F)?.total && v({
1832
- total: se || 0
1833
- }), R(oe), oe;
1313
+ if (I.value = !1, Se && Se?.success) {
1314
+ ie = Se.data || [], n && De(n) && (ie = await n?.(ie)), f(ie);
1315
+ const ae = Se.total || ie?.length || 0;
1316
+ return ae !== T(F)?.total && w({
1317
+ total: ae || 0
1318
+ }), C(ie), ie;
1834
1319
  } else
1835
1320
  return [];
1836
- } catch (V) {
1837
- j.value === void 0 && R([]), M("requestError", V);
1321
+ } catch (E) {
1322
+ A.value === void 0 && C([]), fe("requestError", E);
1838
1323
  } finally {
1839
- L.value = !1, i(!1);
1324
+ G.value = !1, o(!1);
1840
1325
  }
1841
1326
  return [];
1842
- }, ee = Ba(async (w) => {
1843
- J.value && clearTimeout(J.value);
1844
- const r = await ae(w), D = Tl(a.value, r);
1845
- return D && !Y.value && (J.value = setTimeout(() => {
1846
- ee.run({ ...w, isPolling: D });
1847
- }, Math.max(D, 2e3))), r;
1327
+ }, ee = _a(async (g) => {
1328
+ U.value && clearTimeout(U.value);
1329
+ const i = await J(g), B = aa(l.value, i);
1330
+ return B && !oe.value && (U.value = setTimeout(() => {
1331
+ ee.run({ ...g, isPolling: B });
1332
+ }, Math.max(B, 2e3))), i;
1848
1333
  }, d.value || 10);
1849
- il(() => {
1850
- Y.value = !0, clearTimeout(J.value);
1851
- }), ul(() => {
1852
- Y.value = !0, clearTimeout(J.value);
1853
- }), z(() => a.value, () => {
1854
- a.value ? ee.run({ isPolling: !0 }) : clearTimeout(J.value);
1855
- }, { immediate: !0 }), z([() => o.value, () => u.value], () => {
1856
- ye();
1857
- }, { deep: !0, immediate: !0 }), z([() => b], () => {
1858
- le.value || ye();
1859
- }, {
1860
- deep: !0,
1861
- immediate: !0
1862
- });
1863
- function ye() {
1864
- Te(l) ? (!L.value || !a.value) && ee.run({ isPolling: !1 }) : R(u.value || []);
1334
+ kt(() => {
1335
+ oe.value = !0, clearTimeout(U.value);
1336
+ }), Ht(() => {
1337
+ oe.value = !0, clearTimeout(U.value);
1338
+ }), z(() => l.value, () => {
1339
+ l.value ? ee.run({ isPolling: !0 }) : clearTimeout(U.value);
1340
+ }, { immediate: !0 }), z([() => u.value, () => s.value], () => {
1341
+ me();
1342
+ }, { deep: !0, immediate: !0 }), z(() => p, () => {
1343
+ ne.value && me();
1344
+ }, { deep: !0, immediate: !0 });
1345
+ function me() {
1346
+ a ? (!G.value || !l.value) && ee.run({ isPolling: !1 }) : C(s.value || []);
1865
1347
  }
1866
- const fe = C(() => {
1867
- if (I.value)
1868
- return p(j);
1869
- const w = x.value.filter((r) => r.show || r.show === void 0);
1870
- return !p(j) || !w || w.length === 0 ? [] : p(j);
1871
- }), $e = C(() => p(j).some((w) => H(w.children) && w.children.length > 0));
1872
- function t(w) {
1873
- N.value = w;
1348
+ const ve = S(() => {
1349
+ if (le.value)
1350
+ return T(A);
1351
+ const g = y.value.filter((i) => i.show || i.show === void 0);
1352
+ return !T(A) || !g || g.length === 0 ? [] : T(A);
1353
+ }), Q = S(() => T(A).some((g) => L(g.children) && g.children.length > 0));
1354
+ function t(g) {
1355
+ ue.value = g;
1874
1356
  }
1875
- function f(w, r, D, W) {
1876
- ee.run({ pagination: w, filters: r, sorter: D, extra: W, isPolling: !1 }), M("change", w, r, D, W);
1357
+ function r(g, i, B, X) {
1358
+ ee.run({ pagination: g, filters: i, sorter: B, extra: X, isPolling: !1 }), fe("change", g, i, B, X);
1877
1359
  }
1878
- function R(w) {
1879
- const r = $l(U(w), p(F.value));
1880
- if (!We(r, j.value) && (j.value = r, !l || !Ae(l))) {
1881
- const D = r.length || 0;
1882
- D !== p(F)?.total && v({
1883
- total: D
1360
+ function C(g) {
1361
+ const i = la(_(g), T(F.value));
1362
+ if (!Ge(i, A.value) && (A.value = i, !a || !De(a))) {
1363
+ const B = i.length || 0;
1364
+ B !== T(F)?.total && w({
1365
+ total: B
1884
1366
  });
1885
1367
  }
1886
1368
  }
1887
1369
  return {
1888
- dataSource: fe,
1889
- isTreeDataRef: $e,
1890
- reSetDataList: R,
1891
- changeDataValue: (w) => {
1892
- const { key: r, row: D, value: W, type: he = "update" } = w, ne = r ?? e.value, me = D?.[ne] ?? W;
1893
- switch (!D && he !== "delete" && console.warn("row is required"), he) {
1370
+ dataSource: ve,
1371
+ isTreeDataRef: Q,
1372
+ reSetDataList: C,
1373
+ changeDataValue: (g) => {
1374
+ const { key: i, row: B, value: X, type: se = "update" } = g, te = i ?? e.value, re = B?.[te] ?? X;
1375
+ switch (!B && se !== "delete" && console.warn("row is required"), se) {
1894
1376
  case "update":
1895
- ne && me && D && (j.value = j.value.map((V) => me === V[ne] ? Oe(V, D) : V));
1377
+ te && re && B && (A.value = A.value.map((E) => re === E[te] ? xe(E, B) : E));
1896
1378
  break;
1897
1379
  case "push":
1898
- D && j.value.push(D);
1380
+ B && A.value.push(B);
1899
1381
  break;
1900
1382
  case "unshift":
1901
- D && j.value.unshift(D);
1383
+ B && A.value.unshift(B);
1902
1384
  break;
1903
1385
  case "delete":
1904
- ne && (j.value = j.value.filter((V) => W !== V[ne]));
1386
+ te && (A.value = A.value.filter((E) => X !== E[te]));
1905
1387
  break;
1906
1388
  }
1907
1389
  },
1908
- handleTableChange: f,
1909
- reload: async (w) => {
1910
- Te(l) ? await ee.run({ ...w, isPolling: !1 }) : M("reload");
1390
+ handleTableChange: r,
1391
+ reload: async (g) => {
1392
+ Me(a) ? await ee.run({ ...g, isPolling: !1 }) : fe("reload");
1911
1393
  }
1912
1394
  };
1913
1395
  }
1914
- function Ia({ emit: e, loading: a }) {
1915
- const l = P(Z(a.value) ? a.value : G(a.value) ? a.value?.spinning : !1);
1916
- z(() => a.value, (o) => {
1917
- l.value = Z(o) ? o : G(o) ? o?.spinning : l.value;
1396
+ function Za(e) {
1397
+ const l = O(a(e.loading.value));
1398
+ z(() => e.loading.value, (s) => {
1399
+ l.value = a(s, l.value);
1918
1400
  });
1919
- const n = C(() => l.value);
1920
- function u(o) {
1921
- l.value = o, e("loadingChange", !0);
1401
+ function a(s, u = !1) {
1402
+ return de(s) ? s : k(s) ? s?.spinning ?? u : u;
1922
1403
  }
1923
- return { loadingComputed: n, loading: l, setLoading: u };
1404
+ function n(s) {
1405
+ l.value = s;
1406
+ }
1407
+ return [l, n];
1924
1408
  }
1925
- function Aa({
1409
+ const ze = {
1410
+ current: 1,
1411
+ pageSize: 10,
1412
+ size: "default",
1413
+ showQuickJumper: !0,
1414
+ showSizeChanger: !0,
1415
+ pageSizeOptions: ["10", "20", "50", "100"]
1416
+ };
1417
+ function el({
1926
1418
  pagination: e,
1927
- pageItemRender: a
1419
+ pageItemRender: l
1928
1420
  }) {
1929
- const l = pe({}), n = P();
1421
+ const a = O({
1422
+ ...ze
1423
+ }), n = Oe({
1424
+ pageNum: ze.current,
1425
+ pageSize: ze.pageSize
1426
+ });
1930
1427
  z(() => e.value, () => {
1931
- if (Z(e.value) && !e.value) {
1932
- n.value = !1;
1428
+ if (e.value === !1) {
1429
+ a.value = !1;
1933
1430
  return;
1934
1431
  }
1935
- const o = Ae(a) ? {
1432
+ const u = De(l) ? {
1936
1433
  itemRender: ({
1937
1434
  page: h,
1938
- type: x,
1939
- originalElement: T
1940
- }) => a ? a({
1435
+ type: y,
1436
+ originalElement: P
1437
+ }) => l ? l({
1941
1438
  page: h,
1942
- type: x,
1943
- originalElement: T
1439
+ type: y,
1440
+ originalElement: P
1944
1441
  }) : null
1945
1442
  } : null, d = {
1946
- current: 1,
1947
- pageSize: 10,
1948
- size: "default",
1949
- showQuickJumper: !0,
1950
- showSizeChanger: !0,
1951
- pageSizeOptions: ["10", "20", "50", "100"],
1443
+ ...ze,
1952
1444
  ...e.value || {},
1953
- ...o || {}
1445
+ ...u || {}
1954
1446
  };
1955
- e.value?.showTotal || (d.showTotal = (h) => `共${h < d.pageSize ? 1 : Math.ceil(h / (d.pageSize || 10))}页 ${h}条记录`), n.value = d, Object.assign(l, {
1447
+ e.value?.showTotal || (d.showTotal = (h) => `共${h < d.pageSize ? 1 : Math.ceil(h / (d.pageSize || 10))}页 ${h}条记录`), a.value = d, Object.assign(n, {
1956
1448
  pageNum: d.current,
1957
1449
  pageSize: d.pageSize
1958
1450
  });
@@ -1960,164 +1452,153 @@ function Aa({
1960
1452
  deep: 1,
1961
1453
  immediate: !0
1962
1454
  });
1963
- function u(o) {
1964
- if (G(n.value) && G(o)) {
1455
+ function s(u) {
1456
+ if (k(a.value) && k(u)) {
1965
1457
  const d = {};
1966
- Object.keys(o).forEach((h) => {
1967
- Object.prototype.hasOwnProperty.call(o, h) && n.value[h] === o[h] || (d[h] = o[h]);
1968
- }), Object.keys(d).length > 0 && (Object.assign(n.value, d), Oa(d) && Object.assign(l, d));
1458
+ Object.keys(u).forEach((h) => {
1459
+ Object.prototype.hasOwnProperty.call(u, h) && a.value[h] === u[h] || (d[h] = u[h]);
1460
+ }), Object.keys(d).length > 0 && (Object.assign(a.value, d), tl(d) && Object.assign(n, d));
1969
1461
  }
1970
1462
  }
1971
1463
  return {
1972
- paginationInfo: n,
1973
- requestPagination: l,
1974
- setPagination: u
1464
+ paginationInfo: a,
1465
+ requestPagination: n,
1466
+ setPagination: s
1975
1467
  };
1976
1468
  }
1977
- function Oa(e) {
1469
+ function tl(e) {
1978
1470
  if (typeof e != "object" || e === null)
1979
1471
  return !1;
1980
- const a = Object.keys(e);
1981
- return a.length === 2 && a.includes("pageNum") && a.includes("pageSize");
1472
+ const l = Object.keys(e);
1473
+ return l.length === 2 && l.includes("pageNum") && l.includes("pageSize");
1982
1474
  }
1983
- function Da(e, a) {
1984
- const l = P([]), n = P([]);
1985
- z(() => a.value?.selectedRows, (i) => {
1986
- n.value = U(i || []);
1475
+ function al(e, l) {
1476
+ const a = O([]), n = O([]);
1477
+ z(() => l.value?.selectedRows, (o) => {
1478
+ n.value = _(o || []);
1987
1479
  }, {
1988
1480
  deep: !0,
1989
1481
  immediate: !0
1990
- }), z(() => a.value?.selectedRowKeys, (i) => {
1991
- l.value = Fl([...i || []]);
1482
+ }), z(() => l.value?.selectedRowKeys, (o) => {
1483
+ a.value = ia([...o || []]);
1992
1484
  }, {
1993
1485
  deep: !0,
1994
1486
  immediate: !0
1995
1487
  });
1996
- const u = (i, y) => {
1997
- const c = a.value?.type || "checkbox";
1998
- e.value && (y ? i?.[e.value] && c === "checkbox" ? (l.value.push(i[e.value]), n.value.push(i)) : (l.value = [i[e.value]], n.value = [i]) : (l.value = l.value.filter((m) => m !== i[e.value]), n.value = n.value.filter((m) => m[e.value] !== i[e.value])));
1999
- }, o = () => {
2000
- a.value && a.value?.onChange?.(l.value, n.value);
1488
+ const s = (o, R) => {
1489
+ const v = l.value?.type || "checkbox";
1490
+ e.value && (R ? o?.[e.value] && v === "checkbox" ? (a.value.push(o[e.value]), n.value.push(o)) : (a.value = [o[e.value]], n.value = [o]) : (a.value = a.value.filter((f) => f !== o[e.value]), n.value = n.value.filter((f) => f[e.value] !== o[e.value])));
1491
+ }, u = () => {
1492
+ l.value && l.value?.onChange?.(a.value, n.value);
2001
1493
  };
2002
1494
  return {
2003
- selectedKeys: l,
1495
+ selectedKeys: a,
2004
1496
  selectedItems: n,
2005
- selectRowKey: u,
2006
- selectAllRowKey: (i, y, c) => {
2007
- e.value && (i ? y.map((m) => (l.value.every((b) => b !== m?.[e.value]) && m?.[e.value] && (l.value.push(m[e.value]), n.value.push(m)), m)) : c.map((m) => (l.value.includes(m?.[e.value]) && (l.value = l.value.filter((b) => b !== m[e.value]), n.value = n.value.filter((b) => b[e.value] !== m[e.value])), m)));
1497
+ selectRowKey: s,
1498
+ selectAllRowKey: (o, R, v) => {
1499
+ e.value && (o ? R.map((f) => (a.value.every((p) => p !== f?.[e.value]) && f?.[e.value] && (a.value.push(f[e.value]), n.value.push(f)), f)) : v.map((f) => (a.value.includes(f?.[e.value]) && (a.value = a.value.filter((p) => p !== f[e.value]), n.value = n.value.filter((p) => p[e.value] !== f[e.value])), f)));
2008
1500
  },
2009
- removeRowKeys: (i) => {
2010
- l.value = l.value.filter((y) => !i.includes(y)), n.value = n.value.filter((y) => !i.includes(y?.[e.value || ""])), o();
1501
+ removeRowKeys: (o) => {
1502
+ a.value = a.value.filter((R) => !o.includes(R)), n.value = n.value.filter((R) => !o.includes(R?.[e.value || ""])), u();
2011
1503
  },
2012
- changeRowKey: o,
2013
- syncSelectedRows: (i) => {
2014
- if (e.value && l.value.length !== n.value.length) {
2015
- const y = n.value.map((m) => m[e.value]), c = l.value.filter((m) => !y.includes(m));
2016
- i.forEach((m) => {
2017
- c.includes(m[e.value]) && n.value.push(U(m));
1504
+ changeRowKey: u,
1505
+ syncSelectedRows: (o) => {
1506
+ if (e.value && a.value.length !== n.value.length) {
1507
+ const R = n.value.map((f) => f[e.value]), v = a.value.filter((f) => !R.includes(f));
1508
+ o.forEach((f) => {
1509
+ v.includes(f[e.value]) && n.value.push(_(f));
2018
1510
  });
2019
1511
  }
2020
1512
  },
2021
1513
  clearAllRowKeys: () => {
2022
- l.value = [], n.value = [], o();
1514
+ a.value = [], n.value = [], u();
2023
1515
  }
2024
1516
  };
2025
1517
  }
2026
- function ja(e) {
2027
- const a = {};
2028
- return e.forEach((l) => {
2029
- let n = l.initialValue;
2030
- const u = ["select", "number"], o = ["date", "time", "dateRange"], d = ["treeSelect", "numberRange"];
2031
- l.valueType ? !n && u.includes(l.valueType) ? n = void 0 : !n && o.includes(l.valueType) ? n = null : !n && d.includes(l.valueType) ? n = [] : n || (n = "") : n || (n = ""), l.name === "dateRange" ? (a[l.rangeStartName || "start"] = n ? n[0] : null, a[l.rangeEndName || "end"] = n ? n[1] : null) : l.name && (a[l.name] = n);
2032
- }), a;
1518
+ function ll(e) {
1519
+ const l = {};
1520
+ return e.forEach((a) => {
1521
+ let n = a.initialValue;
1522
+ const s = ["select", "number"], u = ["date", "time", "dateRange"], d = ["treeSelect", "numberRange"];
1523
+ a.valueType ? !n && s.includes(a.valueType) ? n = void 0 : !n && u.includes(a.valueType) ? n = null : !n && d.includes(a.valueType) ? n = [] : n || (n = "") : n || (n = ""), a.name === "dateRange" ? (l[a.rangeStartName || "start"] = n ? n[0] : null, l[a.rangeEndName || "end"] = n ? n[1] : null) : a.name && (l[a.name] = n);
1524
+ }), l;
2033
1525
  }
2034
- function Na({ searchMap: e, params: a, columns: l, setPagination: n }) {
2035
- const u = pe({}), o = pe({}), d = P([]);
2036
- function h(i) {
2037
- i.forEach((y) => {
2038
- d.value.some((c) => c.name === y.name) ? d.value = d.value.map((c) => c.name === y.name ? {
2039
- ...c,
2040
- ...y
2041
- } : c) : d.value.push(y);
1526
+ function nl({ searchMap: e, params: l, columns: a, setPagination: n }) {
1527
+ const s = Oe({ ...l.value || {} }), u = Oe({}), d = O([]);
1528
+ function h(o) {
1529
+ o.forEach((R) => {
1530
+ d.value.some((v) => v.name === R.name) ? d.value = d.value.map((v) => v.name === R.name ? {
1531
+ ...v,
1532
+ ...R
1533
+ } : v) : d.value.push(R);
2042
1534
  });
2043
1535
  }
2044
- const x = (i) => {
2045
- const y = [];
2046
- if ((i === "all" || i === "searchMap") && (e.value?.forEach((c) => y.push(c)), h(y)), (i === "all" || i === "columns") && l.value?.length && (l.value && l.value.forEach((c) => {
2047
- c.searchConfig && y.push(c.searchConfig);
2048
- }), h(y)), i === "all" || i === "searchMap" || i === "columns") {
1536
+ const y = (o) => {
1537
+ const R = [];
1538
+ if ((o === "all" || o === "searchMap") && (e.value?.forEach((v) => R.push(v)), h(R)), (o === "all" || o === "columns") && a.value?.length && (a.value && a.value.forEach((v) => {
1539
+ v.searchConfig && R.push(v.searchConfig);
1540
+ }), h(R)), o === "all" || o === "searchMap" || o === "columns") {
2049
1541
  n({ current: 1 });
2050
- const c = ja(y);
2051
- Object.assign(o, { ...c });
2052
- for (const m in c)
2053
- u[m] || (u[m] = c[m]);
1542
+ const v = ll(R);
1543
+ Ee(u, { ...v });
1544
+ for (const f in u)
1545
+ s[f] || (s[f] = v[f]);
2054
1546
  }
2055
- (i === "all" || i === "params") && (n({ current: 1 }), Object.assign(u, a.value));
1547
+ (o === "all" || o === "params") && (n({ current: 1 }), Ee(s, {
1548
+ ...l.value || {}
1549
+ }));
2056
1550
  };
2057
- rl(() => {
2058
- x("all");
2059
- }), z(() => a.value, () => {
2060
- x("params");
1551
+ qt(() => {
1552
+ y("all");
1553
+ }), z(() => l.value, () => {
1554
+ y("params");
2061
1555
  }, { deep: !0 }), z(() => e.value, () => {
2062
- x("searchMap");
2063
- }, { deep: !0 }), z(() => l.value, () => {
2064
- x("columns");
1556
+ y("searchMap");
1557
+ }, { deep: !0 }), z(() => a.value, () => {
1558
+ y("columns");
2065
1559
  }, { deep: !0 });
2066
- function T(i) {
2067
- n({ current: 1 }), Object.assign(u, i);
1560
+ function P(o) {
1561
+ n({ current: 1 }), Ee(s, { ...o });
2068
1562
  }
2069
- return { formDataRef: d, formParamsRef: u, defaultParamsRef: o, setFormParams: T };
1563
+ return { formDataRef: d, formState: s, defaultState: u, setFormState: P };
2070
1564
  }
2071
- function Ma(e) {
2072
- const a = C(() => e.scroll), l = C(() => e.autoScroll), n = C(() => e.modalScroll), u = C(() => e.neverScroll), o = C(() => e.rowSelection), d = C(() => e.scrollBreakpoint);
2073
- return {
2074
- scroll: a,
2075
- neverScroll: u,
2076
- rowSelection: o,
2077
- autoScroll: l,
2078
- modalScroll: n,
2079
- scrollBreakpoint: d
2080
- };
2081
- }
2082
- function Ea({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: u, rowSelection: o, screens: d, innerWidth: h, scrollBreakpoint: x }) {
2083
- const T = C(() => p(x) ? Me(p(x)) ? h.value > p(x) : Pt(p(x)) ? d.value?.[p(x)] : d.value?.xl : d.value?.xl), i = C(() => {
2084
- let c = 0;
2085
- const m = p(o) ? 60 : 0, b = 150, v = U(p(a));
2086
- v.forEach((I) => {
2087
- c += Number.parseInt(String(I.width)) || 0;
1565
+ function il({ scroll: e, columns: l, autoScroll: a, modalScroll: n, neverScroll: s, rowSelection: u, screens: d, innerWidth: h, scrollBreakpoint: y }) {
1566
+ const P = S(() => y.value ? Be(y.value) ? h.value > y.value : yt(y.value) ? d.value?.[y.value] : d.value?.xl : d.value?.xl), o = S(() => {
1567
+ let v = 0;
1568
+ const f = T(u) ? 60 : 0, p = 150, w = _(T(l));
1569
+ w.forEach((le) => {
1570
+ v += Number.parseInt(String(le.width)) || 0;
2088
1571
  });
2089
- const k = v.filter((I) => !Reflect.has(I, "width")).length;
2090
- return k !== 0 && (c += k * b), m && (c += m), c;
1572
+ const K = w.filter((le) => !Reflect.has(le, "width")).length;
1573
+ return K !== 0 && (v += K * p), f && (v += f), v;
2091
1574
  });
2092
- return { proScroll: C(() => p(u) ? {} : p(e) && Object.keys(p(e)).length ? p(e) : p(n) ? {
2093
- y: p(e)?.y || (d.value?.xl ? 400 : 235)
2094
- } : p(l) ? T.value ? {} : Z(T.value) ? { x: p(i) } : {} : {}), breakpoint: T };
1575
+ return { proScroll: S(() => s.value ? {} : e.value && gt(e.value).length ? T(e) : n.value ? {
1576
+ y: e.value?.y || (d.value?.xl ? 400 : 235)
1577
+ } : a.value ? P.value ? {} : de(P.value) ? { x: o.value } : {} : {}), breakpoint: P };
2095
1578
  }
2096
- function za({ size: e, emit: a }) {
2097
- const l = P("middle");
2098
- ze(() => {
2099
- l.value = e.value;
2100
- });
2101
- function n(u) {
2102
- l.value = u, a("sizeChange", u);
1579
+ function ol(e) {
1580
+ const l = O(e.size.value || "middle");
1581
+ z(() => e.size.value, (n) => l.value = n);
1582
+ function a(n) {
1583
+ l.value = n || l.value;
2103
1584
  }
2104
- return { sizeRef: l, setTableSize: n };
1585
+ return [l, a];
2105
1586
  }
2106
- const et = {
1587
+ const Ve = (e) => ({
2107
1588
  "&::-webkit-scrollbar": {
2108
1589
  width: 4,
2109
1590
  height: 4
2110
1591
  },
2111
1592
  "&::-webkit-scrollbar-thumb": {
2112
- backgroundColor: "#d2d4d6",
2113
- borderRadius: 2
1593
+ backgroundColor: e.colorTextTertiary,
1594
+ borderRadius: e.borderRadiusSM
2114
1595
  },
2115
1596
  "&::-webkit-scrollbar-track": {
2116
- backgroundColor: "transparent",
2117
- borderRadius: 2
1597
+ backgroundColor: e.colorTextTertiary,
1598
+ borderRadius: e.borderRadiusSM
2118
1599
  }
2119
- }, Ka = (e) => {
2120
- const a = `${e.antCls}-table`;
1600
+ }), ul = (e) => {
1601
+ const l = `${e.antCls}-table`;
2121
1602
  return {
2122
1603
  [e.componentCls]: {
2123
1604
  "&-a": {
@@ -2127,8 +1608,8 @@ const et = {
2127
1608
  color: e.colorPrimaryHover
2128
1609
  }
2129
1610
  },
2130
- [`${a}`]: {
2131
- [`${a}-cell-ellipsis`]: {
1611
+ [`${l}`]: {
1612
+ [`${l}-cell-ellipsis`]: {
2132
1613
  overflow: "unset",
2133
1614
  whiteSpace: "unset"
2134
1615
  }
@@ -2311,556 +1792,516 @@ const et = {
2311
1792
  }
2312
1793
  },
2313
1794
  [`&${e.componentCls}-beautify-scroll`]: {
2314
- [`${e.antCls}-table-content`]: et,
2315
- [`${e.antCls}-table-body`]: et,
1795
+ [`${e.antCls}-table-content`]: Ve(e),
1796
+ [`${e.antCls}-table-body`]: Ve(e),
2316
1797
  [`${e.antCls}-table-empty`]: {
2317
- [`${e.antCls}-table-content`]: et
1798
+ [`${e.antCls}-table-content`]: Ve(e)
2318
1799
  }
2319
1800
  }
2320
1801
  }
2321
1802
  };
2322
1803
  };
2323
- function Ya(e) {
2324
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !X(e);
1804
+ function sl(e) {
1805
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !V(e);
2325
1806
  }
2326
- function La(e, a, l, n) {
2327
- if (!a) return e;
2328
- let u = e;
2329
- if (G(a)) {
2330
- const o = a.node === "a" ? "span" : a.node;
2331
- return s(o, E(a?.attr || {}, {
2332
- class: [a.class, a.node === "a" ? `${l}-a` : ""],
2333
- onClick: a.click
2334
- }), Ya(e) ? e : {
1807
+ function rl(e, l, a, n) {
1808
+ if (!l) return e;
1809
+ let s = e;
1810
+ if (k(l)) {
1811
+ const u = l.node === "a" ? "span" : l.node;
1812
+ return c(u, M(l?.attr || {}, {
1813
+ class: [l.class, l.node === "a" ? `${a}-a` : ""],
1814
+ onClick: l.click
1815
+ }), sl(e) ? e : {
2335
1816
  default: () => [e]
2336
1817
  });
2337
1818
  }
2338
- switch (a) {
1819
+ switch (l) {
2339
1820
  case "link":
2340
- u = s("span", {
2341
- class: [`${l}-a`, n]
1821
+ s = c("span", {
1822
+ class: [`${a}-a`, n]
2342
1823
  }, [e]);
2343
1824
  break;
2344
1825
  case "time":
2345
- u = q(e).format("HH:mm:ss");
1826
+ s = W(e).format("HH:mm:ss");
2346
1827
  break;
2347
1828
  case "dateMonth":
2348
- u = `${q(e).month() + 1}月`;
1829
+ s = `${W(e).month() + 1}月`;
2349
1830
  break;
2350
1831
  case "date":
2351
- u = q(e).format("YYYY-MM-DD");
1832
+ s = W(e).format("YYYY-MM-DD");
2352
1833
  break;
2353
1834
  case "dateTime":
2354
- u = q(e).format("YYYY-MM-DD HH:mm:ss");
1835
+ s = W(e).format("YYYY-MM-DD HH:mm:ss");
2355
1836
  break;
2356
1837
  }
2357
- return u;
1838
+ return s;
2358
1839
  }
2359
- function Wa(e, a) {
2360
- const l = a && a.current || 1, n = a && a.pageSize || 10;
2361
- return e.filter((u, o) => o < l * n && o >= n * (l - 1));
1840
+ function cl(e, l) {
1841
+ const a = l && l.current || 1, n = l && l.pageSize || 10;
1842
+ return e.filter((s, u) => u < a * n && u >= n * (a - 1));
2362
1843
  }
2363
- function Va(e) {
2364
- const a = document.createElement("textarea");
2365
- a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
1844
+ function dl(e) {
1845
+ const l = document.createElement("textarea");
1846
+ l.style.position = "absolute", l.style.opacity = "0", l.value = e, document.body.appendChild(l), l.select(), document.execCommand("copy"), document.body.removeChild(l);
2366
1847
  }
2367
- function Ha(e) {
2368
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !X(e);
1848
+ function fl(e) {
1849
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !V(e);
2369
1850
  }
2370
- const {
2371
- useBreakpoint: qa
2372
- } = nt, Ga = {
1851
+ const ml = {
2373
1852
  reload: !0,
2374
- density: !0,
2375
- setting: !0,
2376
1853
  fullScreen: !0
2377
- }, _a = Wl.useToken, tt = /* @__PURE__ */ te({
1854
+ }, vl = ya.useToken, Ke = /* @__PURE__ */ Te({
2378
1855
  name: "GProTable",
2379
1856
  inheritAttrs: !1,
2380
- props: re,
1857
+ props: be,
2381
1858
  emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
2382
1859
  slots: Object,
2383
1860
  setup(e, {
2384
- emit: a,
2385
- slots: l,
1861
+ emit: l,
1862
+ slots: a,
2386
1863
  attrs: n,
2387
- expose: u
1864
+ expose: s
2388
1865
  }) {
2389
- const o = at({
1866
+ const u = pt({
2390
1867
  suffixCls: "table",
2391
1868
  isPor: !0
2392
1869
  }), {
2393
1870
  wrapSSR: d,
2394
1871
  hashId: h
2395
- } = qe("ProBaseTable", [Ka], o), {
2396
- token: x
2397
- } = _a(), T = Sl(), i = qa(), {
2398
- width: y
2399
- } = jl(), c = P(!1), m = Rt(), b = P(), v = P(), F = P(e.waitRequest);
2400
- ze(() => F.value = e.waitRequest);
1872
+ } = Xe("ProBaseTable", [ul], u), {
1873
+ token: y
1874
+ } = vl(), P = ea(), o = vt(), {
1875
+ width: R
1876
+ } = ma(), v = O(!1), f = mt(), p = O(), w = O(), F = O(e.waitRequest);
1877
+ dt(() => F.value = e.waitRequest);
2401
1878
  const {
2402
- toggle: k,
2403
- isFullscreen: I
2404
- } = kt(b), M = C(() => ({
1879
+ toggle: K,
1880
+ isFullscreen: le
1881
+ } = bt(p), fe = S(() => ({
2405
1882
  ...e
2406
- })), Y = C(() => !i.value.xl), L = C(() => (e.virtualScroll && Ql(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), O = C(() => e.search === !1 ? !1 : G(e.search) ? e.search : {
1883
+ })), oe = S(() => !o.value.xl), G = S(() => (e.virtualScroll && Ta(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), I = S(() => e.search === !1 ? !1 : k(e.search) ? e.search : {
2407
1884
  type: "auto",
2408
1885
  resetText: "重置",
2409
1886
  searchText: "查询"
2410
- }), N = C(() => O.value === !1 ? {} : O.value), j = C(() => N.value?.manualRequest ?? !1), J = C(() => N.value?.actions), le = C(() => {
2411
- const g = (e.columns || []).filter((S) => S.key || S.dataIndex).map((S) => {
2412
- const B = S.key || S.dataIndex;
2413
- return S.key = B, S.dataIndex = B, S.align = S.align || e.align, S.uuid = S.uuid || lt().uuid(15), S;
1887
+ }), ue = S(() => I.value === !1 ? {} : I.value), A = S(() => ue.value?.autoRequest ?? !0), U = S(() => ue.value?.actions), ne = S(() => {
1888
+ const m = (e.columns || []).filter((x) => x.key || x.dataIndex).map((x) => {
1889
+ const $ = x.key || x.dataIndex;
1890
+ return x.key = $, x.dataIndex = $, x.align = x.align || e.align, x.uuid = x.uuid || oa().uuid(15), x;
2414
1891
  });
2415
- return Bl(g, {
1892
+ return ua(m, {
2416
1893
  align: e.align ?? "left",
2417
1894
  showIndex: e.showIndex ?? !1
2418
1895
  });
1896
+ }), [J, ee] = Za({
1897
+ loading: q(e, "loading")
1898
+ }), [me, ve] = ol({
1899
+ size: q(e, "size")
2419
1900
  }), {
2420
- loadingComputed: ae,
2421
- loading: ee,
2422
- setLoading: ye
2423
- } = Ia({
2424
- emit: a,
2425
- loading: ie(e, "loading")
2426
- }), {
2427
- sizeRef: fe,
2428
- setTableSize: $e
2429
- } = za({
2430
- emit: a,
2431
- size: ie(e, "size")
2432
- }), {
2433
- paginationInfo: t,
2434
- requestPagination: f,
2435
- setPagination: R
2436
- } = Aa({
2437
- pagination: ie(e, "pagination"),
2438
- pageItemRender: bt({
2439
- slots: l,
1901
+ paginationInfo: Q,
1902
+ requestPagination: t,
1903
+ setPagination: r
1904
+ } = el({
1905
+ pagination: q(e, "pagination"),
1906
+ pageItemRender: ot({
1907
+ slots: a,
2440
1908
  props: e,
2441
1909
  key: "pageItemRender"
2442
1910
  })
2443
- }), $ = Ma(e), {
2444
- proScroll: w,
2445
- breakpoint: r
2446
- } = Ea({
2447
- ...$,
2448
- innerWidth: y,
2449
- columns: le,
2450
- screens: i
2451
- }), D = $a(e), {
2452
- proColumns: W,
2453
- cacheProColumns: he,
2454
- setColumns: ne,
2455
- changeColumns: me,
2456
- resizeColumnWidth: V
2457
- } = Ra({
2458
- ...D,
2459
- breakpoint: r,
2460
- scroll: w,
2461
- columns: le
2462
1911
  }), {
2463
- columnsMap: Re,
2464
- operationType: Fe,
2465
- setColumnsMap: oe,
2466
- sortKeyColumns: xe,
2467
- cacheColumnsMap: se,
2468
- setSortKeyColumns: Se
2469
- } = Fa({
2470
- columns: he,
2471
- columnsState: ie(e, "columnsState"),
2472
- changeColumns: me
1912
+ proScroll: C,
1913
+ breakpoint: b
1914
+ } = il({
1915
+ scroll: q(e, "scroll"),
1916
+ autoScroll: q(e, "autoScroll"),
1917
+ modalScroll: q(e, "modalScroll"),
1918
+ neverScroll: q(e, "neverScroll"),
1919
+ rowSelection: q(e, "rowSelection"),
1920
+ scrollBreakpoint: q(e, "scrollBreakpoint"),
1921
+ innerWidth: R,
1922
+ columns: ne,
1923
+ screens: o
1924
+ }), g = Qa(e), {
1925
+ proColumns: i,
1926
+ setColumns: B,
1927
+ changeColumns: X,
1928
+ resizeColumnWidth: se
1929
+ } = Xa({
1930
+ ...g,
1931
+ breakpoint: b,
1932
+ scroll: C,
1933
+ columns: ne
2473
1934
  }), {
2474
- formDataRef: be,
2475
- formParamsRef: ot,
2476
- defaultParamsRef: Et,
2477
- setFormParams: Ge
2478
- } = Na({
2479
- searchMap: ie(e, "searchMap"),
2480
- params: ie(e, "params"),
2481
- columns: le,
2482
- setPagination: R
1935
+ formDataRef: te,
1936
+ formState: re,
1937
+ defaultState: E,
1938
+ setFormState: he
1939
+ } = nl({
1940
+ searchMap: q(e, "searchMap"),
1941
+ params: q(e, "params"),
1942
+ columns: ne,
1943
+ setPagination: r
2483
1944
  }), {
2484
- selectedKeys: st,
2485
- selectedItems: zt,
2486
- changeRowKey: Kt,
2487
- selectRowKey: it,
2488
- selectAllRowKey: ut,
2489
- syncSelectedRows: rt,
2490
- removeRowKeys: ct,
2491
- clearAllRowKeys: Yt
2492
- } = Da(ie(e, "rowKey"), ie(e, "rowSelection")), Lt = Pa(e), {
2493
- reload: Be,
2494
- reSetDataList: Wt,
2495
- changeDataValue: Vt,
2496
- isTreeDataRef: Ht,
2497
- dataSource: Pe,
2498
- handleTableChange: dt
2499
- } = ka({
2500
- ...Lt,
1945
+ selectedKeys: Ce,
1946
+ selectedItems: ie,
1947
+ changeRowKey: Se,
1948
+ selectRowKey: ae,
1949
+ selectAllRowKey: pe,
1950
+ syncSelectedRows: ge,
1951
+ removeRowKeys: Ue,
1952
+ clearAllRowKeys: $t
1953
+ } = al(q(e, "rowKey"), q(e, "rowSelection")), Ft = Ua(e), {
1954
+ reload: Re,
1955
+ reSetDataList: Pt,
1956
+ changeDataValue: Dt,
1957
+ isTreeDataRef: Ot,
1958
+ dataSource: $e,
1959
+ handleTableChange: Je
1960
+ } = Ja({
1961
+ ...Ft,
2501
1962
  waitRequest: F
2502
1963
  }, {
2503
- loading: ae,
2504
- paginationInfo: t,
2505
- setPagination: R,
2506
- removeRowKeys: ct,
2507
- syncSelectedRows: rt,
2508
- setLoading: ye,
2509
- setColumns: ne,
2510
- search: O,
2511
- columns: W,
2512
- formParamsRef: ot,
1964
+ loading: J,
1965
+ paginationInfo: Q,
1966
+ setPagination: r,
1967
+ removeRowKeys: Ue,
1968
+ syncSelectedRows: ge,
1969
+ setLoading: ee,
1970
+ setColumns: B,
1971
+ search: I,
1972
+ columns: i,
1973
+ formState: re,
2513
1974
  onBeforeSearchSubmit: e.onBeforeSearchSubmit,
2514
- hasCustomRender: C(() => Te(e.customRender || l?.customRender))
2515
- }, a), ke = C(() => e.options ? {
2516
- ...Ga,
2517
- ...G(e.options) ? e.options : {}
2518
- } : !1), qt = C(() => ({
2519
- size: p(fe),
2520
- scroll: p(w),
2521
- dataSource: p(Pe),
2522
- pagination: p(t),
2523
- virtualScroll: L.value,
2524
- columns: p(W).filter((g) => g.show || g.show === void 0)
2525
- })), ft = C(() => {
2526
- const g = G(e.loading) ? Ee(e.loading, "spinning") : {};
2527
- return !g.indicator && m?.indicator?.value && (g.indicator = m?.indicator?.value), {
2528
- spinning: e.showLoading ? Te(ee.value) : !1,
2529
- ...g
1975
+ hasCustomRender: S(() => Me(e.customRender || a?.customRender))
1976
+ }, l), Bt = S(() => ({
1977
+ size: T(me),
1978
+ scroll: T(C),
1979
+ dataSource: T($e),
1980
+ pagination: T(Q),
1981
+ virtualScroll: G.value,
1982
+ columns: T(i).filter((m) => m.show || m.show === void 0)
1983
+ })), Ze = S(() => {
1984
+ const m = k(e.loading) ? Le(e.loading, "spinning") : {};
1985
+ return !m.indicator && f?.indicator?.value && (m.indicator = f?.indicator?.value), {
1986
+ spinning: e.showLoading ? Me(J.value) : !1,
1987
+ ...m
2530
1988
  };
2531
- }), ht = C(() => {
2532
- let g;
2533
- const S = p(M).direction === "rtl" ? "bottomLeft" : "right", B = p(t)?.position;
2534
- if (B !== null && Array.isArray(B)) {
2535
- const K = B.find((Q) => Q.includes("top")), _ = B.find((Q) => Q.includes("bottom")), A = B.every((Q) => `${Q}` == "none");
2536
- !K && !_ && !A && (g = S), K && (g = K.toLowerCase().replace("top", "")), _ && (g = _.toLowerCase().replace("bottom", ""));
1989
+ }), et = S(() => {
1990
+ let m;
1991
+ const x = T(fe).direction === "rtl" ? "bottomLeft" : "right", $ = T(Q)?.position;
1992
+ if ($ !== null && Array.isArray($)) {
1993
+ const D = $.find((H) => H.includes("top")), j = $.find((H) => H.includes("bottom")), Y = $.every((H) => `${H}` == "none");
1994
+ !D && !j && !Y && (m = x), D && (m = D.toLowerCase().replace("top", "")), j && (m = j.toLowerCase().replace("bottom", ""));
2537
1995
  } else
2538
- g = S;
2539
- return g;
1996
+ m = x;
1997
+ return m;
2540
1998
  });
2541
- Ta(() => {
2542
- c.value && e.keepAliveReload ? Be() : c.value = !0;
1999
+ Ga(() => {
2000
+ v.value && e.keepAliveReload ? Re() : v.value = !0;
2543
2001
  });
2544
- const mt = async (g, S) => {
2545
- j.value ? J.value?.reload && S ? (Ge(g), await Be()) : Ge(g) : (Ge({
2546
- ...e.params || {},
2547
- ...g
2548
- }), await Be());
2549
- }, Gt = async (g, S) => {
2550
- S === "reset" ? (a("reset", g), e.request && await mt(g, S)) : e.request ? (a("submit", g), await mt(g, S)) : a("submit", g);
2551
- }, vt = (g, S, B, K) => {
2552
- R(xt(g, ["current", "pageSize"])), dt(g, S, B, K);
2553
- }, _t = (g, S) => {
2554
- R({
2555
- current: g,
2556
- pageSize: S
2557
- }), dt({
2558
- current: g,
2559
- pageSize: S,
2560
- total: t.value && t.value?.total || 0
2002
+ const tt = async (m, x) => {
2003
+ A.value ? (he(xe(e.params, m)), await Re()) : U.value?.reload && x ? (he(m), await Re()) : he(m);
2004
+ }, It = async (m, x) => {
2005
+ x === "reset" ? (l("reset", m), e.request && await tt(m, x)) : e.request ? (l("submit", m), await tt(m, x)) : l("submit", m);
2006
+ }, at = (m, x, $, D) => {
2007
+ r(rt(m, ["current", "pageSize"])), Je(m, x, $, D);
2008
+ }, jt = (m, x) => {
2009
+ r({
2010
+ current: m,
2011
+ pageSize: x
2012
+ }), Je({
2013
+ current: m,
2014
+ pageSize: x,
2015
+ total: Q.value && Q.value?.total || 0
2561
2016
  }, {}, {});
2562
- }, Qt = (g) => {
2563
- a("expandedRowsChange", g);
2564
- }, Xt = (g, S) => {
2565
- a("expand", g, S);
2566
- }, Ut = (g, S) => V(g, S), Jt = (g, S, B) => {
2567
- let K = g;
2568
- if (S) {
2569
- const _ = H(g) ? typeof g?.[0]?.children == "string" ? g?.[0]?.children : "" : g ? g.toString() : "", A = B.tooltip === !1 ? {} : B.tooltip, Q = B.tooltip === !1 ? 1 : Me(A?.hiddenLine) && A?.hiddenLine > 0 ? A?.hiddenLine : 1, we = B.tooltip === !1 ? 0 : Me(A?.width) ? A?.width : 0, tl = B.tooltip !== !1 && Pt(_) && we > 0 ? Il(_, {
2017
+ }, At = (m) => {
2018
+ l("expandedRowsChange", m);
2019
+ }, Nt = (m, x) => {
2020
+ l("expand", m, x);
2021
+ }, zt = (m, x) => se(m, x), Yt = (m, x, $) => {
2022
+ let D = m;
2023
+ if (x) {
2024
+ const j = L(m) ? typeof m?.[0]?.children == "string" ? m?.[0]?.children : "" : m ? m.toString() : "", Y = $.tooltip === !1 ? {} : $.tooltip, H = $.tooltip === !1 ? 1 : Be(Y?.hiddenLine) && Y?.hiddenLine > 0 ? Y?.hiddenLine : 1, N = $.tooltip === !1 ? 0 : Be(Y?.width) ? Y?.width : 0, Ie = $.tooltip !== !1 && yt(j) && N > 0 ? ca(j, {
2570
2025
  cssObject: {
2571
2026
  fontSize: "14px",
2572
2027
  lineHeight: "22px",
2573
- fontFamily: T?.token?.value?.fontFamily || x?.value?.fontFamily,
2574
- ...A?.targetStyle || {}
2028
+ fontFamily: P?.token?.value?.fontFamily || y?.value?.fontFamily,
2029
+ ...Y?.targetStyle || {}
2575
2030
  }
2576
- }) : 0, ll = document.querySelector(`.${o} .ant-table-tbody`), Ke = s("div", {
2577
- class: `${o}-ellipsis-text`
2578
- }, [g]), pt = () => B.tooltip === !1 || G(B.tooltip) && tl < we && we > 0 ? Ke : s(ce, E({
2579
- title: g,
2580
- getPopupContainer: (_e) => ll ?? _e?.parentNode?.parentNode
2581
- }, G(B.tooltip) ? B.tooltip : {}, {
2031
+ }) : 0, je = document.querySelector(`.${u} .ant-table-tbody`), Ae = c("div", {
2032
+ class: `${u}-ellipsis-text`
2033
+ }, [m]), nt = () => $.tooltip === !1 || k($.tooltip) && Ie < N && N > 0 ? Ae : c(we, M({
2034
+ title: m,
2035
+ getPopupContainer: (We) => je ?? We?.parentNode?.parentNode
2036
+ }, k($.tooltip) ? $.tooltip : {}, {
2582
2037
  destroyTooltipOnHide: !0
2583
- }), Ha(Ke) ? Ke : {
2584
- default: () => [Ke]
2038
+ }), fl(Ae) ? Ae : {
2039
+ default: () => [Ae]
2585
2040
  });
2586
- if (K = s("div", {
2587
- class: `${o}-ellipsis ${A?.class ?? ""}`,
2041
+ if (D = c("div", {
2042
+ class: `${u}-ellipsis ${Y?.class ?? ""}`,
2588
2043
  style: {
2589
- "-webkit-line-clamp": Q
2044
+ "-webkit-line-clamp": H
2590
2045
  }
2591
- }, [pt()]), B.copyable) {
2592
- const _e = typeof B.copyText == "function" ? B.copyText?.(B) : B.copyText || _;
2593
- K = s("div", {
2594
- class: `${o}-copyable`
2595
- }, [s("div", {
2596
- class: `${o}-ellipsis ${A?.class ?? ""}`,
2046
+ }, [nt()]), $.copyable) {
2047
+ const We = typeof $.copyText == "function" ? $.copyText?.($) : $.copyText || j;
2048
+ D = c("div", {
2049
+ class: `${u}-copyable`
2050
+ }, [c("div", {
2051
+ class: `${u}-ellipsis ${Y?.class ?? ""}`,
2597
2052
  style: {
2598
- "-webkit-line-clamp": Q
2053
+ "-webkit-line-clamp": H
2599
2054
  }
2600
- }, [pt()]), s(Cl, {
2601
- class: `${o}-copyable-icon`,
2055
+ }, [nt()]), c(Ut, {
2056
+ class: `${u}-copyable-icon`,
2602
2057
  onClick: () => {
2603
- Va(_e), ql.success("复制成功");
2058
+ dl(We), Sa.success("复制成功");
2604
2059
  }
2605
2060
  }, null)]);
2606
2061
  }
2607
2062
  }
2608
- return K;
2063
+ return D;
2609
2064
  };
2610
- function gt() {
2611
- const g = Al({
2612
- slots: l,
2065
+ function lt() {
2066
+ const m = da({
2067
+ slots: a,
2613
2068
  props: e,
2614
2069
  key: "emptyText"
2615
2070
  });
2616
- if (g !== !1 && m?.emptyText?.value !== !1) {
2617
- const B = e.emptyTextProps?.extraProps || {}, K = g || m?.emptyText?.value, _ = X(K), A = _ ? Tt(K, B) : Ft(H(K) ? K : [K]);
2618
- return s("div", {
2619
- class: ue(`${o}-empty-text`, h.value, e.emptyTextProps?.class),
2071
+ if (m !== !1 && f?.emptyText?.value !== !1) {
2072
+ const $ = e.emptyTextProps?.extraProps || {}, D = m || f?.emptyText?.value, j = V(D), Y = j ? ft(D, $) : ht(L(D) ? D : [D]);
2073
+ return c("div", {
2074
+ class: Z(`${u}-empty-text`, h.value, e.emptyTextProps?.class),
2620
2075
  style: e.emptyTextProps?.style
2621
- }, [_ ? A : H(A) ? A.map((Q) => He(Q, B)) : s(Gl, null, null)]);
2076
+ }, [j ? Y : L(Y) ? Y.map((H) => Qe(H, $)) : c(xa, null, null)]);
2622
2077
  }
2623
2078
  return null;
2624
2079
  }
2625
- const Zt = () => {
2626
- const g = bt({
2627
- slots: l,
2080
+ const Mt = () => {
2081
+ const m = ot({
2082
+ slots: a,
2628
2083
  props: e,
2629
2084
  key: "customRender"
2630
2085
  });
2631
- if (g) {
2632
- if (Pe.value?.length) {
2633
- const S = U(p(Pe));
2634
- return g?.({
2635
- dataSource: S,
2636
- currentData: Wa(S, t.value)
2086
+ if (m) {
2087
+ if ($e.value?.length) {
2088
+ const x = _(T($e));
2089
+ return m?.({
2090
+ dataSource: x,
2091
+ currentData: cl(x, Q.value)
2637
2092
  });
2638
2093
  }
2639
- return gt();
2094
+ return lt();
2640
2095
  }
2641
- return s(De, null, null);
2642
- }, el = (g) => {
2643
- const S = kl({
2644
- slots: l,
2645
- props: e,
2646
- keys: ["headerTitle", "titleTip", "toolBarBtn", "settingExtra", "optionsExtra"],
2647
- render: !0
2648
- });
2649
- return s(Sa, {
2650
- titleTipText: e.titleTipText,
2651
- options: Z(ke.value) ? ke.value : {
2652
- ...ke.value,
2653
- setting: g ? !1 : ke.value?.setting,
2654
- density: g ? !1 : ke.value?.density
2655
- },
2656
- headerTitle: S.headerTitle,
2657
- titleTip: S.titleTip,
2658
- settingExtra: S.settingExtra,
2659
- optionsExtra: S.optionsExtra,
2660
- toolBarBtn: S.toolBarBtn
2661
- }, null);
2096
+ return c(Ye, null, null);
2662
2097
  };
2663
- return Jl({
2664
- tableSize: fe,
2665
- columns: W,
2666
- cacheColumns: le,
2667
- isMobile: Y,
2668
- searchConfig: N,
2669
- manualSearch: j,
2670
- searchActions: J,
2098
+ return $a({
2099
+ tableSize: me,
2100
+ columns: i,
2101
+ cacheColumns: ne,
2102
+ isMobile: oe,
2103
+ searchConfig: ue,
2104
+ autoRequest: A,
2105
+ searchActions: U,
2671
2106
  action: {
2672
- setTableSize: $e,
2673
- reload: (g) => Be(g),
2674
- toggle: k
2675
- },
2676
- settingsAction: {
2677
- autoScroll: ie(e, "autoScroll"),
2678
- columnsMap: Re,
2679
- operationType: Fe,
2680
- setColumnsMap: oe,
2681
- sortKeyColumns: xe,
2682
- cacheColumnsMap: se,
2683
- setSortKeyColumns: Se
2107
+ setTableSize: ve,
2108
+ reload: (m) => Re(m),
2109
+ toggle: K
2684
2110
  },
2685
- setPagination: R,
2686
- changeColumns: me,
2687
- slots: l
2688
- }), u({
2111
+ setPagination: r,
2112
+ changeColumns: X
2113
+ }), s({
2689
2114
  formRef: () => ({
2690
- getFormState: () => p(ot),
2691
- getFormInnerState: () => v.value?.getFormState() || {},
2692
- restFormState: (g) => {
2693
- F.value = !0, g && g?.(), v.value?.resetForm(!1), F.value = !1;
2115
+ getFormState: () => re,
2116
+ getFormInnerState: () => w.value?.getFormState() || {},
2117
+ restFormState: (m) => {
2118
+ F.value = !0, m && m?.(), w.value?.resetForm(!1), F.value = !1;
2694
2119
  }
2695
2120
  }),
2696
2121
  actionRef: () => ({
2697
- loading: ee,
2698
- dataSource: Pe,
2699
- pageState: f,
2700
- pagination: t.value,
2701
- selectedKeys: C(() => st.value),
2702
- selectedItems: C(() => zt.value),
2122
+ loading: J,
2123
+ dataSource: $e,
2124
+ pageState: t,
2125
+ pagination: Q.value,
2126
+ selectedKeys: S(() => Ce.value),
2127
+ selectedItems: S(() => ie.value),
2703
2128
  rowsSelection: {
2704
- clear: Yt,
2705
- select: it,
2706
- remove: ct,
2707
- sync: rt,
2708
- selectAll: ut
2129
+ clear: $t,
2130
+ select: ae,
2131
+ remove: Ue,
2132
+ sync: ge,
2133
+ selectAll: pe
2709
2134
  },
2710
- reload: Be,
2711
- getLoadingStatus: () => p(ae),
2712
- reloadAndReset: async (g) => {
2713
- F.value = !0, R({
2135
+ reload: Re,
2136
+ getLoadingStatus: () => T(J),
2137
+ reloadAndReset: async (m) => {
2138
+ F.value = !0, r({
2714
2139
  current: 1,
2715
- pageSize: f?.pageSize || 10
2716
- }), g?.callBack && (g?.wait ? await g?.callBack?.() : g?.callBack?.()), v.value?.resetForm(!1), F.value = !1;
2140
+ pageSize: t?.pageSize || 10
2141
+ }), m?.callBack && (m?.wait ? await m?.callBack?.() : m?.callBack?.()), w.value?.resetForm(!1), F.value = !1;
2717
2142
  },
2718
- reSetDataList: Wt,
2719
- setPageAndReload: vt,
2720
- setPagination: R,
2721
- setDataValue: Vt,
2722
- setLoading: ye
2143
+ reSetDataList: Pt,
2144
+ setPageAndReload: at,
2145
+ setPagination: r,
2146
+ setDataValue: Dt,
2147
+ setLoading: ee
2723
2148
  })
2724
2149
  }), () => {
2725
- const g = Te(e.customRender || l.customRender);
2726
- return d(s("div", {
2727
- ref: b,
2728
- class: ue([{
2150
+ const m = Me(e.customRender || a.customRender), x = a.actions?.() || e.actionProps?.actions, $ = sa({
2151
+ slots: a,
2152
+ props: e,
2153
+ keys: ["headerTitle", "titleTip", "settingExtra"],
2154
+ render: !0
2155
+ });
2156
+ return d(c("div", {
2157
+ ref: p,
2158
+ class: Z([{
2729
2159
  [`${h.value}`]: !0,
2730
- [`${o}`]: !0,
2160
+ [`${u}`]: !0,
2731
2161
  [`${n.class}`]: n.class,
2732
- [`${o}-beautify-scroll`]: Z(e.useDefaultScrollStyle) ? !e.useDefaultScrollStyle : !0,
2733
- [`${o}-no-scroll`]: !Object.keys(p(w) || {}).length,
2734
- [`${o}-table-tree`]: Ht.value,
2735
- [`${o}-full-screen`]: I.value
2162
+ [`${u}-beautify-scroll`]: de(e.useDefaultScrollStyle) ? !e.useDefaultScrollStyle : !0,
2163
+ [`${u}-no-scroll`]: !Object.keys(T(C) || {}).length,
2164
+ [`${u}-table-tree`]: Ot.value,
2165
+ [`${u}-full-screen`]: le.value
2736
2166
  }]),
2737
2167
  style: n.style
2738
- }, [s("div", {
2739
- class: [`${o}-content`, h.value]
2740
- }, [(be.value.length > 0 || Te(l.search)) && e.search !== !1 && s(jt, {
2741
- ref: v,
2742
- modal: e.modalScroll,
2168
+ }, [c("div", {
2169
+ class: [`${u}-content`, h.value]
2170
+ }, [(te.value.length > 0 || !!a.search) && e.search !== !1 && c(Ea, {
2171
+ ref: w,
2172
+ modalScroll: e.modalScroll,
2743
2173
  cardBordered: e.cardBordered,
2744
- searchMap: be.value,
2745
- prefixCls: o,
2746
- loading: !!p(ae),
2747
- onSearch: Gt,
2748
- defaultParams: Et
2174
+ searchMap: te.value,
2175
+ prefixCls: u,
2176
+ loading: T(J),
2177
+ onSearch: It,
2178
+ defaultState: E
2749
2179
  }, {
2750
- default: l.search ? () => l.search?.() : null
2751
- }), s("div", {
2752
- class: ue(h.value, `${o}-card`, e.cardBordered && `${o}-card-border`)
2753
- }, [el(g), g ? s(At, ft.value, {
2754
- default: () => [s("div", {
2755
- class: `${o}-wrapper ${h.value}`
2756
- }, [s("div", {
2757
- class: ue(`${o}-list`, h.value, e.tableProps?.class),
2180
+ default: a.search ? () => a.search?.() : null
2181
+ }), c("div", {
2182
+ class: Z(h.value, `${u}-card`, e.cardBordered && `${u}-card-border`)
2183
+ }, [c(Va, {
2184
+ options: e.options ? {
2185
+ ...ml,
2186
+ ...k(e.options) ? e.options : {}
2187
+ } : !1,
2188
+ titleTipText: e.titleTipText,
2189
+ actionsPlacement: e.actionProps?.placement,
2190
+ actionsRender: x,
2191
+ headerTitle: $.headerTitle,
2192
+ titleTip: $.titleTip,
2193
+ settingExtra: $.settingExtra
2194
+ }, null), m ? c(St, Ze.value, {
2195
+ default: () => [c("div", {
2196
+ class: `${u}-wrapper ${h.value}`
2197
+ }, [c("div", {
2198
+ class: Z(`${u}-list`, h.value, e.tableProps?.class),
2758
2199
  style: e.tableProps?.style
2759
- }, [Zt()]), e.pagination !== !1 && Pe.value?.length > 0 && s(Vl, E({
2200
+ }, [Mt()]), e.pagination !== !1 && $e.value?.length > 0 && c(ba, M({
2760
2201
  class: {
2761
- [`${o}-pagination ${h.value}`]: !0,
2762
- [`${o}-pagination-${ht.value} ${h.value}`]: !!ht.value
2202
+ [`${u}-pagination ${h.value}`]: !0,
2203
+ [`${u}-pagination-${et.value} ${h.value}`]: !!et.value
2763
2204
  }
2764
- }, Ce(p(t)), {
2765
- onChange: _t
2205
+ }, ye(T(Q)), {
2206
+ onChange: jt
2766
2207
  }), null)])]
2767
- }) : s(Hl, E(xt(e, Object.keys(Dt)), qt.value, {
2208
+ }) : c(Ca, M(rt(e, Object.keys(wt)), Bt.value, {
2768
2209
  style: e.tableProps?.style,
2769
2210
  class: e.tableProps?.class,
2770
- loading: ft.value,
2771
- rowKey: (S) => S[e.rowKey],
2772
- transformCellText: (S) => {
2773
- e.transformCellText && typeof e.transformCellText && e.transformCellText?.(S);
2211
+ loading: Ze.value,
2212
+ rowKey: (D) => D[e.rowKey],
2213
+ transformCellText: (D) => {
2214
+ e.transformCellText && typeof e.transformCellText && e.transformCellText?.(D);
2774
2215
  const {
2775
- column: B
2776
- } = S;
2777
- if (!B) return S.text;
2778
- const K = B?.key || B?.dataIndex;
2779
- let _ = !0, A = S.text;
2780
- if (H(A))
2781
- if (A.length === 0 || A.length === 1 && !X(A[0])) {
2782
- A = A?.[0];
2783
- const Q = Pl(A, B?.columnEmptyText || e?.columnEmptyText || "");
2784
- _ = Q.success, A = La(Q.value, B?.valueType || e.columns?.find((we) => (we.key || we.dataIndex) === K)?.valueType, o, h.value);
2785
- } else A[0]?.type === "template" && (A = A[0]?.children);
2786
- return B?.ellipsis ? Jt(A, _, B) : A;
2216
+ column: j
2217
+ } = D;
2218
+ if (!j) return D.text;
2219
+ const Y = j?.key || j?.dataIndex;
2220
+ let H = !0, N = D.text;
2221
+ if (L(N))
2222
+ if (N.length === 0 || N.length === 1 && !V(N[0])) {
2223
+ N = N?.[0];
2224
+ const Ie = ra(N, j?.columnEmptyText || e?.columnEmptyText || "");
2225
+ H = Ie.success, N = rl(Ie.value, j?.valueType || e.columns?.find((je) => (je.key || je.dataIndex) === Y)?.valueType, u, h.value);
2226
+ } else N[0]?.type === "template" && (N = N[0]?.children);
2227
+ return j?.ellipsis ? Yt(N, H, j) : N;
2787
2228
  },
2788
2229
  rowSelection: e.rowSelection ? {
2789
- ...Ee(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
2790
- selectedRowKeys: st.value || [],
2791
- onSelect: it,
2792
- onSelectAll: ut,
2793
- onChange: Kt
2230
+ ...Le(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
2231
+ selectedRowKeys: Ce.value || [],
2232
+ onSelect: ae,
2233
+ onSelectAll: pe,
2234
+ onChange: Se
2794
2235
  } : void 0,
2795
- onChange: vt,
2796
- onExpandedRowsChange: Qt,
2797
- onExpand: Xt,
2798
- onResizeColumn: (S, B) => Ut(S, B)
2236
+ onChange: at,
2237
+ onExpandedRowsChange: At,
2238
+ onExpand: Nt,
2239
+ onResizeColumn: (D, j) => zt(D, j)
2799
2240
  }), {
2800
- ...l,
2801
- emptyText: () => gt()
2241
+ ...a,
2242
+ emptyText: () => lt()
2802
2243
  })])])]));
2803
2244
  };
2804
2245
  }
2805
2246
  });
2806
- tt.install = (e) => (e.component(tt.name, tt), e);
2807
- function rn(e, a) {
2808
- function l() {
2809
- const i = {
2247
+ Ke.install = (e) => (e.component(Ke.name, Ke), e);
2248
+ function Pl(e, l) {
2249
+ function a() {
2250
+ const o = {
2810
2251
  params: {},
2811
2252
  searchMap: []
2812
2253
  };
2813
- if (a?.state) {
2814
- if (Qe(a.state) && G(a.state.value))
2815
- return Oe(i, U(a.state.value));
2816
- if (G(a.state) && !Qe(a.state))
2817
- return Oe(i, U(a.state));
2254
+ if (l?.state) {
2255
+ if (ke(l.state) && k(l.state.value))
2256
+ return xe(o, _(l.state.value));
2257
+ if (k(l.state) && !ke(l.state))
2258
+ return xe(o, _(l.state));
2818
2259
  }
2819
- return i;
2260
+ return o;
2820
2261
  }
2821
- const n = pe(Oe(l(), {
2822
- request: a?.request
2262
+ const n = Oe(xe(a(), {
2263
+ request: l?.request
2823
2264
  }));
2824
- a?.state && z(() => a.state && Qe(a.state) ? a.state.value : a.state, () => {
2825
- x();
2265
+ l?.state && z(() => l.state && ke(l.state) ? l.state.value : l.state, () => {
2266
+ y();
2826
2267
  }, { deep: !0 });
2827
- const u = C(() => e?.value?.actionRef?.()), o = C(() => e?.value?.formRef?.()), d = C(() => ({
2828
- ...u.value?.pageState || {},
2829
- ...o.value?.getFormState?.() || {}
2830
- })), h = P(!!u.value?.loading?.value);
2831
- z(() => u.value?.loading?.value, (i) => {
2832
- h.value = !!i;
2833
- }), z(h, (i) => {
2834
- u.value?.setLoading?.(!!i);
2268
+ const s = S(() => e?.value?.actionRef?.()), u = S(() => e?.value?.formRef?.()), d = S(() => ({
2269
+ ...s.value?.pageState || {},
2270
+ ...u.value?.getFormState?.() || {}
2271
+ })), h = O(!!s.value?.loading?.value);
2272
+ z(() => s.value?.loading?.value, (o) => {
2273
+ h.value = !!o;
2274
+ }), z(h, (o) => {
2275
+ s.value?.setLoading?.(!!o);
2835
2276
  });
2836
- function x() {
2837
- Ol(n, l());
2277
+ function y() {
2278
+ Ee(n, a());
2838
2279
  }
2839
- function T(i, y) {
2840
- n.searchMap && (n.searchMap = U(n.searchMap).map((c) => c.name === i ? Oe(c, y) : c));
2280
+ function P(o, R) {
2281
+ n.searchMap && (n.searchMap = _(n.searchMap).map((v) => v.name === o ? xe(v, R) : v));
2841
2282
  }
2842
2283
  return {
2843
- formRef: o,
2844
- actionRef: u,
2284
+ formRef: u,
2285
+ actionRef: s,
2845
2286
  tableState: n,
2846
2287
  requestSearch: d,
2847
2288
  loading: h,
2848
- dataSource: C(() => u?.value?.dataSource?.value || []),
2849
- selectedKeys: C(() => u?.value?.selectedKeys?.value || []),
2850
- selectedItems: C(() => u?.value?.selectedItems?.value || []),
2851
- rowsSelection: u?.value?.rowsSelection,
2852
- mutate: (i) => u.value?.reSetDataList?.(i),
2853
- reloadAndReset: (i) => u.value?.reloadAndReset?.(i),
2854
- setPageAndReload: (i, y, c, m) => u.value?.setPageAndReload?.(i, y, c, m),
2855
- setPagination: (i) => u.value?.setPagination?.(i),
2856
- setLoading: (i) => h.value = i,
2857
- setDataValue: (i) => u.value?.setDataValue?.(i),
2858
- reload: (i) => u.value?.reload?.(i),
2859
- updateSearchMap: T
2289
+ dataSource: S(() => s?.value?.dataSource?.value || []),
2290
+ selectedKeys: S(() => s?.value?.selectedKeys?.value || []),
2291
+ selectedItems: S(() => s?.value?.selectedItems?.value || []),
2292
+ rowsSelection: s?.value?.rowsSelection,
2293
+ mutate: (o) => s.value?.reSetDataList?.(o),
2294
+ reloadAndReset: (o) => s.value?.reloadAndReset?.(o),
2295
+ setPageAndReload: (o, R, v, f) => s.value?.setPageAndReload?.(o, R, v, f),
2296
+ setPagination: (o) => s.value?.setPagination?.(o),
2297
+ setLoading: (o) => h.value = o,
2298
+ setDataValue: (o) => s.value?.setDataValue?.(o),
2299
+ reload: (o) => s.value?.reload?.(o),
2300
+ updateSearchMap: P
2860
2301
  };
2861
2302
  }
2862
2303
  export {
2863
- tt as GProTable,
2864
- re as proTableProps,
2865
- rn as useTable
2304
+ Ke as GProTable,
2305
+ be as proTableProps,
2306
+ Pl as useTable
2866
2307
  };