el-plus-crud 0.0.38 → 0.0.39
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/.eslintrc.js +78 -78
- package/.prettierrc.js +39 -39
- package/CHANGELOG.md +7 -5
- package/build.js +31 -31
- package/dist/el-plus-crud.mjs +2750 -2722
- package/dist/el-plus-crud.umd.js +14 -14
- package/dist/style.css +1 -1
- package/example/App.vue +67 -67
- package/example/main.js +18 -18
- package/index.html +13 -13
- package/lib/components/el-plus-form/ElPlusForm.vue +774 -772
- package/lib/components/el-plus-form/ElPlusFormDialog.vue +90 -90
- package/lib/components/el-plus-form/ElPlusFormGroup.vue +116 -116
- package/lib/components/el-plus-form/components/ElPlusFormArea.vue +61 -61
- package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
- package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +102 -102
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
- package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +63 -63
- package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +53 -51
- package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +44 -42
- package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +44 -42
- package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormDate.vue +39 -39
- package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +46 -44
- package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +40 -38
- package/lib/components/el-plus-form/components/ElPlusFormDatetimerange.vue +3 -1
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +47 -47
- package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
- package/lib/components/el-plus-form/components/ElPlusFormInput.vue +3 -1
- package/lib/components/el-plus-form/components/ElPlusFormLink.vue +281 -281
- package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +489 -489
- package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +53 -51
- package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +146 -144
- package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +3 -1
- package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +94 -92
- package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +161 -161
- package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
- package/lib/components/el-plus-form/components/ElPlusFormText.vue +99 -99
- package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +49 -47
- package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
- package/lib/components/el-plus-form/components/ElPlusFormTree.vue +76 -76
- package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +59 -59
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +368 -368
- package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +135 -135
- package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
- package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
- package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
- package/lib/components/el-plus-form/components/index.ts +17 -17
- package/lib/components/el-plus-form/data/file.ts +74 -74
- package/lib/components/el-plus-form/mixins/index.ts +113 -113
- package/lib/components/el-plus-form/util/index.ts +257 -257
- package/lib/components/el-plus-form/util/validate.ts +332 -332
- package/lib/components/el-plus-table/components/columnItem.vue +205 -205
- package/lib/components/el-plus-table/components/header.vue +240 -240
- package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
- package/lib/components/el-plus-table/util/index.ts +147 -147
- package/lib/config/index.ts +30 -30
- package/lib/index.d.ts +4 -4
- package/lib/index.ts +51 -51
- package/package.json +1 -1
- package/types/axios.d.ts +13 -13
- package/types/formList.d.ts +440 -440
- package/types/layout.d.ts +57 -57
- package/types/mitt.d.ts +38 -38
- package/types/pinia.d.ts +149 -149
- package/types/views.d.ts +329 -329
- package/vite.config.ts +78 -78
package/types/formList.d.ts
CHANGED
|
@@ -1,440 +1,440 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 表单描述
|
|
3
|
-
*/
|
|
4
|
-
declare interface IFormDesc {
|
|
5
|
-
[key: string]: IFormDescItem
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 表单项描述
|
|
10
|
-
*/
|
|
11
|
-
declare interface IFormDescItem {
|
|
12
|
-
type?: string
|
|
13
|
-
field?: string
|
|
14
|
-
label?: string | Function
|
|
15
|
-
prop?: string | Function
|
|
16
|
-
disabled?: boolean | Function
|
|
17
|
-
width?: string
|
|
18
|
-
format?: string | Function
|
|
19
|
-
showLabel?: boolean
|
|
20
|
-
labelWidth?: string | number
|
|
21
|
-
vif?: Function
|
|
22
|
-
tip?: string | Function
|
|
23
|
-
size?: string
|
|
24
|
-
placeholder?: string
|
|
25
|
-
attrs?: { [key: string]: any } | Function
|
|
26
|
-
options?: Array<IFormDescItemOptionItem> | IFetch<Array<IFormDescItemOptionItem>> | string
|
|
27
|
-
default?: string | boolean | number
|
|
28
|
-
defaultItem?: { value: string | number; label: string; dataItem?: { [key: string]: any } }
|
|
29
|
-
rules?: string | Array<any>
|
|
30
|
-
require?: boolean
|
|
31
|
-
required?: boolean
|
|
32
|
-
valueFormat?: Function
|
|
33
|
-
isBlank?: boolean
|
|
34
|
-
colspan?: number
|
|
35
|
-
upType?: string
|
|
36
|
-
multiple?: boolean
|
|
37
|
-
noTip?: boolean
|
|
38
|
-
limit?: number
|
|
39
|
-
maxSize?: number
|
|
40
|
-
remote?: Function
|
|
41
|
-
// 如果是列表
|
|
42
|
-
tableConfig?: ITableConfig
|
|
43
|
-
tableAttr?: { [key: string]: any }
|
|
44
|
-
tableEvent?: { [key: string]: any }
|
|
45
|
-
// 查看详情
|
|
46
|
-
linkId?: string | ((val: any, formData: any) => string)
|
|
47
|
-
linkType?: string | ((val: any, formData: any) => string)
|
|
48
|
-
linkLabel?: string | ((val: any, formData: any) => string)
|
|
49
|
-
// 内部接口
|
|
50
|
-
_type?: string
|
|
51
|
-
_vif?: boolean
|
|
52
|
-
_tip?: string
|
|
53
|
-
_disabled?: boolean
|
|
54
|
-
_attrs?: { [key: string]: any }
|
|
55
|
-
_label?: null
|
|
56
|
-
_prop?: { [key: string]: any }
|
|
57
|
-
_options?: Array<IFormDescItemOptionItem>
|
|
58
|
-
// 其他属性
|
|
59
|
-
// 级联下拉是否只选中最后一级
|
|
60
|
-
checkStrictly?: boolean
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* option描述
|
|
65
|
-
*/
|
|
66
|
-
declare interface IFormDescItemOptionItem {
|
|
67
|
-
l?: string
|
|
68
|
-
v?: string | number
|
|
69
|
-
label?: string
|
|
70
|
-
value?: string | number
|
|
71
|
-
children?: Array<IFormDescItemOptionItem>
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 按钮回调data
|
|
76
|
-
*/
|
|
77
|
-
declare interface IBtnBack {
|
|
78
|
-
row: { [key: string]: any }
|
|
79
|
-
callBack?: Function
|
|
80
|
-
field: string
|
|
81
|
-
rowIndex: number
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 表单配置
|
|
86
|
-
*/
|
|
87
|
-
declare interface IFormConfig {
|
|
88
|
-
// 表单描述对象
|
|
89
|
-
formDesc: IFormDesc
|
|
90
|
-
// 表单的列数,默认是1
|
|
91
|
-
column?: number
|
|
92
|
-
// 提交前执行
|
|
93
|
-
beforeRequest?: Function
|
|
94
|
-
// 请求地址
|
|
95
|
-
requestFn?: Function
|
|
96
|
-
// 更新的函数
|
|
97
|
-
updateFn?: Function
|
|
98
|
-
// 请求成功时
|
|
99
|
-
success?: Function
|
|
100
|
-
// 成功时的提醒文本
|
|
101
|
-
successTip?: string
|
|
102
|
-
// 列表的ref
|
|
103
|
-
tableRef?: any
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* 表单回调
|
|
108
|
-
*/
|
|
109
|
-
declare interface IFormBack {
|
|
110
|
-
response?: any
|
|
111
|
-
formData?: { [key: string]: any }
|
|
112
|
-
callback: Function
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* group表单配置
|
|
117
|
-
*/
|
|
118
|
-
declare interface IFormGroupConfig {
|
|
119
|
-
// 表单的列数,默认是1
|
|
120
|
-
column?: number
|
|
121
|
-
// 提交前执行
|
|
122
|
-
beforeRequest?: Function
|
|
123
|
-
// 请求地址
|
|
124
|
-
requestFn?: Function
|
|
125
|
-
// 更新的函数
|
|
126
|
-
updateFn?: Function
|
|
127
|
-
// 请求成功时
|
|
128
|
-
success?: Function
|
|
129
|
-
// 成功时的提醒文本
|
|
130
|
-
successTip?: string
|
|
131
|
-
// 列表的ref
|
|
132
|
-
tableRef?: any
|
|
133
|
-
// 分组配置信息
|
|
134
|
-
group: Array<{
|
|
135
|
-
// 小标题
|
|
136
|
-
title?: string
|
|
137
|
-
// 表单的列数,默认是1
|
|
138
|
-
column?: number
|
|
139
|
-
// 表单描述对象
|
|
140
|
-
formDesc: IFormDesc
|
|
141
|
-
}>
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/************************************列表************************************ */
|
|
145
|
-
|
|
146
|
-
declare interface IFetch<T> {
|
|
147
|
-
// 查询数据的方法,入参和返回格式固定
|
|
148
|
-
(data?: any): Promise<T | null>
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* 表格项
|
|
153
|
-
*/
|
|
154
|
-
declare interface IColumnItem {
|
|
155
|
-
label: string | ((data?: any) => string)
|
|
156
|
-
prop?: string
|
|
157
|
-
type?: string | Array<string>
|
|
158
|
-
width?: string
|
|
159
|
-
minWidth?: string
|
|
160
|
-
format?: string | Array<string>
|
|
161
|
-
color?: string | Array<string>
|
|
162
|
-
align?: string
|
|
163
|
-
headerAlign?: string
|
|
164
|
-
btns?: Array<Object>
|
|
165
|
-
isBatch?: Boolean
|
|
166
|
-
style?: Object
|
|
167
|
-
fixed?: 'left' | 'right'
|
|
168
|
-
limit?: number
|
|
169
|
-
count?: number
|
|
170
|
-
nodes?: Array<any>
|
|
171
|
-
inline?: Boolean
|
|
172
|
-
text?: Boolean
|
|
173
|
-
parent?: string
|
|
174
|
-
vif?: boolean | 0 | 1 | Function
|
|
175
|
-
_vif?: boolean
|
|
176
|
-
vshow?: boolean | 0 | 1 | Function
|
|
177
|
-
scShow?: boolean
|
|
178
|
-
showOverflowTooltip?: boolean
|
|
179
|
-
content?: any
|
|
180
|
-
hstyle?: any
|
|
181
|
-
required?: boolean
|
|
182
|
-
noHide?: boolean
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* 导出项
|
|
187
|
-
*/
|
|
188
|
-
declare interface IExportConfig {
|
|
189
|
-
// 导出的URL接口地址
|
|
190
|
-
url?: string
|
|
191
|
-
// 查询导出URL的fetch
|
|
192
|
-
fetch?: IFetch<string>
|
|
193
|
-
// 请求夹带的数据
|
|
194
|
-
data?: Object
|
|
195
|
-
// 文件名
|
|
196
|
-
name?: string
|
|
197
|
-
// 是否增加token权限
|
|
198
|
-
isAuth?: Boolean
|
|
199
|
-
// 是否需要拼接查询条件
|
|
200
|
-
noQuery?: Boolean
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* 列表工具
|
|
205
|
-
*/
|
|
206
|
-
declare interface ITableToolbar {
|
|
207
|
-
// 列表顶部的功能按钮
|
|
208
|
-
btns?: Array<any>
|
|
209
|
-
// btn靠右显示, 只有当formConfig为null,可设置改属性
|
|
210
|
-
btnRight?: boolean
|
|
211
|
-
// 顶部查询条件的form
|
|
212
|
-
formConfig?: IFormConfig
|
|
213
|
-
// 顶部导出excel配置
|
|
214
|
-
export?: IExportConfig
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 表单数解析
|
|
219
|
-
*/
|
|
220
|
-
declare interface ITreeProps {
|
|
221
|
-
// 子集的key字段
|
|
222
|
-
children: string
|
|
223
|
-
// 是否拥有子集的key
|
|
224
|
-
hasChildren?: string
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* 展开配置
|
|
229
|
-
*/
|
|
230
|
-
declare interface IExpConfig {
|
|
231
|
-
// 是否自动展开
|
|
232
|
-
isAutoLoadData?: Boolean
|
|
233
|
-
// 展开自身的查询主键的Id名称
|
|
234
|
-
idName?: string
|
|
235
|
-
// 渲染嵌套数据的配置选项
|
|
236
|
-
treeProps?: ITreeProps
|
|
237
|
-
// 需要查询的父类ID-展开类型的列表时采用;;
|
|
238
|
-
queryId?: string
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* 统计项
|
|
243
|
-
*/
|
|
244
|
-
declare interface IStatisticConfig {
|
|
245
|
-
// 数据库对应字段
|
|
246
|
-
dbKeys: Array<string>
|
|
247
|
-
// 需要统计的字段信息
|
|
248
|
-
keys: Array<Object>
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* 列表的选项卡配置
|
|
253
|
-
*/
|
|
254
|
-
declare interface ITableTabConf {
|
|
255
|
-
prop: string
|
|
256
|
-
tabs: Array<ITableTabItem>
|
|
257
|
-
attrs?: { [key: string]: any } | Function
|
|
258
|
-
// 远程拉取数量信息
|
|
259
|
-
fetch?: IFetch<PageObject<any>>
|
|
260
|
-
// 查询条件
|
|
261
|
-
queryMap?: any
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* 列表的选项配置
|
|
266
|
-
*/
|
|
267
|
-
declare interface ITableTabItem {
|
|
268
|
-
label: string | Function
|
|
269
|
-
value: string | number
|
|
270
|
-
key?: string
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* 尾行合计配置
|
|
275
|
-
*/
|
|
276
|
-
declare interface ISummaryConf {
|
|
277
|
-
// 尾行合计的属性名, 多个用逗号分割
|
|
278
|
-
prop: string
|
|
279
|
-
// 尾行合计的显示名称, 多个用逗号分割
|
|
280
|
-
label?: string
|
|
281
|
-
// 格式化
|
|
282
|
-
format?: string
|
|
283
|
-
// 尾行合计的合并方法
|
|
284
|
-
sumFn?: (tableData: any[], allSelectRowList?: any[]) => string
|
|
285
|
-
//尾行合计的样式
|
|
286
|
-
hstyle?: any
|
|
287
|
-
vif?: boolean | ((data?: any) => boolean)
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* 列表配置
|
|
292
|
-
*/
|
|
293
|
-
declare interface ITableConfig {
|
|
294
|
-
// 列表的名称,全局唯一,且固定,方便存储列表设置
|
|
295
|
-
tbName?: string
|
|
296
|
-
tabConf?: ITableTabConf
|
|
297
|
-
// 调用接口
|
|
298
|
-
fetch?: IFetch<any>
|
|
299
|
-
// 列表配置,包含表头,每列信息等
|
|
300
|
-
column: Array<IColumnItem>
|
|
301
|
-
// 查询条件
|
|
302
|
-
queryMap?: any
|
|
303
|
-
// 列表顶部的工具栏
|
|
304
|
-
toolbar?: ITableToolbar
|
|
305
|
-
// 每行自身展开配置项
|
|
306
|
-
explan?: IExplanConfig
|
|
307
|
-
// 针对每行的class进行单独控制
|
|
308
|
-
formatRowClass?: Function
|
|
309
|
-
// 如果数据返回有多级,那么这里就是解析的地方 比如 ['res', 'data', 'list'] 这说明,要获取的是请求返回数据中,rea.data.list 这个数据
|
|
310
|
-
dataListModel?: Array<string>
|
|
311
|
-
// 统计信息
|
|
312
|
-
statistic?: IStatisticConfig
|
|
313
|
-
// 最大高度
|
|
314
|
-
maxHeight?: number
|
|
315
|
-
// 表格属性
|
|
316
|
-
tableAttr?: any
|
|
317
|
-
// 显示选中项的名称Key
|
|
318
|
-
showSelectNameKey?: String
|
|
319
|
-
// 配置通用的合计行
|
|
320
|
-
summaryConf?: ISummaryConf
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* 对象存储Info
|
|
325
|
-
*/
|
|
326
|
-
declare interface IOssInfo {
|
|
327
|
-
id?: string
|
|
328
|
-
name?: string
|
|
329
|
-
furl?: string
|
|
330
|
-
mimeType?: string
|
|
331
|
-
fsize?: number
|
|
332
|
-
suffix?: string
|
|
333
|
-
busId?: string
|
|
334
|
-
busType?: number
|
|
335
|
-
// upload组件需要的字段
|
|
336
|
-
url?: string
|
|
337
|
-
uid?: number
|
|
338
|
-
previewUrl?: string
|
|
339
|
-
shareUrl?: string
|
|
340
|
-
uploadId?: string
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/************************************表单详情************************************ */
|
|
344
|
-
declare interface IFormGroupItem {
|
|
345
|
-
title?: string
|
|
346
|
-
// 表单描述对象
|
|
347
|
-
formDesc: IFormDesc
|
|
348
|
-
// 表单的列数,默认是1
|
|
349
|
-
column?: number
|
|
350
|
-
// 最大宽度
|
|
351
|
-
maxWidth?: string
|
|
352
|
-
// 是否是表格
|
|
353
|
-
isTable?: boolean
|
|
354
|
-
// labelWidth
|
|
355
|
-
labelWidth?: string
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/************************************批量下载************************************ */
|
|
359
|
-
/**
|
|
360
|
-
* 文件(夹)信息
|
|
361
|
-
*/
|
|
362
|
-
declare interface IFiles {
|
|
363
|
-
id: string
|
|
364
|
-
// 是否是文件夹
|
|
365
|
-
folder?: 0 | 1
|
|
366
|
-
// 文件(夹)名称
|
|
367
|
-
name: string
|
|
368
|
-
// 文件地址
|
|
369
|
-
url?: string
|
|
370
|
-
// 文件夹中的文件列表
|
|
371
|
-
files?: Array<IFiles>
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* 下载信息
|
|
376
|
-
*/
|
|
377
|
-
declare interface IDownInfo {
|
|
378
|
-
// 文件名
|
|
379
|
-
name: string
|
|
380
|
-
// 到期时间
|
|
381
|
-
endData?: string
|
|
382
|
-
// 来源
|
|
383
|
-
sc?: string
|
|
384
|
-
// 状态:1可下载;2已过期;3已删除;4无权限; 5无效
|
|
385
|
-
status: 1 | 2 | 3 | 4 | 5
|
|
386
|
-
// 是否zip压缩,如果不是压缩,则默认下载files[0]
|
|
387
|
-
zip: 0 | 1
|
|
388
|
-
// 文件列表
|
|
389
|
-
files: Array<IFiles>
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* 下载文件信息
|
|
394
|
-
*/
|
|
395
|
-
declare interface IDownFile {
|
|
396
|
-
// 文件名
|
|
397
|
-
name: string
|
|
398
|
-
// 文件夹名
|
|
399
|
-
folder: string
|
|
400
|
-
// 文件地址
|
|
401
|
-
url: string
|
|
402
|
-
// 上传进度
|
|
403
|
-
percent?: number
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
declare interface ICRUDConfig {
|
|
407
|
-
debug?: boolean
|
|
408
|
-
size?: 'default' | 'small' | 'large'
|
|
409
|
-
storagePrefix?: string
|
|
410
|
-
form?: {
|
|
411
|
-
leng: {
|
|
412
|
-
input: number
|
|
413
|
-
textare: number
|
|
414
|
-
nbinput: {
|
|
415
|
-
min: number
|
|
416
|
-
max: number
|
|
417
|
-
precision: number
|
|
418
|
-
controlsPosition: 'right' | ''
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
linkUser?: {
|
|
422
|
-
getUserList: IFetch<any>
|
|
423
|
-
deptListKey: string
|
|
424
|
-
}
|
|
425
|
-
// 用户自定义form组件的名称,使用这个,全局注册的名字为el-plus-form-xxx,form中就可以使用xxx进行引入
|
|
426
|
-
comList?: string[]
|
|
427
|
-
}
|
|
428
|
-
upload?: {
|
|
429
|
-
type: 'minio' | 'quniu'
|
|
430
|
-
action?: string | ((data?: any) => string)
|
|
431
|
-
maxISize?: number
|
|
432
|
-
maxFSize?: number
|
|
433
|
-
minio?: {
|
|
434
|
-
getUploadUrl: (fileName?: string) => Promise<any>
|
|
435
|
-
doElUpload: (fileName?: string) => Promise<any>
|
|
436
|
-
getObjectAuthUrl: (fileName?: string) => Promise<any>
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
token?: string | ((data?: any) => string)
|
|
440
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 表单描述
|
|
3
|
+
*/
|
|
4
|
+
declare interface IFormDesc {
|
|
5
|
+
[key: string]: IFormDescItem
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 表单项描述
|
|
10
|
+
*/
|
|
11
|
+
declare interface IFormDescItem {
|
|
12
|
+
type?: string
|
|
13
|
+
field?: string
|
|
14
|
+
label?: string | Function
|
|
15
|
+
prop?: string | Function
|
|
16
|
+
disabled?: boolean | Function
|
|
17
|
+
width?: string
|
|
18
|
+
format?: string | Function
|
|
19
|
+
showLabel?: boolean
|
|
20
|
+
labelWidth?: string | number
|
|
21
|
+
vif?: Function
|
|
22
|
+
tip?: string | Function
|
|
23
|
+
size?: string
|
|
24
|
+
placeholder?: string
|
|
25
|
+
attrs?: { [key: string]: any } | Function
|
|
26
|
+
options?: Array<IFormDescItemOptionItem> | IFetch<Array<IFormDescItemOptionItem>> | string
|
|
27
|
+
default?: string | boolean | number
|
|
28
|
+
defaultItem?: { value: string | number; label: string; dataItem?: { [key: string]: any } }
|
|
29
|
+
rules?: string | Array<any>
|
|
30
|
+
require?: boolean
|
|
31
|
+
required?: boolean
|
|
32
|
+
valueFormat?: Function
|
|
33
|
+
isBlank?: boolean
|
|
34
|
+
colspan?: number
|
|
35
|
+
upType?: string
|
|
36
|
+
multiple?: boolean
|
|
37
|
+
noTip?: boolean
|
|
38
|
+
limit?: number
|
|
39
|
+
maxSize?: number
|
|
40
|
+
remote?: Function
|
|
41
|
+
// 如果是列表
|
|
42
|
+
tableConfig?: ITableConfig
|
|
43
|
+
tableAttr?: { [key: string]: any }
|
|
44
|
+
tableEvent?: { [key: string]: any }
|
|
45
|
+
// 查看详情
|
|
46
|
+
linkId?: string | ((val: any, formData: any) => string)
|
|
47
|
+
linkType?: string | ((val: any, formData: any) => string)
|
|
48
|
+
linkLabel?: string | ((val: any, formData: any) => string)
|
|
49
|
+
// 内部接口
|
|
50
|
+
_type?: string
|
|
51
|
+
_vif?: boolean
|
|
52
|
+
_tip?: string
|
|
53
|
+
_disabled?: boolean
|
|
54
|
+
_attrs?: { [key: string]: any }
|
|
55
|
+
_label?: null
|
|
56
|
+
_prop?: { [key: string]: any }
|
|
57
|
+
_options?: Array<IFormDescItemOptionItem>
|
|
58
|
+
// 其他属性
|
|
59
|
+
// 级联下拉是否只选中最后一级
|
|
60
|
+
checkStrictly?: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* option描述
|
|
65
|
+
*/
|
|
66
|
+
declare interface IFormDescItemOptionItem {
|
|
67
|
+
l?: string
|
|
68
|
+
v?: string | number
|
|
69
|
+
label?: string
|
|
70
|
+
value?: string | number
|
|
71
|
+
children?: Array<IFormDescItemOptionItem>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 按钮回调data
|
|
76
|
+
*/
|
|
77
|
+
declare interface IBtnBack {
|
|
78
|
+
row: { [key: string]: any }
|
|
79
|
+
callBack?: Function
|
|
80
|
+
field: string
|
|
81
|
+
rowIndex: number
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 表单配置
|
|
86
|
+
*/
|
|
87
|
+
declare interface IFormConfig {
|
|
88
|
+
// 表单描述对象
|
|
89
|
+
formDesc: IFormDesc
|
|
90
|
+
// 表单的列数,默认是1
|
|
91
|
+
column?: number
|
|
92
|
+
// 提交前执行
|
|
93
|
+
beforeRequest?: Function
|
|
94
|
+
// 请求地址
|
|
95
|
+
requestFn?: Function
|
|
96
|
+
// 更新的函数
|
|
97
|
+
updateFn?: Function
|
|
98
|
+
// 请求成功时
|
|
99
|
+
success?: Function
|
|
100
|
+
// 成功时的提醒文本
|
|
101
|
+
successTip?: string
|
|
102
|
+
// 列表的ref
|
|
103
|
+
tableRef?: any
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 表单回调
|
|
108
|
+
*/
|
|
109
|
+
declare interface IFormBack {
|
|
110
|
+
response?: any
|
|
111
|
+
formData?: { [key: string]: any }
|
|
112
|
+
callback: Function
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* group表单配置
|
|
117
|
+
*/
|
|
118
|
+
declare interface IFormGroupConfig {
|
|
119
|
+
// 表单的列数,默认是1
|
|
120
|
+
column?: number
|
|
121
|
+
// 提交前执行
|
|
122
|
+
beforeRequest?: Function
|
|
123
|
+
// 请求地址
|
|
124
|
+
requestFn?: Function
|
|
125
|
+
// 更新的函数
|
|
126
|
+
updateFn?: Function
|
|
127
|
+
// 请求成功时
|
|
128
|
+
success?: Function
|
|
129
|
+
// 成功时的提醒文本
|
|
130
|
+
successTip?: string
|
|
131
|
+
// 列表的ref
|
|
132
|
+
tableRef?: any
|
|
133
|
+
// 分组配置信息
|
|
134
|
+
group: Array<{
|
|
135
|
+
// 小标题
|
|
136
|
+
title?: string
|
|
137
|
+
// 表单的列数,默认是1
|
|
138
|
+
column?: number
|
|
139
|
+
// 表单描述对象
|
|
140
|
+
formDesc: IFormDesc
|
|
141
|
+
}>
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/************************************列表************************************ */
|
|
145
|
+
|
|
146
|
+
declare interface IFetch<T> {
|
|
147
|
+
// 查询数据的方法,入参和返回格式固定
|
|
148
|
+
(data?: any): Promise<T | null>
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 表格项
|
|
153
|
+
*/
|
|
154
|
+
declare interface IColumnItem {
|
|
155
|
+
label: string | ((data?: any) => string)
|
|
156
|
+
prop?: string
|
|
157
|
+
type?: string | Array<string>
|
|
158
|
+
width?: string
|
|
159
|
+
minWidth?: string
|
|
160
|
+
format?: string | Array<string>
|
|
161
|
+
color?: string | Array<string>
|
|
162
|
+
align?: string
|
|
163
|
+
headerAlign?: string
|
|
164
|
+
btns?: Array<Object>
|
|
165
|
+
isBatch?: Boolean
|
|
166
|
+
style?: Object
|
|
167
|
+
fixed?: 'left' | 'right'
|
|
168
|
+
limit?: number
|
|
169
|
+
count?: number
|
|
170
|
+
nodes?: Array<any>
|
|
171
|
+
inline?: Boolean
|
|
172
|
+
text?: Boolean
|
|
173
|
+
parent?: string
|
|
174
|
+
vif?: boolean | 0 | 1 | Function
|
|
175
|
+
_vif?: boolean
|
|
176
|
+
vshow?: boolean | 0 | 1 | Function
|
|
177
|
+
scShow?: boolean
|
|
178
|
+
showOverflowTooltip?: boolean
|
|
179
|
+
content?: any
|
|
180
|
+
hstyle?: any
|
|
181
|
+
required?: boolean
|
|
182
|
+
noHide?: boolean
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 导出项
|
|
187
|
+
*/
|
|
188
|
+
declare interface IExportConfig {
|
|
189
|
+
// 导出的URL接口地址
|
|
190
|
+
url?: string
|
|
191
|
+
// 查询导出URL的fetch
|
|
192
|
+
fetch?: IFetch<string>
|
|
193
|
+
// 请求夹带的数据
|
|
194
|
+
data?: Object
|
|
195
|
+
// 文件名
|
|
196
|
+
name?: string
|
|
197
|
+
// 是否增加token权限
|
|
198
|
+
isAuth?: Boolean
|
|
199
|
+
// 是否需要拼接查询条件
|
|
200
|
+
noQuery?: Boolean
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 列表工具
|
|
205
|
+
*/
|
|
206
|
+
declare interface ITableToolbar {
|
|
207
|
+
// 列表顶部的功能按钮
|
|
208
|
+
btns?: Array<any>
|
|
209
|
+
// btn靠右显示, 只有当formConfig为null,可设置改属性
|
|
210
|
+
btnRight?: boolean
|
|
211
|
+
// 顶部查询条件的form
|
|
212
|
+
formConfig?: IFormConfig
|
|
213
|
+
// 顶部导出excel配置
|
|
214
|
+
export?: IExportConfig
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* 表单数解析
|
|
219
|
+
*/
|
|
220
|
+
declare interface ITreeProps {
|
|
221
|
+
// 子集的key字段
|
|
222
|
+
children: string
|
|
223
|
+
// 是否拥有子集的key
|
|
224
|
+
hasChildren?: string
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 展开配置
|
|
229
|
+
*/
|
|
230
|
+
declare interface IExpConfig {
|
|
231
|
+
// 是否自动展开
|
|
232
|
+
isAutoLoadData?: Boolean
|
|
233
|
+
// 展开自身的查询主键的Id名称
|
|
234
|
+
idName?: string
|
|
235
|
+
// 渲染嵌套数据的配置选项
|
|
236
|
+
treeProps?: ITreeProps
|
|
237
|
+
// 需要查询的父类ID-展开类型的列表时采用;;
|
|
238
|
+
queryId?: string
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 统计项
|
|
243
|
+
*/
|
|
244
|
+
declare interface IStatisticConfig {
|
|
245
|
+
// 数据库对应字段
|
|
246
|
+
dbKeys: Array<string>
|
|
247
|
+
// 需要统计的字段信息
|
|
248
|
+
keys: Array<Object>
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 列表的选项卡配置
|
|
253
|
+
*/
|
|
254
|
+
declare interface ITableTabConf {
|
|
255
|
+
prop: string
|
|
256
|
+
tabs: Array<ITableTabItem>
|
|
257
|
+
attrs?: { [key: string]: any } | Function
|
|
258
|
+
// 远程拉取数量信息
|
|
259
|
+
fetch?: IFetch<PageObject<any>>
|
|
260
|
+
// 查询条件
|
|
261
|
+
queryMap?: any
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 列表的选项配置
|
|
266
|
+
*/
|
|
267
|
+
declare interface ITableTabItem {
|
|
268
|
+
label: string | Function
|
|
269
|
+
value: string | number
|
|
270
|
+
key?: string
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* 尾行合计配置
|
|
275
|
+
*/
|
|
276
|
+
declare interface ISummaryConf {
|
|
277
|
+
// 尾行合计的属性名, 多个用逗号分割
|
|
278
|
+
prop: string
|
|
279
|
+
// 尾行合计的显示名称, 多个用逗号分割
|
|
280
|
+
label?: string
|
|
281
|
+
// 格式化
|
|
282
|
+
format?: string
|
|
283
|
+
// 尾行合计的合并方法
|
|
284
|
+
sumFn?: (tableData: any[], allSelectRowList?: any[]) => string
|
|
285
|
+
//尾行合计的样式
|
|
286
|
+
hstyle?: any
|
|
287
|
+
vif?: boolean | ((data?: any) => boolean)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* 列表配置
|
|
292
|
+
*/
|
|
293
|
+
declare interface ITableConfig {
|
|
294
|
+
// 列表的名称,全局唯一,且固定,方便存储列表设置
|
|
295
|
+
tbName?: string
|
|
296
|
+
tabConf?: ITableTabConf
|
|
297
|
+
// 调用接口
|
|
298
|
+
fetch?: IFetch<any>
|
|
299
|
+
// 列表配置,包含表头,每列信息等
|
|
300
|
+
column: Array<IColumnItem>
|
|
301
|
+
// 查询条件
|
|
302
|
+
queryMap?: any
|
|
303
|
+
// 列表顶部的工具栏
|
|
304
|
+
toolbar?: ITableToolbar
|
|
305
|
+
// 每行自身展开配置项
|
|
306
|
+
explan?: IExplanConfig
|
|
307
|
+
// 针对每行的class进行单独控制
|
|
308
|
+
formatRowClass?: Function
|
|
309
|
+
// 如果数据返回有多级,那么这里就是解析的地方 比如 ['res', 'data', 'list'] 这说明,要获取的是请求返回数据中,rea.data.list 这个数据
|
|
310
|
+
dataListModel?: Array<string>
|
|
311
|
+
// 统计信息
|
|
312
|
+
statistic?: IStatisticConfig
|
|
313
|
+
// 最大高度
|
|
314
|
+
maxHeight?: number
|
|
315
|
+
// 表格属性
|
|
316
|
+
tableAttr?: any
|
|
317
|
+
// 显示选中项的名称Key
|
|
318
|
+
showSelectNameKey?: String
|
|
319
|
+
// 配置通用的合计行
|
|
320
|
+
summaryConf?: ISummaryConf
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* 对象存储Info
|
|
325
|
+
*/
|
|
326
|
+
declare interface IOssInfo {
|
|
327
|
+
id?: string
|
|
328
|
+
name?: string
|
|
329
|
+
furl?: string
|
|
330
|
+
mimeType?: string
|
|
331
|
+
fsize?: number
|
|
332
|
+
suffix?: string
|
|
333
|
+
busId?: string
|
|
334
|
+
busType?: number
|
|
335
|
+
// upload组件需要的字段
|
|
336
|
+
url?: string
|
|
337
|
+
uid?: number
|
|
338
|
+
previewUrl?: string
|
|
339
|
+
shareUrl?: string
|
|
340
|
+
uploadId?: string
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/************************************表单详情************************************ */
|
|
344
|
+
declare interface IFormGroupItem {
|
|
345
|
+
title?: string
|
|
346
|
+
// 表单描述对象
|
|
347
|
+
formDesc: IFormDesc
|
|
348
|
+
// 表单的列数,默认是1
|
|
349
|
+
column?: number
|
|
350
|
+
// 最大宽度
|
|
351
|
+
maxWidth?: string
|
|
352
|
+
// 是否是表格
|
|
353
|
+
isTable?: boolean
|
|
354
|
+
// labelWidth
|
|
355
|
+
labelWidth?: string
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/************************************批量下载************************************ */
|
|
359
|
+
/**
|
|
360
|
+
* 文件(夹)信息
|
|
361
|
+
*/
|
|
362
|
+
declare interface IFiles {
|
|
363
|
+
id: string
|
|
364
|
+
// 是否是文件夹
|
|
365
|
+
folder?: 0 | 1
|
|
366
|
+
// 文件(夹)名称
|
|
367
|
+
name: string
|
|
368
|
+
// 文件地址
|
|
369
|
+
url?: string
|
|
370
|
+
// 文件夹中的文件列表
|
|
371
|
+
files?: Array<IFiles>
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* 下载信息
|
|
376
|
+
*/
|
|
377
|
+
declare interface IDownInfo {
|
|
378
|
+
// 文件名
|
|
379
|
+
name: string
|
|
380
|
+
// 到期时间
|
|
381
|
+
endData?: string
|
|
382
|
+
// 来源
|
|
383
|
+
sc?: string
|
|
384
|
+
// 状态:1可下载;2已过期;3已删除;4无权限; 5无效
|
|
385
|
+
status: 1 | 2 | 3 | 4 | 5
|
|
386
|
+
// 是否zip压缩,如果不是压缩,则默认下载files[0]
|
|
387
|
+
zip: 0 | 1
|
|
388
|
+
// 文件列表
|
|
389
|
+
files: Array<IFiles>
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* 下载文件信息
|
|
394
|
+
*/
|
|
395
|
+
declare interface IDownFile {
|
|
396
|
+
// 文件名
|
|
397
|
+
name: string
|
|
398
|
+
// 文件夹名
|
|
399
|
+
folder: string
|
|
400
|
+
// 文件地址
|
|
401
|
+
url: string
|
|
402
|
+
// 上传进度
|
|
403
|
+
percent?: number
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare interface ICRUDConfig {
|
|
407
|
+
debug?: boolean
|
|
408
|
+
size?: 'default' | 'small' | 'large'
|
|
409
|
+
storagePrefix?: string
|
|
410
|
+
form?: {
|
|
411
|
+
leng: {
|
|
412
|
+
input: number
|
|
413
|
+
textare: number
|
|
414
|
+
nbinput: {
|
|
415
|
+
min: number
|
|
416
|
+
max: number
|
|
417
|
+
precision: number
|
|
418
|
+
controlsPosition: 'right' | ''
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
linkUser?: {
|
|
422
|
+
getUserList: IFetch<any>
|
|
423
|
+
deptListKey: string
|
|
424
|
+
}
|
|
425
|
+
// 用户自定义form组件的名称,使用这个,全局注册的名字为el-plus-form-xxx,form中就可以使用xxx进行引入
|
|
426
|
+
comList?: string[]
|
|
427
|
+
}
|
|
428
|
+
upload?: {
|
|
429
|
+
type: 'minio' | 'quniu'
|
|
430
|
+
action?: string | ((data?: any) => string)
|
|
431
|
+
maxISize?: number
|
|
432
|
+
maxFSize?: number
|
|
433
|
+
minio?: {
|
|
434
|
+
getUploadUrl: (fileName?: string) => Promise<any>
|
|
435
|
+
doElUpload: (fileName?: string) => Promise<any>
|
|
436
|
+
getObjectAuthUrl: (fileName?: string) => Promise<any>
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
token?: string | ((data?: any) => string)
|
|
440
|
+
}
|