|
@@ -16,9 +16,17 @@ defineExpose({
|
|
|
const uploadFileList = ref()
|
|
const uploadFileList = ref()
|
|
|
|
|
|
|
|
const changeFileList = (file: any, fileList: any) => {
|
|
const changeFileList = (file: any, fileList: any) => {
|
|
|
|
|
+ if (file.size / 1024 / 1024 > 25) {
|
|
|
|
|
+ const index = fileList.findIndex((item: any) => item.uid === file.uid)
|
|
|
|
|
+ if (index !== -1) {
|
|
|
|
|
+ fileList.splice(index, 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
// 给当前文件添加fileType属性
|
|
// 给当前文件添加fileType属性
|
|
|
file.raw.fileType = fileType.value
|
|
file.raw.fileType = fileType.value
|
|
|
uploadFileList.value = fileList
|
|
uploadFileList.value = fileList
|
|
|
|
|
+ console.log('change', fileList)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function bytesToKB(bytes: number) {
|
|
function bytesToKB(bytes: number) {
|
|
@@ -225,8 +233,8 @@ const uploadFileParams = computed(() => ({
|
|
|
:deep(.el-upload-dragger) {
|
|
:deep(.el-upload-dragger) {
|
|
|
padding-top: 19px;
|
|
padding-top: 19px;
|
|
|
padding-bottom: 19px;
|
|
padding-bottom: 19px;
|
|
|
- background-color: #fef8f2;
|
|
|
|
|
- border: 1px dashed #f5b279;
|
|
|
|
|
|
|
+ background-color: var(--color-upload-file-bg);
|
|
|
|
|
+ border: 1px dashed var(--color-upload-file-border-bg);
|
|
|
}
|
|
}
|
|
|
.el-upload-text {
|
|
.el-upload-text {
|
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|
|
@@ -241,7 +249,7 @@ const uploadFileParams = computed(() => ({
|
|
|
transform: translateY(2px);
|
|
transform: translateY(2px);
|
|
|
}
|
|
}
|
|
|
span {
|
|
span {
|
|
|
- color: var(--color-neutral-3);
|
|
|
|
|
|
|
+ color: var(--color-upload-file-color);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|