@gx-design-vue/pro-table 0.2.0-beta.134 → 0.2.0-beta.135
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/hooks/useFetchData.d.ts +2 -2
- package/dist/pro-table.js +821 -817
- package/dist/pro-table.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/pro-table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.134
|
|
4
4
|
* Author: gx12358
|
|
5
5
|
* Copyright (C) 2024 gx12358
|
|
6
6
|
* License: MIT License
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent as
|
|
13
|
-
import { UpOutlined as
|
|
14
|
-
import { useProAppContext as
|
|
15
|
-
import { useBreakpoint as
|
|
16
|
-
import { useContext as
|
|
17
|
-
import { isArray as q, isBoolean as
|
|
18
|
-
import { useDebounceFn as ul, useFullscreen as
|
|
19
|
-
import { Grid as sl, DatePicker as
|
|
20
|
-
import { omit as
|
|
21
|
-
import { tableProps as
|
|
12
|
+
import { defineComponent as Te, ref as O, watch as Y, cloneVNode as _e, reactive as Qe, watchEffect as dt, computed as C, createVNode as s, Fragment as We, isVNode as Q, mergeProps as H, h as ft, unref as w, onActivated as Nt, nextTick as zt, getCurrentInstance as Yt, toRaw as xe, onUnmounted as Et, onDeactivated as Lt, toRef as _, isRef as He } from "vue";
|
|
13
|
+
import { UpOutlined as Wt, DownOutlined as Mt, InfoCircleOutlined as kt, FullscreenExitOutlined as Ht, FullscreenOutlined as qt, ReloadOutlined as Vt, CopyOutlined as Kt } from "@ant-design/icons-vue";
|
|
14
|
+
import { useProAppContext as mt } from "@gx-design-vue/pro-app";
|
|
15
|
+
import { useBreakpoint as vt, useMemo as De, tryOnUnmounted as Gt } from "@gx-design-vue/pro-hooks";
|
|
16
|
+
import { useContext as Xt, useProStyle as Ue, unit as ot, useProConfigContext as _t } from "@gx-design-vue/pro-provider";
|
|
17
|
+
import { isArray as q, isBoolean as fe, classNames as ie, isNumber as Oe, filterEmpty as ht, getPrefixCls as gt, isObject as U, keysOf as pt, isDeepEqualReact as Be, cloneDeep as J, compareArray as Qt, runFunction as Ut, getSortIndex as Jt, isFunction as Ie, handleCurrentPage as Zt, getRandomNumber as yt, deepMerge as Se, arrayRepeat as el, isString as bt, handleShowIndex as tl, getSlot as it, convertValueBoolean as qe, getSlotsProps as ll, handleEmptyField as al, getTextWidth as nl, getSlotVNode as ol, useDeepMerge as il } from "@gx-design-vue/pro-utils";
|
|
18
|
+
import { useDebounceFn as ul, useFullscreen as Ct, useWindowSize as rl } from "@vueuse/core";
|
|
19
|
+
import { Grid as sl, DatePicker as xt, Space as ut, Input as Ee, TimePicker as cl, TreeSelect as dl, Select as fl, InputNumber as Ve, Button as rt, Spin as St, Tooltip as we, theme as ml, Pagination as vl, Table as hl, message as gl, Empty as pl } from "ant-design-vue";
|
|
20
|
+
import { omit as Ae, cloneDeep as wt, pick as st } from "lodash-es";
|
|
21
|
+
import { tableProps as yl } 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 bl } from "ant-design-vue/es/vc-util/warning";
|
|
24
24
|
import V from "dayjs";
|
|
25
|
-
const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"],
|
|
26
|
-
...
|
|
25
|
+
const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], Tt = {
|
|
26
|
+
...Ae(yl(), Cl),
|
|
27
27
|
direction: {
|
|
28
28
|
type: String,
|
|
29
29
|
default: "ltr"
|
|
@@ -47,8 +47,8 @@ const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
47
47
|
type: Object,
|
|
48
48
|
default: void 0
|
|
49
49
|
}
|
|
50
|
-
}, { provideContext: xl, useInjectContext:
|
|
51
|
-
...
|
|
50
|
+
}, { provideContext: xl, useInjectContext: Je } = Xt("pro-table"), ge = {
|
|
51
|
+
...Tt,
|
|
52
52
|
rowSelection: {
|
|
53
53
|
type: Object,
|
|
54
54
|
default: void 0
|
|
@@ -308,7 +308,7 @@ const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
308
308
|
onLoadingChange: Function,
|
|
309
309
|
onRequestError: Function,
|
|
310
310
|
onBeforeSearchSubmit: Function
|
|
311
|
-
}, Sl = /* @__PURE__ */
|
|
311
|
+
}, Sl = /* @__PURE__ */ Te({
|
|
312
312
|
name: "RequestSelect",
|
|
313
313
|
props: {
|
|
314
314
|
fetch: Function,
|
|
@@ -329,14 +329,14 @@ const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
329
329
|
setup(e, {
|
|
330
330
|
slots: a
|
|
331
331
|
}) {
|
|
332
|
-
const l = O([]), n = O(e.loading ?? !1),
|
|
333
|
-
return
|
|
334
|
-
if (
|
|
332
|
+
const l = O([]), n = O(e.loading ?? !1), i = O("init"), o = ul(e.fetch, e.debounceTime || 10);
|
|
333
|
+
return Y([() => e.fetch, () => e.manual], () => {
|
|
334
|
+
if (i.value !== "init" && n.value) return;
|
|
335
335
|
const d = e.manual ?? !1;
|
|
336
|
-
e.fetch && !d && (n.value = !0,
|
|
337
|
-
l.value =
|
|
338
|
-
}).catch((
|
|
339
|
-
console.error(
|
|
336
|
+
e.fetch && !d && (n.value = !0, o().then((v) => {
|
|
337
|
+
l.value = wt(v), i.value = "success";
|
|
338
|
+
}).catch((v) => {
|
|
339
|
+
console.error(v), i.value = "error";
|
|
340
340
|
}).finally(() => {
|
|
341
341
|
n.value = !1;
|
|
342
342
|
}));
|
|
@@ -344,7 +344,7 @@ const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
344
344
|
immediate: !0
|
|
345
345
|
}), () => {
|
|
346
346
|
const d = a.default?.();
|
|
347
|
-
return
|
|
347
|
+
return _e(q(d) ? d[0] : d, {
|
|
348
348
|
options: l.value,
|
|
349
349
|
notFoundContent: e.notFoundContent?.(n.value)
|
|
350
350
|
});
|
|
@@ -352,27 +352,27 @@ const Cl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered
|
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
354
|
function wl(e, a) {
|
|
355
|
-
const l =
|
|
355
|
+
const l = Qe({});
|
|
356
356
|
function n() {
|
|
357
357
|
Object.keys(e).forEach((d) => {
|
|
358
|
-
|
|
358
|
+
i(d, e[d]);
|
|
359
359
|
});
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
e[
|
|
363
|
-
e[
|
|
360
|
+
const o = a.find((d) => d.valueType === "dateRange");
|
|
361
|
+
o && i(o.name || "", e[o.rangeStartName || "start"] ? [
|
|
362
|
+
e[o.rangeStartName || "start"],
|
|
363
|
+
e[o.rangeEndName || "end"]
|
|
364
364
|
] : []);
|
|
365
365
|
}
|
|
366
|
-
|
|
366
|
+
dt(() => {
|
|
367
367
|
n();
|
|
368
368
|
});
|
|
369
|
-
function
|
|
370
|
-
l[
|
|
369
|
+
function i(o, d) {
|
|
370
|
+
l[o] = d;
|
|
371
371
|
}
|
|
372
372
|
return {
|
|
373
373
|
formState: l,
|
|
374
374
|
resetFormState: n,
|
|
375
|
-
changeFormState:
|
|
375
|
+
changeFormState: i
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
const Tl = (e) => ({
|
|
@@ -461,7 +461,7 @@ const Tl = (e) => ({
|
|
|
461
461
|
justifyContent: "center",
|
|
462
462
|
alignItems: "center"
|
|
463
463
|
}
|
|
464
|
-
}),
|
|
464
|
+
}), Ke = [
|
|
465
465
|
{ value: "xxl", span: 4 },
|
|
466
466
|
{ value: "xl", span: 3 },
|
|
467
467
|
{ value: "lg", span: 2 },
|
|
@@ -469,25 +469,25 @@ const Tl = (e) => ({
|
|
|
469
469
|
{ value: "sm", span: 2 },
|
|
470
470
|
{ value: "xs", span: 1 }
|
|
471
471
|
];
|
|
472
|
-
function
|
|
472
|
+
function de(e, a) {
|
|
473
473
|
return typeof a == "function" ? a(V(e)) : V(e).format(a);
|
|
474
474
|
}
|
|
475
475
|
function Fe(e, a) {
|
|
476
476
|
return a ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const ct = (e, a, l = "string") => {
|
|
479
479
|
if (q(e)) {
|
|
480
|
-
const [n,
|
|
481
|
-
let
|
|
482
|
-
if (Array.isArray(a) ? (
|
|
483
|
-
const
|
|
484
|
-
return [
|
|
480
|
+
const [n, i] = e;
|
|
481
|
+
let o, d;
|
|
482
|
+
if (Array.isArray(a) ? (o = a[0], d = a[1]) : typeof a == "object" && a.type === "mask" ? (o = a.format, d = a.format) : (o = a, d = a), l === "string") {
|
|
483
|
+
const v = n ? de(n, o) : "", p = i ? de(i, d) : "";
|
|
484
|
+
return [v, p];
|
|
485
485
|
}
|
|
486
|
-
return [V(n), V(
|
|
486
|
+
return [V(n), V(i)];
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
489
|
function Rl(e) {
|
|
490
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
490
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Q(e);
|
|
491
491
|
}
|
|
492
492
|
const {
|
|
493
493
|
useBreakpoint: $l
|
|
@@ -497,7 +497,7 @@ const {
|
|
|
497
497
|
YearPicker: Dl,
|
|
498
498
|
WeekPicker: Il,
|
|
499
499
|
QuarterPicker: Bl
|
|
500
|
-
} =
|
|
500
|
+
} = xt;
|
|
501
501
|
function Ol(e) {
|
|
502
502
|
let a = e.reduce((l, n) => n.order !== void 0 ? Math.max(l, n.order) : l, 0);
|
|
503
503
|
return e.forEach((l) => {
|
|
@@ -505,17 +505,17 @@ function Ol(e) {
|
|
|
505
505
|
}), e.sort((l, n) => l.order - n.order), e;
|
|
506
506
|
}
|
|
507
507
|
const Al = {
|
|
508
|
-
modalScroll:
|
|
508
|
+
modalScroll: ge.modalScroll,
|
|
509
509
|
formCols: {
|
|
510
510
|
type: Array,
|
|
511
511
|
default: () => []
|
|
512
512
|
},
|
|
513
|
-
loading:
|
|
514
|
-
cardBordered:
|
|
513
|
+
loading: ge.loading,
|
|
514
|
+
cardBordered: ge.cardBordered,
|
|
515
515
|
prefixCls: String,
|
|
516
516
|
defaultState: Object,
|
|
517
517
|
onSearch: Function
|
|
518
|
-
}, jl = /* @__PURE__ */
|
|
518
|
+
}, jl = /* @__PURE__ */ Te({
|
|
519
519
|
name: "ProTableForm",
|
|
520
520
|
inheritAttrs: !1,
|
|
521
521
|
props: Al,
|
|
@@ -525,184 +525,184 @@ const Al = {
|
|
|
525
525
|
}) {
|
|
526
526
|
const {
|
|
527
527
|
wrapSSR: n,
|
|
528
|
-
hashId:
|
|
529
|
-
} =
|
|
530
|
-
formAutoRequest:
|
|
528
|
+
hashId: i
|
|
529
|
+
} = Ue("ProTableForm", [Tl], e.prefixCls), o = mt(), d = $l(), {
|
|
530
|
+
formAutoRequest: v,
|
|
531
531
|
formConfig: p,
|
|
532
532
|
formActions: P
|
|
533
|
-
} =
|
|
534
|
-
formState:
|
|
533
|
+
} = Je(), {
|
|
534
|
+
formState: r,
|
|
535
535
|
resetFormState: F,
|
|
536
|
-
changeFormState:
|
|
537
|
-
} = wl(e.defaultState || {}, e.formCols || []),
|
|
538
|
-
|
|
539
|
-
|
|
536
|
+
changeFormState: y
|
|
537
|
+
} = wl(e.defaultState || {}, e.formCols || []), f = O(p.value?.collapsed ?? p.value?.defaultCollapsed), h = C(() => fe(P.value?.reset) ? P.value?.reset : !v.value), b = C(() => te(p.value?.span)), $ = C(() => p.value?.label);
|
|
538
|
+
Y(() => p.value?.collapsed, (t) => {
|
|
539
|
+
f.value = t;
|
|
540
540
|
});
|
|
541
541
|
function te(t) {
|
|
542
|
-
let
|
|
543
|
-
for (let
|
|
544
|
-
const g =
|
|
542
|
+
let u = 4;
|
|
543
|
+
for (let x = 0; x < Ke.length; x += 1) {
|
|
544
|
+
const g = Ke[x].value;
|
|
545
545
|
if (d.value[g]) {
|
|
546
|
-
|
|
546
|
+
u = t?.[g] || (e.modalScroll ? 3 : Ke[x].span);
|
|
547
547
|
break;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
return
|
|
550
|
+
return u;
|
|
551
551
|
}
|
|
552
552
|
const le = (t) => {
|
|
553
|
-
|
|
554
|
-
},
|
|
555
|
-
...
|
|
553
|
+
f.value = t;
|
|
554
|
+
}, Re = (t, u, x) => (t + 1) % u === 0 ? {
|
|
555
|
+
...x,
|
|
556
556
|
marginRight: 0
|
|
557
557
|
} : {
|
|
558
|
-
...
|
|
558
|
+
...x,
|
|
559
559
|
marginRight: "2%"
|
|
560
|
-
},
|
|
561
|
-
const t =
|
|
562
|
-
return
|
|
563
|
-
},
|
|
564
|
-
(
|
|
565
|
-
},
|
|
566
|
-
const g =
|
|
567
|
-
switch (
|
|
560
|
+
}, pe = () => {
|
|
561
|
+
const t = wt(r), u = e.formCols.find((R) => R.valueType === "text") || "", x = e.formCols.find((R) => R.valueType === "dateRange") || "", g = e.formCols.find((R) => R.valueType === "treeSelect");
|
|
562
|
+
return u && (t[u.name] = r[u.name] || u.initialValue || ""), x && (t[x.rangeStartName || "start"] = t[x.name] ? t[x.name][0] : "", t[x.rangeEndName || "end"] = t[x.name] ? t[x.name][1] : "", delete t[x.name]), g && (g?.name && q(r[g?.name]) && (t[g.name] = r[g.name].length ? r[g.name].map((R) => R[g.valueKey === "text" ? "label" : "value"]).join() : ""), g?.name && q(t[g?.name]) && (t[g.name] = t[g.name].length ? t[g.name].map((R) => R[g.valueKey === "text" ? "label" : "value"]) : "")), t;
|
|
563
|
+
}, ae = (t = !1, u) => {
|
|
564
|
+
(v.value || t) && e.onSearch?.(pe(), t ? u ? "reset" : "submit" : void 0);
|
|
565
|
+
}, j = (t, u, x) => {
|
|
566
|
+
const g = r[u.name || ""];
|
|
567
|
+
switch (u.valueType) {
|
|
568
568
|
case "text":
|
|
569
|
-
|
|
569
|
+
y(u.name || "", t || "");
|
|
570
570
|
break;
|
|
571
571
|
case "number":
|
|
572
|
-
|
|
572
|
+
y(u.name || "", t || void 0);
|
|
573
573
|
break;
|
|
574
574
|
case "numberRange":
|
|
575
|
-
|
|
575
|
+
Oe(x?.key) && g && (g[x.key] = t, y(u.name || "", g || []));
|
|
576
576
|
break;
|
|
577
577
|
case "select":
|
|
578
|
-
|
|
578
|
+
y(u.name || "", t ?? void 0);
|
|
579
579
|
break;
|
|
580
580
|
case "treeSelect":
|
|
581
|
-
|
|
581
|
+
y(u.name || "", t ?? (u.field?.treeCheckable || u.field?.multiple ? [] : null));
|
|
582
582
|
break;
|
|
583
583
|
case "date":
|
|
584
|
-
|
|
584
|
+
y(u.name || "", t ? de(t, Fe(u.valueFormat, u.showTime)) : null);
|
|
585
585
|
break;
|
|
586
586
|
case "dateWeek":
|
|
587
|
-
|
|
587
|
+
y(u.name || "", t ? de(t, "YYYY-wo") : null);
|
|
588
588
|
break;
|
|
589
589
|
case "dateMonth":
|
|
590
|
-
|
|
590
|
+
y(u.name || "", t ? de(t, "YYYY-MM") : null);
|
|
591
591
|
break;
|
|
592
592
|
case "dateQuarter":
|
|
593
|
-
|
|
593
|
+
y(u.name || "", t ? de(t, "YYYY-QQ") : null);
|
|
594
594
|
break;
|
|
595
595
|
case "dateYear":
|
|
596
|
-
|
|
596
|
+
y(u.name || "", t ? de(t, "YYYY") : null);
|
|
597
597
|
break;
|
|
598
598
|
case "dateRange":
|
|
599
|
-
|
|
599
|
+
y(u.name || "", t && q(t) && t.length === 2 ? ct(t, Fe(u.valueFormat, u.showTime)) : null);
|
|
600
600
|
break;
|
|
601
601
|
case "time":
|
|
602
|
-
|
|
602
|
+
y(u.name || "", t ? de(t, u.valueFormat || "HH:mm:ss") : null);
|
|
603
603
|
break;
|
|
604
604
|
}
|
|
605
|
-
|
|
606
|
-
},
|
|
607
|
-
F(),
|
|
605
|
+
u.valueType === "treeSelect" || u.valueType, ae();
|
|
606
|
+
}, me = (t = !0) => {
|
|
607
|
+
F(), ae(!0, t);
|
|
608
608
|
};
|
|
609
609
|
l({
|
|
610
|
-
getFormState: () =>
|
|
611
|
-
resetForm:
|
|
610
|
+
getFormState: () => pe(),
|
|
611
|
+
resetForm: me
|
|
612
612
|
});
|
|
613
|
-
const
|
|
614
|
-
const t =
|
|
613
|
+
const N = () => {
|
|
614
|
+
const t = o?.emptyText?.value;
|
|
615
615
|
if (t) {
|
|
616
|
-
const
|
|
617
|
-
return
|
|
618
|
-
class:
|
|
619
|
-
}, [
|
|
616
|
+
const u = Q(t), x = u ? ft(t) : ht(t || []);
|
|
617
|
+
return s("div", {
|
|
618
|
+
class: ie(`${e.prefixCls}-search-empty-text`, i.value)
|
|
619
|
+
}, [u ? x : q(x) ? x.map((g) => _e(g)) : void 0]);
|
|
620
620
|
}
|
|
621
|
-
},
|
|
622
|
-
default: () => [h.value &&
|
|
623
|
-
onClick: () =>
|
|
621
|
+
}, K = () => (!v.value || h.value) && s(ut, null, {
|
|
622
|
+
default: () => [h.value && s(rt, {
|
|
623
|
+
onClick: () => me()
|
|
624
624
|
}, {
|
|
625
625
|
default: () => [P.value?.resetText || "重置"]
|
|
626
|
-
}), !
|
|
626
|
+
}), !v.value && s(rt, {
|
|
627
627
|
loading: e.loading,
|
|
628
628
|
type: "primary",
|
|
629
|
-
onClick: () =>
|
|
629
|
+
onClick: () => ae(!0)
|
|
630
630
|
}, {
|
|
631
631
|
default: () => [P.value?.searchText || "查询"]
|
|
632
632
|
})]
|
|
633
|
-
}),
|
|
633
|
+
}), Z = ({
|
|
634
634
|
formItemStyle: t,
|
|
635
|
-
collapsed:
|
|
636
|
-
collapseRender:
|
|
637
|
-
}) =>
|
|
635
|
+
collapsed: u,
|
|
636
|
+
collapseRender: x = !0
|
|
637
|
+
}) => s("div", {
|
|
638
638
|
style: t,
|
|
639
|
-
class: `${e.prefixCls}-search-collapse-buttons ${
|
|
640
|
-
}, [
|
|
639
|
+
class: `${e.prefixCls}-search-collapse-buttons ${i.value}`
|
|
640
|
+
}, [s(ut, {
|
|
641
641
|
size: 16
|
|
642
642
|
}, {
|
|
643
|
-
default: () => [
|
|
644
|
-
class: `${e.prefixCls}-a ${
|
|
645
|
-
onClick: () => le(!
|
|
646
|
-
}, [
|
|
643
|
+
default: () => [K(), p.value?.collapseRender !== !1 && x && s(We, null, [typeof p.value?.collapseRender == "function" ? p.value?.collapseRender(u) : s("span", {
|
|
644
|
+
class: `${e.prefixCls}-a ${i.value}`,
|
|
645
|
+
onClick: () => le(!u)
|
|
646
|
+
}, [u ? "收起" : "展开", u ? s(Wt, null, null) : s(Mt, null, null)])])]
|
|
647
647
|
})]);
|
|
648
|
-
function
|
|
649
|
-
return t === void 0 ? void 0 : t ?
|
|
648
|
+
function ue(t) {
|
|
649
|
+
return t === void 0 ? void 0 : t ? s(St, {
|
|
650
650
|
size: "small",
|
|
651
|
-
indicator:
|
|
652
|
-
}, null) :
|
|
651
|
+
indicator: o?.indicator?.value
|
|
652
|
+
}, null) : N();
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
654
|
+
function ye(t, u) {
|
|
655
|
+
return s(Sl, H(t.request, {
|
|
656
656
|
loading: t.loading,
|
|
657
|
-
notFoundContent:
|
|
658
|
-
}), Rl(
|
|
659
|
-
default: () => [
|
|
657
|
+
notFoundContent: ue
|
|
658
|
+
}), Rl(u) ? u : {
|
|
659
|
+
default: () => [u]
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
|
-
const
|
|
663
|
-
let
|
|
664
|
-
const
|
|
665
|
-
let
|
|
662
|
+
const ee = (t) => {
|
|
663
|
+
let u;
|
|
664
|
+
const x = v.value ? Ee.Search : Ee, g = Ae(t.field || {}, "rules");
|
|
665
|
+
let R = null;
|
|
666
666
|
switch (t.valueType) {
|
|
667
667
|
case "text":
|
|
668
|
-
|
|
668
|
+
u = s(x, H({
|
|
669
669
|
style: {
|
|
670
670
|
width: "100%"
|
|
671
671
|
},
|
|
672
|
-
value:
|
|
672
|
+
value: r[t.name],
|
|
673
673
|
placeholder: t.placeholder || "请输入",
|
|
674
674
|
allowClear: t.allowClear ?? !0,
|
|
675
|
-
onChange: (
|
|
676
|
-
onSearch: (
|
|
675
|
+
onChange: (c) => j(c.target.value, t),
|
|
676
|
+
onSearch: (c) => ae()
|
|
677
677
|
}, g), null);
|
|
678
678
|
break;
|
|
679
679
|
case "number":
|
|
680
|
-
|
|
680
|
+
u = s(Ve, H({
|
|
681
681
|
style: {
|
|
682
682
|
width: "100%"
|
|
683
683
|
},
|
|
684
|
-
value:
|
|
684
|
+
value: r[t.name],
|
|
685
685
|
placeholder: t.placeholder || "请输入",
|
|
686
|
-
onChange: (
|
|
686
|
+
onChange: (c) => j(c, t)
|
|
687
687
|
}, g), null);
|
|
688
688
|
break;
|
|
689
689
|
case "numberRange":
|
|
690
|
-
|
|
690
|
+
u = s(Ee.Group, {
|
|
691
691
|
compact: !0,
|
|
692
|
-
class:
|
|
692
|
+
class: ie(i.value, `${e.prefixCls}-search-input-compact`)
|
|
693
693
|
}, {
|
|
694
|
-
default: () => [
|
|
695
|
-
value:
|
|
696
|
-
onChange: (
|
|
694
|
+
default: () => [s(Ve, {
|
|
695
|
+
value: r[t.name]?.[0],
|
|
696
|
+
onChange: (c) => j(c, t, {
|
|
697
697
|
key: 0
|
|
698
698
|
}),
|
|
699
699
|
placeholder: q(t.placeholder) && t.placeholder?.[0] || "请输入"
|
|
700
|
-
}, null),
|
|
700
|
+
}, null), s(Ee, {
|
|
701
701
|
disabled: !0,
|
|
702
702
|
placeholder: "~"
|
|
703
|
-
}, null),
|
|
704
|
-
value:
|
|
705
|
-
onChange: (
|
|
703
|
+
}, null), s(Ve, {
|
|
704
|
+
value: r[t.name]?.[1],
|
|
705
|
+
onChange: (c) => j(c, t, {
|
|
706
706
|
key: 1
|
|
707
707
|
}),
|
|
708
708
|
placeholder: q(t.placeholder) && t.placeholder?.[1] || "请输入"
|
|
@@ -710,188 +710,188 @@ const Al = {
|
|
|
710
710
|
});
|
|
711
711
|
break;
|
|
712
712
|
case "select":
|
|
713
|
-
|
|
713
|
+
R = s(fl, H({
|
|
714
714
|
style: {
|
|
715
715
|
width: "100%"
|
|
716
716
|
},
|
|
717
|
-
value: t.loading ? void 0 :
|
|
717
|
+
value: t.loading ? void 0 : r[t.name],
|
|
718
718
|
optionFilterProp: "label",
|
|
719
719
|
placeholder: t.placeholder || "请选择",
|
|
720
720
|
showSearch: t.showSearch,
|
|
721
721
|
allowClear: t.allowClear ?? !0,
|
|
722
|
-
getPopupContainer: (
|
|
723
|
-
notFoundContent:
|
|
724
|
-
onChange: (
|
|
722
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
723
|
+
notFoundContent: ue(t.loading),
|
|
724
|
+
onChange: (c) => j(c, t),
|
|
725
725
|
options: t.loading ? [] : t?.valueEnum || []
|
|
726
726
|
}, g), null);
|
|
727
727
|
break;
|
|
728
728
|
case "treeSelect":
|
|
729
|
-
|
|
729
|
+
R = s(dl, H({
|
|
730
730
|
style: {
|
|
731
731
|
width: "100%"
|
|
732
732
|
},
|
|
733
|
-
value:
|
|
733
|
+
value: r[t.name],
|
|
734
734
|
placeholder: t.placeholder || "请选择",
|
|
735
735
|
allowClear: t.allowClear ?? !0,
|
|
736
736
|
treeData: t.loading ? [] : t.valueEnum || [],
|
|
737
|
-
getPopupContainer: (
|
|
738
|
-
notFoundContent:
|
|
739
|
-
onChange: (
|
|
737
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
738
|
+
notFoundContent: ue(t.loading),
|
|
739
|
+
onChange: (c) => j(c, t)
|
|
740
740
|
}, g), null);
|
|
741
741
|
break;
|
|
742
742
|
case "date":
|
|
743
|
-
|
|
743
|
+
u = s(xt, H({
|
|
744
744
|
style: {
|
|
745
745
|
width: "100%"
|
|
746
746
|
},
|
|
747
|
-
value:
|
|
748
|
-
getPopupContainer: (
|
|
747
|
+
value: r[t.name] ? V(r[t.name]) : void 0,
|
|
748
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
749
749
|
placeholder: t.placeholder || "请选择",
|
|
750
750
|
allowClear: t.allowClear ?? !0,
|
|
751
751
|
format: Fe(t.valueFormat, t.showTime),
|
|
752
752
|
showTime: t.showTime,
|
|
753
753
|
showToday: t.showToday || !0,
|
|
754
|
-
onChange: (
|
|
754
|
+
onChange: (c) => j(c, t)
|
|
755
755
|
}, g), null);
|
|
756
756
|
break;
|
|
757
757
|
case "dateWeek":
|
|
758
|
-
|
|
758
|
+
u = s(Il, H({
|
|
759
759
|
style: {
|
|
760
760
|
width: "100%"
|
|
761
761
|
},
|
|
762
|
-
value:
|
|
763
|
-
getPopupContainer: (
|
|
762
|
+
value: r[t.name] ? V(r[t.name], t.valueFormat || "YYYY-wo") : void 0,
|
|
763
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
764
764
|
allowClear: t.allowClear ?? !0,
|
|
765
765
|
placeholder: t.placeholder || "请选择",
|
|
766
|
-
onChange: (
|
|
766
|
+
onChange: (c) => j(c, t)
|
|
767
767
|
}, g), null);
|
|
768
768
|
break;
|
|
769
769
|
case "dateMonth":
|
|
770
|
-
|
|
770
|
+
u = s(Pl, H({
|
|
771
771
|
style: {
|
|
772
772
|
width: "100%"
|
|
773
773
|
},
|
|
774
|
-
value:
|
|
775
|
-
getPopupContainer: (
|
|
774
|
+
value: r[t.name] ? V(r[t.name], t.valueFormat || "YYYY-MM") : void 0,
|
|
775
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
776
776
|
allowClear: t.allowClear ?? !0,
|
|
777
777
|
placeholder: t.placeholder || "请选择",
|
|
778
|
-
onChange: (
|
|
778
|
+
onChange: (c) => j(c, t)
|
|
779
779
|
}, g), null);
|
|
780
780
|
break;
|
|
781
781
|
case "dateQuarter":
|
|
782
|
-
|
|
782
|
+
u = s(Bl, H({
|
|
783
783
|
style: {
|
|
784
784
|
width: "100%"
|
|
785
785
|
},
|
|
786
|
-
value:
|
|
787
|
-
getPopupContainer: (
|
|
786
|
+
value: r[t.name] ? V(r[t.name], t.valueFormat || "YYYY-QQ") : void 0,
|
|
787
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
788
788
|
allowClear: t.allowClear ?? !0,
|
|
789
789
|
placeholder: t.placeholder || "请选择",
|
|
790
|
-
onChange: (
|
|
790
|
+
onChange: (c) => j(c, t)
|
|
791
791
|
}, g), null);
|
|
792
792
|
break;
|
|
793
793
|
case "dateYear":
|
|
794
|
-
|
|
794
|
+
u = s(Dl, H({
|
|
795
795
|
style: {
|
|
796
796
|
width: "100%"
|
|
797
797
|
},
|
|
798
|
-
value:
|
|
799
|
-
getPopupContainer: (
|
|
798
|
+
value: r[t.name] ? V(r[t.name], t.valueFormat || "YYYY") : void 0,
|
|
799
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
800
800
|
allowClear: t.allowClear ?? !0,
|
|
801
801
|
placeholder: t.placeholder || "请选择",
|
|
802
|
-
onChange: (
|
|
802
|
+
onChange: (c) => j(c, t)
|
|
803
803
|
}, g), null);
|
|
804
804
|
break;
|
|
805
805
|
case "dateRange":
|
|
806
|
-
|
|
806
|
+
u = s(Fl, H({
|
|
807
807
|
style: {
|
|
808
808
|
width: "100%"
|
|
809
809
|
},
|
|
810
|
-
value:
|
|
811
|
-
getPopupContainer: (
|
|
810
|
+
value: r[t.name] && q(r[t.name]) && r[t.name]?.length === 2 ? ct(r[t.name], Fe(t.valueFormat, t.showTime), "dayjs") : void 0,
|
|
811
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
812
812
|
placeholder: t.placeholder || ["开始日期", "结束日期"],
|
|
813
813
|
format: Fe(t.valueFormat, t.showTime),
|
|
814
814
|
showTime: t.showTime,
|
|
815
|
-
onChange: (
|
|
815
|
+
onChange: (c) => j(c, t)
|
|
816
816
|
}, g), null);
|
|
817
817
|
break;
|
|
818
818
|
case "time":
|
|
819
|
-
|
|
819
|
+
u = s(cl, H({
|
|
820
820
|
style: {
|
|
821
821
|
width: "100%"
|
|
822
822
|
},
|
|
823
|
-
value:
|
|
824
|
-
getPopupContainer: (
|
|
823
|
+
value: r[t.name] ? V(r[t.name], t.valueFormat || "HH:mm:ss") : void 0,
|
|
824
|
+
getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
|
|
825
825
|
placeholder: t.placeholder || "请选择",
|
|
826
826
|
allowClear: t.allowClear || t.allowClear === !1 ? t.allowClear : !0,
|
|
827
827
|
use12Hours: t.use12Hours,
|
|
828
828
|
format: t.valueFormat || "HH:mm:ss",
|
|
829
|
-
onChange: (
|
|
829
|
+
onChange: (c) => j(c, t)
|
|
830
830
|
}, g), null);
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
833
|
-
return t.valueType && ["select", "treeSelect"].includes(t.valueType) && (
|
|
834
|
-
},
|
|
833
|
+
return t.valueType && ["select", "treeSelect"].includes(t.valueType) && (u = t.request ? ye(t, R) : R), u;
|
|
834
|
+
}, E = ({
|
|
835
835
|
formItemStyle: t = {},
|
|
836
|
-
item:
|
|
836
|
+
item: u
|
|
837
837
|
}) => {
|
|
838
|
-
const
|
|
839
|
-
return
|
|
838
|
+
const x = Q(u) ? u.props?.label : u.label, g = (Q(u) ? u.props?.labelWidth : u.labelWidth) || $.value?.width, R = (Q(u) ? u.props?.labelAlign : u.labelAlign) || $.value?.align;
|
|
839
|
+
return s("div", {
|
|
840
840
|
class: `${e.prefixCls}-search-item`,
|
|
841
841
|
style: {
|
|
842
842
|
...t,
|
|
843
|
-
gap:
|
|
843
|
+
gap: $.value?.gap ? ot($.value?.gap) : void 0
|
|
844
844
|
}
|
|
845
|
-
}, [
|
|
846
|
-
class:
|
|
845
|
+
}, [x && s("div", {
|
|
846
|
+
class: ie(`${e.prefixCls}-search-item-label`, $.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, R && `${e.prefixCls}-search-item-label-${R}`),
|
|
847
847
|
style: {
|
|
848
|
-
width: g ?
|
|
848
|
+
width: g ? ot(g) : void 0
|
|
849
849
|
}
|
|
850
|
-
}, [
|
|
851
|
-
class:
|
|
852
|
-
}, [
|
|
853
|
-
},
|
|
850
|
+
}, [x]), s("div", {
|
|
851
|
+
class: ie(`${e.prefixCls}-search-item-children`)
|
|
852
|
+
}, [Q(u) ? u : ee(u)])]);
|
|
853
|
+
}, ve = () => {
|
|
854
854
|
let t = a.default?.() || [];
|
|
855
855
|
t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
|
|
856
|
-
const
|
|
856
|
+
const u = Ol([...e.formCols, ...t.map((g) => ({
|
|
857
857
|
...g,
|
|
858
858
|
order: g.props?.order || void 0
|
|
859
|
-
}))]),
|
|
860
|
-
width: `${(100 - (
|
|
859
|
+
}))]), x = {
|
|
860
|
+
width: `${(100 - (b.value - 1) * 2) / b.value}%`
|
|
861
861
|
};
|
|
862
|
-
return
|
|
863
|
-
const
|
|
864
|
-
return
|
|
865
|
-
formItemStyle:
|
|
862
|
+
return u.map((g, R) => {
|
|
863
|
+
const c = Re(R, b.value, x);
|
|
864
|
+
return u.length < b.value || f.value ? s(We, null, [E({
|
|
865
|
+
formItemStyle: c,
|
|
866
866
|
item: g
|
|
867
|
-
}),
|
|
867
|
+
}), R === u.length - 1 && Z({
|
|
868
868
|
formItemStyle: {
|
|
869
869
|
flex: 1,
|
|
870
870
|
justifyContent: "flex-end"
|
|
871
871
|
},
|
|
872
|
-
collapsed:
|
|
873
|
-
collapseRender: !!
|
|
874
|
-
})]) :
|
|
875
|
-
formItemStyle:
|
|
872
|
+
collapsed: f.value,
|
|
873
|
+
collapseRender: !!f.value
|
|
874
|
+
})]) : s(We, null, [R < b.value - 1 && E({
|
|
875
|
+
formItemStyle: c,
|
|
876
876
|
item: g
|
|
877
|
-
}),
|
|
878
|
-
formItemStyle:
|
|
877
|
+
}), R === b.value - 1 && (b.value - 1 === 0 || u.length === b.value) && E({
|
|
878
|
+
formItemStyle: c,
|
|
879
879
|
item: g
|
|
880
|
-
}),
|
|
880
|
+
}), R === b.value - 1 && u.length >= b.value && Z({
|
|
881
881
|
formItemStyle: {
|
|
882
882
|
flex: 1,
|
|
883
883
|
justifyContent: "flex-end"
|
|
884
884
|
},
|
|
885
885
|
collapsed: !1,
|
|
886
|
-
collapseRender:
|
|
886
|
+
collapseRender: u.length !== b.value
|
|
887
887
|
})]);
|
|
888
888
|
});
|
|
889
889
|
};
|
|
890
890
|
return () => {
|
|
891
891
|
const t = e.cardBordered && `${e.prefixCls}-search-border`;
|
|
892
|
-
return n(
|
|
893
|
-
class:
|
|
894
|
-
}, [
|
|
892
|
+
return n(s("div", {
|
|
893
|
+
class: ie(i.value, `${e.prefixCls}-search`, t, i.value, p.value?.className)
|
|
894
|
+
}, [ve()]));
|
|
895
895
|
};
|
|
896
896
|
}
|
|
897
897
|
}), Nl = (e) => ({
|
|
@@ -967,125 +967,125 @@ const Al = {
|
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
969
|
function zl(e) {
|
|
970
|
-
if (
|
|
970
|
+
if (Q(e))
|
|
971
971
|
return e;
|
|
972
972
|
if (e) {
|
|
973
973
|
const a = e, {
|
|
974
974
|
icon: l,
|
|
975
975
|
tooltip: n,
|
|
976
|
-
onClick:
|
|
977
|
-
key:
|
|
976
|
+
onClick: i,
|
|
977
|
+
key: o
|
|
978
978
|
} = a;
|
|
979
|
-
return l && n ?
|
|
979
|
+
return l && n ? s(we, {
|
|
980
980
|
title: n,
|
|
981
|
-
key:
|
|
981
|
+
key: o
|
|
982
982
|
}, {
|
|
983
|
-
default: () => [
|
|
984
|
-
key:
|
|
983
|
+
default: () => [s("span", {
|
|
984
|
+
key: o,
|
|
985
985
|
onClick: () => {
|
|
986
|
-
|
|
986
|
+
i && i(o);
|
|
987
987
|
}
|
|
988
988
|
}, [l])]
|
|
989
989
|
}) : l;
|
|
990
990
|
}
|
|
991
991
|
return null;
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const Rt = /* @__PURE__ */ Te({
|
|
994
994
|
props: {
|
|
995
995
|
actions: [Array],
|
|
996
996
|
settings: [Array],
|
|
997
|
-
titleTip:
|
|
997
|
+
titleTip: ge.titleTip,
|
|
998
998
|
prefixCls: String,
|
|
999
|
-
headerTitle:
|
|
1000
|
-
titleTipText:
|
|
999
|
+
headerTitle: ge.headerTitle,
|
|
1000
|
+
titleTipText: ge.titleTipText,
|
|
1001
1001
|
actionsPlacement: String
|
|
1002
1002
|
},
|
|
1003
1003
|
setup(e) {
|
|
1004
1004
|
const {
|
|
1005
1005
|
wrapSSR: a,
|
|
1006
1006
|
hashId: l
|
|
1007
|
-
} =
|
|
1008
|
-
isMobile:
|
|
1009
|
-
} =
|
|
1007
|
+
} = Ue("ListToolBar", [Nl], e.prefixCls), n = vt(), {
|
|
1008
|
+
isMobile: i
|
|
1009
|
+
} = Je(), o = C(() => !!(e.titleTip || e.headerTitle)), d = De(() => {
|
|
1010
1010
|
if (!Array.isArray(e.actions) || e.actions?.length < 1)
|
|
1011
1011
|
return {
|
|
1012
1012
|
left: null,
|
|
1013
1013
|
right: null
|
|
1014
1014
|
};
|
|
1015
|
-
const
|
|
1015
|
+
const y = e.actions.filter((h) => Q(h)).filter((h) => (h?.props?.placement || e.actionsPlacement) === "left"), f = e.actions.filter((h) => Q(h)).filter((h) => (h?.props?.placement || e.actionsPlacement) === "right");
|
|
1016
1016
|
return {
|
|
1017
|
-
left:
|
|
1017
|
+
left: y.length ? s("div", {
|
|
1018
1018
|
class: `${e.prefixCls}-actions ${l.value}`
|
|
1019
|
-
}, [
|
|
1020
|
-
right:
|
|
1019
|
+
}, [y]) : null,
|
|
1020
|
+
right: f.length ? s("div", {
|
|
1021
1021
|
class: `${e.prefixCls}-actions ${l.value}`
|
|
1022
|
-
}, [
|
|
1022
|
+
}, [f]) : null
|
|
1023
1023
|
};
|
|
1024
|
-
}, [() => e.actions, () => e.actionsPlacement]),
|
|
1025
|
-
if (!
|
|
1026
|
-
return
|
|
1024
|
+
}, [() => e.actions, () => e.actionsPlacement]), v = C(() => !!(e.titleTip || e.headerTitle || d.value.left)), p = C(() => !!(e.settings?.length || d.value.right)), P = De(() => {
|
|
1025
|
+
if (!v.value && p.value)
|
|
1026
|
+
return s("div", {
|
|
1027
1027
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1028
1028
|
}, null);
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1029
|
+
const y = d.value.left;
|
|
1030
|
+
return o.value ? s("div", {
|
|
1031
1031
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1032
|
-
}, [
|
|
1032
|
+
}, [s("div", {
|
|
1033
1033
|
class: `${e.prefixCls}-title ${l.value}`
|
|
1034
|
-
}, [e.headerTitle, e.titleTip &&
|
|
1034
|
+
}, [e.headerTitle, e.titleTip && s(we, {
|
|
1035
1035
|
title: e.titleTipText
|
|
1036
1036
|
}, {
|
|
1037
|
-
default: () => [
|
|
1038
|
-
})]),
|
|
1037
|
+
default: () => [fe(e.titleTip) && e.titleTip ? s(kt, null, null) : e.titleTip]
|
|
1038
|
+
})]), y]) : s("div", {
|
|
1039
1039
|
class: `${e.prefixCls}-left ${l.value}`
|
|
1040
|
-
}, [
|
|
1041
|
-
}, [() =>
|
|
1040
|
+
}, [y]);
|
|
1041
|
+
}, [() => v.value, () => p.value, () => o.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.titleTip]), r = De(() => {
|
|
1042
1042
|
if (!p.value) return null;
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1043
|
+
const y = d.value.right;
|
|
1044
|
+
return s("div", {
|
|
1045
1045
|
class: `${e.prefixCls}-right ${l.value}`,
|
|
1046
1046
|
style: {
|
|
1047
1047
|
alignItems: n.value.lg ? "center" : "flex-end",
|
|
1048
1048
|
flexDirection: n.value.lg ? "row" : "column"
|
|
1049
1049
|
}
|
|
1050
|
-
}, [
|
|
1051
|
-
class:
|
|
1052
|
-
}, [e.settings.map((
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1050
|
+
}, [y, e.settings?.length ? s("div", {
|
|
1051
|
+
class: ie(`${e.prefixCls}-setting-items`, l.value)
|
|
1052
|
+
}, [e.settings.map((f, h) => {
|
|
1053
|
+
const b = zl(f);
|
|
1054
|
+
return s("div", {
|
|
1055
1055
|
key: h,
|
|
1056
|
-
class:
|
|
1057
|
-
}, [
|
|
1056
|
+
class: ie(`${e.prefixCls}-setting-item`, l.value)
|
|
1057
|
+
}, [b]);
|
|
1058
1058
|
})]) : null]);
|
|
1059
|
-
}, [() => n.value, () => p.value, () => e.prefixCls, () =>
|
|
1060
|
-
if (!p.value && !
|
|
1061
|
-
const
|
|
1059
|
+
}, [() => n.value, () => p.value, () => e.prefixCls, () => o.value, () => d.value, () => e.settings]), F = De(() => {
|
|
1060
|
+
if (!p.value && !v.value) return null;
|
|
1061
|
+
const y = {
|
|
1062
1062
|
[`${l.value}`]: !0,
|
|
1063
1063
|
[`${e.prefixCls}-container`]: !0,
|
|
1064
|
-
[`${e.prefixCls}-container-mobile`]:
|
|
1064
|
+
[`${e.prefixCls}-container-mobile`]: i.value
|
|
1065
1065
|
};
|
|
1066
|
-
return
|
|
1067
|
-
class:
|
|
1068
|
-
}, [P.value,
|
|
1069
|
-
}, [() =>
|
|
1070
|
-
return () => a(
|
|
1066
|
+
return s("div", {
|
|
1067
|
+
class: y
|
|
1068
|
+
}, [P.value, r.value]);
|
|
1069
|
+
}, [() => i.value, () => v.value, () => p.value, () => P.value, () => e.prefixCls, () => r.value]);
|
|
1070
|
+
return () => a(s("div", {
|
|
1071
1071
|
class: `${e.prefixCls} ${l.value}`
|
|
1072
1072
|
}, [F.value]));
|
|
1073
1073
|
}
|
|
1074
1074
|
});
|
|
1075
|
-
|
|
1076
|
-
const
|
|
1075
|
+
Rt.inheritAttrs = !1;
|
|
1076
|
+
const $t = /* @__PURE__ */ Te({
|
|
1077
1077
|
setup() {
|
|
1078
1078
|
const {
|
|
1079
1079
|
isFullscreen: e
|
|
1080
|
-
} =
|
|
1081
|
-
return () => e.value ?
|
|
1080
|
+
} = Ct();
|
|
1081
|
+
return () => e.value ? s(we, {
|
|
1082
1082
|
title: "退出全屏"
|
|
1083
1083
|
}, {
|
|
1084
|
-
default: () => [
|
|
1085
|
-
}) :
|
|
1084
|
+
default: () => [s(Ht, null, null)]
|
|
1085
|
+
}) : s(we, {
|
|
1086
1086
|
title: "全屏"
|
|
1087
1087
|
}, {
|
|
1088
|
-
default: () => [
|
|
1088
|
+
default: () => [s(qt, null, null)]
|
|
1089
1089
|
});
|
|
1090
1090
|
}
|
|
1091
1091
|
});
|
|
@@ -1093,34 +1093,34 @@ function Yl() {
|
|
|
1093
1093
|
return {
|
|
1094
1094
|
reload: {
|
|
1095
1095
|
text: "刷新",
|
|
1096
|
-
icon:
|
|
1096
|
+
icon: s(Vt, null, null)
|
|
1097
1097
|
},
|
|
1098
1098
|
fullScreen: {
|
|
1099
1099
|
text: "全屏",
|
|
1100
|
-
icon:
|
|
1100
|
+
icon: s($t, null, null)
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
1104
|
function El(e, a) {
|
|
1105
|
-
return
|
|
1105
|
+
return pt(e).filter((l) => l).map((l) => {
|
|
1106
1106
|
const n = e[l];
|
|
1107
1107
|
if (!n)
|
|
1108
1108
|
return null;
|
|
1109
|
-
let
|
|
1110
|
-
if (typeof
|
|
1109
|
+
let i = n === !0 ? a[l] : () => n?.();
|
|
1110
|
+
if (typeof i != "function" && (i = () => {
|
|
1111
1111
|
}), l === "fullScreen")
|
|
1112
|
-
return
|
|
1112
|
+
return s("span", {
|
|
1113
1113
|
key: l,
|
|
1114
|
-
onClick:
|
|
1115
|
-
}, [
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1114
|
+
onClick: i
|
|
1115
|
+
}, [s($t, null, null)]);
|
|
1116
|
+
const o = Yl()[l];
|
|
1117
|
+
return o ? s("span", {
|
|
1118
1118
|
key: l,
|
|
1119
|
-
onClick:
|
|
1120
|
-
}, [
|
|
1121
|
-
title:
|
|
1119
|
+
onClick: i
|
|
1120
|
+
}, [s(we, {
|
|
1121
|
+
title: o.text
|
|
1122
1122
|
}, {
|
|
1123
|
-
default: () => [
|
|
1123
|
+
default: () => [o.icon]
|
|
1124
1124
|
})]) : null;
|
|
1125
1125
|
}).filter((l) => l);
|
|
1126
1126
|
}
|
|
@@ -1132,25 +1132,25 @@ const Ll = {
|
|
|
1132
1132
|
titleTipText: [String],
|
|
1133
1133
|
actionsRender: [Array],
|
|
1134
1134
|
headerTitle: [Function, Boolean, Object, Array, String]
|
|
1135
|
-
}, Wl = /* @__PURE__ */
|
|
1135
|
+
}, Wl = /* @__PURE__ */ Te({
|
|
1136
1136
|
props: Ll,
|
|
1137
1137
|
inheritAttrs: !1,
|
|
1138
1138
|
setup(e) {
|
|
1139
|
-
const a =
|
|
1139
|
+
const a = gt({
|
|
1140
1140
|
suffixCls: "table-list-toolbar",
|
|
1141
1141
|
isPor: !0
|
|
1142
1142
|
}), {
|
|
1143
1143
|
action: l
|
|
1144
|
-
} =
|
|
1144
|
+
} = Je(), n = De(() => e.options === !1 ? [] : El({
|
|
1145
1145
|
reload: () => l?.reload(),
|
|
1146
1146
|
fullScreen: () => l?.toggle()
|
|
1147
|
-
},
|
|
1147
|
+
}, U(e.options) ? e.options : {}), [() => e.options]);
|
|
1148
1148
|
return () => {
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
1149
|
+
const i = e.actionsRender || [];
|
|
1150
|
+
return s(Rt, {
|
|
1151
1151
|
prefixCls: a,
|
|
1152
1152
|
headerTitle: e.headerTitle,
|
|
1153
|
-
actions:
|
|
1153
|
+
actions: i,
|
|
1154
1154
|
actionsPlacement: e.actionsPlacement,
|
|
1155
1155
|
settings: w(n),
|
|
1156
1156
|
titleTip: e.titleTip,
|
|
@@ -1160,288 +1160,291 @@ const Ll = {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
});
|
|
1162
1162
|
function Ml(e) {
|
|
1163
|
-
return
|
|
1163
|
+
return Yt();
|
|
1164
1164
|
}
|
|
1165
1165
|
function kl(e, a = !0, l) {
|
|
1166
|
-
Ml() ?
|
|
1166
|
+
Ml() ? Nt(e, l) : a ? e() : zt(e);
|
|
1167
1167
|
}
|
|
1168
1168
|
function Hl(e) {
|
|
1169
|
-
const a =
|
|
1169
|
+
const a = C(() => e.draggable), l = C(() => e.neverScroll), n = C(() => e.autoScroll);
|
|
1170
1170
|
return {
|
|
1171
1171
|
draggable: a,
|
|
1172
1172
|
neverScroll: l,
|
|
1173
1173
|
autoScroll: n
|
|
1174
1174
|
};
|
|
1175
1175
|
}
|
|
1176
|
-
function ql({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll:
|
|
1176
|
+
function ql({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i, neverScroll: o }) {
|
|
1177
1177
|
const d = O([]);
|
|
1178
|
-
|
|
1178
|
+
Y([
|
|
1179
1179
|
() => e.value,
|
|
1180
1180
|
() => a.value,
|
|
1181
1181
|
() => l.value,
|
|
1182
1182
|
() => n.value,
|
|
1183
1183
|
() => l.value,
|
|
1184
|
-
() =>
|
|
1185
|
-
() =>
|
|
1184
|
+
() => i.value,
|
|
1185
|
+
() => o.value
|
|
1186
1186
|
], () => {
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1187
|
+
const f = P(xe(a.value));
|
|
1188
|
+
Be(f, xe(d.value)) || (d.value = J(f));
|
|
1189
1189
|
}, {
|
|
1190
1190
|
deep: !0,
|
|
1191
1191
|
immediate: !0
|
|
1192
1192
|
});
|
|
1193
|
-
const
|
|
1194
|
-
const
|
|
1193
|
+
const v = C(() => {
|
|
1194
|
+
const f = p(w(d).filter(($) => $.fixed === "left")), h = p(w(d).filter(($) => $.fixed !== "left" && $.fixed !== "right")), b = p(w(d).filter(($) => $.fixed === "right"));
|
|
1195
1195
|
return [
|
|
1196
|
-
...
|
|
1196
|
+
...f,
|
|
1197
1197
|
...h,
|
|
1198
|
-
...
|
|
1198
|
+
...b
|
|
1199
1199
|
];
|
|
1200
1200
|
});
|
|
1201
|
-
function p(
|
|
1202
|
-
return
|
|
1201
|
+
function p(f) {
|
|
1202
|
+
return f.sort((h, b) => Qt(h, b, "order", 0));
|
|
1203
1203
|
}
|
|
1204
|
-
function P(
|
|
1205
|
-
return
|
|
1206
|
-
if (h.dataIndex === "action" ||
|
|
1204
|
+
function P(f) {
|
|
1205
|
+
return J(f).map((h, b) => {
|
|
1206
|
+
if (h.dataIndex === "action" || b === f.length - 1 ? h.resizable = !1 : h.resizable = fe(h.resizable) ? h.resizable : !!(Oe(h.width) && w(n)), !h.width || w(o))
|
|
1207
1207
|
return h;
|
|
1208
|
-
if (h.dataIndex === "action" && w(
|
|
1208
|
+
if (h.dataIndex === "action" && w(i))
|
|
1209
1209
|
if (w(e)?.x || !w(l))
|
|
1210
1210
|
h.width = h.width || 100, h.fixed = "right";
|
|
1211
1211
|
else {
|
|
1212
|
-
const
|
|
1213
|
-
h.width =
|
|
1212
|
+
const $ = w(a).find((te) => te.dataIndex === h.dataIndex);
|
|
1213
|
+
h.width = $?.width || "", h.fixed = $?.fixed;
|
|
1214
1214
|
}
|
|
1215
1215
|
return h;
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
d.value = d.value.map((
|
|
1218
|
+
function r(f, h) {
|
|
1219
|
+
d.value = d.value.map((b) => (b.uuid === h.uuid && (b.width = f), b));
|
|
1220
1220
|
}
|
|
1221
|
-
function F(
|
|
1222
|
-
if (
|
|
1221
|
+
function F(f) {
|
|
1222
|
+
if (f.length <= 0) {
|
|
1223
1223
|
d.value = [];
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
|
-
|
|
1226
|
+
Be(P(f), xe(d.value)) || (d.value = P(f));
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
F(
|
|
1230
|
-
const
|
|
1231
|
-
show:
|
|
1232
|
-
fixed:
|
|
1233
|
-
order:
|
|
1228
|
+
function y(f) {
|
|
1229
|
+
F(J(xe(a.value)).map((h) => {
|
|
1230
|
+
const b = h.key ? {
|
|
1231
|
+
show: f[h.key]?.show,
|
|
1232
|
+
fixed: f[h.key]?.fixed,
|
|
1233
|
+
order: f[h.key]?.order
|
|
1234
1234
|
} : {};
|
|
1235
|
-
return { ...h, ...
|
|
1235
|
+
return { ...h, ...b };
|
|
1236
1236
|
}));
|
|
1237
1237
|
}
|
|
1238
1238
|
return {
|
|
1239
1239
|
breakpoint: l,
|
|
1240
|
-
proColumns:
|
|
1240
|
+
proColumns: v,
|
|
1241
1241
|
setColumns: F,
|
|
1242
|
-
changeColumns:
|
|
1243
|
-
resizeColumnWidth:
|
|
1242
|
+
changeColumns: y,
|
|
1243
|
+
resizeColumnWidth: r
|
|
1244
1244
|
};
|
|
1245
1245
|
}
|
|
1246
1246
|
function Vl(e, a) {
|
|
1247
|
-
const l =
|
|
1248
|
-
function
|
|
1249
|
-
n.value && clearTimeout(n.value);
|
|
1247
|
+
const l = C(() => a), n = O(), i = O(e);
|
|
1248
|
+
function o() {
|
|
1249
|
+
n.value && (clearTimeout(n.value), n.value = null);
|
|
1250
1250
|
}
|
|
1251
|
-
async function d(...
|
|
1252
|
-
return l.value === 0 || l.value === void 0 ?
|
|
1253
|
-
|
|
1254
|
-
p(await
|
|
1251
|
+
async function d(...v) {
|
|
1252
|
+
return l.value === 0 || l.value === void 0 ? i.value(...v) : (o(), new Promise(async (p) => {
|
|
1253
|
+
v[0]?.immediate ? p(await i.value(...v)) : n.value = setTimeout(async () => {
|
|
1254
|
+
p(await i.value(...v));
|
|
1255
1255
|
}, l.value);
|
|
1256
1256
|
}));
|
|
1257
1257
|
}
|
|
1258
|
-
return
|
|
1259
|
-
cancel:
|
|
1258
|
+
return Gt(o), {
|
|
1259
|
+
cancel: o,
|
|
1260
1260
|
run: d
|
|
1261
1261
|
};
|
|
1262
1262
|
}
|
|
1263
1263
|
function Kl(e) {
|
|
1264
|
-
const a =
|
|
1264
|
+
const a = C(() => e.rowKey), l = C(() => e.polling), n = C(() => e.debounceTime), i = C(() => e.dataSource), o = C(() => e.autoRequest);
|
|
1265
1265
|
return {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
polling: n,
|
|
1266
|
+
rowKey: a,
|
|
1267
|
+
polling: l,
|
|
1269
1268
|
request: e.request,
|
|
1270
1269
|
postData: e.postData,
|
|
1271
|
-
debounceTime:
|
|
1270
|
+
debounceTime: n,
|
|
1272
1271
|
dataSource: i,
|
|
1273
|
-
autoRequest:
|
|
1272
|
+
autoRequest: o
|
|
1274
1273
|
};
|
|
1275
1274
|
}
|
|
1276
|
-
function Gl({
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
},
|
|
1280
|
-
const { pagination:
|
|
1281
|
-
if (!
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1275
|
+
function Gl({ rowKey: e, autoRequest: a, polling: l, request: n, postData: i, dataSource: o, waitRequest: d, debounceTime: v }, { params: p, columns: P, setLoading: r, setColumns: F, removeRowKeys: y, syncSelectedRows: f, defaultState: h, setPagination: b, paginationInfo: $, onRequestError: te, onBeforeSearchSubmit: le, hasCustomRender: Re }, pe) {
|
|
1276
|
+
const ae = O(""), j = O(), me = O(!1), N = O([]), K = O(), Z = O(null), ue = () => {
|
|
1277
|
+
r(!1), x(!1);
|
|
1278
|
+
}, ye = async (D = {}) => {
|
|
1279
|
+
const { pagination: A, filters: I = {}, sorter: W = {}, removeKeys: re = [], isPolling: ne = !1, extra: he } = D;
|
|
1280
|
+
if (!n || !Ie(n))
|
|
1281
|
+
return o.value || [];
|
|
1282
|
+
ne ? x(!0) : r(!0), A && b(A);
|
|
1284
1283
|
try {
|
|
1285
|
-
let
|
|
1286
|
-
if (
|
|
1287
|
-
|
|
1284
|
+
let M = {};
|
|
1285
|
+
if (fe(A) && !A || fe($))
|
|
1286
|
+
M = {};
|
|
1288
1287
|
else {
|
|
1289
|
-
const { current:
|
|
1290
|
-
|
|
1288
|
+
const { current: G = 1, pageSize: ce = 10, total: se } = w($) || {};
|
|
1289
|
+
M.pageNum = Zt({ current: G, pageSize: ce, total: se }, re.length), re.length && y(re), M.pageSize = ce;
|
|
1291
1290
|
}
|
|
1292
|
-
const be =
|
|
1293
|
-
F(w(P).map((
|
|
1294
|
-
const
|
|
1291
|
+
const be = U(W) ? Object.keys(W).length ? [W] : [] : W;
|
|
1292
|
+
F(w(P).map((G) => {
|
|
1293
|
+
const ce = be.find((se) => (se?.columnKey || se?.field) === G.dataIndex);
|
|
1295
1294
|
return {
|
|
1296
|
-
...
|
|
1297
|
-
sortOrder:
|
|
1295
|
+
...G,
|
|
1296
|
+
sortOrder: ce?.order
|
|
1298
1297
|
};
|
|
1299
1298
|
}));
|
|
1300
|
-
let
|
|
1301
|
-
...
|
|
1299
|
+
let Ce = {
|
|
1300
|
+
...M,
|
|
1302
1301
|
...w(h),
|
|
1303
|
-
...
|
|
1302
|
+
...D.params
|
|
1304
1303
|
};
|
|
1305
|
-
le && Ie(le) && (
|
|
1306
|
-
params:
|
|
1304
|
+
le && Ie(le) && (Ce = await le({
|
|
1305
|
+
params: Ce,
|
|
1307
1306
|
sorter: be,
|
|
1308
|
-
filter:
|
|
1309
|
-
extra:
|
|
1307
|
+
filter: I,
|
|
1308
|
+
extra: he
|
|
1310
1309
|
}));
|
|
1311
|
-
let
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1310
|
+
let oe = [];
|
|
1311
|
+
const je = `use_request_${yt().uuid(10)}`;
|
|
1312
|
+
ae.value = je;
|
|
1313
|
+
const $e = await n?.({
|
|
1314
|
+
params: J(xe(Ce)),
|
|
1314
1315
|
sorter: be,
|
|
1315
|
-
filter:
|
|
1316
|
-
extra:
|
|
1316
|
+
filter: I,
|
|
1317
|
+
extra: he
|
|
1317
1318
|
});
|
|
1318
|
-
if (
|
|
1319
|
-
|
|
1320
|
-
|
|
1319
|
+
if (ae.value !== je)
|
|
1320
|
+
return [];
|
|
1321
|
+
if ($e) {
|
|
1322
|
+
const { success: G = !0, data: ce = [] } = $e;
|
|
1323
|
+
if (!G)
|
|
1321
1324
|
return [];
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
return
|
|
1325
|
-
total:
|
|
1326
|
-
}),
|
|
1325
|
+
oe = ce, i && Ie(i) && (oe = await i?.(oe)), f(oe);
|
|
1326
|
+
const se = $e.total || oe?.length || 0;
|
|
1327
|
+
return se !== w($)?.total && b({
|
|
1328
|
+
total: se || 0
|
|
1329
|
+
}), Be(oe, J(N.value.map((Me) => Ae(Me, "sortIndex")))) ? w(N) : (R(oe), oe);
|
|
1327
1330
|
} else
|
|
1328
1331
|
return [];
|
|
1329
|
-
} catch (
|
|
1332
|
+
} catch (M) {
|
|
1330
1333
|
if (te === void 0)
|
|
1331
|
-
throw new Error(
|
|
1332
|
-
|
|
1334
|
+
throw new Error(M);
|
|
1335
|
+
N.value === void 0 && R([]), te(M);
|
|
1333
1336
|
} finally {
|
|
1334
|
-
|
|
1337
|
+
ue();
|
|
1335
1338
|
}
|
|
1336
1339
|
return [];
|
|
1337
|
-
},
|
|
1338
|
-
if (
|
|
1340
|
+
}, ee = Vl(async (D) => {
|
|
1341
|
+
if (K.value && clearTimeout(K.value), !n)
|
|
1339
1342
|
return;
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1343
|
+
const A = new AbortController();
|
|
1344
|
+
Z.value = A;
|
|
1342
1345
|
try {
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
new Promise((
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
const I = await Promise.race([
|
|
1347
|
+
ye(D),
|
|
1348
|
+
new Promise((re, ne) => {
|
|
1349
|
+
Z.value?.signal?.addEventListener?.("abort", () => {
|
|
1350
|
+
ne("aborted"), ee.cancel(), ue();
|
|
1348
1351
|
});
|
|
1349
1352
|
})
|
|
1350
1353
|
]);
|
|
1351
|
-
if (
|
|
1354
|
+
if (A.signal.aborted)
|
|
1352
1355
|
return;
|
|
1353
|
-
const
|
|
1354
|
-
return
|
|
1355
|
-
|
|
1356
|
-
}, Math.max(
|
|
1357
|
-
} catch (
|
|
1358
|
-
if (
|
|
1356
|
+
const W = Ut(l.value, I);
|
|
1357
|
+
return W && !j.value && (K.value = setTimeout(() => {
|
|
1358
|
+
ee.run({ ...D, isPolling: W });
|
|
1359
|
+
}, Math.max(W, 2e3))), I;
|
|
1360
|
+
} catch (I) {
|
|
1361
|
+
if (I === "aborted")
|
|
1359
1362
|
return;
|
|
1360
|
-
throw
|
|
1363
|
+
throw I;
|
|
1361
1364
|
}
|
|
1362
|
-
},
|
|
1363
|
-
|
|
1365
|
+
}, v.value || 30), E = () => {
|
|
1366
|
+
Z.value?.abort(), ee.cancel(), ue();
|
|
1364
1367
|
};
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}),
|
|
1368
|
-
|
|
1369
|
-
}),
|
|
1370
|
-
|
|
1371
|
-
}, { immediate: !0 }),
|
|
1372
|
-
|
|
1373
|
-
}, { immediate: !0 }),
|
|
1374
|
-
|
|
1375
|
-
}, { deep: !0, immediate: !0 }),
|
|
1376
|
-
|
|
1377
|
-
}, { deep: !0, immediate: !0 }),
|
|
1378
|
-
|
|
1368
|
+
Et(() => {
|
|
1369
|
+
E(), j.value = !0, clearTimeout(K.value);
|
|
1370
|
+
}), Lt(() => {
|
|
1371
|
+
E(), j.value = !0, clearTimeout(K.value);
|
|
1372
|
+
}), Y(() => l.value, () => {
|
|
1373
|
+
d.value || (l.value ? ee.run({ isPolling: !0 }) : clearTimeout(K.value));
|
|
1374
|
+
}, { immediate: !0 }), Y(() => d.value, () => {
|
|
1375
|
+
d.value ? r(!0) : ee.run({ isPolling: !1 });
|
|
1376
|
+
}, { immediate: !0 }), Y(() => o.value, () => {
|
|
1377
|
+
o.value && R(o.value || []);
|
|
1378
|
+
}, { deep: !0, immediate: !0 }), Y(() => p.value, () => {
|
|
1379
|
+
d.value || a.value && (b({ current: 1 }), ve());
|
|
1380
|
+
}, { deep: !0, immediate: !0 }), Y(() => h.value, (D, A) => {
|
|
1381
|
+
d.value || Be(D, A) || (b({ current: 1 }), ve());
|
|
1379
1382
|
}, { deep: !0, immediate: !0 });
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1383
|
+
function ve() {
|
|
1384
|
+
n ? l.value || (E(), ee.run({ isPolling: !1 })) : R(o.value || []);
|
|
1382
1385
|
}
|
|
1383
|
-
const
|
|
1384
|
-
if (
|
|
1385
|
-
return w(
|
|
1386
|
-
const
|
|
1387
|
-
return !w(
|
|
1388
|
-
}),
|
|
1389
|
-
function
|
|
1390
|
-
|
|
1386
|
+
const t = C(() => {
|
|
1387
|
+
if (Re.value)
|
|
1388
|
+
return w(N);
|
|
1389
|
+
const D = P.value.filter((A) => A.show || A.show === void 0);
|
|
1390
|
+
return !w(N) || !D || D.length === 0 ? [] : w(N);
|
|
1391
|
+
}), u = C(() => w(N).some((D) => q(D.children) && D.children.length > 0));
|
|
1392
|
+
function x(D) {
|
|
1393
|
+
me.value = D;
|
|
1391
1394
|
}
|
|
1392
|
-
function
|
|
1393
|
-
|
|
1395
|
+
function g(D, A = {}, I = {}, W) {
|
|
1396
|
+
E(), ee.run({ pagination: D, filters: A, sorter: I, extra: W, isPolling: !1 });
|
|
1394
1397
|
}
|
|
1395
|
-
function
|
|
1396
|
-
const
|
|
1397
|
-
if (!
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
total:
|
|
1398
|
+
function R(D) {
|
|
1399
|
+
const A = Jt(J(D), w($.value));
|
|
1400
|
+
if (!Be(A, N.value) && (N.value = A, !n || !Ie(n))) {
|
|
1401
|
+
const I = A.length || 0;
|
|
1402
|
+
I !== w($)?.total && b({
|
|
1403
|
+
total: I
|
|
1401
1404
|
});
|
|
1402
1405
|
}
|
|
1403
1406
|
}
|
|
1404
1407
|
return {
|
|
1405
|
-
dataSource:
|
|
1406
|
-
isTreeDataRef:
|
|
1407
|
-
reSetDataList:
|
|
1408
|
-
changeDataValue: (
|
|
1409
|
-
const { key:
|
|
1410
|
-
switch (!
|
|
1408
|
+
dataSource: t,
|
|
1409
|
+
isTreeDataRef: u,
|
|
1410
|
+
reSetDataList: R,
|
|
1411
|
+
changeDataValue: (D) => {
|
|
1412
|
+
const { key: A, row: I, value: W, type: re = "update" } = D, ne = A ?? e.value, he = I?.[ne] ?? W;
|
|
1413
|
+
switch (!I && re !== "delete" && console.warn("row is required"), re) {
|
|
1411
1414
|
case "update":
|
|
1412
|
-
|
|
1415
|
+
ne && he && I && (N.value = N.value.map((M) => he === M[ne] ? Se(M, I) : M));
|
|
1413
1416
|
break;
|
|
1414
1417
|
case "push":
|
|
1415
|
-
|
|
1418
|
+
I && N.value.push(I);
|
|
1416
1419
|
break;
|
|
1417
1420
|
case "unshift":
|
|
1418
|
-
|
|
1421
|
+
I && N.value.unshift(I);
|
|
1419
1422
|
break;
|
|
1420
1423
|
case "delete":
|
|
1421
|
-
|
|
1424
|
+
ne && (N.value = N.value.filter((M) => W !== M[ne]));
|
|
1422
1425
|
break;
|
|
1423
1426
|
}
|
|
1424
1427
|
},
|
|
1425
|
-
handleTableChange:
|
|
1426
|
-
run: async (
|
|
1427
|
-
|
|
1428
|
+
handleTableChange: g,
|
|
1429
|
+
run: async (D) => {
|
|
1430
|
+
d.value || (n ? await ee.run({ ...D, isPolling: !1 }) : pe("reload"));
|
|
1428
1431
|
}
|
|
1429
1432
|
};
|
|
1430
1433
|
}
|
|
1431
1434
|
function Xl(e) {
|
|
1432
1435
|
const a = O(l(e.loading.value));
|
|
1433
|
-
|
|
1434
|
-
a.value = l(
|
|
1436
|
+
Y(() => e.loading.value, (i) => {
|
|
1437
|
+
a.value = l(i, a.value);
|
|
1435
1438
|
});
|
|
1436
|
-
function l(
|
|
1437
|
-
return
|
|
1439
|
+
function l(i, o = !1) {
|
|
1440
|
+
return fe(i) ? i : U(i) ? i?.spinning ?? o : o;
|
|
1438
1441
|
}
|
|
1439
|
-
function n(
|
|
1440
|
-
a.value =
|
|
1442
|
+
function n(i) {
|
|
1443
|
+
a.value = i;
|
|
1441
1444
|
}
|
|
1442
1445
|
return [a, n];
|
|
1443
1446
|
}
|
|
1444
|
-
const
|
|
1447
|
+
const Le = {
|
|
1445
1448
|
current: 1,
|
|
1446
1449
|
pageSize: 10,
|
|
1447
1450
|
size: "default",
|
|
@@ -1449,37 +1452,37 @@ const Ye = {
|
|
|
1449
1452
|
showSizeChanger: !0,
|
|
1450
1453
|
pageSizeOptions: ["10", "20", "50", "100"]
|
|
1451
1454
|
};
|
|
1452
|
-
function
|
|
1455
|
+
function _l({
|
|
1453
1456
|
pagination: e,
|
|
1454
1457
|
pageItemRender: a
|
|
1455
1458
|
}) {
|
|
1456
1459
|
const l = O({
|
|
1457
|
-
...
|
|
1458
|
-
}), n =
|
|
1459
|
-
pageNum:
|
|
1460
|
-
pageSize:
|
|
1460
|
+
...Le
|
|
1461
|
+
}), n = Qe({
|
|
1462
|
+
pageNum: Le.current,
|
|
1463
|
+
pageSize: Le.pageSize
|
|
1461
1464
|
});
|
|
1462
|
-
|
|
1465
|
+
Y(() => e.value, () => {
|
|
1463
1466
|
if (e.value === !1) {
|
|
1464
1467
|
l.value = !1;
|
|
1465
1468
|
return;
|
|
1466
1469
|
}
|
|
1467
|
-
const
|
|
1470
|
+
const o = Ie(a) ? {
|
|
1468
1471
|
itemRender: ({
|
|
1469
|
-
page:
|
|
1472
|
+
page: v,
|
|
1470
1473
|
type: p,
|
|
1471
1474
|
originalElement: P
|
|
1472
1475
|
}) => a ? a({
|
|
1473
|
-
page:
|
|
1476
|
+
page: v,
|
|
1474
1477
|
type: p,
|
|
1475
1478
|
originalElement: P
|
|
1476
1479
|
}) : null
|
|
1477
1480
|
} : null, d = {
|
|
1478
|
-
...
|
|
1481
|
+
...Le,
|
|
1479
1482
|
...e.value || {},
|
|
1480
|
-
...
|
|
1483
|
+
...o || {}
|
|
1481
1484
|
};
|
|
1482
|
-
e.value?.showTotal || (d.showTotal = (
|
|
1485
|
+
e.value?.showTotal || (d.showTotal = (v) => `共${v < d.pageSize ? 1 : Math.ceil(v / (d.pageSize || 10))}页 ${v}条记录`), l.value = d, Object.assign(n, {
|
|
1483
1486
|
pageNum: d.current,
|
|
1484
1487
|
pageSize: d.pageSize
|
|
1485
1488
|
});
|
|
@@ -1487,21 +1490,21 @@ function Ql({
|
|
|
1487
1490
|
deep: 1,
|
|
1488
1491
|
immediate: !0
|
|
1489
1492
|
});
|
|
1490
|
-
function
|
|
1491
|
-
if (
|
|
1493
|
+
function i(o) {
|
|
1494
|
+
if (U(l.value) && U(o)) {
|
|
1492
1495
|
const d = {};
|
|
1493
|
-
Object.keys(
|
|
1494
|
-
Object.prototype.hasOwnProperty.call(
|
|
1495
|
-
}), Object.keys(d).length > 0 && (Object.assign(l.value, d),
|
|
1496
|
+
Object.keys(o).forEach((v) => {
|
|
1497
|
+
Object.prototype.hasOwnProperty.call(o, v) && l.value[v] === o[v] || (d[v] = o[v]);
|
|
1498
|
+
}), Object.keys(d).length > 0 && (Object.assign(l.value, d), Ql(d) && Object.assign(n, d));
|
|
1496
1499
|
}
|
|
1497
1500
|
}
|
|
1498
1501
|
return {
|
|
1499
1502
|
paginationInfo: l,
|
|
1500
1503
|
requestPagination: n,
|
|
1501
|
-
setPagination:
|
|
1504
|
+
setPagination: i
|
|
1502
1505
|
};
|
|
1503
1506
|
}
|
|
1504
|
-
function
|
|
1507
|
+
function Ql(e) {
|
|
1505
1508
|
if (typeof e != "object" || e === null)
|
|
1506
1509
|
return !1;
|
|
1507
1510
|
const a = Object.keys(e);
|
|
@@ -1509,44 +1512,44 @@ function _l(e) {
|
|
|
1509
1512
|
}
|
|
1510
1513
|
function Ul(e, a) {
|
|
1511
1514
|
const l = O([]), n = O([]);
|
|
1512
|
-
|
|
1513
|
-
n.value =
|
|
1515
|
+
Y(() => a.value?.selectedRows, (r) => {
|
|
1516
|
+
n.value = J(r || []);
|
|
1514
1517
|
}, {
|
|
1515
1518
|
deep: !0,
|
|
1516
1519
|
immediate: !0
|
|
1517
|
-
}),
|
|
1518
|
-
l.value =
|
|
1520
|
+
}), Y(() => a.value?.selectedRowKeys, (r) => {
|
|
1521
|
+
l.value = el([...r || []]);
|
|
1519
1522
|
}, {
|
|
1520
1523
|
deep: !0,
|
|
1521
1524
|
immediate: !0
|
|
1522
1525
|
});
|
|
1523
|
-
const
|
|
1524
|
-
const
|
|
1525
|
-
e.value && (F ?
|
|
1526
|
-
},
|
|
1526
|
+
const i = (r, F) => {
|
|
1527
|
+
const y = a.value?.type || "checkbox";
|
|
1528
|
+
e.value && (F ? r?.[e.value] && y === "checkbox" ? (l.value.push(r[e.value]), n.value.push(r)) : (l.value = [r[e.value]], n.value = [r]) : (l.value = l.value.filter((f) => f !== r[e.value]), n.value = n.value.filter((f) => f[e.value] !== r[e.value])));
|
|
1529
|
+
}, o = () => {
|
|
1527
1530
|
a.value && a.value?.onChange?.(l.value, n.value);
|
|
1528
1531
|
};
|
|
1529
1532
|
return {
|
|
1530
1533
|
selectedKeys: l,
|
|
1531
1534
|
selectedItems: n,
|
|
1532
|
-
selectRowKey:
|
|
1533
|
-
selectAllRowKey: (
|
|
1534
|
-
e.value && (
|
|
1535
|
+
selectRowKey: i,
|
|
1536
|
+
selectAllRowKey: (r, F, y) => {
|
|
1537
|
+
e.value && (r ? F.map((f) => (l.value.every((h) => h !== f?.[e.value]) && f?.[e.value] && (l.value.push(f[e.value]), n.value.push(f)), f)) : y.map((f) => (l.value.includes(f?.[e.value]) && (l.value = l.value.filter((h) => h !== f[e.value]), n.value = n.value.filter((h) => h[e.value] !== f[e.value])), f)));
|
|
1535
1538
|
},
|
|
1536
|
-
removeRowKeys: (
|
|
1537
|
-
l.value = l.value.filter((F) => !
|
|
1539
|
+
removeRowKeys: (r) => {
|
|
1540
|
+
l.value = l.value.filter((F) => !r.includes(F)), n.value = n.value.filter((F) => !r.includes(F?.[e.value || ""])), o();
|
|
1538
1541
|
},
|
|
1539
|
-
changeRowKey:
|
|
1540
|
-
syncSelectedRows: (
|
|
1542
|
+
changeRowKey: o,
|
|
1543
|
+
syncSelectedRows: (r) => {
|
|
1541
1544
|
if (e.value && l.value.length !== n.value.length) {
|
|
1542
|
-
const F = n.value.map((
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
+
const F = n.value.map((f) => f[e.value]), y = l.value.filter((f) => !F.includes(f));
|
|
1546
|
+
r.forEach((f) => {
|
|
1547
|
+
y.includes(f[e.value]) && n.value.push(J(f));
|
|
1545
1548
|
});
|
|
1546
1549
|
}
|
|
1547
1550
|
},
|
|
1548
1551
|
clearAllRowKeys: () => {
|
|
1549
|
-
l.value = [], n.value = [],
|
|
1552
|
+
l.value = [], n.value = [], o();
|
|
1550
1553
|
}
|
|
1551
1554
|
};
|
|
1552
1555
|
}
|
|
@@ -1554,52 +1557,52 @@ function Jl(e) {
|
|
|
1554
1557
|
const a = {};
|
|
1555
1558
|
return e.forEach((l) => {
|
|
1556
1559
|
let n = l.initialValue;
|
|
1557
|
-
const
|
|
1558
|
-
l.valueType ? !n &&
|
|
1560
|
+
const i = ["select", "number"], o = ["date", "time", "dateRange"], d = ["treeSelect", "numberRange"];
|
|
1561
|
+
l.valueType ? !n && i.includes(l.valueType) ? n = void 0 : !n && o.includes(l.valueType) ? n = null : !n && d.includes(l.valueType) ? n = [] : n || (n = "") : n || (n = ""), l.name === "dateRange" ? (a[l.rangeStartName || "start"] = n ? n[0] : null, a[l.rangeEndName || "end"] = n ? n[1] : null) : l.name && (a[l.name] = n);
|
|
1559
1562
|
}), a;
|
|
1560
1563
|
}
|
|
1561
1564
|
function Zl({ searchMap: e, columns: a }) {
|
|
1562
1565
|
const l = O([]), n = O({});
|
|
1563
|
-
function
|
|
1564
|
-
|
|
1565
|
-
l.value.some((p) => p.name ===
|
|
1566
|
+
function i(o) {
|
|
1567
|
+
o.forEach((v) => {
|
|
1568
|
+
l.value.some((p) => p.name === v.name) ? l.value = l.value.map((p) => p.name === v.name ? { ...p, ...v } : p) : l.value.push(v);
|
|
1566
1569
|
});
|
|
1567
|
-
const d = Jl(
|
|
1570
|
+
const d = Jl(o);
|
|
1568
1571
|
n.value = { ...n.value, ...d };
|
|
1569
1572
|
}
|
|
1570
|
-
return
|
|
1571
|
-
const
|
|
1572
|
-
e.value?.forEach((d) =>
|
|
1573
|
-
}, { deep: !0 }),
|
|
1574
|
-
const
|
|
1573
|
+
return Y(() => e.value, () => {
|
|
1574
|
+
const o = [];
|
|
1575
|
+
e.value?.forEach((d) => o.push(d)), i(o);
|
|
1576
|
+
}, { deep: !0 }), Y(() => a.value, () => {
|
|
1577
|
+
const o = [];
|
|
1575
1578
|
a.value && a.value?.length && a.value.forEach((d) => {
|
|
1576
|
-
d.searchConfig &&
|
|
1577
|
-
}),
|
|
1579
|
+
d.searchConfig && o.push(d.searchConfig);
|
|
1580
|
+
}), i(o);
|
|
1578
1581
|
}, { deep: !0 }), { formCols: l, defaultState: n };
|
|
1579
1582
|
}
|
|
1580
|
-
function ea({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll:
|
|
1581
|
-
const P =
|
|
1582
|
-
let
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1585
|
-
|
|
1583
|
+
function ea({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: i, rowSelection: o, screens: d, innerWidth: v, scrollBreakpoint: p }) {
|
|
1584
|
+
const P = C(() => p.value ? Oe(p.value) ? v.value > p.value : bt(p.value) ? d.value?.[p.value] : d.value?.xl : d.value?.xl), r = C(() => {
|
|
1585
|
+
let y = 0;
|
|
1586
|
+
const f = w(o) ? 60 : 0, h = 150, b = J(w(a));
|
|
1587
|
+
b.forEach((le) => {
|
|
1588
|
+
y += Number.parseInt(String(le.width)) || 0;
|
|
1586
1589
|
});
|
|
1587
|
-
const te =
|
|
1588
|
-
return te !== 0 && (
|
|
1590
|
+
const te = b.filter((le) => !Reflect.has(le, "width")).length;
|
|
1591
|
+
return te !== 0 && (y += te * h), f && (y += f), y;
|
|
1589
1592
|
});
|
|
1590
|
-
return { proScroll:
|
|
1593
|
+
return { proScroll: C(() => i.value ? {} : e.value && pt(e.value).length ? w(e) : n.value ? {
|
|
1591
1594
|
y: e.value?.y || (d.value?.xl ? 400 : 235)
|
|
1592
|
-
} : l.value ? P.value ? {} :
|
|
1595
|
+
} : l.value ? P.value ? {} : fe(P.value) ? { x: r.value } : {} : {}), breakpoint: P };
|
|
1593
1596
|
}
|
|
1594
1597
|
function ta(e) {
|
|
1595
1598
|
const a = O(e.size.value || "middle");
|
|
1596
|
-
|
|
1599
|
+
Y(() => e.size.value, (n) => a.value = n);
|
|
1597
1600
|
function l(n) {
|
|
1598
1601
|
a.value = n || a.value;
|
|
1599
1602
|
}
|
|
1600
1603
|
return [a, l];
|
|
1601
1604
|
}
|
|
1602
|
-
const
|
|
1605
|
+
const Ge = (e) => ({
|
|
1603
1606
|
"&::-webkit-scrollbar": {
|
|
1604
1607
|
width: 4,
|
|
1605
1608
|
height: 4
|
|
@@ -1814,24 +1817,24 @@ const Ve = (e) => ({
|
|
|
1814
1817
|
}
|
|
1815
1818
|
},
|
|
1816
1819
|
[`&${e.componentCls}-beautify-scroll`]: {
|
|
1817
|
-
[`${e.antCls}-table-content`]:
|
|
1818
|
-
[`${e.antCls}-table-body`]:
|
|
1820
|
+
[`${e.antCls}-table-content`]: Ge(e),
|
|
1821
|
+
[`${e.antCls}-table-body`]: Ge(e),
|
|
1819
1822
|
[`${e.antCls}-table-empty`]: {
|
|
1820
|
-
[`${e.antCls}-table-content`]:
|
|
1823
|
+
[`${e.antCls}-table-content`]: Ge(e)
|
|
1821
1824
|
}
|
|
1822
1825
|
}
|
|
1823
1826
|
}
|
|
1824
1827
|
};
|
|
1825
1828
|
};
|
|
1826
1829
|
function aa(e) {
|
|
1827
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1830
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Q(e);
|
|
1828
1831
|
}
|
|
1829
1832
|
function na(e, a, l, n) {
|
|
1830
1833
|
if (!a) return e;
|
|
1831
|
-
let
|
|
1832
|
-
if (
|
|
1833
|
-
const
|
|
1834
|
-
return
|
|
1834
|
+
let i = e;
|
|
1835
|
+
if (U(a)) {
|
|
1836
|
+
const o = a.node === "a" ? "span" : a.node;
|
|
1837
|
+
return s(o, H(a?.attr || {}, {
|
|
1835
1838
|
class: [a.class, a.node === "a" ? `${l}-a` : ""],
|
|
1836
1839
|
onClick: a.click
|
|
1837
1840
|
}), aa(e) ? e : {
|
|
@@ -1840,499 +1843,500 @@ function na(e, a, l, n) {
|
|
|
1840
1843
|
}
|
|
1841
1844
|
switch (a) {
|
|
1842
1845
|
case "link":
|
|
1843
|
-
|
|
1846
|
+
i = s("span", {
|
|
1844
1847
|
class: [`${l}-a`, n]
|
|
1845
1848
|
}, [e]);
|
|
1846
1849
|
break;
|
|
1847
1850
|
case "time":
|
|
1848
|
-
|
|
1851
|
+
i = V(e).format("HH:mm:ss");
|
|
1849
1852
|
break;
|
|
1850
1853
|
case "dateMonth":
|
|
1851
|
-
|
|
1854
|
+
i = `${V(e).month() + 1}月`;
|
|
1852
1855
|
break;
|
|
1853
1856
|
case "date":
|
|
1854
|
-
|
|
1857
|
+
i = V(e).format("YYYY-MM-DD");
|
|
1855
1858
|
break;
|
|
1856
1859
|
case "dateTime":
|
|
1857
|
-
|
|
1860
|
+
i = V(e).format("YYYY-MM-DD HH:mm:ss");
|
|
1858
1861
|
break;
|
|
1859
1862
|
}
|
|
1860
|
-
return
|
|
1863
|
+
return i;
|
|
1861
1864
|
}
|
|
1862
1865
|
function oa(e, a) {
|
|
1863
1866
|
const l = a && a.current || 1, n = a && a.pageSize || 10;
|
|
1864
|
-
return e.filter((
|
|
1867
|
+
return e.filter((i, o) => o < l * n && o >= n * (l - 1));
|
|
1865
1868
|
}
|
|
1866
1869
|
function ia(e) {
|
|
1867
1870
|
const a = document.createElement("textarea");
|
|
1868
1871
|
a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
|
|
1869
1872
|
}
|
|
1870
1873
|
function ua(e) {
|
|
1871
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1874
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Q(e);
|
|
1872
1875
|
}
|
|
1873
1876
|
const ra = {
|
|
1874
1877
|
reload: !0,
|
|
1875
1878
|
fullScreen: !0
|
|
1876
|
-
}, sa = ml.useToken,
|
|
1879
|
+
}, sa = ml.useToken, Xe = /* @__PURE__ */ Te({
|
|
1877
1880
|
name: "GProTable",
|
|
1878
1881
|
inheritAttrs: !1,
|
|
1879
|
-
props:
|
|
1882
|
+
props: ge,
|
|
1880
1883
|
emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
|
|
1881
1884
|
slots: Object,
|
|
1882
1885
|
setup(e, {
|
|
1883
1886
|
emit: a,
|
|
1884
1887
|
slots: l,
|
|
1885
1888
|
attrs: n,
|
|
1886
|
-
expose:
|
|
1889
|
+
expose: i
|
|
1887
1890
|
}) {
|
|
1888
|
-
const
|
|
1891
|
+
const o = gt({
|
|
1889
1892
|
suffixCls: "table",
|
|
1890
1893
|
isPor: !0
|
|
1891
1894
|
}), {
|
|
1892
1895
|
wrapSSR: d,
|
|
1893
|
-
hashId:
|
|
1894
|
-
} =
|
|
1896
|
+
hashId: v
|
|
1897
|
+
} = Ue("ProBaseTable", [la], o), {
|
|
1895
1898
|
token: p
|
|
1896
|
-
} = sa(), P =
|
|
1899
|
+
} = sa(), P = _t(), r = vt(), {
|
|
1897
1900
|
width: F
|
|
1898
|
-
} = rl(),
|
|
1899
|
-
|
|
1901
|
+
} = rl(), y = O(!1), f = mt(), h = O(), b = O(), $ = O(e.waitRequest);
|
|
1902
|
+
dt(() => $.value = e.waitRequest);
|
|
1900
1903
|
const {
|
|
1901
1904
|
toggle: te,
|
|
1902
1905
|
isFullscreen: le
|
|
1903
|
-
} =
|
|
1906
|
+
} = Ct(h), Re = C(() => !r.value.xl), pe = C(() => (e.virtualScroll && bl(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), ae = C(() => {
|
|
1904
1907
|
if (e.form === !1) return !1;
|
|
1905
|
-
const
|
|
1908
|
+
const m = {
|
|
1906
1909
|
actions: {
|
|
1907
1910
|
resetReload: !0
|
|
1908
1911
|
},
|
|
1909
1912
|
resetText: "重置",
|
|
1910
1913
|
searchText: "查询"
|
|
1911
1914
|
};
|
|
1912
|
-
return
|
|
1913
|
-
}),
|
|
1914
|
-
const
|
|
1915
|
-
const
|
|
1916
|
-
return T.key =
|
|
1915
|
+
return U(e.form) ? Se(m, e.form) : m;
|
|
1916
|
+
}), j = C(() => ae.value === !1 ? {} : ae.value), me = C(() => j.value?.autoRequest ?? e.autoRequest), N = C(() => j.value?.actions), K = C(() => {
|
|
1917
|
+
const m = (e.columns || []).filter((T) => T.key || T.dataIndex).map((T) => {
|
|
1918
|
+
const S = T.key || T.dataIndex;
|
|
1919
|
+
return T.key = S, T.dataIndex = S, T.align = T.align || e.align, T.uuid = T.uuid || yt().uuid(15), T;
|
|
1917
1920
|
});
|
|
1918
|
-
return tl(
|
|
1921
|
+
return tl(m, {
|
|
1919
1922
|
align: e.align ?? "left",
|
|
1920
1923
|
showIndex: e.showIndex ?? !1
|
|
1921
1924
|
});
|
|
1922
|
-
}), [
|
|
1923
|
-
loading:
|
|
1924
|
-
}), [
|
|
1925
|
-
size:
|
|
1925
|
+
}), [Z, ue] = Xl({
|
|
1926
|
+
loading: _(e, "loading")
|
|
1927
|
+
}), [ye, ee] = ta({
|
|
1928
|
+
size: _(e, "size")
|
|
1926
1929
|
}), {
|
|
1927
|
-
paginationInfo:
|
|
1928
|
-
requestPagination:
|
|
1930
|
+
paginationInfo: E,
|
|
1931
|
+
requestPagination: ve,
|
|
1929
1932
|
setPagination: t
|
|
1930
|
-
} =
|
|
1931
|
-
pagination:
|
|
1932
|
-
pageItemRender:
|
|
1933
|
+
} = _l({
|
|
1934
|
+
pagination: _(e, "pagination"),
|
|
1935
|
+
pageItemRender: it({
|
|
1933
1936
|
slots: l,
|
|
1934
1937
|
props: e,
|
|
1935
1938
|
key: "pageItemRender"
|
|
1936
1939
|
})
|
|
1937
1940
|
}), {
|
|
1938
|
-
proScroll:
|
|
1939
|
-
breakpoint:
|
|
1941
|
+
proScroll: u,
|
|
1942
|
+
breakpoint: x
|
|
1940
1943
|
} = ea({
|
|
1941
|
-
scroll:
|
|
1942
|
-
autoScroll:
|
|
1943
|
-
modalScroll:
|
|
1944
|
-
neverScroll:
|
|
1945
|
-
rowSelection:
|
|
1946
|
-
scrollBreakpoint:
|
|
1944
|
+
scroll: _(e, "scroll"),
|
|
1945
|
+
autoScroll: _(e, "autoScroll"),
|
|
1946
|
+
modalScroll: _(e, "modalScroll"),
|
|
1947
|
+
neverScroll: _(e, "neverScroll"),
|
|
1948
|
+
rowSelection: _(e, "rowSelection"),
|
|
1949
|
+
scrollBreakpoint: _(e, "scrollBreakpoint"),
|
|
1947
1950
|
innerWidth: F,
|
|
1948
|
-
columns:
|
|
1949
|
-
screens:
|
|
1951
|
+
columns: K,
|
|
1952
|
+
screens: r
|
|
1950
1953
|
}), g = Hl(e), {
|
|
1951
|
-
proColumns:
|
|
1952
|
-
setColumns:
|
|
1953
|
-
changeColumns:
|
|
1954
|
-
resizeColumnWidth:
|
|
1954
|
+
proColumns: R,
|
|
1955
|
+
setColumns: c,
|
|
1956
|
+
changeColumns: D,
|
|
1957
|
+
resizeColumnWidth: A
|
|
1955
1958
|
} = ql({
|
|
1956
1959
|
...g,
|
|
1957
|
-
breakpoint:
|
|
1958
|
-
scroll:
|
|
1959
|
-
columns:
|
|
1960
|
+
breakpoint: x,
|
|
1961
|
+
scroll: u,
|
|
1962
|
+
columns: K
|
|
1960
1963
|
}), {
|
|
1961
|
-
formCols:
|
|
1962
|
-
defaultState:
|
|
1964
|
+
formCols: I,
|
|
1965
|
+
defaultState: W
|
|
1963
1966
|
} = Zl({
|
|
1964
|
-
searchMap:
|
|
1965
|
-
columns:
|
|
1967
|
+
searchMap: _(e, "searchMap"),
|
|
1968
|
+
columns: K
|
|
1966
1969
|
}), {
|
|
1967
|
-
selectedKeys:
|
|
1968
|
-
selectedItems:
|
|
1969
|
-
changeRowKey:
|
|
1970
|
-
selectRowKey:
|
|
1971
|
-
selectAllRowKey:
|
|
1972
|
-
syncSelectedRows:
|
|
1973
|
-
removeRowKeys:
|
|
1974
|
-
clearAllRowKeys:
|
|
1975
|
-
} = Ul(
|
|
1976
|
-
run:
|
|
1977
|
-
reSetDataList:
|
|
1978
|
-
changeDataValue:
|
|
1979
|
-
isTreeDataRef:
|
|
1970
|
+
selectedKeys: re,
|
|
1971
|
+
selectedItems: ne,
|
|
1972
|
+
changeRowKey: he,
|
|
1973
|
+
selectRowKey: M,
|
|
1974
|
+
selectAllRowKey: be,
|
|
1975
|
+
syncSelectedRows: Ce,
|
|
1976
|
+
removeRowKeys: oe,
|
|
1977
|
+
clearAllRowKeys: je
|
|
1978
|
+
} = Ul(_(e, "rowKey"), _(e, "rowSelection")), $e = Kl(e), {
|
|
1979
|
+
run: G,
|
|
1980
|
+
reSetDataList: ce,
|
|
1981
|
+
changeDataValue: se,
|
|
1982
|
+
isTreeDataRef: Me,
|
|
1980
1983
|
dataSource: Pe,
|
|
1981
|
-
handleTableChange:
|
|
1984
|
+
handleTableChange: Ze
|
|
1982
1985
|
} = Gl({
|
|
1983
|
-
|
|
1984
|
-
waitRequest:
|
|
1986
|
+
...$e,
|
|
1987
|
+
waitRequest: $
|
|
1985
1988
|
}, {
|
|
1986
|
-
loading:
|
|
1987
|
-
paginationInfo:
|
|
1989
|
+
loading: Z,
|
|
1990
|
+
paginationInfo: E,
|
|
1988
1991
|
setPagination: t,
|
|
1989
|
-
removeRowKeys:
|
|
1990
|
-
syncSelectedRows:
|
|
1991
|
-
setLoading:
|
|
1992
|
-
setColumns:
|
|
1993
|
-
|
|
1994
|
-
|
|
1992
|
+
removeRowKeys: oe,
|
|
1993
|
+
syncSelectedRows: Ce,
|
|
1994
|
+
setLoading: ue,
|
|
1995
|
+
setColumns: c,
|
|
1996
|
+
params: _(e, "params"),
|
|
1997
|
+
columns: R,
|
|
1998
|
+
defaultState: W,
|
|
1995
1999
|
onRequestError: e.onRequestError,
|
|
1996
2000
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit,
|
|
1997
|
-
hasCustomRender:
|
|
1998
|
-
}, a),
|
|
1999
|
-
size: w(
|
|
2000
|
-
scroll: w(
|
|
2001
|
+
hasCustomRender: C(() => qe(e.customRender || l?.customRender))
|
|
2002
|
+
}, a), Pt = C(() => ({
|
|
2003
|
+
size: w(ye),
|
|
2004
|
+
scroll: w(u),
|
|
2001
2005
|
dataSource: w(Pe),
|
|
2002
|
-
pagination: w(
|
|
2003
|
-
virtualScroll:
|
|
2004
|
-
columns: w(
|
|
2005
|
-
})),
|
|
2006
|
-
const
|
|
2007
|
-
return !
|
|
2008
|
-
spinning: e.showLoading ?
|
|
2009
|
-
...
|
|
2006
|
+
pagination: w(E),
|
|
2007
|
+
virtualScroll: pe.value,
|
|
2008
|
+
columns: w(R).filter((m) => m.show || m.show === void 0)
|
|
2009
|
+
})), et = C(() => {
|
|
2010
|
+
const m = U(e.loading) ? Ae(e.loading, "spinning") : {};
|
|
2011
|
+
return !m.indicator && f?.indicator?.value && (m.indicator = f?.indicator?.value), {
|
|
2012
|
+
spinning: e.showLoading ? qe(Z.value) : !1,
|
|
2013
|
+
...m
|
|
2010
2014
|
};
|
|
2011
|
-
}),
|
|
2012
|
-
let
|
|
2013
|
-
const T = e.direction === "rtl" ? "bottomLeft" : "right",
|
|
2014
|
-
if (
|
|
2015
|
-
const
|
|
2016
|
-
!
|
|
2015
|
+
}), tt = C(() => {
|
|
2016
|
+
let m;
|
|
2017
|
+
const T = e.direction === "rtl" ? "bottomLeft" : "right", S = w(E)?.position;
|
|
2018
|
+
if (S !== null && Array.isArray(S)) {
|
|
2019
|
+
const B = S.find((X) => X.includes("top")), z = S.find((X) => X.includes("bottom")), k = S.every((X) => `${X}` == "none");
|
|
2020
|
+
!B && !z && !k && (m = T), B && (m = B.toLowerCase().replace("top", "")), z && (m = z.toLowerCase().replace("bottom", ""));
|
|
2017
2021
|
} else
|
|
2018
|
-
|
|
2019
|
-
return
|
|
2022
|
+
m = T;
|
|
2023
|
+
return m;
|
|
2020
2024
|
});
|
|
2021
2025
|
kl(() => {
|
|
2022
|
-
|
|
2026
|
+
y.value && e.keepAliveReload ? G() : y.value = !0;
|
|
2023
2027
|
});
|
|
2024
|
-
const
|
|
2025
|
-
if (
|
|
2026
|
-
|
|
2027
|
-
params:
|
|
2028
|
+
const Ft = async (m, T) => {
|
|
2029
|
+
if (me.value) {
|
|
2030
|
+
G({
|
|
2031
|
+
params: m
|
|
2028
2032
|
});
|
|
2029
2033
|
return;
|
|
2030
2034
|
}
|
|
2031
|
-
T === "reset" ? (a("reset",
|
|
2032
|
-
params:
|
|
2033
|
-
})) : e.request && (a("submit",
|
|
2034
|
-
params:
|
|
2035
|
+
T === "reset" ? (a("reset", m), e.request && N.value?.resetReload && G({
|
|
2036
|
+
params: m
|
|
2037
|
+
})) : e.request && (a("submit", m), G({
|
|
2038
|
+
params: m
|
|
2035
2039
|
}));
|
|
2036
|
-
},
|
|
2037
|
-
t(
|
|
2038
|
-
},
|
|
2039
|
-
const
|
|
2040
|
-
current:
|
|
2040
|
+
}, lt = (m, T, S, B) => {
|
|
2041
|
+
t(st(m, ["current", "pageSize"])), Ze(m, T, S, B), a("change", m, T, S, B);
|
|
2042
|
+
}, Dt = (m, T) => {
|
|
2043
|
+
const S = {
|
|
2044
|
+
current: m,
|
|
2041
2045
|
pageSize: T,
|
|
2042
|
-
total:
|
|
2046
|
+
total: E.value && E.value?.total || 0
|
|
2043
2047
|
};
|
|
2044
|
-
t(
|
|
2045
|
-
},
|
|
2046
|
-
a("expandedRowsChange",
|
|
2047
|
-
},
|
|
2048
|
-
a("expand",
|
|
2049
|
-
},
|
|
2050
|
-
let
|
|
2048
|
+
t(S), a("change", S), Ze(S);
|
|
2049
|
+
}, It = (m) => {
|
|
2050
|
+
a("expandedRowsChange", m);
|
|
2051
|
+
}, Bt = (m, T) => {
|
|
2052
|
+
a("expand", m, T);
|
|
2053
|
+
}, Ot = (m, T) => A(m, T), At = (m, T, S) => {
|
|
2054
|
+
let B = m;
|
|
2051
2055
|
if (T) {
|
|
2052
|
-
const
|
|
2056
|
+
const z = q(m) ? typeof m?.[0]?.children == "string" ? m?.[0]?.children : "" : m ? m.toString() : "", k = S.tooltip === !1 ? {} : S.tooltip, X = S.tooltip === !1 ? 1 : Oe(k?.hiddenLine) && k?.hiddenLine > 0 ? k?.hiddenLine : 1, L = S.tooltip === !1 ? 0 : Oe(k?.width) ? k?.width : 0, Ne = S.tooltip !== !1 && bt(z) && L > 0 ? nl(z, {
|
|
2053
2057
|
cssObject: {
|
|
2054
2058
|
fontSize: "14px",
|
|
2055
2059
|
lineHeight: "22px",
|
|
2056
2060
|
fontFamily: P?.token?.value?.fontFamily || p?.value?.fontFamily,
|
|
2057
|
-
...
|
|
2061
|
+
...k?.targetStyle || {}
|
|
2058
2062
|
}
|
|
2059
|
-
}) : 0,
|
|
2060
|
-
class: `${
|
|
2061
|
-
}, [
|
|
2062
|
-
title:
|
|
2063
|
-
getPopupContainer: (
|
|
2064
|
-
},
|
|
2063
|
+
}) : 0, ze = document.querySelector(`.${o} .ant-table-tbody`), Ye = s("div", {
|
|
2064
|
+
class: `${o}-ellipsis-text`
|
|
2065
|
+
}, [m]), nt = () => S.tooltip === !1 || U(S.tooltip) && Ne < L && L > 0 ? Ye : s(we, H({
|
|
2066
|
+
title: m,
|
|
2067
|
+
getPopupContainer: (ke) => ze ?? ke?.parentNode?.parentNode
|
|
2068
|
+
}, U(S.tooltip) ? S.tooltip : {}, {
|
|
2065
2069
|
destroyTooltipOnHide: !0
|
|
2066
|
-
}), ua(
|
|
2067
|
-
default: () => [
|
|
2070
|
+
}), ua(Ye) ? Ye : {
|
|
2071
|
+
default: () => [Ye]
|
|
2068
2072
|
});
|
|
2069
|
-
if (
|
|
2070
|
-
class: `${
|
|
2073
|
+
if (B = s("div", {
|
|
2074
|
+
class: `${o}-ellipsis ${k?.class ?? ""}`,
|
|
2071
2075
|
style: {
|
|
2072
|
-
"-webkit-line-clamp":
|
|
2076
|
+
"-webkit-line-clamp": X
|
|
2073
2077
|
}
|
|
2074
|
-
}, [
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
class: `${
|
|
2078
|
-
}, [
|
|
2079
|
-
class: `${
|
|
2078
|
+
}, [nt()]), S.copyable) {
|
|
2079
|
+
const ke = typeof S.copyText == "function" ? S.copyText?.(S) : S.copyText || z;
|
|
2080
|
+
B = s("div", {
|
|
2081
|
+
class: `${o}-copyable`
|
|
2082
|
+
}, [s("div", {
|
|
2083
|
+
class: `${o}-ellipsis ${k?.class ?? ""}`,
|
|
2080
2084
|
style: {
|
|
2081
|
-
"-webkit-line-clamp":
|
|
2085
|
+
"-webkit-line-clamp": X
|
|
2082
2086
|
}
|
|
2083
|
-
}, [
|
|
2084
|
-
class: `${
|
|
2087
|
+
}, [nt()]), s(Kt, {
|
|
2088
|
+
class: `${o}-copyable-icon`,
|
|
2085
2089
|
onClick: () => {
|
|
2086
|
-
ia(
|
|
2090
|
+
ia(ke), gl.success("复制成功");
|
|
2087
2091
|
}
|
|
2088
2092
|
}, null)]);
|
|
2089
2093
|
}
|
|
2090
2094
|
}
|
|
2091
|
-
return
|
|
2095
|
+
return B;
|
|
2092
2096
|
};
|
|
2093
|
-
function
|
|
2094
|
-
const
|
|
2097
|
+
function at() {
|
|
2098
|
+
const m = ol({
|
|
2095
2099
|
slots: l,
|
|
2096
2100
|
props: e,
|
|
2097
2101
|
key: "emptyText"
|
|
2098
2102
|
});
|
|
2099
|
-
if (
|
|
2100
|
-
const
|
|
2101
|
-
return
|
|
2102
|
-
class:
|
|
2103
|
+
if (m !== !1 && f?.emptyText?.value !== !1) {
|
|
2104
|
+
const S = e.emptyTextProps?.extraProps || {}, B = m || f?.emptyText?.value, z = Q(B), k = z ? ft(B, S) : ht(q(B) ? B : [B]);
|
|
2105
|
+
return s("div", {
|
|
2106
|
+
class: ie(`${o}-empty-text`, v.value, e.emptyTextProps?.class),
|
|
2103
2107
|
style: e.emptyTextProps?.style
|
|
2104
|
-
}, [
|
|
2108
|
+
}, [z ? k : q(k) ? k.map((X) => _e(X, S)) : s(pl, null, null)]);
|
|
2105
2109
|
}
|
|
2106
2110
|
return null;
|
|
2107
2111
|
}
|
|
2108
|
-
const
|
|
2109
|
-
const
|
|
2112
|
+
const jt = () => {
|
|
2113
|
+
const m = it({
|
|
2110
2114
|
slots: l,
|
|
2111
2115
|
props: e,
|
|
2112
2116
|
key: "customRender"
|
|
2113
2117
|
});
|
|
2114
|
-
if (
|
|
2118
|
+
if (m) {
|
|
2115
2119
|
if (Pe.value?.length) {
|
|
2116
|
-
const T =
|
|
2117
|
-
return
|
|
2120
|
+
const T = J(w(Pe));
|
|
2121
|
+
return m?.({
|
|
2118
2122
|
dataSource: T,
|
|
2119
|
-
currentData: oa(T,
|
|
2123
|
+
currentData: oa(T, E.value)
|
|
2120
2124
|
});
|
|
2121
2125
|
}
|
|
2122
|
-
return
|
|
2126
|
+
return at();
|
|
2123
2127
|
}
|
|
2124
|
-
return
|
|
2128
|
+
return s(We, null, null);
|
|
2125
2129
|
};
|
|
2126
2130
|
return xl({
|
|
2127
|
-
tableSize:
|
|
2128
|
-
columns:
|
|
2129
|
-
cacheColumns:
|
|
2130
|
-
isMobile:
|
|
2131
|
-
formConfig:
|
|
2132
|
-
formAutoRequest:
|
|
2133
|
-
formActions:
|
|
2131
|
+
tableSize: ye,
|
|
2132
|
+
columns: R,
|
|
2133
|
+
cacheColumns: K,
|
|
2134
|
+
isMobile: Re,
|
|
2135
|
+
formConfig: j,
|
|
2136
|
+
formAutoRequest: me,
|
|
2137
|
+
formActions: N,
|
|
2134
2138
|
action: {
|
|
2135
|
-
setTableSize:
|
|
2136
|
-
reload: (
|
|
2139
|
+
setTableSize: ee,
|
|
2140
|
+
reload: (m) => G(m),
|
|
2137
2141
|
toggle: te
|
|
2138
2142
|
},
|
|
2139
2143
|
setPagination: t,
|
|
2140
|
-
changeColumns:
|
|
2141
|
-
}),
|
|
2144
|
+
changeColumns: D
|
|
2145
|
+
}), i({
|
|
2142
2146
|
formRef: () => ({
|
|
2143
2147
|
getFormState: () => ({
|
|
2144
2148
|
...e.params,
|
|
2145
|
-
...
|
|
2149
|
+
...b.value?.getFormState()
|
|
2146
2150
|
}),
|
|
2147
|
-
getFormInnerState: () =>
|
|
2148
|
-
restFormState: (
|
|
2149
|
-
|
|
2151
|
+
getFormInnerState: () => b.value?.getFormState() || {},
|
|
2152
|
+
restFormState: (m) => {
|
|
2153
|
+
$.value = !0, m && m?.(), b.value?.resetForm(!1), $.value = !1;
|
|
2150
2154
|
}
|
|
2151
2155
|
}),
|
|
2152
2156
|
actionRef: () => ({
|
|
2153
|
-
loading:
|
|
2157
|
+
loading: Z,
|
|
2154
2158
|
dataSource: Pe,
|
|
2155
|
-
pageState:
|
|
2156
|
-
pagination:
|
|
2157
|
-
selectedKeys:
|
|
2158
|
-
selectedItems:
|
|
2159
|
+
pageState: ve,
|
|
2160
|
+
pagination: E.value,
|
|
2161
|
+
selectedKeys: C(() => re.value),
|
|
2162
|
+
selectedItems: C(() => ne.value),
|
|
2159
2163
|
rowsSelection: {
|
|
2160
|
-
clear:
|
|
2161
|
-
select:
|
|
2162
|
-
remove:
|
|
2163
|
-
sync:
|
|
2164
|
-
selectAll:
|
|
2164
|
+
clear: je,
|
|
2165
|
+
select: M,
|
|
2166
|
+
remove: oe,
|
|
2167
|
+
sync: Ce,
|
|
2168
|
+
selectAll: be
|
|
2165
2169
|
},
|
|
2166
|
-
reload:
|
|
2167
|
-
getLoadingStatus: () => w(
|
|
2168
|
-
reloadAndReset: async (
|
|
2169
|
-
|
|
2170
|
+
reload: G,
|
|
2171
|
+
getLoadingStatus: () => w(Z),
|
|
2172
|
+
reloadAndReset: async (m) => {
|
|
2173
|
+
$.value = !0, t({
|
|
2170
2174
|
current: 1,
|
|
2171
|
-
pageSize:
|
|
2172
|
-
}),
|
|
2175
|
+
pageSize: ve?.pageSize || 10
|
|
2176
|
+
}), m?.callBack && (m?.wait ? await m?.callBack?.() : m?.callBack?.()), b.value?.resetForm(!1), $.value = !1;
|
|
2173
2177
|
},
|
|
2174
|
-
reSetDataList:
|
|
2175
|
-
setPageAndReload:
|
|
2178
|
+
reSetDataList: ce,
|
|
2179
|
+
setPageAndReload: lt,
|
|
2176
2180
|
setPagination: t,
|
|
2177
|
-
setDataValue:
|
|
2178
|
-
setLoading:
|
|
2181
|
+
setDataValue: se,
|
|
2182
|
+
setLoading: ue
|
|
2179
2183
|
})
|
|
2180
2184
|
}), () => {
|
|
2181
|
-
const
|
|
2185
|
+
const m = qe(e.customRender || l.customRender), T = l.actions?.() || e.actionProps?.actions, S = ll({
|
|
2182
2186
|
slots: l,
|
|
2183
2187
|
props: e,
|
|
2184
2188
|
keys: ["headerTitle", "titleTip", "settingExtra"],
|
|
2185
2189
|
render: !0
|
|
2186
2190
|
});
|
|
2187
|
-
return d(
|
|
2191
|
+
return d(s("div", {
|
|
2188
2192
|
ref: h,
|
|
2189
|
-
class:
|
|
2190
|
-
[`${
|
|
2191
|
-
[`${
|
|
2193
|
+
class: ie([{
|
|
2194
|
+
[`${v.value}`]: !0,
|
|
2195
|
+
[`${o}`]: !0,
|
|
2192
2196
|
[`${n.class}`]: n.class,
|
|
2193
|
-
[`${
|
|
2194
|
-
[`${
|
|
2195
|
-
[`${
|
|
2196
|
-
[`${
|
|
2197
|
+
[`${o}-beautify-scroll`]: fe(e.useDefaultScrollStyle) ? !e.useDefaultScrollStyle : !0,
|
|
2198
|
+
[`${o}-no-scroll`]: !Object.keys(w(u) || {}).length,
|
|
2199
|
+
[`${o}-table-tree`]: Me.value,
|
|
2200
|
+
[`${o}-full-screen`]: le.value
|
|
2197
2201
|
}]),
|
|
2198
2202
|
style: n.style
|
|
2199
|
-
}, [
|
|
2200
|
-
class: [`${
|
|
2201
|
-
}, [(
|
|
2202
|
-
ref:
|
|
2203
|
+
}, [s("div", {
|
|
2204
|
+
class: [`${o}-content`, v.value]
|
|
2205
|
+
}, [(I.value.length > 0 || !!l.form) && e.form !== !1 && s(jl, {
|
|
2206
|
+
ref: b,
|
|
2203
2207
|
modalScroll: e.modalScroll,
|
|
2204
2208
|
cardBordered: e.cardBordered,
|
|
2205
|
-
formCols:
|
|
2206
|
-
prefixCls:
|
|
2207
|
-
loading: w(
|
|
2208
|
-
onSearch:
|
|
2209
|
-
defaultState:
|
|
2209
|
+
formCols: I.value,
|
|
2210
|
+
prefixCls: o,
|
|
2211
|
+
loading: w(Z),
|
|
2212
|
+
onSearch: Ft,
|
|
2213
|
+
defaultState: W.value
|
|
2210
2214
|
}, {
|
|
2211
2215
|
default: l.form ? () => l.form?.() : null
|
|
2212
|
-
}),
|
|
2213
|
-
class:
|
|
2214
|
-
}, [
|
|
2216
|
+
}), s("div", {
|
|
2217
|
+
class: ie(v.value, `${o}-card`, e.cardBordered && `${o}-card-border`)
|
|
2218
|
+
}, [s(Wl, {
|
|
2215
2219
|
options: e.options ? {
|
|
2216
2220
|
...ra,
|
|
2217
|
-
...
|
|
2221
|
+
...U(e.options) ? e.options : {}
|
|
2218
2222
|
} : !1,
|
|
2219
2223
|
titleTipText: e.titleTipText,
|
|
2220
2224
|
actionsPlacement: e.actionProps?.placement,
|
|
2221
2225
|
actionsRender: T,
|
|
2222
|
-
headerTitle:
|
|
2223
|
-
titleTip:
|
|
2224
|
-
settingExtra:
|
|
2225
|
-
}, null),
|
|
2226
|
-
default: () => [
|
|
2227
|
-
class: `${
|
|
2228
|
-
}, [
|
|
2229
|
-
class:
|
|
2226
|
+
headerTitle: S.headerTitle,
|
|
2227
|
+
titleTip: S.titleTip,
|
|
2228
|
+
settingExtra: S.settingExtra
|
|
2229
|
+
}, null), m ? s(St, et.value, {
|
|
2230
|
+
default: () => [s("div", {
|
|
2231
|
+
class: `${o}-wrapper ${v.value}`
|
|
2232
|
+
}, [s("div", {
|
|
2233
|
+
class: ie(`${o}-list`, v.value, e.tableProps?.class),
|
|
2230
2234
|
style: e.tableProps?.style
|
|
2231
|
-
}, [
|
|
2235
|
+
}, [jt()]), e.pagination !== !1 && Pe.value?.length > 0 && s(vl, H({
|
|
2232
2236
|
class: {
|
|
2233
|
-
[`${
|
|
2234
|
-
[`${
|
|
2237
|
+
[`${o}-pagination ${v.value}`]: !0,
|
|
2238
|
+
[`${o}-pagination-${tt.value} ${v.value}`]: !!tt.value
|
|
2235
2239
|
}
|
|
2236
|
-
}, xe(w(
|
|
2237
|
-
onChange:
|
|
2240
|
+
}, xe(w(E)), {
|
|
2241
|
+
onChange: Dt
|
|
2238
2242
|
}), null)])]
|
|
2239
|
-
}) :
|
|
2243
|
+
}) : s(hl, H(st(e, Object.keys(Tt)), Pt.value, {
|
|
2240
2244
|
style: e.tableProps?.style,
|
|
2241
2245
|
class: e.tableProps?.class,
|
|
2242
|
-
loading:
|
|
2243
|
-
rowKey: (
|
|
2244
|
-
transformCellText: (
|
|
2245
|
-
e.transformCellText && typeof e.transformCellText && e.transformCellText?.(
|
|
2246
|
+
loading: et.value,
|
|
2247
|
+
rowKey: (B) => B[e.rowKey],
|
|
2248
|
+
transformCellText: (B) => {
|
|
2249
|
+
e.transformCellText && typeof e.transformCellText && e.transformCellText?.(B);
|
|
2246
2250
|
const {
|
|
2247
|
-
column:
|
|
2248
|
-
} =
|
|
2249
|
-
if (!
|
|
2250
|
-
const
|
|
2251
|
-
let
|
|
2252
|
-
if (q(
|
|
2253
|
-
if (
|
|
2254
|
-
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2257
|
-
} else
|
|
2258
|
-
return
|
|
2251
|
+
column: z
|
|
2252
|
+
} = B;
|
|
2253
|
+
if (!z) return B.text;
|
|
2254
|
+
const k = z?.key || z?.dataIndex;
|
|
2255
|
+
let X = !0, L = B.text;
|
|
2256
|
+
if (q(L))
|
|
2257
|
+
if (L.length === 0 || L.length === 1 && !Q(L[0])) {
|
|
2258
|
+
L = L?.[0];
|
|
2259
|
+
const Ne = al(L, z?.columnEmptyText || e?.columnEmptyText || "");
|
|
2260
|
+
X = Ne.success, L = na(Ne.value, z?.valueType || e.columns?.find((ze) => (ze.key || ze.dataIndex) === k)?.valueType, o, v.value);
|
|
2261
|
+
} else L[0]?.type === "template" && (L = L[0]?.children);
|
|
2262
|
+
return z?.ellipsis ? At(L, X, z) : L;
|
|
2259
2263
|
},
|
|
2260
2264
|
rowSelection: e.rowSelection ? {
|
|
2261
|
-
...
|
|
2262
|
-
selectedRowKeys:
|
|
2263
|
-
onSelect:
|
|
2264
|
-
onSelectAll:
|
|
2265
|
-
onChange:
|
|
2265
|
+
...Ae(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
|
|
2266
|
+
selectedRowKeys: re.value || [],
|
|
2267
|
+
onSelect: M,
|
|
2268
|
+
onSelectAll: be,
|
|
2269
|
+
onChange: he
|
|
2266
2270
|
} : void 0,
|
|
2267
|
-
onChange:
|
|
2268
|
-
onExpandedRowsChange:
|
|
2269
|
-
onExpand:
|
|
2270
|
-
onResizeColumn: (
|
|
2271
|
+
onChange: lt,
|
|
2272
|
+
onExpandedRowsChange: It,
|
|
2273
|
+
onExpand: Bt,
|
|
2274
|
+
onResizeColumn: (B, z) => Ot(B, z)
|
|
2271
2275
|
}), {
|
|
2272
2276
|
...l,
|
|
2273
|
-
emptyText: () =>
|
|
2277
|
+
emptyText: () => at()
|
|
2274
2278
|
})])])]));
|
|
2275
2279
|
};
|
|
2276
2280
|
}
|
|
2277
2281
|
});
|
|
2278
|
-
|
|
2282
|
+
Xe.install = (e) => (e.component(Xe.name, Xe), e);
|
|
2279
2283
|
function wa(e, a) {
|
|
2280
2284
|
function l() {
|
|
2281
|
-
const
|
|
2285
|
+
const r = {
|
|
2282
2286
|
params: {},
|
|
2283
2287
|
searchMap: []
|
|
2284
2288
|
};
|
|
2285
2289
|
if (a?.state) {
|
|
2286
|
-
if (
|
|
2287
|
-
return
|
|
2288
|
-
if (
|
|
2289
|
-
return
|
|
2290
|
+
if (He(a.state) && U(a.state.value))
|
|
2291
|
+
return Se(r, J(a.state.value));
|
|
2292
|
+
if (U(a.state) && !He(a.state))
|
|
2293
|
+
return Se(r, J(a.state));
|
|
2290
2294
|
}
|
|
2291
|
-
return
|
|
2295
|
+
return r;
|
|
2292
2296
|
}
|
|
2293
|
-
const n =
|
|
2297
|
+
const n = Qe(Se(l(), {
|
|
2294
2298
|
request: a?.request
|
|
2295
2299
|
}));
|
|
2296
|
-
a?.state &&
|
|
2300
|
+
a?.state && Y(() => a.state && He(a.state) ? a.state.value : a.state, () => {
|
|
2297
2301
|
p();
|
|
2298
2302
|
}, { deep: !0 });
|
|
2299
|
-
const
|
|
2300
|
-
...
|
|
2301
|
-
...
|
|
2302
|
-
})),
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
}),
|
|
2306
|
-
|
|
2303
|
+
const i = C(() => e?.value?.actionRef?.()), o = C(() => e?.value?.formRef?.()), d = C(() => ({
|
|
2304
|
+
...i.value?.pageState || {},
|
|
2305
|
+
...o.value?.getFormState?.() || {}
|
|
2306
|
+
})), v = O(!!i.value?.loading?.value);
|
|
2307
|
+
Y(() => i.value?.loading?.value, (r) => {
|
|
2308
|
+
v.value = !!r;
|
|
2309
|
+
}), Y(v, (r) => {
|
|
2310
|
+
i.value?.setLoading?.(!!r);
|
|
2307
2311
|
});
|
|
2308
2312
|
function p() {
|
|
2309
2313
|
il(n, l());
|
|
2310
2314
|
}
|
|
2311
|
-
function P(
|
|
2312
|
-
n.searchMap && (n.searchMap =
|
|
2315
|
+
function P(r, F) {
|
|
2316
|
+
n.searchMap && (n.searchMap = J(n.searchMap).map((y) => y.name === r ? Se(y, F) : y));
|
|
2313
2317
|
}
|
|
2314
2318
|
return {
|
|
2315
|
-
formRef:
|
|
2316
|
-
actionRef:
|
|
2319
|
+
formRef: o,
|
|
2320
|
+
actionRef: i,
|
|
2317
2321
|
tableState: n,
|
|
2318
2322
|
requestSearch: d,
|
|
2319
|
-
loading:
|
|
2320
|
-
dataSource:
|
|
2321
|
-
selectedKeys:
|
|
2322
|
-
selectedItems:
|
|
2323
|
-
rowsSelection:
|
|
2324
|
-
mutate: (
|
|
2325
|
-
reloadAndReset: (
|
|
2326
|
-
setPageAndReload: (
|
|
2327
|
-
setPagination: (
|
|
2328
|
-
setLoading: (
|
|
2329
|
-
setDataValue: (
|
|
2330
|
-
reload: (
|
|
2323
|
+
loading: v,
|
|
2324
|
+
dataSource: C(() => i?.value?.dataSource?.value || []),
|
|
2325
|
+
selectedKeys: C(() => i?.value?.selectedKeys?.value || []),
|
|
2326
|
+
selectedItems: C(() => i?.value?.selectedItems?.value || []),
|
|
2327
|
+
rowsSelection: i?.value?.rowsSelection,
|
|
2328
|
+
mutate: (r) => i.value?.reSetDataList?.(r),
|
|
2329
|
+
reloadAndReset: (r) => i.value?.reloadAndReset?.(r),
|
|
2330
|
+
setPageAndReload: (r, F, y, f) => i.value?.setPageAndReload?.(r, F, y, f),
|
|
2331
|
+
setPagination: (r) => i.value?.setPagination?.(r),
|
|
2332
|
+
setLoading: (r) => v.value = r,
|
|
2333
|
+
setDataValue: (r) => i.value?.setDataValue?.(r),
|
|
2334
|
+
reload: (r) => i.value?.reload?.(r),
|
|
2331
2335
|
updateSearchMap: P
|
|
2332
2336
|
};
|
|
2333
2337
|
}
|
|
2334
2338
|
export {
|
|
2335
|
-
|
|
2336
|
-
|
|
2339
|
+
Xe as GProTable,
|
|
2340
|
+
ge as proTableProps,
|
|
2337
2341
|
wa as useTable
|
|
2338
2342
|
};
|