瀏覽代碼

作业查看

SanHQin 1 年之前
父節點
當前提交
0a16567e36
共有 1 個文件被更改,包括 46 次插入4 次删除
  1. 46 4
      src/components/pages/components/worksDetail2.vue

+ 46 - 4
src/components/pages/components/worksDetail2.vue

@@ -27,11 +27,31 @@
         <div class="student_search">
           <div>课程筛选</div>
           <div style="display: flex; width: 90%">
+
+
+						<el-select
+              class="r_select"
+              v-model="choseClass"
+              placeholder="请选择班级"
+							@change="changeClass"
+
+            >
+              <el-option label="所有班级" value></el-option>
+              <el-option
+                v-for="item in classArray"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+
             <el-select
               class="r_select"
               v-model="uname"
               placeholder="请选择学生"
               @change="searchWork2"
+							v-loading="studentLoading"
             >
               <el-option label="所有学生" value></el-option>
               <el-option
@@ -42,6 +62,7 @@
               >
               </el-option>
             </el-select>
+
             <el-select
               v-model="chooseDy"
               placeholder="请选择阶段"
@@ -1571,6 +1592,7 @@ export default {
     return {
       tableHeight: "500px",
       isLoading: false,
+			studentLoading:false,
       id: this.cid,
       userid: this.uid,
       oid: this.ooid,
@@ -1634,6 +1656,7 @@ export default {
       navId: "",
       chooseDy: "",
       uname: "",
+			choseClass:"",
       chooseTask: "",
       subjectJuri: [],
       projectJuri: [],
@@ -1788,6 +1811,7 @@ export default {
       dyList: [],
       dyList2: [],
       userAarray: [],
+			classArray:[],
       isPre: false,
       isNext: false,
       checkJson: [],
@@ -1827,6 +1851,10 @@ export default {
     });
   },
   methods: {
+		changeClass(){//切换班级
+			this.searchWork2();
+			this.getCourseDetail()
+		},
     previewImg(url) {
       this.$hevueImgPreview(url);
     },
@@ -2560,6 +2588,7 @@ export default {
               }
               this.setChart(_option, p);
             }
+						
           }, 0);
           let _dyList = JSON.parse(JSON.stringify(this.dyList));
           // let _dyList2 = [];
@@ -2611,7 +2640,10 @@ export default {
               this.isNext = false;
             }
           }
-
+				
+					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)
+					})
           // this.preStep();
           // this.nextStep();
         })
@@ -2634,11 +2666,13 @@ export default {
         const chartObj = _this.$echarts.init(
           //劳动课程
           // _this.$el.querySelector("#charts_canvas")
+					
           document.getElementsByClassName("charts_canvas")[k]
         );
         // 初始化雷达图
         _this.chartObj[k] = chartObj;
         _this.chartObj[k].setOption(option);
+
       });
     },
     giveScore() {
@@ -2740,16 +2774,18 @@ export default {
       let params = {
         cid: this.id,
         uname: this.uname,
+				choseClass:this.choseClass,
         stage: this.chooseDy,
         task: this.chooseTask,
         page: this.page,
       };
       this.ajax
-        .get(this.$store.state.api + "getCourseWorks3", params)
+        .get(this.$store.state.api + "getCourseWorks5", params) //getCourseWorks3
         .then((res) => {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.tableData = res.data[0];
+					this.classArray = res.data[1]
         })
         .catch((err) => {
           this.isLoading = false;
@@ -2761,11 +2797,12 @@ export default {
       let params = {
         cid: this.id,
         uname: this.uname,
+				choseClass:this.choseClass,
         stage: this.chooseDy,
         task: this.chooseTask,
       };
       this.ajax
-        .get(this.$store.state.api + "getCourseWorks4", params)
+        .get(this.$store.state.api + "getCourseWorks6", params) //getCourseWorks4
         .then((res) => {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
@@ -2777,11 +2814,13 @@ export default {
         });
     },
     getCourseDetail() {
+			this.studentLoading = true;
       let params = {
         cid: this.cid,
+				choseClass:this.choseClass
       };
       this.ajax
-        .get(this.$store.state.api + "getCourseWorksReport", params)
+        .get(this.$store.state.api + "getCourseWorksReport2", params)//getCourseWorksReport
         .then((res) => {
           this.course = res.data[0][0];
           var dyJSON = JSON.parse(res.data[0][0].chapters);
@@ -2793,6 +2832,7 @@ export default {
               dyList[i].taskList.push({ name: a[j].task, id: j });
             }
           }
+					this.studentLoading = false;
           this.dyList = dyList;
           this.userAarray = res.data[1];
           this.getWorks();
@@ -4145,6 +4185,7 @@ export default {
 .isClick {
   /* border: 3px solid #5f89d4; */
   border-radius: 5px;
+	font-weight: bold;
 }
 
 .thumbnail > div {
@@ -4783,6 +4824,7 @@ export default {
 
 .openTaskActive {
   color: #4386e6;
+	font-weight: bold;
 }
 
 .isClick {