@ttkj/avue 2.10.10 → 2.10.12
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/README.md +2 -24
- package/package.json +7 -2
- package/types/README.md +48 -0
- package/types/avue.d.ts +33 -0
- package/types/crud/column.d.ts +383 -0
- package/types/crud/index.d.ts +263 -0
- package/types/crud/option.d.ts +376 -0
- package/types/crud/refs/dialog-form.d.ts +36 -0
- package/types/form/column.d.ts +300 -0
- package/types/form/index.d.ts +63 -0
- package/types/form/option.d.ts +167 -0
- package/types/global-component/dialog-form.d.ts +57 -0
- package/types/global-component/export.d.ts +23 -0
- package/types/global-component/image-cropper.d.ts +142 -0
- package/types/global-component/image-preview.d.ts +52 -0
- package/types/global-component/watermark.d.ts +37 -0
- package/types/global.d.ts +315 -0
- package/types/index.d.ts +4 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<p align="center"><a href="https://avuejs.com" target="_blank" rel="noopener noreferrer"><img width="100" src="https://avuejs.com/images/logo-bg.jpg" alt="Avue logo"></a></p>
|
|
2
2
|
|
|
3
3
|
## 介绍
|
|
4
|
-
|
|
4
|
+
在@smallwei/avue的基础上进行二次开发
|
|
5
5
|
|
|
6
6
|
### 浏览器兼容性
|
|
7
|
-
支持所有符合ES5标准的浏览器(不支持
|
|
7
|
+
支持所有符合ES5标准的浏览器(不支持IE).
|
|
8
8
|
|
|
9
9
|
## 文件
|
|
10
10
|
|
|
@@ -12,25 +12,3 @@
|
|
|
12
12
|
|-------------|----------|
|
|
13
13
|
| avue.min.js | 生产环境|
|
|
14
14
|
| avue.js | 开发环境|
|
|
15
|
-
|
|
16
|
-
## 文档
|
|
17
|
-
|
|
18
|
-
要查看[Live Examples](https://avuejs.com/doc/installation)和文档,请访问[https://avuejs.com](https://avuejs.com).
|
|
19
|
-
|
|
20
|
-
## 问答
|
|
21
|
-
|
|
22
|
-
有关问题和支持,请使用[issues](https://gitee.com/smallweigit/avue/issues)或加入QQ群606410437.
|
|
23
|
-
|
|
24
|
-
## issues
|
|
25
|
-
|
|
26
|
-
打开问题之前,请务必提供详细的问题过程和截图,不符合准则的问题将会被拒绝.
|
|
27
|
-
|
|
28
|
-
## Changelog
|
|
29
|
-
|
|
30
|
-
[发行说明](https://gitee.com/smallweigit/avue/releases)中记录了每个版本的详细更改。
|
|
31
|
-
|
|
32
|
-
## License
|
|
33
|
-
|
|
34
|
-
[MIT](http://opensource.org/licenses/MIT)
|
|
35
|
-
|
|
36
|
-
Copyright (c) 2017-present, Smallwei
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttkj/avue",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.12",
|
|
4
4
|
"description": "A Magic Configurable Web Framework",
|
|
5
5
|
"main": "lib/avue.min.js",
|
|
6
6
|
"unpkg": "lib/avue.min.js",
|
|
@@ -19,9 +19,13 @@
|
|
|
19
19
|
"element-ui",
|
|
20
20
|
"avue"
|
|
21
21
|
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "gitee",
|
|
24
|
+
"url": "gitee+https://gitee.com/nbhm_department/avue.git"
|
|
25
|
+
},
|
|
22
26
|
"author": "osxcn",
|
|
23
27
|
"license": "MIT",
|
|
24
|
-
"homepage": "https://gitee.com/nbhm_department/avue/README.md",
|
|
28
|
+
"homepage": "https://gitee.com/nbhm_department/avue/blob/v2.10.x/README.md",
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"@babel/core": "^7.13.14",
|
|
27
31
|
"@babel/preset-env": "^7.13.12",
|
|
@@ -61,6 +65,7 @@
|
|
|
61
65
|
},
|
|
62
66
|
"files": [
|
|
63
67
|
"lib",
|
|
68
|
+
"types",
|
|
64
69
|
"README.md",
|
|
65
70
|
"LICENSE"
|
|
66
71
|
]
|
package/types/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 介绍
|
|
2
|
+
|
|
3
|
+
`avue.js`的定义文件
|
|
4
|
+
|
|
5
|
+
# 引入方式
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
declare module '@smallwei/avue/lib/avue' {
|
|
9
|
+
import Avue from 'xxx/types/avue';
|
|
10
|
+
export default Avue;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
其中,`xxx`表示定义文件的相对路径
|
|
15
|
+
|
|
16
|
+
## 更新说明
|
|
17
|
+
|
|
18
|
+
* 0.0.1
|
|
19
|
+
|
|
20
|
+
初始版本,仅包含框架定义和crud组件基础配置
|
|
21
|
+
* 0.0.2
|
|
22
|
+
|
|
23
|
+
- 补充了curd基础配置一些缺失的配置项
|
|
24
|
+
- 添加了avue全局api定义
|
|
25
|
+
* 0.0.3
|
|
26
|
+
|
|
27
|
+
- 将AVue全局重命名为Avue
|
|
28
|
+
- 添加了全局定义
|
|
29
|
+
- crud组件 添加了部分参数
|
|
30
|
+
- crud组件 修改了部分参数的默认值和定义
|
|
31
|
+
* 0.0.4
|
|
32
|
+
|
|
33
|
+
- crud组件 添加表单打开模式定时
|
|
34
|
+
- crud组件 修复column为object导致无法使用对象属性方法的bug
|
|
35
|
+
|
|
36
|
+
* 1.0.0
|
|
37
|
+
更新avue版本为2.9.12
|
|
38
|
+
|
|
39
|
+
* 1.0.1
|
|
40
|
+
- 完善了全局API中$DialogForm的定义
|
|
41
|
+
|
|
42
|
+
* 1.0.2
|
|
43
|
+
- 完善了Curd组件的定义
|
|
44
|
+
|
|
45
|
+
* 1.0.3
|
|
46
|
+
- 添加了对Crud/Form组件配置中方法row(行数据)定义的支持
|
|
47
|
+
- 完善了Form组件的定义
|
|
48
|
+
- 修正了Crud组件option配置中未支持Form组件部分公共定义的bug
|
package/types/avue.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Vue as _Vue } from 'vue';
|
|
2
|
+
import { AvueComponent, AvueComponentSize, AvueAlignment } from './global';
|
|
3
|
+
|
|
4
|
+
import { AvueCrud } from './crud';
|
|
5
|
+
import { AvueForm } from './form';
|
|
6
|
+
|
|
7
|
+
export interface InstallationOptions {
|
|
8
|
+
locale: any;
|
|
9
|
+
i18n: any;
|
|
10
|
+
size: AvueComponentSize;
|
|
11
|
+
menuType: 'button' | 'icon' | 'text' | 'menu';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Avue的版本号 */
|
|
15
|
+
export const version: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 将Avue组件安装至Vue
|
|
19
|
+
* 使用`Vue.use(Avue)`进行安装
|
|
20
|
+
*/
|
|
21
|
+
export function install(vue: typeof _Vue, options: InstallationOptions): void;
|
|
22
|
+
|
|
23
|
+
/** Avue组件公共定义 */
|
|
24
|
+
export type Component = AvueComponent;
|
|
25
|
+
|
|
26
|
+
/** 对齐方式 */
|
|
27
|
+
export type Alignment = AvueAlignment;
|
|
28
|
+
|
|
29
|
+
/** Crud表格组件 */
|
|
30
|
+
export class Crud extends AvueCrud {}
|
|
31
|
+
|
|
32
|
+
/** Crud表格组件 */
|
|
33
|
+
export class Form extends AvueForm {}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { CreateElement, VNode } from 'vue';
|
|
2
|
+
import { RenderHeaderData, TableColumn, TableColumnFilter } from 'element-ui/types/table-column';
|
|
3
|
+
import { PopoverPlacement } from 'element-ui/types/popover';
|
|
4
|
+
import { AvueAlignment, Obj } from '../global';
|
|
5
|
+
import { FormColumnEventParams, AvueFormBaseColumn, AvueFormColumn, FormColumnEvent } from '../form/column';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 表单项事件参数,适用于click|blur|focus
|
|
9
|
+
*/
|
|
10
|
+
export interface CrudColumnEventParams<T = Obj> extends FormColumnEventParams {
|
|
11
|
+
/** 所在行 */
|
|
12
|
+
index: number;
|
|
13
|
+
/** 行数据 */
|
|
14
|
+
row: T;
|
|
15
|
+
/** 列配置 */
|
|
16
|
+
column: AvueCrudColumn<T>;
|
|
17
|
+
/**
|
|
18
|
+
* 值的label
|
|
19
|
+
* @description 如果表单项type为选项的,则为选项的label,否则等同于value
|
|
20
|
+
*/
|
|
21
|
+
label: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** 表格项通用参数 */
|
|
25
|
+
export interface CrudBaseColumn {
|
|
26
|
+
/** 列类型, 默认: 'input' */
|
|
27
|
+
type?: string;
|
|
28
|
+
/** 对应列内容的字段名 */
|
|
29
|
+
prop?: string;
|
|
30
|
+
/** 显示的标题 */
|
|
31
|
+
label: string;
|
|
32
|
+
/** 自定义组件名 */
|
|
33
|
+
component?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 是否隐藏列, 默认: false
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
hide?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 是否加入动态现隐列, 默认: true
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
showColumn?: boolean;
|
|
44
|
+
/** 对应列是否可以排序,如果设置为 'custom',则代表用户希望远程排序,需要监听 Table 的 sort-change 事件, 默认: false */
|
|
45
|
+
sortable?: boolean | 'custom';
|
|
46
|
+
/** 子列配置 */
|
|
47
|
+
children?: AvueCrudColumn[];
|
|
48
|
+
/** 列标题 Label 区域渲染使用的 Function */
|
|
49
|
+
renderHeader?: (h: CreateElement, data: RenderHeaderData) => VNode | string;
|
|
50
|
+
/**
|
|
51
|
+
* 是否允许行内编辑, 默认: false
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
cell?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 开启html转义, 默认: false
|
|
57
|
+
* @default false
|
|
58
|
+
* @since 2.8.23
|
|
59
|
+
*/
|
|
60
|
+
html?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 内容格式化,配合html参数可返回html
|
|
63
|
+
* @param row 行数据
|
|
64
|
+
* @param value 当前行列对应项的值
|
|
65
|
+
* @param res formatter前的解析结果
|
|
66
|
+
* @param column 列配置
|
|
67
|
+
* @since 2.6.16
|
|
68
|
+
*/
|
|
69
|
+
formatter?: (row: T, value: any, res: any, column: AvueCrudColumn) => string;
|
|
70
|
+
/**
|
|
71
|
+
* 表格打开表单的时候是否重新拉取字典, 默认: false
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
dicFlag?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 是否开启列自定义, 默认: false
|
|
77
|
+
* @default false
|
|
78
|
+
* @deprecated 2.8.0
|
|
79
|
+
*/
|
|
80
|
+
slot?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 是否开启表头自定义, 默认: false
|
|
83
|
+
* @default false
|
|
84
|
+
* @since 2.7.8
|
|
85
|
+
* @deprecated 2.8.0
|
|
86
|
+
*/
|
|
87
|
+
headerslot?: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** 表格项样式配置 */
|
|
91
|
+
export interface CrudColumnStyleOption {
|
|
92
|
+
/** 当内容过长被隐藏时显示tooltip, 默认: false */
|
|
93
|
+
overHidden: boolean;
|
|
94
|
+
/** 对应列的宽度 */
|
|
95
|
+
width: string | number;
|
|
96
|
+
/** 对应列的最小宽度,与 width 的区别是 width 是固定的,min-width 会把剩余宽度按比例分配给设置了 min-width 的列 */
|
|
97
|
+
minWidth: string | number;
|
|
98
|
+
/** 表头对齐方式, 默认: 'center' */
|
|
99
|
+
headerAlign: AvueAlignment;
|
|
100
|
+
/** 表格列齐方式, 默认: 'center' */
|
|
101
|
+
align: AvueAlignment;
|
|
102
|
+
/** 列是否固定在左侧或者右侧,true 表示固定在左侧 */
|
|
103
|
+
fixed: boolean | 'left' | 'right';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** 表格项通用搜索相关配置 */
|
|
107
|
+
export interface CrudColumnSearchOption {
|
|
108
|
+
/** 是否搜索项, 默认: false */
|
|
109
|
+
search: boolean;
|
|
110
|
+
/** 自定义搜索组件 */
|
|
111
|
+
searchComponent: string;
|
|
112
|
+
/**
|
|
113
|
+
* 搜索项默认值
|
|
114
|
+
* @since 2.8.21
|
|
115
|
+
*/
|
|
116
|
+
searchValue: any;
|
|
117
|
+
/**
|
|
118
|
+
* 搜索项placeholder
|
|
119
|
+
* @since 2.8.20
|
|
120
|
+
*/
|
|
121
|
+
searchPlaceholder: string;
|
|
122
|
+
/**
|
|
123
|
+
* 搜索项弹窗编辑文字提示
|
|
124
|
+
* @since 2.8.20
|
|
125
|
+
*/
|
|
126
|
+
searchTip: string;
|
|
127
|
+
/**
|
|
128
|
+
* 搜索项搜索框辅助文字提示展示方向
|
|
129
|
+
* @since 2.8.20
|
|
130
|
+
*/
|
|
131
|
+
searchTipPlacement: PopoverPlacement;
|
|
132
|
+
/** 搜索项的长度, 默认: 6 */
|
|
133
|
+
searchSpan: number;
|
|
134
|
+
/**
|
|
135
|
+
* 组件尺寸
|
|
136
|
+
* @since 2.6.0
|
|
137
|
+
*/
|
|
138
|
+
searchSize: AvueComponentSize;
|
|
139
|
+
/**
|
|
140
|
+
* 搜索项排序
|
|
141
|
+
* @since 2.8.20
|
|
142
|
+
*/
|
|
143
|
+
searchOrder: number;
|
|
144
|
+
/** 搜索项之间的间距, 默认: 20 */
|
|
145
|
+
searchGutter: number;
|
|
146
|
+
/**
|
|
147
|
+
* 搜索项类型
|
|
148
|
+
*
|
|
149
|
+
* Tip: 若未填写该项,则搜索项的类型如下:
|
|
150
|
+
*
|
|
151
|
+
* 'radio', 'checkbox', 'switch' -> 'select'
|
|
152
|
+
*
|
|
153
|
+
* 'textarea' -> 'input'
|
|
154
|
+
*
|
|
155
|
+
* 时间类型的,如果searchRange为true,则为对应时间类型的范围搜索,否则为时间类型(本身有范围的,取消范围)
|
|
156
|
+
*
|
|
157
|
+
* 其余的,同type
|
|
158
|
+
*/
|
|
159
|
+
searchType: string;
|
|
160
|
+
/** 是否范围搜索, 默认: false */
|
|
161
|
+
searchRange: boolean;
|
|
162
|
+
/** 搜索项label, 默认: 同label */
|
|
163
|
+
searchLabel: string;
|
|
164
|
+
/** 搜索项label的宽度, 默认: 80 */
|
|
165
|
+
searchLabelWidth: number;
|
|
166
|
+
/** 搜索项label的定位, 默认: 'right' */
|
|
167
|
+
searchLabelPosition: AvueAlignment;
|
|
168
|
+
/**
|
|
169
|
+
* 搜索框的清除按钮
|
|
170
|
+
* @since 2.8.20
|
|
171
|
+
*/
|
|
172
|
+
searchClearable: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* 搜索表单是否多选(仅对支持multiple参数的组件生效)
|
|
175
|
+
* @since 2.8.20
|
|
176
|
+
*/
|
|
177
|
+
searchMultiple: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* 多选时是否将选中值按文字的形式展示(仅对支持tag参数的组件生效)
|
|
180
|
+
* @since 2.8.20
|
|
181
|
+
*/
|
|
182
|
+
searchTags: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* 搜索项校验规则
|
|
185
|
+
* @since 2.8.21
|
|
186
|
+
*/
|
|
187
|
+
searchRules: Obj[];
|
|
188
|
+
/**
|
|
189
|
+
* 搜索项是否单独成行, 默认: false
|
|
190
|
+
* @since 2.85.22
|
|
191
|
+
*/
|
|
192
|
+
searchRow: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* 搜索项深结构数据绑定取值
|
|
195
|
+
* @since 2.9.12
|
|
196
|
+
*/
|
|
197
|
+
searchBind: string;
|
|
198
|
+
/**
|
|
199
|
+
* 搜索项深结构数据绑定取值(官方版avue持续使用,自用版本自2.9.12中删除该项,改为searchBind)
|
|
200
|
+
* @since 2.9.3
|
|
201
|
+
* @deprecated 2.9.12
|
|
202
|
+
*/
|
|
203
|
+
searchBin: string;
|
|
204
|
+
/**
|
|
205
|
+
* 搜索项是否禁用, 默认: false
|
|
206
|
+
* @since 2.9.3
|
|
207
|
+
*/
|
|
208
|
+
searchDisabled: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* 搜索项是否只读, 默认: false
|
|
211
|
+
* @since 2.9.3
|
|
212
|
+
*/
|
|
213
|
+
searchReadonly: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* 是否可以输入搜索(仅对支持filterable参数的组件生效)
|
|
216
|
+
* @since 2.8.20
|
|
217
|
+
*/
|
|
218
|
+
searchFilterable: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示。
|
|
221
|
+
* @param value 搜索值
|
|
222
|
+
* @param row 搜索表单值
|
|
223
|
+
* @param column el-table列配置
|
|
224
|
+
*/
|
|
225
|
+
searchFilterMethod: (value: any, row: T, column: TableColumn) => boolean;
|
|
226
|
+
/**
|
|
227
|
+
* 表格搜索选项的自定义
|
|
228
|
+
* @since 2.2.3
|
|
229
|
+
* @deprecated 2.8.0
|
|
230
|
+
*/
|
|
231
|
+
searchslot: boolean;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** 表格项通用过滤相关配置 */
|
|
235
|
+
export interface CrudColumnFilterOption {
|
|
236
|
+
/**
|
|
237
|
+
* 是否在动态搜索条件里面显示, 默认: true
|
|
238
|
+
* @default true
|
|
239
|
+
*/
|
|
240
|
+
filter: boolean;
|
|
241
|
+
/** 数据过滤的选项 */
|
|
242
|
+
filters: TableColumnFilter[];
|
|
243
|
+
/** 数据过滤的选项是否多选, 默认: true */
|
|
244
|
+
filterMultiple: boolean;
|
|
245
|
+
/** 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示。 */
|
|
246
|
+
filterMethod: (value: any, row: T, column: TableColumn) => boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** 表格项表单相关配置 */
|
|
250
|
+
export interface CrudFormColumnOption {
|
|
251
|
+
/**
|
|
252
|
+
* 表单是否为查看模式, 优先级高于addDetail/editDetail, 默认: false
|
|
253
|
+
* @description 2.8.19-21 版本不支持该参数
|
|
254
|
+
* @default false
|
|
255
|
+
* @since 2.5.3
|
|
256
|
+
*/
|
|
257
|
+
detail: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* 表单新增时是否为查看模式, 默认: false
|
|
260
|
+
* @description 2.8.19-21 版本不支持该参数
|
|
261
|
+
* @default false
|
|
262
|
+
* @since 2.5.3
|
|
263
|
+
*/
|
|
264
|
+
addDetail: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* 表单编辑时是否为查看模式, 默认: false
|
|
267
|
+
* @description 2.8.19-21 版本不支持该参数
|
|
268
|
+
* @default false
|
|
269
|
+
* @since 2.5.3
|
|
270
|
+
*/
|
|
271
|
+
editDetail: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* 表单是否为禁用, 优先级高于addDisabled/editDisabled, 默认: false
|
|
274
|
+
* @default false
|
|
275
|
+
*/
|
|
276
|
+
disabled: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* 表单新增时是否为禁用, 默认: false
|
|
279
|
+
* @default false
|
|
280
|
+
*/
|
|
281
|
+
addDisabled: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* 表单编辑时是否为禁用, 默认: false
|
|
284
|
+
* @default false
|
|
285
|
+
*/
|
|
286
|
+
editDisabled: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* 表单是否为可见, 优先级高于addDisplay/editDisplay/viewDisplay, 默认: false
|
|
289
|
+
* @default false
|
|
290
|
+
*/
|
|
291
|
+
display: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* 表单新增时是否为可见, 默认: false
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
addDisplay: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* 表单编辑时是否为可见, 默认: false
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
editDisplay: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* 表单查看时是否为可见, 默认: false
|
|
304
|
+
* @default false
|
|
305
|
+
*/
|
|
306
|
+
viewDisplay: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* 表单项是否单独成行, 默认: false
|
|
309
|
+
* @default false
|
|
310
|
+
*/
|
|
311
|
+
row: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* 是否可以清空选项, 默认: false
|
|
314
|
+
* @default false
|
|
315
|
+
*/
|
|
316
|
+
clearable: boolean;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** 表单项通用事件 */
|
|
320
|
+
export interface CrudFormColumnEvent<T = Obj> {
|
|
321
|
+
/**
|
|
322
|
+
* 字段控制器, 不使用箭头函数
|
|
323
|
+
* @param value 表单项的值
|
|
324
|
+
* @param form 表单值
|
|
325
|
+
* @example https://avuejs.com/form/form-control.html
|
|
326
|
+
* @since 2.8.6
|
|
327
|
+
*/
|
|
328
|
+
control: (value: any, form: T) => Record<string, Partial<AvueFormColumn>>;
|
|
329
|
+
/**
|
|
330
|
+
* 点击事件
|
|
331
|
+
* @description 当且仅当列为行编辑模式时为CrudColumnEventParams<T>
|
|
332
|
+
* @since 2.9.6
|
|
333
|
+
*/
|
|
334
|
+
click: (params: CrudColumnEventParams<T> | FormColumnEventParams) => void;
|
|
335
|
+
/**
|
|
336
|
+
* 值改变事件
|
|
337
|
+
* @description 当且仅当列为行编辑模式时为CrudColumnEventParams<T>
|
|
338
|
+
* @since 2.9.6
|
|
339
|
+
*/
|
|
340
|
+
change: (params: Omit<CrudColumnEventParams<T> | FormColumnEventParams, 'event'>) => void;
|
|
341
|
+
/**
|
|
342
|
+
* 聚焦事件
|
|
343
|
+
* @description 当且仅当列为行编辑模式时为CrudColumnEventParams<T>
|
|
344
|
+
* @since 2.9.6
|
|
345
|
+
*/
|
|
346
|
+
focus: (params: CrudColumnEventParams<T> | FormColumnEventParams) => void;
|
|
347
|
+
/**
|
|
348
|
+
* 失焦事件
|
|
349
|
+
* @description 当且仅当列为行编辑模式时为CrudColumnEventParams<T>
|
|
350
|
+
* @since 2.9.6
|
|
351
|
+
*/
|
|
352
|
+
blur: (params: CrudColumnEventParams<T> | FormColumnEventParams) => void;
|
|
353
|
+
/**
|
|
354
|
+
* 回车事件
|
|
355
|
+
*/
|
|
356
|
+
enter: (params: Pick<FormColumnEventParams, 'value' | 'column'>) => void;
|
|
357
|
+
/** 事件 */
|
|
358
|
+
event: Partial<Omit<CrudFormColumnEvent<T>, 'control' | 'event' | 'enter'>>;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** 表格项通用参数 */
|
|
362
|
+
export interface AvueCrudBaseColumn<T = Obj>
|
|
363
|
+
extends CrudBaseColumn,
|
|
364
|
+
Partial<CrudColumnStyleOption>,
|
|
365
|
+
Partial<CrudColumnSearchOption>,
|
|
366
|
+
Partial<CrudColumnFilterOption>,
|
|
367
|
+
Partial<CrudFormColumnOption>,
|
|
368
|
+
Partial<CrudFormColumnEvent<T>> {}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* 表格项配置
|
|
372
|
+
* TODO 表格项个性化配置待完成
|
|
373
|
+
*/
|
|
374
|
+
// export type AvueCrudColumn<T = Obj> = AvueCrudBaseColumn<T> &
|
|
375
|
+
// Omit<AvueFormColumn<T>, keyof FormColumnEvent<T>> & {
|
|
376
|
+
// /** 其他配置 */
|
|
377
|
+
// [x: string]: any;
|
|
378
|
+
// };
|
|
379
|
+
export type AvueCrudColumn<T = Obj> = AvueCrudBaseColumn<T> &
|
|
380
|
+
Omit<AvueFormBaseColumn<T>, keyof FormColumnEvent<T>> & {
|
|
381
|
+
/** 其他配置 */
|
|
382
|
+
[x: string]: any;
|
|
383
|
+
};
|