From e9fb58ac453bbc4c2434dab962ae4a04cfca5c9b Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 27 十一月 2024 20:23:25 +0800
Subject: [PATCH] 上传优化
---
src/views/student/components/upload-student.vue | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/src/views/student/components/upload-student.vue b/src/views/student/components/upload-student.vue
index abbaa1b..87b668e 100644
--- a/src/views/student/components/upload-student.vue
+++ b/src/views/student/components/upload-student.vue
@@ -64,6 +64,33 @@
this.hasAudience = false;
},
fatherMethod(res, type) {
+ this.progress = false;
+ if (res.success) {
+ var ojb = JSON.parse(res.message);
+ if (ojb.falseLst === null) {
+ this.$message.success("涓婁紶鏁版嵁鎴愬姛");
+ this.$emit("load-success");
+ } else if (ojb.falseLst.length >= 1) {
+ let errortips = "";
+ ojb.falseLst.map((item) => {
+ errortips += (
+ `${item.playerRoll}` +
+ `${item.cause} </div><div style='line-height: 1.5;'>`
+ ).replace("[]", "");
+ });
+ this.$message({
+ dangerouslyUseHTMLString: true,
+ message: `<div style='line-height: 1.5;'>瀵煎叆鏁版嵁鎴愬姛瀵煎叆${
+ res.successNum || 0
+ }鏉�,閿欒淇℃伅:</div><div style='line-height: 1.5;'>${errortips}</div>`,
+ type: "error",
+ duration: 6000,
+ showClose: true,
+ });
+ }
+ } else {
+ this.$message.error(res.message);
+ }
// if (res.falseLst === null) {
// this.$message.success("涓婁紶鏁版嵁鎴愬姛");
// this.$emit("load-success");
@@ -97,7 +124,8 @@
self.progressStatus = "success";
if (res.falseLst === null || res.falseLst.length === 0) {
self.$message.success("涓婁紶鏁版嵁鎴愬姛");
- self.$emit("load-success");x
+ self.$emit("load-success");
+ eventSource.close()
} else if (res.falseLst.length >= 1) {
let errortips = "";
res.falseLst.map((item) => {
@@ -124,7 +152,7 @@
eventSource.onerror = function (err) {
console.error("EventSource failed:", err);
eventSource.close();
- self.showUploadProcess()
+ self.showUploadProcess();
};
}, 3 * 1000);
},
--
Gitblit v1.8.0