@gx-design-vue/pro-table 0.2.0-beta.136 → 0.2.0-beta.138
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 +338 -345
- package/dist/pro-table.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/pro-table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.137
|
|
4
4
|
* Author: gx12358
|
|
5
5
|
* Copyright (C) 2024 gx12358
|
|
6
6
|
* License: MIT License
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent as Te, ref as I, watch as z, cloneVNode as Qe, reactive as Ue, toRaw as re, computed as C, createVNode as s, Fragment as Ye, isVNode as
|
|
13
|
-
import { UpOutlined as Et, DownOutlined as Lt, InfoCircleOutlined as Mt, FullscreenExitOutlined as Wt, FullscreenOutlined as
|
|
12
|
+
import { defineComponent as Te, ref as I, watch as z, cloneVNode as Qe, reactive as Ue, toRaw as re, computed as C, createVNode as s, Fragment as Ye, isVNode as _, mergeProps as W, h as st, unref as S, onActivated as ct, nextTick as Ot, getCurrentInstance as jt, onMounted as At, onUnmounted as Nt, onDeactivated as Yt, watchEffect as zt, toRef as M, isRef as He } from "vue";
|
|
13
|
+
import { UpOutlined as Et, DownOutlined as Lt, InfoCircleOutlined as Mt, FullscreenExitOutlined as Wt, FullscreenOutlined as kt, ReloadOutlined as Ht, CopyOutlined as qt } from "@ant-design/icons-vue";
|
|
14
14
|
import { useProAppContext as dt } from "@gx-design-vue/pro-app";
|
|
15
|
-
import { useBreakpoint as ft, useMemo as
|
|
15
|
+
import { useBreakpoint as ft, useMemo as Pe, tryOnUnmounted as Kt } from "@gx-design-vue/pro-hooks";
|
|
16
16
|
import { useContext as Vt, useProStyle as Je, unit as nt, useProConfigContext as Gt } from "@gx-design-vue/pro-provider";
|
|
17
|
-
import { isArray as K, cloneDeep as
|
|
18
|
-
import { useDebounceFn as
|
|
19
|
-
import { Grid as ul, DatePicker as yt, Space as
|
|
17
|
+
import { isArray as K, cloneDeep as ee, isBoolean as Re, classNames as ae, isNumber as De, filterEmpty as mt, getPrefixCls as vt, isObject as Q, keysOf as ht, isDeepEqualReact as Ee, compareArray as Xt, runFunction as _t, getSortIndex as Qt, isFunction as ze, handleCurrentPage as Ut, getRandomNumber as gt, deepMerge as Se, arrayRepeat as Jt, isString as pt, handleShowIndex as Zt, getSlot as it, convertValueBoolean as qe, getSlotsProps as el, handleEmptyField as tl, getTextWidth as ll, getSlotVNode as al, useDeepMerge as nl } from "@gx-design-vue/pro-utils";
|
|
18
|
+
import { useDebounceFn as il, useFullscreen as bt, useWindowSize as ol } from "@vueuse/core";
|
|
19
|
+
import { Grid as ul, DatePicker as yt, Space as ot, Input as Ne, TimePicker as rl, TreeSelect as sl, Select as cl, InputNumber as Ke, Button as ut, Spin as Ct, Tooltip as we, theme as dl, Pagination as fl, Table as ml, message as vl, Empty as hl } from "ant-design-vue";
|
|
20
20
|
import { omit as Ie, cloneDeep as xt, pick as Le } from "lodash-es";
|
|
21
21
|
import { tableProps as gl } from "ant-design-vue/es/table/Table";
|
|
22
22
|
import "ant-design-vue/es/_util/props-util";
|
|
@@ -329,14 +329,14 @@ const bl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
329
329
|
setup(e, {
|
|
330
330
|
slots: a
|
|
331
331
|
}) {
|
|
332
|
-
const l = I([]), n = I(e.loading ?? !1),
|
|
332
|
+
const l = I([]), n = I(e.loading ?? !1), o = I("init"), i = il(e.fetch, e.debounceTime || 10);
|
|
333
333
|
return z([() => e.fetch, () => e.manual], () => {
|
|
334
|
-
if (
|
|
334
|
+
if (o.value !== "init" && n.value) return;
|
|
335
335
|
const d = e.manual ?? !1;
|
|
336
|
-
e.fetch && !d && (n.value = !0,
|
|
337
|
-
l.value = xt(v),
|
|
336
|
+
e.fetch && !d && (n.value = !0, i().then((v) => {
|
|
337
|
+
l.value = xt(v), o.value = "success";
|
|
338
338
|
}).catch((v) => {
|
|
339
|
-
console.error(v),
|
|
339
|
+
console.error(v), o.value = "error";
|
|
340
340
|
}).finally(() => {
|
|
341
341
|
n.value = !1;
|
|
342
342
|
}));
|
|
@@ -354,23 +354,23 @@ const bl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
354
354
|
function xl(e, a) {
|
|
355
355
|
const l = Ue({});
|
|
356
356
|
function n() {
|
|
357
|
-
Object.assign(l,
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
e[
|
|
361
|
-
e[
|
|
362
|
-
] : [])
|
|
357
|
+
Object.assign(l, ee(re(e)));
|
|
358
|
+
const i = a.find((d) => d.valueType === "dateRange");
|
|
359
|
+
i && o(i.name || "", e[i.rangeStartName || "start"] ? [
|
|
360
|
+
e[i.rangeStartName || "start"],
|
|
361
|
+
e[i.rangeEndName || "end"]
|
|
362
|
+
] : []);
|
|
363
363
|
}
|
|
364
364
|
z(() => e, () => {
|
|
365
365
|
n();
|
|
366
366
|
}, { deep: !0, immediate: !0 });
|
|
367
|
-
function i
|
|
368
|
-
l[
|
|
367
|
+
function o(i, d) {
|
|
368
|
+
l[i] = d;
|
|
369
369
|
}
|
|
370
370
|
return {
|
|
371
371
|
formState: l,
|
|
372
372
|
resetFormState: n,
|
|
373
|
-
changeFormState:
|
|
373
|
+
changeFormState: o
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
const Sl = (e) => ({
|
|
@@ -470,30 +470,30 @@ const Sl = (e) => ({
|
|
|
470
470
|
function fe(e, a) {
|
|
471
471
|
return typeof a == "function" ? a(V(e)) : V(e).format(a);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Fe(e, a) {
|
|
474
474
|
return a ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
|
|
475
475
|
}
|
|
476
476
|
const rt = (e, a, l = "string") => {
|
|
477
477
|
if (K(e)) {
|
|
478
|
-
const [n,
|
|
479
|
-
let
|
|
480
|
-
if (Array.isArray(a) ? (
|
|
481
|
-
const v = n ? fe(n,
|
|
478
|
+
const [n, o] = e;
|
|
479
|
+
let i, d;
|
|
480
|
+
if (Array.isArray(a) ? (i = a[0], d = a[1]) : typeof a == "object" && a.type === "mask" ? (i = a.format, d = a.format) : (i = a, d = a), l === "string") {
|
|
481
|
+
const v = n ? fe(n, i) : "", p = o ? fe(o, d) : "";
|
|
482
482
|
return [v, p];
|
|
483
483
|
}
|
|
484
|
-
return [V(n), V(
|
|
484
|
+
return [V(n), V(o)];
|
|
485
485
|
}
|
|
486
486
|
};
|
|
487
487
|
function wl(e) {
|
|
488
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
488
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
489
489
|
}
|
|
490
490
|
const {
|
|
491
491
|
useBreakpoint: Tl
|
|
492
492
|
} = ul, {
|
|
493
493
|
MonthPicker: Rl,
|
|
494
494
|
RangePicker: $l,
|
|
495
|
-
YearPicker:
|
|
496
|
-
WeekPicker:
|
|
495
|
+
YearPicker: Fl,
|
|
496
|
+
WeekPicker: Pl,
|
|
497
497
|
QuarterPicker: Dl
|
|
498
498
|
} = yt;
|
|
499
499
|
function Il(e) {
|
|
@@ -526,20 +526,20 @@ const Bl = {
|
|
|
526
526
|
}) {
|
|
527
527
|
const {
|
|
528
528
|
wrapSSR: n,
|
|
529
|
-
hashId:
|
|
530
|
-
} = Je("ProTableForm", [Sl], e.prefixCls),
|
|
529
|
+
hashId: o
|
|
530
|
+
} = Je("ProTableForm", [Sl], e.prefixCls), i = dt(), d = Tl(), {
|
|
531
531
|
formAutoRequest: v,
|
|
532
532
|
formConfig: p,
|
|
533
|
-
formActions:
|
|
533
|
+
formActions: P
|
|
534
534
|
} = Ze(), {
|
|
535
535
|
formState: r,
|
|
536
536
|
resetFormState: B,
|
|
537
537
|
changeFormState: h
|
|
538
|
-
} = xl(e.defaultFormSearch, e.formCols), f = I(p.value?.collapsed ?? p.value?.defaultCollapsed), x = C(() => Re(
|
|
538
|
+
} = xl(e.defaultFormSearch, e.formCols), f = I(p.value?.collapsed ?? p.value?.defaultCollapsed), x = C(() => Re(P.value?.reset) ? P.value?.reset : !v.value), b = C(() => oe(p.value?.span)), A = C(() => p.value?.label);
|
|
539
539
|
z(() => p.value?.collapsed, (t) => {
|
|
540
540
|
f.value = t;
|
|
541
541
|
});
|
|
542
|
-
function
|
|
542
|
+
function oe(t) {
|
|
543
543
|
let u = 4;
|
|
544
544
|
for (let y = 0; y < Ve.length; y += 1) {
|
|
545
545
|
const g = Ve[y].value;
|
|
@@ -582,7 +582,7 @@ const Bl = {
|
|
|
582
582
|
h(u.name || "", t ?? (u.field?.treeCheckable || u.field?.multiple ? [] : null));
|
|
583
583
|
break;
|
|
584
584
|
case "date":
|
|
585
|
-
h(u.name || "", t ? fe(t,
|
|
585
|
+
h(u.name || "", t ? fe(t, Fe(u.valueFormat, u.showTime)) : null);
|
|
586
586
|
break;
|
|
587
587
|
case "dateWeek":
|
|
588
588
|
h(u.name || "", t ? fe(t, "YYYY-wo") : null);
|
|
@@ -597,7 +597,7 @@ const Bl = {
|
|
|
597
597
|
h(u.name || "", t ? fe(t, "YYYY") : null);
|
|
598
598
|
break;
|
|
599
599
|
case "dateRange":
|
|
600
|
-
h(u.name || "", t && K(t) && t.length === 2 ? rt(t,
|
|
600
|
+
h(u.name || "", t && K(t) && t.length === 2 ? rt(t, Fe(u.valueFormat, u.showTime)) : null);
|
|
601
601
|
break;
|
|
602
602
|
case "time":
|
|
603
603
|
h(u.name || "", t ? fe(t, u.valueFormat || "HH:mm:ss") : null);
|
|
@@ -612,44 +612,44 @@ const Bl = {
|
|
|
612
612
|
resetForm: me
|
|
613
613
|
});
|
|
614
614
|
const Y = () => {
|
|
615
|
-
const t =
|
|
615
|
+
const t = i?.emptyText?.value;
|
|
616
616
|
if (t) {
|
|
617
|
-
const u =
|
|
617
|
+
const u = _(t), y = u ? st(t) : mt(t || []);
|
|
618
618
|
return s("div", {
|
|
619
|
-
class: ae(`${e.prefixCls}-search-empty-text`,
|
|
619
|
+
class: ae(`${e.prefixCls}-search-empty-text`, o.value)
|
|
620
620
|
}, [u ? y : K(y) ? y.map((g) => Qe(g)) : void 0]);
|
|
621
621
|
}
|
|
622
|
-
},
|
|
622
|
+
}, G = () => (!v.value || x.value) && s(ot, null, {
|
|
623
623
|
default: () => [x.value && s(ut, {
|
|
624
624
|
onClick: () => me()
|
|
625
625
|
}, {
|
|
626
|
-
default: () => [
|
|
626
|
+
default: () => [P.value?.resetText || "重置"]
|
|
627
627
|
}), !v.value && s(ut, {
|
|
628
628
|
loading: e.loading,
|
|
629
629
|
type: "primary",
|
|
630
630
|
onClick: () => le(!0)
|
|
631
631
|
}, {
|
|
632
|
-
default: () => [
|
|
632
|
+
default: () => [P.value?.searchText || "查询"]
|
|
633
633
|
})]
|
|
634
|
-
}),
|
|
634
|
+
}), U = ({
|
|
635
635
|
formItemStyle: t,
|
|
636
636
|
collapsed: u,
|
|
637
637
|
collapseRender: y = !0
|
|
638
638
|
}) => s("div", {
|
|
639
639
|
style: t,
|
|
640
|
-
class: `${e.prefixCls}-search-collapse-buttons ${
|
|
641
|
-
}, [s(
|
|
640
|
+
class: `${e.prefixCls}-search-collapse-buttons ${o.value}`
|
|
641
|
+
}, [s(ot, {
|
|
642
642
|
size: 16
|
|
643
643
|
}, {
|
|
644
|
-
default: () => [
|
|
645
|
-
class: `${e.prefixCls}-a ${
|
|
644
|
+
default: () => [G(), p.value?.collapseRender !== !1 && y && s(Ye, null, [typeof p.value?.collapseRender == "function" ? p.value?.collapseRender(u) : s("span", {
|
|
645
|
+
class: `${e.prefixCls}-a ${o.value}`,
|
|
646
646
|
onClick: () => te(!u)
|
|
647
647
|
}, [u ? "收起" : "展开", u ? s(Et, null, null) : s(Lt, null, null)])])]
|
|
648
648
|
})]);
|
|
649
649
|
function ne(t) {
|
|
650
650
|
return t === void 0 ? void 0 : t ? s(Ct, {
|
|
651
651
|
size: "small",
|
|
652
|
-
indicator:
|
|
652
|
+
indicator: i?.indicator?.value
|
|
653
653
|
}, null) : Y();
|
|
654
654
|
}
|
|
655
655
|
function be(t, u) {
|
|
@@ -660,7 +660,7 @@ const Bl = {
|
|
|
660
660
|
default: () => [u]
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const J = (t) => {
|
|
664
664
|
let u;
|
|
665
665
|
const y = v.value ? Ne.Search : Ne, g = Ie(t.field || {}, "rules");
|
|
666
666
|
let R = null;
|
|
@@ -690,7 +690,7 @@ const Bl = {
|
|
|
690
690
|
case "numberRange":
|
|
691
691
|
u = s(Ne.Group, {
|
|
692
692
|
compact: !0,
|
|
693
|
-
class: ae(
|
|
693
|
+
class: ae(o.value, `${e.prefixCls}-search-input-compact`)
|
|
694
694
|
}, {
|
|
695
695
|
default: () => [s(Ke, {
|
|
696
696
|
value: r[t.name]?.[0],
|
|
@@ -749,14 +749,14 @@ const Bl = {
|
|
|
749
749
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
750
750
|
placeholder: t.placeholder || "请选择",
|
|
751
751
|
allowClear: t.allowClear ?? !0,
|
|
752
|
-
format:
|
|
752
|
+
format: Fe(t.valueFormat, t.showTime),
|
|
753
753
|
showTime: t.showTime,
|
|
754
754
|
showToday: t.showToday || !0,
|
|
755
755
|
onChange: (c) => O(c, t)
|
|
756
756
|
}, g), null);
|
|
757
757
|
break;
|
|
758
758
|
case "dateWeek":
|
|
759
|
-
u = s(
|
|
759
|
+
u = s(Pl, W({
|
|
760
760
|
style: {
|
|
761
761
|
width: "100%"
|
|
762
762
|
},
|
|
@@ -792,7 +792,7 @@ const Bl = {
|
|
|
792
792
|
}, g), null);
|
|
793
793
|
break;
|
|
794
794
|
case "dateYear":
|
|
795
|
-
u = s(
|
|
795
|
+
u = s(Fl, W({
|
|
796
796
|
style: {
|
|
797
797
|
width: "100%"
|
|
798
798
|
},
|
|
@@ -808,10 +808,10 @@ const Bl = {
|
|
|
808
808
|
style: {
|
|
809
809
|
width: "100%"
|
|
810
810
|
},
|
|
811
|
-
value: r[t.name] && K(r[t.name]) && r[t.name]?.length === 2 ? rt(r[t.name],
|
|
811
|
+
value: r[t.name] && K(r[t.name]) && r[t.name]?.length === 2 ? rt(r[t.name], Fe(t.valueFormat, t.showTime), "dayjs") : void 0,
|
|
812
812
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
813
813
|
placeholder: t.placeholder || ["开始日期", "结束日期"],
|
|
814
|
-
format:
|
|
814
|
+
format: Fe(t.valueFormat, t.showTime),
|
|
815
815
|
showTime: t.showTime,
|
|
816
816
|
onChange: (c) => O(c, t)
|
|
817
817
|
}, g), null);
|
|
@@ -836,7 +836,7 @@ const Bl = {
|
|
|
836
836
|
formItemStyle: t = {},
|
|
837
837
|
item: u
|
|
838
838
|
}) => {
|
|
839
|
-
const y =
|
|
839
|
+
const y = _(u) ? u.props?.label : u.label, g = (_(u) ? u.props?.labelWidth : u.labelWidth) || A.value?.width, R = (_(u) ? u.props?.labelAlign : u.labelAlign) || A.value?.align;
|
|
840
840
|
return s("div", {
|
|
841
841
|
class: `${e.prefixCls}-search-item`,
|
|
842
842
|
style: {
|
|
@@ -850,7 +850,7 @@ const Bl = {
|
|
|
850
850
|
}
|
|
851
851
|
}, [y]), s("div", {
|
|
852
852
|
class: ae(`${e.prefixCls}-search-item-children`)
|
|
853
|
-
}, [
|
|
853
|
+
}, [_(u) ? u : J(u)])]);
|
|
854
854
|
}, se = () => {
|
|
855
855
|
let t = a.default?.() || [];
|
|
856
856
|
t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
|
|
@@ -865,7 +865,7 @@ const Bl = {
|
|
|
865
865
|
return u.length < b.value || f.value ? s(Ye, null, [q({
|
|
866
866
|
formItemStyle: c,
|
|
867
867
|
item: g
|
|
868
|
-
}), R === u.length - 1 &&
|
|
868
|
+
}), R === u.length - 1 && U({
|
|
869
869
|
formItemStyle: {
|
|
870
870
|
flex: 1,
|
|
871
871
|
justifyContent: "flex-end"
|
|
@@ -878,7 +878,7 @@ const Bl = {
|
|
|
878
878
|
}), R === b.value - 1 && (b.value - 1 === 0 || u.length === b.value) && q({
|
|
879
879
|
formItemStyle: c,
|
|
880
880
|
item: g
|
|
881
|
-
}), R === b.value - 1 && u.length >= b.value &&
|
|
881
|
+
}), R === b.value - 1 && u.length >= b.value && U({
|
|
882
882
|
formItemStyle: {
|
|
883
883
|
flex: 1,
|
|
884
884
|
justifyContent: "flex-end"
|
|
@@ -891,7 +891,7 @@ const Bl = {
|
|
|
891
891
|
return () => {
|
|
892
892
|
const t = e.cardBordered && `${e.prefixCls}-search-border`;
|
|
893
893
|
return n(s("div", {
|
|
894
|
-
class: ae(
|
|
894
|
+
class: ae(o.value, `${e.prefixCls}-search`, t, o.value, p.value?.className)
|
|
895
895
|
}, [se()]));
|
|
896
896
|
};
|
|
897
897
|
}
|
|
@@ -968,23 +968,23 @@ const Bl = {
|
|
|
968
968
|
}
|
|
969
969
|
});
|
|
970
970
|
function Al(e) {
|
|
971
|
-
if (
|
|
971
|
+
if (_(e))
|
|
972
972
|
return e;
|
|
973
973
|
if (e) {
|
|
974
974
|
const a = e, {
|
|
975
975
|
icon: l,
|
|
976
976
|
tooltip: n,
|
|
977
|
-
onClick:
|
|
978
|
-
key:
|
|
977
|
+
onClick: o,
|
|
978
|
+
key: i
|
|
979
979
|
} = a;
|
|
980
980
|
return l && n ? s(we, {
|
|
981
981
|
title: n,
|
|
982
|
-
key:
|
|
982
|
+
key: i
|
|
983
983
|
}, {
|
|
984
984
|
default: () => [s("span", {
|
|
985
|
-
key:
|
|
985
|
+
key: i,
|
|
986
986
|
onClick: () => {
|
|
987
|
-
|
|
987
|
+
o && o(i);
|
|
988
988
|
}
|
|
989
989
|
}, [l])]
|
|
990
990
|
}) : l;
|
|
@@ -1006,14 +1006,14 @@ const wt = /* @__PURE__ */ Te({
|
|
|
1006
1006
|
wrapSSR: a,
|
|
1007
1007
|
hashId: l
|
|
1008
1008
|
} = Je("ListToolBar", [jl], e.prefixCls), n = ft(), {
|
|
1009
|
-
isMobile:
|
|
1010
|
-
} = Ze(),
|
|
1009
|
+
isMobile: o
|
|
1010
|
+
} = Ze(), i = C(() => !!(e.titleTip || e.headerTitle)), d = Pe(() => {
|
|
1011
1011
|
if (!Array.isArray(e.actions) || e.actions?.length < 1)
|
|
1012
1012
|
return {
|
|
1013
1013
|
left: null,
|
|
1014
1014
|
right: null
|
|
1015
1015
|
};
|
|
1016
|
-
const h = e.actions.filter((x) =>
|
|
1016
|
+
const h = e.actions.filter((x) => _(x)).filter((x) => (x?.props?.placement || e.actionsPlacement) === "left"), f = e.actions.filter((x) => _(x)).filter((x) => (x?.props?.placement || e.actionsPlacement) === "right");
|
|
1017
1017
|
return {
|
|
1018
1018
|
left: h.length ? s("div", {
|
|
1019
1019
|
class: `${e.prefixCls}-actions ${l.value}`
|
|
@@ -1022,13 +1022,13 @@ const wt = /* @__PURE__ */ Te({
|
|
|
1022
1022
|
class: `${e.prefixCls}-actions ${l.value}`
|
|
1023
1023
|
}, [f]) : null
|
|
1024
1024
|
};
|
|
1025
|
-
}, [() => e.actions, () => e.actionsPlacement]), v = C(() => !!(e.titleTip || e.headerTitle || d.value.left)), p = C(() => !!(e.settings?.length || d.value.right)),
|
|
1025
|
+
}, [() => e.actions, () => e.actionsPlacement]), v = C(() => !!(e.titleTip || e.headerTitle || d.value.left)), p = C(() => !!(e.settings?.length || d.value.right)), P = Pe(() => {
|
|
1026
1026
|
if (!v.value && p.value)
|
|
1027
1027
|
return s("div", {
|
|
1028
1028
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1029
1029
|
}, null);
|
|
1030
1030
|
const h = d.value.left;
|
|
1031
|
-
return
|
|
1031
|
+
return i.value ? s("div", {
|
|
1032
1032
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1033
1033
|
}, [s("div", {
|
|
1034
1034
|
class: `${e.prefixCls}-title ${l.value}`
|
|
@@ -1039,7 +1039,7 @@ const wt = /* @__PURE__ */ Te({
|
|
|
1039
1039
|
})]), h]) : s("div", {
|
|
1040
1040
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1041
1041
|
}, [h]);
|
|
1042
|
-
}, [() => v.value, () => p.value, () =>
|
|
1042
|
+
}, [() => v.value, () => p.value, () => i.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.titleTip]), r = Pe(() => {
|
|
1043
1043
|
if (!p.value) return null;
|
|
1044
1044
|
const h = d.value.right;
|
|
1045
1045
|
return s("div", {
|
|
@@ -1057,17 +1057,17 @@ const wt = /* @__PURE__ */ Te({
|
|
|
1057
1057
|
class: ae(`${e.prefixCls}-setting-item`, l.value)
|
|
1058
1058
|
}, [b]);
|
|
1059
1059
|
})]) : null]);
|
|
1060
|
-
}, [() => n.value, () => p.value, () => e.prefixCls, () =>
|
|
1060
|
+
}, [() => n.value, () => p.value, () => e.prefixCls, () => i.value, () => d.value, () => e.settings]), B = Pe(() => {
|
|
1061
1061
|
if (!p.value && !v.value) return null;
|
|
1062
1062
|
const h = {
|
|
1063
1063
|
[`${l.value}`]: !0,
|
|
1064
1064
|
[`${e.prefixCls}-container`]: !0,
|
|
1065
|
-
[`${e.prefixCls}-container-mobile`]:
|
|
1065
|
+
[`${e.prefixCls}-container-mobile`]: o.value
|
|
1066
1066
|
};
|
|
1067
1067
|
return s("div", {
|
|
1068
1068
|
class: h
|
|
1069
|
-
}, [
|
|
1070
|
-
}, [() =>
|
|
1069
|
+
}, [P.value, r.value]);
|
|
1070
|
+
}, [() => o.value, () => v.value, () => p.value, () => P.value, () => e.prefixCls, () => r.value]);
|
|
1071
1071
|
return () => a(s("div", {
|
|
1072
1072
|
class: `${e.prefixCls} ${l.value}`
|
|
1073
1073
|
}, [B.value]));
|
|
@@ -1086,7 +1086,7 @@ const Tt = /* @__PURE__ */ Te({
|
|
|
1086
1086
|
}) : s(we, {
|
|
1087
1087
|
title: "全屏"
|
|
1088
1088
|
}, {
|
|
1089
|
-
default: () => [s(
|
|
1089
|
+
default: () => [s(kt, null, null)]
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
});
|
|
@@ -1094,7 +1094,7 @@ function Nl() {
|
|
|
1094
1094
|
return {
|
|
1095
1095
|
reload: {
|
|
1096
1096
|
text: "刷新",
|
|
1097
|
-
icon: s(
|
|
1097
|
+
icon: s(Ht, null, null)
|
|
1098
1098
|
},
|
|
1099
1099
|
fullScreen: {
|
|
1100
1100
|
text: "全屏",
|
|
@@ -1107,21 +1107,21 @@ function Yl(e, a) {
|
|
|
1107
1107
|
const n = e[l];
|
|
1108
1108
|
if (!n)
|
|
1109
1109
|
return null;
|
|
1110
|
-
let
|
|
1111
|
-
if (typeof
|
|
1110
|
+
let o = n === !0 ? a[l] : () => n?.();
|
|
1111
|
+
if (typeof o != "function" && (o = () => {
|
|
1112
1112
|
}), l === "fullScreen")
|
|
1113
1113
|
return s("span", {
|
|
1114
1114
|
key: l,
|
|
1115
|
-
onClick:
|
|
1115
|
+
onClick: o
|
|
1116
1116
|
}, [s(Tt, null, null)]);
|
|
1117
|
-
const
|
|
1118
|
-
return
|
|
1117
|
+
const i = Nl()[l];
|
|
1118
|
+
return i ? s("span", {
|
|
1119
1119
|
key: l,
|
|
1120
|
-
onClick:
|
|
1120
|
+
onClick: o
|
|
1121
1121
|
}, [s(we, {
|
|
1122
|
-
title:
|
|
1122
|
+
title: i.text
|
|
1123
1123
|
}, {
|
|
1124
|
-
default: () => [
|
|
1124
|
+
default: () => [i.icon]
|
|
1125
1125
|
})]) : null;
|
|
1126
1126
|
}).filter((l) => l);
|
|
1127
1127
|
}
|
|
@@ -1142,16 +1142,16 @@ const zl = {
|
|
|
1142
1142
|
isPor: !0
|
|
1143
1143
|
}), {
|
|
1144
1144
|
action: l
|
|
1145
|
-
} = Ze(), n =
|
|
1145
|
+
} = Ze(), n = Pe(() => e.options === !1 ? [] : Yl({
|
|
1146
1146
|
reload: () => l?.reload(),
|
|
1147
1147
|
fullScreen: () => l?.toggle()
|
|
1148
|
-
},
|
|
1148
|
+
}, Q(e.options) ? e.options : {}), [() => e.options]);
|
|
1149
1149
|
return () => {
|
|
1150
|
-
const
|
|
1150
|
+
const o = e.actionsRender || [];
|
|
1151
1151
|
return s(wt, {
|
|
1152
1152
|
prefixCls: a,
|
|
1153
1153
|
headerTitle: e.headerTitle,
|
|
1154
|
-
actions:
|
|
1154
|
+
actions: o,
|
|
1155
1155
|
actionsPlacement: e.actionsPlacement,
|
|
1156
1156
|
settings: S(n),
|
|
1157
1157
|
titleTip: e.titleTip,
|
|
@@ -1166,7 +1166,7 @@ function Ll(e) {
|
|
|
1166
1166
|
function Ml(e, a = !0, l) {
|
|
1167
1167
|
Ll() ? ct(e, l) : a ? e() : Ot(e);
|
|
1168
1168
|
}
|
|
1169
|
-
function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll:
|
|
1169
|
+
function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: o, neverScroll: i }) {
|
|
1170
1170
|
const d = I([]);
|
|
1171
1171
|
z([
|
|
1172
1172
|
() => e.value,
|
|
@@ -1174,11 +1174,11 @@ function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i,
|
|
|
1174
1174
|
() => l.value,
|
|
1175
1175
|
() => n.value,
|
|
1176
1176
|
() => l.value,
|
|
1177
|
-
() =>
|
|
1178
|
-
() =>
|
|
1177
|
+
() => o.value,
|
|
1178
|
+
() => i.value
|
|
1179
1179
|
], () => {
|
|
1180
|
-
const h =
|
|
1181
|
-
Ee(h, re(d.value)) || (d.value =
|
|
1180
|
+
const h = P(re(a.value));
|
|
1181
|
+
Ee(h, re(d.value)) || (d.value = ee(h));
|
|
1182
1182
|
}, {
|
|
1183
1183
|
deep: !0,
|
|
1184
1184
|
immediate: !0
|
|
@@ -1194,11 +1194,11 @@ function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i,
|
|
|
1194
1194
|
function p(h) {
|
|
1195
1195
|
return h.sort((f, x) => Xt(f, x, "order", 0));
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return
|
|
1199
|
-
if (f.dataIndex === "action" || x === h.length - 1 ? f.resizable = !1 : f.resizable = Re(f.resizable) ? f.resizable : !!(De(f.width) && S(n)), !f.width || S(
|
|
1197
|
+
function P(h) {
|
|
1198
|
+
return ee(h).map((f, x) => {
|
|
1199
|
+
if (f.dataIndex === "action" || x === h.length - 1 ? f.resizable = !1 : f.resizable = Re(f.resizable) ? f.resizable : !!(De(f.width) && S(n)), !f.width || S(i))
|
|
1200
1200
|
return f;
|
|
1201
|
-
if (f.dataIndex === "action" && S(
|
|
1201
|
+
if (f.dataIndex === "action" && S(o))
|
|
1202
1202
|
if (S(e)?.x || !S(l))
|
|
1203
1203
|
f.width = f.width || 100, f.fixed = "right";
|
|
1204
1204
|
else {
|
|
@@ -1216,7 +1216,7 @@ function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i,
|
|
|
1216
1216
|
d.value = [];
|
|
1217
1217
|
return;
|
|
1218
1218
|
}
|
|
1219
|
-
Ee(
|
|
1219
|
+
Ee(P(h), re(d.value)) || (d.value = P(h));
|
|
1220
1220
|
}
|
|
1221
1221
|
return {
|
|
1222
1222
|
breakpoint: l,
|
|
@@ -1225,48 +1225,48 @@ function Wl({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i,
|
|
|
1225
1225
|
resizeColumnWidth: r
|
|
1226
1226
|
};
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
const l = C(() => a), n = I(),
|
|
1230
|
-
function
|
|
1228
|
+
function kl(e, a) {
|
|
1229
|
+
const l = C(() => a), n = I(), o = I(e);
|
|
1230
|
+
function i() {
|
|
1231
1231
|
n.value && (clearTimeout(n.value), n.value = null);
|
|
1232
1232
|
}
|
|
1233
1233
|
async function d(...v) {
|
|
1234
|
-
return l.value === 0 || l.value === void 0 ?
|
|
1235
|
-
v[0]?.immediate ? p(await
|
|
1236
|
-
p(await
|
|
1234
|
+
return l.value === 0 || l.value === void 0 ? o.value(...v) : (i(), new Promise(async (p) => {
|
|
1235
|
+
v[0]?.immediate ? p(await o.value(...v)) : n.value = setTimeout(async () => {
|
|
1236
|
+
p(await o.value(...v));
|
|
1237
1237
|
}, l.value);
|
|
1238
1238
|
}));
|
|
1239
1239
|
}
|
|
1240
|
-
return Kt(
|
|
1241
|
-
cancel:
|
|
1240
|
+
return Kt(i), {
|
|
1241
|
+
cancel: i,
|
|
1242
1242
|
run: d
|
|
1243
1243
|
};
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const a = C(() => e.rowKey), l = C(() => e.polling), n = C(() => e.debounceTime),
|
|
1245
|
+
function Hl(e) {
|
|
1246
|
+
const a = C(() => e.rowKey), l = C(() => e.polling), n = C(() => e.debounceTime), o = C(() => e.dataSource), i = C(() => e.autoRequest);
|
|
1247
1247
|
return {
|
|
1248
1248
|
rowKey: a,
|
|
1249
1249
|
polling: l,
|
|
1250
1250
|
request: e.request,
|
|
1251
1251
|
postData: e.postData,
|
|
1252
1252
|
debounceTime: n,
|
|
1253
|
-
dataSource:
|
|
1254
|
-
autoRequest:
|
|
1253
|
+
dataSource: o,
|
|
1254
|
+
autoRequest: i
|
|
1255
1255
|
};
|
|
1256
1256
|
}
|
|
1257
|
-
function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData:
|
|
1258
|
-
const le = I(""), O = I(!1), me = I(!1), Y = I([]),
|
|
1257
|
+
function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData: o, dataSource: i, waitRequest: d, debounceTime: v }, { params: p, columns: P, setLoading: r, setColumns: B, removeRowKeys: h, syncSelectedRows: f, defaultFormSearch: x, setPagination: b, pageInfo: A, onRequestError: oe, onBeforeSearchSubmit: te, hasCustomRender: $e }, pe) {
|
|
1258
|
+
const le = I(""), O = I(!1), me = I(!1), Y = I([]), G = I(), U = I(null), ne = ($ = !1) => {
|
|
1259
1259
|
(O.value || $) && r(!1), y(!1);
|
|
1260
1260
|
}, be = async ($ = {}) => {
|
|
1261
|
-
const { pagination: N, filters: D = {}, sorter:
|
|
1261
|
+
const { pagination: N, filters: D = {}, sorter: k = {}, removeKeys: ue = [], isPolling: Z = !1, extra: ce } = $;
|
|
1262
1262
|
if (!n || !ze(n))
|
|
1263
|
-
return
|
|
1264
|
-
|
|
1263
|
+
return i.value || [];
|
|
1264
|
+
Z ? y(!0) : r(!0), N && b(N);
|
|
1265
1265
|
try {
|
|
1266
1266
|
ue.length && h(ue);
|
|
1267
|
-
const
|
|
1268
|
-
B(S(
|
|
1269
|
-
const xe =
|
|
1267
|
+
const H = Q(k) ? Object.keys(k).length ? [k] : [] : k;
|
|
1268
|
+
B(S(P).map((Ce) => {
|
|
1269
|
+
const xe = H.find((ve) => (ve?.columnKey || ve?.field) === Ce.dataIndex);
|
|
1270
1270
|
return {
|
|
1271
1271
|
...Ce,
|
|
1272
1272
|
sortOrder: xe?.order
|
|
@@ -1281,27 +1281,27 @@ function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData: i, da
|
|
|
1281
1281
|
};
|
|
1282
1282
|
te && ze(te) && (ye = await te({
|
|
1283
1283
|
params: ye,
|
|
1284
|
-
sorter:
|
|
1284
|
+
sorter: H,
|
|
1285
1285
|
filter: D,
|
|
1286
1286
|
extra: ce
|
|
1287
1287
|
}));
|
|
1288
1288
|
let de = [];
|
|
1289
1289
|
const Be = `table_request_${gt().uuid(10)}`;
|
|
1290
1290
|
le.value = Be;
|
|
1291
|
-
const
|
|
1292
|
-
params:
|
|
1293
|
-
sorter:
|
|
1291
|
+
const ie = await n?.({
|
|
1292
|
+
params: ee(re(ye)),
|
|
1293
|
+
sorter: H,
|
|
1294
1294
|
filter: D,
|
|
1295
1295
|
extra: ce
|
|
1296
1296
|
});
|
|
1297
1297
|
if (le.value !== Be)
|
|
1298
1298
|
return [];
|
|
1299
|
-
if (
|
|
1300
|
-
const { success: Ce = !0, data: xe = [] } =
|
|
1299
|
+
if (ie) {
|
|
1300
|
+
const { success: Ce = !0, data: xe = [] } = ie;
|
|
1301
1301
|
if (!Ce)
|
|
1302
1302
|
return [];
|
|
1303
|
-
de = typeof
|
|
1304
|
-
const ve =
|
|
1303
|
+
de = typeof o == "function" ? await o?.(xe) : xe, f(de);
|
|
1304
|
+
const ve = ie.total || de?.length || 0;
|
|
1305
1305
|
ve !== A.total && b({
|
|
1306
1306
|
total: ve
|
|
1307
1307
|
});
|
|
@@ -1309,78 +1309,78 @@ function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData: i, da
|
|
|
1309
1309
|
return Ee(de, he) ? S(Y) : (R(de), de);
|
|
1310
1310
|
} else
|
|
1311
1311
|
return [];
|
|
1312
|
-
} catch (
|
|
1313
|
-
if (
|
|
1314
|
-
throw new Error(
|
|
1315
|
-
Y.value === void 0 && R([]),
|
|
1312
|
+
} catch (H) {
|
|
1313
|
+
if (oe === void 0)
|
|
1314
|
+
throw new Error(H);
|
|
1315
|
+
Y.value === void 0 && R([]), oe(H);
|
|
1316
1316
|
} finally {
|
|
1317
1317
|
ne(!0);
|
|
1318
1318
|
}
|
|
1319
1319
|
return [];
|
|
1320
|
-
},
|
|
1321
|
-
if (
|
|
1320
|
+
}, J = kl(async ($ = {}) => {
|
|
1321
|
+
if (G.value && clearTimeout(G.value), !n)
|
|
1322
1322
|
return;
|
|
1323
1323
|
const N = new AbortController();
|
|
1324
|
-
|
|
1324
|
+
U.value = N;
|
|
1325
1325
|
try {
|
|
1326
1326
|
const D = await Promise.race([
|
|
1327
1327
|
be($),
|
|
1328
|
-
new Promise((ue,
|
|
1329
|
-
|
|
1330
|
-
|
|
1328
|
+
new Promise((ue, Z) => {
|
|
1329
|
+
U.value?.signal?.addEventListener?.("abort", () => {
|
|
1330
|
+
Z("aborted"), J.cancel(), ne();
|
|
1331
1331
|
});
|
|
1332
1332
|
})
|
|
1333
1333
|
]);
|
|
1334
1334
|
if (N.signal.aborted)
|
|
1335
1335
|
return;
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1338
|
-
|
|
1339
|
-
}, Math.max(
|
|
1336
|
+
const k = _t(l.value, D);
|
|
1337
|
+
return k && !O.value && (G.value = setTimeout(() => {
|
|
1338
|
+
J.run({ ...$, isPolling: k });
|
|
1339
|
+
}, Math.max(k, 2e3))), D;
|
|
1340
1340
|
} catch (D) {
|
|
1341
1341
|
if (D === "aborted")
|
|
1342
1342
|
return;
|
|
1343
1343
|
throw D;
|
|
1344
1344
|
}
|
|
1345
1345
|
}, v.value || 30), q = () => {
|
|
1346
|
-
|
|
1346
|
+
U.value?.abort(), J.cancel(), ne();
|
|
1347
1347
|
};
|
|
1348
1348
|
At(() => {
|
|
1349
1349
|
O.value = !1;
|
|
1350
1350
|
}), ct(() => {
|
|
1351
1351
|
O.value = !1;
|
|
1352
1352
|
}), Nt(() => {
|
|
1353
|
-
q(), O.value = !0, clearTimeout(
|
|
1353
|
+
q(), O.value = !0, clearTimeout(G.value);
|
|
1354
1354
|
}), Yt(() => {
|
|
1355
|
-
q(), O.value = !0, clearTimeout(
|
|
1355
|
+
q(), O.value = !0, clearTimeout(G.value);
|
|
1356
1356
|
}), z(() => l.value, () => {
|
|
1357
|
-
d.value || (l.value ?
|
|
1357
|
+
d.value || (l.value ? J.run({ isPolling: !0 }) : clearTimeout(G.value));
|
|
1358
1358
|
}, { immediate: !0 }), z(() => d.value, () => {
|
|
1359
|
-
d.value ? r(!0) :
|
|
1360
|
-
}, { immediate: !0 }), z(() =>
|
|
1361
|
-
|
|
1359
|
+
d.value ? r(!0) : J.run({ isPolling: !1 });
|
|
1360
|
+
}, { immediate: !0 }), z(() => i.value, () => {
|
|
1361
|
+
i.value && R(i.value || []);
|
|
1362
1362
|
}, { deep: !0, immediate: !0 }), z(() => p.value, () => {
|
|
1363
1363
|
d.value || a.value && (b({ current: 1 }), se());
|
|
1364
1364
|
}, { deep: !0, immediate: !0 }), z(() => x.value, ($, N) => {
|
|
1365
1365
|
d.value || Ee($, N) || (b({ current: 1 }), se());
|
|
1366
1366
|
}, { deep: !0, immediate: !0 });
|
|
1367
1367
|
function se() {
|
|
1368
|
-
n ? l.value || (q(),
|
|
1368
|
+
n ? l.value || (q(), J.run({ isPolling: !1 })) : R(i.value || []);
|
|
1369
1369
|
}
|
|
1370
1370
|
const t = C(() => {
|
|
1371
1371
|
if ($e.value)
|
|
1372
1372
|
return S(Y);
|
|
1373
|
-
const $ =
|
|
1373
|
+
const $ = P.value.filter((N) => N.show || N.show === void 0);
|
|
1374
1374
|
return !S(Y) || !$ || $.length === 0 ? [] : S(Y);
|
|
1375
1375
|
}), u = C(() => S(Y).some(($) => K($.children) && $.children.length > 0));
|
|
1376
1376
|
function y($) {
|
|
1377
1377
|
me.value = $;
|
|
1378
1378
|
}
|
|
1379
|
-
function g($, N = {}, D = {},
|
|
1380
|
-
q(),
|
|
1379
|
+
function g($, N = {}, D = {}, k) {
|
|
1380
|
+
q(), J.run({ pagination: $, filters: N, sorter: D, extra: k, isPolling: !1 });
|
|
1381
1381
|
}
|
|
1382
1382
|
function R($) {
|
|
1383
|
-
const N = Qt(
|
|
1383
|
+
const N = Qt(ee($), re(A));
|
|
1384
1384
|
if (Y.value = N, !n || !ze(n)) {
|
|
1385
1385
|
const D = N.length || 0;
|
|
1386
1386
|
D !== A.total && b({
|
|
@@ -1393,10 +1393,10 @@ function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData: i, da
|
|
|
1393
1393
|
isTreeDataRef: u,
|
|
1394
1394
|
setTableDataList: R,
|
|
1395
1395
|
operateTableDataRow: ($) => {
|
|
1396
|
-
const { key: N, row: D, value:
|
|
1396
|
+
const { key: N, row: D, value: k, type: ue = "update" } = $, Z = N ?? e.value, ce = D?.[Z] ?? k;
|
|
1397
1397
|
switch (!D && ue !== "delete" && console.warn("row is required"), ue) {
|
|
1398
1398
|
case "update":
|
|
1399
|
-
|
|
1399
|
+
Z && ce && D && (Y.value = Y.value.map((H) => ce === H[Z] ? Se(H, D) : H));
|
|
1400
1400
|
break;
|
|
1401
1401
|
case "push":
|
|
1402
1402
|
D && Y.value.push(D);
|
|
@@ -1405,26 +1405,26 @@ function ql({ rowKey: e, autoRequest: a, polling: l, request: n, postData: i, da
|
|
|
1405
1405
|
D && Y.value.unshift(D);
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "delete":
|
|
1408
|
-
|
|
1408
|
+
Z && (Y.value = Y.value.filter((H) => k !== H[Z]));
|
|
1409
1409
|
break;
|
|
1410
1410
|
}
|
|
1411
1411
|
},
|
|
1412
1412
|
handleTableChange: g,
|
|
1413
1413
|
run: async ($) => {
|
|
1414
|
-
d.value || (n ? await
|
|
1414
|
+
d.value || (n ? await J.run({ ...$, isPolling: !1 }) : pe("reload"));
|
|
1415
1415
|
}
|
|
1416
1416
|
};
|
|
1417
1417
|
}
|
|
1418
1418
|
function Kl(e) {
|
|
1419
1419
|
const a = I(l(e.loading.value));
|
|
1420
|
-
z(() => e.loading.value, (
|
|
1421
|
-
a.value = l(
|
|
1420
|
+
z(() => e.loading.value, (o) => {
|
|
1421
|
+
a.value = l(o, a.value);
|
|
1422
1422
|
});
|
|
1423
|
-
function l(
|
|
1424
|
-
return Re(
|
|
1423
|
+
function l(o, i = !1) {
|
|
1424
|
+
return Re(o) ? o : Q(o) ? o?.spinning ?? i : i;
|
|
1425
1425
|
}
|
|
1426
|
-
function n(
|
|
1427
|
-
a.value =
|
|
1426
|
+
function n(o) {
|
|
1427
|
+
a.value = o;
|
|
1428
1428
|
}
|
|
1429
1429
|
return [a, n];
|
|
1430
1430
|
}
|
|
@@ -1448,38 +1448,38 @@ function Vl({
|
|
|
1448
1448
|
l.value = !1;
|
|
1449
1449
|
return;
|
|
1450
1450
|
}
|
|
1451
|
-
const
|
|
1451
|
+
const i = ze(a) ? {
|
|
1452
1452
|
itemRender: ({
|
|
1453
1453
|
page: v,
|
|
1454
1454
|
type: p,
|
|
1455
|
-
originalElement:
|
|
1455
|
+
originalElement: P
|
|
1456
1456
|
}) => a ? a({
|
|
1457
1457
|
page: v,
|
|
1458
1458
|
type: p,
|
|
1459
|
-
originalElement:
|
|
1459
|
+
originalElement: P
|
|
1460
1460
|
}) : null
|
|
1461
1461
|
} : null, d = {
|
|
1462
1462
|
...Ge,
|
|
1463
1463
|
...e.value || {},
|
|
1464
|
-
...
|
|
1464
|
+
...i || {}
|
|
1465
1465
|
};
|
|
1466
1466
|
e.value?.showTotal || (d.showTotal = (v) => `共${v < d.pageSize ? 1 : Math.ceil(v / (d.pageSize || 10))}页 ${v}条记录`), l.value = d, Object.assign(n, Le(d, ["current", "pageSize", "total"]));
|
|
1467
1467
|
}, {
|
|
1468
1468
|
deep: 1,
|
|
1469
1469
|
immediate: !0
|
|
1470
1470
|
});
|
|
1471
|
-
function i
|
|
1472
|
-
if (
|
|
1471
|
+
function o(i) {
|
|
1472
|
+
if (Q(l.value) && Q(i)) {
|
|
1473
1473
|
const d = {};
|
|
1474
|
-
Object.keys(
|
|
1475
|
-
Object.prototype.hasOwnProperty.call(
|
|
1474
|
+
Object.keys(i).forEach((v) => {
|
|
1475
|
+
Object.prototype.hasOwnProperty.call(i, v) && l.value[v] === i[v] || (d[v] = i[v]);
|
|
1476
1476
|
}), Object.keys(d).length > 0 && (Object.assign(l.value, d), Gl(d) && Object.assign(n, d));
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
1479
|
return {
|
|
1480
1480
|
paginationInfo: l,
|
|
1481
1481
|
requestPagination: n,
|
|
1482
|
-
setPagination:
|
|
1482
|
+
setPagination: o
|
|
1483
1483
|
};
|
|
1484
1484
|
}
|
|
1485
1485
|
function Gl(e) {
|
|
@@ -1491,7 +1491,7 @@ function Gl(e) {
|
|
|
1491
1491
|
function Xl(e, a) {
|
|
1492
1492
|
const l = I([]), n = I([]);
|
|
1493
1493
|
z(() => a.value?.selectedRows, (r) => {
|
|
1494
|
-
n.value =
|
|
1494
|
+
n.value = ee(r || []);
|
|
1495
1495
|
}, {
|
|
1496
1496
|
deep: !0,
|
|
1497
1497
|
immediate: !0
|
|
@@ -1501,33 +1501,33 @@ function Xl(e, a) {
|
|
|
1501
1501
|
deep: !0,
|
|
1502
1502
|
immediate: !0
|
|
1503
1503
|
});
|
|
1504
|
-
const
|
|
1504
|
+
const o = (r, B) => {
|
|
1505
1505
|
const h = a.value?.type || "checkbox";
|
|
1506
1506
|
e.value && (B ? r?.[e.value] && h === "checkbox" ? (l.value.push(r[e.value]), n.value.push(r)) : (l.value = [r[e.value]], n.value = [r]) : (l.value = l.value.filter((f) => f !== r[e.value]), n.value = n.value.filter((f) => f[e.value] !== r[e.value])));
|
|
1507
|
-
},
|
|
1507
|
+
}, i = () => {
|
|
1508
1508
|
a.value && a.value?.onChange?.(l.value, n.value);
|
|
1509
1509
|
};
|
|
1510
1510
|
return {
|
|
1511
1511
|
selectedKeys: l,
|
|
1512
1512
|
selectedItems: n,
|
|
1513
|
-
selectRowKey:
|
|
1513
|
+
selectRowKey: o,
|
|
1514
1514
|
selectAllRowKey: (r, B, h) => {
|
|
1515
1515
|
e.value && (r ? B.map((f) => (l.value.every((x) => x !== f?.[e.value]) && f?.[e.value] && (l.value.push(f[e.value]), n.value.push(f)), f)) : h.map((f) => (l.value.includes(f?.[e.value]) && (l.value = l.value.filter((x) => x !== f[e.value]), n.value = n.value.filter((x) => x[e.value] !== f[e.value])), f)));
|
|
1516
1516
|
},
|
|
1517
1517
|
removeRowKeys: (r) => {
|
|
1518
|
-
l.value = l.value.filter((B) => !r.includes(B)), n.value = n.value.filter((B) => !r.includes(B?.[e.value || ""])),
|
|
1518
|
+
l.value = l.value.filter((B) => !r.includes(B)), n.value = n.value.filter((B) => !r.includes(B?.[e.value || ""])), i();
|
|
1519
1519
|
},
|
|
1520
|
-
changeRowKey:
|
|
1520
|
+
changeRowKey: i,
|
|
1521
1521
|
syncSelectedRows: (r) => {
|
|
1522
1522
|
if (e.value && l.value.length !== n.value.length) {
|
|
1523
1523
|
const B = n.value.map((f) => f[e.value]), h = l.value.filter((f) => !B.includes(f));
|
|
1524
1524
|
r.forEach((f) => {
|
|
1525
|
-
h.includes(f[e.value]) && n.value.push(
|
|
1525
|
+
h.includes(f[e.value]) && n.value.push(ee(f));
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
1528
|
},
|
|
1529
1529
|
clearAllRowKeys: () => {
|
|
1530
|
-
l.value = [], n.value = [],
|
|
1530
|
+
l.value = [], n.value = [], i();
|
|
1531
1531
|
}
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
@@ -1535,42 +1535,42 @@ function _l(e) {
|
|
|
1535
1535
|
const a = {};
|
|
1536
1536
|
return e.forEach((l) => {
|
|
1537
1537
|
let n = l.initialValue;
|
|
1538
|
-
const
|
|
1539
|
-
l.valueType ? !n &&
|
|
1538
|
+
const o = ["select", "number"], i = ["date", "time", "dateRange"], d = ["treeSelect", "numberRange"];
|
|
1539
|
+
l.valueType ? !n && o.includes(l.valueType) ? n = void 0 : !n && i.includes(l.valueType) ? n = null : !n && d.includes(l.valueType) ? n = [] : n || (n = "") : n || (n = ""), l.name === "dateRange" ? (a[l.rangeStartName || "start"] = n ? n[0] : null, a[l.rangeEndName || "end"] = n ? n[1] : null) : l.name && (a[l.name] = n);
|
|
1540
1540
|
}), a;
|
|
1541
1541
|
}
|
|
1542
1542
|
function Ql({ searchMap: e, columns: a }) {
|
|
1543
1543
|
const l = I([]), n = I({});
|
|
1544
|
-
function i
|
|
1545
|
-
|
|
1544
|
+
function o(i) {
|
|
1545
|
+
i.forEach((v) => {
|
|
1546
1546
|
l.value.some((p) => p.name === v.name) ? l.value = l.value.map((p) => p.name === v.name ? { ...p, ...v } : p) : l.value.push(v);
|
|
1547
1547
|
});
|
|
1548
|
-
const d = _l(
|
|
1548
|
+
const d = _l(i);
|
|
1549
1549
|
n.value = { ...n.value, ...d };
|
|
1550
1550
|
}
|
|
1551
1551
|
return z(() => e.value, () => {
|
|
1552
|
-
const
|
|
1553
|
-
e.value?.forEach((d) =>
|
|
1552
|
+
const i = [];
|
|
1553
|
+
e.value?.forEach((d) => i.push(d)), o(i);
|
|
1554
1554
|
}, { deep: !0, immediate: !0 }), z(() => a.value, () => {
|
|
1555
|
-
const
|
|
1555
|
+
const i = [];
|
|
1556
1556
|
a.value && a.value?.length && a.value.forEach((d) => {
|
|
1557
|
-
d.searchConfig &&
|
|
1558
|
-
}), i
|
|
1557
|
+
d.searchConfig && i.push(d.searchConfig);
|
|
1558
|
+
}), o(i);
|
|
1559
1559
|
}, { deep: !0, immediate: !0 }), { formCols: l, defaultFormSearch: n };
|
|
1560
1560
|
}
|
|
1561
|
-
function Ul({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll:
|
|
1562
|
-
const
|
|
1561
|
+
function Ul({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: o, rowSelection: i, screens: d, innerWidth: v, scrollBreakpoint: p }) {
|
|
1562
|
+
const P = C(() => p.value ? De(p.value) ? v.value > p.value : pt(p.value) ? d.value?.[p.value] : d.value?.xl : d.value?.xl), r = C(() => {
|
|
1563
1563
|
let h = 0;
|
|
1564
|
-
const f = S(
|
|
1564
|
+
const f = S(i) ? 60 : 0, x = 150, b = ee(S(a));
|
|
1565
1565
|
b.forEach((te) => {
|
|
1566
1566
|
h += Number.parseInt(String(te.width)) || 0;
|
|
1567
1567
|
});
|
|
1568
|
-
const
|
|
1569
|
-
return
|
|
1568
|
+
const oe = b.filter((te) => !Reflect.has(te, "width")).length;
|
|
1569
|
+
return oe !== 0 && (h += oe * x), f && (h += f), h;
|
|
1570
1570
|
});
|
|
1571
|
-
return { proScroll: C(() =>
|
|
1571
|
+
return { proScroll: C(() => o.value ? {} : e.value && ht(e.value).length ? S(e) : n.value ? {
|
|
1572
1572
|
y: e.value?.y || (d.value?.xl ? 400 : 235)
|
|
1573
|
-
} : l.value ?
|
|
1573
|
+
} : l.value ? P.value ? {} : Re(P.value) ? { x: r.value } : {} : {}), breakpoint: P };
|
|
1574
1574
|
}
|
|
1575
1575
|
function Jl(e) {
|
|
1576
1576
|
const a = I(e.size.value || "middle");
|
|
@@ -1597,13 +1597,6 @@ const Xe = (e) => ({
|
|
|
1597
1597
|
const a = `${e.antCls}-table`;
|
|
1598
1598
|
return {
|
|
1599
1599
|
[e.componentCls]: {
|
|
1600
|
-
[`${a}-cell a`]: {
|
|
1601
|
-
cursor: "pointer",
|
|
1602
|
-
color: e.colorPrimary,
|
|
1603
|
-
"&:hover": {
|
|
1604
|
-
color: e.colorPrimaryHover
|
|
1605
|
-
}
|
|
1606
|
-
},
|
|
1607
1600
|
"&-a": {
|
|
1608
1601
|
cursor: "pointer",
|
|
1609
1602
|
color: e.colorPrimary,
|
|
@@ -1805,14 +1798,14 @@ const Xe = (e) => ({
|
|
|
1805
1798
|
};
|
|
1806
1799
|
};
|
|
1807
1800
|
function ea(e) {
|
|
1808
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1801
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
1809
1802
|
}
|
|
1810
1803
|
function ta(e, a, l, n) {
|
|
1811
1804
|
if (!a) return e;
|
|
1812
|
-
let
|
|
1813
|
-
if (
|
|
1814
|
-
const
|
|
1815
|
-
return s(
|
|
1805
|
+
let o = e;
|
|
1806
|
+
if (Q(a)) {
|
|
1807
|
+
const i = a.node === "a" ? "span" : a.node;
|
|
1808
|
+
return s(i, W(a?.attr || {}, {
|
|
1816
1809
|
class: [a.class, a.node === "a" ? `${l}-a` : ""],
|
|
1817
1810
|
onClick: a.click
|
|
1818
1811
|
}), ea(e) ? e : {
|
|
@@ -1821,40 +1814,40 @@ function ta(e, a, l, n) {
|
|
|
1821
1814
|
}
|
|
1822
1815
|
switch (a) {
|
|
1823
1816
|
case "link":
|
|
1824
|
-
|
|
1817
|
+
o = s("span", {
|
|
1825
1818
|
class: [`${l}-a`, n]
|
|
1826
1819
|
}, [e]);
|
|
1827
1820
|
break;
|
|
1828
1821
|
case "time":
|
|
1829
|
-
|
|
1822
|
+
o = V(e).format("HH:mm:ss");
|
|
1830
1823
|
break;
|
|
1831
1824
|
case "dateMonth":
|
|
1832
|
-
|
|
1825
|
+
o = `${V(e).month() + 1}月`;
|
|
1833
1826
|
break;
|
|
1834
1827
|
case "date":
|
|
1835
|
-
|
|
1828
|
+
o = V(e).format("YYYY-MM-DD");
|
|
1836
1829
|
break;
|
|
1837
1830
|
case "dateTime":
|
|
1838
|
-
|
|
1831
|
+
o = V(e).format("YYYY-MM-DD HH:mm:ss");
|
|
1839
1832
|
break;
|
|
1840
1833
|
}
|
|
1841
|
-
return
|
|
1834
|
+
return o;
|
|
1842
1835
|
}
|
|
1843
1836
|
function la(e, a) {
|
|
1844
1837
|
const l = a && a.current || 1, n = a && a.pageSize || 10;
|
|
1845
|
-
return e.filter((
|
|
1838
|
+
return e.filter((o, i) => i < l * n && i >= n * (l - 1));
|
|
1846
1839
|
}
|
|
1847
1840
|
function aa(e) {
|
|
1848
1841
|
const a = document.createElement("textarea");
|
|
1849
1842
|
a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
|
|
1850
1843
|
}
|
|
1851
1844
|
function na(e) {
|
|
1852
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1845
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
1853
1846
|
}
|
|
1854
|
-
const
|
|
1847
|
+
const ia = {
|
|
1855
1848
|
reload: !0,
|
|
1856
1849
|
fullScreen: !0
|
|
1857
|
-
},
|
|
1850
|
+
}, oa = dl.useToken, _e = /* @__PURE__ */ Te({
|
|
1858
1851
|
name: "GProTable",
|
|
1859
1852
|
inheritAttrs: !1,
|
|
1860
1853
|
props: ge,
|
|
@@ -1864,22 +1857,22 @@ const oa = {
|
|
|
1864
1857
|
emit: a,
|
|
1865
1858
|
slots: l,
|
|
1866
1859
|
attrs: n,
|
|
1867
|
-
expose:
|
|
1860
|
+
expose: o
|
|
1868
1861
|
}) {
|
|
1869
|
-
const
|
|
1862
|
+
const i = vt({
|
|
1870
1863
|
suffixCls: "table",
|
|
1871
1864
|
isPor: !0
|
|
1872
1865
|
}), {
|
|
1873
1866
|
wrapSSR: d,
|
|
1874
1867
|
hashId: v
|
|
1875
|
-
} = Je("ProBaseTable", [Zl],
|
|
1868
|
+
} = Je("ProBaseTable", [Zl], i), {
|
|
1876
1869
|
token: p
|
|
1877
|
-
} =
|
|
1870
|
+
} = oa(), P = Gt(), r = ft(), {
|
|
1878
1871
|
width: B
|
|
1879
|
-
} =
|
|
1872
|
+
} = ol(), h = I(!1), f = dt(), x = I(), b = I(), A = I(e.waitRequest);
|
|
1880
1873
|
zt(() => A.value = e.waitRequest);
|
|
1881
1874
|
const {
|
|
1882
|
-
toggle:
|
|
1875
|
+
toggle: oe,
|
|
1883
1876
|
isFullscreen: te
|
|
1884
1877
|
} = bt(x), $e = C(() => !r.value.xl), pe = C(() => (e.virtualScroll && pl(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), le = C(() => {
|
|
1885
1878
|
if (e.form === !1) return !1;
|
|
@@ -1890,8 +1883,8 @@ const oa = {
|
|
|
1890
1883
|
resetText: "重置",
|
|
1891
1884
|
searchText: "查询"
|
|
1892
1885
|
};
|
|
1893
|
-
return
|
|
1894
|
-
}), O = C(() => le.value === !1 ? {} : le.value), me = C(() => O.value?.autoRequest ?? e.autoRequest), Y = C(() => O.value?.actions),
|
|
1886
|
+
return Q(e.form) ? Se(m, e.form) : m;
|
|
1887
|
+
}), O = C(() => le.value === !1 ? {} : le.value), me = C(() => O.value?.autoRequest ?? e.autoRequest), Y = C(() => O.value?.actions), G = C(() => {
|
|
1895
1888
|
const m = e.columns.filter((T) => T.key || T.dataIndex).map((T) => {
|
|
1896
1889
|
const w = T.key || T.dataIndex;
|
|
1897
1890
|
return T.key = w, T.dataIndex = w, T.align = T.align || e.align, T.uuid = T.uuid || gt().uuid(15), T;
|
|
@@ -1900,9 +1893,9 @@ const oa = {
|
|
|
1900
1893
|
align: e.align || "left",
|
|
1901
1894
|
showIndex: e.showIndex ?? !1
|
|
1902
1895
|
});
|
|
1903
|
-
}), [
|
|
1896
|
+
}), [U, ne] = Kl({
|
|
1904
1897
|
loading: M(e, "loading")
|
|
1905
|
-
}), [be,
|
|
1898
|
+
}), [be, J] = Jl({
|
|
1906
1899
|
size: M(e, "size")
|
|
1907
1900
|
}), {
|
|
1908
1901
|
paginationInfo: q,
|
|
@@ -1910,7 +1903,7 @@ const oa = {
|
|
|
1910
1903
|
setPagination: t
|
|
1911
1904
|
} = Vl({
|
|
1912
1905
|
pagination: M(e, "pagination"),
|
|
1913
|
-
pageItemRender:
|
|
1906
|
+
pageItemRender: it({
|
|
1914
1907
|
slots: l,
|
|
1915
1908
|
props: e,
|
|
1916
1909
|
key: "pageItemRender"
|
|
@@ -1926,7 +1919,7 @@ const oa = {
|
|
|
1926
1919
|
rowSelection: M(e, "rowSelection"),
|
|
1927
1920
|
scrollBreakpoint: M(e, "scrollBreakpoint"),
|
|
1928
1921
|
innerWidth: B,
|
|
1929
|
-
columns:
|
|
1922
|
+
columns: G,
|
|
1930
1923
|
screens: r
|
|
1931
1924
|
}), {
|
|
1932
1925
|
proColumns: g,
|
|
@@ -1938,24 +1931,24 @@ const oa = {
|
|
|
1938
1931
|
autoScroll: M(e, "autoScroll"),
|
|
1939
1932
|
breakpoint: y,
|
|
1940
1933
|
scroll: u,
|
|
1941
|
-
columns:
|
|
1934
|
+
columns: G
|
|
1942
1935
|
}), {
|
|
1943
1936
|
formCols: $,
|
|
1944
1937
|
defaultFormSearch: N
|
|
1945
1938
|
} = Ql({
|
|
1946
1939
|
searchMap: M(e, "searchMap"),
|
|
1947
|
-
columns:
|
|
1940
|
+
columns: G
|
|
1948
1941
|
}), {
|
|
1949
1942
|
selectedKeys: D,
|
|
1950
|
-
selectedItems:
|
|
1943
|
+
selectedItems: k,
|
|
1951
1944
|
changeRowKey: ue,
|
|
1952
|
-
selectRowKey:
|
|
1945
|
+
selectRowKey: Z,
|
|
1953
1946
|
selectAllRowKey: ce,
|
|
1954
|
-
syncSelectedRows:
|
|
1947
|
+
syncSelectedRows: H,
|
|
1955
1948
|
removeRowKeys: ye,
|
|
1956
1949
|
clearAllRowKeys: de
|
|
1957
|
-
} = Xl(M(e, "rowKey"), M(e, "rowSelection")), Be =
|
|
1958
|
-
run:
|
|
1950
|
+
} = Xl(M(e, "rowKey"), M(e, "rowSelection")), Be = Hl(e), {
|
|
1951
|
+
run: ie,
|
|
1959
1952
|
setTableDataList: Ce,
|
|
1960
1953
|
operateTableDataRow: xe,
|
|
1961
1954
|
isTreeDataRef: ve,
|
|
@@ -1965,11 +1958,11 @@ const oa = {
|
|
|
1965
1958
|
...Be,
|
|
1966
1959
|
waitRequest: A
|
|
1967
1960
|
}, {
|
|
1968
|
-
loading:
|
|
1961
|
+
loading: U,
|
|
1969
1962
|
pageInfo: se,
|
|
1970
1963
|
setPagination: t,
|
|
1971
1964
|
removeRowKeys: ye,
|
|
1972
|
-
syncSelectedRows:
|
|
1965
|
+
syncSelectedRows: H,
|
|
1973
1966
|
setLoading: ne,
|
|
1974
1967
|
setColumns: R,
|
|
1975
1968
|
columns: g,
|
|
@@ -1986,85 +1979,85 @@ const oa = {
|
|
|
1986
1979
|
virtualScroll: pe.value,
|
|
1987
1980
|
columns: S(g).filter((m) => m.show || m.show === void 0)
|
|
1988
1981
|
})), et = C(() => {
|
|
1989
|
-
const m =
|
|
1982
|
+
const m = Q(e.loading) ? Ie(e.loading, "spinning") : {};
|
|
1990
1983
|
return !m.indicator && f?.indicator?.value && (m.indicator = f?.indicator?.value), {
|
|
1991
|
-
spinning: e.showLoading ? qe(
|
|
1984
|
+
spinning: e.showLoading ? qe(U.value) : !1,
|
|
1992
1985
|
...m
|
|
1993
1986
|
};
|
|
1994
1987
|
}), tt = C(() => {
|
|
1995
1988
|
let m;
|
|
1996
1989
|
const T = e.direction === "rtl" ? "bottomLeft" : "right", w = S(q)?.position;
|
|
1997
1990
|
if (w !== null && Array.isArray(w)) {
|
|
1998
|
-
const
|
|
1999
|
-
!
|
|
1991
|
+
const F = w.find((X) => X.includes("top")), j = w.find((X) => X.includes("bottom")), L = w.every((X) => `${X}` == "none");
|
|
1992
|
+
!F && !j && !L && (m = T), F && (m = F.toLowerCase().replace("top", "")), j && (m = j.toLowerCase().replace("bottom", ""));
|
|
2000
1993
|
} else
|
|
2001
1994
|
m = T;
|
|
2002
1995
|
return m;
|
|
2003
1996
|
});
|
|
2004
1997
|
Ml(() => {
|
|
2005
|
-
h.value && e.keepAliveReload ?
|
|
1998
|
+
h.value && e.keepAliveReload ? ie() : h.value = !0;
|
|
2006
1999
|
});
|
|
2007
2000
|
const $t = async (m, T) => {
|
|
2008
2001
|
if (me.value) {
|
|
2009
|
-
|
|
2002
|
+
ie({
|
|
2010
2003
|
params: m
|
|
2011
2004
|
});
|
|
2012
2005
|
return;
|
|
2013
2006
|
}
|
|
2014
|
-
T === "reset" ? (a("reset", m), e.request && Y.value?.resetReload &&
|
|
2007
|
+
T === "reset" ? (a("reset", m), e.request && Y.value?.resetReload && ie({
|
|
2015
2008
|
params: m
|
|
2016
|
-
})) : e.request && (a("submit", m),
|
|
2009
|
+
})) : e.request && (a("submit", m), ie({
|
|
2017
2010
|
params: m
|
|
2018
2011
|
}));
|
|
2019
|
-
}, We = (m, T, w,
|
|
2020
|
-
t(Le(m, ["current", "pageSize"])), Me(m, T, w,
|
|
2021
|
-
},
|
|
2012
|
+
}, We = (m, T, w, F) => {
|
|
2013
|
+
t(Le(m, ["current", "pageSize"])), Me(m, T, w, F), a("change", m, T, w, F);
|
|
2014
|
+
}, Ft = (m) => {
|
|
2022
2015
|
a("expandedRowsChange", m);
|
|
2023
|
-
},
|
|
2016
|
+
}, Pt = (m, T) => {
|
|
2024
2017
|
a("expand", m, T);
|
|
2025
2018
|
}, Dt = (m, T) => c(m, T), It = (m, T, w) => {
|
|
2026
|
-
let
|
|
2019
|
+
let F = m;
|
|
2027
2020
|
if (T) {
|
|
2028
|
-
const j = K(m) ? typeof m?.[0]?.children == "string" ? m?.[0]?.children : "" : m ? m.toString() : "", L = w.tooltip === !1 ? {} : w.tooltip,
|
|
2021
|
+
const j = K(m) ? typeof m?.[0]?.children == "string" ? m?.[0]?.children : "" : m ? m.toString() : "", L = w.tooltip === !1 ? {} : w.tooltip, X = w.tooltip === !1 ? 1 : De(L?.hiddenLine) && L?.hiddenLine > 0 ? L?.hiddenLine : 1, E = w.tooltip === !1 ? 0 : De(L?.width) ? L?.width : 0, Oe = w.tooltip !== !1 && pt(j) && E > 0 ? ll(j, {
|
|
2029
2022
|
cssObject: {
|
|
2030
2023
|
fontSize: "14px",
|
|
2031
2024
|
lineHeight: "22px",
|
|
2032
|
-
fontFamily:
|
|
2025
|
+
fontFamily: P?.token?.value?.fontFamily || p?.value?.fontFamily,
|
|
2033
2026
|
...L?.targetStyle || {}
|
|
2034
2027
|
}
|
|
2035
|
-
}) : 0, je = document.querySelector(`.${
|
|
2036
|
-
class: `${
|
|
2037
|
-
}, [m]), at = () => w.tooltip === !1 ||
|
|
2028
|
+
}) : 0, je = document.querySelector(`.${i} .ant-table-tbody`), Ae = s("div", {
|
|
2029
|
+
class: `${i}-ellipsis-text`
|
|
2030
|
+
}, [m]), at = () => w.tooltip === !1 || Q(w.tooltip) && Oe < E && E > 0 ? Ae : s(we, W({
|
|
2038
2031
|
title: m,
|
|
2039
|
-
getPopupContainer: (
|
|
2040
|
-
},
|
|
2032
|
+
getPopupContainer: (ke) => je ?? ke?.parentNode?.parentNode
|
|
2033
|
+
}, Q(w.tooltip) ? w.tooltip : {}, {
|
|
2041
2034
|
destroyTooltipOnHide: !0
|
|
2042
2035
|
}), na(Ae) ? Ae : {
|
|
2043
2036
|
default: () => [Ae]
|
|
2044
2037
|
});
|
|
2045
|
-
if (
|
|
2046
|
-
class: `${
|
|
2038
|
+
if (F = s("div", {
|
|
2039
|
+
class: `${i}-ellipsis ${L?.class ?? ""}`,
|
|
2047
2040
|
style: {
|
|
2048
|
-
"-webkit-line-clamp":
|
|
2041
|
+
"-webkit-line-clamp": X
|
|
2049
2042
|
}
|
|
2050
2043
|
}, [at()]), w.copyable) {
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2053
|
-
class: `${
|
|
2044
|
+
const ke = typeof w.copyText == "function" ? w.copyText?.(w) : w.copyText || j;
|
|
2045
|
+
F = s("div", {
|
|
2046
|
+
class: `${i}-copyable`
|
|
2054
2047
|
}, [s("div", {
|
|
2055
|
-
class: `${
|
|
2048
|
+
class: `${i}-ellipsis ${L?.class ?? ""}`,
|
|
2056
2049
|
style: {
|
|
2057
|
-
"-webkit-line-clamp":
|
|
2050
|
+
"-webkit-line-clamp": X
|
|
2058
2051
|
}
|
|
2059
2052
|
}, [at()]), s(qt, {
|
|
2060
|
-
class: `${
|
|
2053
|
+
class: `${i}-copyable-icon`,
|
|
2061
2054
|
onClick: () => {
|
|
2062
|
-
aa(
|
|
2055
|
+
aa(ke), vl.success("复制成功");
|
|
2063
2056
|
}
|
|
2064
2057
|
}, null)]);
|
|
2065
2058
|
}
|
|
2066
2059
|
}
|
|
2067
|
-
return
|
|
2060
|
+
return F;
|
|
2068
2061
|
};
|
|
2069
2062
|
function lt() {
|
|
2070
2063
|
const m = al({
|
|
@@ -2073,23 +2066,23 @@ const oa = {
|
|
|
2073
2066
|
key: "emptyText"
|
|
2074
2067
|
});
|
|
2075
2068
|
if (m !== !1 && f?.emptyText?.value !== !1) {
|
|
2076
|
-
const w = e.emptyTextProps?.extraProps || {},
|
|
2069
|
+
const w = e.emptyTextProps?.extraProps || {}, F = m || f?.emptyText?.value, j = _(F), L = j ? st(F, w) : mt(K(F) ? F : [F]);
|
|
2077
2070
|
return s("div", {
|
|
2078
|
-
class: ae(`${
|
|
2071
|
+
class: ae(`${i}-empty-text`, v.value, e.emptyTextProps?.class),
|
|
2079
2072
|
style: e.emptyTextProps?.style
|
|
2080
|
-
}, [j ? L : K(L) ? L.map((
|
|
2073
|
+
}, [j ? L : K(L) ? L.map((X) => Qe(X, w)) : s(hl, null, null)]);
|
|
2081
2074
|
}
|
|
2082
2075
|
return null;
|
|
2083
2076
|
}
|
|
2084
2077
|
const Bt = () => {
|
|
2085
|
-
const m =
|
|
2078
|
+
const m = it({
|
|
2086
2079
|
slots: l,
|
|
2087
2080
|
props: e,
|
|
2088
2081
|
key: "customRender"
|
|
2089
2082
|
});
|
|
2090
2083
|
if (m) {
|
|
2091
2084
|
if (he.value?.length) {
|
|
2092
|
-
const T =
|
|
2085
|
+
const T = ee(S(he));
|
|
2093
2086
|
return m?.({
|
|
2094
2087
|
dataSource: T,
|
|
2095
2088
|
currentData: la(T, q.value)
|
|
@@ -2102,18 +2095,18 @@ const oa = {
|
|
|
2102
2095
|
return yl({
|
|
2103
2096
|
tableSize: be,
|
|
2104
2097
|
columns: g,
|
|
2105
|
-
cacheColumns:
|
|
2098
|
+
cacheColumns: G,
|
|
2106
2099
|
isMobile: $e,
|
|
2107
2100
|
formConfig: O,
|
|
2108
2101
|
formAutoRequest: me,
|
|
2109
2102
|
formActions: Y,
|
|
2110
2103
|
action: {
|
|
2111
|
-
setTableSize:
|
|
2112
|
-
reload: (m) =>
|
|
2113
|
-
toggle:
|
|
2104
|
+
setTableSize: J,
|
|
2105
|
+
reload: (m) => ie(m),
|
|
2106
|
+
toggle: oe
|
|
2114
2107
|
},
|
|
2115
2108
|
setPagination: t
|
|
2116
|
-
}),
|
|
2109
|
+
}), o({
|
|
2117
2110
|
formRef: () => ({
|
|
2118
2111
|
getFormSearch: () => ({
|
|
2119
2112
|
...S(N),
|
|
@@ -2126,21 +2119,21 @@ const oa = {
|
|
|
2126
2119
|
}
|
|
2127
2120
|
}),
|
|
2128
2121
|
actionRef: () => ({
|
|
2129
|
-
loading:
|
|
2122
|
+
loading: U,
|
|
2130
2123
|
dataSource: he,
|
|
2131
2124
|
pageInfo: se,
|
|
2132
2125
|
pagination: q.value,
|
|
2133
2126
|
selectedKeys: C(() => D.value),
|
|
2134
|
-
selectedItems: C(() =>
|
|
2127
|
+
selectedItems: C(() => k.value),
|
|
2135
2128
|
rowsSelection: {
|
|
2136
2129
|
clear: de,
|
|
2137
|
-
select:
|
|
2130
|
+
select: Z,
|
|
2138
2131
|
remove: ye,
|
|
2139
|
-
sync:
|
|
2132
|
+
sync: H,
|
|
2140
2133
|
selectAll: ce
|
|
2141
2134
|
},
|
|
2142
|
-
reload:
|
|
2143
|
-
getLoadingStatus: () => S(
|
|
2135
|
+
reload: ie,
|
|
2136
|
+
getLoadingStatus: () => S(U),
|
|
2144
2137
|
reloadAndReset: async (m) => {
|
|
2145
2138
|
A.value = !0, t({
|
|
2146
2139
|
current: 1,
|
|
@@ -2164,33 +2157,33 @@ const oa = {
|
|
|
2164
2157
|
ref: x,
|
|
2165
2158
|
class: ae([{
|
|
2166
2159
|
[`${v.value}`]: !0,
|
|
2167
|
-
[`${
|
|
2160
|
+
[`${i}`]: !0,
|
|
2168
2161
|
[`${n.class}`]: n.class,
|
|
2169
|
-
[`${
|
|
2170
|
-
[`${
|
|
2171
|
-
[`${
|
|
2172
|
-
[`${
|
|
2162
|
+
[`${i}-beautify-scroll`]: Re(e.useDefaultScrollStyle) ? !e.useDefaultScrollStyle : !0,
|
|
2163
|
+
[`${i}-no-scroll`]: !Object.keys(S(u) || {}).length,
|
|
2164
|
+
[`${i}-table-tree`]: ve.value,
|
|
2165
|
+
[`${i}-full-screen`]: te.value
|
|
2173
2166
|
}]),
|
|
2174
2167
|
style: n.style
|
|
2175
2168
|
}, [s("div", {
|
|
2176
|
-
class: [`${
|
|
2169
|
+
class: [`${i}-content`, v.value]
|
|
2177
2170
|
}, [($.value.length > 0 || !!l.form) && e.form !== !1 && s(Ol, {
|
|
2178
2171
|
ref: b,
|
|
2179
2172
|
modalScroll: e.modalScroll,
|
|
2180
2173
|
cardBordered: e.cardBordered,
|
|
2181
2174
|
formCols: $.value,
|
|
2182
|
-
prefixCls:
|
|
2183
|
-
loading: S(
|
|
2175
|
+
prefixCls: i,
|
|
2176
|
+
loading: S(U),
|
|
2184
2177
|
onSearch: $t,
|
|
2185
2178
|
defaultFormSearch: N.value
|
|
2186
2179
|
}, {
|
|
2187
2180
|
default: l.form ? () => l.form?.() : null
|
|
2188
2181
|
}), s("div", {
|
|
2189
|
-
class: ae(v.value, `${
|
|
2182
|
+
class: ae(v.value, `${i}-card`, e.cardBordered && `${i}-card-border`)
|
|
2190
2183
|
}, [s(El, {
|
|
2191
2184
|
options: e.options ? {
|
|
2192
|
-
...
|
|
2193
|
-
...
|
|
2185
|
+
...ia,
|
|
2186
|
+
...Q(e.options) ? e.options : {}
|
|
2194
2187
|
} : !1,
|
|
2195
2188
|
titleTipText: e.titleTipText,
|
|
2196
2189
|
actionsPlacement: e.actionProps?.placement,
|
|
@@ -2200,18 +2193,18 @@ const oa = {
|
|
|
2200
2193
|
settingExtra: w.settingExtra
|
|
2201
2194
|
}, null), m ? s(Ct, et.value, {
|
|
2202
2195
|
default: () => [s("div", {
|
|
2203
|
-
class: `${
|
|
2196
|
+
class: `${i}-wrapper ${v.value}`
|
|
2204
2197
|
}, [s("div", {
|
|
2205
|
-
class: ae(`${
|
|
2198
|
+
class: ae(`${i}-list`, v.value, e.tableProps?.class),
|
|
2206
2199
|
style: e.tableProps?.style
|
|
2207
2200
|
}, [Bt()]), e.pagination !== !1 && he.value?.length > 0 && s(fl, W({
|
|
2208
2201
|
class: {
|
|
2209
|
-
[`${
|
|
2210
|
-
[`${
|
|
2202
|
+
[`${i}-pagination ${v.value}`]: !0,
|
|
2203
|
+
[`${i}-pagination-${tt.value} ${v.value}`]: !!tt.value
|
|
2211
2204
|
}
|
|
2212
2205
|
}, re(S(q)), {
|
|
2213
|
-
onChange: (
|
|
2214
|
-
current:
|
|
2206
|
+
onChange: (F, j) => We({
|
|
2207
|
+
current: F,
|
|
2215
2208
|
pageSize: j
|
|
2216
2209
|
})
|
|
2217
2210
|
}), null)])]
|
|
@@ -2219,34 +2212,34 @@ const oa = {
|
|
|
2219
2212
|
style: e.tableProps?.style,
|
|
2220
2213
|
class: e.tableProps?.class,
|
|
2221
2214
|
loading: et.value,
|
|
2222
|
-
rowKey: (
|
|
2223
|
-
transformCellText: (
|
|
2224
|
-
e.transformCellText && typeof e.transformCellText && e.transformCellText?.(
|
|
2215
|
+
rowKey: (F) => F[e.rowKey],
|
|
2216
|
+
transformCellText: (F) => {
|
|
2217
|
+
e.transformCellText && typeof e.transformCellText && e.transformCellText?.(F);
|
|
2225
2218
|
const {
|
|
2226
2219
|
column: j
|
|
2227
|
-
} =
|
|
2228
|
-
if (!j) return
|
|
2220
|
+
} = F;
|
|
2221
|
+
if (!j) return F.text;
|
|
2229
2222
|
const L = j?.key || j?.dataIndex;
|
|
2230
|
-
let
|
|
2223
|
+
let X = !0, E = F.text;
|
|
2231
2224
|
if (K(E))
|
|
2232
|
-
if (E.length === 0 || E.length === 1 && !
|
|
2225
|
+
if (E.length === 0 || E.length === 1 && !_(E[0])) {
|
|
2233
2226
|
E = E?.[0];
|
|
2234
2227
|
const Oe = tl(E, j?.columnEmptyText || e?.columnEmptyText || "");
|
|
2235
|
-
|
|
2228
|
+
X = Oe.success, E = ta(Oe.value, j?.valueType || e.columns?.find((je) => (je.key || je.dataIndex) === L)?.valueType, i, v.value);
|
|
2236
2229
|
} else E[0]?.type === "template" && (E = E[0]?.children);
|
|
2237
|
-
return j?.ellipsis ? It(E,
|
|
2230
|
+
return j?.ellipsis ? It(E, X, j) : E;
|
|
2238
2231
|
},
|
|
2239
2232
|
rowSelection: e.rowSelection ? {
|
|
2240
2233
|
...Ie(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
|
|
2241
2234
|
selectedRowKeys: D.value || [],
|
|
2242
|
-
onSelect:
|
|
2235
|
+
onSelect: Z,
|
|
2243
2236
|
onSelectAll: ce,
|
|
2244
2237
|
onChange: ue
|
|
2245
2238
|
} : void 0,
|
|
2246
2239
|
onChange: We,
|
|
2247
|
-
onExpandedRowsChange:
|
|
2248
|
-
onExpand:
|
|
2249
|
-
onResizeColumn: (
|
|
2240
|
+
onExpandedRowsChange: Ft,
|
|
2241
|
+
onExpand: Pt,
|
|
2242
|
+
onResizeColumn: (F, j) => Dt(F, j)
|
|
2250
2243
|
}), {
|
|
2251
2244
|
...l,
|
|
2252
2245
|
emptyText: () => lt()
|
|
@@ -2262,52 +2255,52 @@ function Ca(e, a) {
|
|
|
2262
2255
|
searchMap: []
|
|
2263
2256
|
};
|
|
2264
2257
|
if (a?.state) {
|
|
2265
|
-
if (
|
|
2266
|
-
return Se(r,
|
|
2267
|
-
if (
|
|
2268
|
-
return Se(r,
|
|
2258
|
+
if (He(a.state) && Q(a.state.value))
|
|
2259
|
+
return Se(r, ee(a.state.value));
|
|
2260
|
+
if (Q(a.state) && !He(a.state))
|
|
2261
|
+
return Se(r, ee(a.state));
|
|
2269
2262
|
}
|
|
2270
2263
|
return r;
|
|
2271
2264
|
}
|
|
2272
2265
|
const n = Ue(Se(l(), {
|
|
2273
2266
|
request: a?.request
|
|
2274
2267
|
}));
|
|
2275
|
-
a?.state && z(() => a.state &&
|
|
2268
|
+
a?.state && z(() => a.state && He(a.state) ? a.state.value : a.state, () => {
|
|
2276
2269
|
p();
|
|
2277
2270
|
}, { deep: !0 });
|
|
2278
|
-
const
|
|
2279
|
-
...
|
|
2280
|
-
...
|
|
2281
|
-
})), v = I(!!
|
|
2282
|
-
z(() =>
|
|
2271
|
+
const o = C(() => e.value ? e.value.actionRef() : {}), i = C(() => e.value ? e.value.formRef() : {}), d = C(() => ({
|
|
2272
|
+
...o.value.pageInfo || {},
|
|
2273
|
+
...i.value.getFormSearch?.() || {}
|
|
2274
|
+
})), v = I(!!o.value.loading?.value);
|
|
2275
|
+
z(() => o.value.loading?.value, (r) => {
|
|
2283
2276
|
v.value = !!r;
|
|
2284
2277
|
}), z(v, (r) => {
|
|
2285
|
-
|
|
2278
|
+
o.value?.setLoading?.(!!r);
|
|
2286
2279
|
});
|
|
2287
2280
|
function p() {
|
|
2288
2281
|
nl(n, l());
|
|
2289
2282
|
}
|
|
2290
|
-
function
|
|
2291
|
-
n.searchMap && (n.searchMap =
|
|
2283
|
+
function P(r, B) {
|
|
2284
|
+
n.searchMap && (n.searchMap = ee(n.searchMap).map((h) => h.name === r ? Se(h, B) : h));
|
|
2292
2285
|
}
|
|
2293
2286
|
return {
|
|
2294
|
-
formRef:
|
|
2295
|
-
actionRef:
|
|
2287
|
+
formRef: i,
|
|
2288
|
+
actionRef: o,
|
|
2296
2289
|
tableState: n,
|
|
2297
2290
|
requestSearch: d,
|
|
2298
2291
|
loading: v,
|
|
2299
|
-
dataSource: C(() =>
|
|
2300
|
-
selectedKeys: C(() =>
|
|
2301
|
-
selectedItems: C(() =>
|
|
2302
|
-
rowsSelection:
|
|
2303
|
-
setTableDataList: (r) =>
|
|
2304
|
-
reloadAndReset: (r) =>
|
|
2305
|
-
setPageInfo: (r, B, h, f) =>
|
|
2306
|
-
setPagination: (r) =>
|
|
2292
|
+
dataSource: C(() => o?.value?.dataSource?.value || []),
|
|
2293
|
+
selectedKeys: C(() => o?.value?.selectedKeys?.value || []),
|
|
2294
|
+
selectedItems: C(() => o?.value?.selectedItems?.value || []),
|
|
2295
|
+
rowsSelection: o?.value?.rowsSelection,
|
|
2296
|
+
setTableDataList: (r) => o.value?.setTableDataList?.(r),
|
|
2297
|
+
reloadAndReset: (r) => o.value?.reloadAndReset?.(r),
|
|
2298
|
+
setPageInfo: (r, B, h, f) => o.value?.setPageInfo?.(r, B, h, f),
|
|
2299
|
+
setPagination: (r) => o.value?.setPagination?.(r),
|
|
2307
2300
|
setLoading: (r) => v.value = r,
|
|
2308
|
-
operateTableDataRow: (r) =>
|
|
2309
|
-
reload: (r) =>
|
|
2310
|
-
updateSearchMap:
|
|
2301
|
+
operateTableDataRow: (r) => o.value?.operateTableDataRow?.(r),
|
|
2302
|
+
reload: (r) => o.value?.reload?.(r),
|
|
2303
|
+
updateSearchMap: P
|
|
2311
2304
|
};
|
|
2312
2305
|
}
|
|
2313
2306
|
export {
|