Kaynağa Gözat

修改上传选择题功能

zengyicheng 3 yıl önce
ebeveyn
işleme
068b0f77d3
1 değiştirilmiş dosya ile 9 ekleme ve 3 silme
  1. 9 3
      src/components/liveProjectDetail.vue

+ 9 - 3
src/components/liveProjectDetail.vue

@@ -775,7 +775,7 @@ export default {
         // this.steps = 2;
         this.isAnswer = true;
         this.addWork(1);
-        this.dialogVisible = true;
+        // this.dialogVisible = true;
       } else {
         this.$message.error("至少选择一个答案!");
       }
@@ -940,7 +940,7 @@ export default {
       //   this.$message.error("请填写简要描述");
       //   return;
       // }
-      if (this.isNoHomeWork == true) {
+      if (this.isNoHomeWork == true || this.isAnswer == true) {
         this.$confirm(
           "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!",
           "提示",
@@ -964,6 +964,8 @@ export default {
         a = JSON.stringify(this.upload);
       } else if (type == 6) {
         a = JSON.stringify(this.rateList);
+      } else if (type == 1) {
+        a = JSON.stringify(this.typeC);
       }
       let params = {
         uid: this.userid,
@@ -1001,7 +1003,11 @@ export default {
         .get(this.$store.state.api + "selectSWork", params)
         .then((res) => {
           if (res.data[0].length > 0) {
-            this.isNoHomeWork = true;
+            if (res.data[0].type == 1) {
+              this.isAnswer = true;
+            } else {
+              this.isNoHomeWork = true;
+            }
           }
         })
         .catch((err) => {