微调
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
<template #tip>
|
||||
<div>请上传xml文件</div>
|
||||
<div>请上传xml文件,文件名不能包含空格</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
@@ -92,6 +92,12 @@ const isValidFile = (file: UploadRawFile) => {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查文件名是否包含空格
|
||||
if (file.name.includes(' ')) {
|
||||
ElMessage.error('文件名不能包含空格,请重命名文件后再上传')
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
// 上传报告
|
||||
@@ -102,6 +108,14 @@ const handleExceed: UploadProps['onExceed'] = files => {
|
||||
uploadRef.value!.clearFiles()
|
||||
const file = files[0] as UploadRawFile
|
||||
file.uid = genFileId()
|
||||
|
||||
// 检查文件名是否包含空格
|
||||
if (file.name.includes(' ')) {
|
||||
ElMessage.error('文件名不能包含空格,请重命名文件后再上传')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
uploadRef.value!.handleStart(file)
|
||||
}
|
||||
|
||||
@@ -116,6 +130,13 @@ const submit = async () => {
|
||||
return ElMessage.warning('请上传icd文件')
|
||||
}
|
||||
if (reportPath.value[0]?.raw != undefined) {
|
||||
|
||||
// 检查文件名是否包含空格
|
||||
if (reportPath.value[0].raw.name.includes(' ')) {
|
||||
ElMessage.error('文件名不能包含空格,请重命名文件后再上传')
|
||||
return
|
||||
}
|
||||
|
||||
await uploadFile(reportPath.value[0].raw, '/icd/').then(res => {
|
||||
//治理工程验收报告
|
||||
form.fileName = res.data.fileName.split('.')[0]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
clearable
|
||||
placeholder="请输入任务名称"
|
||||
placeholder="请输入icd名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user