zengyicheng 2 년 전
부모
커밋
14555c84de
2개의 변경된 파일56개의 추가작업 그리고 138개의 파일을 삭제
  1. 1 2
      src/components/courseDetail.vue
  2. 55 136
      src/components/studyStudent.vue

+ 1 - 2
src/components/courseDetail.vue

@@ -464,8 +464,7 @@
                 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>

+ 55 - 136
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"
@@ -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,47 +7061,6 @@ 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) {
@@ -7116,74 +7075,34 @@ export default {
         this.$message.error("请上传文件");
         return;
       }
-      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);
+      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);
+        });
     },
+    
     addCourseWorksPl(i) {
       let _files = this.plworkFile;
       var c = 1;
@@ -10534,32 +10453,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 (