vft 0.0.439 → 0.0.441
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/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/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 +1271 -544
- package/es/components/table/table.vue.d.ts +291 -124
- package/es/components/table/table.vue2.js +143 -132
- 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/index.js +2 -2
- package/es/package.json.d.ts +4 -3
- package/es/package.json.js +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 +1271 -544
- 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 +4 -3
- 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
|
|
5
|
-
import { FormCompEnum as
|
|
1
|
+
import { defineComponent as N, useAttrs as oe, ref as s, getCurrentInstance as ae, computed as P, unref as e, watch as te, nextTick as le, toRaw as re, createBlock as u, openBlock as m, withCtx as c, createElementVNode as H, normalizeClass as ne, createVNode as p, createCommentVNode as D, mergeProps as F, 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 T, isClient as fe, omit as ue, 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 _ } 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 He = {
|
|
28
28
|
"vft-loading-text": "加载中..."
|
|
29
|
-
},
|
|
29
|
+
}, De = N({
|
|
30
30
|
name: "vft-table"
|
|
31
|
-
}),
|
|
32
|
-
...
|
|
31
|
+
}), lo = /* @__PURE__ */ N({
|
|
32
|
+
...De,
|
|
33
33
|
props: {
|
|
34
34
|
sticky: {
|
|
35
35
|
type: [Boolean, Object]
|
|
36
36
|
},
|
|
37
37
|
api: {},
|
|
38
38
|
pageSize: {
|
|
39
|
-
default:
|
|
39
|
+
default: _
|
|
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,
|
|
@@ -142,7 +146,12 @@ const Re = {
|
|
|
142
146
|
headerRowStyle: {},
|
|
143
147
|
footerRowStyle: {},
|
|
144
148
|
footerCellStyle: {},
|
|
149
|
+
showCustomHeader: {
|
|
150
|
+
type: Boolean
|
|
151
|
+
},
|
|
152
|
+
mergeHeaderCells: {},
|
|
145
153
|
mergeCells: {},
|
|
154
|
+
mergeFooterCells: {},
|
|
146
155
|
mergeFooterItems: {},
|
|
147
156
|
spanMethod: {},
|
|
148
157
|
footerSpanMethod: {},
|
|
@@ -167,18 +176,18 @@ const Re = {
|
|
|
167
176
|
type: [Boolean, String, Number]
|
|
168
177
|
},
|
|
169
178
|
columnConfig: {
|
|
170
|
-
default: {
|
|
179
|
+
default: () => ({
|
|
171
180
|
drag: !1,
|
|
172
181
|
resizable: !0,
|
|
173
182
|
minWidth: "15%"
|
|
174
|
-
}
|
|
183
|
+
})
|
|
175
184
|
},
|
|
176
185
|
rowConfig: {
|
|
177
|
-
default: {
|
|
186
|
+
default: () => ({
|
|
178
187
|
isHover: !0,
|
|
179
188
|
isCurrent: !0,
|
|
180
189
|
useKey: !0
|
|
181
|
-
}
|
|
190
|
+
})
|
|
182
191
|
},
|
|
183
192
|
cellConfig: {},
|
|
184
193
|
headerCellConfig: {},
|
|
@@ -196,9 +205,12 @@ const Re = {
|
|
|
196
205
|
seqConfig: {},
|
|
197
206
|
sortConfig: {},
|
|
198
207
|
filterConfig: {},
|
|
208
|
+
floatingFilterConfig: {},
|
|
199
209
|
radioConfig: {},
|
|
200
210
|
checkboxConfig: {},
|
|
211
|
+
headerTooltipConfig: {},
|
|
201
212
|
tooltipConfig: {},
|
|
213
|
+
footerTooltipConfig: {},
|
|
202
214
|
exportConfig: {},
|
|
203
215
|
importConfig: {},
|
|
204
216
|
printConfig: {},
|
|
@@ -219,14 +231,14 @@ const Re = {
|
|
|
219
231
|
scrollX: {},
|
|
220
232
|
scrollY: {},
|
|
221
233
|
virtualXConfig: {
|
|
222
|
-
default: {
|
|
234
|
+
default: () => ({
|
|
223
235
|
enabled: !1
|
|
224
|
-
}
|
|
236
|
+
})
|
|
225
237
|
},
|
|
226
238
|
virtualYConfig: {
|
|
227
|
-
default: {
|
|
239
|
+
default: () => ({
|
|
228
240
|
enabled: !1
|
|
229
|
-
}
|
|
241
|
+
})
|
|
230
242
|
},
|
|
231
243
|
scrollbarConfig: {},
|
|
232
244
|
params: {},
|
|
@@ -385,67 +397,66 @@ const Re = {
|
|
|
385
397
|
"toolbar-tool-click",
|
|
386
398
|
"zoom"
|
|
387
399
|
],
|
|
388
|
-
setup(
|
|
389
|
-
expose:
|
|
390
|
-
emit:
|
|
400
|
+
setup(Fe, {
|
|
401
|
+
expose: A,
|
|
402
|
+
emit: E
|
|
391
403
|
}) {
|
|
392
|
-
const
|
|
393
|
-
getLoading:
|
|
394
|
-
setLoading:
|
|
395
|
-
} =
|
|
404
|
+
const l = E, g = be("table"), O = oe(), b = s(), C = s(), V = s([]), d = s(), $ = ae(), a = P(() => T($.props, e(d))), {
|
|
405
|
+
getLoading: q,
|
|
406
|
+
setLoading: G
|
|
407
|
+
} = Re(a), {
|
|
396
408
|
getPaginationInfo: i,
|
|
397
|
-
setPagination:
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
} = Be(o), {
|
|
409
|
+
setPagination: f,
|
|
410
|
+
getCurrentPage: I
|
|
411
|
+
} = ze(a), {
|
|
401
412
|
getViewColumns: K,
|
|
402
413
|
setColumns: L
|
|
403
|
-
} =
|
|
404
|
-
te(() =>
|
|
405
|
-
|
|
406
|
-
|
|
414
|
+
} = Se(a);
|
|
415
|
+
te(() => I(), (o) => {
|
|
416
|
+
le(() => {
|
|
417
|
+
y({
|
|
407
418
|
seqConfig: {
|
|
408
|
-
startIndex: (
|
|
419
|
+
startIndex: (o - 1) * (i.value?.pageSize || e(a).pageSize || _)
|
|
409
420
|
}
|
|
410
421
|
});
|
|
411
422
|
});
|
|
412
423
|
}, {
|
|
413
424
|
immediate: !0
|
|
414
425
|
});
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
-
...e(
|
|
418
|
-
...
|
|
426
|
+
function y(o) {
|
|
427
|
+
d.value = {
|
|
428
|
+
...e(d),
|
|
429
|
+
...o
|
|
419
430
|
};
|
|
420
431
|
}
|
|
421
432
|
const {
|
|
422
|
-
getDataSourceRef:
|
|
433
|
+
getDataSourceRef: w,
|
|
423
434
|
handleTableChange: M,
|
|
424
435
|
reload: X,
|
|
425
436
|
deleteTableDataRecord: Y,
|
|
426
|
-
insertTableDataRecord:
|
|
427
|
-
updateTableData:
|
|
428
|
-
updateTableDataRecord:
|
|
429
|
-
setTableData:
|
|
430
|
-
getDataSource:
|
|
431
|
-
getRawDataSource:
|
|
437
|
+
insertTableDataRecord: j,
|
|
438
|
+
updateTableData: W,
|
|
439
|
+
updateTableDataRecord: U,
|
|
440
|
+
setTableData: v,
|
|
441
|
+
getDataSource: J,
|
|
442
|
+
getRawDataSource: k,
|
|
432
443
|
tableSearch: x
|
|
433
|
-
} =
|
|
434
|
-
tableData:
|
|
435
|
-
setLoading:
|
|
444
|
+
} = Be(a, {
|
|
445
|
+
tableData: V,
|
|
446
|
+
setLoading: G,
|
|
436
447
|
getPaginationInfo: i,
|
|
437
|
-
setPagination:
|
|
448
|
+
setPagination: f
|
|
438
449
|
}, l);
|
|
439
|
-
function
|
|
440
|
-
|
|
450
|
+
function S(o) {
|
|
451
|
+
o?.pageSize && f({
|
|
441
452
|
currentPage: 1
|
|
442
|
-
}), M
|
|
453
|
+
}), M(o), l("change", o);
|
|
443
454
|
const {
|
|
444
455
|
onChange: t
|
|
445
|
-
} = e(
|
|
446
|
-
t &&
|
|
456
|
+
} = e(a);
|
|
457
|
+
t && me(t) && t(o);
|
|
447
458
|
}
|
|
448
|
-
const
|
|
459
|
+
const B = {};
|
|
449
460
|
[
|
|
450
461
|
"update:data",
|
|
451
462
|
"keydown-start",
|
|
@@ -566,51 +577,50 @@ const Re = {
|
|
|
566
577
|
"toolbar-button-click",
|
|
567
578
|
"toolbar-tool-click",
|
|
568
579
|
"zoom"
|
|
569
|
-
].forEach((
|
|
570
|
-
const t =
|
|
571
|
-
|
|
580
|
+
].forEach((o) => {
|
|
581
|
+
const t = xe.camelCase(`on-${o}`);
|
|
582
|
+
B[t] = (...n) => l(o, ...n);
|
|
572
583
|
});
|
|
573
|
-
const r =
|
|
574
|
-
const
|
|
575
|
-
...
|
|
576
|
-
...e(
|
|
577
|
-
columns:
|
|
578
|
-
loading: e(
|
|
579
|
-
data:
|
|
580
|
-
...
|
|
584
|
+
const r = P(() => {
|
|
585
|
+
const o = e(w), t = {
|
|
586
|
+
...O,
|
|
587
|
+
...e(a),
|
|
588
|
+
columns: re(e(K)),
|
|
589
|
+
loading: e(q),
|
|
590
|
+
data: o,
|
|
591
|
+
...B
|
|
581
592
|
};
|
|
582
|
-
return
|
|
583
|
-
}),
|
|
584
|
-
setPagination:
|
|
593
|
+
return fe && (t.maxHeight = e(a)?.maxHeight ? e(a)?.maxHeight : `${window.innerHeight - e(a)?.extraSysHeight - (a.value?.showPager ? a.value?.pageHeight || 40 : 0)}px`, t.minHeight = e(a)?.toolbarConfig?.custom ? 300 : e(a)?.minHeight), t;
|
|
594
|
+
}), R = {
|
|
595
|
+
setPagination: f,
|
|
585
596
|
emit: l,
|
|
586
|
-
setProps:
|
|
597
|
+
setProps: y,
|
|
587
598
|
reload: X,
|
|
588
|
-
getShowPagination: b,
|
|
589
599
|
deleteTableDataRecord: Y,
|
|
590
|
-
insertTableDataRecord:
|
|
591
|
-
updateTableDataRecord:
|
|
592
|
-
updateTableData:
|
|
593
|
-
setTableData:
|
|
594
|
-
getDataSource:
|
|
595
|
-
getDataSourceRef:
|
|
600
|
+
insertTableDataRecord: j,
|
|
601
|
+
updateTableDataRecord: U,
|
|
602
|
+
updateTableData: W,
|
|
603
|
+
setTableData: v,
|
|
604
|
+
getDataSource: J,
|
|
605
|
+
getDataSourceRef: w,
|
|
596
606
|
setColumns: L,
|
|
597
|
-
getRawDataSource:
|
|
607
|
+
getRawDataSource: k,
|
|
598
608
|
tableSearch: x
|
|
599
609
|
};
|
|
600
|
-
l("register",
|
|
601
|
-
const
|
|
610
|
+
l("register", R);
|
|
611
|
+
const Q = {
|
|
602
612
|
field: "_filterTableData",
|
|
603
613
|
label: "",
|
|
604
|
-
type:
|
|
614
|
+
type: pe.SEARCH,
|
|
605
615
|
componentProps: ({}) => ({
|
|
606
|
-
onChange: (
|
|
616
|
+
onChange: (o) => {
|
|
607
617
|
z({
|
|
608
|
-
_filterTableData:
|
|
618
|
+
_filterTableData: o
|
|
609
619
|
});
|
|
610
620
|
}
|
|
611
621
|
})
|
|
612
|
-
}, [
|
|
613
|
-
schemas: [r.value?.formOptions?.addSearchAllSchema ?
|
|
622
|
+
}, [Z] = he(T({
|
|
623
|
+
schemas: [r.value?.formOptions?.addSearchAllSchema ? Q : {}],
|
|
614
624
|
rowProps: {
|
|
615
625
|
justify: "start"
|
|
616
626
|
},
|
|
@@ -624,45 +634,46 @@ const Re = {
|
|
|
624
634
|
btnText: "搜索"
|
|
625
635
|
},
|
|
626
636
|
actionInline: !0
|
|
627
|
-
},
|
|
637
|
+
}, ue(
|
|
628
638
|
r.value?.formOptions,
|
|
629
639
|
["showActionForm", "addSearchAllSchema"]
|
|
630
640
|
// 'union' | 'intersection' | 'concat' | 'replace' = 'union'
|
|
631
|
-
), "replace")), z = (
|
|
632
|
-
Reflect.has(
|
|
633
|
-
},
|
|
634
|
-
|
|
641
|
+
), "replace")), z = (o) => {
|
|
642
|
+
Reflect.has(o, "_filterTableData") && x(o._filterTableData), l("form-submit", o);
|
|
643
|
+
}, ee = () => {
|
|
644
|
+
v(k()), l("form-reset");
|
|
635
645
|
};
|
|
636
|
-
return
|
|
637
|
-
table:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
646
|
+
return A({
|
|
647
|
+
table: b,
|
|
648
|
+
pageRef: C,
|
|
649
|
+
...R
|
|
650
|
+
}), (o, t) => (m(), u(e(Ce), null, {
|
|
651
|
+
fallback: c(() => [p(e(we))]),
|
|
652
|
+
default: c(() => [H("div", {
|
|
653
|
+
class: ne([e(g).b()])
|
|
654
|
+
}, [p(e(ke), F({
|
|
644
655
|
ref_key: "xGrid",
|
|
645
|
-
ref:
|
|
656
|
+
ref: b
|
|
646
657
|
}, r.value), {
|
|
647
|
-
toolbarButtons: c(() => [
|
|
658
|
+
toolbarButtons: c(() => [h(o.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), u(e(ve), {
|
|
648
659
|
key: 0,
|
|
649
|
-
onRegister: e(
|
|
660
|
+
onRegister: e(Z),
|
|
650
661
|
onSubmit: z,
|
|
651
|
-
onReset:
|
|
652
|
-
}, null, 8, ["onRegister"])) : D("", !0),
|
|
653
|
-
empty: c(() => [p(e(
|
|
654
|
-
|
|
655
|
-
}, null, 8, ["type"])]),
|
|
656
|
-
loading: c(() => [ne(P("div", Re, null, 512), [[e(ie), r.value.loading]])]),
|
|
662
|
+
onReset: ee
|
|
663
|
+
}, null, 8, ["onRegister"])) : D("", !0), h(o.$slots, "toolbar-right")]),
|
|
664
|
+
empty: c(() => [h(o.$slots, "empty", {}, () => [p(e(ge), ie(se(r.value.emptyCfg)), null, 16)])]),
|
|
665
|
+
loading: c(() => [ce(H("div", He, null, 512), [[e(de), !!r.value.loading]])]),
|
|
657
666
|
_: 3
|
|
658
|
-
}, 16), r.value.showPager
|
|
659
|
-
key: 0
|
|
667
|
+
}, 16), r.value.showPager ? (m(), u(e(ye), F({
|
|
668
|
+
key: 0,
|
|
669
|
+
ref_key: "pageRef",
|
|
670
|
+
ref: C
|
|
660
671
|
}, e(i), {
|
|
661
|
-
class: [e(
|
|
662
|
-
onCurrentChange: t[0] || (t[0] = (n) =>
|
|
672
|
+
class: [e(g).e("pager"), e(g).m(`pager-${e(i)?.pagePlacement}`)],
|
|
673
|
+
onCurrentChange: t[0] || (t[0] = (n) => S({
|
|
663
674
|
currentPage: n
|
|
664
675
|
})),
|
|
665
|
-
onSizeChange: t[1] || (t[1] = (n) =>
|
|
676
|
+
onSizeChange: t[1] || (t[1] = (n) => S({
|
|
666
677
|
pageSize: n
|
|
667
678
|
}))
|
|
668
679
|
}), null, 16, ["class"])) : D("", !0)], 2)]),
|
|
@@ -671,5 +682,5 @@ const Re = {
|
|
|
671
682
|
}
|
|
672
683
|
});
|
|
673
684
|
export {
|
|
674
|
-
|
|
685
|
+
lo as default
|
|
675
686
|
};
|
|
@@ -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
|
}
|