mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-26 12:48:48 +08:00
feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。 (#2045)
* style: 优化系统管理中账号、角色和部门表单样式 * feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。 Co-authored-by: 发光的卤蛋 <zdxndy@qq.com>
This commit is contained in:
parent
5833043d14
commit
f1e8e241b1
@ -31,6 +31,11 @@
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 8,
|
default: 8,
|
||||||
},
|
},
|
||||||
|
// 是否直接返回选中文件
|
||||||
|
isReturnFile: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['success', 'error'],
|
emits: ['success', 'error'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
@ -140,6 +145,10 @@
|
|||||||
const files = e && (e.target as HTMLInputElement).files;
|
const files = e && (e.target as HTMLInputElement).files;
|
||||||
const rawFile = files && files[0]; // only setting files[0]
|
const rawFile = files && files[0]; // only setting files[0]
|
||||||
if (!rawFile) return;
|
if (!rawFile) return;
|
||||||
|
if (props.isReturnFile) {
|
||||||
|
emit('success', rawFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
upload(rawFile);
|
upload(rawFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user