|
@@ -1006,6 +1006,7 @@
|
|
|
:auto-upload="false"
|
|
|
:limit="1"
|
|
|
:on-exceed="handleExceed"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
>
|
|
|
<div class="text-80px text-gray">
|
|
|
<i class="ri-upload-cloud-line" />
|
|
@@ -2608,6 +2609,15 @@ const divisionImportClick = ()=>{
|
|
|
divisionImportDialog.value = true
|
|
|
|
|
|
|
|
|
+}
|
|
|
+// 文件类型验证
|
|
|
+const beforeUpload = (file) => {
|
|
|
+ const extension = file.name.split('.').pop().toLowerCase()
|
|
|
+ if (!['xls', 'xlsx'].includes(extension)) {
|
|
|
+ window.$message.error('仅支持上传 .xls 或 .xlsx 格式的表格文件')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
}
|
|
|
const handleExceed = (files) => {
|
|
|
dialogUploadRef.value.clearFiles()
|