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