zengyicheng 2 éve
szülő
commit
9e0eb4bac5
2 módosított fájl, 139 hozzáadás és 56 törlés
  1. 2 1
      src/components/courseDetail.vue
  2. 137 55
      src/components/studyStudent.vue

+ 2 - 1
src/components/courseDetail.vue

@@ -464,7 +464,8 @@
                 v-if="Object.keys(chaptersJson.time).length"
               >
                 <div class="title">
-                  <span class="frequencyIcon">活跃频率</span>
+                  <!-- <span class="frequencyIcon">活跃频率</span> -->
+                  <span class="frequencyIcon">作业频率</span>
                 </div>
                 <div class="box">
                   <div>

+ 137 - 55
src/components/studyStudent.vue

@@ -2129,8 +2129,8 @@
                           <div class="worksName">
                             <div
                               style="cursor: pointer"
-                              @click="openSname(w.sName, w.wid)"
                             >
+                              <!-- @click="openSname(w.sName, w.wid)" -->
                               {{ w.sName }}
                             </div>
                           </div>
@@ -6596,7 +6596,7 @@
         提交
       </div>
     </el-dialog>
-    <el-dialog
+    <!-- <el-dialog
       title="修改名称"
       :visible.sync="dialogVisibleSname"
       width="500px"
@@ -6604,7 +6604,7 @@
       class="dialog_diy"
       center
     >
-      <div style="text-align: center;">
+      <div style="text-align: center">
         <span class="tian1">名称</span>
         <el-input
           v-model="worksSName"
@@ -6615,7 +6615,7 @@
         <el-button @click="dialogVisibleSname = false">取 消</el-button>
         <el-button type="primary" @click="updateName">确 定</el-button>
       </span>
-    </el-dialog>
+    </el-dialog> -->
   </div>
 </template>
 
@@ -7061,6 +7061,47 @@ export default {
           console.error(err);
         });
     },
+    // addCourseWorks(i) {
+    //   var typesql;
+    //   if (this.fileType === 0) {
+    //     typesql = 1;
+    //   } else if (this.fileType === 1) {
+    //     typesql = 4;
+    //   } else {
+    //     typesql = 5;
+    //   }
+
+    //   if (!this.studyJuri[0].cover[0].url) {
+    //     this.$message.error("请上传文件");
+    //     return;
+    //   }
+    //   let params = [
+    //     {
+    //       uid: this.userid,
+    //       cid: this.id,
+    //       stage: this.courseType,
+    //       task: i,
+    //       tool: this.toolindex,
+    //       content: this.studyJuri[0].cover[0].url,
+    //       type: typesql,
+    //     },
+    //   ];
+    //   this.ajax
+    //     .post(this.$store.state.api + "addCourseWorksR", params)
+    //     .then((res) => {
+    //       this.$message({
+    //         message: "提交成功",
+    //         type: "success",
+    //       });
+    //       this.studyJuri[0].cover = [];
+    //       this.dialogVisible = false;
+    //       this.getCourseDetail();
+    //     })
+    //     .catch((err) => {
+    //       this.$message.error("提交失败");
+    //       console.error(err);
+    //     });
+    // },
     addCourseWorks(i) {
       var typesql;
       if (this.fileType === 0) {
@@ -7075,32 +7116,73 @@ export default {
         this.$message.error("请上传文件");
         return;
       }
-      let params = [
-        {
-          uid: this.userid,
-          cid: this.id,
-          stage: this.courseType,
-          task: i,
-          tool: this.toolindex,
-          content: this.studyJuri[0].cover[0].url,
-          type: typesql,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "addCourseWorksR", params)
-        .then((res) => {
-          this.$message({
-            message: "提交成功",
-            type: "success",
+      if (this.workTypeA == true) {
+        this.$confirm(
+          "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!",
+          "提示",
+          {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          }
+        )
+          .then(() => {
+            let params = [
+              {
+                uid: this.userid,
+                cid: this.id,
+                stage: this.courseType,
+                task: i,
+                tool: this.toolindex,
+                content: this.studyJuri[0].cover[0].url,
+                type: typesql,
+              },
+            ];
+            this.ajax
+              .post(this.$store.state.api + "addCourseWorks", params)
+              .then((res) => {
+                this.$message({
+                  message: "提交成功",
+                  type: "success",
+                });
+                this.studyJuri[0].cover = [];
+                this.dialogVisible = false;
+                this.getCourseDetail();
+              })
+              .catch((err) => {
+                this.$message.error("提交失败");
+                console.error(err);
+              });
+          })
+          .catch(() => {});
+      } else {
+        let params = [
+          {
+            uid: this.userid,
+            cid: this.id,
+            stage: this.courseType,
+            task: i,
+            tool: this.toolindex,
+            content: this.studyJuri[0].cover[0].url,
+            type: typesql,
+          },
+        ];
+        this.ajax
+          .post(this.$store.state.api + "addCourseWorks", params)
+          .then((res) => {
+            this.$message({
+              message: "提交成功",
+              type: "success",
+            });
+            this.studyJuri[0].cover = [];
+            this.dialogVisible = false;
+            this.getCourseDetail();
+          })
+          .catch((err) => {
+            this.$message.error("提交失败");
+            console.error(err);
           });
-          this.studyJuri[0].cover = [];
-          this.dialogVisible = false;
-          this.getCourseDetail();
-        })
-        .catch((err) => {
-          this.$message.error("提交失败");
-          console.error(err);
-        });
+      }
     },
     addCourseWorksPl(i) {
       let _files = this.plworkFile;
@@ -10452,32 +10534,32 @@ export default {
       this.fulltype = type;
       this.fullUrl = url;
     },
-    openSname(n, id) {
-      this.snameWid = id;
-      this.worksSName = n;
-      this.dialogVisibleSname = true;
-    },
-    updateName() {
-      let params = {
-        n: this.worksSName,
-        cid: this.snameWid,
-      };
-      this.ajax
-        .get(this.$store.state.api + "updateCourseWorksName", params)
-        .then((res) => {
-          this.$message({
-            message: "修改成功",
-            type: "success",
-          });
-          this.dialogVisibleSname = false;
-          this.getCourseDetail();
-          this.snameWid = "";
-          this.worksSName = "";
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
+    // openSname(n, id) {
+    //   this.snameWid = id;
+    //   this.worksSName = n;
+    //   this.dialogVisibleSname = true;
+    // },
+    // updateName() {
+    //   let params = {
+    //     n: this.worksSName,
+    //     cid: this.snameWid,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "updateCourseWorksName", params)
+    //     .then((res) => {
+    //       this.$message({
+    //         message: "修改成功",
+    //         type: "success",
+    //       });
+    //       this.dialogVisibleSname = false;
+    //       this.getCourseDetail();
+    //       this.snameWid = "";
+    //       this.worksSName = "";
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
     downloadFile(url) {
       let _url = "";
       if (