Browse Source

成绩分析增加小题分不显示逻辑

liurongli 1 tháng trước cách đây
mục cha
commit
91975e12c8

+ 39 - 33
src/components/PaperImage.vue

@@ -94,6 +94,10 @@ export default {
     rtOrWrSize:{
       type:Number,
       default:2
+    },
+    displayQuesMark:{//判断是否显示小题标记
+      type:Boolean,
+      default:true
     }
   },
   computed:{
@@ -610,46 +614,48 @@ export default {
             }
             else
             {
-              const fontSize = Math.max(12, 18 * scale); // 最小字体12px,基础字体18px
-              // ctx.font = '30px Arial';
-              ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
-              ctx.textAlign = 'left';
-              //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
-              const iconX=obj.x-20*zoomRate*scale;
-              const iconY=obj.y-20*zoomRate*scale;
-              const iconWidth = 40*zoomRate*scale; 
-              const iconHeight = 40*zoomRate*scale;
-              // console.log("打印item.score",item.score)
-              // displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
-              // displayName: res.data.displayName,//显示值
-              // correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
-              if(item.displayType === 2){
-                ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
-              }else{
-                if(item.correctType===0){
-                  //0 分全错
-                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
-                }else if(item.correctType==2){
-                  //满分 全对
-                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-                }else if(item.correctType==1){
-                  //半对
-                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              if(this.displayQuesMark){
+                const fontSize = Math.max(12, 18 * scale); // 最小字体12px,基础字体18px
+                // ctx.font = '30px Arial';
+                ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
+                ctx.textAlign = 'left';
+                //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
+                const iconX=obj.x-20*zoomRate*scale;
+                const iconY=obj.y-20*zoomRate*scale;
+                const iconWidth = 40*zoomRate*scale; 
+                const iconHeight = 40*zoomRate*scale;
+                // console.log("打印item.score",item.score)
+                // displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
+                // displayName: res.data.displayName,//显示值
+                // correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
+                if(item.displayType === 2){
+                  ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                 }else{
-                  const displayName = isNaN(item.displayName)?0:Number(item.displayName);
-                  if(displayName==0){
+                  if(item.correctType===0){
                     //0 分全错
                     ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
-                  }else if(displayName==item.fullScore){
-                    //满分全对
+                  }else if(item.correctType==2){
+                    //满分 全对
                     ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-                  }else{
+                  }else if(item.correctType==1){
                     //半对
                     ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                  }else{
+                    const displayName = isNaN(item.displayName)?0:Number(item.displayName);
+                    if(displayName==0){
+                      //0 分全错
+                      ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                    }else if(displayName==item.fullScore){
+                      //满分全对
+                      ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                    }else{
+                      //半对
+                      ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                    }
+                  }
+                  if(item.displayType === 0){//0-分数 显示分数和对错
+                    ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                   }
-                }
-                if(item.displayType === 0){//0-分数 显示分数和对错
-                  ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                 }
               }
             }

+ 10 - 3
src/components/StudentPaper.vue

@@ -9,14 +9,14 @@
           </div>
       </div>
       <div class="dialog_paper">
-        <div class="paper_content">
+        <div :class="['paper_content',{'paper_content_no_question':!displayQuesMark}]">
           <div class="canvas_button">
             <div :class="currentIndex==0?'disable_button_item':'button_item'"  @click="LastPaper()">
               <i class="el-icon-arrow-left"></i>
             </div>
           </div>
           <div class="canvas_image" v-loading="isLoading" element-loading-text="加载中……" element-loading-spinner="el-icon-loading" element-loading-background="#ffffff">
-            <PaperImage :paperImgUrl="currentPaperUrl"  :drawData="currentDrawData" :usedCardType="usedCardType" :downLoadName="currentDownLoadName"></PaperImage>
+            <PaperImage :paperImgUrl="currentPaperUrl"  :drawData="currentDrawData" :usedCardType="usedCardType" :downLoadName="currentDownLoadName" :displayQuesMark="displayQuesMark"></PaperImage>
           </div>
           <div class="canvas_button">
             <div :class="currentIndex==paperImageList.length-1?'disable_button_item':'button_item'" @click="NextPaper()">
@@ -24,7 +24,7 @@
             </div>
           </div>
         </div>
-        <div class="paper_question">
+        <div class="paper_question" v-if="displayQuesMark">
           <div class="area_table">
             <el-table :data="questionList" border ref="questionTable" :max-height="questionTableHeight">
                 <el-table-column label="小题名称" prop="questionName" align="center">
@@ -88,6 +88,10 @@ export default {
         currentPageIndex:{//默认显示第一页答题卡
           type: Number,
           required: 0,
+        },
+        displayQuesMark:{//判断是否显示小题标记
+          type:Boolean,
+          default:true
         }
         
     },
@@ -338,6 +342,9 @@ export default {
   .paper_content
   {
     width: calc(100% - 340px);
+    &.paper_content_no_question{
+      width: 100%;
+    }
     height: 100%;
     display: flex;
     justify-content: flex-start;

+ 9 - 7
src/views/analysisReport/studentPage/downloadPdf/studentReport.vue

@@ -89,7 +89,7 @@
                                                 <template v-if="header.prop == 'score'">
                                                     <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
                                                     * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
-                                                    * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
+                                                    * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错,7-得分显示等级,小题分不显示 -->
                                                     <template v-if="multiSubjectData.studentOpenness == 3 || multiSubjectData.studentOpenness == 4">
                                                         <template v-if="!isNaN(scope.row?.[header.prop])">
                                                             <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row?.[header.prop]" src="@/assets/report/score_yes_icon.webp" />
@@ -159,7 +159,7 @@
                                                     <template v-if="header.prop=='score'">
                                                         <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
                                                         * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
-                                                        * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
+                                                        * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错,7-得分显示等级,小题分不显示 -->
                                                         <template v-if="(scope.row.studentOpenness == 3 || scope.row.studentOpenness == 4) && scope.row?.score">
                                                             <template v-if="!isNaN(scope?.row?.score)">
                                                                 <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row.score" src="@/assets/report/score_yes_icon.webp" />
@@ -209,7 +209,7 @@
                                                         <template v-if="header.prop == 'score'">
                                                             <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
                                                             * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
-                                                            * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
+                                                            * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错,7-得分显示等级,小题分不显示 -->
                                                             <template v-if="group.studentOpenness == 2 || group.studentOpenness == 4 || group.studentOpenness == 6">
                                                                 <template v-if="!isNaN(scope?.row?.score)">
                                                                     <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row.score" src="@/assets/report/score_yes_icon.webp" />
@@ -298,7 +298,7 @@
                         <!-- 答题卡 -->
                         <template v-for="(paperItem,paperIndex) in (singleSubjectData?.[subKey]?.paperImageList || [])">
                             <div class="area_module area_module_img" v-if="singleSubjectData?.[subKey]?.paperImagePageNum?.[paperIndex] == page">
-                                <PaperImage v-if="paperItem.picUrl" :paperImgUrl="paperItem.picUrl" :usedCardType="paperItem.useType" :drawData="paperItem.questionVOS || []" :isDrag="false" :isWheel="false" :isShowContextMenu="false" rotateDeg="-90"></PaperImage>
+                                <PaperImage v-if="paperItem.picUrl" :paperImgUrl="paperItem.picUrl" :usedCardType="paperItem.useType" :drawData="paperItem.questionVOS || []" :isDrag="false" :isWheel="false" :isShowContextMenu="false" rotateDeg="-90" :displayQuesMark="multiSubjectData?.studentOpenness!=7"></PaperImage>
                             </div>
                         </template>
                     </template>
@@ -505,9 +505,11 @@ export default {
                     showHistory:0
                 })
                 await this.QueryOneSubjectData(element.subjectCode,index);
-                await this.QueryOneSubjectSmallQuestionData(element.subjectCode,index);
-                await this.QueryOneSubjectGroupQuestionData(element.subjectCode,index);
-                await this.QueryOneSubjectCustomGroupQuestion(element.subjectCode,index);
+                if(this.multiSubjectData.studentOpenness != 7){//不显示小题\大题\知识点\自定义分组
+                    await this.QueryOneSubjectSmallQuestionData(element.subjectCode,index);
+                    await this.QueryOneSubjectGroupQuestionData(element.subjectCode,index);
+                    await this.QueryOneSubjectCustomGroupQuestion(element.subjectCode,index);
+                }
                 //学生端查询单科-历次查询(联考)
                 await this.QueryOneSubjectHistoryExamData(element.subjectCode,index);
                 await this.QueryOneSubjectSuggestionData(element.subjectCode,index);

+ 22 - 23
src/views/analysisReport/studentPage/scrolReport/transcript_single.vue

@@ -38,7 +38,7 @@
               <span class="value">
                 <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
                 * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
-                * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
+                * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错,7-得分显示等级,小题分不显示 -->
                 <template
                   v-if="
                     (subjectData.data.studentOpenness == 3 || subjectData.data.studentOpenness == 4) && subjectData?.data?.score
@@ -164,7 +164,7 @@
       <div class="module_table">
         <div class="answer_sheet" v-if="answerCard.paperImageList.length">
           <div class="item" v-for="(item, index) in answerCard.paperImageList">
-            <PaperImage :imageIndex="index" v-if="item.picUrl" :scoreFontSize="20" :rtOrWrSize="10" :paperImgUrl="item.picUrl" :usedCardType="item.useType" :drawData="item.questionVOS || []"></PaperImage>
+            <PaperImage :imageIndex="index" v-if="item.picUrl" :scoreFontSize="20" :rtOrWrSize="10" :paperImgUrl="item.picUrl" :usedCardType="item.useType" :drawData="item.questionVOS || []" :displayQuesMark="subjectData?.data?.studentOpenness!=7"></PaperImage>
             <div class="item_hover">
               <div class="show_view" @click="OpenStudentPaper(index)">
                 <img src="@/assets/icon/pic_show_view.png" />
@@ -261,7 +261,7 @@
                 <template v-if="title.prop == 'score'">
                   <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
                 * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
-                * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
+                * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错,7-得分显示等级,小题分不显示 -->
                   <template
                     v-if="
                       groupData[group.value].studentOpenness == 2 ||
@@ -398,6 +398,7 @@
       :paperInfo="{ examId: reportParam.examId, subjectCode: reportParam.subjectCode }"
       :currentPageIndex="currentPageIndex"
       :pageTitle="paperTitle"
+      :displayQuesMark="subjectData?.data?.studentOpenness!=7"
     ></StudentPaper>
   </div>
 </template>
@@ -446,12 +447,7 @@ export default {
       paperTitle: '', //答题卡弹框标题
       currentPageIndex: 0, //当前选中的答题卡第几页
       groupData: {
-        groupName: [
-          {
-            name: '小题',
-            value: 'smallQuestionData'
-          }
-        ],
+        groupName: [],
         chartTypeList: [
           {
             label: '柱状图',
@@ -600,25 +596,23 @@ export default {
   methods: {
     PageInit() {
       this.initData()
-      this.QueryOneSubjectData() //学生端查询单科-我的成绩
+      this.QueryOneSubjectData(()=>{
+        if(this.subjectData.data.studentOpenness != 7){//7-得分显示等级,小题分不显示
+          this.QueryOneSubjectSmallQuestionData() //学生端查询单科-小题分析(表格-图表)
+          if(this.schoolType == 2){
+            this.QueryStudentKnowLedgeLayering();//知识点分层分析表(联考)
+          }
+        }
+      }) //学生端查询单科-我的成绩
       this.FindStudentCard() //查询学生答题卡带批阅痕迹的(单校)
-      this.QueryOneSubjectSmallQuestionData() //学生端查询单科-小题分析(表格-图表)
-      if(this.schoolType == 2){
-        this.QueryStudentKnowLedgeLayering();//知识点分层分析表(联考)
-      }
       this.QueryOneSubjectHistoryExamData() //学生端查询单科-历次查询
       this.QueryOneSubjectSuggestionData() //学生端查询单科-总结建议
     },
     initData() {
-      this.groupData.groupName = [
-        {
-          name: '小题',
-          value: 'smallQuestionData'
-        }
-      ]
+      this.groupData.groupName = []
       this.suggestionData = null
       Object.keys(this.groupData).forEach(key => {
-        if (key != 'groupName' || key != 'chartTypeList') {
+        if (key != 'groupName' && key != 'chartTypeList') {
           this.groupData[key].chartType = 'vertical_bar'
           this.groupData[key].total = 0
           this.groupData[key].pageNum = 1
@@ -627,7 +621,7 @@ export default {
       })
     },
     //学生端查询单科-我的成绩
-    QueryOneSubjectData() {
+    QueryOneSubjectData(callback) {
       this.subjectLoading = true
       this.$api.reportStudent[getApiName()].queryOneSubjectData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
@@ -657,6 +651,7 @@ export default {
             this.subjectData.fullScore = '' //满分
             this.subjectData.subjectName = '' //科目名称
           }
+          callback && callback()
         })
         .finally(() => {
           this.subjectLoading = false
@@ -713,7 +708,11 @@ export default {
           if (res.code == 200 && res.data) {
             const tableData = res.data.tableData || []
             const titleData = res.data.titleData || []
-            const studentOpenness = res.data?.studentOpenness ?? ''
+            const studentOpenness = res.data?.studentOpenness ?? '';
+            this.groupData.groupName.push({
+              name: '小题',
+              value: 'smallQuestionData'
+            })
             this.TableChartData(tableData, titleData, studentOpenness, 'smallQuestionData')
           } else {
             this.groupData.smallQuestionData.tableData = []