|
@@ -169,12 +169,13 @@ export default {
|
|
|
});
|
|
|
this.$emit("reloadList");
|
|
|
},
|
|
|
- handleError() {
|
|
|
+ handleError(error, file) {
|
|
|
window._hmt.push(["_trackEvent", "离线考试页面", "上传作答", "上传失败"]);
|
|
|
this.file = null;
|
|
|
this.loadingStatus = false;
|
|
|
+ console.log(error);
|
|
|
this.$Message.error({
|
|
|
- content: "上传失败",
|
|
|
+ content: file.desc || "上传失败",
|
|
|
duration: 15,
|
|
|
closable: true,
|
|
|
});
|
|
@@ -210,11 +211,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: "已有作答附件,是否覆盖?",
|
|
|
- onCancel: () => reject(-1),
|
|
|
- onOk: () => resolve(),
|
|
|
- });
|
|
|
+ if (this.course.offlineFileUrl) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "已有作答附件,是否覆盖?",
|
|
|
+ onCancel: () => reject(-1),
|
|
|
+ onOk: () => resolve(),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
}).then(() => {
|
|
|
if (file.type.includes("/pdf")) {
|
|
|
this.fileType = "pdf";
|