el-plus-crud 0.0.74 → 0.0.76
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/CHANGELOG.md +4 -0
- package/dist/el-plus-crud.mjs +10 -10
- package/example/App.vue +69 -68
- package/lib/components/el-plus-form/ElPlusForm.vue +2 -1
- package/lib/components/el-plus-form/ElPlusFormDialog.vue +90 -89
- package/lib/components/el-plus-form/ElPlusFormGroup.vue +2 -1
- package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +2 -1
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +2 -1
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +49 -48
- package/lib/components/el-plus-form/components/ElPlusFormInput.vue +64 -63
- package/lib/components/el-plus-form/components/ElPlusFormLink.vue +284 -283
- package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +492 -491
- package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +149 -148
- package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +46 -45
- package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +98 -97
- package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +164 -163
- package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +52 -51
- package/lib/components/el-plus-form/components/ElPlusFormUpbtn.vue +146 -145
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +371 -370
- package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +137 -136
- package/lib/components/el-plus-table/ElPlusTable.vue +2 -1
- package/lib/components/el-plus-table/components/columnItem.vue +214 -213
- package/lib/components/el-plus-table/components/header.vue +2 -1
- package/lib/components/el-plus-table/components/settingColumn.vue +180 -179
- package/lib/components/el-plus-table/util/index.ts +148 -148
- package/lib/config/index.ts +32 -32
- package/lib/index.ts +52 -52
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/types/global.d.ts +13 -13
- package/types/{formList.d.ts → index.d.ts} +1 -0
|
@@ -1,136 +1,137 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="file-icons-panel">
|
|
3
|
-
<div :class="[isCard ? 'card-list' : 'file-list']" v-if="files && files.length">
|
|
4
|
-
<div v-for="(item, i) in files" :key="i" class="file-item" @click="handelPreview(item)">
|
|
5
|
-
<el-image :src="getIcon(item)" :style="style" fit="cover" />
|
|
6
|
-
<div v-if="showName" class="file-name">{{ cutString(item.name, 50) + item.suffix }}</div>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<!-- 图片查看的站位标签 -->
|
|
11
|
-
<el-image-viewer v-if="showPreview" @close="showPreview = false" teleported :initialIndex="previewIndex" :url-list="previewList" />
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
<script lang="ts" setup name="FileIcons">
|
|
15
|
-
import { ref, computed } from 'vue'
|
|
16
|
-
import fileIcon, { imgSuffix, iconMap } from './data'
|
|
17
|
-
import { cutString } from '../../../util'
|
|
18
|
-
import { IOssInfo } from 'types
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{
|
|
21
|
-
files: Array<IOssInfo>
|
|
22
|
-
size?: number
|
|
23
|
-
// 是否是卡片布局
|
|
24
|
-
isCard?: boolean
|
|
25
|
-
// 如果是图片,是否直接显示, 默认显示的图片icon
|
|
26
|
-
showImg?: boolean
|
|
27
|
-
// 是否能够预览
|
|
28
|
-
preview?: boolean
|
|
29
|
-
// 是否显示名称
|
|
30
|
-
showName?: boolean
|
|
31
|
-
}>()
|
|
32
|
-
|
|
33
|
-
const showPreview = ref(false)
|
|
34
|
-
const previewIndex = ref(0)
|
|
35
|
-
|
|
36
|
-
// 预览列表
|
|
37
|
-
const previewList = computed(() =>
|
|
38
|
-
props.files
|
|
39
|
-
.map((item: any) => {
|
|
40
|
-
if (imgSuffix.indexOf(item.suffix || '') >= 0) {
|
|
41
|
-
return item.shareUrl
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
.filter((url) => url)
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 图片的样式
|
|
49
|
-
*/
|
|
50
|
-
const style = computed(() => {
|
|
51
|
-
return {
|
|
52
|
-
width: (props.size || 16) + 'px',
|
|
53
|
-
height: (props.size || 16) + 'px'
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 获取Icon
|
|
59
|
-
* @param item
|
|
60
|
-
*/
|
|
61
|
-
function getIcon(item: IOssInfo) {
|
|
62
|
-
let icon = iconMap[item.suffix || ''] || fileIcon
|
|
63
|
-
if (props.showImg) {
|
|
64
|
-
if (imgSuffix.indexOf(item.suffix || '') >= 0) {
|
|
65
|
-
return item.shareUrl
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return icon
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 处理点击事件
|
|
72
|
-
function handelPreview(file: IOssInfo) {
|
|
73
|
-
// console.log('preview: ', props.preview, file, previewList.value)
|
|
74
|
-
if (props.preview) {
|
|
75
|
-
// 如果是图片
|
|
76
|
-
if (imgSuffix.indexOf(file.suffix || '') >= 0) {
|
|
77
|
-
previewIndex.value = previewList.value.indexOf(file.shareUrl || file.furl)
|
|
78
|
-
showPreview.value = true
|
|
79
|
-
} else {
|
|
80
|
-
window.open(file.previewUrl || file.shareUrl || file.furl, '_blank')
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</script>
|
|
85
|
-
<style lang="scss" scoped>
|
|
86
|
-
.file-icons-panel {
|
|
87
|
-
width: 100%;
|
|
88
|
-
|
|
89
|
-
.file-list {
|
|
90
|
-
width: 100%;
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-direction: column;
|
|
93
|
-
|
|
94
|
-
.file-item {
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-direction: row;
|
|
97
|
-
align-items: center;
|
|
98
|
-
width: 100%;
|
|
99
|
-
height: 28px;
|
|
100
|
-
line-height: 28px;
|
|
101
|
-
padding: 0 10px;
|
|
102
|
-
background: #f5f7fa;
|
|
103
|
-
margin-bottom: 10px;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
font-size: 13px;
|
|
106
|
-
font-weight: 400;
|
|
107
|
-
color: #303133;
|
|
108
|
-
|
|
109
|
-
&:hover {
|
|
110
|
-
background: #e7e8eb;
|
|
111
|
-
color: var(--el-color-primary);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.file-name {
|
|
115
|
-
margin-left: 10px;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.card-list {
|
|
121
|
-
width: 100%;
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-direction: row;
|
|
124
|
-
|
|
125
|
-
.file-item {
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
align-items: center;
|
|
129
|
-
|
|
130
|
-
.file-name {
|
|
131
|
-
margin-top: 10px;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="file-icons-panel">
|
|
3
|
+
<div :class="[isCard ? 'card-list' : 'file-list']" v-if="files && files.length">
|
|
4
|
+
<div v-for="(item, i) in files" :key="i" class="file-item" @click="handelPreview(item)">
|
|
5
|
+
<el-image :src="getIcon(item)" :style="style" fit="cover" />
|
|
6
|
+
<div v-if="showName" class="file-name">{{ cutString(item.name, 50) + item.suffix }}</div>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<!-- 图片查看的站位标签 -->
|
|
11
|
+
<el-image-viewer v-if="showPreview" @close="showPreview = false" teleported :initialIndex="previewIndex" :url-list="previewList" />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup name="FileIcons">
|
|
15
|
+
import { ref, computed } from 'vue'
|
|
16
|
+
import fileIcon, { imgSuffix, iconMap } from './data'
|
|
17
|
+
import { cutString } from '../../../util'
|
|
18
|
+
import { IOssInfo } from 'types'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
files: Array<IOssInfo>
|
|
22
|
+
size?: number
|
|
23
|
+
// 是否是卡片布局
|
|
24
|
+
isCard?: boolean
|
|
25
|
+
// 如果是图片,是否直接显示, 默认显示的图片icon
|
|
26
|
+
showImg?: boolean
|
|
27
|
+
// 是否能够预览
|
|
28
|
+
preview?: boolean
|
|
29
|
+
// 是否显示名称
|
|
30
|
+
showName?: boolean
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const showPreview = ref(false)
|
|
34
|
+
const previewIndex = ref(0)
|
|
35
|
+
|
|
36
|
+
// 预览列表
|
|
37
|
+
const previewList = computed(() =>
|
|
38
|
+
props.files
|
|
39
|
+
.map((item: any) => {
|
|
40
|
+
if (imgSuffix.indexOf(item.suffix || '') >= 0) {
|
|
41
|
+
return item.shareUrl
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.filter((url) => url)
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 图片的样式
|
|
49
|
+
*/
|
|
50
|
+
const style = computed(() => {
|
|
51
|
+
return {
|
|
52
|
+
width: (props.size || 16) + 'px',
|
|
53
|
+
height: (props.size || 16) + 'px'
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 获取Icon
|
|
59
|
+
* @param item
|
|
60
|
+
*/
|
|
61
|
+
function getIcon(item: IOssInfo) {
|
|
62
|
+
let icon = iconMap[item.suffix || ''] || fileIcon
|
|
63
|
+
if (props.showImg) {
|
|
64
|
+
if (imgSuffix.indexOf(item.suffix || '') >= 0) {
|
|
65
|
+
return item.shareUrl
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return icon
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 处理点击事件
|
|
72
|
+
function handelPreview(file: IOssInfo) {
|
|
73
|
+
// console.log('preview: ', props.preview, file, previewList.value)
|
|
74
|
+
if (props.preview) {
|
|
75
|
+
// 如果是图片
|
|
76
|
+
if (imgSuffix.indexOf(file.suffix || '') >= 0) {
|
|
77
|
+
previewIndex.value = previewList.value.indexOf(file.shareUrl || file.furl)
|
|
78
|
+
showPreview.value = true
|
|
79
|
+
} else {
|
|
80
|
+
window.open(file.previewUrl || file.shareUrl || file.furl, '_blank')
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
<style lang="scss" scoped>
|
|
86
|
+
.file-icons-panel {
|
|
87
|
+
width: 100%;
|
|
88
|
+
|
|
89
|
+
.file-list {
|
|
90
|
+
width: 100%;
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
|
|
94
|
+
.file-item {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
align-items: center;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 28px;
|
|
100
|
+
line-height: 28px;
|
|
101
|
+
padding: 0 10px;
|
|
102
|
+
background: #f5f7fa;
|
|
103
|
+
margin-bottom: 10px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
font-weight: 400;
|
|
107
|
+
color: #303133;
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background: #e7e8eb;
|
|
111
|
+
color: var(--el-color-primary);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.file-name {
|
|
115
|
+
margin-left: 10px;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.card-list {
|
|
121
|
+
width: 100%;
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: row;
|
|
124
|
+
|
|
125
|
+
.file-item {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
align-items: center;
|
|
129
|
+
|
|
130
|
+
.file-name {
|
|
131
|
+
margin-top: 10px;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
137
|
+
types
|
|
@@ -106,7 +106,7 @@ import ColumnItem from './components/columnItem.vue'
|
|
|
106
106
|
import { handelListColumn } from './util'
|
|
107
107
|
import { cloneDeep } from 'lodash'
|
|
108
108
|
import { Loading } from '@element-plus/icons-vue'
|
|
109
|
-
import { ICRUDConfig, ITableConfig, ITableTabItem, ITreeProps } from 'types
|
|
109
|
+
import { ICRUDConfig, ITableConfig, ITableTabItem, ITreeProps } from 'types'
|
|
110
110
|
|
|
111
111
|
const defaultConf = inject('defaultConf') as ICRUDConfig
|
|
112
112
|
const format = inject('format') as any
|
|
@@ -804,3 +804,4 @@ defineExpose({ reload, tableData, changeSelect, resetSelect, initCol })
|
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
</style>
|
|
807
|
+
types
|