feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。 (#2045)

* style: 优化系统管理中账号、角色和部门表单样式

* feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。

Co-authored-by: 发光的卤蛋 <zdxndy@qq.com>
This commit is contained in:
fuling 2022-07-07 15:41:25 +08:00 committed by GitHub
parent 5833043d14
commit f1e8e241b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,11 @@
type: Number,
default: 8,
},
//
isReturnFile: {
type: Boolean,
default: false,
},
},
emits: ['success', 'error'],
setup(props, { emit }) {
@ -140,6 +145,10 @@
const files = e && (e.target as HTMLInputElement).files;
const rawFile = files && files[0]; // only setting files[0]
if (!rawFile) return;
if (props.isReturnFile) {
emit('success', rawFile);
return;
}
upload(rawFile);
}