From b5c2692aab8bf7844e4e55f03de28f390d598b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E7=A0=81-=E6=96=B9=E6=99=93=E8=BE=89?= Date: Mon, 2 Feb 2026 21:04:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AD=A6=E7=94=9F=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E9=80=89=E6=8B=A9=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=A6=86=E7=9B=96=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 beforeUpload 中调用 clearFiles() 清空文件列表, 实现"选择即覆盖"效果,无需手动删除再重新选择 同步更新需求文档 --- docs/01-需求文档/需求规格说明书_v1.0.md | 1 + .../src/views/business/student/components/ImportDialog.vue | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/01-需求文档/需求规格说明书_v1.0.md b/docs/01-需求文档/需求规格说明书_v1.0.md index 288b649..2b74ed2 100644 --- a/docs/01-需求文档/需求规格说明书_v1.0.md +++ b/docs/01-需求文档/需求规格说明书_v1.0.md @@ -831,6 +831,7 @@ | 3 | 导入时,同时需要检查用户手机号,如果系统中存在用户手机号,那么导入的学生就挂在当前用户下;如果系统中不存在对应的用户,自动创建当前手机号的用户,身份为家长,初始密码123456,并把学生信息挂在当前用户下 | | 4 | **教师身份校验**:如果会员手机号对应的会员身份为"教师",需校验教师与学生的归属关系一致(区域、学校、年级、班级),不一致则导入失败并提示原因 | | 5 | 教师未设置学校信息时,无法绑定学生,提示"教师未设置学校信息" | +| 6 | 重新选择文件时自动覆盖之前的文件记录,无需手动删除 | **表格列定义:** | 字段 | 说明 | diff --git a/frontend/ruoyi-ui/src/views/business/student/components/ImportDialog.vue b/frontend/ruoyi-ui/src/views/business/student/components/ImportDialog.vue index 7b245ae..2976d08 100644 --- a/frontend/ruoyi-ui/src/views/business/student/components/ImportDialog.vue +++ b/frontend/ruoyi-ui/src/views/business/student/components/ImportDialog.vue @@ -126,6 +126,9 @@ const handleDownloadTemplate = async () => { // 上传前校验 const beforeUpload = (file) => { + // 清空之前的文件列表,实现"选择即覆盖" + uploadRef.value?.clearFiles() + const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls') if (!isExcel) { ElMessage.error('只能上传 Excel 文件')