Pre Merge pull request !354 from ccran/master

pull/354/MERGE
ccran 2023-12-29 15:06:09 +00:00 committed by Gitee
commit 1a787c314b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 8 deletions

View File

@ -117,12 +117,8 @@ const excelUploadError: UploadProps['onError'] = (): void => {
message.error('导入数据失败,请您重新上传!') message.error('导入数据失败,请您重新上传!')
} }
// //
const handleRemove = (file) => { const handleRemove = () => {
const findex = fileList.value.map((f) => f.name).indexOf(file.name) emitUpdateModelValue()
if (findex > -1) {
fileList.value.splice(findex, 1)
emitUpdateModelValue()
}
} }
const handlePreview: UploadProps['onPreview'] = (uploadFile) => { const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
console.log(uploadFile) console.log(uploadFile)
@ -137,13 +133,13 @@ watch(
if (isString(props.modelValue)) { if (isString(props.modelValue)) {
// 1.1 // 1.1
if (props.modelValue.includes(',')) { if (props.modelValue.includes(',')) {
files.concat(props.modelValue.split(',')) files.push(...props.modelValue.split(','))
} else if (props.modelValue.length > 0) { } else if (props.modelValue.length > 0) {
files.push(props.modelValue) files.push(props.modelValue)
} }
} else if (isArray(props.modelValue)) { } else if (isArray(props.modelValue)) {
// 2 // 2
files.concat(props.modelValue) files.push(...props.modelValue)
} else if (props.modelValue == null) { } else if (props.modelValue == null) {
// 3undefined // 3undefined
} else { } else {