11wqe1 11 months ago
parent
commit
6be9db312d

+ 3 - 4
src/components/pages/components/studentReport.vue

@@ -1,12 +1,11 @@
 <template>
   <div style="width: 100%; height: 100%">
     <div class="sr_head">
-      <el-button v-if="seatNum > 0" type="primary" size="small" @click="upStu">上一位</el-button>
       学生成长报告
-      <el-button v-if="seatNum < studentList.length-1" type="primary" style="margin-left: 0;" size="small" @click="nextStu">下一位</el-button>
-
       <div class="sr_headBtnS">
-        <el-button type="primary" size="small" @click="downloadFile('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/student01-%E5%AD%A6%E7%94%9F%E6%88%90%E9%95%BF%E6%8A%A5%E5%91%8A1719315423787.pdf');">导出报告</el-button>
+        <el-button v-if="seatNum > 0" type="primary" size="small" @click="upStu">上一位</el-button>
+        <el-button  style="margin-left: 10px;" v-if="seatNum < studentList.length-1" type="primary" size="small" @click="nextStu">下一位</el-button>
+        <el-button style="margin-left: 10px;" type="primary" size="small" @click="downloadFile('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/student01-%E5%AD%A6%E7%94%9F%E6%88%90%E9%95%BF%E6%8A%A5%E5%91%8A1719315423787.pdf');">导出报告</el-button>
         <el-button style="margin-left: 10px;" @click="pageBack" type="primary" size="small">返回</el-button>
       </div>
       

+ 49 - 6
src/components/pages/components/workData.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
     <div class="cp_title" v-if="false">
-      <span>{{ this.dataJson.title }}</span>
+      <span>{{ dataJson.title }}</span>
     </div>
     <div class="cp_title" v-if="false">
-      <span>{{ "教师姓名:" + this.dataJson.uname }}</span>
+      <span>{{ "教师姓名:" + dataJson.uname }}</span>
     </div>
     <div class="data_body" v-if="false">
       <div class="data_c">
@@ -165,8 +165,32 @@
               </span>
               <div style="font-weight: 600;color: rgba(0, 0, 0, 0.9);">查看作业</div>
             </div>
-            <div style="width:94%;margin: 0 auto;font-size: 26px;">{{ dataJson.title }}</div>
-            <WorksDetail2 :cid="cid" :uid="uid" :ooid="ooid"></WorksDetail2>
+            <div class="JsonTit">
+              <div style="width:94%;margin: 0 auto;font-size: 26px;">{{ dataJson.title }}</div>
+              <div class="JsonTitBtn" v-if="dialogVisible">
+                <el-button @click="exportData" type="primary" size="small"
+                  >自定义导出</el-button
+                >
+                <el-button style="margin-left: 20px;" @click="retPage" type="primary" size="small">返回</el-button>
+                <!-- <el-button
+                  type="primary"
+                  size="small"
+                  @click="
+                    goTo(
+                      '/worksDetail?cid=' +
+                        dataJson.courseId +
+                        '&userid=' +
+                        userid +
+                        '&oid=' +
+                        oid
+                    )
+                  "
+                  >查看作业</el-button
+                >-->
+              </div>
+            </div>
+            <!-- <div style="width:94%;margin: 0 auto;font-size: 26px;">{{ dataJson.title }}</div> -->
+            <WorksDetail2 :DState="dataJson.state" :cid="cid" :uid="uid" :ooid="ooid"></WorksDetail2>
             <!-- <el-table
               ref="table"
               :data="tableData"
@@ -205,7 +229,7 @@ import ScoreData from "./data/scoreData";
 import WorksDetail2 from "./worksDetail2";
 
 export default {
-  props: ["dataJson", "cid", "uid", "ooid","dialogVisible"],
+  props: ["dataJson", "cid", "uid", "ooid","dialogVisible","dialogVisibleBao"],
   components: {
     WorkData,
     ProblelmData,
@@ -547,8 +571,15 @@ export default {
         return "";
       }
     },
-    pageBack(){
+    retPage(){
       console.log('666');
+      this.$emit('cancel');
+    },
+    exportData(){
+      this.$emit("update:dialogVisibleBao", true);
+    },
+    pageBack(){
+      // console.log('666');
       
       this.$emit("update:dialogVisible", false);
     },
@@ -1024,4 +1055,16 @@ export default {
 .el-table >>> .even_row {
   background-color: #f1f1f1;
 }
+.JsonTit{
+  width: 100%;
+  padding: 20px 0;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+}
+.JsonTitBtn{
+  display: flex;
+  align-items: center;
+}
 </style>

+ 575 - 119
src/components/pages/components/worksDetail2.vue

@@ -4,7 +4,6 @@
       class="pb_content_body"
       style="
         background: #fff;
-        padding: 25px 0 0;
         box-sizing: border-box;
         border-radius: 5px;
       "
@@ -67,6 +66,7 @@
               v-model="chooseDy"
               placeholder="请选择阶段"
               @change="searchWork1"
+              v-if="DState == 1"
             >
               <el-option label="所有阶段" value></el-option>
               <el-option
@@ -80,6 +80,7 @@
               v-model="chooseTask"
               placeholder="请选择任务"
               @change="searchWork2"
+              v-if="DState == 1"
             >
               <el-option label="所有任务" value></el-option>
               <el-option
@@ -91,6 +92,26 @@
                 :value="item.id"
               ></el-option>
             </el-select>
+
+            <el-select
+              v-model="chooseTask"
+              placeholder="请选择任务"
+              @change="searchWork2"
+              v-else
+            >
+              <el-option label="所有任务" value></el-option>
+              <el-option
+                v-for="(item, index) in dyList[0]
+                  ? dyList[0].taskList
+                  : []"
+                :key="index+'a'"
+                :label="item.name"
+                :value="item.id"
+
+              ></el-option>
+            </el-select>
+
+            
             <div class="typeCheck">
               <el-switch v-model="typeCheck"></el-switch
               ><span>查看所有学生</span>
@@ -99,7 +120,14 @@
         </div>
       </div>
     </div>
+   <!-- {{ dyList[0] }} -->
     <div class="pb_content_body">
+      <div class="cutTab">
+        <div :class="[cutTabNum == 0 ? 'ctrlBtn2' : 'ctrlBtn']"  @click="cutTabData(0)">按学生查看</div>
+        <div v-if="DState == 1" :class="[cutTabNum ==1 ? 'ctrlBtn2' : 'ctrlBtn']" @click="cutTabData(1)">按阶段查看</div>
+        <div :class="[cutTabNum == 2  ? 'ctrlBtn2' : 'ctrlBtn']" @click="cutTabData(2)">按任务查看</div>
+
+      </div>
       <div class="student_table">
         <el-table
           ref="table"
@@ -112,6 +140,7 @@
           :header-cell-style="{ background: '#f1f1f1' }"
           :row-class-name="tableRowClassName"
           stripe
+          v-if="cutTabNum ==0"
         >
           <el-table-column
             prop="sName"
@@ -143,10 +172,14 @@
             min-width="20"
             align="center"
             show-overflow-tooltip
+            v-if="DState == 1"
           >
             <template slot-scope="scope">
               <div>
-                {{ dyList.length > 0 ? dyList[!scope.row.stage ? 0 : scope.row.stage ].name : "" }}
+                {{ dyList[scope.row.stage].name ? dyList[scope.row.stage].name : scope.row.stage }}
+
+                <!-- {{ dyList.length > 0 ? dyList[!scope.row.stage ? 0 : scope.row.stage ].name : "" }} -->
+                <!-- {{ scope.row.stage,dyList }} -->
               </div>
             </template>
           </el-table-column>
@@ -208,6 +241,196 @@
             </template>
           </el-table-column>
         </el-table>
+
+        <el-table
+          ref="table"
+          :data="tableData"
+          border
+          :height="tableHeight"
+          :fit="true"
+          v-loading="isLoading"
+          style="width: 100%"
+          :header-cell-style="{ background: '#f1f1f1' }"
+          :row-class-name="tableRowClassName"
+          stripe
+          v-if="cutTabNum == 1"
+        >
+          <el-table-column
+            prop="sName"
+            label="姓名"
+            min-width="15"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            prop="class"
+            label="班级"
+            min-width="20"
+            align="center"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.class ? scope.row.class : "暂无班级" }}</div>
+            </template>
+          </el-table-column>
+         
+          <el-table-column
+            prop="course"
+            label="阶段"
+            min-width="20"
+            align="center"
+            show-overflow-tooltip
+            v-if="DState == 1"
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ dyList[scope.row.stage].name ? dyList[scope.row.stage].name : scope.row.stage }}
+
+                <!-- {{ dyList.length > 0 ? dyList[!scope.row.stage ? 0 : scope.row.stage ].name : "" }} -->
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="course"
+            label="任务"
+            min-width="20"
+            align="center"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <div>
+                {{
+                  dyList.length > 0
+                    ? dyList[!scope.row.stage ? 0 : scope.row.stage].taskList[!scope.row.task ? 0 : scope.row.task]
+                      ? dyList[!scope.row.stage ? 0 : scope.row.stage].taskList[!scope.row.task ? 0 : scope.row.task].name
+                      : ""
+                    : ""
+                }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="time"
+            label="时间"
+            width="100px"
+            align="center" 
+          ></el-table-column>
+          <el-table-column align="center" label="操作" width="260px">
+            <template slot-scope="scope">
+              <el-button
+                type="primary"
+                size="small"
+                @click="
+                  lookWork(scope.row.id, scope.row.userid, 0, scope.$index)
+                "
+                >查看&批改</el-button
+              >
+              <el-button
+                type="primary"
+                size="small"
+                @click="
+                  lookWork2(scope.row.id, scope.row.userid, scope.row.courseid)
+                "
+                >导出作业</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-table
+          ref="table"
+          :data="tableData"
+          border
+          :height="tableHeight"
+          :fit="true"
+          v-loading="isLoading"
+          style="width: 100%"
+          :header-cell-style="{ background: '#f1f1f1' }"
+          :row-class-name="tableRowClassName"
+          stripe
+          v-if="cutTabNum == 2"
+        >
+          <el-table-column
+            prop="sName"
+            label="阶段"
+            min-width="15"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            prop="class"
+            label="班级"
+            min-width="20"
+            align="center"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.class ? scope.row.class : "暂无班级" }}</div>
+            </template>
+          </el-table-column>
+         
+          <el-table-column
+            prop="course"
+            label="阶段"
+            min-width="20"
+            align="center"
+            show-overflow-tooltip
+            v-if="DState == 1"
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ dyList[scope.row.stage].name ? dyList[scope.row.stage].name : scope.row.stage }}
+
+                <!-- {{ dyList.length > 0 ? dyList[!scope.row.stage ? 0 : scope.row.stage ].name : "" }} -->
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="course"
+            label="任务"
+            min-width="20"
+            align="center"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <div>
+                {{
+                  dyList.length > 0
+                    ? dyList[!scope.row.stage ? 0 : scope.row.stage].taskList[!scope.row.task ? 0 : scope.row.task]
+                      ? dyList[!scope.row.stage ? 0 : scope.row.stage].taskList[!scope.row.task ? 0 : scope.row.task].name
+                      : ""
+                    : ""
+                }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="time"
+            label="时间"
+            width="100px"
+            align="center" 
+          ></el-table-column>
+          <el-table-column align="center" label="操作" width="260px">
+            <template slot-scope="scope">
+              <el-button
+                type="primary"
+                size="small"
+                @click="
+                  lookWork(scope.row.id, scope.row.userid, 0, scope.$index)
+                "
+                >查看&批改</el-button
+              >
+              <el-button
+                type="primary"
+                size="small"
+                @click="
+                  lookWork2(scope.row.id, scope.row.userid, scope.row.courseid)
+                "
+                >导出作业</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+
+
+
         <el-dialog
           title="查看作业"
           :visible.sync="dialogVisible3"
@@ -219,7 +442,7 @@
           v-loading="worksLoading"
         >
           <div slot="title" class="header-title">
-            <div style="color: #fff">查看作业</div>
+            <div style="color: #fff">查看&批改</div>
             <!-- <div style="position: absolute; top: 14px; right: 50px">
               <img
                 src="../../../assets/full.png"
@@ -521,12 +744,14 @@
                                 display: flex;
                                 flex-direction: row;
                                 align-items: center;
-                                justify-content: center;
+                                /* justify-content: center; */
                                 flex-wrap: wrap;
+                                margin-top: 10px;
+                                font-size: 16px;
                               "
                             >
-                              <div style="margin-right: 20px">标题:</div>
-                              <div style="font-size: 20px">
+                              <div style="margin-right: 10px">标题:</div>
+                              <div>
                                 {{
                                   worksDetail[sIndex].askInfo[0].askInfo.askJson
                                     .askTitle
@@ -1478,6 +1703,7 @@
           layout="prev, pager, next"
           :page-size="10"
           :total="total"
+          :current-page.sync="page"
           v-if="page"
           @current-change="handleCurrentChange"
         ></el-pagination>
@@ -1598,7 +1824,7 @@ export default {
     StudentData,
     pdf,
   },
-  props: ["cid", "uid", "ooid"],
+  props: ["cid", "uid", "ooid","DState"],
   data() {
     return {
       tableHeight: "500px",
@@ -1828,7 +2054,8 @@ export default {
       checkJson: [],
       typeCheck: false,
       word2: require("../../../assets/icon/word2.png"),
-      worksLoading:false
+      worksLoading:false,
+      cutTabNum:0
     };
   },
   computed: {
@@ -1853,10 +2080,28 @@ export default {
       this.isLoading = true;
       this.tableData = [];
       if (newValue) {
-        this.getWorks1();
+        if (this.cutTabNum==0) {
+          this.getWorks1();
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks2()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks2()
+        }
       } else {
         this.page = 1;
-        this.getWorks();
+
+        if (this.cutTabNum==0) {
+          this.getWorks()
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks()
+        }
+        // this.getWorks();
       }
     },
   },
@@ -1879,6 +2124,122 @@ export default {
     });
   },
   methods: {
+    cutTabData(val){
+      this.cutTabNum = val;
+      this.page = 1;
+      
+      if (this.typeCheck) {
+        if (val==0) {
+          this.getWorks1()
+        }
+        if (val==1) {
+          this.getStageWorks2()
+        }
+        if (val==2) {
+          this.getTaskWorks2()
+        }
+      }else{
+        if (val==0) {
+         this.getWorks()
+        }
+        if (val==1) {
+          this.getStageWorks()
+        }
+        if (val==2) {
+          this.getTaskWorks()
+        }
+      }
+
+      
+    },
+    getStageWorks(){
+      this.isLoading = true;
+      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 + "getCourseStageWorks", 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;
+          console.error(err);
+        });
+    },
+    getStageWorks2(){
+      this.isLoading = true;
+      let params = {
+        cid: this.id,
+        uname: this.uname,
+				choseClass:this.choseClass,
+        stage: this.chooseDy,
+        task: this.chooseTask
+      };
+      this.ajax
+        .get(this.$store.state.api + "getCourseStageWorks2", 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];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    getTaskWorks(){
+      this.isLoading = true;
+      let params = {
+        cid: this.id,
+        uname: this.uname,
+				choseClass:this.choseClass,
+        stage:this.DState!=1 ? 0 : this.chooseDy,
+        task: this.chooseTask,
+        page: this.page,
+      };
+      this.ajax
+        .get(this.$store.state.api + "getCourseTaskWorks", 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;
+          console.error(err);
+        });
+    },
+    getTaskWorks2(){
+      this.isLoading = true;
+      let params = {
+        cid: this.id,
+        uname: this.uname,
+				choseClass:this.choseClass,
+        stage:this.DState!=1 ? 0 : this.chooseDy,
+        task: this.chooseTask
+      };
+      this.ajax
+        .get(this.$store.state.api + "getCourseTaskWorks2", 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];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     getPdf(){
       this.worksLoading = true
       let domHeight = this.$refs.reportPdf.offsetHeight;
@@ -1958,7 +2319,16 @@ export default {
     },
     handleCurrentChange(val) {
       this.page = val;
-      this.getWorks();
+      if (this.cutTabNum==0) {
+        this.getWorks()
+      }
+      if (this.cutTabNum==1) {
+        this.getStageWorks()
+      }
+      if (this.cutTabNum==2) {
+        this.getTaskWorks()
+      }
+      // this.getWorks();
     },
     lookWork(id, uid, type, index) {
       this.scopeId1 = id;
@@ -2076,107 +2446,107 @@ export default {
               };
             }
             workJson[stagetask].time = res.data[0][k].time;
-            // for (var i = 0; i < askInfo.length; i++) {
-            //   if (
-            //     res.data[0][k].stage == askInfo[i].stage &&
-            //     res.data[0][k].task == askInfo[i].task &&
-            //     res.data[0][k].tool == askInfo[i].tool
-            //   ) {
-            //     const element = askInfo[i];
-            //     let a = JSON.parse(element.content)[0];
-            //     let e = [];
-            //     for (var y = 0; y < a.askJson.length; y++) {
-            //       if (a.askJson[y].type == "2") {
-            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-            //       } else {
-            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-            //       }
-            //     }
-            //     a.radio = e;
-            //     workJson[stagetask].askInfo.push({
-            //       askInfo: a,
-            //       score: askInfo[i].score
-            //         ? JSON.parse(askInfo[i].score).wScore
-            //         : askInfo[i].score,
-            //     });
-            //     // checkJson[stagetask].allRight = 0;
-            //     checkJson[stagetask].allRight = 0
-            //     var isCount = 0;
-            //     for (var p = 0; p < a.radio.length; p++) {
-            //       if (!checkJson[stagetask][p]) {
-            //         checkJson[stagetask][p] = {
-            //           checkCount: [],
-            //           checkPerson: [],
-            //         };
-            //       }
-            //       if (!checkJson[stagetask][p].checkCount.length) {
-            //         checkJson[stagetask][p].checkCount = [];
-            //         let _askItemCount = a.askJson[p].askCount;
-            //         for (var aic = 0; aic < _askItemCount; aic++) {
-            //           checkJson[stagetask][p].checkCount.push(0);
-            //         }
-            //       }
-            //       if (a.radio[p] instanceof Array) {
-            //         if (
-            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-            //             .sort()
-            //             .join(",") == a.radio[p].sort().join(",")
-            //         ) {
-            //           checkJson[stagetask][p].right = 100;
-            //           isCount += checkJson[stagetask][p].right;
-            //         } else {
-            //           checkJson[stagetask][p].right = 0;
-            //           isCount += 0;
-            //         }
-            //         for (var q = 0; q < a.radio[p].length; q++) {
-            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
-            //             ? checkJson[stagetask][p].checkPerson[
-            //                 parseInt(a.radio[p][q])
-            //               ].push(res.data[0][k].sName)
-            //             : (checkJson[stagetask][p].checkPerson[
-            //                 parseInt(a.radio[p][q])
-            //               ] = [res.data[0][k].sName]);
-            //               checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
-            //             ? checkJson[stagetask][p].checkCount[
-            //                 parseInt(a.radio[p][q])
-            //               ]++
-            //             : (checkJson[stagetask][p].checkCount[
-            //                 parseInt(a.radio[p][q])
-            //               ] = 1);
-            //         }
-            //       } else {
-            //         if (
-            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
-            //             .answer == a.radio[p]
-            //         ) {
-            //           checkJson[stagetask][p].right = 100;
-            //           isCount += checkJson[stagetask][p].right;
-            //         } else {
-            //           checkJson[stagetask][p].right = 0;
-            //           isCount += 0;
-            //         }
-            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
-            //             ? checkJson[stagetask][p].checkPerson[
-            //                 parseInt(a.radio[p])
-            //               ].push(res.data[0][k].sName)
-            //             : (checkJson[stagetask][p].checkPerson[
-            //                 parseInt(a.radio[p])
-            //               ] = [res.data[0][k].sName]);
-            //               checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
-            //             ? checkJson[stagetask][p].checkCount[
-            //                 parseInt(a.radio[p])
-            //               ]++
-            //             : (checkJson[stagetask][p].checkCount[
-            //                 parseInt(a.radio[p])
-            //               ] = 1);
-            //         }
-            //       }
-            //     }
-            //     checkJson[stagetask].allRight = isCount / a.radio.length;
-            //   }
-            // }
-            console.log(checkJson);
+            for (var i = 0; i < askInfo.length; i++) {
+              if (
+                res.data[0][k].stage == askInfo[i].stage &&
+                res.data[0][k].task == askInfo[i].task &&
+                res.data[0][k].tool == askInfo[i].tool
+              ) {
+                const element = askInfo[i];
+                let a = JSON.parse(element.content)[0];
+                let e = [];
+                for (var y = 0; y < a.askJson.length; y++) {
+                  if (a.askJson[y].type == "2") {
+                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+                  } else {
+                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+                  }
+                }
+                a.radio = e;
+                workJson[stagetask].askInfo.push({
+                  askInfo: a,
+                  score: askInfo[i].score
+                    ? JSON.parse(askInfo[i].score).wScore
+                    : askInfo[i].score,
+                });
+                // checkJson[stagetask].allRight = 0;
+                checkJson[stagetask].allRight = 0
+                var isCount = 0;
+                for (var p = 0; p < a.radio.length; p++) {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
+                      checkCount: [],
+                      checkPerson: [],
+                    };
+                  }
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
+                    let _askItemCount = a.askJson[p].askCount;
+                    for (var aic = 0; aic < _askItemCount; aic++) {
+                      checkJson[stagetask][p].checkCount.push(0);
+                    }
+                  }
+                  if (a.radio[p] instanceof Array) {
+                    if (
+                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+                        .sort()
+                        .join(",") == a.radio[p].sort().join(",")
+                    ) {
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
+                    } else {
+                      checkJson[stagetask][p].right = 0;
+                      isCount += 0;
+                    }
+                    for (var q = 0; q < a.radio[p].length; q++) {
+                      checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
+                            parseInt(a.radio[p][q])
+                          ].push(res.data[0][k].sName)
+                        : (checkJson[stagetask][p].checkPerson[
+                            parseInt(a.radio[p][q])
+                          ] = [res.data[0][k].sName]);
+                          checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
+                            parseInt(a.radio[p][q])
+                          ]++
+                        : (checkJson[stagetask][p].checkCount[
+                            parseInt(a.radio[p][q])
+                          ] = 1);
+                    }
+                  } else {
+                    if (
+                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
+                        .answer == a.radio[p]
+                    ) {
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
+                    } else {
+                      checkJson[stagetask][p].right = 0;
+                      isCount += 0;
+                    }
+                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+                      checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
+                            parseInt(a.radio[p])
+                          ].push(res.data[0][k].sName)
+                        : (checkJson[stagetask][p].checkPerson[
+                            parseInt(a.radio[p])
+                          ] = [res.data[0][k].sName]);
+                          checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
+                            parseInt(a.radio[p])
+                          ]++
+                        : (checkJson[stagetask][p].checkCount[
+                            parseInt(a.radio[p])
+                          ] = 1);
+                    }
+                  }
+                }
+                checkJson[stagetask].allRight = isCount / a.radio.length;
+              }
+            }
+            // console.log(checkJson);
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -2638,10 +3008,11 @@ export default {
           }
 
           this.worksDetail = result;
-          console.log('this.worksDetail',this.worksDetail);
+          // console.log('this.worksDetail',this.worksDetail);
 
 
           this.courseDetail = res.data[0][0];
+// console.log('this.courseDetail',);
 
           this.$forceUpdate;
           this.dialogVisible3 = true;
@@ -2836,11 +3207,66 @@ export default {
     searchWork1() {
       this.page = 1;
       this.chooseTask = "";
-      this.getWorks();
+      if (this.typeCheck) {
+        if (this.cutTabNum==0) {
+          this.getWorks1()
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks2()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks2()
+        }
+      }else{
+        if (this.cutTabNum==0) {
+          this.getWorks()
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks()
+        }
+      }
+
+      // if (this.cutTabNum==0) {
+      //   this.getWorks()
+      // }
+      // if (this.cutTabNum==1) {
+      //   this.getStageWorks()
+      // }
+      // if (this.cutTabNum==2) {
+      //   this.getTaskWorks()
+      // }
+      // this.getWorks();
     },
     searchWork2() {
       this.page = 1;
-      this.getWorks();
+      // console.log(this.typeCheck);
+      
+      if (this.typeCheck) {
+        if (this.cutTabNum==0) {
+          this.getWorks1()
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks2()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks2()
+        }
+      }else{
+        if (this.cutTabNum==0) {
+          this.getWorks()
+        }
+        if (this.cutTabNum==1) {
+          this.getStageWorks()
+        }
+        if (this.cutTabNum==2) {
+          this.getTaskWorks()
+        }
+      }
+      
+      // this.getWorks();
     },
     // fullTools() {
     //   this.full = !this.full;
@@ -2913,7 +3339,16 @@ export default {
 					this.studentLoading = false;
           this.dyList = dyList;
           this.userAarray = res.data[1];
-          this.getWorks();
+          if (this.cutTabNum==0) {
+            this.getWorks()
+          }
+          if (this.cutTabNum==1) {
+            this.getStageWorks()
+          }
+          if (this.cutTabNum==2) {
+            this.getTaskWorks()
+          }
+          // this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -3773,8 +4208,9 @@ export default {
 }
 
 .student_head {
-  margin-top: 10px;
-  padding-bottom: 15px;
+  /* margin-top: 10px;
+  padding-bottom: 15px; */
+  padding: 20px 0;
 }
 
 .student_search {
@@ -4497,7 +4933,7 @@ export default {
   align-items: center;
   justify-content: space-between;
   margin: 10px 0;
-  font-size: 18px;
+  /* font-size: 18px; */
 }
 
 .a_add_head .a_add_head_input {
@@ -4514,6 +4950,9 @@ export default {
   display: flex;
   align-items: center;
 }
+.a_add_body >>> .el-radio__label{
+font-size: 14px !important;
+}
 
 .a_add_input {
   display: flex;
@@ -5438,4 +5877,21 @@ ol {
   object-fit: contain;
   cursor: pointer;
 }
+.cutTab {
+  display: flex;
+  margin: 10px 0;
+}
+.cutTab > .ctrlBtn {
+  margin-right: 15px;
+  padding: 5px 0;
+  cursor: pointer;
+}
+.cutTab > .ctrlBtn2 {
+  cursor: pointer;
+  margin-right: 15px;
+  border-bottom: 3px #409EFF solid;
+  font-weight: 600;
+  padding: 5px 0;
+  color: #409EFF;
+}
 </style>

+ 26 - 38
src/components/pages/works.vue

@@ -99,11 +99,11 @@
             </el-select> -->
             <el-input
               v-model="cn"
-              placeholder="筛选项目名称"
+              placeholder="筛选课程名称"
               @input="search"
             ></el-input>
           </div>
-          <div
+          <!-- <div
             style="
               margin-left: 10px;
               cursor: pointer;
@@ -117,7 +117,7 @@
             "
           >
             学生评价管理
-          </div>
+          </div> -->
         </div>
       </div>
       <div class="pb_content_body">
@@ -232,36 +232,20 @@
         <el-button @click="dialogVisible = false">关 闭</el-button>
       </span>
     </el-dialog>-->
+  
     <WorkDate
       :dataJson="dataJson"
       :uid="userid"
       :cid="dataJson.courseId"
       :ooid="oid"
+      @cancel="cancel"
+      :dialogVisibleBao.sync="dialogVisibleBao"
       :dialogVisible.sync="dialogVisible"
       v-if="dialogVisible"
       class="workdates"
     ></WorkDate>
-    <div class="cancelbox" v-if="dialogVisible">
-      <el-button @click="dialogVisibleBao = true" type="primary" size="small"
-        >自定义导出</el-button
-      >
-      <el-button @click="cancel" type="primary" size="small">返回</el-button>
-      <!-- <el-button
-        type="primary"
-        size="small"
-        @click="
-          goTo(
-            '/worksDetail?cid=' +
-              dataJson.courseId +
-              '&userid=' +
-              userid +
-              '&oid=' +
-              oid
-          )
-        "
-        >查看作业</el-button
-      >-->
-    </div>
+    
+    
     <el-dialog
       title="自定义导出报告"
       :visible.sync="dialogVisibleBao"
@@ -499,7 +483,10 @@ export default {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.tableData1 = res.data[0];
+          this.classJuri = res.data[2];
+
           var cJuri = res.data[1];
+
           for (var j = 0; j < this.tableData1.length; j++) {
             this.tableData1[j].classJson = { className: "" };
             for (var i = 0; i < cJuri.length; i++) {
@@ -627,19 +614,19 @@ export default {
       this.signDialog = false;
     },
 
-    getClass() {
-      let params = {
-        oid: this.oid,
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectClassBySchool", params)
-        .then((res) => {
-          this.classJuri = res.data[0];
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
+    // getClass() {
+    //   let params = {
+    //     oid: this.oid,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "selectClassBySchool", params)
+    //     .then((res) => {
+    //       this.classJuri = res.data[0];
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
     getEva() {
       let params = {
         oid: this.oid,
@@ -656,7 +643,7 @@ export default {
   },
   created() {
     this.page = 1;
-    this.getClass();
+    // this.getClass();
     this.getEva();
     this.getProject();
   },
@@ -820,4 +807,5 @@ export default {
 .student_search >>> .el-input {
   width: auto !important;
 }
+
 </style>