el-plus-crud 0.0.72 → 0.0.74

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 (36) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/el-plus-crud.mjs +12 -12
  3. package/example/App.vue +2 -1
  4. package/lib/components/el-plus-form/ElPlusForm.vue +1 -0
  5. package/lib/components/el-plus-form/ElPlusFormDialog.vue +3 -2
  6. package/lib/components/el-plus-form/ElPlusFormGroup.vue +1 -0
  7. package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +1 -0
  8. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +1 -0
  9. package/lib/components/el-plus-form/components/ElPlusFormFile.vue +1 -0
  10. package/lib/components/el-plus-form/components/ElPlusFormInput.vue +1 -0
  11. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +1 -0
  12. package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +1 -0
  13. package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +1 -0
  14. package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +1 -0
  15. package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +1 -0
  16. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +1 -0
  17. package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +1 -0
  18. package/lib/components/el-plus-form/components/ElPlusFormUpbtn.vue +1 -0
  19. package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +1 -0
  20. package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +1 -0
  21. package/lib/components/el-plus-table/ElPlusTable.vue +1 -0
  22. package/lib/components/el-plus-table/components/columnItem.vue +1 -0
  23. package/lib/components/el-plus-table/components/header.vue +1 -0
  24. package/lib/components/el-plus-table/components/settingColumn.vue +1 -0
  25. package/lib/components/el-plus-table/util/index.ts +1 -0
  26. package/lib/config/index.ts +2 -0
  27. package/lib/index.ts +1 -0
  28. package/package-lock.json +2 -2
  29. package/package.json +1 -1
  30. package/types/formList.d.ts +97 -91
  31. package/types/global.d.ts +1 -133
  32. package/types/axios.d.ts +0 -13
  33. package/types/layout.d.ts +0 -57
  34. package/types/mitt.d.ts +0 -38
  35. package/types/pinia.d.ts +0 -149
  36. package/types/views.d.ts +0 -329
@@ -1,59 +1,98 @@
1
+ // 基础类型
2
+ export type IBaseObj = IBaseObj
3
+
4
+ /**
5
+ * 表单回调
6
+ */
7
+ export interface IFormBack {
8
+ response?: any
9
+ formData?: IBaseObj
10
+ callBack: Function
11
+ }
12
+
13
+ /**
14
+ * 按钮回调data
15
+ */
16
+ export interface IBtnBack {
17
+ row: IBaseObj
18
+ callBack?: Function
19
+ field: string
20
+ rowIndex: number
21
+ files?: Array<any>
22
+ }
23
+
24
+ /**
25
+ * 通用请求
26
+ */
27
+ export interface IFetch<T> {
28
+ // 查询数据的方法,入参和返回格式固定
29
+ (data?: any): Promise<T | null>
30
+ }
31
+
1
32
  /**
2
33
  * 表单描述
3
34
  */
4
- declare interface IFormDesc {
35
+ export interface IFormDesc {
5
36
  [key: string]: IFormDescItem
6
37
  }
7
38
 
8
39
  /**
9
- * 表单项描述
40
+ * 基础的descItem
10
41
  */
11
- declare interface IFormDescItem {
42
+ export type IDescItem = {
12
43
  type?: string
13
- field?: string
14
- label?: string | Function
15
- prop?: string | Function
16
- disabled?: boolean | Function
44
+ label?: string | ((data?: any) => string)
45
+ prop?: string | ((data?: any) => string)
17
46
  width?: string
18
- format?: string | Function
47
+ format?: string | ((data?: any) => string)
48
+ vif?: boolean | ((data?: any) => boolean)
49
+ vshow?: boolean | ((data?: any) => boolean)
50
+ limit?: number
51
+ required?: boolean | ((data?: any) => boolean)
52
+ style?: IBaseObj | ((data?: any) => IBaseObj)
53
+ // 内部使用属性
54
+ _vif?: boolean
55
+ }
56
+
57
+ /**
58
+ * 表单项描述
59
+ */
60
+ export interface IFormDescItem extends IDescItem {
61
+ field?: string
62
+ disabled?: boolean | ((data?: any) => boolean)
19
63
  showLabel?: boolean
20
64
  labelWidth?: string | number
21
- vif?: Function
22
- tip?: string | Function
65
+ tip?: string | ((data?: any) => string)
23
66
  size?: string
24
67
  placeholder?: string
25
- attrs?: { [key: string]: any } | Function
68
+ attrs?: IBaseObj | ((data?: any) => IBaseObj)
26
69
  options?: Array<IFormDescItemOptionItem> | IFetch<Array<IFormDescItemOptionItem>> | string
27
70
  default?: string | boolean | number
28
- defaultItem?: { value: string | number; label: string; dataItem?: { [key: string]: any } }
71
+ defaultItem?: { value: string | number; label: string; dataItem?: IBaseObj }
29
72
  rules?: string | Array<any>
30
- require?: boolean
31
- required?: boolean
32
73
  valueFormat?: Function
33
74
  isBlank?: boolean
34
75
  colspan?: number
35
76
  upType?: string
36
77
  multiple?: boolean
37
78
  noTip?: boolean
38
- limit?: number
39
79
  maxSize?: number
40
80
  remote?: Function
41
81
  // 如果是列表
42
82
  tableConfig?: ITableConfig
43
- tableAttr?: { [key: string]: any }
44
- tableEvent?: { [key: string]: any }
83
+ tableAttr?: IBaseObj
84
+ tableEvent?: IBaseObj
45
85
  // 查看详情
46
86
  linkId?: string | ((val: any, formData: any) => string)
47
87
  linkType?: string | ((val: any, formData: any) => string)
48
88
  linkLabel?: string | ((val: any, formData: any) => string)
49
89
  // 内部接口
50
90
  _type?: string
51
- _vif?: boolean
52
91
  _tip?: string
53
92
  _disabled?: boolean
54
- _attrs?: { [key: string]: any }
93
+ _attrs?: IBaseObj
55
94
  _label?: null
56
- _prop?: { [key: string]: any }
95
+ _prop?: IBaseObj
57
96
  _options?: Array<IFormDescItemOptionItem>
58
97
  // 其他属性
59
98
  // 级联下拉是否只选中最后一级
@@ -67,7 +106,7 @@ declare interface IFormDescItem {
67
106
  /**
68
107
  * option描述
69
108
  */
70
- declare interface IFormDescItemOptionItem {
109
+ export interface IFormDescItemOptionItem {
71
110
  l?: string
72
111
  v?: string | number
73
112
  label?: string
@@ -75,64 +114,44 @@ declare interface IFormDescItemOptionItem {
75
114
  children?: Array<IFormDescItemOptionItem>
76
115
  }
77
116
 
78
- /**
79
- * 按钮回调data
80
- */
81
- declare interface IBtnBack {
82
- row: { [key: string]: any }
83
- callBack?: Function
84
- field: string
85
- rowIndex: number
86
- files?: Array<any>
87
- }
88
-
89
117
  /**
90
118
  * 表单配置
91
119
  */
92
- declare interface IFormConfig {
120
+ export interface IFormConfig {
93
121
  // 表单描述对象
94
122
  formDesc: IFormDesc
95
123
  // 表单的列数,默认是1
96
124
  column?: number
97
125
  // 提交前执行
98
- beforeRequest?: Function
126
+ beforeRequest?: (data?: any) => any
99
127
  // 请求地址
100
- requestFn?: Function
128
+ requestFn?: (data?: any) => Promise<T>
101
129
  // 更新的函数
102
- updateFn?: Function
130
+ updateFn?: (data?: any) => Promise<T>
103
131
  // 请求成功时
104
- success?: Function
132
+ success?: (data?: IFormBack) => any
105
133
  // 成功时的提醒文本
106
- successTip?: string
134
+ successTip?: string | ((data?: any) => string)
107
135
  // 列表的ref
108
136
  tableRef?: any
109
137
  }
110
138
 
111
- /**
112
- * 表单回调
113
- */
114
- declare interface IFormBack {
115
- response?: any
116
- formData?: { [key: string]: any }
117
- callBack: Function
118
- }
119
-
120
139
  /**
121
140
  * group表单配置
122
141
  */
123
- declare interface IFormGroupConfig {
142
+ export interface IFormGroupConfig {
124
143
  // 表单的列数,默认是1
125
144
  column?: number
126
145
  // 提交前执行
127
- beforeRequest?: Function
146
+ beforeRequest?: (data: T) => T
128
147
  // 请求地址
129
- requestFn?: Function
148
+ requestFn?: (data?: any) => Promise<T>
130
149
  // 更新的函数
131
- updateFn?: Function
150
+ updateFn?: (data?: any) => Promise<T>
132
151
  // 请求成功时
133
- success?: Function
152
+ success?: (data: IFormBack) => any
134
153
  // 成功时的提醒文本
135
- successTip?: string
154
+ successTip?: string | ((data?: any) => string)
136
155
  // 列表的ref
137
156
  tableRef?: any
138
157
  // 分组配置信息
@@ -150,49 +169,33 @@ declare interface IFormGroupConfig {
150
169
 
151
170
  /************************************列表************************************ */
152
171
 
153
- declare interface IFetch<T> {
154
- // 查询数据的方法,入参和返回格式固定
155
- (data?: any): Promise<T | null>
156
- }
157
-
158
172
  /**
159
173
  * 表格项
160
174
  */
161
- declare interface IColumnItem {
162
- label: string | ((data?: any) => string)
163
- prop?: string
164
- type?: string | Array<string>
165
- width?: string
175
+ export interface IColumnItem extends IDescItem {
166
176
  minWidth?: string
167
- format?: string | Array<string>
168
177
  color?: string | Array<string>
169
178
  align?: string
170
179
  headerAlign?: string
171
- btns?: Array<Object>
180
+ btns?: Array<IColumnItem>
172
181
  isBatch?: Boolean
173
- style?: Object
174
182
  fixed?: 'left' | 'right'
175
- limit?: number
176
183
  count?: number
177
184
  nodes?: Array<any>
178
185
  inline?: Boolean
179
186
  text?: Boolean
180
187
  parent?: string
181
- vif?: boolean | 0 | 1 | Function
182
- _vif?: boolean
183
- vshow?: boolean | 0 | 1 | Function
184
188
  scShow?: boolean
185
189
  showOverflowTooltip?: boolean
186
190
  content?: any
187
191
  hstyle?: any
188
- required?: boolean
189
- noHide?: boolean
192
+ noHide?: boolean | ((data?: any) => boolean)
190
193
  }
191
194
 
192
195
  /**
193
196
  * 导出项
194
197
  */
195
- declare interface IExportConfig {
198
+ export interface IExportConfig {
196
199
  // 导出的URL接口地址
197
200
  url?: string
198
201
  // 查询导出URL的fetch
@@ -216,7 +219,7 @@ declare interface IExportConfig {
216
219
  /**
217
220
  * 列表工具
218
221
  */
219
- declare interface ITableToolbar {
222
+ export interface ITableToolbar {
220
223
  // 列表顶部的功能按钮
221
224
  btns?: Array<any>
222
225
  // btn靠右显示, 只有当formConfig为null,可设置改属性
@@ -230,17 +233,17 @@ declare interface ITableToolbar {
230
233
  /**
231
234
  * 表单数解析
232
235
  */
233
- declare interface ITreeProps {
236
+ export interface ITreeProps {
234
237
  // 子集的key字段
235
238
  children: string
236
239
  // 是否拥有子集的key
237
- hasChildren?: string
240
+ hasChildren?: boolean
238
241
  }
239
242
 
240
243
  /**
241
244
  * 展开配置
242
245
  */
243
- declare interface IExpConfig {
246
+ export interface IExpConfig {
244
247
  // 是否自动展开
245
248
  isAutoLoadData?: Boolean
246
249
  // 展开自身的查询主键的Id名称
@@ -254,7 +257,7 @@ declare interface IExpConfig {
254
257
  /**
255
258
  * 统计项
256
259
  */
257
- declare interface IStatisticConfig {
260
+ export interface IStatisticConfig {
258
261
  // 数据库对应字段
259
262
  dbKeys: Array<string>
260
263
  // 需要统计的字段信息
@@ -264,12 +267,12 @@ declare interface IStatisticConfig {
264
267
  /**
265
268
  * 列表的选项卡配置
266
269
  */
267
- declare interface ITableTabConf {
270
+ export interface ITableTabConf {
268
271
  prop: string
269
272
  tabs: Array<ITableTabItem>
270
- attrs?: { [key: string]: any } | Function
273
+ attrs?: IBaseObj | Function
271
274
  // 远程拉取数量信息
272
- fetch?: IFetch<PageObject<any>>
275
+ fetch?: IFetch<any>
273
276
  // 查询条件
274
277
  queryMap?: any
275
278
  }
@@ -277,8 +280,8 @@ declare interface ITableTabConf {
277
280
  /**
278
281
  * 列表的选项配置
279
282
  */
280
- declare interface ITableTabItem {
281
- label: string | Function
283
+ export interface ITableTabItem {
284
+ label: string | ((data?: any) => string)
282
285
  value: string | number
283
286
  key?: string
284
287
  }
@@ -286,7 +289,7 @@ declare interface ITableTabItem {
286
289
  /**
287
290
  * 尾行合计配置
288
291
  */
289
- declare interface ISummaryConf {
292
+ export interface ISummaryConf {
290
293
  // 尾行合计的属性名, 多个用逗号分割
291
294
  prop: string
292
295
  // 尾行合计的显示名称, 多个用逗号分割
@@ -303,7 +306,7 @@ declare interface ISummaryConf {
303
306
  /**
304
307
  * 列表配置
305
308
  */
306
- declare interface ITableConfig {
309
+ export interface ITableConfig {
307
310
  // 列表的名称,全局唯一,且固定,方便存储列表设置
308
311
  tbName?: string
309
312
  tabConf?: ITableTabConf
@@ -336,7 +339,7 @@ declare interface ITableConfig {
336
339
  /**
337
340
  * 对象存储Info
338
341
  */
339
- declare interface IOssInfo {
342
+ export interface IOssInfo {
340
343
  id?: string
341
344
  name?: string
342
345
  furl?: string
@@ -354,7 +357,7 @@ declare interface IOssInfo {
354
357
  }
355
358
 
356
359
  /************************************表单详情************************************ */
357
- declare interface IFormGroupItem {
360
+ export interface IFormGroupItem {
358
361
  title?: string
359
362
  // 表单描述对象
360
363
  formDesc: IFormDesc
@@ -372,7 +375,7 @@ declare interface IFormGroupItem {
372
375
  /**
373
376
  * 文件(夹)信息
374
377
  */
375
- declare interface IFiles {
378
+ export interface IFiles {
376
379
  id: string
377
380
  // 是否是文件夹
378
381
  folder?: 0 | 1
@@ -387,7 +390,7 @@ declare interface IFiles {
387
390
  /**
388
391
  * 下载信息
389
392
  */
390
- declare interface IDownInfo {
393
+ export interface IDownInfo {
391
394
  // 文件名
392
395
  name: string
393
396
  // 到期时间
@@ -405,7 +408,7 @@ declare interface IDownInfo {
405
408
  /**
406
409
  * 下载文件信息
407
410
  */
408
- declare interface IDownFile {
411
+ export interface IDownFile {
409
412
  // 文件名
410
413
  name: string
411
414
  // 文件夹名
@@ -416,7 +419,10 @@ declare interface IDownFile {
416
419
  percent?: number
417
420
  }
418
421
 
419
- declare interface ICRUDConfig {
422
+ /**
423
+ * 注册curd配置
424
+ */
425
+ export interface ICRUDConfig {
420
426
  debug?: boolean
421
427
  size?: 'default' | 'small' | 'large'
422
428
  storagePrefix?: string
package/types/global.d.ts CHANGED
@@ -1,145 +1,13 @@
1
- // 申明外部 npm 插件模块
2
- declare module 'vue-grid-layout'
3
- declare module 'qrcodejs2-fixes'
4
- declare module 'splitpanes'
5
- declare module 'js-cookie'
6
- declare module '@wangeditor/editor-for-vue'
7
- declare module 'js-table2excel'
8
- declare module 'qs'
9
- declare module 'bluebird'
10
- declare module 'file-saver'
11
- declare module 'sortablejs'
12
- declare module 'bpmn-js-properties-panel'
13
- declare module 'bpmn-js-bpmnlint'
14
-
15
- // 声明一个模块,防止引入文件时报错
16
- declare module '*.json'
17
- declare module '*.png'
18
- declare module '*.jpg'
19
- declare module '*.scss'
20
- declare module '*.ts'
21
- declare module '*.js'
1
+ import type { DefineComponent } from 'vue'
22
2
 
23
3
  // 声明文件,*.vue 后缀的文件交给 vue 模块来处理
24
4
  declare module '*.vue' {
25
- import type { DefineComponent } from 'vue'
26
5
  const component: DefineComponent<{}, {}, any>
27
6
  export default component
28
7
  }
29
8
 
30
- // 声明文件,定义全局变量
31
- /* eslint-disable */
32
- declare interface Window {
33
- nextLoading: boolean
34
- }
35
-
36
- // 声明路由当前项类型
37
- declare type RouteItem<T = any> = {
38
- path: string
39
- name?: string | symbol | undefined | null
40
- redirect?: string
41
- k?: T
42
- meta?: {
43
- title?: string
44
- isLink?: string
45
- isHide?: boolean
46
- keepAlive?: boolean
47
- isAffix?: boolean
48
- isIframe?: boolean
49
- roles?: string[]
50
- icon?: string
51
- isDynamic?: boolean
52
- isDynamicPath?: string
53
- isIframeOpen?: string
54
- loading?: boolean
55
- }
56
- children: T[]
57
- query?: { [key: string]: T }
58
- params?: { [key: string]: T }
59
- contextMenuClickId?: string | number
60
- commonUrl?: string
61
- isFnClick?: boolean
62
- url?: string
63
- transUrl?: string
64
- title?: string
65
- id?: string | number
66
- }
67
-
68
- // 声明路由 to from
69
- declare interface RouteToFrom<T = any> extends RouteItem {
70
- path?: string
71
- children?: T[]
72
- matched?: any[]
73
- redirectedFrom?: any
74
- }
75
-
76
- // 声明路由当前项类型集合
77
- declare type RouteItems<T extends RouteItem = any> = T[]
78
-
79
9
  // 声明 ref
80
10
  declare type RefType<T = any> = T | null
81
11
 
82
12
  // 声明 HTMLElement
83
13
  declare type HtmlType = HTMLElement | string | undefined | null
84
-
85
- // 申明 children 可选
86
- declare type ChilType<T = any> = {
87
- children?: T[]
88
- }
89
-
90
- // 申明 数组
91
- declare type EmptyArrayType<T = any> = T[]
92
-
93
- // 申明 对象
94
- declare type EmptyObjectType<T = any> = {
95
- [key: string]: T
96
- }
97
-
98
- // 申明 select option
99
- declare type SelectOptionType = {
100
- value: string | number
101
- label: string | number
102
- }
103
-
104
- // 鼠标滚轮滚动类型
105
- declare interface WheelEventType extends WheelEvent {
106
- wheelDelta: number
107
- }
108
-
109
- // table 数据格式公共类型
110
- declare interface TableType<T = any> {
111
- total: number
112
- loading: boolean
113
- param: {
114
- pageNum: number
115
- pageSize: number
116
- [key: string]: T
117
- }
118
- }
119
-
120
- /**
121
- * 入参
122
- */
123
- declare interface RequestParams {
124
- [key: string]: any
125
- }
126
-
127
- /**
128
- * 通用的请求返回对象
129
- */
130
- declare interface RootObject<T> {
131
- status: number
132
- errorMsg: string
133
- data: T
134
- }
135
-
136
- /**
137
- * 分页数据请求返回对象
138
- */
139
- declare interface PageObject<T> {
140
- total?: number | string
141
- size?: number | string
142
- pages?: number | string
143
- current?: number | string
144
- records?: Array<T>
145
- }
package/types/axios.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /* eslint-disable */
2
- import * as axios from 'axios'
3
-
4
- // 扩展 axios 数据返回类型,可自行扩展
5
- declare module 'axios' {
6
- export interface AxiosResponse<T = any> {
7
- code: number
8
- data: T
9
- message: string
10
- type?: string
11
- [key: string]: T
12
- }
13
- }
package/types/layout.d.ts DELETED
@@ -1,57 +0,0 @@
1
- // aside
2
- declare type AsideState = {
3
- menuList: RouteRecordRaw[]
4
- clientWidth: number
5
- }
6
-
7
- // columnsAside
8
- declare type ColumnsAsideState<T = any> = {
9
- columnsAsideList: T[]
10
- liIndex: number
11
- liOldIndex: null | number
12
- liHoverIndex: null | number
13
- liOldPath: null | string
14
- difference: number
15
- routeSplit: string[]
16
- }
17
-
18
- // navBars breadcrumb
19
- declare type BreadcrumbState<T = any> = {
20
- breadcrumbList: T[]
21
- routeSplit: string[]
22
- }
23
-
24
- // navBars search
25
- declare type SearchState<T = any> = {
26
- isShowSearch: boolean
27
- menuQuery: string
28
- tagsViewList: T[]
29
- }
30
-
31
- // navBars tagsView
32
- declare type TagsViewState<T = any> = {
33
- routeActive: string | T
34
- routePath: string | unknown
35
- dropdown: {
36
- x: string | number
37
- y: string | number
38
- }
39
- sortable: T
40
- tagsRefsIndex: number
41
- tagsViewList: T[]
42
- tagsViewRoutesList: T[]
43
- }
44
-
45
- // navBars parent
46
- declare type ParentViewState<T = any> = {
47
- refreshRouterViewKey: string
48
- iframeRefreshKey: string
49
- keepAliveNameList: string[]
50
- iframeList: T[]
51
- }
52
-
53
- // navBars link
54
- declare type LinkViewState = {
55
- title: string
56
- isLink: string
57
- }
package/types/mitt.d.ts DELETED
@@ -1,38 +0,0 @@
1
- /**
2
- * mitt 事件类型定义
3
- *
4
- * @method openSetingsDrawer 打开布局设置弹窗
5
- * @method restoreDefault 分栏布局,鼠标移入、移出数据显示
6
- * @method setSendColumnsChildren 分栏布局,鼠标移入、移出菜单数据传入到 navMenu 下的菜单中
7
- * @method setSendClassicChildren 经典布局,开启切割菜单时,菜单数据传入到 navMenu 下的菜单中
8
- * @method getBreadcrumbIndexSetFilterRoutes 布局设置弹窗,开启切割菜单时,菜单数据传入到 navMenu 下的菜单中
9
- * @method layoutMobileResize 浏览器窗口改变时,用于适配移动端界面显示
10
- * @method openOrCloseSortable 布局设置弹窗,开启 TagsView 拖拽
11
- * @method openShareTagsView 布局设置弹窗,开启 TagsView 共用
12
- * @method onTagsViewRefreshRouterView tagsview 刷新界面
13
- * @method onCurrentContextmenuClick tagsview 右键菜单每项点击时
14
- */
15
- declare type MittType<T = any> = {
16
- openSetingsDrawer?: string
17
- restoreDefault?: string
18
- setSendColumnsChildren: T
19
- setSendClassicChildren: T
20
- getBreadcrumbIndexSetFilterRoutes?: string
21
- layoutMobileResize: T
22
- openOrCloseSortable?: string
23
- openShareTagsView?: string
24
- onTagsViewRefreshRouterView?: T
25
- onCurrentContextmenuClick?: T
26
- }
27
-
28
- // mitt 参数类型定义
29
- declare type LayoutMobileResize = {
30
- layout: string
31
- clientWidth: number
32
- }
33
-
34
- // mitt 参数菜单类型
35
- declare type MittMenu = {
36
- children: RouteRecordRaw[]
37
- item?: RouteItem
38
- }