@gx-design-vue/pro-table 0.2.0-beta.146 → 0.2.0-beta.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pro-table.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.146
|
|
4
4
|
* Author: gx12358
|
|
5
5
|
* Copyright (C) 2024 gx12358
|
|
6
6
|
* License: MIT License
|
|
7
7
|
* Description: Gx Design Pro Table
|
|
8
|
-
* Date Created: 2025-12-
|
|
8
|
+
* Date Created: 2025-12-28
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent as ge, ref as
|
|
13
|
-
import { UpOutlined as
|
|
14
|
-
import { useProAppContext as
|
|
15
|
-
import { useBreakpoint as
|
|
16
|
-
import { useProStyle as Tt, unit as pe, useProConfigContext as
|
|
17
|
-
import { isArray as J, cloneDeep as ee, isObject as ne, isBoolean as
|
|
18
|
-
import { useDebounceFn as Sl, useEventListener as
|
|
19
|
-
import { DatePicker as
|
|
20
|
-
import { omit as
|
|
12
|
+
import { defineComponent as ge, ref as x, watch as K, cloneVNode as tt, reactive as lt, toRaw as ce, computed as T, createVNode as d, Fragment as we, isVNode as ae, mergeProps as Q, h as gt, onBeforeUnmount as Xt, onMounted as at, nextTick as nt, watchEffect as bt, unref as R, onActivated as pt, getCurrentInstance as _t, onUnmounted as yt, onDeactivated as Ct, onUpdated as Gt, toRef as X, Teleport as Qt, isRef as _e } from "vue";
|
|
13
|
+
import { UpOutlined as Ut, DownOutlined as Jt, InfoCircleOutlined as Zt, FullscreenExitOutlined as el, FullscreenOutlined as tl, ReloadOutlined as ll, CopyOutlined as al } from "@ant-design/icons-vue";
|
|
14
|
+
import { useProAppContext as St } from "@gx-design-vue/pro-app";
|
|
15
|
+
import { useBreakpoint as ot, useMemo as nl, tryOnUnmounted as ol, onMountedOrActivated as il } from "@gx-design-vue/pro-hooks";
|
|
16
|
+
import { useProStyle as Tt, unit as pe, useProConfigContext as sl } from "@gx-design-vue/pro-provider";
|
|
17
|
+
import { isArray as J, cloneDeep as ee, isObject as ne, isBoolean as De, classNames as A, isNumber as Ce, filterEmpty as xt, keysOf as wt, isFunction as Ne, isDeepEqualReact as Me, compareArray as rl, runFunction as ul, getSortIndex as cl, handleCurrentPage as dl, getRandomNumber as $t, deepMerge as ye, forInObject as fl, arrayRepeat as vl, isString as Rt, getPrefixCls as ml, handleShowIndex as hl, getSlot as dt, convertValueBoolean as Ge, getSlotsProps as gl, handleEmptyField as bl, getTextWidth as pl, getSlotVNode as yl, useDeepMerge as Cl } from "@gx-design-vue/pro-utils";
|
|
18
|
+
import { useDebounceFn as Sl, useEventListener as ft, isClient as Tl, useElementBounding as xl, useFullscreen as Pt, useElementSize as He, useScroll as wl, useResizeObserver as $l, useWindowSize as Rl } from "@vueuse/core";
|
|
19
|
+
import { DatePicker as Ft, Input as We, TimePicker as Pl, TreeSelect as Fl, Select as Il, InputNumber as Qe, Button as vt, Spin as It, Tooltip as $e, Empty as Bt, theme as Bl, Pagination as Al, Table as Nl, message as zl } from "ant-design-vue";
|
|
20
|
+
import { omit as ze, cloneDeep as At, pick as Dl } from "lodash-es";
|
|
21
21
|
import { tableProps as Ol } from "ant-design-vue/es/table/Table";
|
|
22
22
|
import "ant-design-vue/es/_util/props-util";
|
|
23
23
|
import { warning as El } from "ant-design-vue/es/vc-util/warning";
|
|
24
24
|
import Z from "dayjs";
|
|
25
|
-
import { useContext as
|
|
26
|
-
import { TinyColor as
|
|
27
|
-
const Ll = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"],
|
|
28
|
-
...
|
|
25
|
+
import { useContext as Nt } from "@gx-design-vue/context";
|
|
26
|
+
import { TinyColor as mt } from "@ctrl/tinycolor";
|
|
27
|
+
const Ll = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], zt = {
|
|
28
|
+
...ze(Ol(), Ll),
|
|
29
29
|
direction: {
|
|
30
30
|
type: String,
|
|
31
31
|
default: "ltr"
|
|
@@ -49,8 +49,8 @@ const Ll = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
49
49
|
type: Object,
|
|
50
50
|
default: void 0
|
|
51
51
|
}
|
|
52
|
-
}, { provideContext: jl, useInjectContext:
|
|
53
|
-
...
|
|
52
|
+
}, { provideContext: jl, useInjectContext: qe } = Nt("pro-table"), he = {
|
|
53
|
+
...zt,
|
|
54
54
|
id: {
|
|
55
55
|
type: String,
|
|
56
56
|
default: ""
|
|
@@ -334,49 +334,49 @@ const Ll = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
336
|
setup(e, {
|
|
337
|
-
slots:
|
|
337
|
+
slots: a
|
|
338
338
|
}) {
|
|
339
|
-
const l =
|
|
340
|
-
return
|
|
341
|
-
if (o.value !== "init" &&
|
|
339
|
+
const l = x([]), n = x(e.loading ?? !1), o = x("init"), r = Sl(e.fetch, e.debounceTime || 10);
|
|
340
|
+
return K([() => e.fetch, () => e.manual], () => {
|
|
341
|
+
if (o.value !== "init" && n.value) return;
|
|
342
342
|
const s = e.manual ?? !1;
|
|
343
|
-
e.fetch && !s && (
|
|
344
|
-
l.value =
|
|
343
|
+
e.fetch && !s && (n.value = !0, r().then((h) => {
|
|
344
|
+
l.value = At(h), o.value = "success";
|
|
345
345
|
}).catch((h) => {
|
|
346
346
|
console.error(h), o.value = "error";
|
|
347
347
|
}).finally(() => {
|
|
348
|
-
|
|
348
|
+
n.value = !1;
|
|
349
349
|
}));
|
|
350
350
|
}, {
|
|
351
351
|
immediate: !0
|
|
352
352
|
}), () => {
|
|
353
|
-
const s =
|
|
354
|
-
return
|
|
353
|
+
const s = a.default?.();
|
|
354
|
+
return tt(J(s) ? s[0] : s, {
|
|
355
355
|
options: l.value,
|
|
356
|
-
notFoundContent: e.notFoundContent?.(
|
|
356
|
+
notFoundContent: e.notFoundContent?.(n.value)
|
|
357
357
|
});
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
|
-
function Wl(e,
|
|
362
|
-
const l =
|
|
363
|
-
function
|
|
361
|
+
function Wl(e, a) {
|
|
362
|
+
const l = lt({});
|
|
363
|
+
function n() {
|
|
364
364
|
Object.assign(l, ee(ce(e)));
|
|
365
|
-
const r =
|
|
365
|
+
const r = a.find((s) => s.valueType === "dateRange");
|
|
366
366
|
r && o(r.name || "", e[r.rangeStartName || "start"] ? [
|
|
367
367
|
e[r.rangeStartName || "start"],
|
|
368
368
|
e[r.rangeEndName || "end"]
|
|
369
369
|
] : []);
|
|
370
370
|
}
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
K(() => e, () => {
|
|
372
|
+
n();
|
|
373
373
|
}, { deep: !0, immediate: !0 });
|
|
374
374
|
function o(r, s) {
|
|
375
375
|
l[r] = s;
|
|
376
376
|
}
|
|
377
377
|
return {
|
|
378
378
|
formState: l,
|
|
379
|
-
resetFormState:
|
|
379
|
+
resetFormState: n,
|
|
380
380
|
changeFormState: o
|
|
381
381
|
};
|
|
382
382
|
}
|
|
@@ -487,7 +487,7 @@ const Yl = (e) => ({
|
|
|
487
487
|
justifyContent: "center",
|
|
488
488
|
alignItems: "center"
|
|
489
489
|
}
|
|
490
|
-
}),
|
|
490
|
+
}), Ue = [
|
|
491
491
|
{ value: "xxl", span: 4 },
|
|
492
492
|
{ value: "xl", span: 3 },
|
|
493
493
|
{ value: "lg", span: 2 },
|
|
@@ -495,21 +495,21 @@ const Yl = (e) => ({
|
|
|
495
495
|
{ value: "sm", span: 2 },
|
|
496
496
|
{ value: "xs", span: 1 }
|
|
497
497
|
];
|
|
498
|
-
function me(e,
|
|
499
|
-
return typeof
|
|
498
|
+
function me(e, a) {
|
|
499
|
+
return typeof a == "function" ? a(Z(e)) : Z(e).format(a);
|
|
500
500
|
}
|
|
501
|
-
function Be(e,
|
|
502
|
-
return
|
|
501
|
+
function Be(e, a) {
|
|
502
|
+
return a ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const ht = (e, a, l = "string") => {
|
|
505
505
|
if (J(e)) {
|
|
506
|
-
const [
|
|
506
|
+
const [n, o] = e;
|
|
507
507
|
let r, s;
|
|
508
|
-
if (Array.isArray(
|
|
509
|
-
const h =
|
|
508
|
+
if (Array.isArray(a) ? (r = a[0], s = a[1]) : typeof a == "object" && a.type === "mask" ? (r = a.format, s = a.format) : (r = a, s = a), l === "string") {
|
|
509
|
+
const h = n ? me(n, r) : "", f = o ? me(o, s) : "";
|
|
510
510
|
return [h, f];
|
|
511
511
|
}
|
|
512
|
-
return [Z(
|
|
512
|
+
return [Z(n), Z(o)];
|
|
513
513
|
}
|
|
514
514
|
};
|
|
515
515
|
function Ml(e) {
|
|
@@ -521,12 +521,12 @@ const {
|
|
|
521
521
|
YearPicker: kl,
|
|
522
522
|
WeekPicker: Vl,
|
|
523
523
|
QuarterPicker: Xl
|
|
524
|
-
} =
|
|
524
|
+
} = Ft;
|
|
525
525
|
function _l(e) {
|
|
526
|
-
let
|
|
526
|
+
let a = e.reduce((l, n) => n.order !== void 0 ? Math.max(l, n.order) : l, 0);
|
|
527
527
|
return e.forEach((l) => {
|
|
528
|
-
l.order === void 0 && (
|
|
529
|
-
}), e.sort((l,
|
|
528
|
+
l.order === void 0 && (a += 1, l.order = a);
|
|
529
|
+
}), e.sort((l, n) => l.order - n.order), e;
|
|
530
530
|
}
|
|
531
531
|
const Gl = {
|
|
532
532
|
modalScroll: he.modalScroll,
|
|
@@ -547,31 +547,31 @@ const Gl = {
|
|
|
547
547
|
inheritAttrs: !1,
|
|
548
548
|
props: Gl,
|
|
549
549
|
setup(e, {
|
|
550
|
-
slots:
|
|
550
|
+
slots: a,
|
|
551
551
|
expose: l
|
|
552
552
|
}) {
|
|
553
553
|
const {
|
|
554
|
-
wrapSSR:
|
|
554
|
+
wrapSSR: n,
|
|
555
555
|
hashId: o
|
|
556
|
-
} = Tt("ProTableForm", [Yl], e.prefixCls), r =
|
|
556
|
+
} = Tt("ProTableForm", [Yl], e.prefixCls), r = St(), s = ot(), {
|
|
557
557
|
formAutoRequest: h,
|
|
558
558
|
formConfig: f,
|
|
559
559
|
formActions: $,
|
|
560
|
-
screenWidth:
|
|
560
|
+
screenWidth: v,
|
|
561
561
|
styles: w,
|
|
562
|
-
classNames:
|
|
563
|
-
} =
|
|
562
|
+
classNames: m
|
|
563
|
+
} = qe(), {
|
|
564
564
|
formState: u,
|
|
565
565
|
resetFormState: S,
|
|
566
566
|
changeFormState: g
|
|
567
|
-
} = Wl(e.defaultFormSearch, e.formCols),
|
|
567
|
+
} = Wl(e.defaultFormSearch, e.formCols), O = x(pe(f.value?.gap || 16)), H = T(() => {
|
|
568
568
|
if (f.value?.breakpoint && ne(f.value.breakpoint) && Object.keys(f.value.breakpoint).length)
|
|
569
569
|
return f.value?.breakpoint;
|
|
570
|
-
}),
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
}), B = x(f.value?.collapsed ?? f.value?.defaultCollapsed), E = T(() => De($.value?.reset) ? $.value?.reset : !h.value), F = T(() => H.value ? V(H.value, v.value) : L(f.value?.span, s.value)), Y = T(() => f.value?.label);
|
|
571
|
+
K(() => f.value?.collapsed, (t) => {
|
|
572
|
+
B.value = t;
|
|
573
573
|
});
|
|
574
|
-
function
|
|
574
|
+
function V(t, i) {
|
|
575
575
|
let y = 4;
|
|
576
576
|
const b = Object.keys(t).map((C) => Number(C)).filter((C) => !Number.isNaN(C)).sort((C, c) => c - C);
|
|
577
577
|
for (let C = 0; C < b.length; C += 1) {
|
|
@@ -583,31 +583,31 @@ const Gl = {
|
|
|
583
583
|
}
|
|
584
584
|
return y;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function L(t, i) {
|
|
587
587
|
let y = 4;
|
|
588
|
-
for (let b = 0; b <
|
|
589
|
-
const C =
|
|
588
|
+
for (let b = 0; b < Ue.length; b += 1) {
|
|
589
|
+
const C = Ue[b].value;
|
|
590
590
|
if (i[C]) {
|
|
591
|
-
y = t?.[C] || (e.modalScroll ? 3 :
|
|
591
|
+
y = t?.[C] || (e.modalScroll ? 3 : Ue[b].span);
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
return y;
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
},
|
|
597
|
+
const N = (t) => {
|
|
598
|
+
B.value = t;
|
|
599
|
+
}, k = (t, i, y) => (t + 1) % i === 0 ? {
|
|
600
600
|
...y,
|
|
601
601
|
marginRight: pe(0)
|
|
602
602
|
} : {
|
|
603
603
|
...y,
|
|
604
|
-
marginRight:
|
|
604
|
+
marginRight: O.value
|
|
605
605
|
}, z = () => {
|
|
606
|
-
const t =
|
|
606
|
+
const t = At(u), i = e.formCols.find((C) => C.valueType === "text") || "", y = e.formCols.find((C) => C.valueType === "dateRange") || "", b = e.formCols.find((C) => C.valueType === "treeSelect");
|
|
607
607
|
return i && (t[i.name] = u[i.name] || i.initialValue || ""), y && (t[y.rangeStartName || "start"] = t[y.name] ? t[y.name][0] : "", t[y.rangeEndName || "end"] = t[y.name] ? t[y.name][1] : "", delete t[y.name]), b && (b?.name && J(u[b?.name]) && (t[b.name] = u[b.name].length ? u[b.name].map((C) => C[b.valueKey === "text" ? "label" : "value"]).join() : ""), b?.name && J(t[b?.name]) && (t[b.name] = t[b.name].length ? t[b.name].map((C) => C[b.valueKey === "text" ? "label" : "value"]) : "")), t;
|
|
608
|
-
},
|
|
608
|
+
}, j = (t = !1, i) => {
|
|
609
609
|
(h.value || t) && e.onSearch?.(z(), t ? i ? "reset" : "submit" : void 0);
|
|
610
|
-
},
|
|
610
|
+
}, M = (t, i, y) => {
|
|
611
611
|
const b = u[i.name || ""];
|
|
612
612
|
switch (i.valueType) {
|
|
613
613
|
case "text":
|
|
@@ -641,41 +641,41 @@ const Gl = {
|
|
|
641
641
|
g(i.name || "", t ? me(t, "YYYY") : null);
|
|
642
642
|
break;
|
|
643
643
|
case "dateRange":
|
|
644
|
-
g(i.name || "", t && J(t) && t.length === 2 ?
|
|
644
|
+
g(i.name || "", t && J(t) && t.length === 2 ? ht(t, Be(i.valueFormat, i.showTime)) : null);
|
|
645
645
|
break;
|
|
646
646
|
case "time":
|
|
647
647
|
g(i.name || "", t ? me(t, i.valueFormat || "HH:mm:ss") : null);
|
|
648
648
|
break;
|
|
649
649
|
}
|
|
650
|
-
i.valueType === "treeSelect" || i.valueType,
|
|
651
|
-
},
|
|
652
|
-
S(),
|
|
650
|
+
i.valueType === "treeSelect" || i.valueType, j();
|
|
651
|
+
}, q = (t = !0) => {
|
|
652
|
+
S(), j(!0, t);
|
|
653
653
|
};
|
|
654
654
|
l({
|
|
655
655
|
getFormSearch: () => z(),
|
|
656
|
-
resetForm:
|
|
656
|
+
resetForm: q
|
|
657
657
|
});
|
|
658
658
|
const te = () => {
|
|
659
659
|
const t = r?.emptyText?.value;
|
|
660
660
|
if (t) {
|
|
661
|
-
const i = ae(t), y = i ?
|
|
661
|
+
const i = ae(t), y = i ? gt(t) : xt(t || []);
|
|
662
662
|
return d("div", {
|
|
663
|
-
class:
|
|
664
|
-
}, [i ? y : J(y) ? y.map((b) =>
|
|
663
|
+
class: A(`${e.prefixCls}-search-empty-text`, o.value)
|
|
664
|
+
}, [i ? y : J(y) ? y.map((b) => tt(b)) : void 0]);
|
|
665
665
|
}
|
|
666
|
-
}, se = () => (!h.value ||
|
|
667
|
-
class:
|
|
666
|
+
}, se = () => (!h.value || E.value) && d("div", {
|
|
667
|
+
class: A(`${e.prefixCls}-search-buttons ${o.value}`, m.value?.searchButtons),
|
|
668
668
|
style: w.value?.searchButtons
|
|
669
|
-
}, [
|
|
669
|
+
}, [E.value && d(vt, {
|
|
670
670
|
key: "reset",
|
|
671
|
-
onClick: () =>
|
|
671
|
+
onClick: () => q()
|
|
672
672
|
}, {
|
|
673
673
|
default: () => [$.value?.resetText || "重置"]
|
|
674
|
-
}), !h.value && d(
|
|
674
|
+
}), !h.value && d(vt, {
|
|
675
675
|
key: "submit",
|
|
676
676
|
loading: e.loading,
|
|
677
677
|
type: "primary",
|
|
678
|
-
onClick: () =>
|
|
678
|
+
onClick: () => j(!0)
|
|
679
679
|
}, {
|
|
680
680
|
default: () => [$.value?.searchText || "查询"]
|
|
681
681
|
})]), re = ({
|
|
@@ -687,16 +687,16 @@ const Gl = {
|
|
|
687
687
|
...t,
|
|
688
688
|
...w.value?.searchControl
|
|
689
689
|
},
|
|
690
|
-
class:
|
|
690
|
+
class: A(`${e.prefixCls}-search-control ${o.value}`, m.value?.searchControl)
|
|
691
691
|
}, [d("div", {
|
|
692
|
-
class:
|
|
692
|
+
class: A(`${e.prefixCls}-search-control-content ${o.value}`, m.value?.searchContent)
|
|
693
693
|
}, [se(), f.value?.collapseRender !== !1 && y && d(we, null, [typeof f.value?.collapseRender == "function" ? f.value?.collapseRender(i) : d("span", {
|
|
694
|
-
class:
|
|
694
|
+
class: A(`${e.prefixCls}-search-control-text ${o.value}`, m.value?.searchText),
|
|
695
695
|
style: w.value?.searchText,
|
|
696
|
-
onClick: () =>
|
|
697
|
-
}, [i ? "收起" : "展开", i ? d(
|
|
696
|
+
onClick: () => N(!i)
|
|
697
|
+
}, [i ? "收起" : "展开", i ? d(Ut, null, null) : d(Jt, null, null)])])])]);
|
|
698
698
|
function be(t) {
|
|
699
|
-
return t === void 0 ? void 0 : t ? d(
|
|
699
|
+
return t === void 0 ? void 0 : t ? d(It, {
|
|
700
700
|
size: "small",
|
|
701
701
|
indicator: r?.indicator?.value
|
|
702
702
|
}, null) : te();
|
|
@@ -711,7 +711,7 @@ const Gl = {
|
|
|
711
711
|
}
|
|
712
712
|
const Re = (t) => {
|
|
713
713
|
let i;
|
|
714
|
-
const y = h.value ?
|
|
714
|
+
const y = h.value ? We.Search : We, b = ze(t.field || {}, "rules");
|
|
715
715
|
let C = null;
|
|
716
716
|
switch (t.valueType) {
|
|
717
717
|
case "text":
|
|
@@ -722,37 +722,37 @@ const Gl = {
|
|
|
722
722
|
value: u[t.name],
|
|
723
723
|
placeholder: t.placeholder || "请输入",
|
|
724
724
|
allowClear: t.allowClear ?? !0,
|
|
725
|
-
onChange: (c) =>
|
|
726
|
-
onSearch: (c) =>
|
|
725
|
+
onChange: (c) => M(c.target.value, t),
|
|
726
|
+
onSearch: (c) => j()
|
|
727
727
|
}, b), null);
|
|
728
728
|
break;
|
|
729
729
|
case "number":
|
|
730
|
-
i = d(
|
|
730
|
+
i = d(Qe, Q({
|
|
731
731
|
style: {
|
|
732
732
|
width: "100%"
|
|
733
733
|
},
|
|
734
734
|
value: u[t.name],
|
|
735
735
|
placeholder: t.placeholder || "请输入",
|
|
736
|
-
onChange: (c) =>
|
|
736
|
+
onChange: (c) => M(c, t)
|
|
737
737
|
}, b), null);
|
|
738
738
|
break;
|
|
739
739
|
case "numberRange":
|
|
740
|
-
i = d(
|
|
740
|
+
i = d(We.Group, {
|
|
741
741
|
compact: !0,
|
|
742
|
-
class:
|
|
742
|
+
class: A(o.value, `${e.prefixCls}-search-input-compact`)
|
|
743
743
|
}, {
|
|
744
|
-
default: () => [d(
|
|
744
|
+
default: () => [d(Qe, {
|
|
745
745
|
value: u[t.name]?.[0],
|
|
746
|
-
onChange: (c) =>
|
|
746
|
+
onChange: (c) => M(c, t, {
|
|
747
747
|
key: 0
|
|
748
748
|
}),
|
|
749
749
|
placeholder: J(t.placeholder) && t.placeholder?.[0] || "请输入"
|
|
750
|
-
}, null), d(
|
|
750
|
+
}, null), d(We, {
|
|
751
751
|
disabled: !0,
|
|
752
752
|
placeholder: "~"
|
|
753
|
-
}, null), d(
|
|
753
|
+
}, null), d(Qe, {
|
|
754
754
|
value: u[t.name]?.[1],
|
|
755
|
-
onChange: (c) =>
|
|
755
|
+
onChange: (c) => M(c, t, {
|
|
756
756
|
key: 1
|
|
757
757
|
}),
|
|
758
758
|
placeholder: J(t.placeholder) && t.placeholder?.[1] || "请输入"
|
|
@@ -771,7 +771,7 @@ const Gl = {
|
|
|
771
771
|
allowClear: t.allowClear ?? !0,
|
|
772
772
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
773
773
|
notFoundContent: be(t.loading),
|
|
774
|
-
onChange: (c) =>
|
|
774
|
+
onChange: (c) => M(c, t),
|
|
775
775
|
options: t.loading ? [] : t?.valueEnum || []
|
|
776
776
|
}, b), null);
|
|
777
777
|
break;
|
|
@@ -786,11 +786,11 @@ const Gl = {
|
|
|
786
786
|
treeData: t.loading ? [] : t.valueEnum || [],
|
|
787
787
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
788
788
|
notFoundContent: be(t.loading),
|
|
789
|
-
onChange: (c) =>
|
|
789
|
+
onChange: (c) => M(c, t)
|
|
790
790
|
}, b), null);
|
|
791
791
|
break;
|
|
792
792
|
case "date":
|
|
793
|
-
i = d(
|
|
793
|
+
i = d(Ft, Q({
|
|
794
794
|
style: {
|
|
795
795
|
width: "100%"
|
|
796
796
|
},
|
|
@@ -801,7 +801,7 @@ const Gl = {
|
|
|
801
801
|
format: Be(t.valueFormat, t.showTime),
|
|
802
802
|
showTime: t.showTime,
|
|
803
803
|
showToday: t.showToday || !0,
|
|
804
|
-
onChange: (c) =>
|
|
804
|
+
onChange: (c) => M(c, t)
|
|
805
805
|
}, b), null);
|
|
806
806
|
break;
|
|
807
807
|
case "dateWeek":
|
|
@@ -813,7 +813,7 @@ const Gl = {
|
|
|
813
813
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
814
814
|
allowClear: t.allowClear ?? !0,
|
|
815
815
|
placeholder: t.placeholder || "请选择",
|
|
816
|
-
onChange: (c) =>
|
|
816
|
+
onChange: (c) => M(c, t)
|
|
817
817
|
}, b), null);
|
|
818
818
|
break;
|
|
819
819
|
case "dateMonth":
|
|
@@ -825,7 +825,7 @@ const Gl = {
|
|
|
825
825
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
826
826
|
allowClear: t.allowClear ?? !0,
|
|
827
827
|
placeholder: t.placeholder || "请选择",
|
|
828
|
-
onChange: (c) =>
|
|
828
|
+
onChange: (c) => M(c, t)
|
|
829
829
|
}, b), null);
|
|
830
830
|
break;
|
|
831
831
|
case "dateQuarter":
|
|
@@ -837,7 +837,7 @@ const Gl = {
|
|
|
837
837
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
838
838
|
allowClear: t.allowClear ?? !0,
|
|
839
839
|
placeholder: t.placeholder || "请选择",
|
|
840
|
-
onChange: (c) =>
|
|
840
|
+
onChange: (c) => M(c, t)
|
|
841
841
|
}, b), null);
|
|
842
842
|
break;
|
|
843
843
|
case "dateYear":
|
|
@@ -849,7 +849,7 @@ const Gl = {
|
|
|
849
849
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
850
850
|
allowClear: t.allowClear ?? !0,
|
|
851
851
|
placeholder: t.placeholder || "请选择",
|
|
852
|
-
onChange: (c) =>
|
|
852
|
+
onChange: (c) => M(c, t)
|
|
853
853
|
}, b), null);
|
|
854
854
|
break;
|
|
855
855
|
case "dateRange":
|
|
@@ -857,12 +857,12 @@ const Gl = {
|
|
|
857
857
|
style: {
|
|
858
858
|
width: "100%"
|
|
859
859
|
},
|
|
860
|
-
value: u[t.name] && J(u[t.name]) && u[t.name]?.length === 2 ?
|
|
860
|
+
value: u[t.name] && J(u[t.name]) && u[t.name]?.length === 2 ? ht(u[t.name], Be(t.valueFormat, t.showTime), "dayjs") : void 0,
|
|
861
861
|
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
862
862
|
placeholder: t.placeholder || ["开始日期", "结束日期"],
|
|
863
863
|
format: Be(t.valueFormat, t.showTime),
|
|
864
864
|
showTime: t.showTime,
|
|
865
|
-
onChange: (c) =>
|
|
865
|
+
onChange: (c) => M(c, t)
|
|
866
866
|
}, b), null);
|
|
867
867
|
break;
|
|
868
868
|
case "time":
|
|
@@ -876,7 +876,7 @@ const Gl = {
|
|
|
876
876
|
allowClear: t.allowClear || t.allowClear === !1 ? t.allowClear : !0,
|
|
877
877
|
use12Hours: t.use12Hours,
|
|
878
878
|
format: t.valueFormat || "HH:mm:ss",
|
|
879
|
-
onChange: (c) =>
|
|
879
|
+
onChange: (c) => M(c, t)
|
|
880
880
|
}, b), null);
|
|
881
881
|
break;
|
|
882
882
|
}
|
|
@@ -885,34 +885,34 @@ const Gl = {
|
|
|
885
885
|
formItemStyle: t = {},
|
|
886
886
|
item: i
|
|
887
887
|
}) => {
|
|
888
|
-
const y = ae(i) ? i.props?.label : i.label, b = (ae(i) ? i.props?.labelWidth : i.labelWidth) ||
|
|
888
|
+
const y = ae(i) ? i.props?.label : i.label, b = (ae(i) ? i.props?.labelWidth : i.labelWidth) || Y.value?.width, C = (ae(i) ? i.props?.labelAlign : i.labelAlign) || Y.value?.align;
|
|
889
889
|
return d("div", {
|
|
890
|
-
class:
|
|
890
|
+
class: A(`${e.prefixCls}-search-item`, o.value, m.value?.searchItem),
|
|
891
891
|
style: {
|
|
892
892
|
...t,
|
|
893
|
-
gap:
|
|
893
|
+
gap: Y.value?.gap ? pe(Y.value?.gap) : void 0,
|
|
894
894
|
...w.value?.searchItem || {}
|
|
895
895
|
}
|
|
896
896
|
}, [y && d("div", {
|
|
897
|
-
class:
|
|
897
|
+
class: A(`${e.prefixCls}-search-item-label`, Y.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, C && `${e.prefixCls}-search-item-label-${C}`),
|
|
898
898
|
style: {
|
|
899
899
|
width: b ? pe(b) : void 0
|
|
900
900
|
}
|
|
901
901
|
}, [y]), d("div", {
|
|
902
|
-
class:
|
|
902
|
+
class: A(`${e.prefixCls}-search-item-children`)
|
|
903
903
|
}, [ae(i) ? i : Re(i)])]);
|
|
904
904
|
}, Pe = () => {
|
|
905
|
-
let t =
|
|
905
|
+
let t = a.default?.() || [];
|
|
906
906
|
t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
|
|
907
907
|
const i = _l([...e.formCols, ...t.map((b) => ({
|
|
908
908
|
...b,
|
|
909
909
|
order: b.props?.order || void 0
|
|
910
910
|
}))]), y = {
|
|
911
|
-
width: `calc((100% - (${
|
|
911
|
+
width: `calc((100% - (${F.value - 1} * ${O.value})) / ${F.value})`
|
|
912
912
|
};
|
|
913
913
|
return i.map((b, C) => {
|
|
914
|
-
const c =
|
|
915
|
-
return i.length <
|
|
914
|
+
const c = k(C, F.value, y);
|
|
915
|
+
return i.length < F.value || B.value ? d(we, null, [oe({
|
|
916
916
|
formItemStyle: c,
|
|
917
917
|
item: b
|
|
918
918
|
}), C === i.length - 1 && re({
|
|
@@ -920,28 +920,28 @@ const Gl = {
|
|
|
920
920
|
flex: 1,
|
|
921
921
|
justifyContent: "flex-end"
|
|
922
922
|
},
|
|
923
|
-
collapsed:
|
|
924
|
-
collapseRender: !!
|
|
925
|
-
})]) : d(we, null, [C <
|
|
923
|
+
collapsed: B.value,
|
|
924
|
+
collapseRender: !!B.value
|
|
925
|
+
})]) : d(we, null, [C < F.value - 1 && oe({
|
|
926
926
|
formItemStyle: c,
|
|
927
927
|
item: b
|
|
928
|
-
}), C ===
|
|
928
|
+
}), C === F.value - 1 && (F.value - 1 === 0 || i.length === F.value) && oe({
|
|
929
929
|
formItemStyle: c,
|
|
930
930
|
item: b
|
|
931
|
-
}), C ===
|
|
931
|
+
}), C === F.value - 1 && i.length >= F.value && re({
|
|
932
932
|
formItemStyle: {
|
|
933
933
|
flex: 1,
|
|
934
934
|
justifyContent: "flex-end"
|
|
935
935
|
},
|
|
936
936
|
collapsed: !1,
|
|
937
|
-
collapseRender: i.length !==
|
|
937
|
+
collapseRender: i.length !== F.value
|
|
938
938
|
})]);
|
|
939
939
|
});
|
|
940
940
|
};
|
|
941
941
|
return () => {
|
|
942
942
|
const t = e.cardBordered && `${e.prefixCls}-search-border`;
|
|
943
|
-
return
|
|
944
|
-
class:
|
|
943
|
+
return n(d("div", {
|
|
944
|
+
class: A(m.value?.search, o.value, `${e.prefixCls}-search`, t, o.value, f.value?.className),
|
|
945
945
|
style: w.value?.search
|
|
946
946
|
}, [Pe()]));
|
|
947
947
|
};
|
|
@@ -1021,7 +1021,7 @@ const Gl = {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
}), { useInjectContext:
|
|
1024
|
+
}), { useInjectContext: Dt, provideContext: Jl } = Nt("scrollbar"), xe = 4, Zl = {
|
|
1025
1025
|
vertical: {
|
|
1026
1026
|
offset: "offsetHeight",
|
|
1027
1027
|
scroll: "scrollTop",
|
|
@@ -1042,8 +1042,8 @@ const Gl = {
|
|
|
1042
1042
|
client: "clientX",
|
|
1043
1043
|
direction: "left"
|
|
1044
1044
|
}
|
|
1045
|
-
}, ea = ({ move: e, size:
|
|
1046
|
-
[l.size]:
|
|
1045
|
+
}, ea = ({ move: e, size: a, bar: l }) => ({
|
|
1046
|
+
[l.size]: a,
|
|
1047
1047
|
transform: `translate${l.axis}(${e}%)`
|
|
1048
1048
|
}), ta = {
|
|
1049
1049
|
vertical: Boolean,
|
|
@@ -1058,64 +1058,64 @@ const Gl = {
|
|
|
1058
1058
|
type: [Object],
|
|
1059
1059
|
default: () => ({})
|
|
1060
1060
|
}
|
|
1061
|
-
},
|
|
1061
|
+
}, et = /* @__PURE__ */ ge({
|
|
1062
1062
|
props: ta,
|
|
1063
1063
|
setup(e) {
|
|
1064
1064
|
const {
|
|
1065
|
-
tableHeaderHeight:
|
|
1065
|
+
tableHeaderHeight: a,
|
|
1066
1066
|
hashId: l,
|
|
1067
|
-
wrapElement:
|
|
1067
|
+
wrapElement: n,
|
|
1068
1068
|
scrollbarElement: o,
|
|
1069
1069
|
className: r
|
|
1070
|
-
} =
|
|
1071
|
-
let
|
|
1072
|
-
const g =
|
|
1070
|
+
} = Dt(), s = x(), h = x(), f = x({}), $ = x(!1);
|
|
1071
|
+
let v = !1, w = !1, m = 0, u = 0, S = Tl ? document.onselectstart : null;
|
|
1072
|
+
const g = T(() => Zl[e.vertical ? "vertical" : "horizontal"]), O = T(() => ea({
|
|
1073
1073
|
size: e.size,
|
|
1074
1074
|
move: e.move,
|
|
1075
1075
|
bar: g.value
|
|
1076
|
-
})),
|
|
1076
|
+
})), H = T(() => (
|
|
1077
1077
|
// offsetRatioX = original width of thumb / current width of thumb / ratioX
|
|
1078
1078
|
// offsetRatioY = original height of thumb / current height of thumb / ratioY
|
|
1079
1079
|
// instance height = wrap height - GAP
|
|
1080
|
-
s.value[g.value.offset] ** 2 /
|
|
1081
|
-
)),
|
|
1080
|
+
s.value[g.value.offset] ** 2 / n.value[g.value.scrollSize] / e.ratio / h.value[g.value.offset]
|
|
1081
|
+
)), B = (z) => {
|
|
1082
1082
|
if (z.stopPropagation(), z.ctrlKey || [1, 2].includes(z.button)) return;
|
|
1083
|
-
window.getSelection()?.removeAllRanges(),
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1086
|
-
},
|
|
1087
|
-
if (!h.value || !s.value || !
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1083
|
+
window.getSelection()?.removeAllRanges(), F(z);
|
|
1084
|
+
const j = z.currentTarget;
|
|
1085
|
+
j && (f.value[g.value.axis] = j[g.value.offset] - (z[g.value.client] - j.getBoundingClientRect()[g.value.direction]));
|
|
1086
|
+
}, E = (z) => {
|
|
1087
|
+
if (!h.value || !s.value || !n.value) return;
|
|
1088
|
+
const j = Math.abs(z.target.getBoundingClientRect()[g.value.direction] - z[g.value.client]), M = h.value[g.value.offset] / 2, q = (j - M) * 100 * H.value / s.value[g.value.offset];
|
|
1089
|
+
n.value[g.value.scroll] = q * n.value[g.value.scrollSize] / 100;
|
|
1090
1090
|
};
|
|
1091
|
-
function
|
|
1092
|
-
|
|
1091
|
+
function F(z) {
|
|
1092
|
+
n.value && (z.stopImmediatePropagation(), v = !0, m = n.value.scrollHeight, u = n.value.scrollWidth, document.addEventListener("mousemove", Y), document.addEventListener("mouseup", V), S = document.onselectstart, document.onselectstart = () => !1);
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
if (!
|
|
1096
|
-
const
|
|
1097
|
-
if (!
|
|
1098
|
-
const
|
|
1099
|
-
g.value.scroll === "scrollLeft" ?
|
|
1094
|
+
function Y(z) {
|
|
1095
|
+
if (!n.value || !s.value || !h.value || v === !1) return;
|
|
1096
|
+
const j = f.value[g.value.axis];
|
|
1097
|
+
if (!j) return;
|
|
1098
|
+
const M = (s.value.getBoundingClientRect()[g.value.direction] - z[g.value.client]) * -1, q = h.value[g.value.offset] - j, te = (M - q) * 100 * H.value / s.value[g.value.offset];
|
|
1099
|
+
g.value.scroll === "scrollLeft" ? n.value[g.value.scroll] = te * u / 100 : n.value[g.value.scroll] = te * m / 100;
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1102
|
-
|
|
1101
|
+
function V() {
|
|
1102
|
+
v = !1, f.value[g.value.axis] = 0, document.removeEventListener("mousemove", Y), document.removeEventListener("mouseup", V), k(), w && ($.value = !1);
|
|
1103
1103
|
}
|
|
1104
|
-
const
|
|
1104
|
+
const L = () => {
|
|
1105
1105
|
w = !1, $.value = !!e.size;
|
|
1106
|
-
},
|
|
1107
|
-
w = !0, $.value =
|
|
1106
|
+
}, N = () => {
|
|
1107
|
+
w = !0, $.value = v;
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1110
|
-
|
|
1109
|
+
Xt(() => {
|
|
1110
|
+
k(), document.removeEventListener("mouseup", V);
|
|
1111
1111
|
});
|
|
1112
|
-
function
|
|
1112
|
+
function k() {
|
|
1113
1113
|
document.onselectstart !== S && (document.onselectstart = S);
|
|
1114
1114
|
}
|
|
1115
|
-
return
|
|
1115
|
+
return ft(o, "mousemove", L), ft(o, "mouseleave", N), () => {
|
|
1116
1116
|
const z = g.value.key === "vertical" ? {
|
|
1117
|
-
height: `calc(100% - ${pe(
|
|
1118
|
-
top: pe(
|
|
1117
|
+
height: `calc(100% - ${pe(a.value + 1)})`,
|
|
1118
|
+
top: pe(a.value + 1)
|
|
1119
1119
|
} : {};
|
|
1120
1120
|
return d("div", {
|
|
1121
1121
|
ref: s,
|
|
@@ -1124,17 +1124,17 @@ const Gl = {
|
|
|
1124
1124
|
...z
|
|
1125
1125
|
},
|
|
1126
1126
|
class: [`${r}-bar`, "is-" + g.value.key, l.value],
|
|
1127
|
-
onMousedown:
|
|
1127
|
+
onMousedown: E
|
|
1128
1128
|
}, [d("div", {
|
|
1129
1129
|
ref: h,
|
|
1130
1130
|
class: `${r}-thumb ${l.value}`,
|
|
1131
|
-
style:
|
|
1132
|
-
onMousedown:
|
|
1131
|
+
style: O.value,
|
|
1132
|
+
onMousedown: B
|
|
1133
1133
|
}, null)]);
|
|
1134
1134
|
};
|
|
1135
1135
|
}
|
|
1136
1136
|
});
|
|
1137
|
-
|
|
1137
|
+
et.inheritAttrs = !1;
|
|
1138
1138
|
const la = {
|
|
1139
1139
|
always: {
|
|
1140
1140
|
type: Boolean,
|
|
@@ -1155,35 +1155,35 @@ const la = {
|
|
|
1155
1155
|
inheritAttrs: !1,
|
|
1156
1156
|
props: la,
|
|
1157
1157
|
setup(e, {
|
|
1158
|
-
expose:
|
|
1158
|
+
expose: a
|
|
1159
1159
|
}) {
|
|
1160
1160
|
const {
|
|
1161
1161
|
tableScrollState: l
|
|
1162
|
-
} =
|
|
1163
|
-
if (
|
|
1164
|
-
const u =
|
|
1165
|
-
r.value =
|
|
1162
|
+
} = qe(), n = Dt(), o = x(0), r = x(0), s = x(""), h = x(""), f = x(1), $ = x(1), v = (m) => {
|
|
1163
|
+
if (m) {
|
|
1164
|
+
const u = m.offsetHeight - xe, S = m.offsetWidth - xe;
|
|
1165
|
+
r.value = m.scrollTop * 100 / u * f.value, o.value = m.scrollLeft * 100 / S * $.value;
|
|
1166
1166
|
}
|
|
1167
1167
|
}, w = () => {
|
|
1168
|
-
const
|
|
1169
|
-
if (!
|
|
1170
|
-
const u =
|
|
1171
|
-
f.value = g / (u - g) / (
|
|
1168
|
+
const m = n?.wrapElement;
|
|
1169
|
+
if (!m?.value) return;
|
|
1170
|
+
const u = m.value.offsetHeight - xe, S = m.value.offsetWidth - xe, g = u ** 2 / m.value.scrollHeight, O = S ** 2 / m.value.scrollWidth, H = Math.max(g, e.minSize), B = Math.max(O, e.minSize);
|
|
1171
|
+
f.value = g / (u - g) / (H / (u - H)), $.value = O / (S - O) / (B / (S - B)), h.value = H + xe < u ? `${H}px` : "", s.value = B + xe < S ? `${B}px` : "";
|
|
1172
1172
|
};
|
|
1173
|
-
return
|
|
1174
|
-
|
|
1173
|
+
return at(() => {
|
|
1174
|
+
nt(() => {
|
|
1175
1175
|
w();
|
|
1176
1176
|
});
|
|
1177
|
-
}),
|
|
1177
|
+
}), a({
|
|
1178
1178
|
update: w,
|
|
1179
|
-
handleScroll:
|
|
1180
|
-
}), () => d(we, null, [d(
|
|
1179
|
+
handleScroll: v
|
|
1180
|
+
}), () => d(we, null, [d(et, {
|
|
1181
1181
|
move: o.value,
|
|
1182
1182
|
barStyle: e.barStyle.x,
|
|
1183
1183
|
ratio: $.value,
|
|
1184
1184
|
size: s.value,
|
|
1185
1185
|
always: e.always
|
|
1186
|
-
}, null), !!l.value.y && d(
|
|
1186
|
+
}, null), !!l.value.y && d(et, {
|
|
1187
1187
|
move: r.value,
|
|
1188
1188
|
barStyle: e.barStyle.y,
|
|
1189
1189
|
ratio: f.value,
|
|
@@ -1197,14 +1197,14 @@ function na(e) {
|
|
|
1197
1197
|
if (ae(e))
|
|
1198
1198
|
return e;
|
|
1199
1199
|
if (e) {
|
|
1200
|
-
const
|
|
1200
|
+
const a = e, {
|
|
1201
1201
|
icon: l,
|
|
1202
|
-
tooltip:
|
|
1202
|
+
tooltip: n,
|
|
1203
1203
|
onClick: o,
|
|
1204
1204
|
key: r
|
|
1205
|
-
} =
|
|
1206
|
-
return l &&
|
|
1207
|
-
title:
|
|
1205
|
+
} = a;
|
|
1206
|
+
return l && n ? d($e, {
|
|
1207
|
+
title: n,
|
|
1208
1208
|
key: r
|
|
1209
1209
|
}, {
|
|
1210
1210
|
default: () => [d("span", {
|
|
@@ -1217,11 +1217,10 @@ function na(e) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
return null;
|
|
1219
1219
|
}
|
|
1220
|
-
const
|
|
1220
|
+
const Ot = /* @__PURE__ */ ge({
|
|
1221
1221
|
props: {
|
|
1222
1222
|
actions: [Array],
|
|
1223
1223
|
settings: [Array],
|
|
1224
|
-
prefixCls: String,
|
|
1225
1224
|
headerTitle: he.headerTitle,
|
|
1226
1225
|
listToolAfter: he.listToolAfter,
|
|
1227
1226
|
headerTitleTip: he.headerTitleTip,
|
|
@@ -1229,106 +1228,99 @@ const Lt = /* @__PURE__ */ ge({
|
|
|
1229
1228
|
actionsPlacement: String
|
|
1230
1229
|
},
|
|
1231
1230
|
setup(e) {
|
|
1232
|
-
const
|
|
1231
|
+
const a = x(), {
|
|
1233
1232
|
height: l
|
|
1234
|
-
} =
|
|
1233
|
+
} = xl(a), n = ot(), {
|
|
1235
1234
|
isMobile: o,
|
|
1236
1235
|
tableListToolsHeight: r,
|
|
1237
1236
|
classNames: s,
|
|
1238
1237
|
styles: h,
|
|
1239
|
-
hashId: f
|
|
1240
|
-
|
|
1241
|
-
|
|
1238
|
+
hashId: f,
|
|
1239
|
+
prefixCls: $
|
|
1240
|
+
} = qe(), v = `${$}-list-toolbar`;
|
|
1241
|
+
bt(() => {
|
|
1242
1242
|
r.value = l.value || 0;
|
|
1243
1243
|
});
|
|
1244
|
-
const
|
|
1244
|
+
const w = T(() => !!(e.headerTitleTip || e.headerTitle)), m = T(() => {
|
|
1245
1245
|
if (!Array.isArray(e.actions) || e.actions?.length < 1)
|
|
1246
1246
|
return {
|
|
1247
1247
|
left: null,
|
|
1248
1248
|
right: null
|
|
1249
1249
|
};
|
|
1250
|
-
const B = e.actions.filter((
|
|
1250
|
+
const B = e.actions.filter((F) => ae(F)).filter((F) => (F?.props?.placement || e.actionsPlacement) === "left"), E = e.actions.filter((F) => ae(F)).filter((F) => (F?.props?.placement || e.actionsPlacement) === "right");
|
|
1251
1251
|
return {
|
|
1252
1252
|
left: B.length ? d("div", {
|
|
1253
|
-
class: `${
|
|
1253
|
+
class: A(`${v}-actions`, f.value)
|
|
1254
1254
|
}, [B]) : null,
|
|
1255
|
-
right:
|
|
1256
|
-
class: `${
|
|
1257
|
-
}, [
|
|
1255
|
+
right: E.length ? d("div", {
|
|
1256
|
+
class: A(`${v}-actions`, f.value)
|
|
1257
|
+
}, [E]) : null
|
|
1258
1258
|
};
|
|
1259
|
-
}
|
|
1260
|
-
if (!
|
|
1259
|
+
}), u = T(() => !!(e.headerTitleTip || e.headerTitle || m.value.left)), S = T(() => !!(e.settings?.length || m.value.right)), g = () => {
|
|
1260
|
+
if (!u.value && S.value)
|
|
1261
1261
|
return d("div", {
|
|
1262
|
-
class: `${
|
|
1262
|
+
class: A(`${v}-left`, f.value)
|
|
1263
1263
|
}, null);
|
|
1264
|
-
const B = m.value.left,
|
|
1265
|
-
return
|
|
1266
|
-
class:
|
|
1267
|
-
style:
|
|
1264
|
+
const B = m.value.left, E = A(`${v}-left ${f.value}`, s.value?.toolbarLeft), F = h.value?.toolbarLeft;
|
|
1265
|
+
return w.value ? d("div", {
|
|
1266
|
+
class: E,
|
|
1267
|
+
style: F
|
|
1268
1268
|
}, [d("div", {
|
|
1269
|
-
class: `${
|
|
1269
|
+
class: A(`${v}-title`, f.value)
|
|
1270
1270
|
}, [e.headerTitle, e.headerTitleTip && d($e, {
|
|
1271
1271
|
title: e.titleTipText
|
|
1272
1272
|
}, {
|
|
1273
|
-
default: () => [
|
|
1273
|
+
default: () => [De(e.headerTitleTip) && e.headerTitleTip ? d(Zt, null, null) : e.headerTitleTip]
|
|
1274
1274
|
})]), B]) : d("div", {
|
|
1275
|
-
class:
|
|
1276
|
-
style:
|
|
1275
|
+
class: E,
|
|
1276
|
+
style: F
|
|
1277
1277
|
}, [B]);
|
|
1278
|
-
},
|
|
1279
|
-
if (!
|
|
1278
|
+
}, O = () => {
|
|
1279
|
+
if (!S.value) return null;
|
|
1280
1280
|
const B = m.value.right;
|
|
1281
1281
|
return d("div", {
|
|
1282
|
-
class:
|
|
1282
|
+
class: A(`${v}-right ${f.value}`, s.value?.toolbarRight),
|
|
1283
1283
|
style: {
|
|
1284
|
-
alignItems:
|
|
1285
|
-
flexDirection:
|
|
1284
|
+
alignItems: n.value.lg ? "center" : "flex-end",
|
|
1285
|
+
flexDirection: n.value.lg ? "row" : "column",
|
|
1286
1286
|
...h.value?.toolbarRight || {}
|
|
1287
1287
|
}
|
|
1288
1288
|
}, [B, e.settings?.length ? d("div", {
|
|
1289
|
-
class:
|
|
1290
|
-
}, [e.settings.map((
|
|
1291
|
-
const
|
|
1289
|
+
class: A(`${v}-setting-items`, f.value)
|
|
1290
|
+
}, [e.settings.map((E, F) => {
|
|
1291
|
+
const Y = na(E);
|
|
1292
1292
|
return d("div", {
|
|
1293
|
-
key:
|
|
1294
|
-
class:
|
|
1295
|
-
}, [
|
|
1293
|
+
key: F,
|
|
1294
|
+
class: A(`${v}-setting-item`, f.value)
|
|
1295
|
+
}, [Y]);
|
|
1296
1296
|
})]) : null]);
|
|
1297
|
-
},
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
[`${f.value}`]: !0,
|
|
1301
|
-
[`${e.prefixCls}-container`]: !0,
|
|
1302
|
-
[`${e.prefixCls}-container-mobile`]: o.value
|
|
1303
|
-
};
|
|
1304
|
-
return d("div", {
|
|
1305
|
-
class: B
|
|
1306
|
-
}, [u.value, S.value]);
|
|
1307
|
-
}, [() => o.value, () => w.value, () => v.value, () => u.value, () => e.prefixCls, () => S.value]);
|
|
1297
|
+
}, H = () => !S.value && !u.value ? null : d("div", {
|
|
1298
|
+
class: A(f.value, `${v}-container`, o.value && `${v}-container-mobile`)
|
|
1299
|
+
}, [g(), O()]);
|
|
1308
1300
|
return () => d("div", {
|
|
1309
|
-
ref:
|
|
1310
|
-
class:
|
|
1301
|
+
ref: a,
|
|
1302
|
+
class: A(`${v} ${f.value}`, e.listToolAfter && `${v}-with-after`, s.value?.toolbar),
|
|
1311
1303
|
style: h.value?.toolbar
|
|
1312
|
-
}, [
|
|
1313
|
-
class:
|
|
1304
|
+
}, [H(), e.listToolAfter && d("div", {
|
|
1305
|
+
class: A(`${v}-after ${f.value}`, s.value?.toolbarAfter),
|
|
1314
1306
|
style: h.value?.toolbarAfter
|
|
1315
1307
|
}, [e.listToolAfter])]);
|
|
1316
1308
|
}
|
|
1317
1309
|
});
|
|
1318
|
-
|
|
1310
|
+
Ot.inheritAttrs = !1;
|
|
1319
1311
|
const oa = /* @__PURE__ */ ge({
|
|
1320
1312
|
setup() {
|
|
1321
1313
|
const {
|
|
1322
1314
|
isFullscreen: e
|
|
1323
|
-
} =
|
|
1315
|
+
} = Pt();
|
|
1324
1316
|
return () => e.value ? d($e, {
|
|
1325
1317
|
title: "退出全屏"
|
|
1326
1318
|
}, {
|
|
1327
|
-
default: () => [d(
|
|
1319
|
+
default: () => [d(el, null, null)]
|
|
1328
1320
|
}) : d($e, {
|
|
1329
1321
|
title: "全屏"
|
|
1330
1322
|
}, {
|
|
1331
|
-
default: () => [d(
|
|
1323
|
+
default: () => [d(tl, null, null)]
|
|
1332
1324
|
});
|
|
1333
1325
|
}
|
|
1334
1326
|
});
|
|
@@ -1336,7 +1328,7 @@ function ia() {
|
|
|
1336
1328
|
return {
|
|
1337
1329
|
reload: {
|
|
1338
1330
|
text: "刷新",
|
|
1339
|
-
icon: d(
|
|
1331
|
+
icon: d(ll, null, null)
|
|
1340
1332
|
},
|
|
1341
1333
|
fullScreen: {
|
|
1342
1334
|
text: "全屏",
|
|
@@ -1344,21 +1336,21 @@ function ia() {
|
|
|
1344
1336
|
}
|
|
1345
1337
|
};
|
|
1346
1338
|
}
|
|
1347
|
-
function sa(e,
|
|
1348
|
-
return
|
|
1349
|
-
const
|
|
1350
|
-
if (!
|
|
1339
|
+
function sa(e, a) {
|
|
1340
|
+
return wt(e).filter((l) => l).map((l) => {
|
|
1341
|
+
const n = e[l];
|
|
1342
|
+
if (!n)
|
|
1351
1343
|
return null;
|
|
1352
|
-
const o =
|
|
1344
|
+
const o = n ? a[l] : () => () => {
|
|
1353
1345
|
}, r = ia()[l];
|
|
1354
|
-
return r ? typeof
|
|
1346
|
+
return r ? typeof n == "boolean" || !Ne(n) ? d("span", {
|
|
1355
1347
|
key: l,
|
|
1356
1348
|
onClick: o
|
|
1357
1349
|
}, [d($e, {
|
|
1358
1350
|
title: r.text
|
|
1359
1351
|
}, {
|
|
1360
1352
|
default: () => [r.icon]
|
|
1361
|
-
})]) :
|
|
1353
|
+
})]) : n?.(o) : null;
|
|
1362
1354
|
}).filter((l) => l);
|
|
1363
1355
|
}
|
|
1364
1356
|
const ra = {
|
|
@@ -1373,22 +1365,18 @@ const ra = {
|
|
|
1373
1365
|
props: ra,
|
|
1374
1366
|
inheritAttrs: !1,
|
|
1375
1367
|
setup(e) {
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
} = Ke(), a = Ne(() => e.options === !1 ? [] : sa(ne(e.options) ? e.options : {}, {
|
|
1382
|
-
reload: () => l.reload(),
|
|
1383
|
-
fullScreen: () => l.toggle()
|
|
1368
|
+
const {
|
|
1369
|
+
action: a
|
|
1370
|
+
} = qe(), l = nl(() => e.options === !1 ? [] : sa(ne(e.options) ? e.options : {}, {
|
|
1371
|
+
reload: () => a.reload(),
|
|
1372
|
+
fullScreen: () => a.toggle()
|
|
1384
1373
|
}), [() => e.options]);
|
|
1385
1374
|
return () => {
|
|
1386
|
-
const
|
|
1387
|
-
return d(
|
|
1388
|
-
|
|
1389
|
-
actions: o,
|
|
1375
|
+
const n = e.actionsRender || [];
|
|
1376
|
+
return d(Ot, {
|
|
1377
|
+
actions: n,
|
|
1390
1378
|
actionsPlacement: e.actionsPlacement,
|
|
1391
|
-
settings:
|
|
1379
|
+
settings: R(l),
|
|
1392
1380
|
headerTitle: e.headerTitle,
|
|
1393
1381
|
listToolAfter: e.listToolAfter,
|
|
1394
1382
|
headerTitleTip: e.headerTitleTip,
|
|
@@ -1398,174 +1386,174 @@ const ra = {
|
|
|
1398
1386
|
}
|
|
1399
1387
|
});
|
|
1400
1388
|
function ca(e) {
|
|
1401
|
-
return
|
|
1389
|
+
return _t();
|
|
1402
1390
|
}
|
|
1403
|
-
function da(e,
|
|
1404
|
-
ca() ?
|
|
1391
|
+
function da(e, a = !0, l) {
|
|
1392
|
+
ca() ? pt(e, l) : a ? e() : nt(e);
|
|
1405
1393
|
}
|
|
1406
|
-
function fa({ scroll: e, columns:
|
|
1407
|
-
const s =
|
|
1408
|
-
|
|
1394
|
+
function fa({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: o, neverScroll: r }) {
|
|
1395
|
+
const s = x([]);
|
|
1396
|
+
K([
|
|
1409
1397
|
() => e.value,
|
|
1410
|
-
() => n.value,
|
|
1411
|
-
() => l.value,
|
|
1412
1398
|
() => a.value,
|
|
1413
1399
|
() => l.value,
|
|
1400
|
+
() => n.value,
|
|
1401
|
+
() => l.value,
|
|
1414
1402
|
() => o.value,
|
|
1415
1403
|
() => r.value
|
|
1416
1404
|
], () => {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1405
|
+
const m = $(ce(a.value));
|
|
1406
|
+
Me(m, ce(s.value)) || (s.value = ee(m));
|
|
1419
1407
|
}, {
|
|
1420
1408
|
deep: !0,
|
|
1421
1409
|
immediate: !0
|
|
1422
1410
|
});
|
|
1423
|
-
const h =
|
|
1424
|
-
function f(
|
|
1425
|
-
return
|
|
1411
|
+
const h = T(() => f(R(s)));
|
|
1412
|
+
function f(m) {
|
|
1413
|
+
return m.sort((u, S) => rl(u, S, "order", 0));
|
|
1426
1414
|
}
|
|
1427
|
-
function $(
|
|
1428
|
-
return ee(
|
|
1429
|
-
if (u.dataIndex === "action" || S ===
|
|
1415
|
+
function $(m) {
|
|
1416
|
+
return ee(m).map((u, S) => {
|
|
1417
|
+
if (u.dataIndex === "action" || S === m.length - 1 ? u.resizable = !1 : u.resizable = De(u.resizable) ? u.resizable : !!(Ce(u.width) && R(n)), !u.width || R(r))
|
|
1430
1418
|
return u;
|
|
1431
|
-
if (u.dataIndex === "action" &&
|
|
1432
|
-
if (
|
|
1419
|
+
if (u.dataIndex === "action" && R(o))
|
|
1420
|
+
if (R(e)?.x || !R(l))
|
|
1433
1421
|
u.width = u.width || 100, u.fixed = "right";
|
|
1434
1422
|
else {
|
|
1435
|
-
const g =
|
|
1423
|
+
const g = R(a).find((O) => O.dataIndex === u.dataIndex);
|
|
1436
1424
|
u.width = g?.width || "", u.fixed = g?.fixed;
|
|
1437
1425
|
}
|
|
1438
1426
|
return u;
|
|
1439
1427
|
});
|
|
1440
1428
|
}
|
|
1441
|
-
function m
|
|
1442
|
-
s.value = s.value.map((S) => (S.uuid === u.uuid && (S.width =
|
|
1429
|
+
function v(m, u) {
|
|
1430
|
+
s.value = s.value.map((S) => (S.uuid === u.uuid && (S.width = m), S));
|
|
1443
1431
|
}
|
|
1444
|
-
function w(
|
|
1445
|
-
if (
|
|
1432
|
+
function w(m) {
|
|
1433
|
+
if (m.length <= 0) {
|
|
1446
1434
|
s.value = [];
|
|
1447
1435
|
return;
|
|
1448
1436
|
}
|
|
1449
|
-
|
|
1437
|
+
Me($(m), ce(s.value)) || (s.value = $(m));
|
|
1450
1438
|
}
|
|
1451
1439
|
return {
|
|
1452
1440
|
breakpoint: l,
|
|
1453
1441
|
proColumns: h,
|
|
1454
1442
|
setColumns: w,
|
|
1455
|
-
resizeColumnWidth:
|
|
1443
|
+
resizeColumnWidth: v
|
|
1456
1444
|
};
|
|
1457
1445
|
}
|
|
1458
|
-
function va(e,
|
|
1459
|
-
const l =
|
|
1446
|
+
function va(e, a) {
|
|
1447
|
+
const l = T(() => a), n = x(), o = x(e);
|
|
1460
1448
|
function r() {
|
|
1461
|
-
|
|
1449
|
+
n.value && (clearTimeout(n.value), n.value = null);
|
|
1462
1450
|
}
|
|
1463
1451
|
async function s(...h) {
|
|
1464
1452
|
return l.value === 0 || l.value === void 0 ? o.value(...h) : (r(), new Promise(async (f) => {
|
|
1465
|
-
h[0]?.immediate ? f(await o.value(...h)) :
|
|
1453
|
+
h[0]?.immediate ? f(await o.value(...h)) : n.value = setTimeout(async () => {
|
|
1466
1454
|
f(await o.value(...h));
|
|
1467
1455
|
}, l.value);
|
|
1468
1456
|
}));
|
|
1469
1457
|
}
|
|
1470
|
-
return
|
|
1458
|
+
return ol(r), {
|
|
1471
1459
|
cancel: r,
|
|
1472
1460
|
run: s
|
|
1473
1461
|
};
|
|
1474
1462
|
}
|
|
1475
1463
|
function ma(e) {
|
|
1476
|
-
const
|
|
1464
|
+
const a = T(() => e.rowKey), l = T(() => e.polling), n = T(() => e.debounceTime), o = T(() => e.dataSource), r = T(() => e.autoRequest);
|
|
1477
1465
|
return {
|
|
1478
|
-
rowKey:
|
|
1466
|
+
rowKey: a,
|
|
1479
1467
|
polling: l,
|
|
1480
1468
|
request: e.request,
|
|
1481
1469
|
postData: e.postData,
|
|
1482
|
-
debounceTime:
|
|
1470
|
+
debounceTime: n,
|
|
1483
1471
|
dataSource: o,
|
|
1484
1472
|
autoRequest: r
|
|
1485
1473
|
};
|
|
1486
1474
|
}
|
|
1487
|
-
function ha({ rowKey: e, autoRequest:
|
|
1488
|
-
const
|
|
1489
|
-
(
|
|
1490
|
-
},
|
|
1475
|
+
function ha({ rowKey: e, autoRequest: a, polling: l, request: n, postData: o, dataSource: r, waitRequest: s, debounceTime: h }, { params: f, columns: $, setLoading: v, setColumns: w, removeRowKeys: m, syncSelectedRows: u, defaultFormSearch: S, setPagination: g, pageInfo: O, onRequestError: H, onBeforeSearchSubmit: B, hasCustomRender: E }, F) {
|
|
1476
|
+
const Y = x(""), V = x(!1), L = x(!1), N = x([]), k = x(), z = x(null), j = (t = !1) => {
|
|
1477
|
+
(V.value || t) && v(!1), de(!1);
|
|
1478
|
+
}, M = async (t = {}) => {
|
|
1491
1479
|
const { pagination: i = {}, filters: y = {}, sorter: b = {}, removeKeys: C = [], isPolling: c = !1, extra: fe } = t;
|
|
1492
|
-
if (!
|
|
1480
|
+
if (!n || !Ne(n))
|
|
1493
1481
|
return r.value || [];
|
|
1494
|
-
c ? de(!0) :
|
|
1482
|
+
c ? de(!0) : v(!0), i && g(i);
|
|
1495
1483
|
try {
|
|
1496
|
-
C.length &&
|
|
1484
|
+
C.length && m(C);
|
|
1497
1485
|
const U = ne(b) ? Object.keys(b).length ? [b] : [] : b;
|
|
1498
|
-
w(
|
|
1499
|
-
const
|
|
1486
|
+
w(R($).map((Se) => {
|
|
1487
|
+
const Te = U.find((ie) => (ie?.columnKey || ie?.field) === Se.dataIndex);
|
|
1500
1488
|
return {
|
|
1501
1489
|
...Se,
|
|
1502
|
-
sortOrder:
|
|
1490
|
+
sortOrder: Te?.order
|
|
1503
1491
|
};
|
|
1504
1492
|
}));
|
|
1505
1493
|
let Fe = {
|
|
1506
|
-
...ce(
|
|
1507
|
-
current:
|
|
1508
|
-
...
|
|
1509
|
-
...
|
|
1494
|
+
...ce(O),
|
|
1495
|
+
current: dl(ce(O), C.length),
|
|
1496
|
+
...R(S),
|
|
1497
|
+
...R(f),
|
|
1510
1498
|
...t.params
|
|
1511
1499
|
};
|
|
1512
|
-
|
|
1500
|
+
B && Ne(B) && (Fe = await B({
|
|
1513
1501
|
params: Fe,
|
|
1514
1502
|
sorter: U,
|
|
1515
1503
|
filter: y,
|
|
1516
1504
|
extra: fe
|
|
1517
1505
|
}));
|
|
1518
1506
|
let ve = [];
|
|
1519
|
-
const ue = `table_request_${
|
|
1520
|
-
|
|
1521
|
-
const Ie = await
|
|
1507
|
+
const ue = `table_request_${$t().uuid(10)}`;
|
|
1508
|
+
Y.value = ue;
|
|
1509
|
+
const Ie = await n?.({
|
|
1522
1510
|
params: ee(ce(Fe)),
|
|
1523
1511
|
sorter: U,
|
|
1524
1512
|
filter: y,
|
|
1525
1513
|
extra: fe
|
|
1526
1514
|
});
|
|
1527
|
-
if (
|
|
1515
|
+
if (Y.value !== ue)
|
|
1528
1516
|
return [];
|
|
1529
1517
|
if (Ie) {
|
|
1530
|
-
const { success: Se = !0, data:
|
|
1518
|
+
const { success: Se = !0, data: Te = [] } = Ie;
|
|
1531
1519
|
if (!Se)
|
|
1532
1520
|
return [];
|
|
1533
|
-
ve = typeof o == "function" ? await o?.(
|
|
1521
|
+
ve = typeof o == "function" ? await o?.(Te) : Te, u(ve);
|
|
1534
1522
|
const ie = Ie.total || ve?.length || 0;
|
|
1535
|
-
ie !==
|
|
1523
|
+
ie !== O.total && g({
|
|
1536
1524
|
total: ie
|
|
1537
1525
|
});
|
|
1538
|
-
const
|
|
1539
|
-
return
|
|
1526
|
+
const Ke = R(N).map((ke) => ze(ke, "sortIndex"));
|
|
1527
|
+
return Me(ve, Ke) ? R(N) : (oe(ve), ve);
|
|
1540
1528
|
} else
|
|
1541
1529
|
return [];
|
|
1542
1530
|
} catch (U) {
|
|
1543
|
-
if (
|
|
1531
|
+
if (H === void 0)
|
|
1544
1532
|
throw new Error(U);
|
|
1545
|
-
|
|
1533
|
+
N.value === void 0 && oe([]), H(U);
|
|
1546
1534
|
} finally {
|
|
1547
|
-
|
|
1535
|
+
j(!0);
|
|
1548
1536
|
}
|
|
1549
1537
|
return [];
|
|
1550
|
-
},
|
|
1551
|
-
if (
|
|
1538
|
+
}, q = va(async (t = {}) => {
|
|
1539
|
+
if (k.value && clearTimeout(k.value), !n)
|
|
1552
1540
|
return;
|
|
1553
1541
|
const i = new AbortController();
|
|
1554
1542
|
z.value = i;
|
|
1555
1543
|
try {
|
|
1556
1544
|
const y = await Promise.race([
|
|
1557
|
-
|
|
1545
|
+
M(t),
|
|
1558
1546
|
new Promise((C, c) => {
|
|
1559
1547
|
z.value?.signal?.addEventListener?.("abort", () => {
|
|
1560
|
-
c("aborted"),
|
|
1548
|
+
c("aborted"), q.cancel(), j();
|
|
1561
1549
|
});
|
|
1562
1550
|
})
|
|
1563
1551
|
]);
|
|
1564
1552
|
if (i.signal.aborted)
|
|
1565
1553
|
return;
|
|
1566
|
-
const b =
|
|
1567
|
-
return b && !
|
|
1568
|
-
|
|
1554
|
+
const b = ul(l.value, y);
|
|
1555
|
+
return b && !V.value && (k.value = setTimeout(() => {
|
|
1556
|
+
q.run({ ...t, isPolling: b });
|
|
1569
1557
|
}, Math.max(b, 2e3))), y;
|
|
1570
1558
|
} catch (y) {
|
|
1571
1559
|
if (y === "aborted")
|
|
@@ -1573,47 +1561,47 @@ function ha({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1573
1561
|
throw y;
|
|
1574
1562
|
}
|
|
1575
1563
|
}, h.value || 30), te = () => {
|
|
1576
|
-
z.value?.abort(),
|
|
1564
|
+
z.value?.abort(), q.cancel(), j();
|
|
1577
1565
|
};
|
|
1578
|
-
|
|
1579
|
-
|
|
1566
|
+
at(() => {
|
|
1567
|
+
V.value = !1;
|
|
1568
|
+
}), pt(() => {
|
|
1569
|
+
V.value = !1;
|
|
1580
1570
|
}), yt(() => {
|
|
1581
|
-
|
|
1571
|
+
te(), V.value = !0, clearTimeout(k.value);
|
|
1582
1572
|
}), Ct(() => {
|
|
1583
|
-
te(),
|
|
1584
|
-
}),
|
|
1585
|
-
|
|
1586
|
-
}),
|
|
1587
|
-
s.value
|
|
1588
|
-
}, { immediate: !0 }),
|
|
1589
|
-
s.value ? m(!0) : W.run({ isPolling: !1 });
|
|
1590
|
-
}, { immediate: !0 }), Y(() => r.value, () => {
|
|
1573
|
+
te(), V.value = !0, clearTimeout(k.value);
|
|
1574
|
+
}), K(() => l.value, () => {
|
|
1575
|
+
s.value || (l.value ? q.run({ isPolling: !0 }) : clearTimeout(k.value));
|
|
1576
|
+
}, { immediate: !0 }), K(() => s.value, () => {
|
|
1577
|
+
s.value ? v(!0) : q.run({ isPolling: !1 });
|
|
1578
|
+
}, { immediate: !0 }), K(() => r.value, () => {
|
|
1591
1579
|
r.value && oe(r.value || []);
|
|
1592
|
-
}, { deep: !0, immediate: !0 }),
|
|
1593
|
-
s.value ||
|
|
1594
|
-
}, { deep: !0, immediate: !0 }),
|
|
1595
|
-
s.value ||
|
|
1580
|
+
}, { deep: !0, immediate: !0 }), K(() => f.value, () => {
|
|
1581
|
+
s.value || a.value && (g({ current: 1 }), se());
|
|
1582
|
+
}, { deep: !0, immediate: !0 }), K(() => S.value, (t, i) => {
|
|
1583
|
+
s.value || Me(t, i) || (g({ current: 1 }), se());
|
|
1596
1584
|
}, { deep: !0, immediate: !0 });
|
|
1597
1585
|
function se() {
|
|
1598
|
-
|
|
1586
|
+
n ? l.value || (te(), q.run({ isPolling: !1 })) : oe(r.value || []);
|
|
1599
1587
|
}
|
|
1600
|
-
const re =
|
|
1601
|
-
if (
|
|
1602
|
-
return
|
|
1588
|
+
const re = T(() => {
|
|
1589
|
+
if (E.value)
|
|
1590
|
+
return R(N);
|
|
1603
1591
|
const t = $.value.filter((i) => i.show || i.show === void 0);
|
|
1604
|
-
return !
|
|
1605
|
-
}), be =
|
|
1592
|
+
return !R(N) || !t || t.length === 0 ? [] : R(N);
|
|
1593
|
+
}), be = T(() => R(N).some((t) => J(t.children) && t.children.length > 0));
|
|
1606
1594
|
function de(t) {
|
|
1607
|
-
|
|
1595
|
+
L.value = t;
|
|
1608
1596
|
}
|
|
1609
1597
|
function Re(t, i = {}, y = {}, b) {
|
|
1610
|
-
te(),
|
|
1598
|
+
te(), q.run({ pagination: t, filters: i, sorter: y, extra: b, isPolling: !1 });
|
|
1611
1599
|
}
|
|
1612
1600
|
function oe(t) {
|
|
1613
|
-
const i =
|
|
1614
|
-
if (
|
|
1601
|
+
const i = cl(ee(t), ce(O));
|
|
1602
|
+
if (N.value = i, !n || !Ne(n)) {
|
|
1615
1603
|
const y = i.length || 0;
|
|
1616
|
-
y !==
|
|
1604
|
+
y !== O.total && g({
|
|
1617
1605
|
total: y
|
|
1618
1606
|
});
|
|
1619
1607
|
}
|
|
@@ -1626,39 +1614,39 @@ function ha({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, da
|
|
|
1626
1614
|
const { key: i, row: y, value: b, type: C = "update" } = t, c = i ?? e.value, fe = y?.[c] ?? b;
|
|
1627
1615
|
switch (!y && C !== "delete" && console.warn("row is required"), C) {
|
|
1628
1616
|
case "update":
|
|
1629
|
-
c && fe && y && (
|
|
1617
|
+
c && fe && y && (N.value = N.value.map((U) => fe === U[c] ? ye(U, y) : U));
|
|
1630
1618
|
break;
|
|
1631
1619
|
case "push":
|
|
1632
|
-
y &&
|
|
1620
|
+
y && N.value.push(y);
|
|
1633
1621
|
break;
|
|
1634
1622
|
case "unshift":
|
|
1635
|
-
y &&
|
|
1623
|
+
y && N.value.unshift(y);
|
|
1636
1624
|
break;
|
|
1637
1625
|
case "delete":
|
|
1638
|
-
c && (
|
|
1626
|
+
c && (N.value = N.value.filter((U) => b !== U[c]));
|
|
1639
1627
|
break;
|
|
1640
1628
|
}
|
|
1641
1629
|
},
|
|
1642
1630
|
handleTableChange: Re,
|
|
1643
1631
|
run: async (t) => {
|
|
1644
|
-
s.value || (
|
|
1632
|
+
s.value || (n ? await q.run({ ...t, isPolling: !1 }) : F("reload"));
|
|
1645
1633
|
}
|
|
1646
1634
|
};
|
|
1647
1635
|
}
|
|
1648
1636
|
function ga(e) {
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
|
|
1637
|
+
const a = x(l(e.loading.value));
|
|
1638
|
+
K(() => e.loading.value, (o) => {
|
|
1639
|
+
a.value = l(o, a.value);
|
|
1652
1640
|
});
|
|
1653
1641
|
function l(o, r = !1) {
|
|
1654
|
-
return
|
|
1642
|
+
return De(o) ? o : ne(o) ? o?.spinning ?? r : r;
|
|
1655
1643
|
}
|
|
1656
|
-
function
|
|
1657
|
-
|
|
1644
|
+
function n(o) {
|
|
1645
|
+
a.value = o;
|
|
1658
1646
|
}
|
|
1659
|
-
return [
|
|
1647
|
+
return [a, n];
|
|
1660
1648
|
}
|
|
1661
|
-
const
|
|
1649
|
+
const Ye = {
|
|
1662
1650
|
current: 1,
|
|
1663
1651
|
pageSize: 10,
|
|
1664
1652
|
size: "default",
|
|
@@ -1668,115 +1656,115 @@ const Me = {
|
|
|
1668
1656
|
};
|
|
1669
1657
|
function ba({
|
|
1670
1658
|
pagination: e,
|
|
1671
|
-
pageItemRender:
|
|
1659
|
+
pageItemRender: a
|
|
1672
1660
|
}) {
|
|
1673
|
-
const l =
|
|
1674
|
-
...
|
|
1675
|
-
}),
|
|
1676
|
-
current:
|
|
1677
|
-
pageSize:
|
|
1661
|
+
const l = x({
|
|
1662
|
+
...Ye
|
|
1663
|
+
}), n = lt({
|
|
1664
|
+
current: Ye.current,
|
|
1665
|
+
pageSize: Ye.pageSize,
|
|
1678
1666
|
total: 0
|
|
1679
1667
|
});
|
|
1680
|
-
|
|
1668
|
+
K(() => e.value, () => {
|
|
1681
1669
|
if (e.value === !1) {
|
|
1682
1670
|
l.value = !1;
|
|
1683
1671
|
return;
|
|
1684
1672
|
}
|
|
1685
|
-
const r =
|
|
1673
|
+
const r = Ne(a) ? {
|
|
1686
1674
|
itemRender: ({
|
|
1687
1675
|
page: h,
|
|
1688
1676
|
type: f,
|
|
1689
1677
|
originalElement: $
|
|
1690
|
-
}) =>
|
|
1678
|
+
}) => a ? a({
|
|
1691
1679
|
page: h,
|
|
1692
1680
|
type: f,
|
|
1693
1681
|
originalElement: $
|
|
1694
1682
|
}) : null
|
|
1695
1683
|
} : null, s = {
|
|
1696
|
-
...
|
|
1684
|
+
...Ye,
|
|
1697
1685
|
...e.value || {},
|
|
1698
1686
|
...r || {}
|
|
1699
1687
|
};
|
|
1700
|
-
e.value?.showTotal || (s.showTotal = (h) => `共${h < s.pageSize ? 1 : Math.ceil(h / (s.pageSize || 10))}页 ${h}条记录`), l.value = ee(s),
|
|
1701
|
-
Ce(s[h]) && (
|
|
1688
|
+
e.value?.showTotal || (s.showTotal = (h) => `共${h < s.pageSize ? 1 : Math.ceil(h / (s.pageSize || 10))}页 ${h}条记录`), l.value = ee(s), fl(n, (h) => {
|
|
1689
|
+
Ce(s[h]) && (n[h] = s[h]);
|
|
1702
1690
|
});
|
|
1703
1691
|
}, {
|
|
1704
1692
|
deep: 1,
|
|
1705
1693
|
immediate: !0
|
|
1706
1694
|
});
|
|
1707
1695
|
function o(r) {
|
|
1708
|
-
l.value = ye(
|
|
1709
|
-
for (const s in
|
|
1710
|
-
r[s] && Ce(r[s]) && (
|
|
1696
|
+
l.value = ye(R(l), r);
|
|
1697
|
+
for (const s in n)
|
|
1698
|
+
r[s] && Ce(r[s]) && (n[s] = r[s]);
|
|
1711
1699
|
}
|
|
1712
1700
|
return {
|
|
1713
1701
|
paginationInfo: l,
|
|
1714
|
-
requestPagination:
|
|
1702
|
+
requestPagination: n,
|
|
1715
1703
|
setPagination: o
|
|
1716
1704
|
};
|
|
1717
1705
|
}
|
|
1718
|
-
function pa(e,
|
|
1719
|
-
const l =
|
|
1720
|
-
|
|
1721
|
-
|
|
1706
|
+
function pa(e, a) {
|
|
1707
|
+
const l = x([]), n = x([]);
|
|
1708
|
+
K(() => a.value?.selectedRows, (v) => {
|
|
1709
|
+
n.value = ee(v || []);
|
|
1722
1710
|
}, {
|
|
1723
1711
|
deep: !0,
|
|
1724
1712
|
immediate: !0
|
|
1725
|
-
}),
|
|
1726
|
-
l.value =
|
|
1713
|
+
}), K(() => a.value?.selectedRowKeys, (v) => {
|
|
1714
|
+
l.value = vl([...v || []]);
|
|
1727
1715
|
}, {
|
|
1728
1716
|
deep: !0,
|
|
1729
1717
|
immediate: !0
|
|
1730
1718
|
});
|
|
1731
|
-
const o = (
|
|
1732
|
-
const
|
|
1733
|
-
e.value && (w ?
|
|
1719
|
+
const o = (v, w) => {
|
|
1720
|
+
const m = a.value?.type || "checkbox";
|
|
1721
|
+
e.value && (w ? v?.[e.value] && m === "checkbox" ? (l.value.push(v[e.value]), n.value.push(v)) : (l.value = [v[e.value]], n.value = [v]) : (l.value = l.value.filter((u) => u !== v[e.value]), n.value = n.value.filter((u) => u[e.value] !== v[e.value])));
|
|
1734
1722
|
}, r = () => {
|
|
1735
|
-
|
|
1723
|
+
a.value && a.value?.onChange?.(l.value, n.value);
|
|
1736
1724
|
};
|
|
1737
1725
|
return {
|
|
1738
1726
|
selectedKeys: l,
|
|
1739
|
-
selectedItems:
|
|
1727
|
+
selectedItems: n,
|
|
1740
1728
|
selectRowKey: o,
|
|
1741
|
-
selectAllRowKey: (
|
|
1742
|
-
e.value && (
|
|
1729
|
+
selectAllRowKey: (v, w, m) => {
|
|
1730
|
+
e.value && (v ? w.map((u) => (l.value.every((S) => S !== u?.[e.value]) && u?.[e.value] && (l.value.push(u[e.value]), n.value.push(u)), u)) : m.map((u) => (l.value.includes(u?.[e.value]) && (l.value = l.value.filter((S) => S !== u[e.value]), n.value = n.value.filter((S) => S[e.value] !== u[e.value])), u)));
|
|
1743
1731
|
},
|
|
1744
|
-
removeRowKeys: (
|
|
1745
|
-
l.value = l.value.filter((w) => !
|
|
1732
|
+
removeRowKeys: (v) => {
|
|
1733
|
+
l.value = l.value.filter((w) => !v.includes(w)), n.value = n.value.filter((w) => !v.includes(w?.[e.value || ""])), r();
|
|
1746
1734
|
},
|
|
1747
1735
|
changeRowKey: r,
|
|
1748
|
-
syncSelectedRows: (
|
|
1749
|
-
if (e.value && l.value.length !==
|
|
1750
|
-
const w =
|
|
1751
|
-
|
|
1752
|
-
|
|
1736
|
+
syncSelectedRows: (v) => {
|
|
1737
|
+
if (e.value && l.value.length !== n.value.length) {
|
|
1738
|
+
const w = n.value.map((u) => u[e.value]), m = l.value.filter((u) => !w.includes(u));
|
|
1739
|
+
v.forEach((u) => {
|
|
1740
|
+
m.includes(u[e.value]) && n.value.push(ee(u));
|
|
1753
1741
|
});
|
|
1754
1742
|
}
|
|
1755
1743
|
},
|
|
1756
1744
|
clearAllRowKeys: () => {
|
|
1757
|
-
l.value = [],
|
|
1745
|
+
l.value = [], n.value = [], r();
|
|
1758
1746
|
}
|
|
1759
1747
|
};
|
|
1760
1748
|
}
|
|
1761
1749
|
function ya(e) {
|
|
1762
1750
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ae(e);
|
|
1763
1751
|
}
|
|
1764
|
-
function Ca(e,
|
|
1765
|
-
if (!
|
|
1752
|
+
function Ca(e, a, l, n) {
|
|
1753
|
+
if (!a) return e;
|
|
1766
1754
|
let o = e;
|
|
1767
|
-
if (ne(
|
|
1768
|
-
const r =
|
|
1769
|
-
return d(r, Q(
|
|
1770
|
-
class:
|
|
1771
|
-
onClick:
|
|
1755
|
+
if (ne(a)) {
|
|
1756
|
+
const r = a.node === "a" ? "span" : a.node;
|
|
1757
|
+
return d(r, Q(a?.attr || {}, {
|
|
1758
|
+
class: a.class,
|
|
1759
|
+
onClick: a.click
|
|
1772
1760
|
}), ya(e) ? e : {
|
|
1773
1761
|
default: () => [e]
|
|
1774
1762
|
});
|
|
1775
1763
|
}
|
|
1776
|
-
switch (
|
|
1764
|
+
switch (a) {
|
|
1777
1765
|
case "link":
|
|
1778
1766
|
o = d("span", {
|
|
1779
|
-
class: [`${l}-a`,
|
|
1767
|
+
class: [`${l}-a`, n]
|
|
1780
1768
|
}, [e]);
|
|
1781
1769
|
break;
|
|
1782
1770
|
case "time":
|
|
@@ -1794,153 +1782,153 @@ function Ca(e, n, l, a) {
|
|
|
1794
1782
|
}
|
|
1795
1783
|
return o;
|
|
1796
1784
|
}
|
|
1797
|
-
function Sa(e,
|
|
1798
|
-
const l =
|
|
1799
|
-
return e.filter((o, r) => r < l *
|
|
1785
|
+
function Sa(e, a) {
|
|
1786
|
+
const l = a && a.current || 1, n = a && a.pageSize || 10;
|
|
1787
|
+
return e.filter((o, r) => r < l * n && r >= n * (l - 1));
|
|
1800
1788
|
}
|
|
1801
|
-
function
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1789
|
+
function Ta(e) {
|
|
1790
|
+
const a = document.createElement("textarea");
|
|
1791
|
+
a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
|
|
1804
1792
|
}
|
|
1805
|
-
function Ae(e,
|
|
1806
|
-
let l = null,
|
|
1793
|
+
function Ae(e, a) {
|
|
1794
|
+
let l = null, n = null;
|
|
1807
1795
|
function o() {
|
|
1808
|
-
l && l.disconnect(),
|
|
1796
|
+
l && l.disconnect(), n && n.disconnect();
|
|
1809
1797
|
}
|
|
1810
1798
|
function r(f) {
|
|
1811
1799
|
f && (l = new ResizeObserver(() => {
|
|
1812
|
-
|
|
1813
|
-
}), l.observe(f),
|
|
1800
|
+
a(f);
|
|
1801
|
+
}), l.observe(f), a(f));
|
|
1814
1802
|
}
|
|
1815
1803
|
function s() {
|
|
1816
1804
|
return typeof e == "string" ? document.querySelector(e) : e();
|
|
1817
1805
|
}
|
|
1818
1806
|
const h = s();
|
|
1819
|
-
return h ? (r(h), o) : (
|
|
1807
|
+
return h ? (r(h), o) : (n = new MutationObserver(() => {
|
|
1820
1808
|
const f = s();
|
|
1821
|
-
f && (
|
|
1822
|
-
}),
|
|
1809
|
+
f && (n.disconnect(), r(f));
|
|
1810
|
+
}), n.observe(document.body, {
|
|
1823
1811
|
childList: !0,
|
|
1824
1812
|
subtree: !0
|
|
1825
1813
|
}), o);
|
|
1826
1814
|
}
|
|
1827
|
-
function
|
|
1828
|
-
const o =
|
|
1829
|
-
let w,
|
|
1830
|
-
|
|
1831
|
-
w = Ae(() => r.value?.querySelector(".ant-pagination"), (
|
|
1832
|
-
|
|
1833
|
-
}), u = Ae(() => r.value?.querySelector(".ant-table-header"), (
|
|
1834
|
-
|
|
1835
|
-
}), S = Ae(() => r.value?.querySelector(".ant-table-body>table"), (
|
|
1836
|
-
|
|
1815
|
+
function xa({ fitPage: e, hashId: a, scroll: l, baseClassName: n }) {
|
|
1816
|
+
const o = x(), r = x(), s = x(), h = x(), f = x(), $ = x(), v = x(0);
|
|
1817
|
+
let w, m, u, S;
|
|
1818
|
+
il(() => {
|
|
1819
|
+
w = Ae(() => r.value?.querySelector(".ant-pagination"), (L) => {
|
|
1820
|
+
L && (s.value = L);
|
|
1821
|
+
}), u = Ae(() => r.value?.querySelector(".ant-table-header"), (L) => {
|
|
1822
|
+
L && (h.value = L);
|
|
1823
|
+
}), S = Ae(() => r.value?.querySelector(".ant-table-body>table"), (L) => {
|
|
1824
|
+
L && ($.value = L);
|
|
1837
1825
|
});
|
|
1838
|
-
}),
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
}) :
|
|
1842
|
-
|
|
1826
|
+
}), K(() => l.value, (L) => {
|
|
1827
|
+
m && m(), L.y || e.value ? m = Ae(() => r.value?.querySelector(".ant-table-body"), (N) => {
|
|
1828
|
+
N && (f.value = N);
|
|
1829
|
+
}) : L.x && (m = Ae(() => r.value?.querySelector(".ant-table-content"), (N) => {
|
|
1830
|
+
N && (f.value = N);
|
|
1843
1831
|
}));
|
|
1844
1832
|
}, { immediate: !0 });
|
|
1845
|
-
const { height: g } =
|
|
1833
|
+
const { height: g } = He(r), { height: O } = He(h), { height: H } = He($), { height: B } = He(s), E = T(() => {
|
|
1846
1834
|
if (!r.value || !e.value)
|
|
1847
1835
|
return 0;
|
|
1848
|
-
let
|
|
1836
|
+
let L = 0;
|
|
1849
1837
|
if (s.value) {
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1838
|
+
const k = getComputedStyle(s.value), z = Number.parseFloat(k.marginTop) || 0, j = Number.parseFloat(k.marginBottom) || 0;
|
|
1839
|
+
L = z + j;
|
|
1852
1840
|
}
|
|
1853
|
-
return g.value -
|
|
1854
|
-
}),
|
|
1855
|
-
|
|
1841
|
+
return g.value - O.value - v.value - (B.value + L);
|
|
1842
|
+
}), F = T(() => E.value && e.value ? H.value <= E.value : !1);
|
|
1843
|
+
K([
|
|
1856
1844
|
() => f.value,
|
|
1857
|
-
() =>
|
|
1845
|
+
() => E.value
|
|
1858
1846
|
], () => {
|
|
1859
|
-
f.value && e.value && f.value.setAttribute("style", `height: ${
|
|
1847
|
+
f.value && e.value && f.value.setAttribute("style", `height: ${E.value}px;`);
|
|
1860
1848
|
}), wl(f, {
|
|
1861
1849
|
onScroll: () => {
|
|
1862
1850
|
f.value && o.value?.handleScroll(f.value);
|
|
1863
1851
|
}
|
|
1864
1852
|
});
|
|
1865
|
-
const
|
|
1853
|
+
const Y = () => {
|
|
1866
1854
|
o.value?.update();
|
|
1867
1855
|
};
|
|
1868
|
-
$l(f,
|
|
1869
|
-
|
|
1870
|
-
|
|
1856
|
+
$l(f, Y), at(() => {
|
|
1857
|
+
nt(() => {
|
|
1858
|
+
Y();
|
|
1871
1859
|
});
|
|
1872
|
-
}),
|
|
1873
|
-
function
|
|
1874
|
-
w && w(),
|
|
1860
|
+
}), Gt(() => Y());
|
|
1861
|
+
function V() {
|
|
1862
|
+
w && w(), m && m(), u && u(), S && S();
|
|
1875
1863
|
}
|
|
1876
|
-
return
|
|
1877
|
-
|
|
1878
|
-
}),
|
|
1879
|
-
|
|
1864
|
+
return yt(() => {
|
|
1865
|
+
V();
|
|
1866
|
+
}), Ct(() => {
|
|
1867
|
+
V && V();
|
|
1880
1868
|
}), Jl({
|
|
1881
|
-
className: `${
|
|
1882
|
-
hashId:
|
|
1883
|
-
tableScrollYHeight:
|
|
1884
|
-
tableHeaderHeight:
|
|
1869
|
+
className: `${n}-scroll`,
|
|
1870
|
+
hashId: a,
|
|
1871
|
+
tableScrollYHeight: E,
|
|
1872
|
+
tableHeaderHeight: O,
|
|
1885
1873
|
scrollbarElement: r,
|
|
1886
1874
|
wrapElement: f
|
|
1887
1875
|
}), {
|
|
1888
1876
|
barRef: o,
|
|
1889
1877
|
tableCardEl: r,
|
|
1890
1878
|
tableScrollEl: f,
|
|
1891
|
-
tableOverHidden:
|
|
1892
|
-
tableScrollYHeight:
|
|
1893
|
-
tableListToolsHeight:
|
|
1879
|
+
tableOverHidden: F,
|
|
1880
|
+
tableScrollYHeight: E,
|
|
1881
|
+
tableListToolsHeight: v
|
|
1894
1882
|
};
|
|
1895
1883
|
}
|
|
1896
1884
|
function wa(e) {
|
|
1897
|
-
const
|
|
1885
|
+
const a = {};
|
|
1898
1886
|
return e.forEach((l) => {
|
|
1899
|
-
let
|
|
1887
|
+
let n = l.initialValue;
|
|
1900
1888
|
const o = ["select", "number"], r = ["date", "time", "dateRange"], s = ["treeSelect", "numberRange"];
|
|
1901
|
-
l.valueType ? !
|
|
1902
|
-
}),
|
|
1889
|
+
l.valueType ? !n && o.includes(l.valueType) ? n = void 0 : !n && r.includes(l.valueType) ? n = null : !n && s.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);
|
|
1890
|
+
}), a;
|
|
1903
1891
|
}
|
|
1904
|
-
function $a({ searchMap: e, columns:
|
|
1905
|
-
const l =
|
|
1892
|
+
function $a({ searchMap: e, columns: a }) {
|
|
1893
|
+
const l = x([]), n = x({});
|
|
1906
1894
|
function o(r) {
|
|
1907
1895
|
r.forEach((h) => {
|
|
1908
1896
|
l.value.some((f) => f.name === h.name) ? l.value = l.value.map((f) => f.name === h.name ? { ...f, ...h } : f) : l.value.push(h);
|
|
1909
1897
|
});
|
|
1910
1898
|
const s = wa(r);
|
|
1911
|
-
|
|
1899
|
+
n.value = { ...n.value, ...s };
|
|
1912
1900
|
}
|
|
1913
|
-
return
|
|
1901
|
+
return K(() => e.value, () => {
|
|
1914
1902
|
const r = [];
|
|
1915
1903
|
e.value?.forEach((s) => r.push(s)), o(r);
|
|
1916
|
-
}, { deep: !0, immediate: !0 }),
|
|
1904
|
+
}, { deep: !0, immediate: !0 }), K(() => a.value, () => {
|
|
1917
1905
|
const r = [];
|
|
1918
|
-
|
|
1906
|
+
a.value && a.value?.length && a.value.forEach((s) => {
|
|
1919
1907
|
s.searchConfig && r.push(s.searchConfig);
|
|
1920
1908
|
}), o(r);
|
|
1921
|
-
}, { deep: !0, immediate: !0 }), { formCols: l, defaultFormSearch:
|
|
1909
|
+
}, { deep: !0, immediate: !0 }), { formCols: l, defaultFormSearch: n };
|
|
1922
1910
|
}
|
|
1923
|
-
function Ra({ scroll: e, columns:
|
|
1924
|
-
const $ =
|
|
1925
|
-
let
|
|
1926
|
-
const u =
|
|
1927
|
-
g.forEach((
|
|
1928
|
-
|
|
1911
|
+
function Ra({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: o, rowSelection: r, screens: s, innerWidth: h, scrollBreakpoint: f }) {
|
|
1912
|
+
const $ = T(() => f.value ? Ce(f.value) ? h.value > f.value : Rt(f.value) ? s.value?.[f.value] : s.value?.xl : s.value?.xl), v = T(() => {
|
|
1913
|
+
let m = 0;
|
|
1914
|
+
const u = R(r) ? 60 : 0, S = 150, g = ee(R(a));
|
|
1915
|
+
g.forEach((B) => {
|
|
1916
|
+
m += Number.parseInt(String(B.width)) || 0;
|
|
1929
1917
|
});
|
|
1930
|
-
const
|
|
1931
|
-
return
|
|
1918
|
+
const H = g.filter((B) => !Reflect.has(B, "width")).length;
|
|
1919
|
+
return H !== 0 && (m += H * S), u && (m += u), m;
|
|
1932
1920
|
});
|
|
1933
|
-
return { proScroll:
|
|
1921
|
+
return { proScroll: T(() => o.value ? {} : e.value && wt(e.value).length ? R(e) : n.value ? {
|
|
1934
1922
|
y: e.value?.y || (s.value?.xl ? 400 : 235)
|
|
1935
|
-
} : l.value ? $.value ? {} :
|
|
1923
|
+
} : l.value ? $.value ? {} : De($.value) ? { x: v.value } : {} : {}), breakpoint: $ };
|
|
1936
1924
|
}
|
|
1937
1925
|
function Pa(e) {
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
function l(
|
|
1941
|
-
|
|
1926
|
+
const a = x(e.size.value || "middle");
|
|
1927
|
+
K(() => e.size.value, (n) => a.value = n);
|
|
1928
|
+
function l(n) {
|
|
1929
|
+
a.value = n || a.value;
|
|
1942
1930
|
}
|
|
1943
|
-
return [
|
|
1931
|
+
return [a, l];
|
|
1944
1932
|
}
|
|
1945
1933
|
const Fa = (e) => ({
|
|
1946
1934
|
[e.componentCls]: {
|
|
@@ -1969,14 +1957,14 @@ const Fa = (e) => ({
|
|
|
1969
1957
|
}
|
|
1970
1958
|
}
|
|
1971
1959
|
}
|
|
1972
|
-
}),
|
|
1960
|
+
}), Je = () => ({
|
|
1973
1961
|
scrollbarWidth: "none",
|
|
1974
1962
|
"&::-webkit-scrollbar": {
|
|
1975
1963
|
width: 0,
|
|
1976
1964
|
height: 0
|
|
1977
1965
|
}
|
|
1978
1966
|
}), Ia = (e) => {
|
|
1979
|
-
const
|
|
1967
|
+
const a = new mt(e.colorText).setAlpha(0.2).toRgbString(), l = new mt(e.colorText).setAlpha(0.4).toRgbString();
|
|
1980
1968
|
return {
|
|
1981
1969
|
[e.componentCls]: {
|
|
1982
1970
|
[`${e.antCls}-table-container`]: {
|
|
@@ -2011,7 +1999,7 @@ const Fa = (e) => ({
|
|
|
2011
1999
|
height: 0,
|
|
2012
2000
|
cursor: "pointer",
|
|
2013
2001
|
opacity: 1,
|
|
2014
|
-
backgroundColor:
|
|
2002
|
+
backgroundColor: a,
|
|
2015
2003
|
borderRadius: "inherit",
|
|
2016
2004
|
transition: ".3s background-color",
|
|
2017
2005
|
"&:hover": {
|
|
@@ -2020,15 +2008,15 @@ const Fa = (e) => ({
|
|
|
2020
2008
|
}
|
|
2021
2009
|
}
|
|
2022
2010
|
},
|
|
2023
|
-
[`${e.antCls}-table-content`]:
|
|
2024
|
-
[`${e.antCls}-table-body`]:
|
|
2011
|
+
[`${e.antCls}-table-content`]: Je(),
|
|
2012
|
+
[`${e.antCls}-table-body`]: Je(),
|
|
2025
2013
|
[`${e.antCls}-table-empty`]: {
|
|
2026
|
-
[`${e.antCls}-table-content`]:
|
|
2014
|
+
[`${e.antCls}-table-content`]: Je()
|
|
2027
2015
|
}
|
|
2028
2016
|
}
|
|
2029
2017
|
};
|
|
2030
2018
|
}, Ba = (e) => {
|
|
2031
|
-
const
|
|
2019
|
+
const a = `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`;
|
|
2032
2020
|
return {
|
|
2033
2021
|
[e.componentCls]: {
|
|
2034
2022
|
[`&${e.componentCls}-full-page`]: {
|
|
@@ -2046,9 +2034,9 @@ const Fa = (e) => ({
|
|
|
2046
2034
|
overflow: "hidden",
|
|
2047
2035
|
[`${e.componentCls}-overflow-hidden`]: {
|
|
2048
2036
|
[`${e.antCls}-table${e.antCls}-table-bordered>${e.antCls}-table-container`]: {
|
|
2049
|
-
borderBlockEnd:
|
|
2037
|
+
borderBlockEnd: a,
|
|
2050
2038
|
[`${e.antCls}-table-body`]: {
|
|
2051
|
-
borderInlineEnd:
|
|
2039
|
+
borderInlineEnd: a
|
|
2052
2040
|
},
|
|
2053
2041
|
[`${e.antCls}-table-row`]: {
|
|
2054
2042
|
[`${e.antCls}-table-cell`]: {
|
|
@@ -2239,18 +2227,18 @@ const Fa = (e) => ({
|
|
|
2239
2227
|
function Na(e) {
|
|
2240
2228
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ae(e);
|
|
2241
2229
|
}
|
|
2242
|
-
const za =
|
|
2230
|
+
const za = Bt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, Ze = /* @__PURE__ */ ge({
|
|
2243
2231
|
name: "GProTable",
|
|
2244
2232
|
inheritAttrs: !1,
|
|
2245
2233
|
props: he,
|
|
2246
2234
|
emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
|
|
2247
2235
|
slots: Object,
|
|
2248
2236
|
setup(e, {
|
|
2249
|
-
emit:
|
|
2237
|
+
emit: a,
|
|
2250
2238
|
slots: l,
|
|
2251
|
-
expose:
|
|
2239
|
+
expose: n
|
|
2252
2240
|
}) {
|
|
2253
|
-
const o =
|
|
2241
|
+
const o = ml({
|
|
2254
2242
|
suffixCls: "table",
|
|
2255
2243
|
isPor: !0
|
|
2256
2244
|
}), {
|
|
@@ -2258,14 +2246,14 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2258
2246
|
hashId: s
|
|
2259
2247
|
} = Tt("ProBaseTable", [Aa, Ia, Ba, Fa, Ul], o), {
|
|
2260
2248
|
token: h
|
|
2261
|
-
} = Da(), f =
|
|
2262
|
-
width:
|
|
2263
|
-
} = Rl(), w =
|
|
2264
|
-
|
|
2249
|
+
} = Da(), f = sl(), $ = ot(), {
|
|
2250
|
+
width: v
|
|
2251
|
+
} = Rl(), w = x(!1), m = St(), u = x(), S = x(), g = x(e.waitRequest);
|
|
2252
|
+
bt(() => g.value = e.waitRequest);
|
|
2265
2253
|
const {
|
|
2266
|
-
toggle:
|
|
2267
|
-
isFullscreen:
|
|
2268
|
-
} =
|
|
2254
|
+
toggle: O,
|
|
2255
|
+
isFullscreen: H
|
|
2256
|
+
} = Pt(u), B = T(() => !$.value.xl), E = T(() => (e.virtualScroll && El(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), F = T(() => {
|
|
2269
2257
|
if (e.form === !1) return !1;
|
|
2270
2258
|
const p = {
|
|
2271
2259
|
actions: {
|
|
@@ -2281,26 +2269,26 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2281
2269
|
searchText: "查询"
|
|
2282
2270
|
};
|
|
2283
2271
|
return ne(e.form) ? ye(p, e.form) : p;
|
|
2284
|
-
}),
|
|
2285
|
-
const p = ee(e.columns || []).filter((
|
|
2286
|
-
const I =
|
|
2287
|
-
return
|
|
2272
|
+
}), Y = T(() => F.value === !1 ? {} : F.value), V = T(() => Y.value?.autoRequest ?? e.autoRequest), L = T(() => Y.value?.actions), N = T(() => {
|
|
2273
|
+
const p = ee(e.columns || []).filter((P) => P.key || P.dataIndex).filter((P) => P.show ?? !0).map((P) => {
|
|
2274
|
+
const I = P.key || P.dataIndex;
|
|
2275
|
+
return P.key = I, P.dataIndex = I, P.align = P.align || e.align, P.uuid = P.uuid || $t().uuid(15), P;
|
|
2288
2276
|
});
|
|
2289
2277
|
return hl(p, {
|
|
2290
2278
|
align: e.align || "left",
|
|
2291
2279
|
showIndex: e.showIndex ?? !1
|
|
2292
2280
|
});
|
|
2293
|
-
}), [
|
|
2294
|
-
loading:
|
|
2295
|
-
}), [
|
|
2296
|
-
size:
|
|
2281
|
+
}), [k, z] = ga({
|
|
2282
|
+
loading: X(e, "loading")
|
|
2283
|
+
}), [j, M] = Pa({
|
|
2284
|
+
size: X(e, "size")
|
|
2297
2285
|
}), {
|
|
2298
|
-
paginationInfo:
|
|
2286
|
+
paginationInfo: q,
|
|
2299
2287
|
requestPagination: te,
|
|
2300
2288
|
setPagination: se
|
|
2301
2289
|
} = ba({
|
|
2302
|
-
pagination:
|
|
2303
|
-
pageItemRender:
|
|
2290
|
+
pagination: X(e, "pagination"),
|
|
2291
|
+
pageItemRender: dt({
|
|
2304
2292
|
slots: l,
|
|
2305
2293
|
props: e,
|
|
2306
2294
|
key: "pageItemRender"
|
|
@@ -2309,32 +2297,32 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2309
2297
|
proScroll: re,
|
|
2310
2298
|
breakpoint: be
|
|
2311
2299
|
} = Ra({
|
|
2312
|
-
scroll:
|
|
2313
|
-
autoScroll:
|
|
2314
|
-
modalScroll:
|
|
2315
|
-
neverScroll:
|
|
2316
|
-
rowSelection:
|
|
2317
|
-
scrollBreakpoint:
|
|
2318
|
-
innerWidth:
|
|
2319
|
-
columns:
|
|
2300
|
+
scroll: X(e, "scroll"),
|
|
2301
|
+
autoScroll: X(e, "autoScroll"),
|
|
2302
|
+
modalScroll: X(e, "modalScroll"),
|
|
2303
|
+
neverScroll: X(e, "neverScroll"),
|
|
2304
|
+
rowSelection: X(e, "rowSelection"),
|
|
2305
|
+
scrollBreakpoint: X(e, "scrollBreakpoint"),
|
|
2306
|
+
innerWidth: v,
|
|
2307
|
+
columns: N,
|
|
2320
2308
|
screens: $
|
|
2321
2309
|
}), {
|
|
2322
2310
|
proColumns: de,
|
|
2323
2311
|
setColumns: Re,
|
|
2324
2312
|
resizeColumnWidth: oe
|
|
2325
2313
|
} = fa({
|
|
2326
|
-
draggable:
|
|
2327
|
-
neverScroll:
|
|
2328
|
-
autoScroll:
|
|
2314
|
+
draggable: X(e, "draggable"),
|
|
2315
|
+
neverScroll: X(e, "neverScroll"),
|
|
2316
|
+
autoScroll: X(e, "autoScroll"),
|
|
2329
2317
|
breakpoint: be,
|
|
2330
2318
|
scroll: re,
|
|
2331
|
-
columns:
|
|
2319
|
+
columns: N
|
|
2332
2320
|
}), {
|
|
2333
2321
|
formCols: Pe,
|
|
2334
2322
|
defaultFormSearch: t
|
|
2335
2323
|
} = $a({
|
|
2336
|
-
searchMap:
|
|
2337
|
-
columns:
|
|
2324
|
+
searchMap: X(e, "searchMap"),
|
|
2325
|
+
columns: N
|
|
2338
2326
|
}), {
|
|
2339
2327
|
selectedKeys: i,
|
|
2340
2328
|
selectedItems: y,
|
|
@@ -2344,18 +2332,18 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2344
2332
|
syncSelectedRows: fe,
|
|
2345
2333
|
removeRowKeys: U,
|
|
2346
2334
|
clearAllRowKeys: Fe
|
|
2347
|
-
} = pa(
|
|
2335
|
+
} = pa(X(e, "rowKey"), X(e, "rowSelection")), ve = ma(e), {
|
|
2348
2336
|
run: ue,
|
|
2349
2337
|
setTableDataList: Ie,
|
|
2350
2338
|
operateTableDataRow: Se,
|
|
2351
|
-
isTreeDataRef:
|
|
2339
|
+
isTreeDataRef: Te,
|
|
2352
2340
|
dataSource: ie,
|
|
2353
|
-
handleTableChange:
|
|
2341
|
+
handleTableChange: Ke
|
|
2354
2342
|
} = ha({
|
|
2355
2343
|
...ve,
|
|
2356
2344
|
waitRequest: g
|
|
2357
2345
|
}, {
|
|
2358
|
-
loading:
|
|
2346
|
+
loading: k,
|
|
2359
2347
|
pageInfo: te,
|
|
2360
2348
|
setPagination: se,
|
|
2361
2349
|
removeRowKeys: U,
|
|
@@ -2364,51 +2352,51 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2364
2352
|
setColumns: Re,
|
|
2365
2353
|
columns: de,
|
|
2366
2354
|
defaultFormSearch: t,
|
|
2367
|
-
params:
|
|
2355
|
+
params: X(e, "params"),
|
|
2368
2356
|
onRequestError: e.onRequestError,
|
|
2369
2357
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit,
|
|
2370
|
-
hasCustomRender:
|
|
2371
|
-
},
|
|
2372
|
-
tableCardEl:
|
|
2373
|
-
tableScrollYHeight:
|
|
2374
|
-
tableListToolsHeight:
|
|
2375
|
-
tableScrollEl:
|
|
2376
|
-
tableOverHidden:
|
|
2377
|
-
barRef:
|
|
2378
|
-
} =
|
|
2358
|
+
hasCustomRender: T(() => Ge(e.customRender || l?.customRender))
|
|
2359
|
+
}, a), {
|
|
2360
|
+
tableCardEl: ke,
|
|
2361
|
+
tableScrollYHeight: Oe,
|
|
2362
|
+
tableListToolsHeight: Et,
|
|
2363
|
+
tableScrollEl: it,
|
|
2364
|
+
tableOverHidden: Lt,
|
|
2365
|
+
barRef: jt
|
|
2366
|
+
} = xa({
|
|
2379
2367
|
hashId: s,
|
|
2380
2368
|
scroll: re,
|
|
2381
2369
|
baseClassName: o,
|
|
2382
|
-
fitPage:
|
|
2383
|
-
}),
|
|
2384
|
-
const p =
|
|
2385
|
-
y:
|
|
2370
|
+
fitPage: X(e, "fitPage")
|
|
2371
|
+
}), st = T(() => {
|
|
2372
|
+
const p = Oe.value && e.fitPage ? {
|
|
2373
|
+
y: Oe.value
|
|
2386
2374
|
} : {};
|
|
2387
2375
|
return {
|
|
2388
|
-
...
|
|
2376
|
+
...R(re),
|
|
2389
2377
|
...p
|
|
2390
2378
|
};
|
|
2391
|
-
}),
|
|
2392
|
-
size:
|
|
2393
|
-
scroll:
|
|
2394
|
-
dataSource:
|
|
2395
|
-
pagination:
|
|
2396
|
-
virtualScroll:
|
|
2397
|
-
columns:
|
|
2398
|
-
})),
|
|
2399
|
-
const p = ne(e.loading) ?
|
|
2400
|
-
return !p.indicator &&
|
|
2401
|
-
spinning: e.showLoading ?
|
|
2379
|
+
}), Ht = T(() => ({
|
|
2380
|
+
size: R(j),
|
|
2381
|
+
scroll: R(st),
|
|
2382
|
+
dataSource: R(ie),
|
|
2383
|
+
pagination: R(q),
|
|
2384
|
+
virtualScroll: E.value,
|
|
2385
|
+
columns: R(de).filter((p) => p.show || p.show === void 0)
|
|
2386
|
+
})), rt = T(() => {
|
|
2387
|
+
const p = ne(e.loading) ? ze(e.loading, "spinning") : {};
|
|
2388
|
+
return !p.indicator && m?.indicator?.value && (p.indicator = m?.indicator?.value), {
|
|
2389
|
+
spinning: e.showLoading ? Ge(k.value) : !1,
|
|
2402
2390
|
...p
|
|
2403
2391
|
};
|
|
2404
|
-
}),
|
|
2392
|
+
}), Wt = T(() => {
|
|
2405
2393
|
let p;
|
|
2406
|
-
const
|
|
2394
|
+
const P = e.direction === "rtl" ? "bottomLeft" : "right", I = R(q)?.position;
|
|
2407
2395
|
if (I !== null && Array.isArray(I)) {
|
|
2408
|
-
const D = I.find((le) => le.includes("top")),
|
|
2409
|
-
!D && !
|
|
2396
|
+
const D = I.find((le) => le.includes("top")), W = I.find((le) => le.includes("bottom")), _ = I.every((le) => `${le}` == "none");
|
|
2397
|
+
!D && !W && !_ && (p = P), D && (p = D.toLowerCase().replace("top", "")), W && (p = W.toLowerCase().replace("bottom", ""));
|
|
2410
2398
|
} else
|
|
2411
|
-
p =
|
|
2399
|
+
p = P;
|
|
2412
2400
|
return p;
|
|
2413
2401
|
});
|
|
2414
2402
|
da(() => {
|
|
@@ -2416,127 +2404,128 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2416
2404
|
params: e.params
|
|
2417
2405
|
}) : w.value = !0;
|
|
2418
2406
|
});
|
|
2419
|
-
const
|
|
2420
|
-
if (
|
|
2407
|
+
const Yt = async (p, P) => {
|
|
2408
|
+
if (V.value) {
|
|
2421
2409
|
ue({
|
|
2422
2410
|
params: p
|
|
2423
2411
|
});
|
|
2424
2412
|
return;
|
|
2425
2413
|
}
|
|
2426
|
-
|
|
2414
|
+
P === "reset" ? (a("reset", p), e.request && L.value?.resetReload && ue({
|
|
2427
2415
|
params: p
|
|
2428
|
-
})) : e.request && (
|
|
2416
|
+
})) : e.request && (a("submit", p), ue({
|
|
2429
2417
|
params: p
|
|
2430
2418
|
}));
|
|
2431
|
-
},
|
|
2432
|
-
|
|
2433
|
-
},
|
|
2434
|
-
|
|
2435
|
-
},
|
|
2436
|
-
|
|
2437
|
-
},
|
|
2419
|
+
}, Ve = (p, P, I, D) => {
|
|
2420
|
+
Ke(p, P, I, D), a("change", p, P, I, D);
|
|
2421
|
+
}, Mt = (p) => {
|
|
2422
|
+
a("expandedRowsChange", p);
|
|
2423
|
+
}, qt = (p, P) => {
|
|
2424
|
+
a("expand", p, P);
|
|
2425
|
+
}, Kt = (p, P) => oe(p, P), kt = (p, P, I) => {
|
|
2438
2426
|
let D = p;
|
|
2439
|
-
if (
|
|
2440
|
-
const
|
|
2427
|
+
if (P) {
|
|
2428
|
+
const W = J(p) ? typeof p?.[0]?.children == "string" ? p?.[0]?.children : "" : p ? p.toString() : "", _ = I.tooltip === !1 ? {} : I.tooltip, le = I.tooltip === !1 ? 1 : Ce(_?.hiddenLine) && _?.hiddenLine > 0 ? _?.hiddenLine : 1, G = I.tooltip === !1 ? 0 : Ce(_?.width) ? _?.width : 0, Ee = I.tooltip !== !1 && Rt(W) && G > 0 ? pl(W, {
|
|
2441
2429
|
cssObject: {
|
|
2442
2430
|
fontSize: "14px",
|
|
2443
2431
|
lineHeight: "22px",
|
|
2444
2432
|
fontFamily: f?.token?.value?.fontFamily || h?.value?.fontFamily,
|
|
2445
2433
|
..._?.targetStyle || {}
|
|
2446
2434
|
}
|
|
2447
|
-
}) : 0,
|
|
2435
|
+
}) : 0, Le = document.querySelector(`.${o} .ant-table-tbody`), je = d("div", {
|
|
2448
2436
|
class: `${o}-ellipsis-text`
|
|
2449
|
-
}, [p]),
|
|
2437
|
+
}, [p]), ct = () => I.tooltip === !1 || ne(I.tooltip) && Ee < G && G > 0 ? je : d($e, Q({
|
|
2450
2438
|
title: p,
|
|
2451
|
-
getPopupContainer: (
|
|
2439
|
+
getPopupContainer: (Xe) => Le ?? Xe?.parentNode?.parentNode
|
|
2452
2440
|
}, ne(I.tooltip) ? I.tooltip : {}, {
|
|
2453
2441
|
destroyTooltipOnHide: !0
|
|
2454
|
-
}), Na(
|
|
2455
|
-
default: () => [
|
|
2442
|
+
}), Na(je) ? je : {
|
|
2443
|
+
default: () => [je]
|
|
2456
2444
|
});
|
|
2457
2445
|
if (D = d("div", {
|
|
2458
|
-
class:
|
|
2446
|
+
class: A(`${o}-ellipsis`, _?.class),
|
|
2459
2447
|
style: {
|
|
2460
2448
|
"-webkit-line-clamp": le
|
|
2461
2449
|
}
|
|
2462
|
-
}, [
|
|
2463
|
-
const
|
|
2450
|
+
}, [ct()]), I.copyable) {
|
|
2451
|
+
const Xe = typeof I.copyText == "function" ? I.copyText?.(I) : I.copyText || W;
|
|
2464
2452
|
D = d("div", {
|
|
2465
2453
|
class: `${o}-copyable`
|
|
2466
2454
|
}, [d("div", {
|
|
2467
|
-
class:
|
|
2455
|
+
class: A(`${o}-ellipsis`, _?.class),
|
|
2468
2456
|
style: {
|
|
2469
2457
|
"-webkit-line-clamp": le
|
|
2470
2458
|
}
|
|
2471
|
-
}, [
|
|
2459
|
+
}, [ct()]), d(al, {
|
|
2472
2460
|
class: `${o}-copyable-icon`,
|
|
2473
2461
|
onClick: () => {
|
|
2474
|
-
|
|
2462
|
+
Ta(Xe), zl.success("复制成功");
|
|
2475
2463
|
}
|
|
2476
2464
|
}, null)]);
|
|
2477
2465
|
}
|
|
2478
2466
|
}
|
|
2479
2467
|
return D;
|
|
2480
2468
|
};
|
|
2481
|
-
function
|
|
2469
|
+
function ut() {
|
|
2482
2470
|
const p = yl({
|
|
2483
2471
|
slots: l,
|
|
2484
2472
|
props: e,
|
|
2485
2473
|
key: "emptyText"
|
|
2486
2474
|
});
|
|
2487
|
-
if (p !== !1 &&
|
|
2488
|
-
const I = e.emptyTextProps?.extraProps || {}, D = p ||
|
|
2475
|
+
if (p !== !1 && m?.emptyText?.value !== !1) {
|
|
2476
|
+
const I = e.emptyTextProps?.extraProps || {}, D = p || m?.emptyText?.value, W = ae(D), _ = W ? gt(D, I) : xt(J(D) ? D : [D]);
|
|
2489
2477
|
return d("div", {
|
|
2490
|
-
class:
|
|
2478
|
+
class: A(`${o}-empty-text`, s.value, e.emptyTextProps?.class),
|
|
2491
2479
|
style: e.emptyTextProps?.style
|
|
2492
|
-
}, [
|
|
2480
|
+
}, [W ? _ : J(_) && _.length ? _.map((le) => tt(le, I)) : d(Bt, {
|
|
2493
2481
|
image: za
|
|
2494
2482
|
}, null)]);
|
|
2495
2483
|
}
|
|
2496
2484
|
return null;
|
|
2497
2485
|
}
|
|
2498
|
-
const
|
|
2499
|
-
const p =
|
|
2486
|
+
const Vt = () => {
|
|
2487
|
+
const p = dt({
|
|
2500
2488
|
slots: l,
|
|
2501
2489
|
props: e,
|
|
2502
2490
|
key: "customRender"
|
|
2503
2491
|
});
|
|
2504
2492
|
if (p) {
|
|
2505
2493
|
if (ie.value?.length) {
|
|
2506
|
-
const
|
|
2494
|
+
const P = ee(R(ie));
|
|
2507
2495
|
return p?.({
|
|
2508
|
-
dataSource:
|
|
2509
|
-
currentData: Sa(
|
|
2496
|
+
dataSource: P,
|
|
2497
|
+
currentData: Sa(P, q.value)
|
|
2510
2498
|
});
|
|
2511
2499
|
}
|
|
2512
|
-
return
|
|
2500
|
+
return ut();
|
|
2513
2501
|
}
|
|
2514
2502
|
return d(we, null, null);
|
|
2515
2503
|
};
|
|
2516
2504
|
return jl({
|
|
2517
2505
|
hashId: s,
|
|
2518
|
-
|
|
2519
|
-
|
|
2506
|
+
prefixCls: o,
|
|
2507
|
+
tableScrollState: st,
|
|
2508
|
+
tableSize: j,
|
|
2520
2509
|
columns: de,
|
|
2521
|
-
cacheColumns:
|
|
2522
|
-
isMobile:
|
|
2523
|
-
formConfig:
|
|
2524
|
-
formAutoRequest:
|
|
2525
|
-
formActions:
|
|
2526
|
-
screenWidth:
|
|
2527
|
-
tableListToolsHeight:
|
|
2528
|
-
styles:
|
|
2529
|
-
classNames:
|
|
2510
|
+
cacheColumns: N,
|
|
2511
|
+
isMobile: B,
|
|
2512
|
+
formConfig: Y,
|
|
2513
|
+
formAutoRequest: V,
|
|
2514
|
+
formActions: L,
|
|
2515
|
+
screenWidth: v,
|
|
2516
|
+
tableListToolsHeight: Et,
|
|
2517
|
+
styles: X(e, "styles"),
|
|
2518
|
+
classNames: X(e, "classNames"),
|
|
2530
2519
|
action: {
|
|
2531
|
-
setTableSize:
|
|
2520
|
+
setTableSize: M,
|
|
2532
2521
|
reload: (p) => ue(p),
|
|
2533
|
-
toggle:
|
|
2522
|
+
toggle: O
|
|
2534
2523
|
},
|
|
2535
2524
|
setPagination: se
|
|
2536
|
-
}),
|
|
2525
|
+
}), n({
|
|
2537
2526
|
formRef: () => ({
|
|
2538
2527
|
getFormSearch: () => ({
|
|
2539
|
-
...
|
|
2528
|
+
...R(t),
|
|
2540
2529
|
...S.value?.getFormSearch(),
|
|
2541
2530
|
...e.params
|
|
2542
2531
|
}),
|
|
@@ -2546,12 +2535,12 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2546
2535
|
}
|
|
2547
2536
|
}),
|
|
2548
2537
|
actionRef: () => ({
|
|
2549
|
-
loading:
|
|
2538
|
+
loading: k,
|
|
2550
2539
|
dataSource: ie,
|
|
2551
2540
|
pageInfo: te,
|
|
2552
|
-
pagination:
|
|
2553
|
-
selectedKeys:
|
|
2554
|
-
selectedItems:
|
|
2541
|
+
pagination: q.value,
|
|
2542
|
+
selectedKeys: T(() => i.value),
|
|
2543
|
+
selectedItems: T(() => y.value),
|
|
2555
2544
|
rowsSelection: {
|
|
2556
2545
|
clear: Fe,
|
|
2557
2546
|
select: C,
|
|
@@ -2560,21 +2549,21 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2560
2549
|
selectAll: c
|
|
2561
2550
|
},
|
|
2562
2551
|
reload: ue,
|
|
2563
|
-
getLoadingStatus: () =>
|
|
2552
|
+
getLoadingStatus: () => R(k),
|
|
2564
2553
|
reloadAndReset: async (p) => {
|
|
2565
2554
|
g.value = !0, se({
|
|
2566
2555
|
current: 1,
|
|
2567
2556
|
pageSize: te?.pageSize || 10
|
|
2568
2557
|
}), p && p?.callBack && (p.wait ? await p.callBack() : p.callBack()), S.value?.resetForm(!0), g.value = !1;
|
|
2569
2558
|
},
|
|
2570
|
-
setPageInfo:
|
|
2559
|
+
setPageInfo: Ve,
|
|
2571
2560
|
setTableDataList: Ie,
|
|
2572
2561
|
setPagination: se,
|
|
2573
2562
|
operateTableDataRow: Se,
|
|
2574
2563
|
setLoading: z
|
|
2575
2564
|
})
|
|
2576
2565
|
}), () => {
|
|
2577
|
-
const p =
|
|
2566
|
+
const p = Ge(e.customRender || l.customRender), P = l.actions?.() || e.actionProps?.actions, I = gl({
|
|
2578
2567
|
slots: l,
|
|
2579
2568
|
props: e,
|
|
2580
2569
|
keys: ["headerTitle", "headerTitleTip", "listToolAfter"],
|
|
@@ -2582,18 +2571,18 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2582
2571
|
});
|
|
2583
2572
|
return r(d("div", {
|
|
2584
2573
|
ref: u,
|
|
2585
|
-
class:
|
|
2586
|
-
[`${o}-no-scroll`]: !Object.keys(
|
|
2587
|
-
[`${o}-table-tree`]:
|
|
2574
|
+
class: A(o, s.value, e.class, e.classNames?.root, [{
|
|
2575
|
+
[`${o}-no-scroll`]: !Object.keys(R(re) || {}).length,
|
|
2576
|
+
[`${o}-table-tree`]: Te.value,
|
|
2588
2577
|
[`${o}-full-page`]: e.fitPage,
|
|
2589
|
-
[`${o}-full-screen`]:
|
|
2578
|
+
[`${o}-full-screen`]: H.value
|
|
2590
2579
|
}]),
|
|
2591
2580
|
style: {
|
|
2592
2581
|
...e.style,
|
|
2593
2582
|
...e.styles?.root || {}
|
|
2594
2583
|
}
|
|
2595
2584
|
}, [d("div", {
|
|
2596
|
-
class:
|
|
2585
|
+
class: A(`${o}-content`, s.value, e.classNames?.content),
|
|
2597
2586
|
style: e.styles?.content
|
|
2598
2587
|
}, [(Pe.value.length > 0 || !!l.form) && e.form !== !1 && d(Ql, {
|
|
2599
2588
|
ref: S,
|
|
@@ -2601,14 +2590,14 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2601
2590
|
cardBordered: e.cardBordered,
|
|
2602
2591
|
formCols: Pe.value,
|
|
2603
2592
|
prefixCls: o,
|
|
2604
|
-
loading:
|
|
2605
|
-
onSearch:
|
|
2593
|
+
loading: R(k),
|
|
2594
|
+
onSearch: Yt,
|
|
2606
2595
|
defaultFormSearch: t.value
|
|
2607
2596
|
}, {
|
|
2608
2597
|
default: l.form ? () => l.form?.() : null
|
|
2609
2598
|
}), d("div", {
|
|
2610
|
-
ref:
|
|
2611
|
-
class:
|
|
2599
|
+
ref: ke,
|
|
2600
|
+
class: A(e.classNames?.card, s.value, `${o}-card`, e.cardBordered && `${o}-card-border`),
|
|
2612
2601
|
style: e.styles?.card
|
|
2613
2602
|
}, [d(ua, {
|
|
2614
2603
|
options: e.options ? {
|
|
@@ -2616,131 +2605,131 @@ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = Bl.useToken, et = /* @__PURE__ */ ge(
|
|
|
2616
2605
|
} : !1,
|
|
2617
2606
|
titleTipText: e.titleTipText,
|
|
2618
2607
|
actionsPlacement: e.actionProps?.placement,
|
|
2619
|
-
actionsRender:
|
|
2608
|
+
actionsRender: P,
|
|
2620
2609
|
headerTitle: I.headerTitle,
|
|
2621
2610
|
listToolAfter: I.listToolAfter,
|
|
2622
2611
|
headerTitleTip: I.headerTitleTip
|
|
2623
|
-
}, null), p ? d(
|
|
2612
|
+
}, null), p ? d(It, rt.value, {
|
|
2624
2613
|
default: () => [d("div", {
|
|
2625
|
-
class:
|
|
2614
|
+
class: A(`${o}-list ${s.value}`, e.classNames?.list),
|
|
2626
2615
|
style: e.styles?.list
|
|
2627
2616
|
}, [d("div", {
|
|
2628
|
-
class:
|
|
2617
|
+
class: A(`${o}-list-content`, s.value, e.classNames?.listContent),
|
|
2629
2618
|
style: {
|
|
2630
2619
|
...e.styles?.listContent || {},
|
|
2631
|
-
height:
|
|
2620
|
+
height: Oe.value ? pe(Oe.value) : e.styles?.listContent?.height
|
|
2632
2621
|
}
|
|
2633
|
-
}, [
|
|
2634
|
-
class:
|
|
2622
|
+
}, [Vt()]), e.pagination !== !1 && ie.value?.length > 0 && d(Al, Q(ce(R(q)), {
|
|
2623
|
+
class: A(s.value, `${o}-pagination`, `${o}-pagination-${Wt.value}`, e.classNames?.pagination),
|
|
2635
2624
|
style: e.styles?.pagination,
|
|
2636
|
-
onChange: (D,
|
|
2625
|
+
onChange: (D, W) => Ve({
|
|
2637
2626
|
current: D,
|
|
2638
|
-
pageSize:
|
|
2627
|
+
pageSize: W
|
|
2639
2628
|
})
|
|
2640
2629
|
}), null)])]
|
|
2641
|
-
}) : d(we, null, [d(Nl, Q(Dl(e, Object.keys(
|
|
2630
|
+
}) : d(we, null, [d(Nl, Q(Dl(e, Object.keys(zt)), R(Ht), {
|
|
2642
2631
|
style: e.styles?.table,
|
|
2643
|
-
class:
|
|
2644
|
-
loading:
|
|
2632
|
+
class: A(e.classNames?.table, s.value, Lt.value && `${o}-overflow-hidden`),
|
|
2633
|
+
loading: rt.value,
|
|
2645
2634
|
rowKey: (D) => D[e.rowKey],
|
|
2646
2635
|
transformCellText: (D) => {
|
|
2647
2636
|
e.transformCellText && typeof e.transformCellText && e.transformCellText?.(D);
|
|
2648
2637
|
const {
|
|
2649
|
-
column:
|
|
2638
|
+
column: W
|
|
2650
2639
|
} = D;
|
|
2651
|
-
if (!
|
|
2652
|
-
const _ =
|
|
2640
|
+
if (!W) return D.text;
|
|
2641
|
+
const _ = W?.key || W?.dataIndex;
|
|
2653
2642
|
let le = !0, G = D.text;
|
|
2654
2643
|
if (J(G))
|
|
2655
2644
|
if (G.length === 0 || G.length === 1 && !ae(G[0])) {
|
|
2656
2645
|
G = G?.[0];
|
|
2657
|
-
const
|
|
2658
|
-
le =
|
|
2646
|
+
const Ee = bl(G, W?.columnEmptyText || e?.columnEmptyText || "");
|
|
2647
|
+
le = Ee.success, G = Ca(Ee.value, W?.valueType || e.columns?.find((Le) => (Le.key || Le.dataIndex) === _)?.valueType, o, s.value);
|
|
2659
2648
|
} else G[0]?.type === "template" && (G = G[0]?.children);
|
|
2660
|
-
return
|
|
2649
|
+
return W?.ellipsis ? kt(G, le, W) : G;
|
|
2661
2650
|
},
|
|
2662
2651
|
rowSelection: e.rowSelection ? {
|
|
2663
|
-
...
|
|
2652
|
+
...ze(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
|
|
2664
2653
|
selectedRowKeys: i.value || [],
|
|
2665
2654
|
onSelect: C,
|
|
2666
2655
|
onSelectAll: c,
|
|
2667
2656
|
onChange: b
|
|
2668
2657
|
} : void 0,
|
|
2669
|
-
onChange:
|
|
2670
|
-
onExpandedRowsChange:
|
|
2671
|
-
onExpand:
|
|
2672
|
-
onResizeColumn: (D,
|
|
2658
|
+
onChange: Ve,
|
|
2659
|
+
onExpandedRowsChange: Mt,
|
|
2660
|
+
onExpand: qt,
|
|
2661
|
+
onResizeColumn: (D, W) => Kt(D, W)
|
|
2673
2662
|
}), {
|
|
2674
2663
|
...l,
|
|
2675
|
-
emptyText: () =>
|
|
2676
|
-
}),
|
|
2677
|
-
to:
|
|
2664
|
+
emptyText: () => ut()
|
|
2665
|
+
}), it.value && !p && d(Qt, {
|
|
2666
|
+
to: it.value
|
|
2678
2667
|
}, {
|
|
2679
2668
|
default: () => [d(aa, {
|
|
2680
|
-
ref:
|
|
2669
|
+
ref: jt
|
|
2681
2670
|
}, null)]
|
|
2682
2671
|
})])])])]));
|
|
2683
2672
|
};
|
|
2684
2673
|
}
|
|
2685
2674
|
});
|
|
2686
|
-
|
|
2687
|
-
function Qa(e,
|
|
2675
|
+
Ze.install = (e) => (e.component(Ze.name, Ze), e);
|
|
2676
|
+
function Qa(e, a) {
|
|
2688
2677
|
function l() {
|
|
2689
|
-
const
|
|
2678
|
+
const v = {
|
|
2690
2679
|
params: {},
|
|
2691
2680
|
searchMap: []
|
|
2692
2681
|
};
|
|
2693
|
-
if (
|
|
2694
|
-
if (
|
|
2695
|
-
return ye(
|
|
2696
|
-
if (ne(
|
|
2697
|
-
return ye(
|
|
2682
|
+
if (a?.state) {
|
|
2683
|
+
if (_e(a.state) && ne(a.state.value))
|
|
2684
|
+
return ye(v, ee(a.state.value));
|
|
2685
|
+
if (ne(a.state) && !_e(a.state))
|
|
2686
|
+
return ye(v, ee(a.state));
|
|
2698
2687
|
}
|
|
2699
|
-
return
|
|
2688
|
+
return v;
|
|
2700
2689
|
}
|
|
2701
|
-
const
|
|
2702
|
-
request:
|
|
2690
|
+
const n = lt(ye(l(), {
|
|
2691
|
+
request: a?.request
|
|
2703
2692
|
}));
|
|
2704
|
-
|
|
2693
|
+
a?.state && K(() => a.state && _e(a.state) ? a.state.value : a.state, () => {
|
|
2705
2694
|
f();
|
|
2706
2695
|
}, { deep: !0 });
|
|
2707
|
-
const o =
|
|
2696
|
+
const o = T(() => e.value ? e.value.actionRef() : {}), r = T(() => e.value ? e.value.formRef() : {}), s = T(() => ({
|
|
2708
2697
|
...o.value.pageInfo || {},
|
|
2709
2698
|
...r.value.getFormSearch?.() || {}
|
|
2710
|
-
})), h =
|
|
2711
|
-
|
|
2712
|
-
h.value = !!
|
|
2713
|
-
}),
|
|
2714
|
-
o.value?.setLoading?.(!!
|
|
2699
|
+
})), h = x(!!o.value.loading?.value);
|
|
2700
|
+
K(() => o.value.loading?.value, (v) => {
|
|
2701
|
+
h.value = !!v;
|
|
2702
|
+
}), K(h, (v) => {
|
|
2703
|
+
o.value?.setLoading?.(!!v);
|
|
2715
2704
|
});
|
|
2716
2705
|
function f() {
|
|
2717
|
-
Cl(
|
|
2706
|
+
Cl(n, l());
|
|
2718
2707
|
}
|
|
2719
|
-
function $(
|
|
2720
|
-
|
|
2708
|
+
function $(v, w) {
|
|
2709
|
+
n.searchMap && (n.searchMap = ee(n.searchMap).map((m) => m.name === v ? ye(m, w) : m));
|
|
2721
2710
|
}
|
|
2722
2711
|
return {
|
|
2723
2712
|
formRef: r,
|
|
2724
2713
|
actionRef: o,
|
|
2725
|
-
tableState:
|
|
2714
|
+
tableState: n,
|
|
2726
2715
|
requestSearch: s,
|
|
2727
2716
|
loading: h,
|
|
2728
|
-
dataSource:
|
|
2729
|
-
selectedKeys:
|
|
2730
|
-
selectedItems:
|
|
2717
|
+
dataSource: T(() => o?.value?.dataSource?.value || []),
|
|
2718
|
+
selectedKeys: T(() => o?.value?.selectedKeys?.value || []),
|
|
2719
|
+
selectedItems: T(() => o?.value?.selectedItems?.value || []),
|
|
2731
2720
|
rowsSelection: o?.value?.rowsSelection,
|
|
2732
|
-
setTableDataList: (
|
|
2733
|
-
reloadAndReset: (
|
|
2734
|
-
setPageInfo: (
|
|
2735
|
-
setPagination: (
|
|
2736
|
-
setLoading: (
|
|
2737
|
-
operateTableDataRow: (
|
|
2738
|
-
reload: (
|
|
2721
|
+
setTableDataList: (v) => o.value?.setTableDataList?.(v),
|
|
2722
|
+
reloadAndReset: (v) => o.value?.reloadAndReset?.(v),
|
|
2723
|
+
setPageInfo: (v, w, m, u) => o.value?.setPageInfo?.(v, w, m, u),
|
|
2724
|
+
setPagination: (v) => o.value?.setPagination?.(v),
|
|
2725
|
+
setLoading: (v) => h.value = v,
|
|
2726
|
+
operateTableDataRow: (v) => o.value?.operateTableDataRow?.(v),
|
|
2727
|
+
reload: (v) => o.value?.reload?.(v),
|
|
2739
2728
|
updateSearchMap: $
|
|
2740
2729
|
};
|
|
2741
2730
|
}
|
|
2742
2731
|
export {
|
|
2743
|
-
|
|
2732
|
+
Ze as GProTable,
|
|
2744
2733
|
he as proTableProps,
|
|
2745
2734
|
Qa as useTable
|
|
2746
2735
|
};
|