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.
Files changed (41) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/es/components/pagination/index.d.ts +3 -1
  4. package/es/components/pagination/pagination.vue.d.ts +3 -1
  5. package/es/components/pagination/pagination.vue2.js +47 -44
  6. package/es/components/table/constants.d.ts +2 -1
  7. package/es/components/table/constants.js +2 -2
  8. package/es/components/table/field.d.ts +60 -0
  9. package/es/components/table/index.d.ts +1271 -544
  10. package/es/components/table/table.vue.d.ts +291 -124
  11. package/es/components/table/table.vue2.js +143 -132
  12. package/es/components/table/types.d.ts +48 -43
  13. package/es/components/table/use/use-data-source.js +69 -69
  14. package/es/components/table/use/use-pagination.d.ts +11 -7
  15. package/es/components/table/use/use-pagination.js +36 -46
  16. package/es/components/table/utils.d.ts +24 -4
  17. package/es/index.js +2 -2
  18. package/es/package.json.d.ts +4 -3
  19. package/es/package.json.js +1 -1
  20. package/lib/components/pagination/index.d.ts +3 -1
  21. package/lib/components/pagination/pagination.vue.d.ts +3 -1
  22. package/lib/components/pagination/pagination.vue2.cjs +1 -1
  23. package/lib/components/table/constants.cjs +1 -1
  24. package/lib/components/table/constants.d.ts +2 -1
  25. package/lib/components/table/field.d.ts +60 -0
  26. package/lib/components/table/index.d.ts +1271 -544
  27. package/lib/components/table/table.vue.d.ts +291 -124
  28. package/lib/components/table/table.vue2.cjs +1 -1
  29. package/lib/components/table/types.d.ts +48 -43
  30. package/lib/components/table/use/use-data-source.cjs +1 -1
  31. package/lib/components/table/use/use-pagination.cjs +1 -1
  32. package/lib/components/table/use/use-pagination.d.ts +11 -7
  33. package/lib/components/table/utils.d.ts +24 -4
  34. package/lib/package.json.cjs +1 -1
  35. package/lib/package.json.d.ts +4 -3
  36. package/package.json +6 -5
  37. package/tags.json +1 -1
  38. package/theme-style/index.css +1 -1
  39. package/theme-style/src/table.scss +6 -1
  40. package/theme-style/vft-table.css +1 -1
  41. package/web-types.json +1 -1
@@ -1,42 +1,42 @@
1
- import { defineComponent as T, useAttrs as ee, ref as u, getCurrentInstance as ae, computed as R, unref as e, watch as te, nextTick as oe, toRaw as le, createBlock as f, openBlock as m, withCtx as c, createElementVNode as P, normalizeClass as re, createVNode as p, createCommentVNode as D, mergeProps as H, withDirectives as ne, renderSlot as _ } from "vue";
2
- import { VftEmpty as ce } from "../empty/index.js";
3
- import { vLoading as ie } from "../loading/directive.js";
4
- import { deepMerge as F, isClient as se, omit as ge, isFunction as de } from "@vft/utils";
5
- import { FormCompEnum as ue } from "../../utils/form-register.js";
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 fe } from "../super-form/use/use-form.js";
10
- import { useNamespace as me } from "../../hooks/use-namespace/index.js";
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 pe } from "../client-only/index.js";
16
- import { VftPagination as he } from "../pagination/index.js";
17
- import { VftSkeleton as be } from "../skeleton/index.js";
18
- import { VftSuperForm as Ce } from "../super-form/index.js";
19
- import { VxeGrid as ye } from "vxe-table";
20
- import we from "xe-utils";
21
- import { PAGE_SIZE as ve } from "./constants.js";
22
- import { useColumns as xe } from "./use/use-columns.js";
23
- import { useDataSource as ke } from "./use/use-data-source.js";
24
- import { useLoading as Se } from "./use/use-loading.js";
25
- import { usePagination as Be } from "./use/use-pagination.js";
26
- import { EmptyEnum as ze } from "../empty/constants.js";
27
- const Re = {
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
- }, Pe = T({
29
+ }, De = N({
30
30
  name: "vft-table"
31
- }), ta = /* @__PURE__ */ T({
32
- ...Pe,
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: ve
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(De, {
389
- expose: E,
390
- emit: A
400
+ setup(Fe, {
401
+ expose: A,
402
+ emit: E
391
403
  }) {
392
- const s = me("table"), l = A, N = ee(), h = u(), O = u([]), g = u(), V = ae(), o = R(() => F(V.props, e(g))), {
393
- getLoading: I,
394
- setLoading: q
395
- } = Se(o), {
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: d,
398
- getShowPagination: b,
399
- getCurrentPage: G
400
- } = Be(o), {
409
+ setPagination: f,
410
+ getCurrentPage: I
411
+ } = ze(a), {
401
412
  getViewColumns: K,
402
413
  setColumns: L
403
- } = xe(o);
404
- te(() => G(), (a) => {
405
- oe(() => {
406
- C({
414
+ } = Se(a);
415
+ te(() => I(), (o) => {
416
+ le(() => {
417
+ y({
407
418
  seqConfig: {
408
- startIndex: (a - 1) * (i.value?.pageSize || e(o).pageSize)
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 C(a) {
416
- g.value = {
417
- ...e(g),
418
- ...a
426
+ function y(o) {
427
+ d.value = {
428
+ ...e(d),
429
+ ...o
419
430
  };
420
431
  }
421
432
  const {
422
- getDataSourceRef: y,
433
+ getDataSourceRef: w,
423
434
  handleTableChange: M,
424
435
  reload: X,
425
436
  deleteTableDataRecord: Y,
426
- insertTableDataRecord: $,
427
- updateTableData: j,
428
- updateTableDataRecord: W,
429
- setTableData: w,
430
- getDataSource: U,
431
- getRawDataSource: v,
437
+ insertTableDataRecord: j,
438
+ updateTableData: W,
439
+ updateTableDataRecord: U,
440
+ setTableData: v,
441
+ getDataSource: J,
442
+ getRawDataSource: k,
432
443
  tableSearch: x
433
- } = ke(o, {
434
- tableData: O,
435
- setLoading: q,
444
+ } = Be(a, {
445
+ tableData: V,
446
+ setLoading: G,
436
447
  getPaginationInfo: i,
437
- setPagination: d
448
+ setPagination: f
438
449
  }, l);
439
- function k(...a) {
440
- a?.[0]?.pageSize && d({
450
+ function S(o) {
451
+ o?.pageSize && f({
441
452
  currentPage: 1
442
- }), M.call(void 0, ...a), l("change", ...a);
453
+ }), M(o), l("change", o);
443
454
  const {
444
455
  onChange: t
445
- } = e(o);
446
- t && de(t) && t.call(void 0, ...a);
456
+ } = e(a);
457
+ t && me(t) && t(o);
447
458
  }
448
- const S = {};
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((a) => {
570
- const t = we.camelCase(`on-${a}`);
571
- S[t] = (...n) => l(a, ...n);
580
+ ].forEach((o) => {
581
+ const t = xe.camelCase(`on-${o}`);
582
+ B[t] = (...n) => l(o, ...n);
572
583
  });
573
- const r = R(() => {
574
- const a = e(y), t = {
575
- ...N,
576
- ...e(o),
577
- columns: le(e(K)),
578
- loading: e(I),
579
- data: a,
580
- ...S
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 se && (t.maxHeight = e(o)?.maxHeight ? e(o)?.maxHeight : window.innerHeight - e(o)?.extraSysHeight - (o.value?.showPager ? o.value?.pageHeight : 0) + "px"), t;
583
- }), B = {
584
- setPagination: d,
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: C,
597
+ setProps: y,
587
598
  reload: X,
588
- getShowPagination: b,
589
599
  deleteTableDataRecord: Y,
590
- insertTableDataRecord: $,
591
- updateTableDataRecord: W,
592
- updateTableData: j,
593
- setTableData: w,
594
- getDataSource: U,
595
- getDataSourceRef: y,
600
+ insertTableDataRecord: j,
601
+ updateTableDataRecord: U,
602
+ updateTableData: W,
603
+ setTableData: v,
604
+ getDataSource: J,
605
+ getDataSourceRef: w,
596
606
  setColumns: L,
597
- getRawDataSource: v,
607
+ getRawDataSource: k,
598
608
  tableSearch: x
599
609
  };
600
- l("register", B);
601
- const Z = {
610
+ l("register", R);
611
+ const Q = {
602
612
  field: "_filterTableData",
603
613
  label: "",
604
- type: ue.SEARCH,
614
+ type: pe.SEARCH,
605
615
  componentProps: ({}) => ({
606
- onChange: (a) => {
616
+ onChange: (o) => {
607
617
  z({
608
- _filterTableData: a
618
+ _filterTableData: o
609
619
  });
610
620
  }
611
621
  })
612
- }, [J] = fe(F({
613
- schemas: [r.value?.formOptions?.addSearchAllSchema ? Z : {}],
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
- }, ge(
637
+ }, ue(
628
638
  r.value?.formOptions,
629
639
  ["showActionForm", "addSearchAllSchema"]
630
640
  // 'union' | 'intersection' | 'concat' | 'replace' = 'union'
631
- ), "replace")), z = (a) => {
632
- Reflect.has(a, "_filterTableData") && x(a._filterTableData), l("form-submit", a);
633
- }, Q = () => {
634
- w(v()), l("form-reset");
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 E({
637
- table: h,
638
- ...B
639
- }), (a, t) => (m(), f(e(pe), null, {
640
- fallback: c(() => [p(e(be))]),
641
- default: c(() => [P("div", {
642
- class: re(e(s).b())
643
- }, [p(e(ye), H({
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: h
656
+ ref: b
646
657
  }, r.value), {
647
- toolbarButtons: c(() => [_(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(Ce), {
658
+ toolbarButtons: c(() => [h(o.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), u(e(ve), {
648
659
  key: 0,
649
- onRegister: e(J),
660
+ onRegister: e(Z),
650
661
  onSubmit: z,
651
- onReset: Q
652
- }, null, 8, ["onRegister"])) : D("", !0), _(a.$slots, "toolbar-right")]),
653
- empty: c(() => [p(e(ce), {
654
- type: e(ze).NoData
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 && e(b) ? (m(), f(e(he), H({
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(s).e("pager"), e(s).m("pager-" + e(i).pagePlacement)],
662
- onCurrentChange: t[0] || (t[0] = (n) => k({
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) => k({
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
- ta as default
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
  }