|
@@ -108,8 +108,8 @@
|
|
|
v-model:file-list="cardFileList"
|
|
v-model:file-list="cardFileList"
|
|
|
:auto-upload="false"
|
|
:auto-upload="false"
|
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
|
- :limit="1"
|
|
|
|
|
:on-preview="handlePreview"
|
|
:on-preview="handlePreview"
|
|
|
|
|
+ :on-change="onCardChange"
|
|
|
>
|
|
>
|
|
|
<el-icon><Plus /></el-icon>
|
|
<el-icon><Plus /></el-icon>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
@@ -241,6 +241,13 @@ const handlePreview = (file: UploadFile) => {
|
|
|
if (file.url) window.open(file.url)
|
|
if (file.url) window.open(file.url)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const onCardChange = (_file: UploadFile, uploadFiles: UploadFile[]) => {
|
|
|
|
|
+ if (uploadFiles.length > 1) {
|
|
|
|
|
+ const last = uploadFiles[uploadFiles.length - 1]
|
|
|
|
|
+ cardFileList.value = [last]
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const handleRegister = async () => {
|
|
const handleRegister = async () => {
|
|
|
const valid = await registerFormRef.value?.validate().catch(() => false)
|
|
const valid = await registerFormRef.value?.validate().catch(() => false)
|
|
|
if (!valid) return
|
|
if (!valid) return
|