@gx-design-vue/pro-table 0.2.0-beta.165 → 0.2.0-beta.166
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 +197 -195
- package/dist/pro-table.umd.cjs +3 -3
- package/package.json +2 -2
package/dist/pro-table.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.165
|
|
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: 2026-01-
|
|
8
|
+
* Date Created: 2026-01-23
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent as ue, ref as x, watch as
|
|
12
|
+
import { defineComponent as ue, ref as x, watch as Y, cloneVNode as Ze, reactive as et, toRaw as ge, computed as S, createVNode as f, Fragment as $e, isVNode as le, mergeProps as G, h as gt, onBeforeUnmount as Kt, onMounted as tt, nextTick as lt, watchEffect as bt, unref as F, onActivated as pt, getCurrentInstance as kt, onUnmounted as yt, onDeactivated as Ct, onUpdated as Vt, toRef as k, Teleport as Xt, isRef as ke } from "vue";
|
|
13
13
|
import { useProAppContext as St } from "@gx-design-vue/pro-app";
|
|
14
14
|
import { useBreakpoint as at, useMemo as _t, tryOnUnmounted as Gt, onMountedOrActivated as Qt } from "@gx-design-vue/pro-hooks";
|
|
15
15
|
import { useProStyle as xt, unit as Se, useProConfigContext as Ut } from "@gx-design-vue/pro-provider";
|
|
16
|
-
import { isArray as
|
|
16
|
+
import { isArray as V, cloneDeep as J, isObject as ae, isBoolean as Oe, classNames as N, isNumber as we, filterEmpty as wt, isString as Tt, getTextWidth as Jt, keysOf as Rt, isFunction as ze, isDeepEqualReact as Ye, compareArray as Zt, runFunction as el, getSortIndex as tl, handleCurrentPage as ll, getRandomNumber as $t, deepMerge as xe, forInObject as al, arrayRepeat as nl, isNil as ol, getPrefixCls as il, handleShowIndex as rl, getSlot as dt, convertValueBoolean as Ve, getSlotsProps as sl, handleEmptyField as ul, getSlotVNode as cl, useDeepMerge as dl } from "@gx-design-vue/pro-utils";
|
|
17
17
|
import { useDebounceFn as fl, useEventListener as ft, isClient as vl, useElementBounding as ml, useFullscreen as Ft, useElementSize as He, useScroll as hl, useResizeObserver as gl, useWindowSize as bl } from "@vueuse/core";
|
|
18
18
|
import { DatePicker as Pt, Input as Le, TimePicker as pl, TreeSelect as yl, Select as Cl, InputNumber as Xe, Button as vt, Spin as It, theme as Sl, Tooltip as Pe, Empty as At, Pagination as xl, Table as wl } from "ant-design-vue";
|
|
19
19
|
import { omit as Fe, cloneDeep as Nt, pick as Tl } from "lodash-es";
|
|
@@ -351,7 +351,7 @@ const El = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
351
351
|
slots: n
|
|
352
352
|
}) {
|
|
353
353
|
const l = x([]), a = x(e.loading ?? !1), o = x("init"), i = fl(e.fetch, e.debounceTime || 10);
|
|
354
|
-
return
|
|
354
|
+
return Y([() => e.fetch, () => e.manual], () => {
|
|
355
355
|
if (o.value !== "init" && a.value) return;
|
|
356
356
|
const c = e.manual ?? !1;
|
|
357
357
|
e.fetch && !c && (a.value = !0, i().then((g) => {
|
|
@@ -365,7 +365,7 @@ const El = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
365
365
|
immediate: !0
|
|
366
366
|
}), () => {
|
|
367
367
|
const c = n.default?.();
|
|
368
|
-
return Ze(
|
|
368
|
+
return Ze(V(c) ? c[0] : c, {
|
|
369
369
|
options: l.value,
|
|
370
370
|
notFoundContent: e.notFoundContent?.(a.value)
|
|
371
371
|
});
|
|
@@ -385,7 +385,7 @@ function Dl(e, n) {
|
|
|
385
385
|
o(i.name, c);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
Y(() => e, () => {
|
|
389
389
|
a();
|
|
390
390
|
}, { deep: !0, immediate: !0 });
|
|
391
391
|
function o(i, c) {
|
|
@@ -519,7 +519,7 @@ function Be(e, n) {
|
|
|
519
519
|
return n ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
|
|
520
520
|
}
|
|
521
521
|
const ht = (e, n, l = "string") => {
|
|
522
|
-
if (
|
|
522
|
+
if (V(e)) {
|
|
523
523
|
const [a, o] = e;
|
|
524
524
|
let i, c;
|
|
525
525
|
if (Array.isArray(n) ? (i = n[0], c = n[1]) : typeof n == "object" && n.type === "mask" ? (i = n.format, c = n.format) : (i = n, c = n), l === "string") {
|
|
@@ -584,11 +584,11 @@ const kl = {
|
|
|
584
584
|
} = Dl(e.defaultFormSearch, e.formCols), H = x(Se(d.value?.gap || 16)), L = S(() => {
|
|
585
585
|
if (d.value?.breakpoint && ae(d.value.breakpoint) && Object.keys(d.value.breakpoint).length)
|
|
586
586
|
return d.value?.breakpoint;
|
|
587
|
-
}), I = x(d.value?.collapsed ?? d.value?.defaultCollapsed), E = S(() => Oe(R.value?.reset) ? R.value?.reset : !g.value), P = S(() => L.value ?
|
|
588
|
-
|
|
587
|
+
}), I = x(d.value?.collapsed ?? d.value?.defaultCollapsed), E = S(() => Oe(R.value?.reset) ? R.value?.reset : !g.value), P = S(() => L.value ? _(L.value, v.value) : A(d.value?.span, c.value)), q = S(() => d.value?.label);
|
|
588
|
+
Y(() => d.value?.collapsed, (t) => {
|
|
589
589
|
I.value = t;
|
|
590
590
|
});
|
|
591
|
-
function
|
|
591
|
+
function _(t, s) {
|
|
592
592
|
let p = 4;
|
|
593
593
|
const h = Object.keys(t).map((b) => Number(b)).filter((b) => !Number.isNaN(b)).sort((b, r) => r - b);
|
|
594
594
|
for (let b = 0; b < h.length; b += 1) {
|
|
@@ -613,7 +613,7 @@ const kl = {
|
|
|
613
613
|
}
|
|
614
614
|
const Q = (t) => {
|
|
615
615
|
I.value = t;
|
|
616
|
-
},
|
|
616
|
+
}, O = (t, s, p) => (t + 1) % s === 0 ? {
|
|
617
617
|
...p,
|
|
618
618
|
marginRight: Se(0)
|
|
619
619
|
} : {
|
|
@@ -621,14 +621,14 @@ const kl = {
|
|
|
621
621
|
marginRight: H.value
|
|
622
622
|
}, B = () => {
|
|
623
623
|
const t = Nt(u), s = e.formCols.find((r) => r.valueType === "text"), p = e.formCols.find((r) => r.valueType === "dateRange"), h = e.formCols.find((r) => r.valueType === "numberRange"), b = e.formCols.find((r) => r.valueType === "treeSelect");
|
|
624
|
-
if (s && (t[s.name] = u[s.name] || s.initialValue), p && (p.rangeStartName || p.rangeEndName ? (t[p.rangeStartName || "start"] = t[p.name] ? t[p.name][0] : void 0, t[p.rangeEndName || "end"] = t[p.name] ? t[p.name][1] : void 0, delete t[p.name]) : t[p.name] =
|
|
624
|
+
if (s && (t[s.name] = u[s.name] || s.initialValue), p && (p.rangeStartName || p.rangeEndName ? (t[p.rangeStartName || "start"] = t[p.name] ? t[p.name][0] : void 0, t[p.rangeEndName || "end"] = t[p.name] ? t[p.name][1] : void 0, delete t[p.name]) : t[p.name] = V(t[p.name]) && t[p.name].length > 0 ? u[p.name] : void 0), h) {
|
|
625
625
|
const r = t[h.name];
|
|
626
|
-
t[h.name] =
|
|
626
|
+
t[h.name] = V(r) && r.some((ee) => we(ee)) ? r : void 0;
|
|
627
627
|
}
|
|
628
|
-
return b && (b?.name &&
|
|
628
|
+
return b && (b?.name && V(u[b?.name]) && (t[b.name] = u[b.name].length ? u[b.name].map((r) => r[b.valueKey === "text" ? "label" : "value"]).join() : void 0), b?.name && V(t[b?.name]) && (t[b.name] = t[b.name].length ? t[b.name].map((r) => r[b.valueKey === "text" ? "label" : "value"]) : void 0)), t;
|
|
629
629
|
}, z = (t = !1, s) => {
|
|
630
630
|
(g.value || t) && e.onSearch?.(B(), t ? s ? "reset" : "submit" : void 0);
|
|
631
|
-
},
|
|
631
|
+
}, D = (t, s, p) => {
|
|
632
632
|
let h = u[s.name];
|
|
633
633
|
switch (s.valueType) {
|
|
634
634
|
case "text":
|
|
@@ -639,7 +639,7 @@ const kl = {
|
|
|
639
639
|
break;
|
|
640
640
|
case "numberRange":
|
|
641
641
|
if ((p?.key === 0 || p?.key === 1) && h) {
|
|
642
|
-
h =
|
|
642
|
+
h = V(h) ? h : [];
|
|
643
643
|
for (let b = 0; b < 2; b += 1)
|
|
644
644
|
p?.key === b ? h[b] = t ?? "" : h[b] = h[b] ?? "";
|
|
645
645
|
y(s.name, h);
|
|
@@ -667,7 +667,7 @@ const kl = {
|
|
|
667
667
|
y(s.name, t ? me(t, "YYYY") : null);
|
|
668
668
|
break;
|
|
669
669
|
case "dateRange":
|
|
670
|
-
y(s.name, t &&
|
|
670
|
+
y(s.name, t && V(t) && t.length === 2 ? ht(t, Be(s.valueFormat, s.showTime)) : null);
|
|
671
671
|
break;
|
|
672
672
|
case "time":
|
|
673
673
|
y(s.name, t ? me(t, s.valueFormat || "HH:mm:ss") : null);
|
|
@@ -681,13 +681,13 @@ const kl = {
|
|
|
681
681
|
getFormSearch: () => B(),
|
|
682
682
|
resetForm: Z
|
|
683
683
|
});
|
|
684
|
-
const
|
|
684
|
+
const X = () => {
|
|
685
685
|
const t = i?.emptyText?.value;
|
|
686
686
|
if (t) {
|
|
687
687
|
const s = le(t), p = s ? gt(t) : wt(t || []);
|
|
688
688
|
return f("div", {
|
|
689
689
|
class: N(`${e.prefixCls}-search-empty-text`, o.value)
|
|
690
|
-
}, [s ? p :
|
|
690
|
+
}, [s ? p : V(p) ? p.map((h) => Ze(h)) : void 0]);
|
|
691
691
|
}
|
|
692
692
|
}, ce = () => (!g.value || E.value) && f("div", {
|
|
693
693
|
class: N(`${e.prefixCls}-search-buttons ${o.value}`, m.value?.searchButtons),
|
|
@@ -725,7 +725,7 @@ const kl = {
|
|
|
725
725
|
return t === void 0 ? void 0 : t ? f(It, {
|
|
726
726
|
size: "small",
|
|
727
727
|
indicator: i?.indicator?.value
|
|
728
|
-
}, null) :
|
|
728
|
+
}, null) : X();
|
|
729
729
|
}
|
|
730
730
|
function Ie(t, s) {
|
|
731
731
|
return f(Ol, G(t.request, {
|
|
@@ -748,7 +748,7 @@ const kl = {
|
|
|
748
748
|
value: u[t.name],
|
|
749
749
|
placeholder: t.placeholder || "请输入",
|
|
750
750
|
allowClear: t.allowClear ?? !0,
|
|
751
|
-
onChange: (r) =>
|
|
751
|
+
onChange: (r) => D(r.target.value, t),
|
|
752
752
|
onSearch: (r) => z()
|
|
753
753
|
}, h), null);
|
|
754
754
|
break;
|
|
@@ -759,7 +759,7 @@ const kl = {
|
|
|
759
759
|
},
|
|
760
760
|
value: u[t.name],
|
|
761
761
|
placeholder: t.placeholder || "请输入",
|
|
762
|
-
onChange: (r) =>
|
|
762
|
+
onChange: (r) => D(r, t)
|
|
763
763
|
}, h), null);
|
|
764
764
|
break;
|
|
765
765
|
case "numberRange":
|
|
@@ -769,19 +769,19 @@ const kl = {
|
|
|
769
769
|
}, {
|
|
770
770
|
default: () => [f(Xe, {
|
|
771
771
|
value: u[t.name]?.[0],
|
|
772
|
-
onChange: (r) =>
|
|
772
|
+
onChange: (r) => D(r, t, {
|
|
773
773
|
key: 0
|
|
774
774
|
}),
|
|
775
|
-
placeholder:
|
|
775
|
+
placeholder: V(t.placeholder) && t.placeholder?.[0] || "请输入"
|
|
776
776
|
}, null), f(Le, {
|
|
777
777
|
disabled: !0,
|
|
778
778
|
placeholder: "~"
|
|
779
779
|
}, null), f(Xe, {
|
|
780
780
|
value: u[t.name]?.[1],
|
|
781
|
-
onChange: (r) =>
|
|
781
|
+
onChange: (r) => D(r, t, {
|
|
782
782
|
key: 1
|
|
783
783
|
}),
|
|
784
|
-
placeholder:
|
|
784
|
+
placeholder: V(t.placeholder) && t.placeholder?.[1] || "请输入"
|
|
785
785
|
}, null)]
|
|
786
786
|
});
|
|
787
787
|
break;
|
|
@@ -797,7 +797,7 @@ const kl = {
|
|
|
797
797
|
allowClear: t.allowClear ?? !0,
|
|
798
798
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
799
799
|
notFoundContent: be(t.loading),
|
|
800
|
-
onChange: (r) =>
|
|
800
|
+
onChange: (r) => D(r, t),
|
|
801
801
|
options: t.loading ? [] : t?.valueEnum || []
|
|
802
802
|
}, h), null);
|
|
803
803
|
break;
|
|
@@ -812,7 +812,7 @@ const kl = {
|
|
|
812
812
|
treeData: t.loading ? [] : t.valueEnum || [],
|
|
813
813
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
814
814
|
notFoundContent: be(t.loading),
|
|
815
|
-
onChange: (r) =>
|
|
815
|
+
onChange: (r) => D(r, t)
|
|
816
816
|
}, h), null);
|
|
817
817
|
break;
|
|
818
818
|
case "date":
|
|
@@ -827,7 +827,7 @@ const kl = {
|
|
|
827
827
|
format: Be(t.valueFormat, t.showTime),
|
|
828
828
|
showTime: t.showTime,
|
|
829
829
|
showToday: t.showToday || !0,
|
|
830
|
-
onChange: (r) =>
|
|
830
|
+
onChange: (r) => D(r, t)
|
|
831
831
|
}, h), null);
|
|
832
832
|
break;
|
|
833
833
|
case "dateWeek":
|
|
@@ -839,7 +839,7 @@ const kl = {
|
|
|
839
839
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
840
840
|
allowClear: t.allowClear ?? !0,
|
|
841
841
|
placeholder: t.placeholder || "请选择",
|
|
842
|
-
onChange: (r) =>
|
|
842
|
+
onChange: (r) => D(r, t)
|
|
843
843
|
}, h), null);
|
|
844
844
|
break;
|
|
845
845
|
case "dateMonth":
|
|
@@ -851,7 +851,7 @@ const kl = {
|
|
|
851
851
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
852
852
|
allowClear: t.allowClear ?? !0,
|
|
853
853
|
placeholder: t.placeholder || "请选择",
|
|
854
|
-
onChange: (r) =>
|
|
854
|
+
onChange: (r) => D(r, t)
|
|
855
855
|
}, h), null);
|
|
856
856
|
break;
|
|
857
857
|
case "dateQuarter":
|
|
@@ -863,7 +863,7 @@ const kl = {
|
|
|
863
863
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
864
864
|
allowClear: t.allowClear ?? !0,
|
|
865
865
|
placeholder: t.placeholder || "请选择",
|
|
866
|
-
onChange: (r) =>
|
|
866
|
+
onChange: (r) => D(r, t)
|
|
867
867
|
}, h), null);
|
|
868
868
|
break;
|
|
869
869
|
case "dateYear":
|
|
@@ -875,7 +875,7 @@ const kl = {
|
|
|
875
875
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
876
876
|
allowClear: t.allowClear ?? !0,
|
|
877
877
|
placeholder: t.placeholder || "请选择",
|
|
878
|
-
onChange: (r) =>
|
|
878
|
+
onChange: (r) => D(r, t)
|
|
879
879
|
}, h), null);
|
|
880
880
|
break;
|
|
881
881
|
case "dateRange":
|
|
@@ -883,12 +883,12 @@ const kl = {
|
|
|
883
883
|
style: {
|
|
884
884
|
width: "100%"
|
|
885
885
|
},
|
|
886
|
-
value: u[t.name] &&
|
|
886
|
+
value: u[t.name] && V(u[t.name]) && u[t.name]?.length === 2 ? ht(u[t.name], Be(t.valueFormat, t.showTime), "dayjs") : void 0,
|
|
887
887
|
getPopupContainer: (r) => r && r.parentNode ? r.parentNode : r,
|
|
888
888
|
placeholder: t.placeholder || ["开始日期", "结束日期"],
|
|
889
889
|
format: Be(t.valueFormat, t.showTime),
|
|
890
890
|
showTime: t.showTime,
|
|
891
|
-
onChange: (r) =>
|
|
891
|
+
onChange: (r) => D(r, t)
|
|
892
892
|
}, h), null);
|
|
893
893
|
break;
|
|
894
894
|
case "time":
|
|
@@ -902,7 +902,7 @@ const kl = {
|
|
|
902
902
|
allowClear: t.allowClear || t.allowClear === !1 ? t.allowClear : !0,
|
|
903
903
|
use12Hours: t.use12Hours,
|
|
904
904
|
format: t.valueFormat || "HH:mm:ss",
|
|
905
|
-
onChange: (r) =>
|
|
905
|
+
onChange: (r) => D(r, t)
|
|
906
906
|
}, h), null);
|
|
907
907
|
break;
|
|
908
908
|
}
|
|
@@ -911,16 +911,16 @@ const kl = {
|
|
|
911
911
|
formItemStyle: t = {},
|
|
912
912
|
item: s
|
|
913
913
|
}) => {
|
|
914
|
-
const p = le(s) ? s.props?.label : s.label, h = (le(s) ? s.props?.labelWidth : s.labelWidth) ||
|
|
914
|
+
const p = le(s) ? s.props?.label : s.label, h = (le(s) ? s.props?.labelWidth : s.labelWidth) || q.value?.width, b = (le(s) ? s.props?.labelAlign : s.labelAlign) || q.value?.align;
|
|
915
915
|
return f("div", {
|
|
916
916
|
class: N(`${e.prefixCls}-search-item`, o.value, m.value?.searchItem),
|
|
917
917
|
style: {
|
|
918
918
|
...t,
|
|
919
|
-
gap:
|
|
919
|
+
gap: q.value?.gap ? Se(q.value?.gap) : void 0,
|
|
920
920
|
...T.value?.searchItem || {}
|
|
921
921
|
}
|
|
922
922
|
}, [p && f("div", {
|
|
923
|
-
class: N(`${e.prefixCls}-search-item-label`,
|
|
923
|
+
class: N(`${e.prefixCls}-search-item-label`, q.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, b && `${e.prefixCls}-search-item-label-${b}`),
|
|
924
924
|
style: {
|
|
925
925
|
width: h ? Se(h) : void 0
|
|
926
926
|
}
|
|
@@ -937,7 +937,7 @@ const kl = {
|
|
|
937
937
|
width: `calc((100% - (${P.value - 1} * ${H.value})) / ${P.value})`
|
|
938
938
|
};
|
|
939
939
|
return s.map((h, b) => {
|
|
940
|
-
const r =
|
|
940
|
+
const r = O(b, P.value, p);
|
|
941
941
|
return s.length < P.value || I.value ? f($e, null, [ie({
|
|
942
942
|
formItemStyle: r,
|
|
943
943
|
item: h
|
|
@@ -1111,21 +1111,21 @@ const kl = {
|
|
|
1111
1111
|
z && (d.value[y.value.axis] = z[y.value.offset] - (B[y.value.client] - z.getBoundingClientRect()[y.value.direction]));
|
|
1112
1112
|
}, E = (B) => {
|
|
1113
1113
|
if (!g.value || !c.value || !a.value) return;
|
|
1114
|
-
const z = Math.abs(B.target.getBoundingClientRect()[y.value.direction] - B[y.value.client]),
|
|
1114
|
+
const z = Math.abs(B.target.getBoundingClientRect()[y.value.direction] - B[y.value.client]), D = g.value[y.value.offset] / 2, Z = (z - D) * 100 * L.value / c.value[y.value.offset];
|
|
1115
1115
|
a.value[y.value.scroll] = Z * a.value[y.value.scrollSize] / 100;
|
|
1116
1116
|
};
|
|
1117
1117
|
function P(B) {
|
|
1118
|
-
a.value && (B.stopImmediatePropagation(), v = !0, m = a.value.scrollHeight, u = a.value.scrollWidth, document.addEventListener("mousemove",
|
|
1118
|
+
a.value && (B.stopImmediatePropagation(), v = !0, m = a.value.scrollHeight, u = a.value.scrollWidth, document.addEventListener("mousemove", q), document.addEventListener("mouseup", _), w = document.onselectstart, document.onselectstart = () => !1);
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function q(B) {
|
|
1121
1121
|
if (!a.value || !c.value || !g.value || v === !1) return;
|
|
1122
1122
|
const z = d.value[y.value.axis];
|
|
1123
1123
|
if (!z) return;
|
|
1124
|
-
const
|
|
1125
|
-
y.value.scroll === "scrollLeft" ? a.value[y.value.scroll] =
|
|
1124
|
+
const D = (c.value.getBoundingClientRect()[y.value.direction] - B[y.value.client]) * -1, Z = g.value[y.value.offset] - z, X = (D - Z) * 100 * L.value / c.value[y.value.offset];
|
|
1125
|
+
y.value.scroll === "scrollLeft" ? a.value[y.value.scroll] = X * u / 100 : a.value[y.value.scroll] = X * m / 100;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1128
|
-
v = !1, d.value[y.value.axis] = 0, document.removeEventListener("mousemove",
|
|
1127
|
+
function _() {
|
|
1128
|
+
v = !1, d.value[y.value.axis] = 0, document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", _), O(), T && (R.value = !1);
|
|
1129
1129
|
}
|
|
1130
1130
|
const A = () => {
|
|
1131
1131
|
T = !1, R.value = !!e.size;
|
|
@@ -1133,9 +1133,9 @@ const kl = {
|
|
|
1133
1133
|
T = !0, R.value = v;
|
|
1134
1134
|
};
|
|
1135
1135
|
Kt(() => {
|
|
1136
|
-
|
|
1136
|
+
O(), document.removeEventListener("mouseup", _);
|
|
1137
1137
|
});
|
|
1138
|
-
function
|
|
1138
|
+
function O() {
|
|
1139
1139
|
document.onselectstart !== w && (document.onselectstart = w);
|
|
1140
1140
|
}
|
|
1141
1141
|
return ft(o, "mousemove", A), ft(o, "mouseleave", Q), () => {
|
|
@@ -1243,7 +1243,7 @@ const ta = Sl.useToken, la = /* @__PURE__ */ ue({
|
|
|
1243
1243
|
setup(e) {
|
|
1244
1244
|
const n = Ut(), {
|
|
1245
1245
|
token: l
|
|
1246
|
-
} = ta(), a = x(), o = S(() =>
|
|
1246
|
+
} = ta(), a = x(), o = S(() => V(e.text) ? typeof e.text?.[0]?.children == "string" ? e.text?.[0]?.children : "" : e.text ? e.text.toString() : ""), i = S(() => e.column.tooltip === !1 ? {} : e.column.tooltip), c = S(() => e.column.tooltip === !1 ? 1 : we(i.value?.hiddenLine) && i.value?.hiddenLine > 0 ? i.value?.hiddenLine : 1);
|
|
1247
1247
|
function g() {
|
|
1248
1248
|
if (e.column?.tooltip === !1) return !1;
|
|
1249
1249
|
const d = a.value ? a.value.clientWidth : 0, R = we(i.value?.width) ? i.value?.width : d, v = Tt(o.value) ? Jt(o.value, {
|
|
@@ -1372,11 +1372,11 @@ const zt = /* @__PURE__ */ ue({
|
|
|
1372
1372
|
}, [I, e.settings?.length ? f("div", {
|
|
1373
1373
|
class: N(`${v}-setting-items`, d.value)
|
|
1374
1374
|
}, [e.settings.map((E, P) => {
|
|
1375
|
-
const
|
|
1375
|
+
const q = aa(E);
|
|
1376
1376
|
return f("div", {
|
|
1377
1377
|
key: P,
|
|
1378
1378
|
class: N(`${v}-setting-item`, d.value)
|
|
1379
|
-
}, [
|
|
1379
|
+
}, [q]);
|
|
1380
1380
|
})]) : null]);
|
|
1381
1381
|
}, L = () => !w.value && !u.value ? null : f("div", {
|
|
1382
1382
|
class: N(d.value, `${v}-container`, o.value && `${v}-container-mobile`)
|
|
@@ -1477,7 +1477,7 @@ function ca(e, n = !0, l) {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
function da({ scroll: e, columns: n, breakpoint: l, draggable: a, autoScroll: o, neverScroll: i }) {
|
|
1479
1479
|
const c = x([]);
|
|
1480
|
-
|
|
1480
|
+
Y([
|
|
1481
1481
|
() => e.value,
|
|
1482
1482
|
() => n.value,
|
|
1483
1483
|
() => l.value,
|
|
@@ -1556,8 +1556,8 @@ function va(e) {
|
|
|
1556
1556
|
autoRequest: i
|
|
1557
1557
|
};
|
|
1558
1558
|
}
|
|
1559
|
-
function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, dataSource: i, waitRequest: c, debounceTime: g }, { params: d, columns: R, setLoading: v, setColumns: T, removeRowKeys: m, syncSelectedRows: u, defaultFormSearch: w, setPagination: y, pageInfo: H, paginationInfo: L, onRequestError: I, onBeforeSearchSubmit: E, hasCustomRender: P },
|
|
1560
|
-
const
|
|
1559
|
+
function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, dataSource: i, waitRequest: c, debounceTime: g }, { params: d, columns: R, setLoading: v, setColumns: T, removeRowKeys: m, syncSelectedRows: u, defaultFormSearch: w, setPagination: y, pageInfo: H, paginationInfo: L, onRequestError: I, onBeforeSearchSubmit: E, hasCustomRender: P }, q) {
|
|
1560
|
+
const _ = x(""), A = x(!1), Q = x(!1), O = x([]), B = x(), z = x(null), D = (s = !1) => {
|
|
1561
1561
|
(A.value || s) && v(!1), pe(!1);
|
|
1562
1562
|
}, Z = async (s = {}) => {
|
|
1563
1563
|
const { pagination: p = {}, filters: h = {}, sorter: b = {}, removeKeys: r = [], isPolling: ee = !1, extra: ye } = s;
|
|
@@ -1566,9 +1566,9 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1566
1566
|
ee ? pe(!0) : v(!0), p && Object.keys(p).length && y(p);
|
|
1567
1567
|
try {
|
|
1568
1568
|
r.length && m(r);
|
|
1569
|
-
const
|
|
1569
|
+
const K = ae(b) ? Object.keys(b).length ? [b] : [] : b;
|
|
1570
1570
|
T(F(R).map((Te) => {
|
|
1571
|
-
const re =
|
|
1571
|
+
const re = K.find((Ce) => (Ce?.columnKey || Ce?.field) === Te.dataIndex);
|
|
1572
1572
|
return {
|
|
1573
1573
|
...Te,
|
|
1574
1574
|
sortOrder: re?.order
|
|
@@ -1585,20 +1585,20 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1585
1585
|
};
|
|
1586
1586
|
E && ze(E) && (Ae = await E({
|
|
1587
1587
|
params: Ae,
|
|
1588
|
-
sorter:
|
|
1588
|
+
sorter: K,
|
|
1589
1589
|
filter: h,
|
|
1590
1590
|
extra: ye
|
|
1591
1591
|
}));
|
|
1592
1592
|
let de = [];
|
|
1593
1593
|
const fe = `table_request_${$t().uuid(10)}`;
|
|
1594
|
-
|
|
1594
|
+
_.value = fe;
|
|
1595
1595
|
const Ne = await a?.({
|
|
1596
1596
|
params: J(ge(Ae)),
|
|
1597
|
-
sorter:
|
|
1597
|
+
sorter: K,
|
|
1598
1598
|
filter: h,
|
|
1599
1599
|
extra: ye
|
|
1600
1600
|
});
|
|
1601
|
-
if (
|
|
1601
|
+
if (_.value !== fe)
|
|
1602
1602
|
return [];
|
|
1603
1603
|
if (Ne) {
|
|
1604
1604
|
const { success: Te = !0, data: re = [] } = Ne;
|
|
@@ -1609,19 +1609,19 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1609
1609
|
Ce !== H.total && y({
|
|
1610
1610
|
total: Ce
|
|
1611
1611
|
});
|
|
1612
|
-
const De = F(
|
|
1613
|
-
return Ye(de, De) ? F(
|
|
1612
|
+
const De = F(O).map((qe) => Fe(qe, "sortIndex"));
|
|
1613
|
+
return Ye(de, De) ? F(O) : (ne(de), de);
|
|
1614
1614
|
} else
|
|
1615
1615
|
return [];
|
|
1616
|
-
} catch (
|
|
1616
|
+
} catch (K) {
|
|
1617
1617
|
if (I === void 0)
|
|
1618
|
-
throw new Error(
|
|
1619
|
-
|
|
1618
|
+
throw new Error(K);
|
|
1619
|
+
O.value === void 0 && ne([]), I(K);
|
|
1620
1620
|
} finally {
|
|
1621
|
-
|
|
1621
|
+
D(!0);
|
|
1622
1622
|
}
|
|
1623
1623
|
return [];
|
|
1624
|
-
},
|
|
1624
|
+
}, X = fa(async (s = {}) => {
|
|
1625
1625
|
if (B.value && clearTimeout(B.value), !a)
|
|
1626
1626
|
return;
|
|
1627
1627
|
const p = new AbortController();
|
|
@@ -1631,7 +1631,7 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1631
1631
|
Z(s),
|
|
1632
1632
|
new Promise((r, ee) => {
|
|
1633
1633
|
z.value?.signal?.addEventListener?.("abort", () => {
|
|
1634
|
-
ee("aborted"),
|
|
1634
|
+
ee("aborted"), X.cancel(), D();
|
|
1635
1635
|
});
|
|
1636
1636
|
})
|
|
1637
1637
|
]);
|
|
@@ -1639,7 +1639,7 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1639
1639
|
return;
|
|
1640
1640
|
const b = el(l.value, h);
|
|
1641
1641
|
return b && !A.value && (B.value = setTimeout(() => {
|
|
1642
|
-
|
|
1642
|
+
X.run({ ...s, isPolling: b });
|
|
1643
1643
|
}, Math.max(b, 2e3))), h;
|
|
1644
1644
|
} catch (h) {
|
|
1645
1645
|
if (h === "aborted")
|
|
@@ -1647,7 +1647,7 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1647
1647
|
throw h;
|
|
1648
1648
|
}
|
|
1649
1649
|
}, g.value || 30), ce = () => {
|
|
1650
|
-
z.value?.abort(),
|
|
1650
|
+
z.value?.abort(), X.cancel(), D();
|
|
1651
1651
|
};
|
|
1652
1652
|
tt(() => {
|
|
1653
1653
|
A.value = !1;
|
|
@@ -1657,35 +1657,35 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1657
1657
|
ce(), A.value = !0, clearTimeout(B.value);
|
|
1658
1658
|
}), Ct(() => {
|
|
1659
1659
|
ce(), A.value = !0, clearTimeout(B.value);
|
|
1660
|
-
}),
|
|
1661
|
-
c.value || (l.value ?
|
|
1662
|
-
}, { immediate: !0 }),
|
|
1663
|
-
c.value ? v(!0) :
|
|
1664
|
-
}, { immediate: !0 }),
|
|
1660
|
+
}), Y(() => l.value, () => {
|
|
1661
|
+
c.value || (l.value ? X.run({ isPolling: !0 }) : clearTimeout(B.value));
|
|
1662
|
+
}, { immediate: !0 }), Y(() => c.value, () => {
|
|
1663
|
+
c.value ? v(!0) : X.run({ isPolling: !1 });
|
|
1664
|
+
}, { immediate: !0 }), Y(() => i.value, () => {
|
|
1665
1665
|
i.value && ne(i.value || []);
|
|
1666
|
-
}, { deep: !0, immediate: !0 }),
|
|
1666
|
+
}, { deep: !0, immediate: !0 }), Y(() => d.value, () => {
|
|
1667
1667
|
c.value || n.value && (y({ current: 1 }), oe());
|
|
1668
|
-
}, { deep: !0, immediate: !0 }),
|
|
1668
|
+
}, { deep: !0, immediate: !0 }), Y(() => w.value, (s, p) => {
|
|
1669
1669
|
c.value || Ye(s, p) || (y({ current: 1 }), oe());
|
|
1670
1670
|
}, { deep: !0, immediate: !0 });
|
|
1671
1671
|
function oe() {
|
|
1672
|
-
a ? l.value || (ce(),
|
|
1672
|
+
a ? l.value || (ce(), X.run({ isPolling: !1 })) : ne(i.value || []);
|
|
1673
1673
|
}
|
|
1674
1674
|
const be = S(() => {
|
|
1675
1675
|
if (P.value)
|
|
1676
|
-
return F(
|
|
1676
|
+
return F(O);
|
|
1677
1677
|
const s = R.value.filter((p) => p.show || p.show === void 0);
|
|
1678
|
-
return !F(
|
|
1679
|
-
}), Ie = S(() => F(
|
|
1678
|
+
return !F(O) || !s || s.length === 0 ? [] : F(O);
|
|
1679
|
+
}), Ie = S(() => F(O).some((s) => V(s.children) && s.children.length > 0));
|
|
1680
1680
|
function pe(s) {
|
|
1681
1681
|
Q.value = s;
|
|
1682
1682
|
}
|
|
1683
1683
|
function ie(s, p = {}, h = {}, b) {
|
|
1684
|
-
ce(),
|
|
1684
|
+
ce(), X.run({ pagination: s, filters: p, sorter: h, extra: b, isPolling: !1 });
|
|
1685
1685
|
}
|
|
1686
1686
|
function ne(s) {
|
|
1687
1687
|
const p = tl(J(s), ge(H));
|
|
1688
|
-
if (
|
|
1688
|
+
if (O.value = p, !a || !ze(a)) {
|
|
1689
1689
|
const h = p.length || 0;
|
|
1690
1690
|
h !== H.total && y({
|
|
1691
1691
|
total: h
|
|
@@ -1700,28 +1700,28 @@ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1700
1700
|
const { key: p, row: h, value: b, type: r = "update" } = s, ee = p ?? e.value, ye = h?.[ee] ?? b;
|
|
1701
1701
|
switch (!h && r !== "delete" && console.warn("row is required"), r) {
|
|
1702
1702
|
case "update":
|
|
1703
|
-
ee && ye && h && (
|
|
1703
|
+
ee && ye && h && (O.value = O.value.map((K) => ye === K[ee] ? xe(K, h) : K));
|
|
1704
1704
|
break;
|
|
1705
1705
|
case "push":
|
|
1706
|
-
h &&
|
|
1706
|
+
h && O.value.push(h);
|
|
1707
1707
|
break;
|
|
1708
1708
|
case "unshift":
|
|
1709
|
-
h &&
|
|
1709
|
+
h && O.value.unshift(h);
|
|
1710
1710
|
break;
|
|
1711
1711
|
case "delete":
|
|
1712
|
-
ee && (
|
|
1712
|
+
ee && (O.value = O.value.filter((K) => b !== K[ee]));
|
|
1713
1713
|
break;
|
|
1714
1714
|
}
|
|
1715
1715
|
},
|
|
1716
1716
|
handleTableChange: ie,
|
|
1717
1717
|
run: async (s) => {
|
|
1718
|
-
c.value || (a ? await
|
|
1718
|
+
c.value || (a ? await X.run({ ...s, isPolling: !1 }) : q("reload"));
|
|
1719
1719
|
}
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
1722
|
function ha(e) {
|
|
1723
1723
|
const n = x(l(e.loading.value));
|
|
1724
|
-
|
|
1724
|
+
Y(() => e.loading.value, (o) => {
|
|
1725
1725
|
n.value = l(o, n.value);
|
|
1726
1726
|
});
|
|
1727
1727
|
function l(o, i = !1) {
|
|
@@ -1751,7 +1751,7 @@ function ga({
|
|
|
1751
1751
|
pageSize: We.pageSize,
|
|
1752
1752
|
total: 0
|
|
1753
1753
|
});
|
|
1754
|
-
|
|
1754
|
+
Y(() => e.value, () => {
|
|
1755
1755
|
if (e.value === !1) {
|
|
1756
1756
|
l.value = !1;
|
|
1757
1757
|
return;
|
|
@@ -1793,12 +1793,12 @@ function ga({
|
|
|
1793
1793
|
}
|
|
1794
1794
|
function ba(e, n) {
|
|
1795
1795
|
const l = x([]), a = x([]);
|
|
1796
|
-
|
|
1796
|
+
Y(() => n.value?.selectedRows, (v) => {
|
|
1797
1797
|
a.value = J(v || []);
|
|
1798
1798
|
}, {
|
|
1799
1799
|
deep: !0,
|
|
1800
1800
|
immediate: !0
|
|
1801
|
-
}),
|
|
1801
|
+
}), Y(() => n.value?.selectedRowKeys, (v) => {
|
|
1802
1802
|
l.value = nl([...v || []]);
|
|
1803
1803
|
}, {
|
|
1804
1804
|
deep: !0,
|
|
@@ -1908,7 +1908,7 @@ function Sa({ fitPage: e, hashId: n, scroll: l, baseClassName: a }) {
|
|
|
1908
1908
|
}), w = Ee(() => i.value?.querySelector(".ant-table-body>table"), (A) => {
|
|
1909
1909
|
A && (R.value = A);
|
|
1910
1910
|
});
|
|
1911
|
-
}),
|
|
1911
|
+
}), Y(() => l.value, (A) => {
|
|
1912
1912
|
m && m(), A.y || e.value ? m = Ee(() => i.value?.querySelector(".ant-table-body"), (Q) => {
|
|
1913
1913
|
Q && (d.value = Q);
|
|
1914
1914
|
}) : A.x && (m = Ee(() => i.value?.querySelector(".ant-table-content"), (Q) => {
|
|
@@ -1920,12 +1920,12 @@ function Sa({ fitPage: e, hashId: n, scroll: l, baseClassName: a }) {
|
|
|
1920
1920
|
return 0;
|
|
1921
1921
|
let A = 0;
|
|
1922
1922
|
if (c.value) {
|
|
1923
|
-
const
|
|
1923
|
+
const O = getComputedStyle(c.value), B = Number.parseFloat(O.marginTop) || 0, z = Number.parseFloat(O.marginBottom) || 0;
|
|
1924
1924
|
A = B + z;
|
|
1925
1925
|
}
|
|
1926
1926
|
return y.value - H.value - v.value - (I.value + A);
|
|
1927
1927
|
}), P = S(() => E.value && e.value ? L.value <= E.value : !1);
|
|
1928
|
-
|
|
1928
|
+
Y([
|
|
1929
1929
|
() => d.value,
|
|
1930
1930
|
() => E.value
|
|
1931
1931
|
], () => {
|
|
@@ -1935,21 +1935,21 @@ function Sa({ fitPage: e, hashId: n, scroll: l, baseClassName: a }) {
|
|
|
1935
1935
|
d.value && o.value?.handleScroll(d.value);
|
|
1936
1936
|
}
|
|
1937
1937
|
});
|
|
1938
|
-
const
|
|
1938
|
+
const q = () => {
|
|
1939
1939
|
o.value?.update();
|
|
1940
1940
|
};
|
|
1941
|
-
gl(d,
|
|
1941
|
+
gl(d, q), tt(() => {
|
|
1942
1942
|
lt(() => {
|
|
1943
|
-
|
|
1943
|
+
q();
|
|
1944
1944
|
});
|
|
1945
|
-
}), Vt(() =>
|
|
1946
|
-
function
|
|
1945
|
+
}), Vt(() => q());
|
|
1946
|
+
function _() {
|
|
1947
1947
|
T && T(), m && m(), u && u(), w && w();
|
|
1948
1948
|
}
|
|
1949
1949
|
return yt(() => {
|
|
1950
|
-
|
|
1950
|
+
_();
|
|
1951
1951
|
}), Ct(() => {
|
|
1952
|
-
|
|
1952
|
+
_ && _();
|
|
1953
1953
|
}), _l({
|
|
1954
1954
|
className: `${a}-scroll`,
|
|
1955
1955
|
hashId: n,
|
|
@@ -1971,7 +1971,7 @@ function xa(e) {
|
|
|
1971
1971
|
return e.forEach((l) => {
|
|
1972
1972
|
let a = l.initialValue;
|
|
1973
1973
|
const o = ["treeSelect", "numberRange"];
|
|
1974
|
-
l.valueType && !a && o.includes(l.valueType) && (a = []), l.name && (n[l.name] = a), l.valueType === "dateRange" && (l.rangeStartName || l.rangeEndName) && (n[l.rangeStartName || "start"] =
|
|
1974
|
+
l.valueType && !a && o.includes(l.valueType) && (a = []), l.name && (n[l.name] = a), l.valueType === "dateRange" && (l.rangeStartName || l.rangeEndName) && (n[l.rangeStartName || "start"] = V(a) ? a[0] : void 0, n[l.rangeEndName || "end"] = V(a) ? a[1] : void 0, delete n[l.name]);
|
|
1975
1975
|
}), n;
|
|
1976
1976
|
}
|
|
1977
1977
|
function wa({ searchMap: e, columns: n }) {
|
|
@@ -1983,10 +1983,10 @@ function wa({ searchMap: e, columns: n }) {
|
|
|
1983
1983
|
const c = xa(i);
|
|
1984
1984
|
a.value = { ...a.value, ...c };
|
|
1985
1985
|
}
|
|
1986
|
-
return
|
|
1986
|
+
return Y(() => e.value, () => {
|
|
1987
1987
|
const i = [];
|
|
1988
1988
|
e.value?.forEach((c) => i.push(c)), i.length && o(i);
|
|
1989
|
-
}, { deep: !0, immediate: !0 }),
|
|
1989
|
+
}, { deep: !0, immediate: !0 }), Y(() => n.value, () => {
|
|
1990
1990
|
const i = [];
|
|
1991
1991
|
n.value && n.value?.length && n.value.forEach((c) => {
|
|
1992
1992
|
c.searchConfig && i.push(c.searchConfig);
|
|
@@ -2009,7 +2009,7 @@ function Ta({ scroll: e, columns: n, autoScroll: l, modalScroll: a, neverScroll:
|
|
|
2009
2009
|
}
|
|
2010
2010
|
function Ra(e) {
|
|
2011
2011
|
const n = x(e.size.value || "middle");
|
|
2012
|
-
|
|
2012
|
+
Y(() => e.size.value, (a) => n.value = a);
|
|
2013
2013
|
function l(a) {
|
|
2014
2014
|
n.value = a || n.value;
|
|
2015
2015
|
}
|
|
@@ -2348,60 +2348,62 @@ const $a = (e) => ({
|
|
|
2348
2348
|
searchText: "查询"
|
|
2349
2349
|
};
|
|
2350
2350
|
return ae(e.form) ? xe(C, e.form) : C;
|
|
2351
|
-
}), E = S(() => I.value === !1 ? {} : I.value), P = S(() => E.value?.autoRequest ?? e.autoRequest),
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2351
|
+
}), E = S(() => I.value === !1 ? {} : I.value), P = S(() => E.value?.autoRequest ?? e.autoRequest), q = S(() => E.value?.actions), _ = S(() => {
|
|
2352
|
+
function C(M) {
|
|
2353
|
+
return M.filter(($) => $.key || $.dataIndex).filter(($) => $.show ?? !0).map(($, j) => {
|
|
2354
|
+
const W = $.key || $.dataIndex;
|
|
2355
|
+
return $.key = W, $.order = j, $.dataIndex = W, $.align = $.align || e.align || "left", $.uuid = $.uuid || $t().uuid(15), $.children && ($.children = C($.children)), $;
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
return rl(C(J(e.columns || [])), {
|
|
2357
2359
|
align: e.align || "left",
|
|
2358
2360
|
showIndex: e.showIndex ?? !1
|
|
2359
2361
|
});
|
|
2360
2362
|
}), [A, Q] = ha({
|
|
2361
|
-
loading:
|
|
2362
|
-
}), [
|
|
2363
|
-
size:
|
|
2363
|
+
loading: k(e, "loading")
|
|
2364
|
+
}), [O, B] = Ra({
|
|
2365
|
+
size: k(e, "size")
|
|
2364
2366
|
}), {
|
|
2365
2367
|
paginationInfo: z,
|
|
2366
|
-
requestPagination:
|
|
2368
|
+
requestPagination: D,
|
|
2367
2369
|
setPagination: Z
|
|
2368
2370
|
} = ga({
|
|
2369
|
-
pagination:
|
|
2371
|
+
pagination: k(e, "pagination"),
|
|
2370
2372
|
pageItemRender: dt({
|
|
2371
2373
|
slots: l,
|
|
2372
2374
|
props: e,
|
|
2373
2375
|
key: "pageItemRender"
|
|
2374
2376
|
})
|
|
2375
2377
|
}), {
|
|
2376
|
-
proScroll:
|
|
2378
|
+
proScroll: X,
|
|
2377
2379
|
breakpoint: ce
|
|
2378
2380
|
} = Ta({
|
|
2379
|
-
scroll:
|
|
2380
|
-
autoScroll:
|
|
2381
|
-
modalScroll:
|
|
2382
|
-
neverScroll:
|
|
2383
|
-
rowSelection:
|
|
2384
|
-
scrollBreakpoint:
|
|
2381
|
+
scroll: k(e, "scroll"),
|
|
2382
|
+
autoScroll: k(e, "autoScroll"),
|
|
2383
|
+
modalScroll: k(e, "modalScroll"),
|
|
2384
|
+
neverScroll: k(e, "neverScroll"),
|
|
2385
|
+
rowSelection: k(e, "rowSelection"),
|
|
2386
|
+
scrollBreakpoint: k(e, "scrollBreakpoint"),
|
|
2385
2387
|
innerWidth: d,
|
|
2386
|
-
columns:
|
|
2388
|
+
columns: _,
|
|
2387
2389
|
screens: g
|
|
2388
2390
|
}), {
|
|
2389
2391
|
proColumns: oe,
|
|
2390
2392
|
setColumns: be,
|
|
2391
2393
|
resizeColumnWidth: Ie
|
|
2392
2394
|
} = da({
|
|
2393
|
-
draggable:
|
|
2394
|
-
neverScroll:
|
|
2395
|
-
autoScroll:
|
|
2395
|
+
draggable: k(e, "draggable"),
|
|
2396
|
+
neverScroll: k(e, "neverScroll"),
|
|
2397
|
+
autoScroll: k(e, "autoScroll"),
|
|
2396
2398
|
breakpoint: ce,
|
|
2397
|
-
scroll:
|
|
2398
|
-
columns:
|
|
2399
|
+
scroll: X,
|
|
2400
|
+
columns: _
|
|
2399
2401
|
}), {
|
|
2400
2402
|
formCols: pe,
|
|
2401
2403
|
defaultFormSearch: ie
|
|
2402
2404
|
} = wa({
|
|
2403
|
-
searchMap:
|
|
2404
|
-
columns:
|
|
2405
|
+
searchMap: k(e, "searchMap"),
|
|
2406
|
+
columns: _
|
|
2405
2407
|
}), {
|
|
2406
2408
|
selectedKeys: ne,
|
|
2407
2409
|
selectedItems: t,
|
|
@@ -2411,8 +2413,8 @@ const $a = (e) => ({
|
|
|
2411
2413
|
syncSelectedRows: b,
|
|
2412
2414
|
removeRowKeys: r,
|
|
2413
2415
|
clearAllRowKeys: ee
|
|
2414
|
-
} = ba(
|
|
2415
|
-
run:
|
|
2416
|
+
} = ba(k(e, "rowKey"), k(e, "rowSelection")), ye = va(e), {
|
|
2417
|
+
run: K,
|
|
2416
2418
|
setTableDataList: nt,
|
|
2417
2419
|
operateTableDataRow: Ae,
|
|
2418
2420
|
isTreeDataRef: de,
|
|
@@ -2424,7 +2426,7 @@ const $a = (e) => ({
|
|
|
2424
2426
|
}, {
|
|
2425
2427
|
loading: A,
|
|
2426
2428
|
paginationInfo: z,
|
|
2427
|
-
pageInfo:
|
|
2429
|
+
pageInfo: D,
|
|
2428
2430
|
setPagination: Z,
|
|
2429
2431
|
removeRowKeys: r,
|
|
2430
2432
|
syncSelectedRows: b,
|
|
@@ -2432,7 +2434,7 @@ const $a = (e) => ({
|
|
|
2432
2434
|
setColumns: be,
|
|
2433
2435
|
columns: oe,
|
|
2434
2436
|
defaultFormSearch: ie,
|
|
2435
|
-
params:
|
|
2437
|
+
params: k(e, "params"),
|
|
2436
2438
|
onRequestError: e.onRequestError,
|
|
2437
2439
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit,
|
|
2438
2440
|
hasCustomRender: S(() => Ve(e.customRender || l?.customRender))
|
|
@@ -2445,20 +2447,20 @@ const $a = (e) => ({
|
|
|
2445
2447
|
barRef: Ot
|
|
2446
2448
|
} = Sa({
|
|
2447
2449
|
hashId: c,
|
|
2448
|
-
scroll:
|
|
2450
|
+
scroll: X,
|
|
2449
2451
|
baseClassName: o,
|
|
2450
|
-
fitPage:
|
|
2452
|
+
fitPage: k(e, "fitPage")
|
|
2451
2453
|
}), ot = S(() => {
|
|
2452
2454
|
const C = re.value && e.fitPage ? {
|
|
2453
2455
|
y: re.value
|
|
2454
2456
|
} : {};
|
|
2455
2457
|
return {
|
|
2456
|
-
...F(
|
|
2458
|
+
...F(X),
|
|
2457
2459
|
...C
|
|
2458
2460
|
};
|
|
2459
2461
|
}), Dt = S(() => ({
|
|
2460
2462
|
...Fe(e, Object.keys(Ue).concat(["style", "class", "loading", "rowKey", "transformCellText", "rowSelection", "onChange", "onExpandedRowsChange", "onExpand", "onResizeColumn"])),
|
|
2461
|
-
size: F(
|
|
2463
|
+
size: F(O),
|
|
2462
2464
|
scroll: F(ot),
|
|
2463
2465
|
dataSource: F(fe),
|
|
2464
2466
|
pagination: F(z),
|
|
@@ -2472,12 +2474,12 @@ const $a = (e) => ({
|
|
|
2472
2474
|
};
|
|
2473
2475
|
}), jt = S(() => {
|
|
2474
2476
|
let C;
|
|
2475
|
-
const
|
|
2476
|
-
if (
|
|
2477
|
-
const
|
|
2478
|
-
!
|
|
2477
|
+
const M = e.direction === "rtl" ? "bottomLeft" : "right", $ = F(z)?.position;
|
|
2478
|
+
if ($ !== null && Array.isArray($)) {
|
|
2479
|
+
const j = $.find((se) => se.includes("top")), W = $.find((se) => se.includes("bottom")), ve = $.every((se) => `${se}` == "none");
|
|
2480
|
+
!j && !W && !ve && (C = M), j && (C = j.toLowerCase().replace("top", "")), W && (C = W.toLowerCase().replace("bottom", ""));
|
|
2479
2481
|
} else
|
|
2480
|
-
C =
|
|
2482
|
+
C = M;
|
|
2481
2483
|
return C;
|
|
2482
2484
|
});
|
|
2483
2485
|
function rt() {
|
|
@@ -2488,26 +2490,26 @@ const $a = (e) => ({
|
|
|
2488
2490
|
};
|
|
2489
2491
|
}
|
|
2490
2492
|
ca(() => {
|
|
2491
|
-
R.value ? e.keepAliveReload &&
|
|
2493
|
+
R.value ? e.keepAliveReload && K({
|
|
2492
2494
|
params: rt()
|
|
2493
2495
|
}) : R.value = !0;
|
|
2494
2496
|
});
|
|
2495
|
-
const Ht = async (C,
|
|
2497
|
+
const Ht = async (C, M) => {
|
|
2496
2498
|
if (P.value) {
|
|
2497
|
-
|
|
2499
|
+
K({
|
|
2498
2500
|
params: C
|
|
2499
2501
|
});
|
|
2500
2502
|
return;
|
|
2501
2503
|
}
|
|
2502
|
-
|
|
2504
|
+
M === "reset" ? (n("reset", C), e.request && q.value?.resetReload && K({
|
|
2503
2505
|
params: C
|
|
2504
|
-
})) : e.request && (n("submit", C),
|
|
2506
|
+
})) : e.request && (n("submit", C), K({
|
|
2505
2507
|
params: C
|
|
2506
2508
|
}));
|
|
2507
|
-
}, Ke = (C, $,
|
|
2508
|
-
Ne(C, $,
|
|
2509
|
-
}, Lt = (C) => e.onExpandedRowsChange?.(C), Wt = (C,
|
|
2510
|
-
Ie(C,
|
|
2509
|
+
}, Ke = (C, M, $, j) => {
|
|
2510
|
+
Ne(C, M, $, j), e.onChange?.(C, M, $, j);
|
|
2511
|
+
}, Lt = (C) => e.onExpandedRowsChange?.(C), Wt = (C, M) => e.onExpand?.(C, M), Yt = (C, M) => {
|
|
2512
|
+
Ie(C, M), e.onResizeColumn?.(C, M);
|
|
2511
2513
|
};
|
|
2512
2514
|
function st() {
|
|
2513
2515
|
const C = cl({
|
|
@@ -2516,11 +2518,11 @@ const $a = (e) => ({
|
|
|
2516
2518
|
key: "emptyText"
|
|
2517
2519
|
});
|
|
2518
2520
|
if (C !== !1 && v?.emptyText?.value !== !1) {
|
|
2519
|
-
const
|
|
2521
|
+
const $ = e.emptyTextProps?.extraProps || {}, j = C || v?.emptyText?.value, W = le(j), ve = W ? gt(j, $) : wt(V(j) ? j : [j]);
|
|
2520
2522
|
return f("div", {
|
|
2521
2523
|
class: N(`${o}-empty-text`, c.value, e.emptyTextProps?.class),
|
|
2522
2524
|
style: e.emptyTextProps?.style
|
|
2523
|
-
}, [
|
|
2525
|
+
}, [W ? ve : V(ve) && ve.length ? ve.map((se) => Ze(se, $)) : f(At, {
|
|
2524
2526
|
image: Aa
|
|
2525
2527
|
}, null)]);
|
|
2526
2528
|
}
|
|
@@ -2534,10 +2536,10 @@ const $a = (e) => ({
|
|
|
2534
2536
|
});
|
|
2535
2537
|
if (C) {
|
|
2536
2538
|
if (fe.value?.length) {
|
|
2537
|
-
const
|
|
2539
|
+
const M = J(F(fe));
|
|
2538
2540
|
return C?.({
|
|
2539
|
-
dataSource:
|
|
2540
|
-
currentData: Ca(
|
|
2541
|
+
dataSource: M,
|
|
2542
|
+
currentData: Ca(M, z.value)
|
|
2541
2543
|
});
|
|
2542
2544
|
}
|
|
2543
2545
|
return st();
|
|
@@ -2548,20 +2550,20 @@ const $a = (e) => ({
|
|
|
2548
2550
|
hashId: c,
|
|
2549
2551
|
prefixCls: o,
|
|
2550
2552
|
tableScrollState: ot,
|
|
2551
|
-
tableSize:
|
|
2553
|
+
tableSize: O,
|
|
2552
2554
|
columns: oe,
|
|
2553
|
-
cacheColumns:
|
|
2555
|
+
cacheColumns: _,
|
|
2554
2556
|
isMobile: H,
|
|
2555
2557
|
formConfig: E,
|
|
2556
2558
|
formAutoRequest: P,
|
|
2557
|
-
formActions:
|
|
2559
|
+
formActions: q,
|
|
2558
2560
|
screenWidth: d,
|
|
2559
2561
|
tableListToolsHeight: Ce,
|
|
2560
|
-
styles:
|
|
2561
|
-
classNames:
|
|
2562
|
+
styles: k(e, "styles"),
|
|
2563
|
+
classNames: k(e, "classNames"),
|
|
2562
2564
|
action: {
|
|
2563
2565
|
setTableSize: B,
|
|
2564
|
-
reload: (C) =>
|
|
2566
|
+
reload: (C) => K(C),
|
|
2565
2567
|
toggle: w
|
|
2566
2568
|
},
|
|
2567
2569
|
setPagination: Z
|
|
@@ -2576,7 +2578,7 @@ const $a = (e) => ({
|
|
|
2576
2578
|
actionRef: () => ({
|
|
2577
2579
|
loading: A,
|
|
2578
2580
|
dataSource: fe,
|
|
2579
|
-
pageInfo:
|
|
2581
|
+
pageInfo: D,
|
|
2580
2582
|
pagination: z.value,
|
|
2581
2583
|
selectedKeys: S(() => ne.value),
|
|
2582
2584
|
selectedItems: S(() => t.value),
|
|
@@ -2587,12 +2589,12 @@ const $a = (e) => ({
|
|
|
2587
2589
|
sync: b,
|
|
2588
2590
|
selectAll: h
|
|
2589
2591
|
},
|
|
2590
|
-
reload:
|
|
2592
|
+
reload: K,
|
|
2591
2593
|
getLoadingStatus: () => F(A),
|
|
2592
2594
|
reloadAndReset: async (C) => {
|
|
2593
2595
|
u.value = !0, Z({
|
|
2594
2596
|
current: 1,
|
|
2595
|
-
pageSize:
|
|
2597
|
+
pageSize: D?.pageSize || 10
|
|
2596
2598
|
}), C && C?.callBack && (C.wait ? await C.callBack() : C.callBack()), m.value?.resetForm(!0), u.value = !1;
|
|
2597
2599
|
},
|
|
2598
2600
|
setPageInfo: Ke,
|
|
@@ -2602,7 +2604,7 @@ const $a = (e) => ({
|
|
|
2602
2604
|
setLoading: Q
|
|
2603
2605
|
})
|
|
2604
2606
|
}), () => {
|
|
2605
|
-
const C = Ve(e.customRender || l.customRender),
|
|
2607
|
+
const C = Ve(e.customRender || l.customRender), M = l.actions?.() || e.actionProps?.actions, $ = sl({
|
|
2606
2608
|
slots: l,
|
|
2607
2609
|
props: e,
|
|
2608
2610
|
keys: ["headerTitle", "headerTitleTip", "listToolAfter"],
|
|
@@ -2611,7 +2613,7 @@ const $a = (e) => ({
|
|
|
2611
2613
|
return i(f("div", {
|
|
2612
2614
|
ref: T,
|
|
2613
2615
|
class: N(o, c.value, e.class, e.classNames?.root, [{
|
|
2614
|
-
[`${o}-no-scroll`]: !Object.keys(F(
|
|
2616
|
+
[`${o}-no-scroll`]: !Object.keys(F(X) || {}).length,
|
|
2615
2617
|
[`${o}-table-tree`]: de.value,
|
|
2616
2618
|
[`${o}-full-page`]: e.fitPage,
|
|
2617
2619
|
[`${o}-full-screen`]: y.value
|
|
@@ -2644,10 +2646,10 @@ const $a = (e) => ({
|
|
|
2644
2646
|
} : !1,
|
|
2645
2647
|
titleTipText: e.titleTipText,
|
|
2646
2648
|
actionsPlacement: e.actionProps?.placement,
|
|
2647
|
-
actionsRender:
|
|
2648
|
-
headerTitle:
|
|
2649
|
-
listToolAfter:
|
|
2650
|
-
headerTitleTip:
|
|
2649
|
+
actionsRender: M,
|
|
2650
|
+
headerTitle: $.headerTitle,
|
|
2651
|
+
listToolAfter: $.listToolAfter,
|
|
2652
|
+
headerTitleTip: $.headerTitleTip
|
|
2651
2653
|
}, null), C ? f(It, it.value, {
|
|
2652
2654
|
default: () => [f("div", {
|
|
2653
2655
|
class: N(`${o}-list ${c.value}`, e.classNames?.list),
|
|
@@ -2661,33 +2663,33 @@ const $a = (e) => ({
|
|
|
2661
2663
|
}, [Mt()]), e.pagination !== !1 && fe.value?.length > 0 && f(xl, G(ge(F(z)), {
|
|
2662
2664
|
class: N(c.value, `${o}-pagination`, `${o}-pagination-${jt.value}`, e.classNames?.pagination),
|
|
2663
2665
|
style: e.styles?.pagination,
|
|
2664
|
-
onChange: (
|
|
2665
|
-
current:
|
|
2666
|
-
pageSize:
|
|
2666
|
+
onChange: (j, W) => Ke({
|
|
2667
|
+
current: j,
|
|
2668
|
+
pageSize: W
|
|
2667
2669
|
})
|
|
2668
2670
|
}), null)])]
|
|
2669
2671
|
}) : f($e, null, [f(wl, G(Tl(e, Object.keys(Ue)), F(Dt), {
|
|
2670
2672
|
style: e.styles?.table,
|
|
2671
2673
|
class: N(e.classNames?.table, c.value, qe.value && `${o}-overflow-hidden`),
|
|
2672
2674
|
loading: it.value,
|
|
2673
|
-
rowKey: (
|
|
2674
|
-
transformCellText: (
|
|
2675
|
-
e.transformCellText && typeof e.transformCellText == "function" && e.transformCellText?.(
|
|
2675
|
+
rowKey: (j) => j[e.rowKey],
|
|
2676
|
+
transformCellText: (j) => {
|
|
2677
|
+
e.transformCellText && typeof e.transformCellText == "function" && e.transformCellText?.(j);
|
|
2676
2678
|
const {
|
|
2677
|
-
column:
|
|
2679
|
+
column: W,
|
|
2678
2680
|
record: ve
|
|
2679
|
-
} =
|
|
2680
|
-
if (!
|
|
2681
|
-
const se =
|
|
2682
|
-
let te =
|
|
2683
|
-
|
|
2684
|
-
const je =
|
|
2681
|
+
} = j;
|
|
2682
|
+
if (!W) return j.text;
|
|
2683
|
+
const se = W?.key || W?.dataIndex;
|
|
2684
|
+
let te = j.text;
|
|
2685
|
+
V(te) && (te.length === 0 || te.length === 1 && !le(te[0]) ? (te = te?.[0], te = ya(te, W?.valueType || e.columns?.find((ct) => (ct.key || ct.dataIndex) === se)?.valueType, o, c.value)) : te[0]?.type === "template" && (te = te[0]?.children));
|
|
2686
|
+
const je = W?.columnEmptyText || e?.columnEmptyText, {
|
|
2685
2687
|
value: ut,
|
|
2686
2688
|
success: qt
|
|
2687
2689
|
} = ul(te, je ? typeof je == "function" ? je(ve) : je : "");
|
|
2688
|
-
return qt &&
|
|
2690
|
+
return qt && W?.ellipsis && te ? f(la, {
|
|
2689
2691
|
text: ut,
|
|
2690
|
-
column:
|
|
2692
|
+
column: W,
|
|
2691
2693
|
className: o,
|
|
2692
2694
|
hashId: c.value
|
|
2693
2695
|
}, null) : ut;
|
|
@@ -2703,7 +2705,7 @@ const $a = (e) => ({
|
|
|
2703
2705
|
onChange: Ke,
|
|
2704
2706
|
onExpandedRowsChange: Lt,
|
|
2705
2707
|
onExpand: Wt,
|
|
2706
|
-
onResizeColumn: (
|
|
2708
|
+
onResizeColumn: (j, W) => Yt(j, W)
|
|
2707
2709
|
}), {
|
|
2708
2710
|
...l,
|
|
2709
2711
|
emptyText: () => st()
|
|
@@ -2735,16 +2737,16 @@ function Va(e, n) {
|
|
|
2735
2737
|
const a = et(xe(l(), {
|
|
2736
2738
|
request: n?.request
|
|
2737
2739
|
}));
|
|
2738
|
-
n?.state &&
|
|
2740
|
+
n?.state && Y(() => n.state && ke(n.state) ? n.state.value : n.state, () => {
|
|
2739
2741
|
d();
|
|
2740
2742
|
}, { deep: !0 });
|
|
2741
2743
|
const o = S(() => e.value ? e.value.actionRef() : {}), i = S(() => e.value ? e.value.formRef() : {}), c = S(() => ({
|
|
2742
2744
|
...o.value.pageInfo || {},
|
|
2743
2745
|
...i.value.getFormSearch?.() || {}
|
|
2744
2746
|
})), g = x(!!o.value.loading?.value);
|
|
2745
|
-
|
|
2747
|
+
Y(() => o.value.loading?.value, (v) => {
|
|
2746
2748
|
g.value = !!v;
|
|
2747
|
-
}),
|
|
2749
|
+
}), Y(g, (v) => {
|
|
2748
2750
|
o.value?.setLoading?.(!!v);
|
|
2749
2751
|
});
|
|
2750
2752
|
function d() {
|