@dazhicheng/ui 1.6.18 → 1.6.20
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/components/tt-form/index.d.ts +2 -2
- package/dist/components/tt-form/src/formApi.d.ts +11 -2
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +162 -114
- package/dist/components/tt-form/src/group-form/groupFormApi.js +8 -14
- package/dist/components/tt-form/src/group-form/lazyContext.d.ts +18 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +64 -36
- package/dist/components/tt-form/src/group-form/types.d.ts +39 -6
- package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +7 -5
- package/dist/components/tt-form/src/types.d.ts +58 -26
- package/dist/components/tt-form/src/useForm.d.ts +1 -1
- package/dist/components/tt-form/src/useForm.js +5 -5
- package/dist/components/tt-modal-form/props.d.ts +9 -4
- package/dist/components/tt-modal-form/useModalForm.d.ts +1 -1
- package/dist/components/tt-table/index.d.ts +15 -0
- package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
- package/dist/components/tt-table/src/Table.vue.js +240 -242
- package/dist/components/tt-table/src/TableForm.vue.d.ts +15 -4
- package/dist/components/tt-table/src/TableForm.vue.js +232 -202
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +1 -1
- package/dist/components/tt-table/src/hooks/usePagination.js +38 -24
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +4 -4
- package/dist/components/tt-table/src/props.d.ts +12 -1
- package/dist/components/tt-table/src/props.js +14 -4
- package/dist/components/tt-table/src/types/table.d.ts +8 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +44 -10
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
- package/package.json +1 -1
|
@@ -1,52 +1,66 @@
|
|
|
1
|
-
import { GlobalConfig as
|
|
1
|
+
import { GlobalConfig as s } from "../../../../hooks/useSetup.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
|
+
import { isFunction as P } from "../../../../packages/utils/src/is.js";
|
|
5
|
+
import { ref as h, unref as t, computed as C, watch as y } from "vue";
|
|
4
6
|
import "dayjs";
|
|
5
|
-
import { ref as c, unref as o, computed as P, watch as l } from "vue";
|
|
6
7
|
import "numeral";
|
|
7
8
|
import "xe-utils";
|
|
8
9
|
import "dayjs/plugin/utc";
|
|
9
10
|
import "dayjs/plugin/timezone";
|
|
10
|
-
import { mergeWithArrayOverride as
|
|
11
|
+
import { mergeWithArrayOverride as b } from "../../../../packages/utils/src/merge.js";
|
|
11
12
|
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
12
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
13
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
14
15
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
15
16
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
16
17
|
import "lodash-es";
|
|
17
|
-
const
|
|
18
|
+
const z = {
|
|
18
19
|
currentPage: 1,
|
|
19
20
|
pageSize: 300,
|
|
20
21
|
total: 0,
|
|
21
22
|
pageSizes: [300, 500, 1e3, 2e3],
|
|
22
23
|
layouts: ["Total", "PrevPage", "JumpNumber", "NextPage", "Sizes", "FullJump"]
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
const r =
|
|
27
|
-
|
|
28
|
-
),
|
|
29
|
-
const { showPager:
|
|
30
|
-
if (!(!
|
|
31
|
-
return { ...
|
|
25
|
+
function D(i, f) {
|
|
26
|
+
var u;
|
|
27
|
+
const r = h(
|
|
28
|
+
b(t(i).pagerConfig || {}, ((u = s.table) == null ? void 0 : u.pagerConfig) || {})
|
|
29
|
+
), g = C(() => {
|
|
30
|
+
const { showPager: e, pagerConfig: n } = t(i);
|
|
31
|
+
if (!(!e && !n))
|
|
32
|
+
return { ...z, ...t(r) };
|
|
32
33
|
});
|
|
33
|
-
function
|
|
34
|
-
return
|
|
34
|
+
function c() {
|
|
35
|
+
return t(g);
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
r.value = { ...
|
|
37
|
+
function o(e) {
|
|
38
|
+
r.value = { ...t(r), ...e };
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
let a = !1;
|
|
41
|
+
async function l(e) {
|
|
42
|
+
const { currentPage: n, pageSize: m } = e, { beforePageChange: p } = t(i);
|
|
43
|
+
if (P(p)) {
|
|
44
|
+
if (a) return;
|
|
45
|
+
a = !0;
|
|
46
|
+
try {
|
|
47
|
+
if (await p({ ...t(r), currentPage: n, pageSize: m }) === !1) return;
|
|
48
|
+
} catch {
|
|
49
|
+
return;
|
|
50
|
+
} finally {
|
|
51
|
+
a = !1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
o({ currentPage: n, pageSize: m }), f("page-change", e);
|
|
41
55
|
}
|
|
42
|
-
return
|
|
43
|
-
() =>
|
|
44
|
-
(
|
|
45
|
-
|
|
56
|
+
return y(
|
|
57
|
+
() => t(i).pagerConfig,
|
|
58
|
+
(e) => {
|
|
59
|
+
e && o(e);
|
|
46
60
|
},
|
|
47
61
|
{ deep: !0 }
|
|
48
|
-
), { pagination: r, paginationInfo:
|
|
62
|
+
), { pagination: r, paginationInfo: g, getPagination: c, setPagination: o, onPageChange: l };
|
|
49
63
|
}
|
|
50
64
|
export {
|
|
51
|
-
|
|
65
|
+
D as usePagination
|
|
52
66
|
};
|
|
@@ -16,9 +16,9 @@ type TtTableRenderEmits = Record<string, (...args: any[]) => any>;
|
|
|
16
16
|
*
|
|
17
17
|
* `Row` 是业务行数据类型,传入后表格插槽作用域与 `tableFormApi.tableApi` 的方法签名跟着推断。
|
|
18
18
|
*/
|
|
19
|
-
export type TtUseTableFormRenderReturnType<Row = any> = [
|
|
20
|
-
DefineSetupFnComponent<TtTableFormProps<Row>, TtTableRenderEmits, SlotsType<TtTableSlots<Row>>>,
|
|
21
|
-
TtTableExtendedTableFormApi<Row>
|
|
19
|
+
export type TtUseTableFormRenderReturnType<Row = any, TValues extends Record<string, any> = Record<string, any>> = [
|
|
20
|
+
DefineSetupFnComponent<TtTableFormProps<Row, TValues>, TtTableRenderEmits, SlotsType<TtTableSlots<Row>>>,
|
|
21
|
+
TtTableExtendedTableFormApi<Row, TValues>
|
|
22
22
|
];
|
|
23
23
|
/**
|
|
24
24
|
* useTableRender 的返回值
|
|
@@ -61,7 +61,7 @@ export type TtUseTableRenderReturnType<Row = any> = [
|
|
|
61
61
|
* // 在模板中使用
|
|
62
62
|
* <FormTable />
|
|
63
63
|
*/
|
|
64
|
-
export declare function useTableFormRender<Row = any>(options: NoInfer<TtTableFormProps<Row>>): TtUseTableFormRenderReturnType<Row>;
|
|
64
|
+
export declare function useTableFormRender<Row = any, TValues extends Record<string, any> = Record<string, any>>(options: NoInfer<TtTableFormProps<Row, TValues>>): TtUseTableFormRenderReturnType<Row, TValues>;
|
|
65
65
|
/**
|
|
66
66
|
* 用于渲染表格的 hooks,返回 [TableRender 组件, 表格API]。
|
|
67
67
|
*
|
|
@@ -2,7 +2,7 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { TtExtendedFormApi, TtFormProps } from '../../tt-form';
|
|
3
3
|
import { VxeTableDefines, VxeTablePropTypes } from 'vxe-table';
|
|
4
4
|
import { TtTableExtendedTableApi, TtTableProps } from './types/table';
|
|
5
|
-
import { TtTableExtendedTableFormApi } from './types/tableForm';
|
|
5
|
+
import { TtTableExtendedTableFormApi, TtTableFormProps } from './types/tableForm';
|
|
6
6
|
import { TtTableToolsProps } from './types/tableTools';
|
|
7
7
|
/** 表格参数 */
|
|
8
8
|
export declare const tableProps: {
|
|
@@ -71,6 +71,11 @@ export declare const tableProps: {
|
|
|
71
71
|
type: PropType<TtTableProps["beforeFetch"]>;
|
|
72
72
|
default: null;
|
|
73
73
|
};
|
|
74
|
+
/** 用户操作分页器请求前的回调,返回 false 拦下这次翻页 */
|
|
75
|
+
beforePageChange: {
|
|
76
|
+
type: PropType<TtTableProps["beforePageChange"]>;
|
|
77
|
+
default: null;
|
|
78
|
+
};
|
|
74
79
|
/**
|
|
75
80
|
* data
|
|
76
81
|
*
|
|
@@ -479,6 +484,7 @@ export declare const tableFormProps: {
|
|
|
479
484
|
immediate?: boolean;
|
|
480
485
|
afterFetch?: ((data: any[], res: Recordable | Recordable[]) => Promise<any[]>) | undefined;
|
|
481
486
|
beforeFetch?: (params: Recordable) => Promise<Recordable>;
|
|
487
|
+
beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
|
|
482
488
|
isScrollFetch?: boolean;
|
|
483
489
|
showToolbar?: boolean;
|
|
484
490
|
columnsFieldSort?: string[];
|
|
@@ -504,6 +510,11 @@ export declare const tableFormProps: {
|
|
|
504
510
|
type: PropType<Fn>;
|
|
505
511
|
default: null;
|
|
506
512
|
};
|
|
513
|
+
/** 查询发起请求前的调用方法,返回 false 拦截本次查询 */
|
|
514
|
+
tableSearchBefore: {
|
|
515
|
+
type: PropType<NonNullable<TtTableFormProps["tableSearchBefore"]>>;
|
|
516
|
+
default: null;
|
|
517
|
+
};
|
|
507
518
|
/** TtTableTools的props */
|
|
508
519
|
toolConfig: {
|
|
509
520
|
type: PropType<TtTableToolsProps>;
|
|
@@ -82,7 +82,7 @@ const a = {
|
|
|
82
82
|
type: Function
|
|
83
83
|
// default: () => GlobalConfig.table?.customizeColumn,
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, n = {
|
|
86
86
|
/** api请求方法 */
|
|
87
87
|
api: {
|
|
88
88
|
type: Function,
|
|
@@ -102,6 +102,11 @@ const a = {
|
|
|
102
102
|
type: Function,
|
|
103
103
|
default: null
|
|
104
104
|
},
|
|
105
|
+
/** 用户操作分页器请求前的回调,返回 false 拦下这次翻页 */
|
|
106
|
+
beforePageChange: {
|
|
107
|
+
type: Function,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
105
110
|
/**
|
|
106
111
|
* data
|
|
107
112
|
*
|
|
@@ -115,7 +120,7 @@ const a = {
|
|
|
115
120
|
},
|
|
116
121
|
/** 是否滚动加载数据 */
|
|
117
122
|
isScrollFetch: { type: Boolean, default: () => e("isScrollFetch") }
|
|
118
|
-
},
|
|
123
|
+
}, p = {
|
|
119
124
|
/** 是否显示toolbar */
|
|
120
125
|
showToolbar: { type: Boolean, default: () => e("showToolbar") },
|
|
121
126
|
/** 具体某些列排序 field数组 */
|
|
@@ -207,8 +212,8 @@ const a = {
|
|
|
207
212
|
},
|
|
208
213
|
...a,
|
|
209
214
|
...r,
|
|
210
|
-
...
|
|
211
|
-
...
|
|
215
|
+
...n,
|
|
216
|
+
...p
|
|
212
217
|
}, i = {
|
|
213
218
|
/** 按键配置项 */
|
|
214
219
|
keyboardConfig: {
|
|
@@ -261,6 +266,11 @@ const a = {
|
|
|
261
266
|
type: Function,
|
|
262
267
|
default: null
|
|
263
268
|
},
|
|
269
|
+
/** 查询发起请求前的调用方法,返回 false 拦截本次查询 */
|
|
270
|
+
tableSearchBefore: {
|
|
271
|
+
type: Function,
|
|
272
|
+
default: null
|
|
273
|
+
},
|
|
264
274
|
/** TtTableTools的props */
|
|
265
275
|
toolConfig: {
|
|
266
276
|
type: Object,
|
|
@@ -77,6 +77,14 @@ export type TtTableFetchProps<Row = any> = {
|
|
|
77
77
|
* @param params 请求参数
|
|
78
78
|
*/
|
|
79
79
|
beforeFetch?: (params: Recordable) => Promise<Recordable>;
|
|
80
|
+
/**
|
|
81
|
+
* 用户操作分页器发起请求前的回调,返回 `false` 拦下这次翻页,页码保持原样。
|
|
82
|
+
*
|
|
83
|
+
* 只拦分页器上的交互,代码里调 `setPagination()` 改分页不经过它。
|
|
84
|
+
* `TtTableForm` 会用它把分页接到 `tableSearchBefore` 上,用表单的组合方式时不必自己传。
|
|
85
|
+
* @param page 这次要切到的分页信息
|
|
86
|
+
*/
|
|
87
|
+
beforePageChange?: (page: VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
|
|
80
88
|
/** 是否滚动加载 */
|
|
81
89
|
isScrollFetch?: boolean;
|
|
82
90
|
};
|
|
@@ -3,19 +3,43 @@ import { TtSelectRowKeysType, TtTableMethods, TtTableProps } from '../types/tabl
|
|
|
3
3
|
import { TableFormApi } from '../utils/table-form-api';
|
|
4
4
|
import { TtTableToolsProps } from './tableTools';
|
|
5
5
|
import { TtExtendedFormApi, TtFormProps } from '../../../tt-form';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 搜索表单配置。
|
|
8
|
+
*
|
|
9
|
+
* `TValues` 是搜索表单的值类型,由 `useTableFormRender<Row, SearchValues>()` 传入后,
|
|
10
|
+
* schema 里 `dependencies` 等回调的 values 参数会跟着推断;不传时退化为 `Record<string, any>`。
|
|
11
|
+
*/
|
|
12
|
+
export type TtTableFormRenderFormProps<TValues extends Record<string, any> = Record<string, any>> = Partial<TtFormProps<TValues>>;
|
|
13
|
+
export type TtTableRenderFormInstance<TValues extends Record<string, any> = Record<string, any>> = TtExtendedFormApi<TValues>;
|
|
14
|
+
/**
|
|
15
|
+
* 触发查询的入口。
|
|
16
|
+
*
|
|
17
|
+
* `submit` 查询按钮或回车提交,`reset` 重置按钮,`refresh` 工具栏刷新按钮,`page` 分页器翻页或改每页条数。
|
|
18
|
+
*/
|
|
19
|
+
export type TtTableSearchTrigger = "submit" | "reset" | "refresh" | "page";
|
|
20
|
+
/**
|
|
21
|
+
* 查询前拦截的返回结果。
|
|
22
|
+
*
|
|
23
|
+
* 直接返回布尔值表示是否发起查询;需要在拦截的同时清掉列表时返回对象形式。
|
|
24
|
+
*/
|
|
25
|
+
export type TtTableSearchBeforeResult = boolean | {
|
|
26
|
+
/** 是否继续发起查询请求 */
|
|
27
|
+
canSearch: boolean;
|
|
28
|
+
/** 是否清空表格数据与分页总数,默认 false */
|
|
29
|
+
clearData?: boolean;
|
|
30
|
+
};
|
|
8
31
|
/**
|
|
9
32
|
* 表单 + 表格的组合配置。
|
|
10
33
|
*
|
|
11
34
|
* `Row` 是业务行数据类型,由 `useTableFormRender<Row>()` 传入后 `table` 里的列配置、
|
|
12
35
|
* 数据与 `tableApi` 的方法签名都会跟着推断;不传时退化为 `any`。
|
|
36
|
+
* `TValues` 是搜索表单的值类型,由第二个类型参数传入,决定 `form` 里各回调的 values 类型。
|
|
13
37
|
*/
|
|
14
|
-
export type TtTableFormProps<Row = any> = {
|
|
38
|
+
export type TtTableFormProps<Row = any, TValues extends Record<string, any> = Record<string, any>> = {
|
|
15
39
|
/** 表格配置 */
|
|
16
40
|
table?: Partial<TtTableProps<Row>>;
|
|
17
41
|
/** form 配置 */
|
|
18
|
-
form?: TtTableFormRenderFormProps
|
|
42
|
+
form?: TtTableFormRenderFormProps<TValues>;
|
|
19
43
|
/** 是否开启form表单 */
|
|
20
44
|
useSearchForm?: boolean;
|
|
21
45
|
handleSearchInfoFn?: Fn;
|
|
@@ -23,6 +47,16 @@ export type TtTableFormProps<Row = any> = {
|
|
|
23
47
|
toolConfig?: TtTableToolsProps;
|
|
24
48
|
/** 刷新前的调用方法 */
|
|
25
49
|
tableRefreshBefore?: (...arg: any[]) => Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* 用户操作发起查询请求前的调用方法。
|
|
52
|
+
*
|
|
53
|
+
* 返回 `false` 拦截本次查询;返回 `{ canSearch, clearData }` 可以在拦截的同时清空表格数据。
|
|
54
|
+
* 覆盖查询、重置、工具栏刷新与分页器四个用户入口;`table.immediate` 的首次自动请求、
|
|
55
|
+
* `reload()` / `setPagination()` 等 API 调用都不经过这里。分页被拦下时页码保持原样。
|
|
56
|
+
* @param values 通过校验后的当前表单值,重置时是重置后的值
|
|
57
|
+
* @param trigger 触发入口
|
|
58
|
+
*/
|
|
59
|
+
tableSearchBefore?: (values: TValues, trigger: TtTableSearchTrigger) => TtTableSearchBeforeResult | Promise<TtTableSearchBeforeResult>;
|
|
26
60
|
/**
|
|
27
61
|
* 表格 testId,用于生成测试标识
|
|
28
62
|
* 如果不指定,将从 table.api 路径自动提取
|
|
@@ -31,13 +65,13 @@ export type TtTableFormProps<Row = any> = {
|
|
|
31
65
|
*/
|
|
32
66
|
testId?: string;
|
|
33
67
|
};
|
|
34
|
-
export type TtTableFormActionType<Row = any> = {
|
|
68
|
+
export type TtTableFormActionType<Row = any, TValues extends Record<string, any> = Record<string, any>> = {
|
|
35
69
|
setTableProps: (props: Partial<TtTableProps<Row>>) => void;
|
|
36
|
-
setFormProps: (props: TtTableFormRenderFormProps) => void;
|
|
70
|
+
setFormProps: (props: TtTableFormRenderFormProps<TValues>) => void;
|
|
37
71
|
tableMethods: TtTableMethods<Row>;
|
|
38
|
-
formMethods: TtTableRenderFormInstance
|
|
72
|
+
formMethods: TtTableRenderFormInstance<TValues>;
|
|
39
73
|
/** 设置props */
|
|
40
|
-
setProps: (props: Partial<TtTableFormProps<Row>>) => void;
|
|
74
|
+
setProps: (props: Partial<TtTableFormProps<Row, TValues>>) => void;
|
|
41
75
|
/** reload */
|
|
42
76
|
reload: TtTableMethods<Row>["reload"];
|
|
43
77
|
/**
|
|
@@ -46,6 +80,6 @@ export type TtTableFormActionType<Row = any> = {
|
|
|
46
80
|
*/
|
|
47
81
|
selectedKeys: MaybeRef<TtSelectRowKeysType>;
|
|
48
82
|
};
|
|
49
|
-
export type TtTableExtendedTableFormApi<Row = any> = TableFormApi<Row> & {
|
|
50
|
-
useStore: <T = NoInfer<TtTableFormProps<Row>>>(selector?: (state: NoInfer<TtTableFormProps<Row>>) => T) => Readonly<Ref<T>>;
|
|
83
|
+
export type TtTableExtendedTableFormApi<Row = any, TValues extends Record<string, any> = Record<string, any>> = TableFormApi<Row, TValues> & {
|
|
84
|
+
useStore: <T = NoInfer<TtTableFormProps<Row, TValues>>>(selector?: (state: NoInfer<TtTableFormProps<Row, TValues>>) => T) => Readonly<Ref<T>>;
|
|
51
85
|
};
|
|
@@ -13,37 +13,37 @@ import { Store } from '@tanstack/vue-store';
|
|
|
13
13
|
* api.reload()
|
|
14
14
|
* api.setFormProps({ ... })
|
|
15
15
|
*/
|
|
16
|
-
declare class TableFormApi<Row = any> {
|
|
16
|
+
declare class TableFormApi<Row = any, TValues extends Record<string, any> = Record<string, any>> {
|
|
17
17
|
/** form 表单实例(FormApi) */
|
|
18
|
-
formApi: TtExtendedFormApi
|
|
18
|
+
formApi: TtExtendedFormApi<TValues>;
|
|
19
19
|
/** 表格 API 实例(TableApi) */
|
|
20
20
|
tableApi: TtTableExtendedTableApi<Row>;
|
|
21
21
|
/** vxe-grid 表格实例 */
|
|
22
22
|
grid: VxeGridInstance;
|
|
23
23
|
/** 当前表单+表格的 props 状态 */
|
|
24
|
-
state: null | TtTableFormProps<Row>;
|
|
24
|
+
state: null | TtTableFormProps<Row, TValues>;
|
|
25
25
|
/** 表单操作方法集合(TableFormActionType) */
|
|
26
|
-
tableForm: TtTableFormActionType<Row>;
|
|
26
|
+
tableForm: TtTableFormActionType<Row, TValues>;
|
|
27
27
|
/** 响应式 store,存储表单+表格的状态 */
|
|
28
|
-
store: Store<TtTableFormProps<Row>>;
|
|
28
|
+
store: Store<TtTableFormProps<Row, TValues>>;
|
|
29
29
|
private isMounted;
|
|
30
30
|
private stateHandler;
|
|
31
31
|
/**
|
|
32
32
|
* 构造函数,初始化 store、tableApi、状态等
|
|
33
33
|
* @param options 表单+表格配置项
|
|
34
34
|
*/
|
|
35
|
-
constructor(options?: TtTableFormProps<Row>);
|
|
35
|
+
constructor(options?: TtTableFormProps<Row, TValues>);
|
|
36
36
|
/**
|
|
37
37
|
* 组件挂载时调用,注入表单和表格实例
|
|
38
38
|
* @param instance 表单操作方法实例
|
|
39
39
|
* @param formApi 表单实例
|
|
40
40
|
*/
|
|
41
|
-
mount(instance: null | TtTableFormActionType<Row>, formApi: TtExtendedFormApi): void;
|
|
41
|
+
mount(instance: null | TtTableFormActionType<Row, TValues>, formApi: TtExtendedFormApi<TValues>): void;
|
|
42
42
|
/**
|
|
43
43
|
* 更新表单+表格的数据
|
|
44
44
|
* @param stateOrFn 新状态或返回新状态的函数
|
|
45
45
|
*/
|
|
46
|
-
setState(stateOrFn: ((prev: TtTableFormProps<Row>) => Partial<TtTableFormProps<Row>>) | Partial<TtTableFormProps<Row>>): void;
|
|
46
|
+
setState(stateOrFn: ((prev: TtTableFormProps<Row, TValues>) => Partial<TtTableFormProps<Row, TValues>>) | Partial<TtTableFormProps<Row, TValues>>): void;
|
|
47
47
|
/**
|
|
48
48
|
* 重新加载表格数据
|
|
49
49
|
* @param data 可选的查询参数
|
|
@@ -56,7 +56,7 @@ declare class TableFormApi<Row = any> {
|
|
|
56
56
|
/**
|
|
57
57
|
* 获取表单实例
|
|
58
58
|
*/
|
|
59
|
-
formInstance():
|
|
59
|
+
formInstance(): TtExtendedFormApi<TValues>;
|
|
60
60
|
/**
|
|
61
61
|
* 获取 vxe-grid 表格实例
|
|
62
62
|
*/
|
|
@@ -74,12 +74,12 @@ declare class TableFormApi<Row = any> {
|
|
|
74
74
|
* 设置表单属性
|
|
75
75
|
* @param props 表单属性
|
|
76
76
|
*/
|
|
77
|
-
setFormProps(props: Partial<TtTableFormRenderFormProps
|
|
77
|
+
setFormProps(props: Partial<TtTableFormRenderFormProps<TValues>>): void;
|
|
78
78
|
/**
|
|
79
79
|
* 设置表单+表格属性
|
|
80
80
|
* @param props 属性
|
|
81
81
|
*/
|
|
82
|
-
setProps(props: Partial<TtTableFormProps<Row>>): void;
|
|
82
|
+
setProps(props: Partial<TtTableFormProps<Row, TValues>>): void;
|
|
83
83
|
/**
|
|
84
84
|
* 组件卸载时调用,重置挂载状态
|
|
85
85
|
*/
|