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