@ttkj/avue 2.10.20 → 2.10.22
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/avue.js +34 -34
- package/lib/avue.min.js +3 -3
- package/package.json +1 -1
- package/types/crud/column.d.ts +8 -8
- package/types/crud/index.d.ts +32 -2
- package/types/form/components/dynamic.d.ts +16 -1
- package/types/form/index.d.ts +18 -0
package/package.json
CHANGED
package/types/crud/column.d.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
import { CreateElement, VNode } from 'vue';
|
2
2
|
import { RenderHeaderData, TableColumn, TableColumnFilter } from 'element-ui/types/table-column';
|
3
3
|
import { PopoverPlacement } from 'element-ui/types/popover';
|
4
|
-
import { AvueAlignment, Obj } from '../global';
|
4
|
+
import { AvueAlignment, AvueComponentSize, Obj } from '../global';
|
5
5
|
import { FormColumnEventParams, AvueFormBaseColumn, AvueFormColumn, FormColumnEvent } from '../form/column';
|
6
6
|
import { DynamicFormColumnChildren } from '../form/components/dynamic';
|
7
7
|
|
8
8
|
/**
|
9
9
|
* 表单项事件参数,适用于click|blur|focus
|
10
10
|
*/
|
11
|
-
export interface CrudColumnEventParams<T = Obj> extends FormColumnEventParams<T> {
|
11
|
+
export interface CrudColumnEventParams<T = Obj, U = Obj> extends FormColumnEventParams<T, U> {
|
12
12
|
/** 所在行 */
|
13
13
|
index: number;
|
14
14
|
/** 行数据 */
|
@@ -23,7 +23,7 @@ export interface CrudColumnEventParams<T = Obj> extends FormColumnEventParams<T>
|
|
23
23
|
}
|
24
24
|
|
25
25
|
/** 表格项通用参数 */
|
26
|
-
export interface CrudBaseColumn {
|
26
|
+
export interface CrudBaseColumn<T = Obj> {
|
27
27
|
/** 列类型, 默认: 'input' */
|
28
28
|
type?: string;
|
29
29
|
/** 对应列内容的字段名 */
|
@@ -105,7 +105,7 @@ export interface CrudColumnStyleOption {
|
|
105
105
|
}
|
106
106
|
|
107
107
|
/** 表格项通用搜索相关配置 */
|
108
|
-
export interface CrudColumnSearchOption {
|
108
|
+
export interface CrudColumnSearchOption<T = Obj> {
|
109
109
|
/** 是否搜索项, 默认: false */
|
110
110
|
search: boolean;
|
111
111
|
/** 自定义搜索组件 */
|
@@ -240,7 +240,7 @@ export interface CrudColumnSearchOption {
|
|
240
240
|
}
|
241
241
|
|
242
242
|
/** 表格项通用过滤相关配置 */
|
243
|
-
export interface CrudColumnFilterOption {
|
243
|
+
export interface CrudColumnFilterOption<T = Obj> {
|
244
244
|
/**
|
245
245
|
* 是否在动态搜索条件里面显示, 默认: true
|
246
246
|
* @default true
|
@@ -368,10 +368,10 @@ export interface CrudFormColumnEvent<T = Obj> {
|
|
368
368
|
|
369
369
|
/** 表格项通用参数 */
|
370
370
|
export interface AvueCrudBaseColumn<T = Obj>
|
371
|
-
extends CrudBaseColumn
|
371
|
+
extends CrudBaseColumn<T>,
|
372
372
|
Partial<CrudColumnStyleOption>,
|
373
|
-
Partial<CrudColumnSearchOption
|
374
|
-
Partial<CrudColumnFilterOption
|
373
|
+
Partial<CrudColumnSearchOption<T>>,
|
374
|
+
Partial<CrudColumnFilterOption<T>>,
|
375
375
|
Partial<CrudFormColumnOption>,
|
376
376
|
Partial<CrudFormColumnEvent<T>> {}
|
377
377
|
|
package/types/crud/index.d.ts
CHANGED
@@ -5,11 +5,12 @@ import { ElForm } from 'element-ui/types/form';
|
|
5
5
|
import { ElTable } from 'element-ui/types/element-ui';
|
6
6
|
import { ElUploadInternalRawFile } from 'element-ui/types/upload';
|
7
7
|
|
8
|
-
import { AvueComponent, Obj } from '../global';
|
8
|
+
import { AvueComponent, Obj, DicProps } from '../global';
|
9
9
|
import { CrudOption } from './option';
|
10
10
|
import { AvueCrudColumn } from './column';
|
11
11
|
import { AvueCrudHeaderSearch } from './refs/header-search';
|
12
12
|
import { AvueCrudDialogForm } from './refs/dialog-form';
|
13
|
+
import { DynamicFormColumnEventParams } from '../form/components/dynamic';
|
13
14
|
|
14
15
|
/** 表单打开类型 */
|
15
16
|
export type AvueCrudFormMode = 'add' | 'edit' | 'view';
|
@@ -249,7 +250,7 @@ export interface CrudSearchFormNormalScope<T = any, R = Obj> {
|
|
249
250
|
dic?: Obj[];
|
250
251
|
}
|
251
252
|
|
252
|
-
/**
|
253
|
+
/** 通用弹窗表单插槽 */
|
253
254
|
export interface CrudFormNormalScope<T = any> {
|
254
255
|
/** 表单值 */
|
255
256
|
value: T;
|
@@ -262,3 +263,32 @@ export interface CrudFormNormalScope<T = any> {
|
|
262
263
|
/** 表单弹窗类型 */
|
263
264
|
type: AvueCrudFormMode;
|
264
265
|
}
|
266
|
+
|
267
|
+
/** 通用行内弹窗表单插槽 */
|
268
|
+
export interface CrudCellFormNormalScope<T = any, D = Obj> extends CrudNormalScope<D> {
|
269
|
+
/** 数据字典 */
|
270
|
+
dic?: Obj[];
|
271
|
+
/** 列配置 */
|
272
|
+
tableData: {
|
273
|
+
/** 行索引 */
|
274
|
+
index: number;
|
275
|
+
/** 行数据 */
|
276
|
+
row: D;
|
277
|
+
/** 显示值 */
|
278
|
+
label: string;
|
279
|
+
/** 列索引 */
|
280
|
+
columnIndex: Record<string, AvueCrudColumn>;
|
281
|
+
/** 数据字典 */
|
282
|
+
dic?: Obj[];
|
283
|
+
/** 根表单数据,明细组件时有值 */
|
284
|
+
rootFormData?: DynamicFormColumnEventParams;
|
285
|
+
};
|
286
|
+
/** props配置 */
|
287
|
+
props?: DicProps;
|
288
|
+
/** 是否只读 */
|
289
|
+
readonly?: boolean;
|
290
|
+
/** 是否禁用 */
|
291
|
+
disabled?: boolean;
|
292
|
+
/** 是否显示清空按钮 */
|
293
|
+
clearable: boolean;
|
294
|
+
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
// 引入定义
|
2
2
|
import { Obj } from '../../global';
|
3
3
|
import { CrudOption } from '../../crud/option';
|
4
|
-
import {
|
4
|
+
import { FormOption } from '../option';
|
5
|
+
import { AvueFormBaseColumn, FormColumnEventParams, AvueFormColumn } from '../column';
|
5
6
|
|
6
7
|
/** 明细表单/表格配置 */
|
7
8
|
export interface DynamicFormColumnChildren extends CrudOption {
|
@@ -33,3 +34,17 @@ export interface DynamicFormColumn<T = Obj> extends AvueFormBaseColumn<T> {
|
|
33
34
|
/** 其他配置 */
|
34
35
|
[x: string]: any;
|
35
36
|
}
|
37
|
+
/** 表单项事件参数,适用于click|blur|focus */
|
38
|
+
export interface DynamicFormColumnEventParams<T = Obj, U = Obj> extends FormColumnEventParams<T, U> {
|
39
|
+
/** 根表单数据 */
|
40
|
+
rootFormData: {
|
41
|
+
/** 表单项列配置索引 */
|
42
|
+
columnIndex: Record<string, AvueFormColumn>;
|
43
|
+
/** 根表单的数据值 */
|
44
|
+
data: T;
|
45
|
+
/** */
|
46
|
+
formOption: FormOption<T>;
|
47
|
+
};
|
48
|
+
}
|
49
|
+
/** change事件参数 */
|
50
|
+
export type DynamicFormColumnChangeEventParams<T = Obj, U = Obj> = Omit<DynamicFormColumnEventParams<T, U>, 'event'>;
|
package/types/form/index.d.ts
CHANGED
@@ -65,3 +65,21 @@ export declare class AvueForm<T = Obj> extends AvueComponent {
|
|
65
65
|
/** 组件Refs */
|
66
66
|
$refs: AvueFormRefs;
|
67
67
|
}
|
68
|
+
|
69
|
+
/** 通用表单插槽 */
|
70
|
+
export interface FormNormalScope<T = any, D = Obj> {
|
71
|
+
/** 表单值 */
|
72
|
+
value: T;
|
73
|
+
/** 选中值,仅适用于涉及字典的组件 */
|
74
|
+
label?: string;
|
75
|
+
/** 列配置 */
|
76
|
+
column: AvueCrudColumn;
|
77
|
+
/** 大小 */
|
78
|
+
size: AvueComponentSize;
|
79
|
+
/** 是否只读 */
|
80
|
+
readonly?: boolean;
|
81
|
+
/** 是否禁用 */
|
82
|
+
disabled: boolean;
|
83
|
+
/** 表单数据 */
|
84
|
+
row: D;
|
85
|
+
}
|