vft 0.0.440 → 0.0.442
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/pagination/index.d.ts +3 -1
- package/es/components/pagination/pagination.vue.d.ts +3 -1
- package/es/components/pagination/pagination.vue2.js +47 -44
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/table/constants.d.ts +2 -1
- package/es/components/table/constants.js +2 -2
- package/es/components/table/field.d.ts +60 -0
- package/es/components/table/index.d.ts +1224 -551
- package/es/components/table/table.vue.d.ts +291 -124
- package/es/components/table/table.vue2.js +130 -127
- package/es/components/table/types.d.ts +48 -43
- package/es/components/table/use/use-data-source.js +69 -69
- package/es/components/table/use/use-pagination.d.ts +11 -7
- package/es/components/table/use/use-pagination.js +36 -46
- package/es/components/table/utils.d.ts +24 -4
- package/es/package.json.d.ts +2 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/pagination/index.d.ts +3 -1
- package/lib/components/pagination/pagination.vue.d.ts +3 -1
- package/lib/components/pagination/pagination.vue2.cjs +1 -1
- package/lib/components/table/constants.cjs +1 -1
- package/lib/components/table/constants.d.ts +2 -1
- package/lib/components/table/field.d.ts +60 -0
- package/lib/components/table/index.d.ts +1224 -551
- package/lib/components/table/table.vue.d.ts +291 -124
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/types.d.ts +48 -43
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/table/use/use-pagination.cjs +1 -1
- package/lib/components/table/use/use-pagination.d.ts +11 -7
- package/lib/components/table/utils.d.ts +24 -4
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +2 -1
- package/package.json +6 -5
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/table.scss +6 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftEmpty as
|
|
3
|
-
import { vLoading as
|
|
4
|
-
import { deepMerge as F, isClient as
|
|
5
|
-
import { FormCompEnum as
|
|
1
|
+
import { defineComponent as N, useAttrs as ae, ref as s, getCurrentInstance as te, computed as P, unref as e, watch as oe, nextTick as le, toRaw as re, createBlock as f, openBlock as m, withCtx as c, createElementVNode as D, normalizeClass as ne, createVNode as p, createCommentVNode as H, mergeProps as _, withDirectives as ce, renderSlot as h, normalizeProps as ie, guardReactiveProps as se } from "vue";
|
|
2
|
+
import { VftEmpty as ge } from "../empty/index.js";
|
|
3
|
+
import { vLoading as de } from "../loading/directive.js";
|
|
4
|
+
import { deepMerge as F, isClient as ue, omit as fe, isFunction as me } from "@vft/utils";
|
|
5
|
+
import { FormCompEnum as pe } from "../../utils/form-register.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
8
|
import "lodash-es";
|
|
9
|
-
import { useForm as
|
|
10
|
-
import { useNamespace as
|
|
9
|
+
import { useForm as he } from "../super-form/use/use-form.js";
|
|
10
|
+
import { useNamespace as be } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
14
|
import "../icon/index.js";
|
|
15
|
-
import { VftClientOnly as
|
|
16
|
-
import { VftPagination as
|
|
17
|
-
import { VftSkeleton as
|
|
18
|
-
import { VftSuperForm as
|
|
19
|
-
import { VxeGrid as
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import { useColumns as
|
|
23
|
-
import { useDataSource as
|
|
24
|
-
import { useLoading as
|
|
25
|
-
import { usePagination as
|
|
26
|
-
import { EmptyEnum as
|
|
27
|
-
const
|
|
15
|
+
import { VftClientOnly as Ce } from "../client-only/index.js";
|
|
16
|
+
import { VftPagination as ye } from "../pagination/index.js";
|
|
17
|
+
import { VftSkeleton as we } from "../skeleton/index.js";
|
|
18
|
+
import { VftSuperForm as ve } from "../super-form/index.js";
|
|
19
|
+
import { VxeGrid as ke } from "vxe-table";
|
|
20
|
+
import xe from "xe-utils";
|
|
21
|
+
import { PageSize as T } from "./constants.js";
|
|
22
|
+
import { useColumns as Se } from "./use/use-columns.js";
|
|
23
|
+
import { useDataSource as Be } from "./use/use-data-source.js";
|
|
24
|
+
import { useLoading as Re } from "./use/use-loading.js";
|
|
25
|
+
import { usePagination as ze } from "./use/use-pagination.js";
|
|
26
|
+
import { EmptyEnum as Pe } from "../empty/constants.js";
|
|
27
|
+
const De = {
|
|
28
28
|
"vft-loading-text": "加载中..."
|
|
29
|
-
},
|
|
29
|
+
}, He = N({
|
|
30
30
|
name: "vft-table"
|
|
31
|
-
}),
|
|
32
|
-
...
|
|
31
|
+
}), la = /* @__PURE__ */ N({
|
|
32
|
+
...He,
|
|
33
33
|
props: {
|
|
34
34
|
sticky: {
|
|
35
35
|
type: [Boolean, Object]
|
|
36
36
|
},
|
|
37
37
|
api: {},
|
|
38
38
|
pageSize: {
|
|
39
|
-
default:
|
|
39
|
+
default: T
|
|
40
40
|
},
|
|
41
41
|
total: {},
|
|
42
42
|
rowkey: {
|
|
@@ -74,17 +74,23 @@ const Re = {
|
|
|
74
74
|
},
|
|
75
75
|
pagination: {},
|
|
76
76
|
formOptions: {},
|
|
77
|
+
onChange: {},
|
|
78
|
+
emptyCfg: {
|
|
79
|
+
default: () => ({
|
|
80
|
+
type: Pe.NoData
|
|
81
|
+
})
|
|
82
|
+
},
|
|
77
83
|
layouts: {},
|
|
78
84
|
columns: {},
|
|
79
85
|
pagerConfig: {},
|
|
80
86
|
proxyConfig: {},
|
|
81
87
|
toolbarConfig: {
|
|
82
|
-
default: {
|
|
88
|
+
default: () => ({
|
|
83
89
|
enabled: !1,
|
|
84
90
|
slots: {
|
|
85
91
|
buttons: "toolbarButtons"
|
|
86
92
|
}
|
|
87
|
-
}
|
|
93
|
+
})
|
|
88
94
|
},
|
|
89
95
|
formConfig: {},
|
|
90
96
|
zoomConfig: {},
|
|
@@ -92,9 +98,7 @@ const Re = {
|
|
|
92
98
|
id: {},
|
|
93
99
|
data: {},
|
|
94
100
|
height: {},
|
|
95
|
-
minHeight: {
|
|
96
|
-
default: 80
|
|
97
|
-
},
|
|
101
|
+
minHeight: {},
|
|
98
102
|
maxHeight: {},
|
|
99
103
|
stripe: {
|
|
100
104
|
type: Boolean,
|
|
@@ -167,18 +171,18 @@ const Re = {
|
|
|
167
171
|
type: [Boolean, String, Number]
|
|
168
172
|
},
|
|
169
173
|
columnConfig: {
|
|
170
|
-
default: {
|
|
174
|
+
default: () => ({
|
|
171
175
|
drag: !1,
|
|
172
176
|
resizable: !0,
|
|
173
177
|
minWidth: "15%"
|
|
174
|
-
}
|
|
178
|
+
})
|
|
175
179
|
},
|
|
176
180
|
rowConfig: {
|
|
177
|
-
default: {
|
|
181
|
+
default: () => ({
|
|
178
182
|
isHover: !0,
|
|
179
183
|
isCurrent: !0,
|
|
180
184
|
useKey: !0
|
|
181
|
-
}
|
|
185
|
+
})
|
|
182
186
|
},
|
|
183
187
|
cellConfig: {},
|
|
184
188
|
headerCellConfig: {},
|
|
@@ -219,14 +223,14 @@ const Re = {
|
|
|
219
223
|
scrollX: {},
|
|
220
224
|
scrollY: {},
|
|
221
225
|
virtualXConfig: {
|
|
222
|
-
default: {
|
|
226
|
+
default: () => ({
|
|
223
227
|
enabled: !1
|
|
224
|
-
}
|
|
228
|
+
})
|
|
225
229
|
},
|
|
226
230
|
virtualYConfig: {
|
|
227
|
-
default: {
|
|
231
|
+
default: () => ({
|
|
228
232
|
enabled: !1
|
|
229
|
-
}
|
|
233
|
+
})
|
|
230
234
|
},
|
|
231
235
|
scrollbarConfig: {},
|
|
232
236
|
params: {},
|
|
@@ -385,67 +389,66 @@ const Re = {
|
|
|
385
389
|
"toolbar-tool-click",
|
|
386
390
|
"zoom"
|
|
387
391
|
],
|
|
388
|
-
setup(
|
|
389
|
-
expose:
|
|
390
|
-
emit:
|
|
392
|
+
setup(_e, {
|
|
393
|
+
expose: A,
|
|
394
|
+
emit: E
|
|
391
395
|
}) {
|
|
392
|
-
const
|
|
393
|
-
getLoading:
|
|
394
|
-
setLoading:
|
|
395
|
-
} =
|
|
396
|
+
const l = E, g = be("table"), O = ae(), b = s(), C = s(), V = s([]), d = s(), $ = te(), t = P(() => F($.props, e(d))), {
|
|
397
|
+
getLoading: q,
|
|
398
|
+
setLoading: G
|
|
399
|
+
} = Re(t), {
|
|
396
400
|
getPaginationInfo: i,
|
|
397
|
-
setPagination:
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
} = Be(o), {
|
|
401
|
+
setPagination: u,
|
|
402
|
+
getCurrentPage: I
|
|
403
|
+
} = ze(t), {
|
|
401
404
|
getViewColumns: K,
|
|
402
405
|
setColumns: L
|
|
403
|
-
} =
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
} = Se(t);
|
|
407
|
+
oe(() => I(), (a) => {
|
|
408
|
+
le(() => {
|
|
409
|
+
y({
|
|
407
410
|
seqConfig: {
|
|
408
|
-
startIndex: (a - 1) * (i.value?.pageSize || e(
|
|
411
|
+
startIndex: (a - 1) * (i.value?.pageSize || e(t).pageSize || T)
|
|
409
412
|
}
|
|
410
413
|
});
|
|
411
414
|
});
|
|
412
415
|
}, {
|
|
413
416
|
immediate: !0
|
|
414
417
|
});
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
-
...e(
|
|
418
|
+
function y(a) {
|
|
419
|
+
d.value = {
|
|
420
|
+
...e(d),
|
|
418
421
|
...a
|
|
419
422
|
};
|
|
420
423
|
}
|
|
421
424
|
const {
|
|
422
|
-
getDataSourceRef:
|
|
425
|
+
getDataSourceRef: w,
|
|
423
426
|
handleTableChange: M,
|
|
424
427
|
reload: X,
|
|
425
428
|
deleteTableDataRecord: Y,
|
|
426
|
-
insertTableDataRecord:
|
|
427
|
-
updateTableData:
|
|
428
|
-
updateTableDataRecord:
|
|
429
|
-
setTableData:
|
|
430
|
-
getDataSource:
|
|
431
|
-
getRawDataSource:
|
|
429
|
+
insertTableDataRecord: j,
|
|
430
|
+
updateTableData: W,
|
|
431
|
+
updateTableDataRecord: U,
|
|
432
|
+
setTableData: v,
|
|
433
|
+
getDataSource: J,
|
|
434
|
+
getRawDataSource: k,
|
|
432
435
|
tableSearch: x
|
|
433
|
-
} =
|
|
434
|
-
tableData:
|
|
435
|
-
setLoading:
|
|
436
|
+
} = Be(t, {
|
|
437
|
+
tableData: V,
|
|
438
|
+
setLoading: G,
|
|
436
439
|
getPaginationInfo: i,
|
|
437
|
-
setPagination:
|
|
440
|
+
setPagination: u
|
|
438
441
|
}, l);
|
|
439
|
-
function
|
|
440
|
-
a?.
|
|
442
|
+
function S(a) {
|
|
443
|
+
a?.pageSize && u({
|
|
441
444
|
currentPage: 1
|
|
442
|
-
}), M
|
|
445
|
+
}), M(a), l("change", a);
|
|
443
446
|
const {
|
|
444
|
-
onChange:
|
|
445
|
-
} = e(
|
|
446
|
-
|
|
447
|
+
onChange: o
|
|
448
|
+
} = e(t);
|
|
449
|
+
o && me(o) && o(a);
|
|
447
450
|
}
|
|
448
|
-
const
|
|
451
|
+
const B = {};
|
|
449
452
|
[
|
|
450
453
|
"update:data",
|
|
451
454
|
"keydown-start",
|
|
@@ -567,41 +570,40 @@ const Re = {
|
|
|
567
570
|
"toolbar-tool-click",
|
|
568
571
|
"zoom"
|
|
569
572
|
].forEach((a) => {
|
|
570
|
-
const
|
|
571
|
-
|
|
573
|
+
const o = xe.camelCase(`on-${a}`);
|
|
574
|
+
B[o] = (...n) => l(a, ...n);
|
|
572
575
|
});
|
|
573
|
-
const r =
|
|
574
|
-
const a = e(
|
|
575
|
-
...
|
|
576
|
-
...e(
|
|
577
|
-
columns:
|
|
578
|
-
loading: e(
|
|
576
|
+
const r = P(() => {
|
|
577
|
+
const a = e(w), o = {
|
|
578
|
+
...O,
|
|
579
|
+
...e(t),
|
|
580
|
+
columns: re(e(K)),
|
|
581
|
+
loading: e(q),
|
|
579
582
|
data: a,
|
|
580
|
-
...
|
|
583
|
+
...B
|
|
581
584
|
};
|
|
582
|
-
return
|
|
583
|
-
}),
|
|
584
|
-
setPagination:
|
|
585
|
+
return ue && (o.maxHeight = e(t)?.maxHeight ? e(t)?.maxHeight : `${window.innerHeight - e(t)?.extraSysHeight - (t.value?.showPager ? t.value?.pageHeight || 40 : 0)}px`, o.minHeight = e(t)?.toolbarConfig?.custom ? 300 : e(t)?.minHeight), o;
|
|
586
|
+
}), R = {
|
|
587
|
+
setPagination: u,
|
|
585
588
|
emit: l,
|
|
586
|
-
setProps:
|
|
589
|
+
setProps: y,
|
|
587
590
|
reload: X,
|
|
588
|
-
getShowPagination: b,
|
|
589
591
|
deleteTableDataRecord: Y,
|
|
590
|
-
insertTableDataRecord:
|
|
591
|
-
updateTableDataRecord:
|
|
592
|
-
updateTableData:
|
|
593
|
-
setTableData:
|
|
594
|
-
getDataSource:
|
|
595
|
-
getDataSourceRef:
|
|
592
|
+
insertTableDataRecord: j,
|
|
593
|
+
updateTableDataRecord: U,
|
|
594
|
+
updateTableData: W,
|
|
595
|
+
setTableData: v,
|
|
596
|
+
getDataSource: J,
|
|
597
|
+
getDataSourceRef: w,
|
|
596
598
|
setColumns: L,
|
|
597
|
-
getRawDataSource:
|
|
599
|
+
getRawDataSource: k,
|
|
598
600
|
tableSearch: x
|
|
599
601
|
};
|
|
600
|
-
l("register",
|
|
601
|
-
const
|
|
602
|
+
l("register", R);
|
|
603
|
+
const Q = {
|
|
602
604
|
field: "_filterTableData",
|
|
603
605
|
label: "",
|
|
604
|
-
type:
|
|
606
|
+
type: pe.SEARCH,
|
|
605
607
|
componentProps: ({}) => ({
|
|
606
608
|
onChange: (a) => {
|
|
607
609
|
z({
|
|
@@ -609,8 +611,8 @@ const Re = {
|
|
|
609
611
|
});
|
|
610
612
|
}
|
|
611
613
|
})
|
|
612
|
-
}, [
|
|
613
|
-
schemas: [r.value?.formOptions?.addSearchAllSchema ?
|
|
614
|
+
}, [Z] = he(F({
|
|
615
|
+
schemas: [r.value?.formOptions?.addSearchAllSchema ? Q : {}],
|
|
614
616
|
rowProps: {
|
|
615
617
|
justify: "start"
|
|
616
618
|
},
|
|
@@ -624,52 +626,53 @@ const Re = {
|
|
|
624
626
|
btnText: "搜索"
|
|
625
627
|
},
|
|
626
628
|
actionInline: !0
|
|
627
|
-
},
|
|
629
|
+
}, fe(
|
|
628
630
|
r.value?.formOptions,
|
|
629
631
|
["showActionForm", "addSearchAllSchema"]
|
|
630
632
|
// 'union' | 'intersection' | 'concat' | 'replace' = 'union'
|
|
631
633
|
), "replace")), z = (a) => {
|
|
632
634
|
Reflect.has(a, "_filterTableData") && x(a._filterTableData), l("form-submit", a);
|
|
633
|
-
},
|
|
634
|
-
|
|
635
|
+
}, ee = () => {
|
|
636
|
+
v(k()), l("form-reset");
|
|
635
637
|
};
|
|
636
|
-
return
|
|
637
|
-
table:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
638
|
+
return A({
|
|
639
|
+
table: b,
|
|
640
|
+
pageRef: C,
|
|
641
|
+
...R
|
|
642
|
+
}), (a, o) => (m(), f(e(Ce), null, {
|
|
643
|
+
fallback: c(() => [p(e(we))]),
|
|
644
|
+
default: c(() => [D("div", {
|
|
645
|
+
class: ne([e(g).b()])
|
|
646
|
+
}, [p(e(ke), _({
|
|
644
647
|
ref_key: "xGrid",
|
|
645
|
-
ref:
|
|
648
|
+
ref: b
|
|
646
649
|
}, r.value), {
|
|
647
|
-
toolbarButtons: c(() => [
|
|
650
|
+
toolbarButtons: c(() => [h(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(ve), {
|
|
648
651
|
key: 0,
|
|
649
|
-
onRegister: e(
|
|
652
|
+
onRegister: e(Z),
|
|
650
653
|
onSubmit: z,
|
|
651
|
-
onReset:
|
|
652
|
-
}, null, 8, ["onRegister"])) :
|
|
653
|
-
empty: c(() => [p(e(
|
|
654
|
-
|
|
655
|
-
}, null, 8, ["type"])]),
|
|
656
|
-
loading: c(() => [ne(P("div", Re, null, 512), [[e(ie), r.value.loading]])]),
|
|
654
|
+
onReset: ee
|
|
655
|
+
}, null, 8, ["onRegister"])) : H("", !0), h(a.$slots, "toolbar-right")]),
|
|
656
|
+
empty: c(() => [h(a.$slots, "empty", {}, () => [p(e(ge), ie(se(r.value.emptyCfg)), null, 16)])]),
|
|
657
|
+
loading: c(() => [ce(D("div", De, null, 512), [[e(de), !!r.value.loading]])]),
|
|
657
658
|
_: 3
|
|
658
|
-
}, 16), r.value.showPager
|
|
659
|
-
key: 0
|
|
659
|
+
}, 16), r.value.showPager ? (m(), f(e(ye), _({
|
|
660
|
+
key: 0,
|
|
661
|
+
ref_key: "pageRef",
|
|
662
|
+
ref: C
|
|
660
663
|
}, e(i), {
|
|
661
|
-
class: [e(
|
|
662
|
-
onCurrentChange:
|
|
664
|
+
class: [e(g).e("pager"), e(g).m(`pager-${e(i)?.pagePlacement}`)],
|
|
665
|
+
onCurrentChange: o[0] || (o[0] = (n) => S({
|
|
663
666
|
currentPage: n
|
|
664
667
|
})),
|
|
665
|
-
onSizeChange:
|
|
668
|
+
onSizeChange: o[1] || (o[1] = (n) => S({
|
|
666
669
|
pageSize: n
|
|
667
670
|
}))
|
|
668
|
-
}), null, 16, ["class"])) :
|
|
671
|
+
}), null, 16, ["class"])) : H("", !0)], 2)]),
|
|
669
672
|
_: 3
|
|
670
673
|
}));
|
|
671
674
|
}
|
|
672
675
|
});
|
|
673
676
|
export {
|
|
674
|
-
|
|
677
|
+
la as default
|
|
675
678
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EmptyProps } from 'vft/es/components/empty';
|
|
1
2
|
import { type PaginationProps } from 'vft/es/components/pagination';
|
|
2
3
|
import type { VxeGridInstance, VxeGridProps, VxeTableDefines } from 'vxe-table';
|
|
3
4
|
import { type SuperFormProps } from '../super-form';
|
|
@@ -6,101 +7,105 @@ import type { Recordable } from '../types';
|
|
|
6
7
|
export type TableInstance = VxeGridInstance;
|
|
7
8
|
/** 粘性定位选项接口 */
|
|
8
9
|
export interface StickyOption {
|
|
9
|
-
/**
|
|
10
|
+
/** 距离顶部的偏移量,单位为像素 */
|
|
10
11
|
offsetTop: number;
|
|
11
|
-
/**
|
|
12
|
+
/** 获取容器元素,用于指定粘性定位的容器 */
|
|
12
13
|
getContainer?: HTMLElement;
|
|
13
14
|
}
|
|
14
15
|
/** 数据获取设置接口 */
|
|
15
16
|
export interface FetchSetting {
|
|
16
|
-
/**
|
|
17
|
+
/** 请求接口当前页数字段名,默认为 'page' */
|
|
17
18
|
pageField: string;
|
|
18
|
-
/**
|
|
19
|
+
/** 每页显示条数字段名,默认为 'pageSize' */
|
|
19
20
|
sizeField: string;
|
|
20
|
-
/** 请求结果列表字段名,支持 a.b.c
|
|
21
|
+
/** 请求结果列表字段名,支持 a.b.c 格式,默认为 'data.items' */
|
|
21
22
|
listField: string;
|
|
22
|
-
/** 请求结果总数字段名,支持 a.b.c
|
|
23
|
+
/** 请求结果总数字段名,支持 a.b.c 格式,默认为 'data.total' */
|
|
23
24
|
totalField: string;
|
|
24
25
|
}
|
|
25
26
|
/** 表格属性接口 */
|
|
26
27
|
export interface TableProps extends VxeGridProps {
|
|
27
|
-
/**
|
|
28
|
+
/** 是否启用粘性定位,可以是布尔值或配置对象 */
|
|
28
29
|
sticky?: boolean | StickyOption;
|
|
29
|
-
/**
|
|
30
|
+
/** 数据获取接口函数,用于远程获取表格数据 */
|
|
30
31
|
api?: (params?: any) => Promise<any>;
|
|
31
|
-
/**
|
|
32
|
+
/** 每页显示条数,默认为 15 */
|
|
32
33
|
pageSize?: number;
|
|
33
|
-
/**
|
|
34
|
+
/** 数据总条数 */
|
|
34
35
|
total?: number;
|
|
35
|
-
/**
|
|
36
|
+
/** 行键字段名,用于唯一标识每一行数据 */
|
|
36
37
|
rowkey?: string;
|
|
37
|
-
/**
|
|
38
|
+
/** 是否在组件挂载后立即加载数据,默认为 true */
|
|
38
39
|
immediate?: boolean;
|
|
39
|
-
/**
|
|
40
|
+
/** 数据获取配置,用于自定义请求参数和响应数据的字段映射 */
|
|
40
41
|
fetchSetting?: Partial<FetchSetting>;
|
|
41
|
-
/**
|
|
42
|
+
/** 是否监听接口变化,当 api 属性变化时自动重新请求数据 */
|
|
42
43
|
watchApiFetch?: boolean;
|
|
43
|
-
/**
|
|
44
|
+
/** 数据获取前的处理函数,可以对请求参数进行修改 */
|
|
44
45
|
beforeFetch?: (params?: any) => any;
|
|
45
|
-
/**
|
|
46
|
+
/** 是否删除空参数,true 表示删除空字符串和 null,'strict' 表示删除空字符串、null 和 undefined */
|
|
46
47
|
delEmptyParams?: boolean | 'strict';
|
|
47
|
-
/**
|
|
48
|
+
/** 数据获取后的处理函数,可以对响应数据进行转换 */
|
|
48
49
|
afterFetch?: (params: any) => Recordable[];
|
|
49
|
-
/**
|
|
50
|
+
/** 是否转换参数,将分页参数转换为标准格式,默认为 true */
|
|
50
51
|
transformParams?: boolean;
|
|
51
|
-
/**
|
|
52
|
+
/** 额外的请求参数,会合并到请求参数中 */
|
|
52
53
|
extraParams?: any;
|
|
53
|
-
/**
|
|
54
|
+
/** 额外的系统高度,用于计算表格高度时需要减去的额外高度 */
|
|
54
55
|
extraSysHeight?: number;
|
|
55
|
-
/**
|
|
56
|
+
/** 分页器高度,默认为 40 像素 */
|
|
56
57
|
pageHeight?: number;
|
|
57
|
-
/**
|
|
58
|
+
/** 是否显示分页器,默认为 true */
|
|
58
59
|
showPager?: boolean;
|
|
59
|
-
/**
|
|
60
|
+
/** 分页器配置选项 */
|
|
60
61
|
pagination?: Partial<PaginationProps> & {
|
|
61
|
-
/**
|
|
62
|
+
/** 分页器位置,可选值:'bottom-left'、'bottom-right'、'top-left'、'top-right' */
|
|
62
63
|
pagePlacement?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
63
|
-
/** 页码是否从0开始 */
|
|
64
|
+
/** 页码是否从 0 开始,默认从 1 开始 */
|
|
64
65
|
pageIsZero?: boolean;
|
|
65
66
|
};
|
|
66
|
-
/**
|
|
67
|
+
/** 表单配置选项,用于配置表格顶部的搜索表单 */
|
|
67
68
|
formOptions?: SuperFormProps & {
|
|
68
|
-
/**
|
|
69
|
+
/** 是否显示操作表单,默认为 false */
|
|
69
70
|
showActionForm?: boolean;
|
|
70
|
-
/**
|
|
71
|
+
/** 是否添加搜索全部配置,默认为 false */
|
|
71
72
|
addSearchAllSchema?: boolean;
|
|
72
73
|
};
|
|
74
|
+
/** 表格数据变化时的回调函数 */
|
|
75
|
+
onChange?: (...args: any[]) => void;
|
|
76
|
+
/** 空状态配置,用于自定义空数据时的显示内容 */
|
|
77
|
+
emptyCfg?: EmptyProps;
|
|
73
78
|
}
|
|
74
|
-
/**
|
|
79
|
+
/** 列项属性类型,继承自 VXE Table 的列选项 */
|
|
75
80
|
export type ColumnItemProps = VxeTableDefines.ColumnOptions;
|
|
76
|
-
/**
|
|
81
|
+
/** 列属性类型,表示列配置数组 */
|
|
77
82
|
export type ColumnProps = ColumnItemProps[];
|
|
78
83
|
/** 表格操作方法接口 */
|
|
79
84
|
export interface TableActionType {
|
|
80
|
-
/**
|
|
85
|
+
/** 重新加载表格数据,可传入可选参数 */
|
|
81
86
|
reload: (opt?: any) => Promise<any>;
|
|
82
|
-
/**
|
|
87
|
+
/** 设置表格属性,用于动态更新表格配置 */
|
|
83
88
|
setProps: (props: Partial<TableProps>) => void;
|
|
84
|
-
/**
|
|
89
|
+
/** 获取当前表格的数据源 */
|
|
85
90
|
getDataSource: () => Recordable<any>[];
|
|
86
|
-
/**
|
|
91
|
+
/** 获取原始数据源,未经过滤或处理的完整数据 */
|
|
87
92
|
getRawDataSource: () => Recordable<any>[];
|
|
88
|
-
/**
|
|
93
|
+
/** 表格搜索功能,根据关键字过滤数据 */
|
|
89
94
|
tableSearch: (value: string | number) => void;
|
|
90
|
-
/**
|
|
95
|
+
/** 获取当前的列配置 */
|
|
91
96
|
getColumns: () => ColumnProps;
|
|
92
|
-
/**
|
|
97
|
+
/** 设置列配置,用于动态更新表格列 */
|
|
93
98
|
setColumns: (columns: ColumnProps) => void;
|
|
94
|
-
/**
|
|
99
|
+
/** 设置表格数据,替换当前所有数据 */
|
|
95
100
|
setTableData: <T = Recordable>(values: T[]) => void;
|
|
96
|
-
/**
|
|
101
|
+
/** 设置分页信息,如当前页、每页条数等 */
|
|
97
102
|
setPagination: (info: Partial<PaginationProps>) => void;
|
|
98
|
-
/**
|
|
103
|
+
/** 更新指定行的数据记录 */
|
|
99
104
|
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void;
|
|
100
|
-
/**
|
|
105
|
+
/** 删除指定的数据记录,支持单个或多个 rowKey */
|
|
101
106
|
deleteTableDataRecord: (row: Recordable, rowKey?: string | number | string[] | number[]) => void;
|
|
102
|
-
/**
|
|
107
|
+
/** 插入新的数据记录,可指定插入位置 */
|
|
103
108
|
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | void;
|
|
104
|
-
/**
|
|
109
|
+
/** 根据 rowKey 查找指定的数据记录 */
|
|
105
110
|
findTableDataRecord: (rowKey: string | number) => Recordable | void;
|
|
106
111
|
}
|