@gx-design-vue/pro-table 0.2.0-beta.132 → 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 -1024
- package/dist/pro-table.umd.cjs +3 -3
- package/dist/props.d.ts +17 -4
- package/dist/types/TableTypings.d.ts +7 -6
- package/package.json +1 -1
package/dist/pro-table.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.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,286 +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
|
-
reload: () =>
|
|
1132
|
-
fullScreen: () =>
|
|
1133
|
-
},
|
|
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]);
|
|
1134
1148
|
return () => {
|
|
1135
|
-
const
|
|
1136
|
-
return
|
|
1137
|
-
prefixCls:
|
|
1149
|
+
const i = e.actionsRender || [];
|
|
1150
|
+
return r(wt, {
|
|
1151
|
+
prefixCls: a,
|
|
1138
1152
|
headerTitle: e.headerTitle,
|
|
1139
|
-
actions:
|
|
1153
|
+
actions: i,
|
|
1140
1154
|
actionsPlacement: e.actionsPlacement,
|
|
1141
|
-
settings:
|
|
1155
|
+
settings: C(n),
|
|
1142
1156
|
titleTip: e.titleTip,
|
|
1143
1157
|
titleTipText: e.titleTipText
|
|
1144
1158
|
}, null);
|
|
1145
1159
|
};
|
|
1146
1160
|
}
|
|
1147
1161
|
});
|
|
1148
|
-
function
|
|
1149
|
-
return
|
|
1162
|
+
function Ml(e) {
|
|
1163
|
+
return zt();
|
|
1150
1164
|
}
|
|
1151
|
-
function
|
|
1152
|
-
|
|
1165
|
+
function kl(e, a = !0, l) {
|
|
1166
|
+
Ml() ? jt(e, l) : a ? e() : Nt(e);
|
|
1153
1167
|
}
|
|
1154
|
-
function
|
|
1155
|
-
const
|
|
1168
|
+
function Hl(e) {
|
|
1169
|
+
const a = y(() => e.draggable), l = y(() => e.neverScroll), n = y(() => e.autoScroll);
|
|
1156
1170
|
return {
|
|
1157
|
-
draggable:
|
|
1158
|
-
neverScroll:
|
|
1171
|
+
draggable: a,
|
|
1172
|
+
neverScroll: l,
|
|
1159
1173
|
autoScroll: n
|
|
1160
1174
|
};
|
|
1161
1175
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const d =
|
|
1164
|
-
|
|
1176
|
+
function ql({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: i, neverScroll: o }) {
|
|
1177
|
+
const d = B([]);
|
|
1178
|
+
L([
|
|
1165
1179
|
() => e.value,
|
|
1166
|
-
() => l.value,
|
|
1167
1180
|
() => a.value,
|
|
1181
|
+
() => l.value,
|
|
1168
1182
|
() => n.value,
|
|
1169
|
-
() =>
|
|
1170
|
-
() =>
|
|
1171
|
-
() =>
|
|
1183
|
+
() => l.value,
|
|
1184
|
+
() => i.value,
|
|
1185
|
+
() => o.value
|
|
1172
1186
|
], () => {
|
|
1173
|
-
const f =
|
|
1174
|
-
|
|
1187
|
+
const f = F(xe(a.value));
|
|
1188
|
+
Le(f, xe(d.value)) || (d.value = J(f));
|
|
1175
1189
|
}, {
|
|
1176
1190
|
deep: !0,
|
|
1177
1191
|
immediate: !0
|
|
1178
1192
|
});
|
|
1179
|
-
const
|
|
1180
|
-
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"));
|
|
1181
1195
|
return [
|
|
1182
1196
|
...f,
|
|
1183
|
-
...
|
|
1184
|
-
...
|
|
1197
|
+
...h,
|
|
1198
|
+
...x
|
|
1185
1199
|
];
|
|
1186
1200
|
});
|
|
1187
|
-
function
|
|
1188
|
-
return f.sort((
|
|
1201
|
+
function p(f) {
|
|
1202
|
+
return f.sort((h, x) => Qt(h, x, "order", 0));
|
|
1189
1203
|
}
|
|
1190
|
-
function
|
|
1191
|
-
return
|
|
1192
|
-
if (
|
|
1193
|
-
return
|
|
1194
|
-
if (
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
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";
|
|
1197
1211
|
else {
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1212
|
+
const $ = C(a).find((q) => q.dataIndex === h.dataIndex);
|
|
1213
|
+
h.width = $?.width || "", h.fixed = $?.fixed;
|
|
1200
1214
|
}
|
|
1201
|
-
return
|
|
1215
|
+
return h;
|
|
1202
1216
|
});
|
|
1203
1217
|
}
|
|
1204
|
-
function
|
|
1205
|
-
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));
|
|
1206
1220
|
}
|
|
1207
|
-
function
|
|
1221
|
+
function P(f) {
|
|
1208
1222
|
if (f.length <= 0) {
|
|
1209
1223
|
d.value = [];
|
|
1210
1224
|
return;
|
|
1211
1225
|
}
|
|
1212
|
-
|
|
1226
|
+
Le(F(f), xe(d.value)) || (d.value = F(f));
|
|
1213
1227
|
}
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
show: f[
|
|
1218
|
-
fixed: f[
|
|
1219
|
-
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
|
|
1220
1234
|
} : {};
|
|
1221
|
-
return { ...
|
|
1235
|
+
return { ...h, ...x };
|
|
1222
1236
|
}));
|
|
1223
1237
|
}
|
|
1224
1238
|
return {
|
|
1225
|
-
breakpoint:
|
|
1226
|
-
proColumns:
|
|
1227
|
-
setColumns:
|
|
1228
|
-
changeColumns:
|
|
1229
|
-
resizeColumnWidth:
|
|
1239
|
+
breakpoint: l,
|
|
1240
|
+
proColumns: m,
|
|
1241
|
+
setColumns: P,
|
|
1242
|
+
changeColumns: b,
|
|
1243
|
+
resizeColumnWidth: s
|
|
1230
1244
|
};
|
|
1231
1245
|
}
|
|
1232
|
-
function
|
|
1233
|
-
const
|
|
1234
|
-
function
|
|
1246
|
+
function Vl(e, a) {
|
|
1247
|
+
const l = y(() => a), n = B(), i = B(e);
|
|
1248
|
+
function o() {
|
|
1235
1249
|
n.value && clearTimeout(n.value);
|
|
1236
1250
|
}
|
|
1237
|
-
async function d(...
|
|
1238
|
-
return
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
},
|
|
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);
|
|
1242
1256
|
}));
|
|
1243
1257
|
}
|
|
1244
|
-
return
|
|
1245
|
-
cancel:
|
|
1258
|
+
return Kt(o), {
|
|
1259
|
+
cancel: o,
|
|
1246
1260
|
run: d
|
|
1247
1261
|
};
|
|
1248
1262
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const l =
|
|
1263
|
+
function Kl(e) {
|
|
1264
|
+
const a = y(() => e.params), l = y(() => e.rowKey), n = y(() => e.polling), i = y(() => e.debounceTime), o = y(() => e.dataSource), d = y(() => e.autoRequest);
|
|
1251
1265
|
return {
|
|
1266
|
+
params: a,
|
|
1252
1267
|
rowKey: l,
|
|
1253
|
-
polling:
|
|
1268
|
+
polling: n,
|
|
1254
1269
|
request: e.request,
|
|
1255
1270
|
postData: e.postData,
|
|
1256
|
-
debounceTime:
|
|
1257
|
-
dataSource:
|
|
1271
|
+
debounceTime: i,
|
|
1272
|
+
dataSource: o,
|
|
1273
|
+
autoRequest: d
|
|
1258
1274
|
};
|
|
1259
1275
|
}
|
|
1260
|
-
function
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
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;
|
|
1267
1285
|
return;
|
|
1268
1286
|
}
|
|
1269
|
-
|
|
1287
|
+
N && $(N);
|
|
1270
1288
|
try {
|
|
1271
|
-
let
|
|
1272
|
-
if (
|
|
1273
|
-
|
|
1289
|
+
let H = {};
|
|
1290
|
+
if (me(N) && !N || me(q))
|
|
1291
|
+
H = {};
|
|
1274
1292
|
else {
|
|
1275
|
-
const { current:
|
|
1276
|
-
|
|
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;
|
|
1277
1295
|
}
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
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);
|
|
1281
1299
|
return {
|
|
1282
|
-
...
|
|
1283
|
-
sortOrder:
|
|
1300
|
+
...de,
|
|
1301
|
+
sortOrder: X?.order
|
|
1284
1302
|
};
|
|
1285
1303
|
}));
|
|
1286
1304
|
let Ce = {
|
|
1287
|
-
...
|
|
1288
|
-
...
|
|
1289
|
-
...
|
|
1305
|
+
...H,
|
|
1306
|
+
...C(x),
|
|
1307
|
+
...O.params
|
|
1290
1308
|
};
|
|
1291
|
-
|
|
1309
|
+
le && Ie(le) && (Ce = await le({
|
|
1292
1310
|
params: Ce,
|
|
1293
|
-
sorter:
|
|
1294
|
-
filter:
|
|
1295
|
-
extra:
|
|
1311
|
+
sorter: ye,
|
|
1312
|
+
filter: D,
|
|
1313
|
+
extra: ge
|
|
1296
1314
|
}));
|
|
1297
|
-
let
|
|
1298
|
-
const
|
|
1299
|
-
params:
|
|
1300
|
-
sorter:
|
|
1301
|
-
filter:
|
|
1302
|
-
extra:
|
|
1315
|
+
let oe = [];
|
|
1316
|
+
const $e = await i?.({
|
|
1317
|
+
params: J(xe(Ce)),
|
|
1318
|
+
sorter: ye,
|
|
1319
|
+
filter: D,
|
|
1320
|
+
extra: ge
|
|
1303
1321
|
});
|
|
1304
|
-
if (
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
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);
|
|
1310
1331
|
} else
|
|
1311
1332
|
return [];
|
|
1312
|
-
} catch (
|
|
1313
|
-
|
|
1333
|
+
} catch (H) {
|
|
1334
|
+
j.value === void 0 && R([]), ve("requestError", H);
|
|
1314
1335
|
} finally {
|
|
1315
|
-
|
|
1336
|
+
A.value = !1, ue();
|
|
1316
1337
|
}
|
|
1317
1338
|
return [];
|
|
1318
|
-
},
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
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();
|
|
1335
1379
|
}, { deep: !0, immediate: !0 });
|
|
1336
|
-
function
|
|
1337
|
-
|
|
1380
|
+
function ce() {
|
|
1381
|
+
i ? (!A.value || !n.value) && ae.run({ isPolling: !1 }) : R(d.value || []);
|
|
1338
1382
|
}
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1341
|
-
return
|
|
1342
|
-
const
|
|
1343
|
-
return !
|
|
1344
|
-
}),
|
|
1345
|
-
function
|
|
1346
|
-
|
|
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;
|
|
1347
1391
|
}
|
|
1348
|
-
function
|
|
1349
|
-
|
|
1392
|
+
function g(O, N = {}, D = {}, W) {
|
|
1393
|
+
Y(), ae.run({ pagination: O, filters: N, sorter: D, extra: W, isPolling: !1 });
|
|
1350
1394
|
}
|
|
1351
|
-
function
|
|
1352
|
-
const
|
|
1353
|
-
if (!
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1356
|
-
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
|
|
1357
1401
|
});
|
|
1358
1402
|
}
|
|
1359
1403
|
}
|
|
1360
1404
|
return {
|
|
1361
|
-
dataSource:
|
|
1362
|
-
isTreeDataRef:
|
|
1363
|
-
reSetDataList:
|
|
1364
|
-
changeDataValue: (
|
|
1365
|
-
const { key:
|
|
1366
|
-
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) {
|
|
1367
1411
|
case "update":
|
|
1368
|
-
|
|
1412
|
+
ne && ge && D && (j.value = j.value.map((H) => ge === H[ne] ? Se(H, D) : H));
|
|
1369
1413
|
break;
|
|
1370
1414
|
case "push":
|
|
1371
|
-
|
|
1415
|
+
D && j.value.push(D);
|
|
1372
1416
|
break;
|
|
1373
1417
|
case "unshift":
|
|
1374
|
-
|
|
1418
|
+
D && j.value.unshift(D);
|
|
1375
1419
|
break;
|
|
1376
1420
|
case "delete":
|
|
1377
|
-
|
|
1421
|
+
ne && (j.value = j.value.filter((H) => W !== H[ne]));
|
|
1378
1422
|
break;
|
|
1379
1423
|
}
|
|
1380
1424
|
},
|
|
1381
|
-
handleTableChange:
|
|
1382
|
-
|
|
1383
|
-
|
|
1425
|
+
handleTableChange: g,
|
|
1426
|
+
run: async (O) => {
|
|
1427
|
+
i ? (Y(), await ae.run({ ...O, isPolling: !1 })) : ve("reload");
|
|
1384
1428
|
}
|
|
1385
1429
|
};
|
|
1386
1430
|
}
|
|
1387
|
-
function
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
|
|
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);
|
|
1391
1435
|
});
|
|
1392
|
-
function
|
|
1393
|
-
return
|
|
1436
|
+
function l(i, o = !1) {
|
|
1437
|
+
return me(i) ? i : U(i) ? i?.spinning ?? o : o;
|
|
1394
1438
|
}
|
|
1395
|
-
function n(
|
|
1396
|
-
|
|
1439
|
+
function n(i) {
|
|
1440
|
+
a.value = i;
|
|
1397
1441
|
}
|
|
1398
|
-
return [
|
|
1442
|
+
return [a, n];
|
|
1399
1443
|
}
|
|
1400
|
-
const
|
|
1444
|
+
const Ye = {
|
|
1401
1445
|
current: 1,
|
|
1402
1446
|
pageSize: 10,
|
|
1403
1447
|
size: "default",
|
|
@@ -1405,37 +1449,37 @@ const ze = {
|
|
|
1405
1449
|
showSizeChanger: !0,
|
|
1406
1450
|
pageSizeOptions: ["10", "20", "50", "100"]
|
|
1407
1451
|
};
|
|
1408
|
-
function
|
|
1452
|
+
function Ql({
|
|
1409
1453
|
pagination: e,
|
|
1410
|
-
pageItemRender:
|
|
1454
|
+
pageItemRender: a
|
|
1411
1455
|
}) {
|
|
1412
|
-
const
|
|
1413
|
-
...
|
|
1414
|
-
}), n =
|
|
1415
|
-
pageNum:
|
|
1416
|
-
pageSize:
|
|
1456
|
+
const l = B({
|
|
1457
|
+
...Ye
|
|
1458
|
+
}), n = Qe({
|
|
1459
|
+
pageNum: Ye.current,
|
|
1460
|
+
pageSize: Ye.pageSize
|
|
1417
1461
|
});
|
|
1418
|
-
|
|
1462
|
+
L(() => e.value, () => {
|
|
1419
1463
|
if (e.value === !1) {
|
|
1420
|
-
|
|
1464
|
+
l.value = !1;
|
|
1421
1465
|
return;
|
|
1422
1466
|
}
|
|
1423
|
-
const
|
|
1467
|
+
const o = Ie(a) ? {
|
|
1424
1468
|
itemRender: ({
|
|
1425
|
-
page:
|
|
1426
|
-
type:
|
|
1427
|
-
originalElement:
|
|
1428
|
-
}) =>
|
|
1429
|
-
page:
|
|
1430
|
-
type:
|
|
1431
|
-
originalElement:
|
|
1469
|
+
page: m,
|
|
1470
|
+
type: p,
|
|
1471
|
+
originalElement: F
|
|
1472
|
+
}) => a ? a({
|
|
1473
|
+
page: m,
|
|
1474
|
+
type: p,
|
|
1475
|
+
originalElement: F
|
|
1432
1476
|
}) : null
|
|
1433
1477
|
} : null, d = {
|
|
1434
|
-
...
|
|
1478
|
+
...Ye,
|
|
1435
1479
|
...e.value || {},
|
|
1436
|
-
...
|
|
1480
|
+
...o || {}
|
|
1437
1481
|
};
|
|
1438
|
-
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, {
|
|
1439
1483
|
pageNum: d.current,
|
|
1440
1484
|
pageSize: d.pageSize
|
|
1441
1485
|
});
|
|
@@ -1443,139 +1487,119 @@ function el({
|
|
|
1443
1487
|
deep: 1,
|
|
1444
1488
|
immediate: !0
|
|
1445
1489
|
});
|
|
1446
|
-
function
|
|
1447
|
-
if (
|
|
1490
|
+
function i(o) {
|
|
1491
|
+
if (U(l.value) && U(o)) {
|
|
1448
1492
|
const d = {};
|
|
1449
|
-
Object.keys(
|
|
1450
|
-
Object.prototype.hasOwnProperty.call(
|
|
1451
|
-
}), 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));
|
|
1452
1496
|
}
|
|
1453
1497
|
}
|
|
1454
1498
|
return {
|
|
1455
|
-
paginationInfo:
|
|
1499
|
+
paginationInfo: l,
|
|
1456
1500
|
requestPagination: n,
|
|
1457
|
-
setPagination:
|
|
1501
|
+
setPagination: i
|
|
1458
1502
|
};
|
|
1459
1503
|
}
|
|
1460
|
-
function
|
|
1504
|
+
function _l(e) {
|
|
1461
1505
|
if (typeof e != "object" || e === null)
|
|
1462
1506
|
return !1;
|
|
1463
|
-
const
|
|
1464
|
-
return
|
|
1507
|
+
const a = Object.keys(e);
|
|
1508
|
+
return a.length === 2 && a.includes("pageNum") && a.includes("pageSize");
|
|
1465
1509
|
}
|
|
1466
|
-
function
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
n.value =
|
|
1510
|
+
function Ul(e, a) {
|
|
1511
|
+
const l = B([]), n = B([]);
|
|
1512
|
+
L(() => a.value?.selectedRows, (s) => {
|
|
1513
|
+
n.value = J(s || []);
|
|
1470
1514
|
}, {
|
|
1471
1515
|
deep: !0,
|
|
1472
1516
|
immediate: !0
|
|
1473
|
-
}),
|
|
1474
|
-
|
|
1517
|
+
}), L(() => a.value?.selectedRowKeys, (s) => {
|
|
1518
|
+
l.value = Zt([...s || []]);
|
|
1475
1519
|
}, {
|
|
1476
1520
|
deep: !0,
|
|
1477
1521
|
immediate: !0
|
|
1478
1522
|
});
|
|
1479
|
-
const
|
|
1480
|
-
const
|
|
1481
|
-
e.value && (
|
|
1482
|
-
},
|
|
1483
|
-
|
|
1523
|
+
const 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);
|
|
1484
1528
|
};
|
|
1485
1529
|
return {
|
|
1486
|
-
selectedKeys:
|
|
1530
|
+
selectedKeys: l,
|
|
1487
1531
|
selectedItems: n,
|
|
1488
|
-
selectRowKey:
|
|
1489
|
-
selectAllRowKey: (
|
|
1490
|
-
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)));
|
|
1491
1535
|
},
|
|
1492
|
-
removeRowKeys: (
|
|
1493
|
-
|
|
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();
|
|
1494
1538
|
},
|
|
1495
|
-
changeRowKey:
|
|
1496
|
-
syncSelectedRows: (
|
|
1497
|
-
if (e.value &&
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1500
|
-
|
|
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));
|
|
1501
1545
|
});
|
|
1502
1546
|
}
|
|
1503
1547
|
},
|
|
1504
1548
|
clearAllRowKeys: () => {
|
|
1505
|
-
|
|
1549
|
+
l.value = [], n.value = [], o();
|
|
1506
1550
|
}
|
|
1507
1551
|
};
|
|
1508
1552
|
}
|
|
1509
|
-
function
|
|
1510
|
-
const
|
|
1511
|
-
return e.forEach((
|
|
1512
|
-
let n =
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1515
|
-
}),
|
|
1553
|
+
function Jl(e) {
|
|
1554
|
+
const a = {};
|
|
1555
|
+
return e.forEach((l) => {
|
|
1556
|
+
let n = l.initialValue;
|
|
1557
|
+
const 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;
|
|
1516
1560
|
}
|
|
1517
|
-
function
|
|
1518
|
-
const
|
|
1519
|
-
function
|
|
1520
|
-
o.forEach((
|
|
1521
|
-
|
|
1522
|
-
...v,
|
|
1523
|
-
...R
|
|
1524
|
-
} : 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);
|
|
1525
1566
|
});
|
|
1567
|
+
const d = Jl(o);
|
|
1568
|
+
n.value = { ...n.value, ...d };
|
|
1526
1569
|
}
|
|
1527
|
-
|
|
1528
|
-
const
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
s[f] || (s[f] = v[f]);
|
|
1537
|
-
}
|
|
1538
|
-
(o === "all" || o === "params") && (n({ current: 1 }), Ee(s, {
|
|
1539
|
-
...l.value || {}
|
|
1540
|
-
}));
|
|
1541
|
-
};
|
|
1542
|
-
qt(() => {
|
|
1543
|
-
y("all");
|
|
1544
|
-
}), z(() => l.value, () => {
|
|
1545
|
-
y("params");
|
|
1546
|
-
}, { deep: !0 }), z(() => e.value, () => {
|
|
1547
|
-
y("searchMap");
|
|
1548
|
-
}, { deep: !0 }), z(() => a.value, () => {
|
|
1549
|
-
y("columns");
|
|
1550
|
-
}, { deep: !0 });
|
|
1551
|
-
function P(o) {
|
|
1552
|
-
n({ current: 1 }), Ee(s, { ...o });
|
|
1553
|
-
}
|
|
1554
|
-
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 };
|
|
1555
1579
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1558
|
-
let
|
|
1559
|
-
const f =
|
|
1560
|
-
|
|
1561
|
-
|
|
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;
|
|
1562
1586
|
});
|
|
1563
|
-
const
|
|
1564
|
-
return
|
|
1587
|
+
const q = x.filter((le) => !Reflect.has(le, "width")).length;
|
|
1588
|
+
return q !== 0 && (b += q * h), f && (b += f), b;
|
|
1565
1589
|
});
|
|
1566
|
-
return { proScroll:
|
|
1590
|
+
return { proScroll: y(() => i.value ? {} : e.value && gt(e.value).length ? C(e) : n.value ? {
|
|
1567
1591
|
y: e.value?.y || (d.value?.xl ? 400 : 235)
|
|
1568
|
-
} :
|
|
1592
|
+
} : l.value ? F.value ? {} : me(F.value) ? { x: s.value } : {} : {}), breakpoint: F };
|
|
1569
1593
|
}
|
|
1570
|
-
function
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1573
|
-
function
|
|
1574
|
-
|
|
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;
|
|
1575
1599
|
}
|
|
1576
|
-
return [
|
|
1600
|
+
return [a, l];
|
|
1577
1601
|
}
|
|
1578
|
-
const
|
|
1602
|
+
const Ke = (e) => ({
|
|
1579
1603
|
"&::-webkit-scrollbar": {
|
|
1580
1604
|
width: 4,
|
|
1581
1605
|
height: 4
|
|
@@ -1588,10 +1612,17 @@ const Ve = (e) => ({
|
|
|
1588
1612
|
backgroundColor: "rgba(144,147,153,0.3)",
|
|
1589
1613
|
borderRadius: e.borderRadiusSM
|
|
1590
1614
|
}
|
|
1591
|
-
}),
|
|
1592
|
-
const
|
|
1615
|
+
}), la = (e) => {
|
|
1616
|
+
const a = `${e.antCls}-table`;
|
|
1593
1617
|
return {
|
|
1594
1618
|
[e.componentCls]: {
|
|
1619
|
+
[`${a}-cell a`]: {
|
|
1620
|
+
cursor: "pointer",
|
|
1621
|
+
color: e.colorPrimary,
|
|
1622
|
+
"&:hover": {
|
|
1623
|
+
color: e.colorPrimaryHover
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1595
1626
|
"&-a": {
|
|
1596
1627
|
cursor: "pointer",
|
|
1597
1628
|
color: e.colorPrimary,
|
|
@@ -1599,8 +1630,8 @@ const Ve = (e) => ({
|
|
|
1599
1630
|
color: e.colorPrimaryHover
|
|
1600
1631
|
}
|
|
1601
1632
|
},
|
|
1602
|
-
[`${
|
|
1603
|
-
[`${
|
|
1633
|
+
[`${a}`]: {
|
|
1634
|
+
[`${a}-cell-ellipsis`]: {
|
|
1604
1635
|
overflow: "unset",
|
|
1605
1636
|
whiteSpace: "unset"
|
|
1606
1637
|
}
|
|
@@ -1783,516 +1814,524 @@ const Ve = (e) => ({
|
|
|
1783
1814
|
}
|
|
1784
1815
|
},
|
|
1785
1816
|
[`&${e.componentCls}-beautify-scroll`]: {
|
|
1786
|
-
[`${e.antCls}-table-content`]:
|
|
1787
|
-
[`${e.antCls}-table-body`]:
|
|
1817
|
+
[`${e.antCls}-table-content`]: Ke(e),
|
|
1818
|
+
[`${e.antCls}-table-body`]: Ke(e),
|
|
1788
1819
|
[`${e.antCls}-table-empty`]: {
|
|
1789
|
-
[`${e.antCls}-table-content`]:
|
|
1820
|
+
[`${e.antCls}-table-content`]: Ke(e)
|
|
1790
1821
|
}
|
|
1791
1822
|
}
|
|
1792
1823
|
}
|
|
1793
1824
|
};
|
|
1794
1825
|
};
|
|
1795
|
-
function
|
|
1796
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1826
|
+
function aa(e) {
|
|
1827
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
1797
1828
|
}
|
|
1798
|
-
function
|
|
1799
|
-
if (!
|
|
1800
|
-
let
|
|
1801
|
-
if (
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
1804
|
-
class: [
|
|
1805
|
-
onClick:
|
|
1806
|
-
}),
|
|
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 : {
|
|
1807
1838
|
default: () => [e]
|
|
1808
1839
|
});
|
|
1809
1840
|
}
|
|
1810
|
-
switch (
|
|
1841
|
+
switch (a) {
|
|
1811
1842
|
case "link":
|
|
1812
|
-
|
|
1813
|
-
class: [`${
|
|
1843
|
+
i = r("span", {
|
|
1844
|
+
class: [`${l}-a`, n]
|
|
1814
1845
|
}, [e]);
|
|
1815
1846
|
break;
|
|
1816
1847
|
case "time":
|
|
1817
|
-
|
|
1848
|
+
i = K(e).format("HH:mm:ss");
|
|
1818
1849
|
break;
|
|
1819
1850
|
case "dateMonth":
|
|
1820
|
-
|
|
1851
|
+
i = `${K(e).month() + 1}月`;
|
|
1821
1852
|
break;
|
|
1822
1853
|
case "date":
|
|
1823
|
-
|
|
1854
|
+
i = K(e).format("YYYY-MM-DD");
|
|
1824
1855
|
break;
|
|
1825
1856
|
case "dateTime":
|
|
1826
|
-
|
|
1857
|
+
i = K(e).format("YYYY-MM-DD HH:mm:ss");
|
|
1827
1858
|
break;
|
|
1828
1859
|
}
|
|
1829
|
-
return
|
|
1860
|
+
return i;
|
|
1830
1861
|
}
|
|
1831
|
-
function
|
|
1832
|
-
const
|
|
1833
|
-
return e.filter((
|
|
1862
|
+
function oa(e, a) {
|
|
1863
|
+
const l = a && a.current || 1, n = a && a.pageSize || 10;
|
|
1864
|
+
return e.filter((i, o) => o < l * n && o >= n * (l - 1));
|
|
1834
1865
|
}
|
|
1835
|
-
function
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1866
|
+
function ia(e) {
|
|
1867
|
+
const a = document.createElement("textarea");
|
|
1868
|
+
a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
|
|
1838
1869
|
}
|
|
1839
|
-
function
|
|
1840
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1870
|
+
function ua(e) {
|
|
1871
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
1841
1872
|
}
|
|
1842
|
-
const
|
|
1873
|
+
const sa = {
|
|
1843
1874
|
reload: !0,
|
|
1844
1875
|
fullScreen: !0
|
|
1845
|
-
},
|
|
1876
|
+
}, ra = ml.useToken, Ge = /* @__PURE__ */ Te({
|
|
1846
1877
|
name: "GProTable",
|
|
1847
1878
|
inheritAttrs: !1,
|
|
1848
|
-
props:
|
|
1879
|
+
props: pe,
|
|
1849
1880
|
emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
|
|
1850
1881
|
slots: Object,
|
|
1851
1882
|
setup(e, {
|
|
1852
|
-
emit:
|
|
1853
|
-
slots:
|
|
1883
|
+
emit: a,
|
|
1884
|
+
slots: l,
|
|
1854
1885
|
attrs: n,
|
|
1855
|
-
expose:
|
|
1886
|
+
expose: i
|
|
1856
1887
|
}) {
|
|
1857
|
-
const
|
|
1888
|
+
const o = ht({
|
|
1858
1889
|
suffixCls: "table",
|
|
1859
1890
|
isPor: !0
|
|
1860
1891
|
}), {
|
|
1861
1892
|
wrapSSR: d,
|
|
1862
|
-
hashId:
|
|
1863
|
-
} =
|
|
1864
|
-
token:
|
|
1865
|
-
} =
|
|
1866
|
-
width:
|
|
1867
|
-
} =
|
|
1868
|
-
|
|
1893
|
+
hashId: 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);
|
|
1869
1900
|
const {
|
|
1870
|
-
toggle:
|
|
1901
|
+
toggle: q,
|
|
1871
1902
|
isFullscreen: le
|
|
1872
|
-
} = bt(
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
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;
|
|
1882
1917
|
});
|
|
1883
|
-
return
|
|
1918
|
+
return tl(v, {
|
|
1884
1919
|
align: e.align ?? "left",
|
|
1885
1920
|
showIndex: e.showIndex ?? !1
|
|
1886
1921
|
});
|
|
1887
|
-
}), [
|
|
1888
|
-
loading:
|
|
1889
|
-
}), [
|
|
1890
|
-
size:
|
|
1922
|
+
}), [ee, ue] = Xl({
|
|
1923
|
+
loading: te(e, "loading")
|
|
1924
|
+
}), [be, ae] = ta({
|
|
1925
|
+
size: te(e, "size")
|
|
1891
1926
|
}), {
|
|
1892
|
-
paginationInfo:
|
|
1893
|
-
requestPagination:
|
|
1894
|
-
setPagination:
|
|
1895
|
-
} =
|
|
1896
|
-
pagination:
|
|
1927
|
+
paginationInfo: Y,
|
|
1928
|
+
requestPagination: ce,
|
|
1929
|
+
setPagination: t
|
|
1930
|
+
} = Ql({
|
|
1931
|
+
pagination: te(e, "pagination"),
|
|
1897
1932
|
pageItemRender: ot({
|
|
1898
|
-
slots:
|
|
1933
|
+
slots: l,
|
|
1899
1934
|
props: e,
|
|
1900
1935
|
key: "pageItemRender"
|
|
1901
1936
|
})
|
|
1902
1937
|
}), {
|
|
1903
|
-
proScroll:
|
|
1904
|
-
breakpoint:
|
|
1905
|
-
} =
|
|
1906
|
-
scroll:
|
|
1907
|
-
autoScroll:
|
|
1908
|
-
modalScroll:
|
|
1909
|
-
neverScroll:
|
|
1910
|
-
rowSelection:
|
|
1911
|
-
scrollBreakpoint:
|
|
1912
|
-
innerWidth:
|
|
1913
|
-
columns:
|
|
1914
|
-
screens:
|
|
1915
|
-
}), g =
|
|
1916
|
-
proColumns:
|
|
1917
|
-
setColumns:
|
|
1918
|
-
changeColumns:
|
|
1919
|
-
resizeColumnWidth:
|
|
1920
|
-
} =
|
|
1938
|
+
proScroll: 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({
|
|
1921
1956
|
...g,
|
|
1922
|
-
breakpoint:
|
|
1923
|
-
scroll:
|
|
1924
|
-
columns:
|
|
1957
|
+
breakpoint: S,
|
|
1958
|
+
scroll: u,
|
|
1959
|
+
columns: G
|
|
1925
1960
|
}), {
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
searchMap: q(e, "searchMap"),
|
|
1932
|
-
params: q(e, "params"),
|
|
1933
|
-
columns: ne,
|
|
1934
|
-
setPagination: r
|
|
1961
|
+
formCols: D,
|
|
1962
|
+
defaultState: W
|
|
1963
|
+
} = Zl({
|
|
1964
|
+
searchMap: te(e, "searchMap"),
|
|
1965
|
+
columns: G
|
|
1935
1966
|
}), {
|
|
1936
|
-
selectedKeys:
|
|
1937
|
-
selectedItems:
|
|
1938
|
-
changeRowKey:
|
|
1939
|
-
selectRowKey:
|
|
1940
|
-
selectAllRowKey:
|
|
1941
|
-
syncSelectedRows:
|
|
1942
|
-
removeRowKeys:
|
|
1943
|
-
clearAllRowKeys: $
|
|
1944
|
-
} =
|
|
1945
|
-
|
|
1946
|
-
reSetDataList:
|
|
1947
|
-
changeDataValue:
|
|
1948
|
-
isTreeDataRef:
|
|
1949
|
-
dataSource:
|
|
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,
|
|
1950
1981
|
handleTableChange: Je
|
|
1951
|
-
} =
|
|
1952
|
-
...
|
|
1953
|
-
waitRequest:
|
|
1982
|
+
} = Gl({
|
|
1983
|
+
...de,
|
|
1984
|
+
waitRequest: $
|
|
1954
1985
|
}, {
|
|
1955
|
-
loading:
|
|
1956
|
-
paginationInfo:
|
|
1957
|
-
setPagination:
|
|
1958
|
-
removeRowKeys:
|
|
1959
|
-
syncSelectedRows:
|
|
1960
|
-
setLoading:
|
|
1961
|
-
setColumns:
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
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,
|
|
1965
1995
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit,
|
|
1966
|
-
hasCustomRender:
|
|
1967
|
-
},
|
|
1968
|
-
size:
|
|
1969
|
-
scroll:
|
|
1970
|
-
dataSource:
|
|
1971
|
-
pagination:
|
|
1972
|
-
virtualScroll:
|
|
1973
|
-
columns:
|
|
1974
|
-
})), Ze =
|
|
1975
|
-
const
|
|
1976
|
-
return !
|
|
1977
|
-
spinning: e.showLoading ?
|
|
1978
|
-
...
|
|
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
|
|
1979
2009
|
};
|
|
1980
|
-
}), et =
|
|
1981
|
-
let
|
|
1982
|
-
const
|
|
1983
|
-
if (
|
|
1984
|
-
const
|
|
1985
|
-
!
|
|
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", ""));
|
|
1986
2016
|
} else
|
|
1987
|
-
|
|
1988
|
-
return
|
|
2017
|
+
v = T;
|
|
2018
|
+
return v;
|
|
1989
2019
|
});
|
|
1990
|
-
|
|
1991
|
-
|
|
2020
|
+
kl(() => {
|
|
2021
|
+
b.value && e.keepAliveReload ? X() : b.value = !0;
|
|
1992
2022
|
});
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
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, {
|
|
2016
2052
|
cssObject: {
|
|
2017
2053
|
fontSize: "14px",
|
|
2018
2054
|
lineHeight: "22px",
|
|
2019
|
-
fontFamily:
|
|
2020
|
-
...
|
|
2055
|
+
fontFamily: F?.token?.value?.fontFamily || p?.value?.fontFamily,
|
|
2056
|
+
...M?.targetStyle || {}
|
|
2021
2057
|
}
|
|
2022
|
-
}) : 0, je = document.querySelector(`.${
|
|
2023
|
-
class: `${
|
|
2024
|
-
}, [
|
|
2025
|
-
title:
|
|
2026
|
-
getPopupContainer: (
|
|
2027
|
-
},
|
|
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 : {}, {
|
|
2028
2064
|
destroyTooltipOnHide: !0
|
|
2029
|
-
}),
|
|
2030
|
-
default: () => [
|
|
2065
|
+
}), ua(Ne) ? Ne : {
|
|
2066
|
+
default: () => [Ne]
|
|
2031
2067
|
});
|
|
2032
|
-
if (
|
|
2033
|
-
class: `${
|
|
2068
|
+
if (I = r("div", {
|
|
2069
|
+
class: `${o}-ellipsis ${M?.class ?? ""}`,
|
|
2034
2070
|
style: {
|
|
2035
|
-
"-webkit-line-clamp":
|
|
2071
|
+
"-webkit-line-clamp": Q
|
|
2036
2072
|
}
|
|
2037
|
-
}, [
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2040
|
-
class: `${
|
|
2041
|
-
}, [
|
|
2042
|
-
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 ?? ""}`,
|
|
2043
2079
|
style: {
|
|
2044
|
-
"-webkit-line-clamp":
|
|
2080
|
+
"-webkit-line-clamp": Q
|
|
2045
2081
|
}
|
|
2046
|
-
}, [
|
|
2047
|
-
class: `${
|
|
2082
|
+
}, [at()]), r(Vt, {
|
|
2083
|
+
class: `${o}-copyable-icon`,
|
|
2048
2084
|
onClick: () => {
|
|
2049
|
-
|
|
2085
|
+
ia(Me), gl.success("复制成功");
|
|
2050
2086
|
}
|
|
2051
2087
|
}, null)]);
|
|
2052
2088
|
}
|
|
2053
2089
|
}
|
|
2054
|
-
return
|
|
2090
|
+
return I;
|
|
2055
2091
|
};
|
|
2056
2092
|
function lt() {
|
|
2057
|
-
const
|
|
2058
|
-
slots:
|
|
2093
|
+
const v = ol({
|
|
2094
|
+
slots: l,
|
|
2059
2095
|
props: e,
|
|
2060
2096
|
key: "emptyText"
|
|
2061
2097
|
});
|
|
2062
|
-
if (
|
|
2063
|
-
const
|
|
2064
|
-
return
|
|
2065
|
-
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),
|
|
2066
2102
|
style: e.emptyTextProps?.style
|
|
2067
|
-
}, [
|
|
2103
|
+
}, [z ? M : V(M) ? M.map((Q) => Xe(Q, w)) : r(pl, null, null)]);
|
|
2068
2104
|
}
|
|
2069
2105
|
return null;
|
|
2070
2106
|
}
|
|
2071
|
-
const
|
|
2072
|
-
const
|
|
2073
|
-
slots:
|
|
2107
|
+
const At = () => {
|
|
2108
|
+
const v = ot({
|
|
2109
|
+
slots: l,
|
|
2074
2110
|
props: e,
|
|
2075
2111
|
key: "customRender"
|
|
2076
2112
|
});
|
|
2077
|
-
if (
|
|
2078
|
-
if (
|
|
2079
|
-
const
|
|
2080
|
-
return
|
|
2081
|
-
dataSource:
|
|
2082
|
-
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)
|
|
2083
2119
|
});
|
|
2084
2120
|
}
|
|
2085
2121
|
return lt();
|
|
2086
2122
|
}
|
|
2087
|
-
return
|
|
2123
|
+
return r(Ee, null, null);
|
|
2088
2124
|
};
|
|
2089
|
-
return
|
|
2090
|
-
tableSize:
|
|
2091
|
-
columns:
|
|
2092
|
-
cacheColumns:
|
|
2093
|
-
isMobile:
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2125
|
+
return xl({
|
|
2126
|
+
tableSize: be,
|
|
2127
|
+
columns: R,
|
|
2128
|
+
cacheColumns: G,
|
|
2129
|
+
isMobile: Re,
|
|
2130
|
+
formConfig: A,
|
|
2131
|
+
formAutoRequest: he,
|
|
2132
|
+
formActions: j,
|
|
2097
2133
|
action: {
|
|
2098
|
-
setTableSize:
|
|
2099
|
-
reload: (
|
|
2100
|
-
toggle:
|
|
2134
|
+
setTableSize: ae,
|
|
2135
|
+
reload: (v) => X(v),
|
|
2136
|
+
toggle: q
|
|
2101
2137
|
},
|
|
2102
|
-
setPagination:
|
|
2103
|
-
changeColumns:
|
|
2104
|
-
}),
|
|
2138
|
+
setPagination: t,
|
|
2139
|
+
changeColumns: O
|
|
2140
|
+
}), i({
|
|
2105
2141
|
formRef: () => ({
|
|
2106
|
-
getFormState: () =>
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
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;
|
|
2110
2149
|
}
|
|
2111
2150
|
}),
|
|
2112
2151
|
actionRef: () => ({
|
|
2113
|
-
loading:
|
|
2114
|
-
dataSource:
|
|
2115
|
-
pageState:
|
|
2116
|
-
pagination:
|
|
2117
|
-
selectedKeys:
|
|
2118
|
-
selectedItems:
|
|
2152
|
+
loading: ee,
|
|
2153
|
+
dataSource: Pe,
|
|
2154
|
+
pageState: ce,
|
|
2155
|
+
pagination: Y.value,
|
|
2156
|
+
selectedKeys: y(() => se.value),
|
|
2157
|
+
selectedItems: y(() => ne.value),
|
|
2119
2158
|
rowsSelection: {
|
|
2120
|
-
clear: $
|
|
2121
|
-
select:
|
|
2122
|
-
remove:
|
|
2123
|
-
sync:
|
|
2124
|
-
selectAll:
|
|
2159
|
+
clear: $e,
|
|
2160
|
+
select: H,
|
|
2161
|
+
remove: oe,
|
|
2162
|
+
sync: Ce,
|
|
2163
|
+
selectAll: ye
|
|
2125
2164
|
},
|
|
2126
|
-
reload:
|
|
2127
|
-
getLoadingStatus: () =>
|
|
2128
|
-
reloadAndReset: async (
|
|
2129
|
-
|
|
2165
|
+
reload: X,
|
|
2166
|
+
getLoadingStatus: () => C(ee),
|
|
2167
|
+
reloadAndReset: async (v) => {
|
|
2168
|
+
$.value = !0, t({
|
|
2130
2169
|
current: 1,
|
|
2131
|
-
pageSize:
|
|
2132
|
-
}),
|
|
2170
|
+
pageSize: ce?.pageSize || 10
|
|
2171
|
+
}), v?.callBack && (v?.wait ? await v?.callBack?.() : v?.callBack?.()), x.value?.resetForm(!1), $.value = !1;
|
|
2133
2172
|
},
|
|
2134
|
-
reSetDataList:
|
|
2135
|
-
setPageAndReload:
|
|
2136
|
-
setPagination:
|
|
2137
|
-
setDataValue:
|
|
2138
|
-
setLoading:
|
|
2173
|
+
reSetDataList: re,
|
|
2174
|
+
setPageAndReload: tt,
|
|
2175
|
+
setPagination: t,
|
|
2176
|
+
setDataValue: We,
|
|
2177
|
+
setLoading: ue
|
|
2139
2178
|
})
|
|
2140
2179
|
}), () => {
|
|
2141
|
-
const
|
|
2142
|
-
slots:
|
|
2180
|
+
const v = He(e.customRender || l.customRender), T = l.actions?.() || e.actionProps?.actions, w = ll({
|
|
2181
|
+
slots: l,
|
|
2143
2182
|
props: e,
|
|
2144
2183
|
keys: ["headerTitle", "titleTip", "settingExtra"],
|
|
2145
2184
|
render: !0
|
|
2146
2185
|
});
|
|
2147
|
-
return d(
|
|
2148
|
-
ref:
|
|
2149
|
-
class:
|
|
2150
|
-
[`${
|
|
2151
|
-
[`${
|
|
2186
|
+
return d(r("div", {
|
|
2187
|
+
ref: h,
|
|
2188
|
+
class: ie([{
|
|
2189
|
+
[`${m.value}`]: !0,
|
|
2190
|
+
[`${o}`]: !0,
|
|
2152
2191
|
[`${n.class}`]: n.class,
|
|
2153
|
-
[`${
|
|
2154
|
-
[`${
|
|
2155
|
-
[`${
|
|
2156
|
-
[`${
|
|
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
|
|
2157
2196
|
}]),
|
|
2158
2197
|
style: n.style
|
|
2159
|
-
}, [
|
|
2160
|
-
class: [`${
|
|
2161
|
-
}, [(
|
|
2162
|
-
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,
|
|
2163
2202
|
modalScroll: e.modalScroll,
|
|
2164
2203
|
cardBordered: e.cardBordered,
|
|
2165
|
-
|
|
2166
|
-
prefixCls:
|
|
2167
|
-
loading:
|
|
2168
|
-
onSearch:
|
|
2169
|
-
defaultState:
|
|
2204
|
+
formCols: D.value,
|
|
2205
|
+
prefixCls: o,
|
|
2206
|
+
loading: C(ee),
|
|
2207
|
+
onSearch: Pt,
|
|
2208
|
+
defaultState: W.value
|
|
2170
2209
|
}, {
|
|
2171
|
-
default:
|
|
2172
|
-
}),
|
|
2173
|
-
class:
|
|
2174
|
-
}, [
|
|
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, {
|
|
2175
2214
|
options: e.options ? {
|
|
2176
|
-
...
|
|
2177
|
-
...
|
|
2215
|
+
...sa,
|
|
2216
|
+
...U(e.options) ? e.options : {}
|
|
2178
2217
|
} : !1,
|
|
2179
2218
|
titleTipText: e.titleTipText,
|
|
2180
2219
|
actionsPlacement: e.actionProps?.placement,
|
|
2181
|
-
actionsRender:
|
|
2182
|
-
headerTitle:
|
|
2183
|
-
titleTip:
|
|
2184
|
-
settingExtra:
|
|
2185
|
-
}, null),
|
|
2186
|
-
default: () => [
|
|
2187
|
-
class: `${
|
|
2188
|
-
}, [
|
|
2189
|
-
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),
|
|
2190
2229
|
style: e.tableProps?.style
|
|
2191
|
-
}, [
|
|
2230
|
+
}, [At()]), e.pagination !== !1 && Pe.value?.length > 0 && r(vl, k({
|
|
2192
2231
|
class: {
|
|
2193
|
-
[`${
|
|
2194
|
-
[`${
|
|
2232
|
+
[`${o}-pagination ${m.value}`]: !0,
|
|
2233
|
+
[`${o}-pagination-${et.value} ${m.value}`]: !!et.value
|
|
2195
2234
|
}
|
|
2196
|
-
},
|
|
2197
|
-
onChange:
|
|
2235
|
+
}, xe(C(Y)), {
|
|
2236
|
+
onChange: Ft
|
|
2198
2237
|
}), null)])]
|
|
2199
|
-
}) :
|
|
2238
|
+
}) : r(hl, k(st(e, Object.keys(St)), $t.value, {
|
|
2200
2239
|
style: e.tableProps?.style,
|
|
2201
2240
|
class: e.tableProps?.class,
|
|
2202
2241
|
loading: Ze.value,
|
|
2203
|
-
rowKey: (
|
|
2204
|
-
transformCellText: (
|
|
2205
|
-
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);
|
|
2206
2245
|
const {
|
|
2207
|
-
column:
|
|
2208
|
-
} =
|
|
2209
|
-
if (!
|
|
2210
|
-
const
|
|
2211
|
-
let
|
|
2212
|
-
if (
|
|
2213
|
-
if (
|
|
2214
|
-
|
|
2215
|
-
const
|
|
2216
|
-
|
|
2217
|
-
} else
|
|
2218
|
-
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;
|
|
2219
2258
|
},
|
|
2220
2259
|
rowSelection: e.rowSelection ? {
|
|
2221
|
-
...
|
|
2222
|
-
selectedRowKeys:
|
|
2223
|
-
onSelect:
|
|
2224
|
-
onSelectAll:
|
|
2225
|
-
onChange:
|
|
2260
|
+
...Oe(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
|
|
2261
|
+
selectedRowKeys: se.value || [],
|
|
2262
|
+
onSelect: H,
|
|
2263
|
+
onSelectAll: ye,
|
|
2264
|
+
onChange: ge
|
|
2226
2265
|
} : void 0,
|
|
2227
|
-
onChange:
|
|
2228
|
-
onExpandedRowsChange:
|
|
2229
|
-
onExpand:
|
|
2230
|
-
onResizeColumn: (
|
|
2266
|
+
onChange: tt,
|
|
2267
|
+
onExpandedRowsChange: Dt,
|
|
2268
|
+
onExpand: It,
|
|
2269
|
+
onResizeColumn: (I, z) => Bt(I, z)
|
|
2231
2270
|
}), {
|
|
2232
|
-
...
|
|
2271
|
+
...l,
|
|
2233
2272
|
emptyText: () => lt()
|
|
2234
2273
|
})])])]));
|
|
2235
2274
|
};
|
|
2236
2275
|
}
|
|
2237
2276
|
});
|
|
2238
|
-
|
|
2239
|
-
function
|
|
2240
|
-
function
|
|
2241
|
-
const
|
|
2277
|
+
Ge.install = (e) => (e.component(Ge.name, Ge), e);
|
|
2278
|
+
function wa(e, a) {
|
|
2279
|
+
function l() {
|
|
2280
|
+
const s = {
|
|
2242
2281
|
params: {},
|
|
2243
2282
|
searchMap: []
|
|
2244
2283
|
};
|
|
2245
|
-
if (
|
|
2246
|
-
if (ke(
|
|
2247
|
-
return
|
|
2248
|
-
if (
|
|
2249
|
-
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));
|
|
2250
2289
|
}
|
|
2251
|
-
return
|
|
2290
|
+
return s;
|
|
2252
2291
|
}
|
|
2253
|
-
const n =
|
|
2254
|
-
request:
|
|
2292
|
+
const n = Qe(Se(l(), {
|
|
2293
|
+
request: a?.request
|
|
2255
2294
|
}));
|
|
2256
|
-
|
|
2257
|
-
|
|
2295
|
+
a?.state && L(() => a.state && ke(a.state) ? a.state.value : a.state, () => {
|
|
2296
|
+
p();
|
|
2258
2297
|
}, { deep: !0 });
|
|
2259
|
-
const
|
|
2260
|
-
...
|
|
2261
|
-
...
|
|
2262
|
-
})),
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
}),
|
|
2266
|
-
|
|
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);
|
|
2267
2306
|
});
|
|
2268
|
-
function
|
|
2269
|
-
|
|
2307
|
+
function p() {
|
|
2308
|
+
il(n, l());
|
|
2270
2309
|
}
|
|
2271
|
-
function
|
|
2272
|
-
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));
|
|
2273
2312
|
}
|
|
2274
2313
|
return {
|
|
2275
|
-
formRef:
|
|
2276
|
-
actionRef:
|
|
2314
|
+
formRef: o,
|
|
2315
|
+
actionRef: i,
|
|
2277
2316
|
tableState: n,
|
|
2278
2317
|
requestSearch: d,
|
|
2279
|
-
loading:
|
|
2280
|
-
dataSource:
|
|
2281
|
-
selectedKeys:
|
|
2282
|
-
selectedItems:
|
|
2283
|
-
rowsSelection:
|
|
2284
|
-
mutate: (
|
|
2285
|
-
reloadAndReset: (
|
|
2286
|
-
setPageAndReload: (
|
|
2287
|
-
setPagination: (
|
|
2288
|
-
setLoading: (
|
|
2289
|
-
setDataValue: (
|
|
2290
|
-
reload: (
|
|
2291
|
-
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
|
|
2292
2331
|
};
|
|
2293
2332
|
}
|
|
2294
2333
|
export {
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2334
|
+
Ge as GProTable,
|
|
2335
|
+
pe as proTableProps,
|
|
2336
|
+
wa as useTable
|
|
2298
2337
|
};
|