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