11wqe1 hai 1 ano
pai
achega
6fc3e538ee
Modificáronse 1 ficheiros con 175 adicións e 69 borrados
  1. 175 69
      src/components/pages/components/worksDetail2.vue

+ 175 - 69
src/components/pages/components/worksDetail2.vue

@@ -216,6 +216,7 @@
           width="100%"
           class="dialog_diy2 max_diy"
           :class="{ fullStyle: full }"
+          v-loading="worksLoading"
         >
           <div slot="title" class="header-title">
             <div style="color: #fff">查看作业</div>
@@ -618,13 +619,13 @@
                           class="left_top"
                           v-if="worksDetail[sIndex].chooseInfo.length > 0"
                         >
-                          <div>
+                          <div v-for="(lcc, lccindex) in worksDetail[sIndex].chooseInfo" :key="lccindex + 'a'">
                             <div
-                              v-if="worksDetail[sIndex].chooseInfo[0].score"
+                              v-if="lcc.score"
                               style="float: right; margin-right: 10px"
                             >
                               评分:{{
-                                worksDetail[sIndex].chooseInfo[0].score
+                                lcc.score
                               }}
                             </div>
                             <div
@@ -637,7 +638,7 @@
                                 flex-wrap: wrap;
                               "
                             >
-                              <div style="font-size: 16px">选择题工具</div>
+                              <div style="font-size: 16px">选择题工具{{ lccindex + 1 }}</div>
                             </div>
                             <div class="a_addBox">
                               <div style="font-size: 16px; color: #c7c7c7">
@@ -649,8 +650,7 @@
                                     ? 'a_add_box'
                                     : 'isAddBox'
                                 "
-                                v-for="(item1, index1) in worksDetail[sIndex]
-                                  .chooseInfo[0].chooseInfo.testCount"
+                                v-for="(item1, index1) in lcc.chooseInfo.testJson"
                                 :key="index1"
                               >
                                 <div class="a_add_head">
@@ -658,20 +658,16 @@
                                     {{ index1 + 1 + "、" }}
                                     <div>
                                       题目:{{
-                                        worksDetail[sIndex].chooseInfo[0]
-                                          .chooseInfo.testJson[index1]
-                                          .teststitle
+                                       item1.teststitle
                                       }}
                                     </div>
                                   </div>
                                   <img
                                     v-if="
-                                      worksDetail[sIndex].chooseInfo[0]
-                                        .chooseInfo.testJson[index1].img
+                                      item1.img
                                     "
                                     :src="
-                                      worksDetail[sIndex].chooseInfo[0]
-                                        .chooseInfo.testJson[index1].img
+                                     item1.img
                                     "
                                     style="
                                       height: 300px;
@@ -680,33 +676,28 @@
                                     "
                                   />
                                 </div>
+
                                 <div class="a_add_body">
                                   <div class="a_add_input">
                                     <el-radio-group
                                       v-model="
-                                        worksDetail[sIndex].chooseInfo[0]
-                                          .chooseInfo.radio[index1]
+                                       lcc.chooseInfo.radio[index1]
                                       "
                                       v-if="
-                                        worksDetail[sIndex].chooseInfo[0]
-                                          .chooseInfo.testJson[index1].type ==
-                                        '1'
+                                        item1.type == '1'
                                       "
                                     >
                                       <div class="radioBox">
                                         <el-radio
                                           v-for="(
                                             item2, checkIndex
-                                          ) in worksDetail[sIndex].chooseInfo[0]
-                                            .chooseInfo.testJson[index1]
-                                            .checkList"
+                                          ) in item1.checkList"
                                           :key="checkIndex"
                                           :label="checkIndex"
                                           disabled
-                                          class="redioStyle"
+                                          :class="[item1.answer ==  checkIndex ? 'redioStyle':'redioStyle2']"
                                         >
                                           <div
-                                            style="margin-right: 10px"
                                             v-if="
                                               item2 &&
                                               item2.imgType &&
@@ -726,28 +717,26 @@
                                         </el-radio>
                                       </div>
                                     </el-radio-group>
+
                                     <el-checkbox-group
                                       v-model="
-                                        worksDetail[sIndex].chooseInfo[0]
-                                          .chooseInfo.radio[index1]
+                                       lcc.chooseInfo.radio[index1]
                                       "
                                       v-if="
-                                        worksDetail[sIndex].chooseInfo[0]
-                                          .chooseInfo.testJson[index1].type ==
-                                        '2'
+                                        item1.type == '2'
                                       "
                                     >
                                       <div class="radioBox">
+                                        {{ item1.answer }}
+                                        {{ item1.answer.includes(checkIndex) }}
                                         <el-checkbox
                                           v-for="(
                                             item2, checkIndex
-                                          ) in worksDetail[sIndex].chooseInfo[0]
-                                            .chooseInfo.testJson[index1]
-                                            .checkList"
+                                          ) in item1.checkList"
                                           :key="checkIndex"
                                           :label="checkIndex"
                                           disabled
-                                          class="redioStyle"
+                                          :class="[item1.answer.includes(checkIndex) ? 'redioStyle3':'redioStyle4']"
                                         >
                                           <div
                                             style="margin-right: 10px"
@@ -776,6 +765,7 @@
                             </div>
                           </div>
                         </div>
+
                         <div
                           class="left_top"
                           v-if="worksDetail[sIndex].wpptInfo.length > 0"
@@ -819,6 +809,7 @@
                             ></iframe>
                           </div>
                         </div>
+
                         <div
                           class="left_top"
                           v-if="worksDetail[sIndex].pjInfo.length > 0"
@@ -1011,12 +1002,12 @@
                           class="left_top"
                           v-if="worksDetail[sIndex].lccjInfo.length > 0"
                         >
-                          <div class="sentenBox">
+                          <div class="sentenBox" v-for="(lcc, lccindex) in worksDetail[sIndex].lccjInfo" :key="lccindex +'b'">
                             <div
-                              v-if="worksDetail[sIndex].lccjInfo[0].score"
+                              v-if="lcc.score"
                               style="float: right; margin-right: 10px"
                             >
-                              评分:{{ worksDetail[sIndex].lccjInfo[0].score }}
+                              评分:{{ lcc.score }}
                             </div>
                             <div
                               class="a_add_title"
@@ -1031,9 +1022,8 @@
                               <div style="font-size: 16px">排序工具</div>
                             </div>
                             <div
-                              v-for="(st, stIndex) in worksDetail[sIndex]
-                                .lccjInfo"
-                              :key="stIndex"
+                              v-for="(st, stIndex) in lcc.lccjInfo"
+                              :key="stIndex+'c'"
                               style="padding-bottom: 20px"
                             >
                               <div
@@ -1047,13 +1037,12 @@
                               <div class="isWrong">
                                 <div
                                   class="cardList1"
-                                  v-if="st.lccjInfo.chooseSenList"
+                                  v-if="st.chooseSenList"
                                 >
                                   <div class="cardBox">
                                     <div
-                                      v-for="(s, sIndex) in st.lccjInfo
-                                        .chooseSenList"
-                                      :key="sIndex"
+                                      v-for="(s, sIndex) in st.chooseSenList"
+                                      :key="sIndex+'d'"
                                     >
                                       <el-tooltip
                                         class="item"
@@ -1069,15 +1058,15 @@
                                   </div>
                                   <div class="cardAnswerBox">
                                     组成句子:{{
-                                      st.lccjInfo.chooseSenList.join(" ")
+                                      st.chooseSenList.join(" ")
                                     }}
                                   </div>
                                 </div>
                                 <div
                                   class="answerRight isTj"
                                   v-if="
-                                    st.lccjInfo.chooseSenList.toString() ==
-                                    st.lccjInfo.rightAnswer.toString()
+                                    st.chooseSenList.toString() ==
+                                    st.rightAnswer.toString()
                                   "
                                 >
                                   <div class="isTjImg">
@@ -1091,8 +1080,8 @@
                                 <div
                                   class="answerRight isTj"
                                   v-if="
-                                    st.lccjInfo.chooseSenList.toString() !=
-                                    st.lccjInfo.rightAnswer.toString()
+                                    st.chooseSenList.toString() !=
+                                    st.rightAnswer.toString()
                                   "
                                 >
                                   <div class="isTjImg">
@@ -1106,8 +1095,8 @@
                               </div>
                               <div
                                 v-if="
-                                  st.lccjInfo.chooseSenList.toString() !=
-                                  st.lccjInfo.rightAnswer.toString()
+                                  st.chooseSenList.toString() !=
+                                  st.rightAnswer.toString()
                                 "
                               >
                                 <div style="padding: 15px 0 10px 20px">
@@ -1115,7 +1104,7 @@
                                 </div>
                                 <div
                                   class="cardList"
-                                  v-if="st.lccjInfo.rightAnswer"
+                                  v-if="st.rightAnswer"
                                   style="
                                     border: none;
                                     padding: 10px 0 10px 10px;
@@ -1124,8 +1113,7 @@
                                 >
                                   <div class="cardBox">
                                     <div
-                                      v-for="(r, rIndex) in st.lccjInfo
-                                        .rightAnswer"
+                                      v-for="(r, rIndex) in st.rightAnswer"
                                       :key="rIndex"
                                     >
                                       <el-tooltip
@@ -1142,7 +1130,7 @@
                                   </div>
                                   <div class="cardAnswerBox">
                                     组成句子:{{
-                                      st.lccjInfo.rightAnswer.join(" ")
+                                      st.rightAnswer.join(" ")
                                     }}
                                   </div>
                                 </div>
@@ -1380,12 +1368,20 @@
                         position: relative;
                       "
                     >
+                    <div class="worksTimeBlack">
+                      <div class="worksTimeBlackTit">
+                        <div>
+                          任务得分: <span style="color: rgba(54, 129, 252, 1);margin-left: 5px;">{{ totalScore(worksDetail[sIndex].rateList) }}</span>分
+                        </div>
+                      </div>
                       <div class="worksTime">
                         作业提交时间:<span style="width: auto"
                           >{{ worksDetail[sIndex].time }}
                         </span>
                       </div>
-                      <div
+                    </div>
+                     
+                      <!-- <div
                         v-if="
                           // worksDetail[sIndex].img.length == 0 &&
                           // worksDetail[sIndex].askInfo.length == 0 &&
@@ -1429,12 +1425,13 @@
                           <span>全部题的正确率:</span>
                           <span>{{ checkJson[sIndex].allRight + "%" }}</span>
                         </div>
-                      </div>
+                      </div> -->
                       <div v-if="worksDetail[sIndex].eList.length">
-                        <div class="ech" style="margin-left: 23px">
+                        <!-- <div class="ech" style="margin-left: 23px">
                           <img src="../../../assets/icon/pj/score.png" alt="" />
-                        </div>
+                        </div> -->
                         <div>
+                          <div class="score_boxTit"><span>分数详情</span></div>
                           <div
                             class="score_box"
                             v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1456,6 +1453,12 @@
                             ></el-rate>
                           </div>
                         </div>
+                        <div class="worksTarget"><span>目标</span></div>
+                        <div class="worksTargetCon">
+                            <div v-for="item in worksDetail[sIndex].eList" :key="item">
+                              <span v-if="!item.target"> {{ item.target }}</span>
+                            </div>
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -1826,8 +1829,25 @@ export default {
       checkJson: [],
       typeCheck: false,
       word2: require("../../../assets/icon/word2.png"),
+      worksLoading:false
     };
   },
+  computed: {
+    totalScore(){
+      return function (val) {
+        let sco = 0
+        let num = 0
+
+        for (const key in val) {
+          if (val[key]  || val[key] == 0) {
+            sco+= val[key] * 1
+          }
+          num+=1
+        }
+        return (sco / (num - 1)).toFixed(1)
+      }
+    }
+  },
   watch: {
     typeCheck(newValue, oldValue) {
       this.loading = true;
@@ -1861,6 +1881,7 @@ export default {
   },
   methods: {
     getPdf(){
+      this.worksLoading = true
       let domHeight = this.$refs.reportPdf.offsetHeight;
       console.log('this.$refs.reportPdf',this.$refs.reportPdf.offsetHeight);
       let maxHeight = 64257;
@@ -1889,8 +1910,12 @@ export default {
         pdf.addImage(pageData, 'JPEG', 10, 0, imgWidth-20, imgHeight-20 );
        
         pdf.save( this.allWorks.course+'-'+ this.allWorks.sName+'.pdf')
-
+        this.worksLoading = false
     })
+    .catch((err) => {
+      this.worksLoading = false
+      console.log(err);
+    });
 
     },
 		changeClass(){//切换班级
@@ -1971,7 +1996,10 @@ export default {
             _ooption = [],
             _rate = [],
             _rateList = [];
+            console.log('res.data',res.data);
           var worksDetail = res.data[1];
+          // let worksDetailCopy = JSON.parse(JSON.stringify(worksDetail))
+          // console.log('worksDetailCopy',worksDetailCopy);
           // this.scopeId = res.data[2][0].id;
           // var scopeId = res.data[2][0].id;
           var askInfo = res.data[3];
@@ -2356,10 +2384,11 @@ export default {
             }
           }
 
+          // 排序
           for (var i = 0; i < lccjInfo.length; i++) {
             var lccj = lccjInfo[i];
             workJson[lccjInfo[i].stage + "-" + lccjInfo[i].task].lccjInfo.push({
-              lccjInfo: JSON.parse(lccj.content)[0],
+              lccjInfo: JSON.parse(lccj.content),
               score: lccjInfo[i].score
                 ? JSON.parse(lccjInfo[i].score).wScore
                 : lccjInfo[i].score,
@@ -2606,6 +2635,8 @@ export default {
           }
 
           this.worksDetail = result;
+          console.log('this.worksDetail',this.worksDetail);
+
 
           this.courseDetail = res.data[0][0];
 
@@ -4032,25 +4063,43 @@ export default {
   font-size: 15px;
   background: #fff;
   height: 100%;
-  padding-top: 40px;
+  /* padding-top: 40px; */
+  padding: 40px 30px 0;
   border-radius: 5px;
   width: 90%;
   box-shadow: 2px 2px 5px #909090;
   /* overflow: auto; */
 }
+.sd_score .score_boxTit{
+  margin-top: 20px;
+  /* padding: 0 30px; */
+  box-sizing: border-box;
+  font-size: 16px;
+  font-weight: 600;
+  color: rgba(0, 0, 0, 0.9);
+}
+
+.sd_score .score_boxTit > span{
+  border-left: 3px solid rgba(54, 129, 252, 1);
+  padding-left: 5px;
+}
 
 .sd_score .score_box {
   display: flex;
   align-items: center;
-  justify-content: flex-start;
+  font-size: 14px !important;
+  /* justify-content: flex-start; */
+  justify-content: space-between;
   margin-bottom: 15px;
-  margin: 10px 0 0 30px;
+  /* margin: 10px 0 0 30px; */
+  margin: 10px 0;
+
 }
 .sd_score .score_box > span:nth-child(1) {
   margin-right: 20px;
-  text-align-last: justify;
-  max-width: 120px;
-  width: 80px;
+  /* text-align-last: justify; */
+  /* max-width: 300px; */
+  width: 150px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
@@ -4079,7 +4128,29 @@ export default {
   text-overflow: ellipsis;
   font-size: 16px;
 }
-
+.worksTarget {
+  margin: 15px 0;
+  border-left: 3px solid rgba(54, 129, 252, 1);
+  font-size: 16px;
+  font-weight: 600;
+  color: rgba(0, 0, 0, 0.9);
+}
+.worksTarget > span {
+  margin-left: 5px;
+}
+.worksTargetCon {
+  background: rgba(243, 247, 253, 1);
+  margin: 0 30;
+  padding: 10px;
+  border-radius: 5px;
+  box-sizing: border-box;
+}
+.worksTargetCon > div {
+  margin-bottom: 10px;
+}
+.worksTargetCon :nth-child(-1){
+  margin-bottom: 0;
+}
 .moreSay {
   margin: 0px 0 5px 20px;
 }
@@ -4258,6 +4329,7 @@ export default {
   flex-wrap: nowrap;
   align-items: flex-start;
   overflow: hidden;
+  border-radius: 5px;
 }
 
 .zyBoxC + .zyBoxC {
@@ -4438,6 +4510,19 @@ export default {
 
 .redioStyle >>> .el-radio__label {
   font-size: 18px;
+  color: #06a7ff !important;
+
+}
+.redioStyle2 >>> .el-radio__label {
+  font-size: 18px;
+}
+
+.redioStyle3 >>> .el-checkbox__label {
+  font-size: 18px;
+  color: #06a7ff !important;
+}
+.redioStyle4 >>> .el-checkbox__label {
+  font-size: 18px;
 }
 
 .task_title {
@@ -4630,6 +4715,7 @@ export default {
   /* height: 500px; */
   /* height: 100%; */
   min-height: 800px;
+  border-radius: 5px;
 }
 
 .cTitle {
@@ -4884,7 +4970,7 @@ export default {
 }
 
 .fullStyle >>> .el-dialog__body {
-  height: 100% !important;
+  height: calc(100% - 68px) !important;
   overflow: auto;
 }
 
@@ -4895,11 +4981,23 @@ export default {
   height: 100% !important;
   margin: 0 !important;
 }
+.worksTimeBlack{
+  /* padding: 0 30px; */
+  box-sizing: border-box;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: rgba(0, 0, 0, 0.9);
+}
+.worksTimeBlack > .worksTimeBlackTit{
+  font-size: 18px;
+  font-weight: 600;
+}
 
 .worksTime {
-  position: absolute;
+  /* position: absolute;
   top: 10px;
-  right: 20px;
+  right: 20px; */
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
@@ -4940,6 +5038,14 @@ export default {
   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;
 }