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