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.
Files changed (47) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/es/components/carousel/use-carousel.js +1 -1
  4. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  5. package/es/components/input/input.vue2.js +4 -4
  6. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  7. package/es/components/pagination/index.d.ts +3 -1
  8. package/es/components/pagination/pagination.vue.d.ts +3 -1
  9. package/es/components/pagination/pagination.vue2.js +47 -44
  10. package/es/components/super-form/super-form-item.vue2.js +1 -1
  11. package/es/components/table/constants.d.ts +2 -1
  12. package/es/components/table/constants.js +2 -2
  13. package/es/components/table/field.d.ts +60 -0
  14. package/es/components/table/index.d.ts +1224 -551
  15. package/es/components/table/table.vue.d.ts +291 -124
  16. package/es/components/table/table.vue2.js +130 -127
  17. package/es/components/table/types.d.ts +48 -43
  18. package/es/components/table/use/use-data-source.js +69 -69
  19. package/es/components/table/use/use-pagination.d.ts +11 -7
  20. package/es/components/table/use/use-pagination.js +36 -46
  21. package/es/components/table/utils.d.ts +24 -4
  22. package/es/package.json.d.ts +2 -1
  23. package/es/package.json.js +1 -1
  24. package/es/utils/vue/vnode.js +1 -1
  25. package/lib/components/input/input.vue2.cjs +1 -1
  26. package/lib/components/pagination/index.d.ts +3 -1
  27. package/lib/components/pagination/pagination.vue.d.ts +3 -1
  28. package/lib/components/pagination/pagination.vue2.cjs +1 -1
  29. package/lib/components/table/constants.cjs +1 -1
  30. package/lib/components/table/constants.d.ts +2 -1
  31. package/lib/components/table/field.d.ts +60 -0
  32. package/lib/components/table/index.d.ts +1224 -551
  33. package/lib/components/table/table.vue.d.ts +291 -124
  34. package/lib/components/table/table.vue2.cjs +1 -1
  35. package/lib/components/table/types.d.ts +48 -43
  36. package/lib/components/table/use/use-data-source.cjs +1 -1
  37. package/lib/components/table/use/use-pagination.cjs +1 -1
  38. package/lib/components/table/use/use-pagination.d.ts +11 -7
  39. package/lib/components/table/utils.d.ts +24 -4
  40. package/lib/package.json.cjs +1 -1
  41. package/lib/package.json.d.ts +2 -1
  42. package/package.json +6 -5
  43. package/tags.json +1 -1
  44. package/theme-style/index.css +1 -1
  45. package/theme-style/src/table.scss +6 -1
  46. package/theme-style/vft-table.css +1 -1
  47. 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 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 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 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
- }, Pe = T({
29
+ }, He = N({
30
30
  name: "vft-table"
31
- }), ta = /* @__PURE__ */ T({
32
- ...Pe,
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: ve
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(De, {
389
- expose: E,
390
- emit: A
392
+ setup(_e, {
393
+ expose: A,
394
+ emit: E
391
395
  }) {
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), {
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: d,
398
- getShowPagination: b,
399
- getCurrentPage: G
400
- } = Be(o), {
401
+ setPagination: u,
402
+ getCurrentPage: I
403
+ } = ze(t), {
401
404
  getViewColumns: K,
402
405
  setColumns: L
403
- } = xe(o);
404
- te(() => G(), (a) => {
405
- oe(() => {
406
- C({
406
+ } = Se(t);
407
+ oe(() => I(), (a) => {
408
+ le(() => {
409
+ y({
407
410
  seqConfig: {
408
- startIndex: (a - 1) * (i.value?.pageSize || e(o).pageSize)
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 C(a) {
416
- g.value = {
417
- ...e(g),
418
+ function y(a) {
419
+ d.value = {
420
+ ...e(d),
418
421
  ...a
419
422
  };
420
423
  }
421
424
  const {
422
- getDataSourceRef: y,
425
+ getDataSourceRef: w,
423
426
  handleTableChange: M,
424
427
  reload: X,
425
428
  deleteTableDataRecord: Y,
426
- insertTableDataRecord: $,
427
- updateTableData: j,
428
- updateTableDataRecord: W,
429
- setTableData: w,
430
- getDataSource: U,
431
- getRawDataSource: v,
429
+ insertTableDataRecord: j,
430
+ updateTableData: W,
431
+ updateTableDataRecord: U,
432
+ setTableData: v,
433
+ getDataSource: J,
434
+ getRawDataSource: k,
432
435
  tableSearch: x
433
- } = ke(o, {
434
- tableData: O,
435
- setLoading: q,
436
+ } = Be(t, {
437
+ tableData: V,
438
+ setLoading: G,
436
439
  getPaginationInfo: i,
437
- setPagination: d
440
+ setPagination: u
438
441
  }, l);
439
- function k(...a) {
440
- a?.[0]?.pageSize && d({
442
+ function S(a) {
443
+ a?.pageSize && u({
441
444
  currentPage: 1
442
- }), M.call(void 0, ...a), l("change", ...a);
445
+ }), M(a), l("change", a);
443
446
  const {
444
- onChange: t
445
- } = e(o);
446
- t && de(t) && t.call(void 0, ...a);
447
+ onChange: o
448
+ } = e(t);
449
+ o && me(o) && o(a);
447
450
  }
448
- const S = {};
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 t = we.camelCase(`on-${a}`);
571
- S[t] = (...n) => l(a, ...n);
573
+ const o = xe.camelCase(`on-${a}`);
574
+ B[o] = (...n) => l(a, ...n);
572
575
  });
573
- const r = R(() => {
574
- const a = e(y), t = {
575
- ...N,
576
- ...e(o),
577
- columns: le(e(K)),
578
- loading: e(I),
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
- ...S
583
+ ...B
581
584
  };
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,
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: C,
589
+ setProps: y,
587
590
  reload: X,
588
- getShowPagination: b,
589
591
  deleteTableDataRecord: Y,
590
- insertTableDataRecord: $,
591
- updateTableDataRecord: W,
592
- updateTableData: j,
593
- setTableData: w,
594
- getDataSource: U,
595
- getDataSourceRef: y,
592
+ insertTableDataRecord: j,
593
+ updateTableDataRecord: U,
594
+ updateTableData: W,
595
+ setTableData: v,
596
+ getDataSource: J,
597
+ getDataSourceRef: w,
596
598
  setColumns: L,
597
- getRawDataSource: v,
599
+ getRawDataSource: k,
598
600
  tableSearch: x
599
601
  };
600
- l("register", B);
601
- const Z = {
602
+ l("register", R);
603
+ const Q = {
602
604
  field: "_filterTableData",
603
605
  label: "",
604
- type: ue.SEARCH,
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
- }, [J] = fe(F({
613
- schemas: [r.value?.formOptions?.addSearchAllSchema ? Z : {}],
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
- }, ge(
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
- }, Q = () => {
634
- w(v()), l("form-reset");
635
+ }, ee = () => {
636
+ v(k()), l("form-reset");
635
637
  };
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({
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: h
648
+ ref: b
646
649
  }, r.value), {
647
- toolbarButtons: c(() => [_(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(Ce), {
650
+ toolbarButtons: c(() => [h(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(ve), {
648
651
  key: 0,
649
- onRegister: e(J),
652
+ onRegister: e(Z),
650
653
  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]])]),
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 && e(b) ? (m(), f(e(he), H({
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(s).e("pager"), e(s).m("pager-" + e(i).pagePlacement)],
662
- onCurrentChange: t[0] || (t[0] = (n) => k({
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: t[1] || (t[1] = (n) => k({
668
+ onSizeChange: o[1] || (o[1] = (n) => S({
666
669
  pageSize: n
667
670
  }))
668
- }), null, 16, ["class"])) : D("", !0)], 2)]),
671
+ }), null, 16, ["class"])) : H("", !0)], 2)]),
669
672
  _: 3
670
673
  }));
671
674
  }
672
675
  });
673
676
  export {
674
- ta as default
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
  }