11wqe1 há 7 meses atrás
pai
commit
c23d8b2e61

+ 56 - 62
src/components/pages/components/studentWorksDetail.vue

@@ -67,7 +67,7 @@
               </el-option>
             </el-select> -->
             <el-input style="width: 200px;" @change="searchWork2" v-model="uname" placeholder="请输入课程"></el-input>
-            <el-select
+            <!-- <el-select
               class="r_select"
               v-model="uClass"
               placeholder="请选择班级"
@@ -81,7 +81,7 @@
                 :value="item.classId"
               >
               </el-option>
-            </el-select>
+            </el-select> -->
             <!-- <el-select
               v-model="chooseDy"
               placeholder="请选择阶段"
@@ -152,45 +152,7 @@
             show-overflow-tooltip
           >
           </el-table-column>
-          <!-- <el-table-column
-            prop="course"
-            label="阶段"
-            min-width="20"
-            align="center"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <div>
-                <div v-if="scope.row.stage < dyList.length">
-                  {{ dyList[scope.row.stage].name ? dyList[scope.row.stage].name : scope.row.stage }}
-                </div>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="course"
-            label="任务"
-            min-width="20"
-            align="center"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <div>
-                <div v-if="scope.row.stage < dyList.length">
-                  <div v-if="scope.row.task < dyList[scope.row.stage].taskList.length">
-                    {{
-                      dyList.length > 0
-                        ? dyList[scope.row.stage].taskList[scope.row.task]
-                          ? dyList[scope.row.stage].taskList[scope.row.task].name
-                          : ""
-                        : ""
-                    }}
-                  </div>
-                </div>
-                
-              </div>
-            </template>
-          </el-table-column> -->
+
           <el-table-column
             prop="time"
             label="时间"
@@ -1947,8 +1909,33 @@ export default {
       this.getWorks();
     },
     lookWork(cid, uid) {
-      this.studentId = uid;
       this.cid = cid
+      this.studentId = uid;
+
+      let params = {
+        cid: cid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "getCourseWorksDyList", params)//getCourseWorksReport
+        .then((res) => {
+          var dyJSON = JSON.parse(res.data[0][0].chapters);
+          let dyList = [];
+          for (var i = 0; i < dyJSON.length; i++) {
+            dyList.push({ name: dyJSON[i].dyName, id: i, taskList: [] });
+            var a = dyJSON[i].chapterInfo[0].taskJson;
+            for (var j = 0; j < a.length; j++) {
+              dyList[i].taskList.push({ name: a[j].task, id: j });
+            }
+          }
+          this.dyList = dyList;
+          this.lookDyList(cid,uid)
+        
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    lookDyList(cid, uid){
       let params = {
         uid: uid,
         cid: cid
@@ -2633,7 +2620,7 @@ export default {
 
           this.courseDetail = res.data[0][0];
 
-          this.$forceUpdate();
+          this.$forceUpdate;
           this.dialogVisible3 = true;
           setTimeout(() => {
             for (var p = 0; p < res.data[0].length; p++) {
@@ -2682,9 +2669,6 @@ export default {
             this.dyList2[0].id + "-" + this.dyList2[0].taskList[0].id;
          
 				
-					this.$nextTick(()=>{
-						this.openTask(this.chooseDy?this.chooseDy:0,this.chooseTask?this.chooseTask:0,this.chooseDy?this.dyList2.findIndex(i=>i.id==this.chooseDy):0,this.chooseTask?this.dyList2[this.dyList2.findIndex(i=>i.id==this.chooseDy)].taskList.findIndex(i=>i.id==this.chooseTask):0)
-					})
         })
         .catch(err => {
           console.error(err);
@@ -3425,7 +3409,7 @@ export default {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.tableData = res.data[0];
-          this.classAarray=res.data[1];
+          // this.classAarray=res.data[1];
 
         })
         .catch(err => {
@@ -3502,7 +3486,7 @@ export default {
     updateWorks(stagetask, rateList, i) {
       var arr = stagetask.split("-");
       let params = {
-        cid: this.id,
+        cid: this.cid,
         s: arr[0],
         t: arr[1],
         rate: rateList,
@@ -3545,19 +3529,18 @@ export default {
       this.dyList2[s].isOpen = !this.dyList2[s].isOpen;
     },
     openTask(s, i, dyi, navi) {
-      console.log('openTask',s, i, dyi, navi);
       
       if (!this.dyList2[dyi].taskList[navi].isWork) {
         this.$message.warning("该任务暂时没提交作业");
       } else {
-        // var a = s + "-" + i;
-        // var b = document.getElementById(a);
-        // var d = b.getAttribute("scrollindex");
-        // var c = document.getElementsByClassName("shuBox")[0];
-        // c.scrollTop = parseInt(d) * 375;
-        // this.stageIndex = s;
-        // this.taskCount = i;
-        // this.navId = a;
+        var a = s + "-" + i;
+        var b = document.getElementById(a);
+        var d = b.getAttribute("scrollindex");
+        var c = document.getElementsByClassName("shuBox")[0];
+        c.scrollTop = parseInt(d) * 375;
+        this.stageIndex = s;
+        this.taskCount = i;
+        this.navId = a;
       }
     },
     async generate(a) {
@@ -4008,7 +3991,7 @@ export default {
 }
 
 .rate_size >>> .el-rate__icon {
-  font-size: 25px;
+  font-size: 22px;
 }
 
 .rate_size >>> .el-icon-star-off {
@@ -4387,7 +4370,7 @@ export default {
   display: flex;
   align-items: center;
 }
-.a_add_body >>> .el-radio__label {
+.a_add_body >>> .el-radio__label{
   font-size: 14px !important;
 }
 
@@ -4409,6 +4392,7 @@ export default {
   flex-wrap: wrap;
 }
 
+
 .redioStyle >>> .el-radio__label {
   font-size: 18px;
 }
@@ -4434,6 +4418,7 @@ export default {
   font-weight: 700;
 }
 
+
 .ask_Answer {
   /* margin-top: 10px; */
 }
@@ -4623,6 +4608,7 @@ export default {
   font-size: 28px !important;
 }
 
+
 .pfBox > div:nth-child(2) {
   background: #f7f6f9;
   min-height: 45px;
@@ -5225,10 +5211,18 @@ ol {
 }
 .radioBox {
   display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  align-items: center;
+  flex-direction: column;
+  flex-wrap: wrap;
+  /* align-items: center; */
+}
+.radioBox >>> .el-radio {
+  margin-bottom: 5px;
 }
+
+.radioBox >>> .el-checkbox {
+  margin-bottom: 5px;
+}
+
 .radioBox > div {
   margin: 10px 0 0 10px;
 }

+ 1 - 1
src/components/pages/works.vue

@@ -775,7 +775,7 @@ export default {
     this.page = 1;
 
     // this.getClass();
-    this.getAllStudent()
+    // this.getAllStudent()
     this.getEva();
     this.getProject();
   },