staging #36

Merged
hy merged 2 commits from staging into master 2025-11-28 10:36:37 +08:00
2 changed files with 14 additions and 4 deletions
Showing only changes of commit f1c155b95b - Show all commits

View File

@ -63,7 +63,7 @@
</div> </div>
<div v-show="!selectUser" class="toolbar-container"> <div v-show="!selectUser" class="toolbar-container">
<!-- 按钮组 --> <!-- 按钮组 -->
<el-button type="success" @click="importData">导入用户</el-button> <el-button type="success" @click="importData(ImportStudent)">导入用户</el-button>
<el-button type="default" @click="downLoadImportUsersTemplate" <el-button type="default" @click="downLoadImportUsersTemplate"
>下载学生模板</el-button >下载学生模板</el-button
> >
@ -692,7 +692,6 @@ const importUpdateStudent = () => {
}; };
const importData = (api = null) => { const importData = (api = null) => {
console.log("批量导入"); console.log("批量导入");
api = api ?? ImportStudent;
let fileE = document.createElement("input"); let fileE = document.createElement("input");
fileE.type = "file"; fileE.type = "file";
var formData = new window.FormData(); var formData = new window.FormData();
@ -719,7 +718,13 @@ const importData = (api = null) => {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
ElMessage.success("导入失败,已导出错误数据"); ElMessage.warning("导入失败,已导出错误数据");
ElMessage({
showClose: true,
type: "warning",
message: "导入失败,已导出错误数据.",
duration: 0,
});
}; };
try { try {
fileE.click(); fileE.click();

View File

@ -742,7 +742,12 @@ const importData = () => {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
ElMessage.success("导入失败,已导出错误数据"); ElMessage({
showClose: true,
type: 'warning',
message: '导入失败,已导出错误数据.',
duration: 0,
})
}; };
try { try {
fileE.click(); fileE.click();