@gx-design-vue/pro-table 0.2.0-alpha.14 → 0.2.0-alpha.15
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/ProTable.js +9 -0
- package/dist/components/ScrollBar/Bar.d.ts +1 -1
- package/dist/components/ScrollBar/Thumb.d.ts +1 -1
- package/dist/components/SearchForm/CollapseToggle.d.ts +1 -1
- package/dist/components/SearchForm/FormItemContainer.d.ts +1 -1
- package/dist/components/SearchForm/FormItemWrapper.d.ts +1 -1
- package/dist/components/SearchForm/SearchForm.d.ts +4 -4
- package/dist/components/Toolbar/ListToolBar.d.ts +8 -8
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/hooks/useTable.js +6 -4
- package/dist/pro-table.esm.js +214 -205
- package/dist/pro-table.js +1 -1
- package/package.json +2 -2
package/dist/pro-table.esm.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createInjectionState as e, useBreakpoints as t, useDebounceFn as n, useElementSize as r, useEventListener as i, useFullscreen as a, useMutationObserver as o, useResizeObserver as s, useScroll as c, useWindowSize as l } from "@vueuse/core";
|
|
2
|
-
import { Comment as u, Fragment as d, Teleport as f, Text as p, computed as m, createVNode as h, defineComponent as g, getCurrentInstance as _, h as v, isVNode as y, mergeDefaults as b, mergeProps as x, nextTick as S, onActivated as C, onBeforeUnmount as w, onDeactivated as T, onMounted as E, onScopeDispose as D, onUnmounted as
|
|
2
|
+
import { Comment as u, Fragment as d, Teleport as f, Text as p, computed as m, createVNode as h, defineComponent as g, getCurrentInstance as _, h as v, isVNode as y, mergeDefaults as b, mergeProps as x, nextTick as S, onActivated as C, onBeforeUnmount as w, onDeactivated as T, onMounted as E, onScopeDispose as D, onUnmounted as ee, reactive as O, ref as k, shallowRef as A, toRaw as j, toRef as M, toValue as N, unref as te, watch as P, watchEffect as ne } from "vue";
|
|
3
3
|
import { proGenStyleHooks as re, unit as F, useProConfigContext as ie } from "@gx-design-vue/pro-provider";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useBaseConfig as
|
|
6
|
-
import
|
|
7
|
-
import { GIcon as
|
|
4
|
+
import { Button as ae, Cascader as I, DatePicker as L, Input as oe, InputNumber as R, Pagination as z, Select as se, SpaceCompact as ce, Spin as le, Table as ue, TimePicker as de, Tooltip as fe, TreeSelect as pe } from "antdv-next";
|
|
5
|
+
import { useBaseConfig as me } from "antdv-next/config-provider/context";
|
|
6
|
+
import he from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
7
|
+
import { GIcon as B } from "@gx-design-vue/icon";
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
|
-
var
|
|
10
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
9
|
+
var ge = Object.create, _e = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, ye = Object.getOwnPropertyNames, be = Object.getPrototypeOf, xe = Object.prototype.hasOwnProperty, Se = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Ce = (e, t, n, r) => {
|
|
10
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = ye(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !xe.call(e, s) && s !== n && _e(e, s, {
|
|
11
11
|
get: ((e) => t[e]).bind(null, s),
|
|
12
|
-
enumerable: !(r =
|
|
12
|
+
enumerable: !(r = ve(t, s)) || r.enumerable
|
|
13
13
|
});
|
|
14
14
|
return e;
|
|
15
|
-
},
|
|
15
|
+
}, V = (e, t, n) => (n = e == null ? {} : ge(be(e)), Ce(t || !e || !e.__esModule ? _e(n, "default", {
|
|
16
16
|
value: e,
|
|
17
17
|
enumerable: !0
|
|
18
|
-
}) : n, e)), [
|
|
18
|
+
}) : n, e)), [we, Te] = e((e) => e), Ee = [
|
|
19
19
|
{
|
|
20
20
|
breakpoint: "xxl",
|
|
21
21
|
span: 4
|
|
@@ -40,7 +40,7 @@ var me = Object.create, he = Object.defineProperty, ge = Object.getOwnPropertyDe
|
|
|
40
40
|
breakpoint: "xs",
|
|
41
41
|
span: 1
|
|
42
42
|
}
|
|
43
|
-
],
|
|
43
|
+
], De = {
|
|
44
44
|
xs: 0,
|
|
45
45
|
sm: 576,
|
|
46
46
|
md: 768,
|
|
@@ -48,8 +48,8 @@ var me = Object.create, he = Object.defineProperty, ge = Object.getOwnPropertyDe
|
|
|
48
48
|
xl: 1200,
|
|
49
49
|
xxl: 1600
|
|
50
50
|
};
|
|
51
|
-
function
|
|
52
|
-
let e = t(
|
|
51
|
+
function Oe() {
|
|
52
|
+
let e = t(De), { width: n } = l(), r = m(() => ({
|
|
53
53
|
xs: e.isGreaterOrEqual("xs"),
|
|
54
54
|
sm: e.isGreaterOrEqual("sm"),
|
|
55
55
|
md: e.isGreaterOrEqual("md"),
|
|
@@ -58,7 +58,7 @@ function De() {
|
|
|
58
58
|
xxl: e.isGreaterOrEqual("xxl")
|
|
59
59
|
})), i = m(() => !r.value.xl);
|
|
60
60
|
function a(e, t) {
|
|
61
|
-
return t && typeof t == "object" && Object.keys(t).length > 0 ?
|
|
61
|
+
return t && typeof t == "object" && Object.keys(t).length > 0 ? H(t, n.value) : ke(e, r.value);
|
|
62
62
|
}
|
|
63
63
|
return {
|
|
64
64
|
screens: r,
|
|
@@ -67,7 +67,7 @@ function De() {
|
|
|
67
67
|
getRowItemsPerBreakpoint: a
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function H(e, t) {
|
|
71
71
|
let n = 4, r = Object.keys(e).map(Number).filter((e) => !Number.isNaN(e)).sort((e, t) => t - e);
|
|
72
72
|
for (let i of r) if (e[i] && t >= i) {
|
|
73
73
|
n = e[i];
|
|
@@ -75,12 +75,12 @@ function U(e, t) {
|
|
|
75
75
|
}
|
|
76
76
|
return n;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ke(e, t) {
|
|
79
79
|
let n = 4;
|
|
80
|
-
for (let r = 0; r <
|
|
81
|
-
let i =
|
|
80
|
+
for (let r = 0; r < Ee.length; r += 1) {
|
|
81
|
+
let i = Ee[r].breakpoint;
|
|
82
82
|
if (t[i]) {
|
|
83
|
-
n = e?.[i] ??
|
|
83
|
+
n = e?.[i] ?? Ee[r].span;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -88,30 +88,30 @@ function Oe(e, t) {
|
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region ../pro-utils/dist/is/nil.js
|
|
91
|
-
function
|
|
91
|
+
function Ae(e) {
|
|
92
92
|
return e == null;
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region ../pro-utils/dist/function/object.js
|
|
96
|
-
function
|
|
96
|
+
function je(e) {
|
|
97
97
|
return Object.getOwnPropertySymbols(e);
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region ../pro-utils/dist/is/type.js
|
|
101
|
-
function
|
|
101
|
+
function Me(e, t) {
|
|
102
102
|
return Object.prototype.toString.call(e) === `[object ${t}]`;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ne(e) {
|
|
105
105
|
return typeof e == "boolean";
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function U(e) {
|
|
108
108
|
return typeof e == "number";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function W(e) {
|
|
111
111
|
return Array.isArray === void 0 ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
112
112
|
}
|
|
113
113
|
function G(e) {
|
|
114
|
-
return e !== null &&
|
|
114
|
+
return e !== null && Me(e, "Object");
|
|
115
115
|
}
|
|
116
116
|
function Pe(e) {
|
|
117
117
|
return typeof e == "string";
|
|
@@ -229,7 +229,7 @@ function K(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
|
229
229
|
return e;
|
|
230
230
|
}
|
|
231
231
|
function q(e, t, n = e, r, i) {
|
|
232
|
-
let a = [...Object.keys(t), ...
|
|
232
|
+
let a = [...Object.keys(t), ...je(t)];
|
|
233
233
|
for (let o = 0; o < a.length; o++) {
|
|
234
234
|
let s = a[o], c = Object.getOwnPropertyDescriptor(e, s);
|
|
235
235
|
(c == null || c.writable) && (e[s] = K(t[s], s, n, r, i));
|
|
@@ -285,7 +285,7 @@ function J(...e) {
|
|
|
285
285
|
let r = e[n];
|
|
286
286
|
if (r) {
|
|
287
287
|
if (Pe(r)) t.push(r);
|
|
288
|
-
else if (
|
|
288
|
+
else if (W(r)) for (let e = 0; e < r.length; e++) {
|
|
289
289
|
let n = J(r[e]);
|
|
290
290
|
n && t.push(n);
|
|
291
291
|
}
|
|
@@ -384,7 +384,7 @@ function bt(e, t) {
|
|
|
384
384
|
}
|
|
385
385
|
//#endregion
|
|
386
386
|
//#region src/utils/valueFormat.ts
|
|
387
|
-
var Y = /* @__PURE__ */
|
|
387
|
+
var Y = /* @__PURE__ */ V((/* @__PURE__ */ Se(((e, t) => {
|
|
388
388
|
(function(n, r) {
|
|
389
389
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
390
390
|
})(e, (function() {
|
|
@@ -680,7 +680,7 @@ var Y = /* @__PURE__ */ Se((/* @__PURE__ */ be(((e, t) => {
|
|
|
680
680
|
}));
|
|
681
681
|
})))(), 1);
|
|
682
682
|
function xt(e, t, n = {}) {
|
|
683
|
-
if (
|
|
683
|
+
if (Ae(e) || e === "" || !t || t === "text") return e;
|
|
684
684
|
if (G(t) && !Array.isArray(t)) {
|
|
685
685
|
let n = t, r = n.node ?? "span";
|
|
686
686
|
return v(r === "a" ? "span" : r, {
|
|
@@ -770,7 +770,7 @@ function Nt(e) {
|
|
|
770
770
|
return [...e].sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
|
|
771
771
|
}
|
|
772
772
|
function Pt(e) {
|
|
773
|
-
let t =
|
|
773
|
+
let t = A(null), n = P(() => e.columns.value, () => {
|
|
774
774
|
t.value = null;
|
|
775
775
|
});
|
|
776
776
|
D(() => n());
|
|
@@ -805,7 +805,7 @@ function It() {
|
|
|
805
805
|
}
|
|
806
806
|
},
|
|
807
807
|
setup(e, { slots: t, attrs: n }) {
|
|
808
|
-
let r =
|
|
808
|
+
let r = A(!1), i = A(!1), a = A(0), o = A(0);
|
|
809
809
|
function s(t) {
|
|
810
810
|
t.preventDefault(), t.stopPropagation(), r.value = !0, i.value = !1, a.value = t.clientX, o.value = e.width || t.currentTarget?.parentElement?.offsetWidth || 0;
|
|
811
811
|
function n(t) {
|
|
@@ -840,7 +840,7 @@ function It() {
|
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
function Lt(e) {
|
|
843
|
-
let t =
|
|
843
|
+
let t = A(/* @__PURE__ */ new Map());
|
|
844
844
|
function n(e, n) {
|
|
845
845
|
let r = new Map(t.value);
|
|
846
846
|
r.set(e, n.size.width), t.value = r;
|
|
@@ -872,7 +872,7 @@ function Lt(e) {
|
|
|
872
872
|
//#region src/hooks/useFetchData.ts
|
|
873
873
|
var Rt = [];
|
|
874
874
|
function zt(e, t) {
|
|
875
|
-
let { rowKey: r, polling: i, pollingTime: a, request: o, postData: s, dataSource: c, immediate: l, waitRequest: u, autoRequest: d, debounceTime: f, params: p, defaultFormSearch: h, onLoadingChange: g, onRequestError: _, onBeforeSearchSubmit: v } = e, { pageInfo: y, paginationInfo: b, setPagination: x, setLoading: S, setColumns: w, removeRowKeys: E, syncSelectedRows: D, columns:
|
|
875
|
+
let { rowKey: r, polling: i, pollingTime: a, request: o, postData: s, dataSource: c, immediate: l, waitRequest: u, autoRequest: d, debounceTime: f, params: p, defaultFormSearch: h, onLoadingChange: g, onRequestError: _, onBeforeSearchSubmit: v } = e, { pageInfo: y, paginationInfo: b, setPagination: x, setLoading: S, setColumns: w, removeRowKeys: E, syncSelectedRows: D, columns: O } = t, A = k([]), M = k(!1), N = k(null), te = k(null), ne = k("");
|
|
876
876
|
function re(e) {
|
|
877
877
|
g && g(e);
|
|
878
878
|
}
|
|
@@ -882,33 +882,33 @@ function zt(e, t) {
|
|
|
882
882
|
function ie() {
|
|
883
883
|
F();
|
|
884
884
|
}
|
|
885
|
-
function
|
|
886
|
-
if (
|
|
885
|
+
function ae(e) {
|
|
886
|
+
if (M.value || !i.value) return;
|
|
887
887
|
let t = Math.max(a.value || 2e3, 2e3);
|
|
888
888
|
F(), N.value = setTimeout(() => {
|
|
889
|
-
|
|
889
|
+
z({
|
|
890
890
|
...e,
|
|
891
891
|
isPolling: !0
|
|
892
892
|
});
|
|
893
893
|
}, t);
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function I() {
|
|
896
896
|
te.value?.abort(), te.value = null;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
if (
|
|
898
|
+
function L(e) {
|
|
899
|
+
if (A.value = ze(e, j(y)), !o || !Fe(o)) {
|
|
900
900
|
let t = e.length || 0;
|
|
901
901
|
t !== y.total && x({ total: t });
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
async function
|
|
904
|
+
async function oe(e = {}) {
|
|
905
905
|
let { pagination: t = {}, filters: n = {}, sorter: r = {}, removeKeys: i = [], isPolling: a = !1, extra: l } = e;
|
|
906
906
|
if (!o || !Fe(o)) return c.value || [];
|
|
907
907
|
a || (S(!0), re(!0)), t && Object.keys(t).length && x(t);
|
|
908
908
|
try {
|
|
909
909
|
i.length && E(i);
|
|
910
|
-
let t = G(r) && Object.keys(r).length ? [r] :
|
|
911
|
-
w &&
|
|
910
|
+
let t = G(r) && Object.keys(r).length ? [r] : W(r) ? r : [];
|
|
911
|
+
w && O && w(O.value.map((e) => {
|
|
912
912
|
let n = t.find((t) => (t?.columnKey || t?.field) === e.dataIndex);
|
|
913
913
|
return {
|
|
914
914
|
...e,
|
|
@@ -918,10 +918,10 @@ function zt(e, t) {
|
|
|
918
918
|
let a = {
|
|
919
919
|
...b.value === !1 ? {} : {
|
|
920
920
|
pageSize: y.pageSize,
|
|
921
|
-
current: bt(
|
|
921
|
+
current: bt(j(y), i.length)
|
|
922
922
|
},
|
|
923
|
-
...
|
|
924
|
-
...
|
|
923
|
+
...j(h.value),
|
|
924
|
+
...j(p.value),
|
|
925
925
|
...e.params || {}
|
|
926
926
|
};
|
|
927
927
|
v && Fe(v) && (a = await v({
|
|
@@ -946,44 +946,44 @@ function zt(e, t) {
|
|
|
946
946
|
let { success: t = !0, data: n = [] } = d;
|
|
947
947
|
if (!t) return [];
|
|
948
948
|
let r = typeof s == "function" ? s(n) : n, i = d.total || r.length || 0;
|
|
949
|
-
return i !== y.total && x({ total: i }),
|
|
949
|
+
return i !== y.total && x({ total: i }), L(r), D(r), ae(e), r;
|
|
950
950
|
}
|
|
951
951
|
return [];
|
|
952
952
|
} catch (e) {
|
|
953
953
|
if (e.name === "AbortError") return [];
|
|
954
|
-
if (_) return
|
|
954
|
+
if (_) return A.value === void 0 && L([]), _(e), [];
|
|
955
955
|
throw e;
|
|
956
956
|
} finally {
|
|
957
957
|
a || (S(!1), re(!1));
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
let
|
|
961
|
-
function
|
|
962
|
-
|
|
960
|
+
let R = n((e) => oe(e), () => f.value ?? 10);
|
|
961
|
+
function z(e = {}) {
|
|
962
|
+
I(), R(e);
|
|
963
963
|
}
|
|
964
964
|
C(() => {
|
|
965
|
-
|
|
966
|
-
}),
|
|
967
|
-
|
|
965
|
+
M.value = !1;
|
|
966
|
+
}), ee(() => {
|
|
967
|
+
M.value = !0, I(), ie();
|
|
968
968
|
}), T(() => {
|
|
969
|
-
|
|
969
|
+
M.value = !0, I(), ie();
|
|
970
970
|
}), P(() => c.value, (e) => {
|
|
971
|
-
e && !Fe(o) &&
|
|
971
|
+
e && !Fe(o) && L(e);
|
|
972
972
|
}, {
|
|
973
973
|
deep: !0,
|
|
974
974
|
immediate: !0
|
|
975
975
|
}), P(() => p.value, () => {
|
|
976
|
-
u.value || d.value && (x({ current: 1 }),
|
|
976
|
+
u.value || d.value && (x({ current: 1 }), z({ isPolling: !1 }));
|
|
977
977
|
}, { deep: !0 }), P(() => h.value, (e, t) => {
|
|
978
|
-
u.value || e !== t && (x({ current: 1 }),
|
|
978
|
+
u.value || e !== t && (x({ current: 1 }), z({ isPolling: !1 }));
|
|
979
979
|
}, { deep: !0 }), P(() => i.value, () => {
|
|
980
|
-
u.value || (i.value ?
|
|
980
|
+
u.value || (i.value ? z({ isPolling: !0 }) : ie());
|
|
981
981
|
}), P(() => u.value, (e) => {
|
|
982
|
-
e ? (S(!0), re(!0)) : l.value &&
|
|
983
|
-
}), !u.value && l.value &&
|
|
984
|
-
let
|
|
985
|
-
function
|
|
986
|
-
|
|
982
|
+
e ? (S(!0), re(!0)) : l.value && z({ isPolling: !1 });
|
|
983
|
+
}), !u.value && l.value && z({ isPolling: !1 });
|
|
984
|
+
let se = m(() => A.value.some((e) => W(e.children) && e.children.length > 0));
|
|
985
|
+
function ce(e, t = {}, n = {}, r) {
|
|
986
|
+
z({
|
|
987
987
|
pagination: e,
|
|
988
988
|
filters: t,
|
|
989
989
|
sorter: n,
|
|
@@ -991,40 +991,40 @@ function zt(e, t) {
|
|
|
991
991
|
isPolling: !1
|
|
992
992
|
});
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function le(e) {
|
|
995
995
|
let { key: t, row: n, value: i, type: a = "update" } = e, o = t ?? r.value, s = n?.[o] ?? i;
|
|
996
996
|
switch (!n && a !== "delete" && console.warn("row is required"), a) {
|
|
997
997
|
case "update":
|
|
998
|
-
o && s && n && (
|
|
998
|
+
o && s && n && (A.value = A.value.map((e) => s === e[o] ? dt({}, e, n) : e));
|
|
999
999
|
break;
|
|
1000
1000
|
case "push":
|
|
1001
|
-
n &&
|
|
1001
|
+
n && A.value.push(n);
|
|
1002
1002
|
break;
|
|
1003
1003
|
case "unshift":
|
|
1004
|
-
n &&
|
|
1004
|
+
n && A.value.unshift(n);
|
|
1005
1005
|
break;
|
|
1006
1006
|
case "delete":
|
|
1007
|
-
o && (
|
|
1007
|
+
o && (A.value = A.value.filter((e) => i !== e[o]));
|
|
1008
1008
|
break;
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1012
|
-
u.value || (o ?
|
|
1011
|
+
function ue(e) {
|
|
1012
|
+
u.value || (o ? z({
|
|
1013
1013
|
...e,
|
|
1014
1014
|
isPolling: !1
|
|
1015
|
-
}) :
|
|
1015
|
+
}) : L(c.value || []));
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1018
|
-
|
|
1017
|
+
function de(e) {
|
|
1018
|
+
ue(e);
|
|
1019
1019
|
}
|
|
1020
1020
|
return {
|
|
1021
|
-
dataSource: m(() =>
|
|
1022
|
-
isTreeDataRef:
|
|
1023
|
-
setTableDataList:
|
|
1024
|
-
operateTableDataRow:
|
|
1025
|
-
handleTableChange:
|
|
1026
|
-
run:
|
|
1027
|
-
reload:
|
|
1021
|
+
dataSource: m(() => A.value.length ? A.value : Rt),
|
|
1022
|
+
isTreeDataRef: se,
|
|
1023
|
+
setTableDataList: L,
|
|
1024
|
+
operateTableDataRow: le,
|
|
1025
|
+
handleTableChange: ce,
|
|
1026
|
+
run: ue,
|
|
1027
|
+
reload: de
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
@@ -1057,7 +1057,7 @@ function Gt(e) {
|
|
|
1057
1057
|
return (Number.parseFloat(t.marginTop) || 0) + (Number.parseFloat(t.marginBottom) || 0);
|
|
1058
1058
|
}
|
|
1059
1059
|
function Kt(e) {
|
|
1060
|
-
let { fitPage: t, cardEl: n, prefixCls: i } = e, a =
|
|
1060
|
+
let { fitPage: t, cardEl: n, prefixCls: i } = e, a = k(), l = k(), u = k(), d = k(), f = k(), p = k(), h = {
|
|
1061
1061
|
toolbarEl: l,
|
|
1062
1062
|
headerEl: u,
|
|
1063
1063
|
pageEl: d,
|
|
@@ -1103,7 +1103,7 @@ function qt(e) {
|
|
|
1103
1103
|
_() ? C(e) : S(e);
|
|
1104
1104
|
}
|
|
1105
1105
|
function Jt(e) {
|
|
1106
|
-
let t =
|
|
1106
|
+
let t = k(!1);
|
|
1107
1107
|
return qt(() => {
|
|
1108
1108
|
t.value ? e.enabled.value && e.reload() : t.value = !0;
|
|
1109
1109
|
}), { hasActivated: t };
|
|
@@ -1111,10 +1111,10 @@ function Jt(e) {
|
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
//#region src/hooks/useLoading.ts
|
|
1113
1113
|
function Yt(e, t = !1) {
|
|
1114
|
-
return
|
|
1114
|
+
return Ne(e) ? e : G(e) ? e.spinning ?? t : t;
|
|
1115
1115
|
}
|
|
1116
1116
|
function Xt(e) {
|
|
1117
|
-
let t =
|
|
1117
|
+
let t = k(Yt(e.loading.value));
|
|
1118
1118
|
P(() => e.loading.value, (n) => {
|
|
1119
1119
|
let r = Yt(n, t.value);
|
|
1120
1120
|
r !== t.value && (t.value = r, e.onChange?.(r));
|
|
@@ -1142,7 +1142,7 @@ var Zt = {
|
|
|
1142
1142
|
]
|
|
1143
1143
|
};
|
|
1144
1144
|
function Qt({ pagination: e }) {
|
|
1145
|
-
let t =
|
|
1145
|
+
let t = k({ ...Zt }), n = O({
|
|
1146
1146
|
current: Zt.current,
|
|
1147
1147
|
pageSize: Zt.pageSize,
|
|
1148
1148
|
total: 0
|
|
@@ -1162,7 +1162,7 @@ function Qt({ pagination: e }) {
|
|
|
1162
1162
|
immediate: !0
|
|
1163
1163
|
});
|
|
1164
1164
|
function r(e) {
|
|
1165
|
-
|
|
1165
|
+
U(e.current) && (n.current = e.current), U(e.pageSize) && (n.pageSize = e.pageSize), U(e.total) && (n.total = e.total);
|
|
1166
1166
|
}
|
|
1167
1167
|
function i(e) {
|
|
1168
1168
|
t.value !== !1 && (t.value = dt({}, t.value, e), r(e));
|
|
@@ -1184,7 +1184,7 @@ function Qt({ pagination: e }) {
|
|
|
1184
1184
|
//#endregion
|
|
1185
1185
|
//#region src/hooks/useRequestOptions.ts
|
|
1186
1186
|
function $t(e) {
|
|
1187
|
-
let t =
|
|
1187
|
+
let t = k([]), r = k(!1), i = k("idle"), a = n(async () => {
|
|
1188
1188
|
if (e.fetch) {
|
|
1189
1189
|
r.value = !0, i.value = "loading";
|
|
1190
1190
|
try {
|
|
@@ -1198,7 +1198,7 @@ function $t(e) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
1200
|
}, e.debounceTime ?? 10);
|
|
1201
|
-
return e.fetch && !e.manual && a(),
|
|
1201
|
+
return e.fetch && !e.manual && a(), ee(() => {
|
|
1202
1202
|
t.value = [], r.value = !1;
|
|
1203
1203
|
}), {
|
|
1204
1204
|
optionList: t,
|
|
@@ -1213,7 +1213,7 @@ function X(e, t) {
|
|
|
1213
1213
|
return e[t];
|
|
1214
1214
|
}
|
|
1215
1215
|
function en(e) {
|
|
1216
|
-
let t =
|
|
1216
|
+
let t = O(/* @__PURE__ */ new Map()), n = P(() => e.rowSelection.value?.selectedRowKeys, (n) => {
|
|
1217
1217
|
if (!n) return;
|
|
1218
1218
|
let r = /* @__PURE__ */ new Map(), i = e.dataSource.value;
|
|
1219
1219
|
for (let a of n) {
|
|
@@ -1283,15 +1283,16 @@ function en(e) {
|
|
|
1283
1283
|
//#region src/hooks/useTable.ts
|
|
1284
1284
|
var tn = [];
|
|
1285
1285
|
function nn(e, t) {
|
|
1286
|
-
let n =
|
|
1286
|
+
let n = O({
|
|
1287
1287
|
params: {},
|
|
1288
1288
|
searchMap: []
|
|
1289
1289
|
}), r = /* @__PURE__ */ new Set();
|
|
1290
1290
|
function i(e = {}) {
|
|
1291
|
-
let
|
|
1292
|
-
for (let
|
|
1293
|
-
|
|
1294
|
-
|
|
1291
|
+
for (let t of r) t in e || (delete n[t], r.delete(t));
|
|
1292
|
+
for (let t of Object.keys(e)) {
|
|
1293
|
+
let i = e[t];
|
|
1294
|
+
i !== n[t] && (n[t] = i), r.add(t);
|
|
1295
|
+
}
|
|
1295
1296
|
t?.request && (n.request = t.request);
|
|
1296
1297
|
}
|
|
1297
1298
|
P(() => N(t?.state), (e) => {
|
|
@@ -1303,7 +1304,7 @@ function nn(e, t) {
|
|
|
1303
1304
|
let a = m(() => e.value?.actionRef?.() ?? {}), o = m(() => e.value?.formRef?.() ?? {}), s = m(() => ({
|
|
1304
1305
|
...a.value?.pageInfo || {},
|
|
1305
1306
|
...o.value?.getFormSearch?.() || {}
|
|
1306
|
-
})), c =
|
|
1307
|
+
})), c = k(!1);
|
|
1307
1308
|
P(() => a.value?.loading?.value, (e) => {
|
|
1308
1309
|
c.value = !!e;
|
|
1309
1310
|
}), P(c, (e) => {
|
|
@@ -1384,15 +1385,15 @@ function on(e) {
|
|
|
1384
1385
|
order: e.searchConfig.order ?? e.order ?? 0
|
|
1385
1386
|
}));
|
|
1386
1387
|
return rn([...e, ...r]);
|
|
1387
|
-
}), i = m(() => an(r.value)), a =
|
|
1388
|
+
}), i = m(() => an(r.value)), a = k({});
|
|
1388
1389
|
P(() => i.value, (e) => {
|
|
1389
|
-
a.value = ut(
|
|
1390
|
+
a.value = ut(j(e));
|
|
1390
1391
|
}, {
|
|
1391
1392
|
deep: !0,
|
|
1392
1393
|
immediate: !0
|
|
1393
1394
|
});
|
|
1394
1395
|
function o() {
|
|
1395
|
-
let e = ut(
|
|
1396
|
+
let e = ut(j(a.value));
|
|
1396
1397
|
for (let t of r.value) {
|
|
1397
1398
|
let n = t.valueType ?? "text", r = t.name;
|
|
1398
1399
|
if (n === "text" && (e[r] = a.value[r] ?? t.initialValue), n === "dateRange" && (t.rangeStartName || t.rangeEndName)) {
|
|
@@ -1415,7 +1416,7 @@ function on(e) {
|
|
|
1415
1416
|
return e;
|
|
1416
1417
|
}
|
|
1417
1418
|
function s() {
|
|
1418
|
-
let e = ut(
|
|
1419
|
+
let e = ut(j(i.value));
|
|
1419
1420
|
a.value = e;
|
|
1420
1421
|
for (let t of r.value) if (t.valueType === "dateRange" && (t.rangeStartName || t.rangeEndName)) {
|
|
1421
1422
|
let n = t.rangeStartName || "start", r = t.rangeEndName || "end", i = e[n], o = e[r];
|
|
@@ -1560,7 +1561,7 @@ var bn = /* @__PURE__ */ g({
|
|
|
1560
1561
|
}
|
|
1561
1562
|
},
|
|
1562
1563
|
setup(e) {
|
|
1563
|
-
let t = Ut(), n =
|
|
1564
|
+
let t = Ut(), n = k(), r = k(), a = k({}), o = k(!1), s = !1, c = !1, l = 0, u = 0, d = m(() => vn[e.vertical ? "vertical" : "horizontal"]), f = m(() => yn({
|
|
1564
1565
|
size: e.size,
|
|
1565
1566
|
move: e.move,
|
|
1566
1567
|
bar: d.value
|
|
@@ -1643,7 +1644,7 @@ var bn = /* @__PURE__ */ g({
|
|
|
1643
1644
|
}
|
|
1644
1645
|
},
|
|
1645
1646
|
setup(e, { expose: t }) {
|
|
1646
|
-
let n = Ut(), r =
|
|
1647
|
+
let n = Ut(), r = k(0), i = k(0), a = k(""), o = k(""), s = k(1), c = k(1);
|
|
1647
1648
|
function l(e) {
|
|
1648
1649
|
if (!e) return;
|
|
1649
1650
|
let t = e.offsetHeight - 4, n = e.offsetWidth - 4;
|
|
@@ -1860,9 +1861,9 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1860
1861
|
}, [e.collapseRender(e.collapsed)]) : h("span", {
|
|
1861
1862
|
class: `${e.prefixCls}-search-control-text`,
|
|
1862
1863
|
onClick: () => e.onToggle(!e.collapsed)
|
|
1863
|
-
}, [e.collapsed ? "展开" : "收起", e.collapsed ? h(
|
|
1864
|
+
}, [e.collapsed ? "展开" : "收起", e.collapsed ? h(B, { type: "DownOutlined" }, null) : h(B, { type: "UpOutlined" }, null)]);
|
|
1864
1865
|
}
|
|
1865
|
-
}), { RangePicker: $n } =
|
|
1866
|
+
}), { RangePicker: $n } = L, er = /* @__PURE__ */ g({
|
|
1866
1867
|
name: "ProTableFormItemContainer",
|
|
1867
1868
|
props: {
|
|
1868
1869
|
prefixCls: {
|
|
@@ -1915,15 +1916,15 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1915
1916
|
allowClear: e.record.allowClear ?? !0,
|
|
1916
1917
|
...t
|
|
1917
1918
|
};
|
|
1918
|
-
return e.autoRequest ? h(
|
|
1919
|
+
return e.autoRequest ? h(oe.Search, x(n, {
|
|
1919
1920
|
onSearch: () => e.onSubmit?.(),
|
|
1920
1921
|
onChange: (t) => {
|
|
1921
1922
|
e.formState[e.record.name] = t.target?.value ?? t;
|
|
1922
1923
|
}
|
|
1923
|
-
}), null) : h(
|
|
1924
|
+
}), null) : h(oe, x(n, { onChange: (e) => i(e.target?.value ?? e) }), null);
|
|
1924
1925
|
}
|
|
1925
1926
|
function o() {
|
|
1926
|
-
return h(
|
|
1927
|
+
return h(R, x({
|
|
1927
1928
|
style: { width: "100%" },
|
|
1928
1929
|
value: e.formState[e.record.name],
|
|
1929
1930
|
placeholder: e.record.placeholder || "请输入",
|
|
@@ -1932,17 +1933,17 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1932
1933
|
}
|
|
1933
1934
|
function s() {
|
|
1934
1935
|
let t = e.record.name, n = e.formState[t], a = Array.isArray(e.record.placeholder) ? e.record.placeholder : ["请输入", "请输入"];
|
|
1935
|
-
return h(
|
|
1936
|
+
return h(ce, {
|
|
1936
1937
|
class: `${e.prefixCls}-search-input-compact`,
|
|
1937
1938
|
style: { width: "100%" }
|
|
1938
1939
|
}, { default: () => [
|
|
1939
|
-
h(
|
|
1940
|
+
h(R, {
|
|
1940
1941
|
value: n?.[0],
|
|
1941
1942
|
placeholder: a[0] || "请输入",
|
|
1942
1943
|
onChange: (e) => i(e, { key: 0 }),
|
|
1943
1944
|
style: r
|
|
1944
1945
|
}, null),
|
|
1945
|
-
h(
|
|
1946
|
+
h(oe, {
|
|
1946
1947
|
disabled: !0,
|
|
1947
1948
|
value: "~",
|
|
1948
1949
|
class: `${e.prefixCls}-number-range-separator`,
|
|
@@ -1952,7 +1953,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1952
1953
|
pointerEvents: "none"
|
|
1953
1954
|
}
|
|
1954
1955
|
}, null),
|
|
1955
|
-
h(
|
|
1956
|
+
h(R, {
|
|
1956
1957
|
value: n?.[1],
|
|
1957
1958
|
placeholder: a[1] || "请输入",
|
|
1958
1959
|
onChange: (e) => i(e, { key: 1 }),
|
|
@@ -1962,7 +1963,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1962
1963
|
}
|
|
1963
1964
|
function c() {
|
|
1964
1965
|
let r = e.record.loading || n.value, a = e.record.request ? t.value : e.record.valueEnum || [], o = e.record.field ?? {};
|
|
1965
|
-
return h(
|
|
1966
|
+
return h(se, x({
|
|
1966
1967
|
style: { width: "100%" },
|
|
1967
1968
|
value: r ? void 0 : e.formState[e.record.name],
|
|
1968
1969
|
optionFilterProp: "label",
|
|
@@ -1976,7 +1977,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1976
1977
|
}
|
|
1977
1978
|
function l() {
|
|
1978
1979
|
let r = e.record.field ?? {}, a = e.record.loading || n.value;
|
|
1979
|
-
return h(
|
|
1980
|
+
return h(pe, x({
|
|
1980
1981
|
style: { width: "100%" },
|
|
1981
1982
|
value: e.formState[e.record.name],
|
|
1982
1983
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -1988,7 +1989,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1988
1989
|
}
|
|
1989
1990
|
function u() {
|
|
1990
1991
|
let r = e.record.field ?? {}, a = e.record.loading || n.value;
|
|
1991
|
-
return h(
|
|
1992
|
+
return h(I, x({
|
|
1992
1993
|
style: { width: "100%" },
|
|
1993
1994
|
value: e.formState[e.record.name],
|
|
1994
1995
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -2000,7 +2001,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
2000
2001
|
}
|
|
2001
2002
|
function d() {
|
|
2002
2003
|
let t = Xn(e.record.valueFormat, e.record.showTime);
|
|
2003
|
-
return h(
|
|
2004
|
+
return h(L, x({
|
|
2004
2005
|
style: { width: "100%" },
|
|
2005
2006
|
value: e.formState[e.record.name] ? (0, Y.default)(e.formState[e.record.name]) : void 0,
|
|
2006
2007
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -2012,7 +2013,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
2012
2013
|
}
|
|
2013
2014
|
function f(t, n, r) {
|
|
2014
2015
|
let a = e.formState[e.record.name];
|
|
2015
|
-
return h(
|
|
2016
|
+
return h(L, x({
|
|
2016
2017
|
style: { width: "100%" },
|
|
2017
2018
|
picker: t,
|
|
2018
2019
|
value: a ? (0, Y.default)(a, n) : void 0,
|
|
@@ -2036,7 +2037,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
2036
2037
|
}
|
|
2037
2038
|
function m() {
|
|
2038
2039
|
let t = e.record.valueFormat || "HH:mm:ss";
|
|
2039
|
-
return h(
|
|
2040
|
+
return h(de, x({
|
|
2040
2041
|
style: { width: "100%" },
|
|
2041
2042
|
value: e.formState[e.record.name] ? (0, Y.default)(e.formState[e.record.name], t) : void 0,
|
|
2042
2043
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -2184,16 +2185,16 @@ var rr = /* @__PURE__ */ g({
|
|
|
2184
2185
|
}
|
|
2185
2186
|
},
|
|
2186
2187
|
setup(e, { slots: t, expose: n }) {
|
|
2187
|
-
let r =
|
|
2188
|
+
let r = k(e.formConfig?.collapsed ?? e.formConfig?.defaultCollapsed);
|
|
2188
2189
|
P(() => e.formConfig?.collapsed, (e) => {
|
|
2189
2190
|
r.value = e;
|
|
2190
2191
|
});
|
|
2191
|
-
let { getRowItemsPerBreakpoint: i } =
|
|
2192
|
+
let { getRowItemsPerBreakpoint: i } = Oe(), a = m(() => e.formConfig), o = m(() => e.formAutoRequest), s = m(() => e.formActions), c = m(() => {
|
|
2192
2193
|
if (a.value?.breakpoint && G(a.value.breakpoint) && Object.keys(a.value.breakpoint).length > 0) return a.value.breakpoint;
|
|
2193
2194
|
}), l = m(() => i(a.value?.span, c.value)), u = m(() => {
|
|
2194
2195
|
let e = a.value?.gap;
|
|
2195
2196
|
return typeof e == "number" ? `${e}px` : e ?? "16px";
|
|
2196
|
-
}), d = m(() => a.value?.label), f = m(() =>
|
|
2197
|
+
}), d = m(() => a.value?.label), f = m(() => Ne(s.value?.reset) ? s.value.reset : !o.value);
|
|
2197
2198
|
function p(t, n, r) {
|
|
2198
2199
|
let i = n.name, a = n.valueType ?? "text", o = t;
|
|
2199
2200
|
switch (a) {
|
|
@@ -2235,7 +2236,7 @@ var rr = /* @__PURE__ */ g({
|
|
|
2235
2236
|
break;
|
|
2236
2237
|
case "dateRange": {
|
|
2237
2238
|
let e = Xn(n.valueFormat, n.showTime);
|
|
2238
|
-
o = t &&
|
|
2239
|
+
o = t && W(t) && t.length === 2 ? Zn(t, e, "string") : null;
|
|
2239
2240
|
break;
|
|
2240
2241
|
}
|
|
2241
2242
|
case "time":
|
|
@@ -2269,7 +2270,7 @@ var rr = /* @__PURE__ */ g({
|
|
|
2269
2270
|
}
|
|
2270
2271
|
if (r === "numberRange") {
|
|
2271
2272
|
let e = t[i];
|
|
2272
|
-
t[i] = Array.isArray(e) && e.some((e) =>
|
|
2273
|
+
t[i] = Array.isArray(e) && e.some((e) => U(e)) ? e : void 0;
|
|
2273
2274
|
}
|
|
2274
2275
|
}
|
|
2275
2276
|
return t;
|
|
@@ -2338,15 +2339,15 @@ var rr = /* @__PURE__ */ g({
|
|
|
2338
2339
|
}, D = () => !f.value && o.value ? null : h("div", {
|
|
2339
2340
|
class: [`${e.prefixCls}-search-buttons`, e.proClasses.searchButtons],
|
|
2340
2341
|
style: e.proStyles.searchButtons
|
|
2341
|
-
}, [f.value && h(
|
|
2342
|
+
}, [f.value && h(ae, {
|
|
2342
2343
|
key: "reset",
|
|
2343
2344
|
onClick: x
|
|
2344
|
-
}, { default: () => [s.value?.resetText || "重置"] }), !o.value && h(
|
|
2345
|
+
}, { default: () => [s.value?.resetText || "重置"] }), !o.value && h(ae, {
|
|
2345
2346
|
key: "submit",
|
|
2346
2347
|
type: "primary",
|
|
2347
2348
|
loading: typeof e.loading == "boolean" ? e.loading : !1,
|
|
2348
2349
|
onClick: v
|
|
2349
|
-
}, { default: () => [s.value?.searchText || "查询"] })]),
|
|
2350
|
+
}, { default: () => [s.value?.searchText || "查询"] })]), ee = (t, n) => {
|
|
2350
2351
|
if (a.value?.collapseRender === !1 && !D()) return null;
|
|
2351
2352
|
let r = D();
|
|
2352
2353
|
return !t && !r ? null : h("div", {
|
|
@@ -2362,11 +2363,11 @@ var rr = /* @__PURE__ */ g({
|
|
|
2362
2363
|
prefixCls: e.prefixCls,
|
|
2363
2364
|
onToggle: S
|
|
2364
2365
|
}, null)])]);
|
|
2365
|
-
},
|
|
2366
|
+
}, O = e.cardBordered ? `${e.prefixCls}-search-border` : "", k = b <= m || !w ? b : Math.max(m - 1, 0);
|
|
2366
2367
|
return h("div", {
|
|
2367
|
-
class: J(e.proClasses.search, `${e.prefixCls}-search`,
|
|
2368
|
+
class: J(e.proClasses.search, `${e.prefixCls}-search`, O, a.value?.className),
|
|
2368
2369
|
style: e.proStyles.search
|
|
2369
|
-
}, [c.slice(0,
|
|
2370
|
+
}, [c.slice(0, k).map((e, t) => E(e, t)), ee(T, w)]);
|
|
2370
2371
|
};
|
|
2371
2372
|
}
|
|
2372
2373
|
});
|
|
@@ -2392,7 +2393,7 @@ var ar = /* @__PURE__ */ g({
|
|
|
2392
2393
|
}
|
|
2393
2394
|
},
|
|
2394
2395
|
setup(e) {
|
|
2395
|
-
return () => h(
|
|
2396
|
+
return () => h(fe, { title: e.isFullscreen ? "退出全屏" : "全屏" }, { default: () => [h("span", { onClick: e.onToggle }, [e.isFullscreen ? h(B, { type: "FullscreenExitOutlined" }, null) : h(B, { type: "FullscreenOutlined" }, null)])] });
|
|
2396
2397
|
}
|
|
2397
2398
|
});
|
|
2398
2399
|
//#endregion
|
|
@@ -2401,7 +2402,7 @@ function or(e) {
|
|
|
2401
2402
|
if (y(e)) return e;
|
|
2402
2403
|
if (!e) return null;
|
|
2403
2404
|
let { icon: t, tooltip: n, onClick: r, key: i } = e;
|
|
2404
|
-
return t && n ? h(
|
|
2405
|
+
return t && n ? h(fe, {
|
|
2405
2406
|
title: n,
|
|
2406
2407
|
key: i
|
|
2407
2408
|
}, { default: () => [h("span", {
|
|
@@ -2465,7 +2466,7 @@ var sr = /* @__PURE__ */ g({
|
|
|
2465
2466
|
}, [t.value && h("div", {
|
|
2466
2467
|
class: [`${o}-list-toolbar-title`, e.proClasses.toolbarTitle],
|
|
2467
2468
|
style: e.proStyles.toolbarTitle
|
|
2468
|
-
}, [e.headerTitle, e.headerTitleTip && h(
|
|
2469
|
+
}, [e.headerTitle, e.headerTitleTip && h(fe, { title: e.titleTipText }, { default: () => [typeof e.headerTitleTip == "boolean" ? h(B, { type: "InfoCircleOutlined" }, null) : e.headerTitleTip] })]), n.value.length > 0 && h("div", { class: `${o}-list-toolbar-actions` }, [n.value])]) : a.value ? h("div", {
|
|
2469
2470
|
class: `${o}-list-toolbar-left`,
|
|
2470
2471
|
style: e.proStyles.toolbarLeft
|
|
2471
2472
|
}, null) : null, c = a.value ? h("div", {
|
|
@@ -2535,7 +2536,7 @@ var lr = /* @__PURE__ */ g({
|
|
|
2535
2536
|
}
|
|
2536
2537
|
},
|
|
2537
2538
|
setup(e) {
|
|
2538
|
-
let t =
|
|
2539
|
+
let t = Te(), n = m(() => {
|
|
2539
2540
|
if (e.options === !1) return [];
|
|
2540
2541
|
let n = cr(e.options) ? e.options : {}, r = [];
|
|
2541
2542
|
if (n.reload !== !1) {
|
|
@@ -2543,10 +2544,10 @@ var lr = /* @__PURE__ */ g({
|
|
|
2543
2544
|
if (typeof n.reload == "function") {
|
|
2544
2545
|
let t = n.reload(e);
|
|
2545
2546
|
t && r.push(t);
|
|
2546
|
-
} else r.push(h(
|
|
2547
|
+
} else r.push(h(fe, {
|
|
2547
2548
|
title: "刷新",
|
|
2548
2549
|
key: "reload"
|
|
2549
|
-
}, { default: () => [h("span", { onClick: e }, [h(
|
|
2550
|
+
}, { default: () => [h("span", { onClick: e }, [h(B, { type: "ReloadOutlined" }, null)])] }));
|
|
2550
2551
|
}
|
|
2551
2552
|
return n.fullScreen !== !1 && (typeof n.fullScreen == "function" ? r.push(h(ar, {
|
|
2552
2553
|
key: "fullscreen",
|
|
@@ -2941,45 +2942,45 @@ var gr = (e) => {
|
|
|
2941
2942
|
"classes",
|
|
2942
2943
|
"styles"
|
|
2943
2944
|
], Sr = /* @__PURE__ */ g((e, { attrs: t, slots: n, emit: r, expose: i }) => {
|
|
2944
|
-
let { prefixCls: o } =
|
|
2945
|
+
let { prefixCls: o } = me("pro-table", e), s = he(o), [c, l] = yr(o, s), u = ie(), p = k(), { toggle: g, isFullscreen: _ } = a(p);
|
|
2945
2946
|
P(_, (e) => {
|
|
2946
2947
|
r("fullscreenChange", e);
|
|
2947
2948
|
});
|
|
2948
|
-
let v = m(() => J(o.value, c.value, l.value, s.value, t.class, e.proClasses?.root,
|
|
2949
|
+
let v = m(() => J(o.value, c.value, l.value, s.value, t.class, e.proClasses?.root, Ne.value)), y = m(() => [e.proStyles?.root, t.style]), { isMobile: b, screenWidth: S, screens: C } = Oe(), { paginationInfo: w, paginationAlign: T, requestPagination: E, setPagination: D } = Qt({ pagination: M(e, "pagination") }), { tableSize: ee, setTableSize: O } = _n({
|
|
2949
2950
|
size: m(() => e.size),
|
|
2950
2951
|
onChange: (e) => r("sizeChange", e)
|
|
2951
|
-
}), { loading:
|
|
2952
|
+
}), { loading: A, setLoading: j } = Xt({
|
|
2952
2953
|
loading: m(() => e.loading),
|
|
2953
2954
|
onChange: (t) => e.onLoadingChange?.(t)
|
|
2954
|
-
}), { selectedRowKeys: N, selectedItems: te, mergedRowSelection: ne, select: re, selectAll: F, remove:
|
|
2955
|
+
}), { selectedRowKeys: N, selectedItems: te, mergedRowSelection: ne, select: re, selectAll: F, remove: ae, clear: I, sync: L } = en({
|
|
2955
2956
|
rowKey: m(() => e.rowKey),
|
|
2956
2957
|
rowSelection: m(() => e.rowSelection),
|
|
2957
2958
|
dataSource: m(() => e.dataSource ?? [])
|
|
2958
|
-
}),
|
|
2959
|
+
}), oe = m(() => At(e.columns ?? [], e.indexColumn, e.align ?? "left")), { tableScroll: R, shouldFixActionColumn: se } = mn({
|
|
2959
2960
|
scroll: m(() => e.scroll),
|
|
2960
|
-
columns:
|
|
2961
|
+
columns: oe,
|
|
2961
2962
|
rowSelection: m(() => e.rowSelection),
|
|
2962
2963
|
screens: C,
|
|
2963
2964
|
screenWidth: S,
|
|
2964
2965
|
scrollPolicy: m(() => e.scrollPolicy)
|
|
2965
|
-
}), { tableColumns:
|
|
2966
|
+
}), { tableColumns: ce, cacheColumns: de, setColumns: fe } = Pt({
|
|
2966
2967
|
columns: m(() => e.columns ?? []),
|
|
2967
2968
|
align: m(() => e.align ?? "left"),
|
|
2968
2969
|
indexColumn: m(() => e.indexColumn),
|
|
2969
|
-
shouldFixActionColumn:
|
|
2970
|
+
shouldFixActionColumn: se,
|
|
2970
2971
|
wrapColumnRender: Ct({
|
|
2971
2972
|
columnEmptyText: m(() => e.columnEmptyText),
|
|
2972
2973
|
prefixCls: o
|
|
2973
2974
|
}).wrapColumnRender
|
|
2974
|
-
}), { resizableColumns:
|
|
2975
|
-
columns:
|
|
2975
|
+
}), { resizableColumns: pe, resizableComponents: B } = Lt({
|
|
2976
|
+
columns: ce,
|
|
2976
2977
|
onResize: (e, t) => r("resizeColumn", e, t)
|
|
2977
|
-
}),
|
|
2978
|
+
}), ge = m(() => e.form === !1 ? void 0 : e.form), _e = m(() => e.form === !1 ? e.autoRequest ?? !0 : e.form?.autoRequest ?? e.autoRequest ?? !0), ve = m(() => {
|
|
2978
2979
|
if (e.form !== !1) return e.form?.actions;
|
|
2979
|
-
}), { formColumns:
|
|
2980
|
+
}), { formColumns: ye, defaultFormSearch: be, formState: xe, getFormSearch: Se, resetFormState: Ce } = on({
|
|
2980
2981
|
searchMap: m(() => e.searchMap ?? []),
|
|
2981
2982
|
columns: m(() => e.columns ?? [])
|
|
2982
|
-
}), { dataSource:
|
|
2983
|
+
}), { dataSource: V, setTableDataList: Te, operateTableDataRow: Ee, handleTableChange: De, reload: H, run: ke } = zt({
|
|
2983
2984
|
rowKey: m(() => e.rowKey),
|
|
2984
2985
|
polling: m(() => e.polling ?? !1),
|
|
2985
2986
|
pollingTime: m(() => e.pollingTime ?? 2e3),
|
|
@@ -2991,7 +2992,7 @@ var gr = (e) => {
|
|
|
2991
2992
|
autoRequest: m(() => e.autoRequest ?? !0),
|
|
2992
2993
|
debounceTime: m(() => e.debounceTime ?? 10),
|
|
2993
2994
|
params: m(() => e.params),
|
|
2994
|
-
defaultFormSearch:
|
|
2995
|
+
defaultFormSearch: be,
|
|
2995
2996
|
onLoadingChange: e.onLoadingChange,
|
|
2996
2997
|
onRequestError: e.onRequestError,
|
|
2997
2998
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit
|
|
@@ -2999,44 +3000,44 @@ var gr = (e) => {
|
|
|
2999
3000
|
pageInfo: E,
|
|
3000
3001
|
paginationInfo: w,
|
|
3001
3002
|
setPagination: D,
|
|
3002
|
-
setLoading:
|
|
3003
|
-
setColumns:
|
|
3004
|
-
removeRowKeys:
|
|
3005
|
-
syncSelectedRows:
|
|
3006
|
-
columns:
|
|
3003
|
+
setLoading: j,
|
|
3004
|
+
setColumns: fe,
|
|
3005
|
+
removeRowKeys: ae,
|
|
3006
|
+
syncSelectedRows: L,
|
|
3007
|
+
columns: de
|
|
3007
3008
|
});
|
|
3008
3009
|
Jt({
|
|
3009
3010
|
enabled: m(() => e.keepAliveReload ?? !1),
|
|
3010
|
-
reload:
|
|
3011
|
+
reload: H
|
|
3011
3012
|
});
|
|
3012
|
-
let
|
|
3013
|
-
fitPage: m(() => !
|
|
3014
|
-
cardEl:
|
|
3013
|
+
let Ae = k(), { scrollY: je, overflowHidden: Me, fullPageClass: Ne, scrollEl: U, barRef: W } = Kt({
|
|
3014
|
+
fitPage: m(() => !R.value?.y && !!e.fitPage),
|
|
3015
|
+
cardEl: Ae,
|
|
3015
3016
|
prefixCls: o
|
|
3016
3017
|
}), G = m(() => ({
|
|
3017
|
-
...
|
|
3018
|
-
...
|
|
3018
|
+
...R.value ?? {},
|
|
3019
|
+
...je.value > 0 ? { y: je.value } : {}
|
|
3019
3020
|
}));
|
|
3020
|
-
|
|
3021
|
-
reload:
|
|
3021
|
+
we({
|
|
3022
|
+
reload: H,
|
|
3022
3023
|
setPagination: D,
|
|
3023
|
-
tableSize:
|
|
3024
|
-
setTableSize:
|
|
3025
|
-
formAutoRequest:
|
|
3026
|
-
formConfig:
|
|
3027
|
-
formActions:
|
|
3024
|
+
tableSize: ee,
|
|
3025
|
+
setTableSize: O,
|
|
3026
|
+
formAutoRequest: _e,
|
|
3027
|
+
formConfig: ge,
|
|
3028
|
+
formActions: ve,
|
|
3028
3029
|
isMobile: b,
|
|
3029
3030
|
screenWidth: S,
|
|
3030
3031
|
toggleFullscreen: g,
|
|
3031
3032
|
isFullscreen: _
|
|
3032
3033
|
});
|
|
3033
|
-
let Pe = m(() => !!(e.customRender || n.customRender)), Fe = m(() => e.form === !1 ? !1 :
|
|
3034
|
+
let Pe = m(() => !!(e.customRender || n.customRender)), Fe = m(() => e.form === !1 ? !1 : ye.value.length > 0 || !!n.form);
|
|
3034
3035
|
function Ie(t, n) {
|
|
3035
|
-
if (
|
|
3036
|
-
|
|
3036
|
+
if (_e.value) {
|
|
3037
|
+
H({ params: t });
|
|
3037
3038
|
return;
|
|
3038
3039
|
}
|
|
3039
|
-
n === "reset" ? (r("reset", t), e.request &&
|
|
3040
|
+
n === "reset" ? (r("reset", t), e.request && ve.value?.resetReload && H({ params: t })) : e.request && (r("submit", t), H({ params: t }));
|
|
3040
3041
|
}
|
|
3041
3042
|
function Le(e) {
|
|
3042
3043
|
let t = w.value;
|
|
@@ -3047,7 +3048,7 @@ var gr = (e) => {
|
|
|
3047
3048
|
function Re() {
|
|
3048
3049
|
let t = e.customRender || n.customRender;
|
|
3049
3050
|
if (!t) return null;
|
|
3050
|
-
let r =
|
|
3051
|
+
let r = V.value;
|
|
3051
3052
|
return r?.length ? typeof t == "function" ? t({
|
|
3052
3053
|
dataSource: r,
|
|
3053
3054
|
currentData: Le(r)
|
|
@@ -3067,7 +3068,7 @@ var gr = (e) => {
|
|
|
3067
3068
|
pageSize: t
|
|
3068
3069
|
}, {}, {}, {});
|
|
3069
3070
|
}
|
|
3070
|
-
let Ve = m(() => e.showLoading === !1 ? !1 :
|
|
3071
|
+
let Ve = m(() => e.showLoading === !1 ? !1 : A.value), He = m(() => {
|
|
3071
3072
|
let t = {};
|
|
3072
3073
|
for (let n of xr) {
|
|
3073
3074
|
if (n === "classes") {
|
|
@@ -3078,13 +3079,21 @@ var gr = (e) => {
|
|
|
3078
3079
|
});
|
|
3079
3080
|
continue;
|
|
3080
3081
|
}
|
|
3082
|
+
if (n === "expandable") {
|
|
3083
|
+
let n = e.expandable, r = e.expandedRowKeys;
|
|
3084
|
+
(n !== void 0 || r !== void 0) && (t.expandable = {
|
|
3085
|
+
...n ?? {},
|
|
3086
|
+
...r === void 0 ? {} : { expandedRowKeys: r }
|
|
3087
|
+
});
|
|
3088
|
+
continue;
|
|
3089
|
+
}
|
|
3081
3090
|
let r = e[n];
|
|
3082
3091
|
r !== void 0 && (t[n] = r);
|
|
3083
3092
|
}
|
|
3084
3093
|
return t;
|
|
3085
3094
|
});
|
|
3086
3095
|
function Ue(t, n, r, i) {
|
|
3087
|
-
|
|
3096
|
+
De(t, n, r, i), e.onChange?.(t, n, r, i);
|
|
3088
3097
|
}
|
|
3089
3098
|
function We(e) {
|
|
3090
3099
|
r("update:expandedRowKeys", e);
|
|
@@ -3113,35 +3122,35 @@ var gr = (e) => {
|
|
|
3113
3122
|
});
|
|
3114
3123
|
return i({
|
|
3115
3124
|
actionRef: () => ({
|
|
3116
|
-
loading:
|
|
3117
|
-
dataSource:
|
|
3125
|
+
loading: A,
|
|
3126
|
+
dataSource: V,
|
|
3118
3127
|
pageInfo: E,
|
|
3119
|
-
reload:
|
|
3128
|
+
reload: H,
|
|
3120
3129
|
reloadAndReset: (e) => {
|
|
3121
|
-
D({ current: 1 }),
|
|
3130
|
+
D({ current: 1 }), Ce(), ke(), e?.callBack?.();
|
|
3122
3131
|
},
|
|
3123
3132
|
setPagination: D,
|
|
3124
3133
|
setPageInfo: (e, t, n, r) => {
|
|
3125
|
-
D(e),
|
|
3134
|
+
D(e), De(e, t ?? {}, n ?? {}, r ?? {});
|
|
3126
3135
|
},
|
|
3127
|
-
setTableDataList:
|
|
3128
|
-
operateTableDataRow:
|
|
3129
|
-
setLoading:
|
|
3136
|
+
setTableDataList: Te,
|
|
3137
|
+
operateTableDataRow: Ee,
|
|
3138
|
+
setLoading: j,
|
|
3130
3139
|
selectedKeys: N,
|
|
3131
3140
|
selectedItems: te,
|
|
3132
3141
|
rowsSelection: {
|
|
3133
|
-
clear:
|
|
3142
|
+
clear: I,
|
|
3134
3143
|
select: re,
|
|
3135
3144
|
selectAll: F,
|
|
3136
|
-
remove:
|
|
3137
|
-
sync:
|
|
3145
|
+
remove: ae,
|
|
3146
|
+
sync: L
|
|
3138
3147
|
}
|
|
3139
3148
|
}),
|
|
3140
3149
|
formRef: () => ({
|
|
3141
|
-
getFormSearch:
|
|
3142
|
-
getFormInnerState: () =>
|
|
3150
|
+
getFormSearch: Se,
|
|
3151
|
+
getFormInnerState: () => xe.value,
|
|
3143
3152
|
restFormState: (e) => {
|
|
3144
|
-
|
|
3153
|
+
Ce(), e?.();
|
|
3145
3154
|
}
|
|
3146
3155
|
})
|
|
3147
3156
|
}), () => {
|
|
@@ -3155,12 +3164,12 @@ var gr = (e) => {
|
|
|
3155
3164
|
style: e.proStyles?.content
|
|
3156
3165
|
}, [Fe.value && h(rr, {
|
|
3157
3166
|
prefixCls: o.value,
|
|
3158
|
-
formColumns:
|
|
3159
|
-
formState:
|
|
3160
|
-
defaultFormSearch:
|
|
3161
|
-
formConfig:
|
|
3162
|
-
formAutoRequest:
|
|
3163
|
-
formActions:
|
|
3167
|
+
formColumns: ye.value,
|
|
3168
|
+
formState: xe.value,
|
|
3169
|
+
defaultFormSearch: be.value,
|
|
3170
|
+
formConfig: ge.value,
|
|
3171
|
+
formAutoRequest: _e.value,
|
|
3172
|
+
formActions: ve.value,
|
|
3164
3173
|
loading: Ve.value,
|
|
3165
3174
|
cardBordered: e.cardBordered,
|
|
3166
3175
|
proClasses: e.proClasses ?? {},
|
|
@@ -3168,7 +3177,7 @@ var gr = (e) => {
|
|
|
3168
3177
|
onSearch: Ie,
|
|
3169
3178
|
onReset: (e) => r("reset", e)
|
|
3170
3179
|
}, { default: () => [n.form?.()] }), h("div", {
|
|
3171
|
-
ref:
|
|
3180
|
+
ref: Ae,
|
|
3172
3181
|
class: J(e.proClasses?.card, `${o.value}-card`, e.cardBordered && `${o.value}-card-border`),
|
|
3173
3182
|
style: e.proStyles?.card
|
|
3174
3183
|
}, [h(lr, {
|
|
@@ -3182,21 +3191,21 @@ var gr = (e) => {
|
|
|
3182
3191
|
listToolAfter: n.listToolAfter?.() ?? e.listToolAfter,
|
|
3183
3192
|
proClasses: e.proClasses ?? {},
|
|
3184
3193
|
proStyles: e.proStyles ?? {}
|
|
3185
|
-
}, null), Pe.value ? h(
|
|
3194
|
+
}, null), Pe.value ? h(le, { spinning: !!Ve.value }, { default: () => [h("div", { class: J(`${o.value}-list`, e.proClasses?.list) }, [h("div", {
|
|
3186
3195
|
class: J(`${o.value}-list-content`, e.proClasses?.listContent),
|
|
3187
3196
|
style: e.proStyles?.listContent
|
|
3188
|
-
}, [Re()]), w.value !== !1 &&
|
|
3197
|
+
}, [Re()]), w.value !== !1 && V.value?.length > 0 && h(z, x(w.value, {
|
|
3189
3198
|
align: T.value,
|
|
3190
3199
|
class: J(`${o.value}-pagination`, e.proClasses?.pagination),
|
|
3191
3200
|
style: e.proStyles?.pagination,
|
|
3192
3201
|
onChange: Be
|
|
3193
|
-
}), null)])] }) : h(d, null, [h(
|
|
3202
|
+
}), null)])] }) : h(d, null, [h(ue, x(He.value, {
|
|
3194
3203
|
scroll: G.value,
|
|
3195
|
-
dataSource:
|
|
3196
|
-
columns: e.draggable ?
|
|
3197
|
-
components: e.draggable ?
|
|
3204
|
+
dataSource: V.value,
|
|
3205
|
+
columns: e.draggable ? pe.value : ce.value,
|
|
3206
|
+
components: e.draggable ? B.value : He.value.components,
|
|
3198
3207
|
rowKey: e.rowKey,
|
|
3199
|
-
size:
|
|
3208
|
+
size: ee.value,
|
|
3200
3209
|
pagination: w.value,
|
|
3201
3210
|
loading: Ve.value,
|
|
3202
3211
|
rowSelection: ne.value,
|
|
@@ -3205,10 +3214,10 @@ var gr = (e) => {
|
|
|
3205
3214
|
onScroll: Ge,
|
|
3206
3215
|
classes: {
|
|
3207
3216
|
...He.value.classes,
|
|
3208
|
-
...
|
|
3217
|
+
...Me.value ? { root: `${o.value}-overflow-hidden` } : {}
|
|
3209
3218
|
}
|
|
3210
|
-
}), qe.value),
|
|
3211
|
-
ref:
|
|
3219
|
+
}), qe.value), U.value && h(f, { to: U.value }, { default: () => [h(xn, {
|
|
3220
|
+
ref: W,
|
|
3212
3221
|
hasScrollY: !!G.value.y
|
|
3213
3222
|
}, null)] })])])])]);
|
|
3214
3223
|
};
|
|
@@ -3651,4 +3660,4 @@ var gr = (e) => {
|
|
|
3651
3660
|
inheritAttrs: !1
|
|
3652
3661
|
});
|
|
3653
3662
|
//#endregion
|
|
3654
|
-
export { Sr as GProTable, zt as useFetchData,
|
|
3663
|
+
export { Sr as GProTable, zt as useFetchData, Te as useInjectTableContext, Qt as usePagination, Oe as useProBreakpoints, $t as useRequestOptions, nn as useTable, on as useTableForm };
|