From f1e8e241b1f1b981ea6fecb3a83cf8b8a64ca600 Mon Sep 17 00:00:00 2001 From: fuling <49261002+zdxzqwz@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:41:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ImportExcel=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=9B=B4=E6=8E=A5=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=96=B9=E4=BE=BF=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=A4=A7Excel=E6=96=87=E4=BB=B6=E3=80=82=20(?= =?UTF-8?q?#2045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: 优化系统管理中账号、角色和部门表单样式 * feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。 Co-authored-by: 发光的卤蛋 --- src/components/Excel/src/ImportExcel.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/Excel/src/ImportExcel.vue b/src/components/Excel/src/ImportExcel.vue index f6f742525..1c8a5f264 100644 --- a/src/components/Excel/src/ImportExcel.vue +++ b/src/components/Excel/src/ImportExcel.vue @@ -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); }