用户导入添加验证提示

pull/1087/head
RuoYi 2025-08-23 11:14:45 +08:00
parent eed3ae8f80
commit 6c811c88c2
1 changed files with 5 additions and 0 deletions

View File

@ -546,6 +546,11 @@ export default {
},
//
submitFileForm() {
const file = this.$refs.upload.uploadFiles
if (!file || file.length === 0 || !file[0].name.toLowerCase().endsWith('.xls') && !file[0].name.toLowerCase().endsWith('.xlsx')) {
this.$modal.msgError("请选择后缀为 “xls”或“xlsx”的文件。")
return
}
this.$refs.upload.submit()
}
}