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