Bladeren bron

报告异常数据处理

liurongli 4 maanden geleden
bovenliggende
commit
2f8733f24c
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      src/views/analysisReport/studentPage/downloadPdf/studentReport.vue

+ 5 - 5
src/views/analysisReport/studentPage/downloadPdf/studentReport.vue

@@ -152,9 +152,9 @@
                         </template>
                         <!-- 小题分 大题 知识点  能力要素  自定义分组 -->
                         <template v-for="group in (singleSubjectData?.[subKey]?.groupQuestionData || [])">
-                            <div class="area_module" v-if="group.chartPagesNum == page && group.type!='smallQuestionData'">
+                            <div class="area_module" v-if="group.chartPagesNum == page && group.datay.length > 0 && group.type!='smallQuestionData'">
                                 <div class="area_module_title">{{group.groupName}}分析图</div>
-                                <div class="area_module_chart" v-if="group.tableList.length > 0">
+                                <div class="area_module_chart" v-if="group.datay.length > 0">
                                     <BarChart v-if="group.type=='bigQuestionData'" :datax="group.datax" :datay="group.datay" unit="" typeName="" :showNuitY="false" :unit="'%'" :showTooltip="false" :isShowMarkLine="false" :gridLeft="0" :gridRight="0" :gridTop="20" :fontSize="14" :fontColor="'#333333'" :showDataZoom="false" style="height: 270px;"></BarChart>
                                     <RadarCharts v-else :showLegend="false" :reportHeight="`300px`" :showDataLabel="true" :showTooltip="false" :data="group.radarChartData" :unit="'%'" :legendList="[]" legendLeft="center" :showCheckBox="false" :openShowAllLegend="false" :showRadiusAxis="false" :fontSize="14" :fontColor="'#333333'" :style="{height: 'auto',minHeight:'100% !important'}"></RadarCharts>
                                 </div>
@@ -992,11 +992,11 @@ export default {
             const radarChartData = [['group', '得分率'], ...radarChart]
             let chartHeight = 0;//小题分析只显示table 不显示图
             if(type=='bigQuestionData'){
-                chartHeight = 363 //柱状图
+                chartHeight = datay.length > 0 ? 363 : 0; //柱状图
             }else if (type == 'smallQuestionData'){
-                chartHeight = 0
+                chartHeight = 0;
             } else{
-                chartHeight = 393//雷达图
+                chartHeight = datay.length > 0 ? 393 : 0;//雷达图
             }
             const chartPagesNum = this.SingleChartPage(chartHeight);
             const staticHeader = titleData.slice(0,1);//固定表头