el-plus-crud 0.0.39 → 0.0.41

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 (73) hide show
  1. package/.eslintrc.js +78 -78
  2. package/.prettierrc.js +39 -39
  3. package/CHANGELOG.md +5 -1
  4. package/build.js +31 -31
  5. package/dist/el-plus-crud.mjs +1803 -1801
  6. package/dist/el-plus-crud.umd.js +7 -7
  7. package/dist/style.css +1 -1
  8. package/example/App.vue +67 -67
  9. package/example/main.js +18 -18
  10. package/index.html +13 -13
  11. package/lib/components/el-plus-form/ElPlusForm.vue +771 -774
  12. package/lib/components/el-plus-form/ElPlusFormDialog.vue +90 -90
  13. package/lib/components/el-plus-form/ElPlusFormGroup.vue +116 -116
  14. package/lib/components/el-plus-form/components/ElPlusFormArea.vue +61 -61
  15. package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
  16. package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +102 -102
  17. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
  18. package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +63 -63
  19. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +53 -53
  20. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +44 -44
  21. package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +44 -44
  22. package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
  23. package/lib/components/el-plus-form/components/ElPlusFormDate.vue +39 -39
  24. package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +46 -46
  25. package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +40 -40
  26. package/lib/components/el-plus-form/components/ElPlusFormFile.vue +47 -47
  27. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
  28. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +281 -281
  29. package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +489 -489
  30. package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +53 -53
  31. package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +146 -146
  32. package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +94 -94
  33. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
  34. package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
  35. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +161 -161
  36. package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
  37. package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
  38. package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
  39. package/lib/components/el-plus-form/components/ElPlusFormText.vue +99 -99
  40. package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +49 -49
  41. package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
  42. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +76 -76
  43. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +59 -59
  44. package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +368 -368
  45. package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +135 -135
  46. package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
  47. package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
  48. package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
  49. package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
  50. package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
  51. package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
  52. package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
  53. package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
  54. package/lib/components/el-plus-form/components/index.ts +17 -17
  55. package/lib/components/el-plus-form/data/file.ts +74 -74
  56. package/lib/components/el-plus-form/mixins/index.ts +115 -113
  57. package/lib/components/el-plus-form/util/index.ts +257 -257
  58. package/lib/components/el-plus-form/util/validate.ts +332 -332
  59. package/lib/components/el-plus-table/components/columnItem.vue +205 -205
  60. package/lib/components/el-plus-table/components/header.vue +240 -240
  61. package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
  62. package/lib/components/el-plus-table/util/index.ts +147 -147
  63. package/lib/config/index.ts +30 -30
  64. package/lib/index.d.ts +4 -4
  65. package/lib/index.ts +51 -51
  66. package/package.json +1 -1
  67. package/types/axios.d.ts +13 -13
  68. package/types/formList.d.ts +440 -440
  69. package/types/layout.d.ts +57 -57
  70. package/types/mitt.d.ts +38 -38
  71. package/types/pinia.d.ts +149 -149
  72. package/types/views.d.ts +329 -329
  73. package/vite.config.ts +78 -78
@@ -1,17 +1,17 @@
1
- /**
2
- * 这里加载当前文件夹下的所有Vue组件
3
- */
4
- const modulesFiles = import.meta.globEager('./*.vue')
5
-
6
- const components: any[] = []
7
- const typeList: String[] = []
8
-
9
- // 递归
10
- for (const file in modulesFiles) {
11
- const tempComponent = (modulesFiles[file] as any).default
12
- components.push(tempComponent)
13
- if (tempComponent.typeName) {
14
- typeList.push(tempComponent.typeName)
15
- }
16
- }
17
- export { components, typeList }
1
+ /**
2
+ * 这里加载当前文件夹下的所有Vue组件
3
+ */
4
+ const modulesFiles = import.meta.globEager('./*.vue')
5
+
6
+ const components: any[] = []
7
+ const typeList: String[] = []
8
+
9
+ // 递归
10
+ for (const file in modulesFiles) {
11
+ const tempComponent = (modulesFiles[file] as any).default
12
+ components.push(tempComponent)
13
+ if (tempComponent.typeName) {
14
+ typeList.push(tempComponent.typeName)
15
+ }
16
+ }
17
+ export { components, typeList }
@@ -1,74 +1,74 @@
1
- /**
2
- * 能够上传的图片类型
3
- */
4
- export const imageTypes = ['image/jpg', 'image/png', 'image/gif', 'image/jpeg']
5
- /**
6
- * 能够上传的图片后缀名称
7
- */
8
- export const imageSuffixes = ['.jpe', '.jpeg', '.jpg', '.gif', '.png']
9
-
10
- /**
11
- * 能够上传的视频类型
12
- */
13
- export const videoTypes = ['video/3gpp', 'video/mpeg', 'application/mp4', 'video/mp4', 'video/ogg', 'video/x-flv', 'video/x-msvideo']
14
- /**
15
- * 能够上传的视频后缀名称
16
- */
17
- export const videoSuffixes = ['.3gpp', '.mpeg', '.mpg', '.mp4', '.ogv', '.flv', '.avi']
18
-
19
- /**
20
- * 能够上传的音频类型
21
- */
22
- export const audioTypes = ['audio/x-wav', 'audio/x-ms-wma', 'audio/mp4', 'audio/mp3']
23
- /**
24
- * 能够上传的音频后缀名称
25
- */
26
- export const audioSuffixes = ['.wav', '.wma', '.mp4a', '.mp3']
27
-
28
- /**
29
- * 能够上传的文档类型
30
- */
31
- export const officeTypes = ['application/x-msaccess', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', ' application/vnd.ms-powerpoint', 'application/vnd.ms-excel', ' application/msword', 'application/pdf', 'application/vnd.ms-works']
32
- /**
33
- * 能够上传的文档后缀名称
34
- */
35
- export const officeSuffixes = ['.mdb', '.docx', '.xlsx', '.pptx', '.ppt', '.xls', '.doc', '.pdf']
36
-
37
- /**
38
- * 能够上传的文档类型
39
- */
40
- export const textTypes = ['application/xml', 'application/x-sh', 'application/json', 'application/javascript', 'application/java-vm', 'application/java-archive', 'text/html', 'text/plain']
41
- /**
42
- * 能够上传的文档后缀名称
43
- */
44
- export const textSuffixes = ['.xml', '.sh', '.json', '.js', '.class', '.jar', 'html', '.txt', '.wdb', '.wps']
45
-
46
- /**
47
- * 能够上传的文档类型
48
- */
49
- export const otherTypes = ['application/x-rar-compressed', 'application/x-msdownload', 'application/x-font-woff', ' application/x-font-ttf', 'application/x-7z-compressed', ' application/vnd.android.package-archive', 'application/zip']
50
- /**
51
- * 能够上传的文档后缀
52
- */
53
- export const otherSuffixes = ['.rar', '.exe', '.woff', '.ttf', '.7z', '.apk', '.zip']
54
-
55
- /**
56
- * 能够上传的文件类型
57
- */
58
- export const fileTypes = [...imageTypes, ...videoTypes, ...officeTypes, ...textTypes, ...otherTypes]
59
- /**
60
- * 能够上传的文件后缀
61
- */
62
- export const fileSuffixes = [...imageSuffixes, ...videoSuffixes, ...officeSuffixes, ...textSuffixes, ...otherSuffixes]
63
-
64
- /**
65
- * 文档后缀对应的类型
66
- */
67
- export const suffixTypes = [
68
- { type: 'pdf', suffixes: ['.pdf'] },
69
- { type: 'txt', suffixes: ['.txt'] },
70
- { type: 'excel', suffixes: ['.xls', '.xlsx'] },
71
- { type: 'word', suffixes: ['.doc', '.docx'] },
72
- { type: 'ppt', suffixes: ['.ppt', '.pptx'] },
73
- { type: 'zip', suffixes: ['.zip', '.rar', '.7z'] }
74
- ]
1
+ /**
2
+ * 能够上传的图片类型
3
+ */
4
+ export const imageTypes = ['image/jpg', 'image/png', 'image/gif', 'image/jpeg']
5
+ /**
6
+ * 能够上传的图片后缀名称
7
+ */
8
+ export const imageSuffixes = ['.jpe', '.jpeg', '.jpg', '.gif', '.png']
9
+
10
+ /**
11
+ * 能够上传的视频类型
12
+ */
13
+ export const videoTypes = ['video/3gpp', 'video/mpeg', 'application/mp4', 'video/mp4', 'video/ogg', 'video/x-flv', 'video/x-msvideo']
14
+ /**
15
+ * 能够上传的视频后缀名称
16
+ */
17
+ export const videoSuffixes = ['.3gpp', '.mpeg', '.mpg', '.mp4', '.ogv', '.flv', '.avi']
18
+
19
+ /**
20
+ * 能够上传的音频类型
21
+ */
22
+ export const audioTypes = ['audio/x-wav', 'audio/x-ms-wma', 'audio/mp4', 'audio/mp3']
23
+ /**
24
+ * 能够上传的音频后缀名称
25
+ */
26
+ export const audioSuffixes = ['.wav', '.wma', '.mp4a', '.mp3']
27
+
28
+ /**
29
+ * 能够上传的文档类型
30
+ */
31
+ export const officeTypes = ['application/x-msaccess', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', ' application/vnd.ms-powerpoint', 'application/vnd.ms-excel', ' application/msword', 'application/pdf', 'application/vnd.ms-works']
32
+ /**
33
+ * 能够上传的文档后缀名称
34
+ */
35
+ export const officeSuffixes = ['.mdb', '.docx', '.xlsx', '.pptx', '.ppt', '.xls', '.doc', '.pdf']
36
+
37
+ /**
38
+ * 能够上传的文档类型
39
+ */
40
+ export const textTypes = ['application/xml', 'application/x-sh', 'application/json', 'application/javascript', 'application/java-vm', 'application/java-archive', 'text/html', 'text/plain']
41
+ /**
42
+ * 能够上传的文档后缀名称
43
+ */
44
+ export const textSuffixes = ['.xml', '.sh', '.json', '.js', '.class', '.jar', 'html', '.txt', '.wdb', '.wps']
45
+
46
+ /**
47
+ * 能够上传的文档类型
48
+ */
49
+ export const otherTypes = ['application/x-rar-compressed', 'application/x-msdownload', 'application/x-font-woff', ' application/x-font-ttf', 'application/x-7z-compressed', ' application/vnd.android.package-archive', 'application/zip']
50
+ /**
51
+ * 能够上传的文档后缀
52
+ */
53
+ export const otherSuffixes = ['.rar', '.exe', '.woff', '.ttf', '.7z', '.apk', '.zip']
54
+
55
+ /**
56
+ * 能够上传的文件类型
57
+ */
58
+ export const fileTypes = [...imageTypes, ...videoTypes, ...officeTypes, ...textTypes, ...otherTypes]
59
+ /**
60
+ * 能够上传的文件后缀
61
+ */
62
+ export const fileSuffixes = [...imageSuffixes, ...videoSuffixes, ...officeSuffixes, ...textSuffixes, ...otherSuffixes]
63
+
64
+ /**
65
+ * 文档后缀对应的类型
66
+ */
67
+ export const suffixTypes = [
68
+ { type: 'pdf', suffixes: ['.pdf'] },
69
+ { type: 'txt', suffixes: ['.txt'] },
70
+ { type: 'excel', suffixes: ['.xls', '.xlsx'] },
71
+ { type: 'word', suffixes: ['.doc', '.docx'] },
72
+ { type: 'ppt', suffixes: ['.ppt', '.pptx'] },
73
+ { type: 'zip', suffixes: ['.zip', '.rar', '.7z'] }
74
+ ]
@@ -1,113 +1,115 @@
1
- export interface IMixinsProps {
2
- modelValue?: any
3
- field: string
4
- rowIndex?: number
5
- loading?: boolean
6
- desc: { [key: string]: any }
7
- formData: { [key: string]: any }
8
- isMobile?: boolean
9
- defineEmits?: any
10
- }
11
-
12
- /**
13
- * 获取属性
14
- * @param props
15
- * @param customAttrs
16
- * @returns
17
- */
18
- export const getAttrs = async (props: IMixinsProps, customAttrs?: { [key: string]: any }) => {
19
- // 合并属性
20
- const attrs = Object.assign({}, customAttrs, props.desc?._attrs, props.desc?.attrs, getPlaceholder(props.desc))
21
-
22
- // 处理多选
23
- if (props.desc.multiple) {
24
- attrs.multiple = true
25
- attrs.showCheckbox = true
26
- if (['select'].indexOf(props.desc.type) >= 0) {
27
- attrs.collapseTags = props.desc.attrs?.collapseTags ?? false
28
- attrs.collapseTagsTooltip = props.desc.attrs?.collapseTagsTooltip ?? false
29
- }
30
- }
31
-
32
- // if (['area'].indexOf(props.desc.type) >= 0) {
33
- // delete attrs.options
34
- // }
35
-
36
- // 处理下elType
37
- if (props.desc.elType) {
38
- if (typeof props.desc.elType === 'function') {
39
- attrs.type = props.desc.elType(props.formData)
40
- } else {
41
- attrs.type = props.desc.elType
42
- }
43
- }
44
- return attrs
45
- }
46
-
47
- /**
48
- * 获取事件
49
- * @returns
50
- */
51
- export const getEvents = (props: IMixinsProps) => {
52
- const tempOn = {} as any
53
- if (props.desc?.on) {
54
- Object.keys(props.desc.on).map((key: string) => {
55
- tempOn[key] = (val: any) => {
56
- props.desc.on[key](props.formData, props.rowIndex, val)
57
- }
58
- })
59
- }
60
- return tempOn
61
- }
62
-
63
- /**
64
- * 根据类型获取属性 placeholder
65
- * @param desc
66
- * @returns
67
- */
68
- function getPlaceholder(desc: { [key: string]: any }) {
69
- if (!desc || !desc.type) return ''
70
- switch (desc.type) {
71
- case 'input':
72
- case 'nbinput':
73
- case 'password':
74
- case 'number':
75
- case 'validCode':
76
- case 'tag':
77
- return { placeholder: desc?.placeholder || '请输入' + desc?._label }
78
- case 'switch':
79
- return {}
80
- case 'area':
81
- case 'select':
82
- case 'category':
83
- case 'cascader':
84
- return { placeholder: desc?.placeholder || '请选择' + (desc.remote ? (desc.initLoad !== false ? '(默认查10个,其余请输入搜索)' : '或输入进行搜索') : desc?._label) }
85
- case 'data':
86
- case 'datetime':
87
- case 'datas':
88
- return { placeholder: '选择日期' }
89
- case 'daterange':
90
- case 'datetimerange':
91
- case 'timerange':
92
- case 'monthrange':
93
- return {
94
- startPlaceholder: '开始日期',
95
- endPlaceholder: '结束日期'
96
- }
97
- case 'dates':
98
- return { placeholder: '选择一个或多个日期' }
99
- case 'month':
100
- return { placeholder: '选择月' }
101
- case 'time':
102
- case 'timsPicker':
103
- return { placeholder: '请选择时间' }
104
- case 'week':
105
- return { placeholder: '请选择周' }
106
- case 'year':
107
- return { placeholder: '请选择年' }
108
- case 'upimg':
109
- return { placeholder: '请上传' }
110
- case 'upfile':
111
- return { placeholder: '点击上传' }
112
- }
113
- }
1
+ export interface IMixinsProps {
2
+ modelValue?: any
3
+ field: string
4
+ rowIndex?: number
5
+ loading?: boolean
6
+ desc: { [key: string]: any }
7
+ formData: { [key: string]: any }
8
+ isMobile?: boolean
9
+ defineEmits?: any
10
+ }
11
+
12
+ /**
13
+ * 获取属性
14
+ * @param props
15
+ * @param customAttrs
16
+ * @returns
17
+ */
18
+ export const getAttrs = async (props: IMixinsProps, customAttrs?: { [key: string]: any }) => {
19
+ // 合并属性
20
+ const attrs = Object.assign({}, customAttrs, props.desc?._attrs, props.desc?.attrs, getPlaceholder(props.desc))
21
+
22
+ // 处理多选
23
+ if (props.desc.multiple) {
24
+ attrs.multiple = true
25
+ attrs.showCheckbox = true
26
+ if (['select'].indexOf(props.desc.type) >= 0) {
27
+ attrs.collapseTags = props.desc.attrs?.collapseTags ?? false
28
+ attrs.collapseTagsTooltip = props.desc.attrs?.collapseTagsTooltip ?? false
29
+ }
30
+ }
31
+
32
+ // if (['area'].indexOf(props.desc.type) >= 0) {
33
+ // delete attrs.options
34
+ // }
35
+
36
+ // 处理下elType
37
+ if (props.desc.elType) {
38
+ if (typeof props.desc.elType === 'function') {
39
+ attrs.type = props.desc.elType(props.formData)
40
+ } else {
41
+ attrs.type = props.desc.elType
42
+ }
43
+ }
44
+ return attrs
45
+ }
46
+
47
+ /**
48
+ * 获取事件
49
+ * @returns
50
+ */
51
+ export const getEvents = (props: IMixinsProps) => {
52
+ const tempOn = {} as any
53
+ if (props.desc?.on) {
54
+ Object.keys(props.desc.on).map((key: string) => {
55
+ tempOn[key] = (val: any) => {
56
+ props.desc.on[key](props.formData, props.rowIndex, val)
57
+ }
58
+ })
59
+ }
60
+ return tempOn
61
+ }
62
+
63
+ /**
64
+ * 根据类型获取属性 placeholder
65
+ * @param desc
66
+ * @returns
67
+ */
68
+ function getPlaceholder(desc: { [key: string]: any }) {
69
+ if (!desc || !desc.type) return ''
70
+ switch (desc.type) {
71
+ case 'input':
72
+ case 'nbinput':
73
+ case 'password':
74
+ case 'number':
75
+ case 'validCode':
76
+ case 'tag':
77
+ case 'textarea':
78
+ return { placeholder: desc?.placeholder || '请输入' + desc?._label }
79
+ case 'switch':
80
+ return {}
81
+ case 'area':
82
+ case 'select':
83
+ case 'category':
84
+ case 'cascader':
85
+ return { placeholder: desc?.placeholder || '请选择' + (desc.remote ? (desc.initLoad !== false ? '(默认查10个,其余请输入搜索)' : '或输入进行搜索') : desc?._label) }
86
+ case 'data':
87
+ case 'datetime':
88
+ case 'datas':
89
+ case 'date':
90
+ return { placeholder: '请选择日期' }
91
+ case 'daterange':
92
+ case 'datetimerange':
93
+ case 'timerange':
94
+ case 'monthrange':
95
+ return {
96
+ startPlaceholder: '开始日期',
97
+ endPlaceholder: '结束日期'
98
+ }
99
+ case 'dates':
100
+ return { placeholder: '请选择一个或多个日期' }
101
+ case 'month':
102
+ return { placeholder: '请选择月' }
103
+ case 'time':
104
+ case 'timsPicker':
105
+ return { placeholder: '请选择时间' }
106
+ case 'week':
107
+ return { placeholder: '请选择周' }
108
+ case 'year':
109
+ return { placeholder: '请选择年' }
110
+ case 'upimg':
111
+ return { placeholder: '请上传' }
112
+ case 'upfile':
113
+ return { placeholder: '点击上传' }
114
+ }
115
+ }