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
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ele-form-file" :style="{ marginTop: props.modelValue && props.modelValue.length > 0 ? '10px' : '0' }">
|
|
3
|
-
<template v-if="props.modelValue && props.modelValue.length > 0">
|
|
4
|
-
<FileIcons :files="props.modelValue" showName preview />
|
|
5
|
-
</template>
|
|
6
|
-
<span v-else class="no-img-tip">暂无内容</span>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
export default {
|
|
11
|
-
name: 'ElPlusFormFile',
|
|
12
|
-
inheritAttrs: false,
|
|
13
|
-
typeName: 'file',
|
|
14
|
-
customOptions: {}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import FileIcons from './components/file-icons/FileIcons.vue'
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{
|
|
21
|
-
modelValue?: Array<IOssInfo>
|
|
22
|
-
field: string
|
|
23
|
-
loading?: boolean
|
|
24
|
-
desc: { [key: string]: any }
|
|
25
|
-
formData: { [key: string]: any }
|
|
26
|
-
}>()
|
|
27
|
-
</script>
|
|
28
|
-
<style lang="scss">
|
|
29
|
-
.ele-form-file {
|
|
30
|
-
width: 100%;
|
|
31
|
-
display: flex;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
margin-top: 10px;
|
|
34
|
-
|
|
35
|
-
.form-file-list {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
width: 100%;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.no-img-tip {
|
|
42
|
-
width: 100%;
|
|
43
|
-
color: #999999;
|
|
44
|
-
padding-left: 20px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ele-form-file" :style="{ marginTop: props.modelValue && props.modelValue.length > 0 ? '10px' : '0' }">
|
|
3
|
+
<template v-if="props.modelValue && props.modelValue.length > 0">
|
|
4
|
+
<FileIcons :files="props.modelValue" showName preview />
|
|
5
|
+
</template>
|
|
6
|
+
<span v-else class="no-img-tip">暂无内容</span>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ElPlusFormFile',
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
typeName: 'file',
|
|
14
|
+
customOptions: {}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import FileIcons from './components/file-icons/FileIcons.vue'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
modelValue?: Array<IOssInfo>
|
|
22
|
+
field: string
|
|
23
|
+
loading?: boolean
|
|
24
|
+
desc: { [key: string]: any }
|
|
25
|
+
formData: { [key: string]: any }
|
|
26
|
+
}>()
|
|
27
|
+
</script>
|
|
28
|
+
<style lang="scss">
|
|
29
|
+
.ele-form-file {
|
|
30
|
+
width: 100%;
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
margin-top: 10px;
|
|
34
|
+
|
|
35
|
+
.form-file-list {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.no-img-tip {
|
|
42
|
+
width: 100%;
|
|
43
|
+
color: #999999;
|
|
44
|
+
padding-left: 20px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ele-form-image">
|
|
3
|
-
<template v-if="imagLIst && imagLIst.length > 0">
|
|
4
|
-
<el-image v-for="(image, i) in imagLIst" :class="desc.class" :key="image" :preview-src-list="attrs.isShowPreview === false ? null : imagLIst" :initial-index="i" :src="format.imgUrl(image)" v-bind="attrs" :style="styles" v-on="onEvents" :fit="attrs.fit || 'cover'" />
|
|
5
|
-
</template>
|
|
6
|
-
<div v-else>
|
|
7
|
-
<span class="no-img-tip">—</span>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
<script lang="ts">
|
|
12
|
-
export default {
|
|
13
|
-
name: 'ElPlusFormImage',
|
|
14
|
-
inheritAttrs: false,
|
|
15
|
-
typeName: 'image',
|
|
16
|
-
customOptions: {}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
<script lang="ts" setup>
|
|
20
|
-
import { ref, computed, useAttrs, onBeforeMount, inject } from 'vue'
|
|
21
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
22
|
-
|
|
23
|
-
// 格式化
|
|
24
|
-
const format = inject('format') as any
|
|
25
|
-
|
|
26
|
-
const props = defineProps<{
|
|
27
|
-
modelValue?: Array<any> | string | null
|
|
28
|
-
field: string
|
|
29
|
-
loading?: boolean
|
|
30
|
-
desc: { [key: string]: any }
|
|
31
|
-
formData: { [key: string]: any }
|
|
32
|
-
}>()
|
|
33
|
-
|
|
34
|
-
const attrs = ref({} as any)
|
|
35
|
-
const onEvents = ref(getEvents(props))
|
|
36
|
-
|
|
37
|
-
onBeforeMount(async () => {
|
|
38
|
-
attrs.value = await getAttrs(props, { isShowPreview: true, previewTeleported: true, ...useAttrs() })
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
const imagLIst = computed(() => {
|
|
42
|
-
if (!props.modelValue) {
|
|
43
|
-
return []
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(props.modelValue)) {
|
|
46
|
-
if (typeof props.modelValue[0] === 'string') {
|
|
47
|
-
return props.modelValue
|
|
48
|
-
} else {
|
|
49
|
-
return props.modelValue.map((item) => item.shareUrl || item.furl)
|
|
50
|
-
}
|
|
51
|
-
} else if (typeof props.modelValue === 'string') {
|
|
52
|
-
return props.modelValue.split(',').map((url) => format.imgUrl(url))
|
|
53
|
-
} else {
|
|
54
|
-
// console.log('unknown image Type.....')
|
|
55
|
-
}
|
|
56
|
-
return []
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 格式化样式
|
|
61
|
-
* large,default,small
|
|
62
|
-
*/
|
|
63
|
-
const styles = computed(() => {
|
|
64
|
-
let width = ''
|
|
65
|
-
let height = ''
|
|
66
|
-
let size = props.desc.size || 'default'
|
|
67
|
-
switch (size) {
|
|
68
|
-
case 'large':
|
|
69
|
-
width = '44px'
|
|
70
|
-
height = '44px'
|
|
71
|
-
break
|
|
72
|
-
case 'default':
|
|
73
|
-
width = '36px'
|
|
74
|
-
height = '36px'
|
|
75
|
-
break
|
|
76
|
-
case 'small':
|
|
77
|
-
width = '28px'
|
|
78
|
-
height = '28px'
|
|
79
|
-
break
|
|
80
|
-
default:
|
|
81
|
-
width = parseInt(size) + 'px'
|
|
82
|
-
height = parseInt(size) + 'px'
|
|
83
|
-
break
|
|
84
|
-
}
|
|
85
|
-
return Object.assign({}, props.desc.style, { width, height, 'max-width': width })
|
|
86
|
-
})
|
|
87
|
-
</script>
|
|
88
|
-
<style lang="scss">
|
|
89
|
-
.ele-form-image {
|
|
90
|
-
display: flex;
|
|
91
|
-
// justify-content: center;
|
|
92
|
-
flex-wrap: wrap;
|
|
93
|
-
|
|
94
|
-
.no-img-tip {
|
|
95
|
-
color: #999999;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.el-image {
|
|
99
|
-
margin-left: 10px;
|
|
100
|
-
margin-bottom: 10px;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.ele-form-image .el-image {
|
|
105
|
-
border-radius: 5px;
|
|
106
|
-
margin-bottom: 10px;
|
|
107
|
-
|
|
108
|
-
.el-image__error {
|
|
109
|
-
font-size: 12px;
|
|
110
|
-
line-height: 13px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ele-form-image">
|
|
3
|
+
<template v-if="imagLIst && imagLIst.length > 0">
|
|
4
|
+
<el-image v-for="(image, i) in imagLIst" :class="desc.class" :key="image" :preview-src-list="attrs.isShowPreview === false ? null : imagLIst" :initial-index="i" :src="format.imgUrl(image)" v-bind="attrs" :style="styles" v-on="onEvents" :fit="attrs.fit || 'cover'" />
|
|
5
|
+
</template>
|
|
6
|
+
<div v-else>
|
|
7
|
+
<span class="no-img-tip">—</span>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export default {
|
|
13
|
+
name: 'ElPlusFormImage',
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
typeName: 'image',
|
|
16
|
+
customOptions: {}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { ref, computed, useAttrs, onBeforeMount, inject } from 'vue'
|
|
21
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
22
|
+
|
|
23
|
+
// 格式化
|
|
24
|
+
const format = inject('format') as any
|
|
25
|
+
|
|
26
|
+
const props = defineProps<{
|
|
27
|
+
modelValue?: Array<any> | string | null
|
|
28
|
+
field: string
|
|
29
|
+
loading?: boolean
|
|
30
|
+
desc: { [key: string]: any }
|
|
31
|
+
formData: { [key: string]: any }
|
|
32
|
+
}>()
|
|
33
|
+
|
|
34
|
+
const attrs = ref({} as any)
|
|
35
|
+
const onEvents = ref(getEvents(props))
|
|
36
|
+
|
|
37
|
+
onBeforeMount(async () => {
|
|
38
|
+
attrs.value = await getAttrs(props, { isShowPreview: true, previewTeleported: true, ...useAttrs() })
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const imagLIst = computed(() => {
|
|
42
|
+
if (!props.modelValue) {
|
|
43
|
+
return []
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(props.modelValue)) {
|
|
46
|
+
if (typeof props.modelValue[0] === 'string') {
|
|
47
|
+
return props.modelValue
|
|
48
|
+
} else {
|
|
49
|
+
return props.modelValue.map((item) => item.shareUrl || item.furl)
|
|
50
|
+
}
|
|
51
|
+
} else if (typeof props.modelValue === 'string') {
|
|
52
|
+
return props.modelValue.split(',').map((url) => format.imgUrl(url))
|
|
53
|
+
} else {
|
|
54
|
+
// console.log('unknown image Type.....')
|
|
55
|
+
}
|
|
56
|
+
return []
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 格式化样式
|
|
61
|
+
* large,default,small
|
|
62
|
+
*/
|
|
63
|
+
const styles = computed(() => {
|
|
64
|
+
let width = ''
|
|
65
|
+
let height = ''
|
|
66
|
+
let size = props.desc.size || 'default'
|
|
67
|
+
switch (size) {
|
|
68
|
+
case 'large':
|
|
69
|
+
width = '44px'
|
|
70
|
+
height = '44px'
|
|
71
|
+
break
|
|
72
|
+
case 'default':
|
|
73
|
+
width = '36px'
|
|
74
|
+
height = '36px'
|
|
75
|
+
break
|
|
76
|
+
case 'small':
|
|
77
|
+
width = '28px'
|
|
78
|
+
height = '28px'
|
|
79
|
+
break
|
|
80
|
+
default:
|
|
81
|
+
width = parseInt(size) + 'px'
|
|
82
|
+
height = parseInt(size) + 'px'
|
|
83
|
+
break
|
|
84
|
+
}
|
|
85
|
+
return Object.assign({}, props.desc.style, { width, height, 'max-width': width })
|
|
86
|
+
})
|
|
87
|
+
</script>
|
|
88
|
+
<style lang="scss">
|
|
89
|
+
.ele-form-image {
|
|
90
|
+
display: flex;
|
|
91
|
+
// justify-content: center;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
|
|
94
|
+
.no-img-tip {
|
|
95
|
+
color: #999999;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.el-image {
|
|
99
|
+
margin-left: 10px;
|
|
100
|
+
margin-bottom: 10px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ele-form-image .el-image {
|
|
105
|
+
border-radius: 5px;
|
|
106
|
+
margin-bottom: 10px;
|
|
107
|
+
|
|
108
|
+
.el-image__error {
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
line-height: 13px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-input style="display: flex" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
2
|
+
<el-input v-if="isInit" style="display: flex" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
3
|
<template v-for="(item, key, index) of slots" #[key] :key="index">
|
|
4
4
|
<slot :name="key" />
|
|
5
5
|
</template>
|
|
@@ -29,6 +29,7 @@ const props = defineProps<{
|
|
|
29
29
|
const emits = defineEmits(['update:modelValue', 'validateThis'])
|
|
30
30
|
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
31
31
|
const attrs = ref({} as any)
|
|
32
|
+
const isInit = ref(false)
|
|
32
33
|
const onEvents = ref(getEvents(props))
|
|
33
34
|
|
|
34
35
|
const currentValue = ref()
|
|
@@ -36,6 +37,7 @@ emits('update:modelValue', currentValue)
|
|
|
36
37
|
|
|
37
38
|
onBeforeMount(async () => {
|
|
38
39
|
attrs.value = await getAttrs(props, { autocomplete: 'new-password', maxlength: defaultConf.form?.leng?.input || 0, clearable: true, ...useAttrs() })
|
|
40
|
+
isInit.value = true
|
|
39
41
|
})
|
|
40
42
|
|
|
41
43
|
watch(
|