studentReport.vue 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624
  1. <template>
  2. <!-- 学生报告 -->
  3. <!-- v-loading="loading" element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.5)" :element-loading-text="loadingText" -->
  4. <BookFlip :book-pages="bookPageImages" bookBg="student" :requestLoading="loading" :openLoading="openLoading" :coverTitle="`${stuClasName}${studentName}分析报告册`" subtitle="供参考学生使用" ref="bookFlipBox" @OpenBookImages="OpenBookImages" @PdfLoadEnd="PdfLoadEnd">
  5. <!-- 自定义每页内容 -->
  6. <template #default="slotProps">
  7. <template v-if="slotProps.type == 'web_mode'">
  8. <div class="area_page" style="position: absolute;top: -9999999px;z-index: -10;height: auto;min-height: 1285px;">
  9. <!-- 用于获取div的高度 默认隐藏不显示 -->
  10. <div class="area_title" ref="areaReportTitle">
  11. <p>{{ reportTitle }}</p>
  12. <p>{{ stuClasName }}{{ studentName }}分析报告</p>
  13. </div>
  14. <div class="area_module" ref="standardScoreChartDes">
  15. <div class="area_module_describe" v-if="multiSubjectData.maxSubject || multiSubjectData.minSubject" style="margin-top: 0;">
  16. 说明:从标准分情况来看,这次考试<template v-if="multiSubjectData.maxSubject"><span style="color: #3ba272">{{ multiSubjectData.maxSubject }}</span>表现突出,请继续保持</template><template v-if="multiSubjectData.minSubject">;<span style="color: #ee6666">{{ multiSubjectData.minSubject }}</span>标准分明显低于其他学科,可能会对总体排名造成影响,可结合错题梳理核心知识点,精准定位薄弱环节,制定针对性的提升计划,以实现各科均衡发展,进一步巩固整体成绩</template>。
  17. </div>
  18. </div>
  19. <div class="area_module" ref="multiSuggestionModule">
  20. <div class="area_module_title">总结建议</div>
  21. <div class="area_module_describe" style="margin-top: 0;" v-html="suggestionHtml"></div>
  22. <div class="pring_jg"></div>
  23. </div>
  24. <template v-for="(subject,subKey) in multiSubjectData.singleSubject">
  25. <div class="area_module" :ref="`singleSubjectSuggestion_${subKey}`" v-if="singleSubjectData?.[subKey]?.suggestionHtml">
  26. <div class="area_module_title">总结建议</div>
  27. <div class="area_module_describe" style="margin-top: 0;" v-html="singleSubjectData?.[subKey]?.suggestionHtml"></div>
  28. <div class="pring_jg"></div>
  29. </div>
  30. </template>
  31. <!-- 知识点分层 -->
  32. <template v-for="know in knowLedgeLayeringData">
  33. <div class="area_module" :ref="`knowLedgeLayering_${know.subjectCode}`">
  34. <div class="area_module_title">{{know.groupName}}分层分析</div>
  35. <div class="area_module_table">
  36. <ul class="student_know_paper">
  37. <li>
  38. <div class="li_left">
  39. <span>满分区</span>
  40. <span>(得满分的知识点)</span>
  41. </div>
  42. <div class="li_know">{{ know.knowLedgeLayering.fullScore }}{{ know.knowLedgeLayering.fullScore ? '。':'' }}</div>
  43. </li>
  44. <li>
  45. <div class="li_left">
  46. <span>突破升级区</span>
  47. <span>(得分率高于同层次,但低于上一层次平均水平的知识点)</span>
  48. </div>
  49. <div class="li_know">{{ know.knowLedgeLayering.breakThrough }}{{ know.knowLedgeLayering.breakThrough ? '。':'' }}</div>
  50. </li>
  51. <li>
  52. <div class="li_left">
  53. <span>就近发展区</span>
  54. <span>(得分率低于同层次平均水平的知识点)</span>
  55. </div>
  56. <div class="li_know">{{ know.knowLedgeLayering.develop }}{{ know.knowLedgeLayering.develop ? '。':'' }}</div>
  57. </li>
  58. </ul>
  59. </div>
  60. <div class="pring_jg"></div>
  61. </div>
  62. </template>
  63. </div>
  64. <div class="area_page web_area_page" v-for="page in pageCount" :key="`${pageKey}_${page}`">
  65. <template v-if="page == 1">
  66. <div class="area_title">
  67. <p>{{ reportTitle }}</p>
  68. <p>{{ stuClasName }}{{ studentName }}分析报告</p>
  69. </div>
  70. <div class="area_header bg_purple">
  71. <img :src="headerLeftIcon" class="header_icon_left" />
  72. 总分成绩分析
  73. <img :src="headerRightIcon" class="header_icon_right" />
  74. </div>
  75. <div class="pring_jg"></div>
  76. </template>
  77. <template v-for="(tableData,index) in multiSubjectData.tableList">
  78. <template v-for="(itemTable,itemIndex) in tableData">
  79. <div class="area_module" v-if="multiSubjectData.tablePagesNum[index][itemIndex] == page && itemTable.length > 0">
  80. <div class="area_module_title">成绩单</div>
  81. <div class="area_module_table">
  82. <el-table border :data="itemTable" stripe align="center">
  83. <el-table-column v-for="header in (multiSubjectData?.staticHeaderData ?? [])" align="center" :label="header.name" min-width="100" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. {{ scope.row?.[header.prop] || '-' }}
  86. </template>
  87. </el-table-column>
  88. <el-table-column v-for="header in (multiSubjectData?.headerList?.[index]?.[itemIndex] ?? [])" align="center" :label="header.name" min-width="100" show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. <template v-if="header.prop == 'score'">
  91. <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
  92. * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
  93. * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
  94. <template v-if="multiSubjectData.studentOpenness == 3 || multiSubjectData.studentOpenness == 4">
  95. <template v-if="!isNaN(scope.row?.[header.prop])">
  96. <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row?.[header.prop]" src="@/assets/report/score_yes_icon.webp" />
  97. <img class="right_or_wrong_icon" v-else-if="scope.row?.[header.prop] == 0" src="@/assets/report/score_no_icon.webp" />
  98. <img class="right_or_wrong_icon" v-else src="@/assets/report/score_dimidiate_icon.webp" />
  99. </template>
  100. <template v-else>{{ scope.row?.[header.prop] ?? '-' }}</template>
  101. </template>
  102. <template v-else>{{ scope.row?.[header.prop] ?? '-' }}</template>
  103. </template>
  104. <template v-else>{{ scope.row?.[header.prop] ?? '-' }}</template>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. </div>
  109. </div>
  110. <template v-if="multiSubjectData.tablePagesNum[index][itemIndex] == page && itemTable.length > 0">
  111. <div class="pring_jg" style="height: 29px;border-bottom: 1px solid #F3F3F3;box-sizing: border-box;"></div>
  112. <div class="pring_jg"></div>
  113. </template>
  114. </template>
  115. </template>
  116. <div class="area_module" v-if="multiSubjectData.chartPagesNum==page && ((multiSubjectData.standardScoreAnalysisStatus === 0 && schoolType == 2) || schoolType == 1) && multiSubjectData.datay.length>0">
  117. <div class="area_module_title">标准分分析图</div>
  118. <div class="area_module_chart">
  119. <DifferenceChart v-if="multiSubjectData.datay.length" :datax="multiSubjectData.datax" unit="" :datay="multiSubjectData.datay" :isClick="false" :rate="0" :gridLeft="0" :gridRight="0" :gridTop="20" :fontSize="14" :fontColor="'#333333'" :showDataZoom="false" style="height: 270px !important;min-height: 270px !important;"></DifferenceChart>
  120. </div>
  121. <div class="area_module_describe" v-if="multiSubjectData.maxSubject || multiSubjectData.minSubject">
  122. 说明:从标准分情况来看,这次考试<template v-if="multiSubjectData.maxSubject"><span style="color: #3ba272">{{ multiSubjectData.maxSubject }}</span>表现突出,请继续保持</template><template v-if="multiSubjectData.minSubject">;<span style="color: #ee6666">{{ multiSubjectData.minSubject }}</span>标准分明显低于其他学科,可能会对总体排名造成影响,可结合错题梳理核心知识点,精准定位薄弱环节,制定针对性的提升计划,以实现各科均衡发展,进一步巩固整体成绩</template>。
  123. </div>
  124. <div class="pring_jg"></div>
  125. </div>
  126. <!-- <div class="area_module" v-if="historyExamData.pageNum==page && historyExamData.chartData.length > 0">
  127. <div class="area_module_title">历次标准分追踪分析图</div>
  128. <div class="area_module_chart">
  129. <LineChart v-if="historyExamData.datay.length>0" :datax="historyExamData.datax" :datay="historyExamData.datay" :title="historyExamData.title"
  130. :extraText="false" :showBackground="false" :isShowLabel="true" labelColor="#333333" :legendList="historyExamData.legendList" :tooltipData="historyExamData.tooltipData" :gridLeft="0" :gridRight="0" :gridTop="25" :fontSize="14" :fontColor="'#333333'" :showCheckBox="false" reportHeight="270px" style="min-height:270px!important;">
  131. </LineChart>
  132. </div>
  133. <div class="pring_jg"></div>
  134. </div> -->
  135. <div class="area_module" v-if="suggestionHtml && multiSuggestionPageNum == page">
  136. <div class="area_module_title">总结建议</div>
  137. <div class="area_module_describe" style="margin-top: 0;" v-html="suggestionHtml"></div>
  138. <div class="pring_jg"></div>
  139. </div>
  140. <!-- 单科 -->
  141. <template v-for="(subject,subKey) in multiSubjectData.singleSubject">
  142. <template v-if="singleSubjectData?.[subKey]?.titlePageNum == page">
  143. <div class="area_header bg_purple">
  144. <img :src="headerLeftIcon" class="header_icon_left" />
  145. {{subject.subjectName}}成绩分析
  146. <img :src="headerRightIcon" class="header_icon_right" />
  147. </div>
  148. <div class="pring_jg"></div>
  149. </template>
  150. <!-- 成绩单 -->
  151. <template v-for="(tableData,index) in (singleSubjectData?.[subKey]?.scrolTableList || [])">
  152. <template v-for="(itemTable,itemIndex) in tableData">
  153. <div class="area_module" v-if="singleSubjectData?.[subKey]?.scrolTablePagesNum?.[index]?.[itemIndex] == page && itemTable.length > 0">
  154. <div class="area_module_title">成绩单</div>
  155. <div class="area_module_table">
  156. <el-table border :data="itemTable" stripe align="center">
  157. <el-table-column v-for="header in (singleSubjectData?.[subKey]?.scrolHeaderList?.[index]?.[itemIndex] ?? [])" align="center" :label="header.name" min-width="100" show-overflow-tooltip>
  158. <template slot-scope="scope">
  159. <template v-if="header.prop=='score'">
  160. <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
  161. * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
  162. * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
  163. <template v-if="(scope.row.studentOpenness == 3 || scope.row.studentOpenness == 4) && scope.row?.score">
  164. <template v-if="!isNaN(scope?.row?.score)">
  165. <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row.score" src="@/assets/report/score_yes_icon.webp" />
  166. <img class="right_or_wrong_icon" v-else-if="scope.row.score === 0" src="@/assets/report/score_no_icon.webp" />
  167. <img class="right_or_wrong_icon" v-else src="@/assets/report/score_dimidiate_icon.webp" />
  168. </template>
  169. <template v-else>{{ scope.row.score }}</template>
  170. </template>
  171. <template v-else>{{ scope?.row?.[header.prop] ?? '-' }}</template>
  172. </template>
  173. <template v-else>{{ scope?.row?.[header.prop] ?? '-' }}</template>
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. </div>
  178. </div>
  179. <template v-if="singleSubjectData?.[subKey]?.scrolTablePagesNum?.[index]?.[itemIndex] == page && itemTable.length > 0">
  180. <div class="pring_jg" style="height: 29px;border-bottom: 1px solid #F3F3F3;box-sizing: border-box;"></div>
  181. <div class="pring_jg"></div>
  182. </template>
  183. </template>
  184. </template>
  185. <!-- 小题分 大题 知识点 能力要素 自定义分组 -->
  186. <template v-for="group in (singleSubjectData?.[subKey]?.groupQuestionData || [])">
  187. <div class="area_module" v-if="group.chartPagesNum == page && group.datay.length > 0 && group.type!='smallQuestionData'">
  188. <div class="area_module_title">{{group.groupName}}分析图</div>
  189. <div class="area_module_chart" v-if="group.datay.length > 0">
  190. <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>
  191. <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>
  192. </div>
  193. <div class="pring_jg"></div>
  194. </div>
  195. <template v-for="(tableData,index) in group.tableList">
  196. <template v-for="(itemTable,itemIndex) in tableData">
  197. <div class="area_module" v-if="group.tablePagesNum[index][itemIndex] == page && itemTable.length > 0">
  198. <div class="area_module_title">{{group.groupName}}分析表</div>
  199. <div class="area_module_table">
  200. <el-table border :data="itemTable" stripe align="center">
  201. <el-table-column v-for="header in (group?.staticHeader ?? [])" align="center" :label="header.name" :min-width="header.prop=='smallQuestionNames'?120:90" show-overflow-tooltip>
  202. <template slot-scope="scope">
  203. {{ scope.row[header.prop] || '-' }}
  204. </template>
  205. </el-table-column>
  206. <el-table-column v-for="header in (group?.headerList?.[index]?.[itemIndex] ?? [])" align="center" :label="header.name" :min-width="header.prop=='smallQuestionNames'?120:90" show-overflow-tooltip>
  207. <template slot-scope="scope">
  208. <template v-if="header.prop == 'score'">
  209. <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
  210. * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
  211. * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
  212. <template v-if="group.studentOpenness == 2 || group.studentOpenness == 4 || group.studentOpenness == 6">
  213. <template v-if="!isNaN(scope?.row?.score)">
  214. <img class="right_or_wrong_icon" v-if="scope.row.fullScore == scope.row.score" src="@/assets/report/score_yes_icon.webp" />
  215. <img class="right_or_wrong_icon" v-else-if="scope.row.score == 0" src="@/assets/report/score_no_icon.webp" />
  216. <img class="right_or_wrong_icon" v-else src="@/assets/report/score_dimidiate_icon.webp" />
  217. </template>
  218. <template v-else>{{ scope?.row?.score ?? '-' }}</template>
  219. </template>
  220. <template v-else>{{ scope.row.score || '-' }}</template>
  221. </template>
  222. <!-- 包含小题 -->
  223. <template v-else-if="header.prop == 'smallQuestionNames' && scope?.row?.[header.prop] && Object.prototype.toString.call(scope.row[header.prop]) == '[object Array]'">
  224. {{ scope.row[header.prop].join('、') }}
  225. </template>
  226. <template v-else-if="header.prop=='scoreRateStr'">
  227. <template v-if="scope?.row?.scoreRate && !isNaN(scope?.row?.scoreRate)">
  228. <span style="color:#EE6666;" v-if="Number(scope?.row?.scoreRate) < 60">{{ scope?.row?.[header.prop] }}</span>
  229. <span style="color:#FAC858;" v-else-if="Number(scope?.row?.scoreRate) >= 60 && Number(scope?.row?.scoreRate) < 80">{{ scope?.row?.[header.prop] }}</span>
  230. <span style="color:#3BA272;" v-else-if="Number(scope?.row?.scoreRate) >= 80 && Number(scope?.row?.scoreRate) <= 100">{{ scope?.row?.[header.prop] }}</span>
  231. <span v-else>{{ scope?.row?.[header.prop] ?? '-'}}</span>
  232. </template>
  233. <template v-else>{{ scope?.row?.[header.prop] ?? '-'}}</template>
  234. </template>
  235. <template v-else-if="header.prop == 'difficultyName'">
  236. <span :class="GetDifficultyClass(scope.row[header.prop])"></span>
  237. <span>{{ GetDifficultyName(scope.row[header.prop]) }}</span>
  238. </template>
  239. <template v-else>{{ scope.row[header.prop] || '-' }}</template>
  240. </template>
  241. </el-table-column>
  242. </el-table>
  243. </div>
  244. </div>
  245. <template v-if="group.tablePagesNum[index][itemIndex] == page && itemTable.length > 0">
  246. <div class="pring_jg" style="height: 29px;border-bottom: 1px solid #F3F3F3;box-sizing: border-box;"></div>
  247. <div class="pring_jg"></div>
  248. </template>
  249. </template>
  250. </template>
  251. <div class="area_module" v-if="group.type=='knowledgePointQuestionData' && group?.knowLedgeLayering && page == knowLedgeLayeringPageNum[subKey]">
  252. <div class="area_module_title">{{group.groupName}}分层分析</div>
  253. <div class="area_module_table">
  254. <ul class="student_know_paper">
  255. <li>
  256. <div class="li_left">
  257. <span>满分区</span>
  258. <span>(得满分的知识点)</span>
  259. </div>
  260. <div class="li_know">{{ group.knowLedgeLayering.fullScore }}{{ group.knowLedgeLayering.fullScore ? '。':'' }}</div>
  261. </li>
  262. <li>
  263. <div class="li_left">
  264. <span>突破升级区</span>
  265. <span>(得分率高于同层次,但低于上一层次平均水平的知识点)</span>
  266. </div>
  267. <div class="li_know">{{ group.knowLedgeLayering.breakThrough }}{{ group.knowLedgeLayering.breakThrough ? '。':'' }}</div>
  268. </li>
  269. <li>
  270. <div class="li_left">
  271. <span>就近发展区</span>
  272. <span>(得分率低于同层次平均水平的知识点)</span>
  273. </div>
  274. <div class="li_know">{{ group.knowLedgeLayering.develop }}{{ group.knowLedgeLayering.develop ? '。':'' }}</div>
  275. </li>
  276. </ul>
  277. </div>
  278. <div class="pring_jg"></div>
  279. </div>
  280. </template>
  281. <!-- 历次 -->
  282. <!-- <div class="area_module" v-if="singleSubjectData?.[subKey]?.historyExamData?.pageNum==page && singleSubjectData[subKey].historyExamData.chartData.length > 0">
  283. <div class="area_module_title">历次标准分追踪分析图</div>
  284. <div class="area_module_chart">
  285. <LineChart v-if="singleSubjectData?.[subKey]?.historyExamData?.datay.length>0" :datax="singleSubjectData[subKey].historyExamData.datax" :datay="singleSubjectData[subKey].historyExamData.datay" :title="singleSubjectData[subKey].historyExamData.title"
  286. :extraText="false" :showBackground="false" :isShowLabel="true" labelColor="#333333" :legendList="singleSubjectData[subKey].historyExamData.legendList" :tooltipData="singleSubjectData[subKey].historyExamData.tooltipData" :gridLeft="0" :gridRight="0" :gridTop="25" :fontSize="14" :fontColor="'#333333'" :showCheckBox="false" reportHeight="270px" style="min-height:270px!important;">
  287. </LineChart>
  288. </div>
  289. <div class="pring_jg"></div>
  290. </div> -->
  291. <div class="area_module" v-if="singleSubjectData?.[subKey]?.suggestionHtml && singleSubjectData?.[subKey]?.suggestionPageNum == page">
  292. <div class="area_module_title">总结建议</div>
  293. <div class="area_module_describe" style="margin-top: 0;" v-html="singleSubjectData?.[subKey]?.suggestionHtml"></div>
  294. <div class="pring_jg"></div>
  295. </div>
  296. <!-- 答题卡 -->
  297. <template v-for="(paperItem,paperIndex) in (singleSubjectData?.[subKey]?.paperImageList || [])">
  298. <div class="area_module area_module_img" v-if="singleSubjectData?.[subKey]?.paperImagePageNum?.[paperIndex] == page">
  299. <PaperImage v-if="paperItem.picUrl" :paperImgUrl="paperItem.picUrl" :usedCardType="singleSubjectData?.[subKey]?.usedCardType" :drawData="paperItem.questionVOS || []" :isDrag="false" :isWheel="false" :isShowContextMenu="false" rotateDeg="-90"></PaperImage>
  300. </div>
  301. </template>
  302. </template>
  303. <div class="area_page_number">第 {{ page }} 页</div>
  304. </div>
  305. </template>
  306. <template v-else>
  307. <!-- 生成翻书效果 -->
  308. <div class="gradient"></div>
  309. <img :src="slotProps.content" style="width: 100%;height: 100%;" />
  310. </template>
  311. </template>
  312. </BookFlip>
  313. </template>
  314. <script>
  315. import BookFlip from './components/bookFlip.vue';
  316. import BarChart from "@/views/analysisReport/components/dCharts/barChart"; //单柱状图组件
  317. import RadarCharts from "@/views/analysisReport/components/dCharts/radarCharts";//G10-G1雷达图
  318. import DifferenceChart from "@/views/analysisReport/components/dCharts/differenceChart"; //率差图
  319. import LineChart from "@/views/analysisReport/components/dCharts/lineChart";//折线图
  320. import PaperImage from '@/components/PaperImage.vue';//答题卡
  321. import { mapGetters } from "vuex";
  322. import {getApiName} from '@/utils/common';
  323. // import { jsPDF } from "jspdf";
  324. import html2canvas from "html2canvas";
  325. export default {
  326. components: { BookFlip, BarChart, RadarCharts, DifferenceChart, LineChart,PaperImage},
  327. data() {
  328. return {
  329. pageKey:1,
  330. headerLeftIcon: require("@/assets/report/header_left_student.webp"),
  331. headerRightIcon: require("@/assets/report/header_right_student.webp"),
  332. // 书页数据(长度为4,偶数页)
  333. colors: this.$global.getScorePerformanceAnalysis(),//按顺序显示的20个颜色值
  334. pageCount:15,//页数 第一页不处理
  335. printPageHeight:1245,//A4纸高度 去掉边距 40
  336. chartHeight:270,//echart 高度
  337. moduleHeightData:[],//每个模块的高度
  338. modulePageData:[],//每个模块对应的页码
  339. stuClasName:'',
  340. multiSubjectData: {
  341. tablePagesNum:[],
  342. tableList:[],
  343. headerList:[],
  344. staticHeaderData:[],
  345. singleSubject:[],
  346. standardScoreAnalysisStatus: 0,
  347. studentOpenness: '', //学生信息
  348. datax: [], //图数据
  349. datay: [], //图数据
  350. tooltipData: [],
  351. maxSubject: '',
  352. minSubject: ''
  353. },//总分成绩分析
  354. historyExamData: {
  355. pageNum:'',
  356. chartData: [],
  357. datax: [],
  358. datay: [],
  359. title: [],
  360. legendList: [],
  361. tooltipData:[]
  362. }, //总分历次信息(联考)
  363. suggestionHtml: null,//总结建议
  364. multiSuggestionPageNum:'',//总分 总结建议
  365. singleSubjectData:[],//单科数据
  366. knowLedgeLayeringData:[],//知识点分层
  367. knowLedgeLayeringPageNum:[],//知识点分层分页
  368. bookPageImages:[],//生成的图片地址
  369. // showReportLoading:false,
  370. targetProgress:0,
  371. timer:null,
  372. loading:true,
  373. loadingText:'拼命加载中(1%)……',
  374. openLoading:false,
  375. };
  376. },
  377. computed: {
  378. reportTitle() {
  379. return this?.$store?.state?.report?.examSelectItem?.examName ?? '';
  380. },
  381. reportParam() {
  382. return {
  383. examLevel: this.$store.state.report.examLevel, // 任务等级联考还是单校
  384. // schoolId: this.$store.state.report.studentReportFilterObject.schoolId, // 学校id
  385. // contrastExamIds: this.$store.state.report.lastExamSelectIds, //多次考试任务对比ID,不包含当前任务ID
  386. // examId: this.$store.state.report.examId, // 当前考试ID
  387. // subjectCode: this.$store.state.report.studentReportFilterObject.subjectCode, //科目code
  388. // subjectGroupType: this.$store.state.report.filterObject.subjectGroupType, // 科目是否为组合
  389. // isTotal: this.$store.state.report.filterObject.isTotal, //是否为总分科目 1为总分 0为非总分
  390. // classIdCode: this.$store.state.report.studentReportFilterObject.classIdCode, // 班级idcode
  391. // classGroupName: this.$store.state.report.studentReportFilterObject.classGroupName, // 班级名称
  392. // registrationName: this.$store.state.report.studentReportFilterObject.registrationName, // 学籍名称
  393. // studentName:this.$store.state.report.studentReportFilterObject.studentName, //学生名称
  394. // registrationCode:this.$store.state.report.studentReportFilterObject.registrationCode //学生学籍号
  395. examLevel: this.$store.state.report.filterObject.examLevel, //1-联考 2-单校
  396. contrastExamIds: this.$store.state.report.filterObject.contrastExamIds, //多次考试任务对比ID,不包含当前任务ID
  397. examId: this.$store.state.report.filterObject.examId, //考试id
  398. subjectCode: this.$store.state.report.filterObject.subjectCode, //科目code
  399. subjectGroupType: this.$store.state.report.filterObject.subjectGroupType, //是否为组合科目 1为组合科目 0为非组合科目
  400. isTotal: this.$store.state.report.filterObject.isTotal //是否为总分科目 1为总分 0为非总分
  401. }
  402. },//分析报告公共参数变量
  403. ...mapGetters(["userInfo"]),
  404. studentName() {
  405. return this.userInfo.userName;
  406. },
  407. schoolType() {
  408. return sessionStorage.getItem('schoolType') //1:单校 2:联校
  409. },
  410. },
  411. watch: {
  412. // 监听 filterObject 对象变化(注意要开启深度监听)
  413. async reportParam() {
  414. // clearTimeout(this.timer); // 清除定时器,停止重复执行
  415. // this.timer = null;
  416. this.PageInit();//初始加载数据
  417. },//监听筛选数据变化
  418. },
  419. async created() {
  420. this.setHtmlFontSize();
  421. // 监听窗口缩放,实时更新
  422. window.addEventListener('resize', this.setHtmlFontSize);
  423. // 可选:监听页面加载完成后再设置一次(避免初始渲染问题)
  424. window.addEventListener('load', this.setHtmlFontSize);
  425. this.PageInit();//页面初始加载数据
  426. },
  427. destroyed(){
  428. // 根组件卸载时销毁监听
  429. window.removeEventListener('resize', this.setHtmlFontSize);
  430. document.documentElement.style.fontSize = '';
  431. },
  432. methods: {
  433. //初始化设置
  434. setHtmlFontSize(){
  435. // 设计稿宽度(根据实际设计稿调整,例如 1920px)
  436. const designWidth = 1920;
  437. // 设计稿中 1rem 对应的 px 值(例如 16px)
  438. const baseFontSize = 16;
  439. // 获取当前浏览器窗口宽度
  440. const windowWidth = document.documentElement.clientWidth || window.innerWidth;
  441. // 计算当前窗口下的 html font-size(按设计稿比例缩放)
  442. const htmlFontSize = (windowWidth / designWidth) * baseFontSize;
  443. // 应用到 html 元素
  444. document.documentElement.style.fontSize = `${htmlFontSize}px`;
  445. },
  446. async PageInit() {
  447. // let currentProgress = 1;
  448. // this.loadingText = `拼命加载中(1%)……`;
  449. // this.timer = setInterval(() => {
  450. // currentProgress++;
  451. // this.loadingText = `拼命加载中(${currentProgress}%)……`;
  452. // }, 500);
  453. this.loading = true;
  454. this.openLoading = false;
  455. this.bookPageImages = [];
  456. // this.targetProgress = 1;
  457. // this.showReportLoading = true;
  458. this.pageCount = 15;
  459. this.$nextTick(()=>{
  460. const titleHeight = this.$refs?.areaReportTitle?.offsetHeight || 0;
  461. const reportTitleHeight = titleHeight + 82;
  462. this.moduleHeightData = [reportTitleHeight];//每个模块的高度 初始标题高度
  463. })
  464. this.modulePageData = [1];
  465. this.multiSuggestionPageNum = '';//总分 总结建议
  466. this.singleSubjectData = [];//单科数据
  467. this.knowLedgeLayeringData = [];//知识点分层
  468. this.knowLedgeLayeringPageNum = [];//知识点分层分页
  469. this.pageKey += 1;
  470. //多科成绩总览 科目标准分分析
  471. await this.QueryMultiSubjectData();
  472. //学生端查询总分,多科历次信息(联考)
  473. // await this.QueryHistoryExamData();
  474. // 学生端查询总分,多科总结建议信息(联考)
  475. await this.QuerySuggestionData();
  476. let index = 0;
  477. for (const element of this.multiSubjectData.singleSubject){
  478. //单科每个模块标题分页
  479. this.singleSubjectData.push({
  480. titlePageNum:this.SingleChartPage(82),
  481. scrolTablePagesNum:[],//成绩单
  482. scrolTableList:[],
  483. scrolHeaderList:[],
  484. groupQuestionData:[],//小题分组、大题分组、知识点、自定义分组
  485. historyExamData:{
  486. pageNum:'',
  487. chartData: [],
  488. datax: [],
  489. datay: [],
  490. title: [],
  491. legendList: [],
  492. tooltipData:[]
  493. },
  494. suggestionPageNum:'',//总结建议分页
  495. suggestionHtml: '',//总结建议
  496. paperImageList:[],//答题卡
  497. paperImagePageNum:[],//答题卡页码
  498. })
  499. await this.QueryOneSubjectData(element.subjectCode,index);
  500. await this.QueryOneSubjectSmallQuestionData(element.subjectCode,index);
  501. await this.QueryOneSubjectGroupQuestionData(element.subjectCode,index);
  502. await this.QueryOneSubjectCustomGroupQuestion(element.subjectCode,index);
  503. //学生端查询单科-历次查询(联考)
  504. // await this.QueryOneSubjectHistoryExamData(element.subjectCode,index);
  505. await this.QueryOneSubjectSuggestionData(element.subjectCode,index);
  506. await this.FindStudentCard(element.subjectCode,index);
  507. index++; // 每次循环后索引+1
  508. }
  509. this.pageCount = this.modulePageData.length > 0 ? Math.max(...this.modulePageData) : 1;
  510. this.loading = false;
  511. this.$emit('isPdfDataLoadEnd');//是否显示下载pdf按钮
  512. console.log(this.pageCount,this.modulePageData,this.moduleHeightData,777777)
  513. // this.$nextTick(()=>{
  514. // setTimeout(()=>{
  515. // // clearTimeout(this.timer); // 清除定时器,停止重复执行
  516. // // this.GetPageImages(currentProgress);
  517. // this.GetPageImages();
  518. // },2000)
  519. // })
  520. },
  521. //下载预览图片
  522. OpenBookImages(){
  523. if(this.bookPageImages.length){
  524. this.$refs.bookFlipBox.showFullScreen()
  525. }else{
  526. this.openLoading = true;
  527. this.$nextTick(()=>{
  528. setTimeout(()=>{
  529. this.GetPageImages();
  530. },2000)
  531. })
  532. }
  533. },
  534. //获取图片
  535. async GetPageImages(){
  536. //获取所有的area_page 元素
  537. const elements = document.querySelectorAll(".web_mode .web_area_page");
  538. // const stepLens = elements?.length || 1;
  539. // const remainingProgress = 100 - progress;//剩余进度
  540. // const perStepProgress = Math.floor(remainingProgress / stepLens) || 1; // 每次增加的进度 向下取整
  541. // const pdf = new jsPDF("p", "pt", "a4"); // 'p'表示纵向,'a4'表示A4纸张尺寸
  542. // const pdfWidth = pdf.internal.pageSize.getWidth(); //获取pdf的宽度
  543. // const pdfHeight = pdf.internal.pageSize.getHeight(); //获取pdf的高度
  544. // let yPos = 0; //当前图像在pdf页面上的垂直位置的变量
  545. let i = 1;
  546. // let currentProgress = progress;
  547. for (const element of elements) {
  548. await html2canvas(element, {
  549. scale: 2, // 增加缩放比例
  550. useCORS: true, // 允许跨域
  551. logging: false, // 是否打印调试日志(开发时开启,生产关闭)
  552. letterRendering: true, // 文字抗锯齿 启用字母渲染
  553. }).then(async (canvas) => {
  554. // const imgData = canvas.toDataURL("image/png");
  555. const blob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
  556. const imgUrl = URL.createObjectURL(blob);
  557. console.log(imgUrl,89999)
  558. this.bookPageImages.push(imgUrl);
  559. // currentProgress = Math.min(Math.round((i / stepLens) * 100),100);
  560. // currentProgress = Math.min(progress + i * perStepProgress,100);
  561. // this.targetProgress = currentProgress
  562. // this.loadingText = `拼命加载中(${currentProgress}%)……`;
  563. // const imgProps = pdf.getImageProperties(imgData); // 获取图像的属性,包括宽度和高度
  564. // const imgWidth = imgProps.width;
  565. // const imgHeight = imgProps.height;
  566. // const ratio = Math.min(pdfWidth / imgWidth, pdfHeight / imgHeight); //计算图片的缩放比例
  567. // const adjustWidth = imgWidth * ratio;
  568. // const adjustHeight = imgHeight * ratio;
  569. // // 在添加每个图像之前,检查当前页面的高度是否足够。如果不够,则添加新页面,并将 yPos 重置为 0
  570. // if (yPos + adjustHeight > pdfHeight) {
  571. // pdf.addPage();
  572. // yPos = 0;
  573. // }
  574. // // 将图像添加到pdf中
  575. // pdf.addImage(imgData, "PNG", 0, yPos, adjustWidth, adjustHeight);
  576. // yPos += adjustHeight;
  577. // // 如果添加图像后剩余空间不足一页,则添加新页面
  578. // if (yPos > pdfHeight) {
  579. // pdf.addPage();
  580. // yPos = 0;
  581. // }
  582. i++;
  583. })
  584. }
  585. // if(currentProgress < 100){
  586. // this.loadingText = `拼命加载中(100%)……`;
  587. // }
  588. // 保存pdf文件
  589. // pdf.save("联校报告册.pdf");
  590. // this.showReportLoading = false;
  591. setTimeout(()=>{
  592. // this.loading = false;
  593. this.openLoading = false;
  594. this.$refs.bookFlipBox.showFullScreen()
  595. },500)
  596. },
  597. //总分成绩分析
  598. async QueryMultiSubjectData() {
  599. await this.$api.reportStudent[getApiName()].queryMultiSubjectData({
  600. ...this.reportParam,
  601. subjectGroupType: 1, // 科目是否为组合
  602. isTotal: 1, //是否为总分科目 1为总分 0为非总分
  603. }).then(res => {
  604. if (res.code == 200 && res.data) {
  605. const titleData = res?.data?.titleData || [];
  606. this.multiSubjectData.studentOpenness = res?.data?.studentOpenness ?? '';
  607. const headerData = titleData.filter(item=>item.prop!='imgUrlList' && item.prop!='subjectName');
  608. const staticHeaderData = titleData.filter(item=>item.prop=='subjectName');
  609. const tableData = res?.data?.tableData || [];
  610. this.stuClasName = tableData?.find(item=>item.subjectCode==0)?.className || '';
  611. //表格分页
  612. const pageTableData = this.TableRowAndColumnPage(headerData,tableData,7,1);//8列一个表
  613. this.multiSubjectData.tablePagesNum = pageTableData.tablePagesNum;
  614. this.multiSubjectData.tableList = pageTableData.tableList;
  615. this.multiSubjectData.headerList = pageTableData.headerList;
  616. this.multiSubjectData.staticHeaderData = staticHeaderData;//静态表头
  617. //标准分分析图
  618. this.multiSubjectData.datax = []
  619. this.multiSubjectData.datay = []
  620. this.multiSubjectData.tooltipData = []
  621. this.multiSubjectData.standardScoreAnalysisStatus = res?.data?.standardScoreAnalysisStatus ?? 1;
  622. //总分
  623. const totalScore = tableData.filter(item => item.isTotal == 1)
  624. //组合
  625. const subjectGroup = tableData.filter(
  626. item => item.isTotal == 0 && item.subjectGroupType == 1
  627. )
  628. //单科
  629. const singleSubject = tableData.filter(
  630. item => item.isTotal == 0 && item.subjectGroupType == 0
  631. )
  632. this.multiSubjectData.singleSubject = singleSubject;//单科
  633. const chartData = [...totalScore, ...subjectGroup, ...singleSubject];
  634. let datax = [],datay = [];
  635. chartData.forEach(item => {
  636. this.multiSubjectData.datax.push(item?.subjectName ?? '-')
  637. this.multiSubjectData.datay.push(!item?.standardScore || item?.standardScore == '-' ? 0 : item?.standardScore)
  638. if (item.isTotal == 0 && item.subjectGroupType == 0) {
  639. datax.push(item?.subjectName ?? '')
  640. datay.push(item?.standardScore ?? 0)
  641. }
  642. })
  643. let maxSubject = [],minSubject = []
  644. datay.forEach((item, k) => {
  645. if (Number(item) > 0) {
  646. maxSubject.push(datax[k])
  647. }
  648. if (Number(item) < 0) {
  649. minSubject.push(datax[k])
  650. }
  651. })
  652. this.multiSubjectData.maxSubject = maxSubject.join('、')
  653. this.multiSubjectData.minSubject = minSubject.join('、')
  654. //标准分分析图分页
  655. this.$nextTick(()=>{
  656. if((this.multiSubjectData.standardScoreAnalysisStatus === 0 && this.schoolType == 2) || this.schoolType == 1){
  657. const desHeight = this.$refs?.standardScoreChartDes?.offsetHeight || 0;
  658. const divHeight = 404 + desHeight;
  659. this.multiSubjectData.chartPagesNum = this.SingleChartPage(this.multiSubjectData.datay.length > 0 ? divHeight : 0);
  660. }else{
  661. this.multiSubjectData.chartPagesNum = this.SingleChartPage(0);
  662. }
  663. // console.log(divHeight,desHeight,this.multiSubjectData.chartPagesNum,13322133)
  664. })
  665. } else {
  666. this.multiSubjectData.studentOpenness = '';
  667. this.multiSubjectData.tablePagesNum = [];
  668. this.multiSubjectData.tableList = [];
  669. this.multiSubjectData.headerList = [];
  670. this.multiSubjectData.singleSubject = [];
  671. // 标准分分析
  672. this.multiSubjectData.datax = []
  673. this.multiSubjectData.datay = []
  674. this.multiSubjectData.tooltipData = []
  675. this.multiSubjectData.standardScoreAnalysisStatus = 1;
  676. this.multiSubjectData.maxSubject = []
  677. this.multiSubjectData.minSubject = []
  678. this.multiSubjectData.chartPagesNum = '';//标准分分析图分页
  679. }
  680. })
  681. },
  682. //总分,多科历次信息
  683. async QueryHistoryExamData() {
  684. await this.$api.reportStudent[getApiName()].queryHistoryExamData({
  685. ...this.reportParam,
  686. subjectGroupType: 1, // 科目是否为组合
  687. isTotal: 1, //是否为总分科目 1为总分 0为非总分
  688. }).then(res => {
  689. if (res.code == 200 && res.data) {
  690. const detailData = (res.data?.detailData || []).reverse();
  691. this.historyExamData.chartData = detailData;
  692. const selectNames = res.data.selectNames || [];
  693. const selectVal = selectNames?.[0]?.prop ?? '';
  694. this.historyExamData.datax = [];
  695. let datay = [],tooltipData = [];
  696. detailData.forEach(item => {
  697. this.historyExamData.datax.push(item.examName)
  698. datay.push(item[selectVal])
  699. tooltipData.push({
  700. name: selectNames?.[0]?.name ?? '',
  701. value: item[selectVal]
  702. })
  703. })
  704. this.historyExamData.datay = [datay];
  705. this.historyExamData.tooltipData = [tooltipData];
  706. this.historyExamData.pageNum = this.SingleChartPage(this.historyExamData.chartData.length > 0 ? 363 : 0);
  707. } else {
  708. this.historyExamData.chartData = [];
  709. this.historyExamData.tooltipData = [];
  710. this.historyExamData.datax = [];
  711. this.historyExamData.datay = [];
  712. this.historyExamData.pageNum = '';
  713. }
  714. })
  715. },
  716. // 学生端查询总分,多科总结建议信息(联考)
  717. async QuerySuggestionData() {
  718. await this.$api.reportStudent[getApiName()].querySuggestionData({
  719. ...this.reportParam,
  720. subjectGroupType: 1, // 科目是否为组合
  721. isTotal: 1, //是否为总分科目 1为总分 0为非总分
  722. }).then(res => {
  723. if (res.code == 200 && res.data) {
  724. const data = res.data;
  725. const upSubjectList = data.upSubjectData || [];
  726. const downSubjectList = data.downSubjectData || [];
  727. const upSubjectData = upSubjectList.map(item => {
  728. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  729. return `${item.subjectName}(得分${item.score})`
  730. } else {
  731. return `${item.subjectName}(${item.score})`
  732. }}).join('、')
  733. const downSubjectData = downSubjectList.map(item => {
  734. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  735. return `${item.subjectName}(得分${item.score})`
  736. } else {
  737. return `${item.subjectName}(${item.score})`
  738. }}).join('、')
  739. if(data?.fullScore && data?.fullScore!='-'){
  740. const scoreText = data?.studentOpenness == 1 || data?.studentOpenness == 2 ? '总分' : '总分标准分为'
  741. const unit = data?.studentOpenness == 1 || data?.studentOpenness == 2 ? '分' : '';
  742. this.suggestionHtml = `${data?.studentName || ''}同学,本次考试${scoreText}<span style="color: #2e64fa">${data?.fullScore}</span>${unit},整体处于${data?.summarySuggestionLevel},`;
  743. if(upSubjectData){
  744. this.suggestionHtml += `<span style="color: #3ba272">${upSubjectData}</span>是你的优势学科,建议通过提分练习进行强化,继续保持这类学科的优势性${downSubjectData ? ';' : '。'}`;
  745. }
  746. if(downSubjectData){
  747. this.suggestionHtml += `<span style="color: #f56c6c">${downSubjectData}</span>是你的劣势学科,建议先加强学习,熟练掌握薄弱知识点的基础,然后通过提分练习进行巩固和强化,争取下次考试获得更优异的成绩!`;
  748. }
  749. }else{
  750. this.suggestionHtml = null
  751. }
  752. } else {
  753. this.suggestionHtml = null
  754. }
  755. this.$nextTick(()=>{
  756. const suggestionHeight = this.$refs?.multiSuggestionModule?.offsetHeight || 0;
  757. // console.log(suggestionHeight,99888)
  758. this.multiSuggestionPageNum = this.SingleChartPage(this.suggestionHtml?suggestionHeight:0);
  759. })
  760. })
  761. },
  762. //学生端查询单科-我的成绩
  763. async QueryOneSubjectData(subjectCode,index) {
  764. await this.$api.reportStudent[getApiName()].queryOneSubjectData({
  765. ...this.reportParam,
  766. subjectGroupType: 0, // 科目是否为组合
  767. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  768. subjectCode:subjectCode
  769. }).then(res => {
  770. if (res.code == 200 && res.data) {
  771. const headData = [{
  772. name:'班级',
  773. prop:'className',
  774. display:true
  775. },{
  776. name:'原始分',
  777. prop:'score',
  778. display:res?.data?.scoreStatus === 0 //0-显示,1-不显示
  779. },{
  780. name:'赋分',
  781. prop:'rateScore',
  782. display:res?.data?.rateScoreStatus === 0 //0-显示,1-不显示
  783. },{
  784. name:'班排',
  785. prop:'classRank',
  786. display:res?.data?.classRankStatus === 0
  787. },{
  788. name:'年排',
  789. prop:'schoolRank',
  790. display:res?.data?.schoolRankStatus === 0
  791. },{
  792. name:'联排',
  793. prop:'examRank',
  794. display:res?.data?.examRankStatus === 0 && this.reportParam.examLevel == 1 && this.schoolType == 2
  795. },{
  796. name:'区排',
  797. prop:'regionRank',
  798. display:res?.data?.regionRankStatus === 0
  799. },{
  800. name:'赋分等级',
  801. prop:'rateScoreName',
  802. display:res?.data?.rateScoreStatus === 0
  803. },{
  804. name:'标准分',
  805. prop:'standardScore',
  806. display:(res?.data?.standardScoreStatus === 0 && this.schoolType == 2) || this.schoolType == 1
  807. },{
  808. name:'学业等级',
  809. prop:'gradeName',
  810. display:(res?.data?.gradeNameStatus === 0 && this.schoolType == 2) || this.schoolType == 1
  811. },{
  812. name:'得分率',
  813. prop:'scoreRate',
  814. display:res?.data?.scoreRateStatus === 0
  815. },{
  816. name:'班级最高分',
  817. prop:'classMaxScore',
  818. display:res?.data?.classMaxScoreStatus === 0 && this.schoolType == 2
  819. },{
  820. name:'年级最高分',
  821. prop:'gradeMaxScore',
  822. display:res?.data?.gradeMaxScoreStatus === 0 && this.schoolType == 2
  823. },{
  824. name:'联校最高分',
  825. prop:'examMaxScore',
  826. display:res?.data?.examMaxScoreStatus === 0 && this.schoolType == 2
  827. },{
  828. name:'班级均分',
  829. prop:'classAvgScore',
  830. display:res?.data?.classAvgScoreStatus === 0 && this.schoolType == 2
  831. },{
  832. name:'年级均分',
  833. prop:'gradeAvgScore',
  834. display:res?.data?.gradeAvgScoreStatus === 0 && this.schoolType == 2
  835. },{
  836. name:'联校均分',
  837. prop:'examAvgScore',
  838. display:res?.data?.examAvgScoreStatus === 0 && this.schoolType == 2
  839. }]
  840. const tableData = [res.data] || [];
  841. const headerList = headData.filter(item=>item.display);
  842. const pageTableData = this.TableRowAndColumnPage(headerList,tableData,8,1);//8列一个表
  843. this.singleSubjectData[index].scrolTablePagesNum = pageTableData.tablePagesNum;
  844. this.singleSubjectData[index].scrolTableList = pageTableData.tableList;
  845. this.singleSubjectData[index].scrolHeaderList = pageTableData.headerList;//表头
  846. } else {
  847. this.singleSubjectData[index].scrolTablePagesNum = [];
  848. this.singleSubjectData[index].scrolTableList = [];
  849. this.singleSubjectData[index].scrolHeaderList = [];//表头
  850. }
  851. })
  852. },
  853. //学生端查询单科-小题分析(表格-图表)
  854. async QueryOneSubjectSmallQuestionData(subjectCode,index) {
  855. await this.$api.reportStudent[getApiName()].queryOneSubjectSmallQuestionData({
  856. ...this.reportParam,
  857. subjectGroupType: 0, // 科目是否为组合
  858. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  859. subjectCode:subjectCode
  860. }).then(res => {
  861. if (res.code == 200 && res?.data?.tableData?.length > 0) {
  862. const tableData = res.data.tableData || [];
  863. const titleData = res.data.titleData || [];
  864. const studentOpenness = res.data?.studentOpenness ?? '';//控制得分显示对错或值
  865. this.TableChartData(tableData, titleData, studentOpenness, index,'smallQuestionData','小题',subjectCode);
  866. }
  867. })
  868. },
  869. //学生端查询单科-大题分析,知识点分析,能力要素分析(联考)
  870. async QueryOneSubjectGroupQuestionData(subjectCode,index) {
  871. await this.$api.reportStudent[getApiName()].queryOneSubjectGroupQuestionData({
  872. ...this.reportParam,
  873. subjectGroupType: 0, // 科目是否为组合
  874. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  875. subjectCode:subjectCode
  876. }).then(async res => {
  877. if (res.code == 200 && res.data) {
  878. const { bigQuestion, knowledgePointQuestion, abilityQuestion } = res.data
  879. if (bigQuestion && bigQuestion?.tableData?.length > 0) {
  880. const tableData = bigQuestion.tableData || [];
  881. const titleData = bigQuestion.titleData || [];
  882. const studentOpenness = bigQuestion?.studentOpenness ?? '';
  883. this.TableChartData(tableData, titleData, studentOpenness, index,'bigQuestionData','大题',subjectCode);
  884. }
  885. if (knowledgePointQuestion && knowledgePointQuestion?.tableData?.length > 0) {
  886. const tableData = knowledgePointQuestion.tableData || [];
  887. const titleData = knowledgePointQuestion.titleData || [];
  888. const studentOpenness = knowledgePointQuestion?.studentOpenness ?? '';
  889. this.TableChartData(tableData, titleData, studentOpenness, index,'knowledgePointQuestionData','知识点',subjectCode);
  890. if(this.schoolType == 2){
  891. // 等待 DOM 更新完成后获取高度
  892. await this.$nextTick();
  893. await new Promise(resolve => setTimeout(resolve, 2000)); // 额外延迟确保浏览器挂载
  894. //处理知识点分层分页
  895. const refName = `knowLedgeLayering_${subjectCode}`;
  896. const domHeight = this.$refs[refName]?.[0]?.offsetHeight || 0;
  897. this.knowLedgeLayeringPageNum.push(this.SingleChartPage(domHeight));
  898. }
  899. }
  900. if (abilityQuestion && abilityQuestion?.tableData?.length > 0) {
  901. const tableData = abilityQuestion.tableData || [];
  902. const titleData = abilityQuestion.titleData || [];
  903. const studentOpenness = abilityQuestion?.studentOpenness ?? '';
  904. this.TableChartData(tableData, titleData, studentOpenness, index,'abilityQuestionData','能力要素',subjectCode);
  905. }
  906. }
  907. })
  908. },
  909. //学生端查询单科-自定义分组(联考)
  910. async QueryOneSubjectCustomGroupQuestion(subjectCode,index) {
  911. await this.$api.reportStudent[getApiName()].queryOneSubjectCustomGroupQuestion({
  912. ...this.reportParam,
  913. subjectGroupType: 0, // 科目是否为组合
  914. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  915. subjectCode:subjectCode
  916. }).then(res => {
  917. if (res.code == 200 && res.data) {
  918. const customQuestionData = res?.data?.customQuestionData ?? []
  919. if (customQuestionData && customQuestionData.length > 0) {
  920. customQuestionData.forEach((item, key) => {
  921. const tableData = item?.questionData?.tableData || []
  922. const titleData = item?.questionData?.titleData || []
  923. const studentOpenness = res.data?.studentOpenness ?? ''
  924. this.TableChartData(tableData, titleData, studentOpenness, index,`customQuestionData${key}`,item.customName,subjectCode);
  925. })
  926. }
  927. }
  928. })
  929. },
  930. //学生端查询单科-历次查询(联考)
  931. async QueryOneSubjectHistoryExamData(subjectCode,index) {
  932. await this.$api.reportStudent[getApiName()].queryOneSubjectHistoryExamData({
  933. ...this.reportParam,
  934. subjectGroupType: 0, // 科目是否为组合
  935. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  936. subjectCode:subjectCode
  937. }).then(res => {
  938. if (res.code == 200 && res.data) {
  939. const detailData = (res.data?.detailData || []).reverse();
  940. // console.log(this.singleSubjectData[index],98899)
  941. this.singleSubjectData[index].historyExamData.chartData = detailData;
  942. const selectNames = res.data.selectNames || [];
  943. const selectVal = selectNames?.[0]?.prop ?? '';
  944. this.singleSubjectData[index].datax = [];
  945. let datay = [],tooltipData = [];
  946. detailData.forEach(item => {
  947. this.singleSubjectData[index].historyExamData.datax.push(item.examName)
  948. datay.push(item[selectVal])
  949. tooltipData.push({
  950. name: selectNames?.[0]?.name ?? '',
  951. value: item[selectVal]
  952. })
  953. })
  954. this.singleSubjectData[index].historyExamData.datay = [datay];
  955. this.singleSubjectData[index].historyExamData.tooltipData = [tooltipData];
  956. this.singleSubjectData[index].historyExamData.pageNum = this.SingleChartPage(this.singleSubjectData[index].historyExamData.chartData.length > 0 ? 363 : 0);
  957. }
  958. })
  959. },
  960. //学生端查询单科-总结建议
  961. async QueryOneSubjectSuggestionData(subjectCode,index) {
  962. await this.$api.reportStudent[getApiName()].queryOneSubjectSuggestionData({
  963. ...this.reportParam,
  964. subjectGroupType: 0, // 科目是否为组合
  965. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  966. subjectCode:subjectCode
  967. }).then(res => {
  968. if (res.code == 200 && res.data) {
  969. const data = res.data
  970. //* 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
  971. //* 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
  972. //* 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错
  973. const upSubjectList = data?.upSubjectData || [];
  974. const downSubjectList = data?.downSubjectData || [];
  975. const upSubjectData = upSubjectList.map(item => {
  976. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  977. return `${item.subjectName}得分<span style="color: #3BA272;">${item.score}</span>分`
  978. } else {
  979. return `${item.subjectName}标准分为<span style="color: #3BA272;">${item.score}</span>`
  980. }
  981. }).join('、')
  982. const downSubjectData = downSubjectList.map(item => {
  983. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  984. return `${item.subjectName}得分<span style="color: #EE6666;">${item.score}</span>分`
  985. } else {
  986. return `${item.subjectName}标准分为<span style="color: #EE6666;">${item.score}</span>`
  987. }
  988. }).join('、')
  989. this.singleSubjectData[index].suggestionHtml = '';
  990. if (data.studentName && (upSubjectData || downSubjectData)) {
  991. this.singleSubjectData[index].suggestionHtml = `${data.studentName}同学,本次考试`
  992. }
  993. if (upSubjectData) {
  994. this.singleSubjectData[index].suggestionHtml += `${upSubjectData},是你的优势学科,建议通过提分练习进行强化,继续保持这类学科的优势性!`
  995. }
  996. if (downSubjectData) {
  997. this.singleSubjectData[index].suggestionHtml += `${downSubjectData},是你的劣势学科,建议先加强学习,熟练掌握薄弱知识点的基础,然后通过提分练习进行巩固和强化,争取下次考试获得更优异的成绩!`
  998. }
  999. this.$nextTick(()=>{
  1000. const suggestionHeight = this.$refs?.[`singleSubjectSuggestion_${index}`]?.[0]?.offsetHeight || 0;
  1001. // console.log(suggestionHeight,8999111)
  1002. this.singleSubjectData[index].suggestionPageNum = this.SingleChartPage(this.singleSubjectData[index].suggestionHtml?suggestionHeight:0);
  1003. })
  1004. } else {
  1005. this.singleSubjectData[index].suggestionHtml = ''
  1006. }
  1007. })
  1008. },
  1009. //答题卡
  1010. async FindStudentCard(subjectCode,index){
  1011. await this.$api.reportStudent[getApiName()].findStudentCard({
  1012. examId:this.reportParam.examId,
  1013. subjectCode:subjectCode,
  1014. registrationCode:this.reportParam.registrationCode
  1015. }).then(res => {
  1016. if (res.code == 200 && res.data) {
  1017. let paperImageList = res.data.pageVOS || [];
  1018. //先添加总分数据
  1019. let totalScore = {
  1020. questionName: '总分',
  1021. fullScore: res?.data?.fullScore || '',
  1022. score: res?.data?.levelName ?? res?.data?.totalScore,
  1023. displayType: res.data.displayType, //显示类型 0-分数 1-对错 2-等级
  1024. displayName: res.data.displayName, //显示值
  1025. correctType: res.data.correctType, //显示对错的时候 0-错 1-半对 2-全对
  1026. questionAnswer: '',
  1027. answer: '',
  1028. samplingPosition: '{"x":195,"y":247,"page":1}'
  1029. }
  1030. if (paperImageList.length > 0 && paperImageList[0].questionVOS) {
  1031. paperImageList[0].questionVOS.unshift(totalScore)
  1032. }
  1033. this.singleSubjectData[index].paperImageList = paperImageList;
  1034. this.singleSubjectData[index].usedCardType = res?.data?.usedCardType ?? 1;
  1035. for(let i = 0;i<paperImageList.length;i++){
  1036. const pageNum = this.SingleChartPage(this.printPageHeight);
  1037. this.singleSubjectData[index].paperImagePageNum.push(pageNum);
  1038. }
  1039. }
  1040. })
  1041. },
  1042. //处理数据
  1043. async TableChartData(tableData, titleData, studentOpenness, index,type,groupName,subjectCode) {
  1044. //柱状图
  1045. let datax = [],datay = [],radarChart = []
  1046. tableData.forEach(item => {
  1047. datax.push(item.questionName)
  1048. const scoreRate = item?.scoreRate ?? ''
  1049. datay.push(scoreRate)
  1050. radarChart.push([item.questionName, scoreRate])
  1051. })
  1052. //雷达图
  1053. const radarChartData = [['group', '得分率'], ...radarChart]
  1054. let chartHeight = 0;//小题分析只显示table 不显示图
  1055. if(type=='bigQuestionData'){
  1056. chartHeight = datay.length > 0 ? 363 : 0; //柱状图
  1057. }else if (type == 'smallQuestionData'){
  1058. chartHeight = 0;
  1059. } else{
  1060. chartHeight = datay.length > 0 ? 393 : 0;//雷达图
  1061. }
  1062. const chartPagesNum = this.SingleChartPage(chartHeight);
  1063. const staticHeader = titleData.slice(0,1);//固定表头
  1064. const dynamicHeader = titleData.slice(1);//动态分组标头
  1065. const pageTableData = this.TableRowAndColumnPage(dynamicHeader,tableData,7,1);//8列一个表
  1066. const tablePagesNum = pageTableData.tablePagesNum;
  1067. const tableList = pageTableData.tableList;
  1068. const headerList = pageTableData.headerList;//表头
  1069. //查询单科-知识点分层分析表(联考)
  1070. let knowLedgeLayering = null;
  1071. if(type == 'knowledgePointQuestionData' && this.schoolType== 2){
  1072. await this.$api.reportStudent[getApiName()].queryStudentKnowLedgeLayering({
  1073. ...this.reportParam,
  1074. subjectGroupType: 0, // 科目是否为组合
  1075. isTotal: 0, //是否为总分科目 1为总分 0为非总分
  1076. subjectCode:subjectCode
  1077. }).then(res => {
  1078. if (res.code == 200 && res.data) {
  1079. const { breakThrough,develop,fullScore } = res.data;
  1080. knowLedgeLayering = {
  1081. breakThrough:breakThrough || '',
  1082. develop:develop || '',
  1083. fullScore:fullScore || ''
  1084. }
  1085. //知识点
  1086. this.knowLedgeLayeringData.push({
  1087. subjectCode:subjectCode,
  1088. groupName:groupName,
  1089. knowLedgeLayering:knowLedgeLayering
  1090. })
  1091. }else{
  1092. knowLedgeLayering = null;
  1093. }
  1094. })
  1095. }
  1096. this.singleSubjectData[index].groupQuestionData.push({
  1097. type:type,
  1098. groupName:groupName,
  1099. studentOpenness:studentOpenness,
  1100. staticHeader:staticHeader,
  1101. headerList:headerList,
  1102. tableList:tableList,
  1103. tablePagesNum:tablePagesNum,
  1104. chartPagesNum:chartPagesNum,
  1105. datax:datax,
  1106. datay:datay,
  1107. radarChartData:radarChartData,
  1108. knowLedgeLayering:knowLedgeLayering
  1109. })
  1110. },
  1111. //按照原始顺序累加,当总和超过A4高度1285时,将当前元素放入下一组
  1112. groupByThreshold(arr, threshold) {
  1113. const result = [];
  1114. let currentGroup = [];
  1115. let currentSum = 0;
  1116. for (let i = 0; i < arr.length; i++) {
  1117. const num = arr[i];
  1118. // 如果当前组为空,直接添加
  1119. if (currentGroup.length === 0) {
  1120. currentGroup.push(num);
  1121. currentSum += num;
  1122. }
  1123. // 如果加上当前元素会超过阈值,则创建新组
  1124. else if (currentSum + num > threshold) {
  1125. result.push(currentGroup);
  1126. currentGroup = [num];
  1127. currentSum = num;
  1128. }
  1129. // 否则添加到当前组
  1130. else {
  1131. currentGroup.push(num);
  1132. currentSum += num;
  1133. }
  1134. }
  1135. // 添加最后一组
  1136. if (currentGroup.length > 0) {
  1137. result.push(currentGroup);
  1138. }
  1139. return result;
  1140. },
  1141. /*
  1142. *对表格横向和竖向分页
  1143. *dynamicHeader 动态表头
  1144. *tableData 表格数据
  1145. *groupSize 动态表头分页大小
  1146. *headNum 表头行数
  1147. */
  1148. TableRowAndColumnPage(dynamicHeader,tableData,groupSize,headNum){
  1149. /*
  1150. * 每个模块的高度
  1151. */
  1152. const tableTitle = 49;//表格标题高度
  1153. const tableHeadHeight = 41;//表头高度
  1154. const tableGap = 49;//表格和图表之间的间距
  1155. //对表格横向分页
  1156. const groupDynamicHeader = [];
  1157. for (let i = 0; i < dynamicHeader.length; i += groupSize) {
  1158. const group = dynamicHeader.slice(i, i + groupSize);
  1159. //表格补充
  1160. if(group.length > 0 && group.length!=groupSize && i > 0){
  1161. const tdLens = groupSize - group.length;
  1162. for(let j = 0; j < tdLens; j ++){
  1163. group.push({})
  1164. }
  1165. }
  1166. groupDynamicHeader.push(group)
  1167. }
  1168. let tablePagesNum = [],tableList = [],headerList = [];//当前模块所有table页码 表格 表格高度
  1169. for (let i = 0; i < groupDynamicHeader.length; i ++) {
  1170. let itemTablePagesNum = [],itemTableList = [],itemHeadder= [], moduleHeightData = [] ,isShowSplitLine = [];//每个table的页码 表格 表格高度 isShowSplitLine:表格是否显示分割线
  1171. //计算最后一页模块的高度
  1172. let lastPageDataSum = 0;
  1173. const lastPageNum = this.modulePageData.length > 0 ? this.modulePageData[this.modulePageData.length - 1] : 1;//最后一页页码
  1174. this.modulePageData.forEach((item,p)=>{
  1175. if(item == lastPageNum){
  1176. lastPageDataSum += this.moduleHeightData[p];
  1177. }
  1178. })
  1179. const remainHeight = this.printPageHeight - lastPageDataSum - (tableHeadHeight * headNum) - tableTitle - 41;//41 是距离底部的边距
  1180. const remainTableRow = Math.floor(remainHeight / 40);//剩余可放多少行
  1181. if(remainTableRow > 1){
  1182. const tableLens = tableData.length ?? 0;//表格行数量
  1183. if(tableLens > remainTableRow){//判断第二页是否有值
  1184. const pageTableHeight = this.printPageHeight - (tableHeadHeight * headNum) - tableTitle - 41;// 一页能放下的table的高度 41 是距离底部的边距
  1185. const tableRowNum = Math.floor(pageTableHeight / 40);//一页可放多少行
  1186. //第一页数据
  1187. const firstTableData = tableData.slice(0,remainTableRow);
  1188. itemTableList.push(firstTableData)
  1189. itemHeadder.push(groupDynamicHeader[i])
  1190. isShowSplitLine.push(false);//是否显示表格底部的分割线 第一页不显示
  1191. //第一页页码
  1192. // this.modulePageData.push(lastPageNum);
  1193. //当前表格第一页页码
  1194. itemTablePagesNum.push(lastPageNum);//图表分页页码
  1195. // 第一页高度
  1196. const tableHeight1 = firstTableData.length > 0 ? (tableHeadHeight * headNum) + tableTitle + tableGap + firstTableData.length * 40 : 0;
  1197. moduleHeightData.push(tableHeight1)
  1198. const otherTableData = tableData.slice(remainTableRow);//接取完上一页剩下的表格数据
  1199. // 按步长遍历,每次截取 表格行数 元素
  1200. for (let j = 0; j < otherTableData.length; j += tableRowNum) {
  1201. const group = otherTableData.slice(j, j + tableRowNum);
  1202. const key = j/tableRowNum;
  1203. //表格数据
  1204. itemTableList.push(group);
  1205. itemHeadder.push(groupDynamicHeader[i])
  1206. isShowSplitLine.push(false);//是否显示表格底部的分割线
  1207. //页码
  1208. // this.modulePageData.push(lastPageNum + key + 1);
  1209. //当前表格分页页码
  1210. itemTablePagesNum.push(lastPageNum + key + 1);
  1211. //高度
  1212. const tableHeight = group.length > 0 ? (tableHeadHeight * headNum) + tableTitle + tableGap + group.length * 40 : 0;
  1213. moduleHeightData.push(tableHeight)
  1214. }
  1215. }else{
  1216. const tableData1 = tableData.slice(0,remainTableRow);
  1217. const tableData2 = tableData.slice(remainTableRow);
  1218. itemTableList.push(tableData1,tableData2);
  1219. itemHeadder.push(groupDynamicHeader[i],groupDynamicHeader[i])
  1220. // this.modulePageData.push(lastPageNum,lastPageNum);
  1221. //页码
  1222. itemTablePagesNum.push(lastPageNum,lastPageNum)
  1223. //高度
  1224. const tableHeight1 = tableData1.length > 0 ? (tableHeadHeight * headNum) + tableTitle + tableGap + tableData1.length * 40 : 0;
  1225. const tableHeight2 = tableData2.length > 0 ? (tableHeadHeight * headNum) + tableTitle + tableGap + tableData2.length * 40 : 0;
  1226. moduleHeightData.push(tableHeight1,tableHeight2)
  1227. }
  1228. }else{
  1229. const pageTableHeight = this.printPageHeight - (tableHeadHeight * headNum) - tableTitle - 41;// 一页能放下的table的高度 41 是距离底部的边距
  1230. const tableRowNum = Math.floor(pageTableHeight / 40);//一页可放多少行
  1231. // 按步长遍历,每次截取 表格行数 元素
  1232. for (let j = 0; j < tableData.length; j += tableRowNum) {
  1233. const group = tableData.slice(j, j + tableRowNum);
  1234. const key = j/tableRowNum;
  1235. //表格数据
  1236. itemTableList.push(group);
  1237. itemHeadder.push(groupDynamicHeader[i])
  1238. // this.modulePageData.push(lastPageNum + key + 1);
  1239. //页码
  1240. itemTablePagesNum.push(lastPageNum + key + 1)
  1241. //高度
  1242. const tableHeight = group.length > 0 ? (tableHeadHeight * headNum) + tableTitle + tableGap + group.length * 40 : 0;
  1243. moduleHeightData.push(tableHeight)
  1244. }
  1245. }
  1246. this.modulePageData.push(...itemTablePagesNum);
  1247. this.moduleHeightData.push(...moduleHeightData);
  1248. // console.log(this.modulePageData,111333)
  1249. tableList.push(itemTableList)
  1250. headerList.push(itemHeadder)
  1251. tablePagesNum.push(itemTablePagesNum);//当前模块表格的分页页码
  1252. }
  1253. return {headerList,tablePagesNum,tableList}
  1254. },
  1255. /*
  1256. *单个图分页
  1257. *chartHeight 图表高度
  1258. */
  1259. SingleChartPage(chartHeight){
  1260. let chartPagesNum = '';//各分析图 高度
  1261. const prevModuleLastPageNum = this.modulePageData.length > 0 ? this.modulePageData[this.modulePageData.length - 1] : 1;//上一模块 最后一页页码
  1262. //上一模块最后一页高度 和 当前模块 echart高度
  1263. let prevModuleLastPageHeight = [],moduleChartHeight = [];
  1264. this.modulePageData.forEach((item,i)=>{
  1265. if(item == prevModuleLastPageNum){
  1266. prevModuleLastPageHeight.push(this.moduleHeightData[i])
  1267. moduleChartHeight.push(this.moduleHeightData[i]);//最后一页高度
  1268. }
  1269. })
  1270. // 将当前模块 echart高度
  1271. this.moduleHeightData.push(chartHeight)
  1272. moduleChartHeight.push(chartHeight)
  1273. //进行分页 满足一页的高度放在一起
  1274. const printPageGroup = this.groupByThreshold([...moduleChartHeight], this.printPageHeight);
  1275. //每个模块对应的页码
  1276. for (let i = 0; i < printPageGroup.length; i++) {
  1277. const arr = printPageGroup[i]
  1278. for (let j = 0; j < arr.length; j++) {
  1279. if(i == 0){//第一页
  1280. if(j > prevModuleLastPageHeight.length - 1){
  1281. this.modulePageData.push(prevModuleLastPageNum)
  1282. chartPagesNum = prevModuleLastPageNum
  1283. }
  1284. }else{
  1285. this.modulePageData.push(prevModuleLastPageNum + i);
  1286. chartPagesNum = prevModuleLastPageNum + i
  1287. }
  1288. }
  1289. }
  1290. return chartPagesNum
  1291. },
  1292. GetDifficultyClass(val) {
  1293. if (val == 1) {
  1294. return 'difficulty easy'
  1295. } else if (val == 2) {
  1296. return 'difficulty relatively_easy'
  1297. } else if (val == 3) {
  1298. return 'difficulty general'
  1299. } else if (val == 4) {
  1300. return 'difficulty more_difficult'
  1301. } else if (val == 5) {
  1302. return 'difficulty difficult'
  1303. } else {
  1304. return ''
  1305. }
  1306. },
  1307. GetDifficultyName(val) {
  1308. if (val == 1) {
  1309. return '容易'
  1310. } else if (val == 2) {
  1311. return '较易'
  1312. } else if (val == 3) {
  1313. return '一般'
  1314. } else if (val == 4) {
  1315. return '较难'
  1316. } else if (val == 5) {
  1317. return '困难'
  1318. } else {
  1319. return '-'
  1320. }
  1321. },
  1322. //点击顶部下载PDF按钮导出
  1323. DownloadPdf(){
  1324. if(this.$refs.bookFlipBox){
  1325. this.$refs.bookFlipBox.DownloadPdfNew();
  1326. }
  1327. },
  1328. //向父级页面传值关闭下载Pdf按钮loading
  1329. PdfLoadEnd(){
  1330. this.$emit('closePdfLoading')
  1331. },
  1332. }
  1333. };
  1334. </script>
  1335. <style scoped lang="scss">
  1336. .area_module_describe{
  1337. margin-top: 20px;
  1338. }
  1339. .card-container {
  1340. display: flex;
  1341. flex-wrap: wrap;
  1342. /* 允许换行 */
  1343. /* 设置元素之间间隔 */
  1344. gap: 10px;
  1345. .card {
  1346. // flex: 0 1 calc((100% - 240px) / 5);
  1347. flex-grow: 1; /* 使每个div平分可用空间 */
  1348. flex-basis: 0; /* 初始基础大小为0 */
  1349. width: 20%;
  1350. // max-width: 320px;
  1351. // width: 238px;
  1352. /* 每个卡片占据 18% 宽度,确保能在一行显示五个,考虑间隔 */
  1353. // flex: 0 0 16.5%; /* 每个卡片占据 18% 宽度,确保能在一行显示五个,考虑间隔 */
  1354. // border: 2px dashed #ccc;
  1355. border-radius: 10px;
  1356. padding: 12px 6px;
  1357. box-sizing: border-box;
  1358. text-align: center;
  1359. color: #fff;
  1360. /* 文字颜色可以根据背景调整 */
  1361. background-size: cover;
  1362. background-position: center;
  1363. height: 70px;
  1364. /* 可调整高度 */
  1365. // margin-bottom: 20px; /* 卡片底部间距 */
  1366. position: relative;
  1367. }
  1368. .background-image {
  1369. position: absolute;
  1370. top: 0;
  1371. right: 0;
  1372. /* 背景图片宽度 */
  1373. width: 100%;
  1374. height: 70px;
  1375. background-size: contain;
  1376. background-repeat: no-repeat;
  1377. background-position: center right;
  1378. z-index: 1;
  1379. /* 确保背景图片在文本之下 */
  1380. border-radius: 10px;
  1381. }
  1382. .statistic,.value {
  1383. position: relative;
  1384. z-index: 2;
  1385. /* 确保文本在背景图片之上 */
  1386. }
  1387. .statistic {
  1388. font-size: 13px;
  1389. font-weight: 400;
  1390. line-height: 22px;
  1391. text-align: left;
  1392. z-index: 2;
  1393. }
  1394. .value {
  1395. font-size: 16px;
  1396. font-weight: 600;
  1397. line-height: 20px;
  1398. text-align: left;
  1399. margin-top: 5px;
  1400. z-index: 2;
  1401. }
  1402. }
  1403. .area_module{
  1404. .area_module_content{
  1405. display: flex;
  1406. width: 100%;
  1407. justify-content: space-between;
  1408. .area_module_chart{
  1409. width: 35% !important;
  1410. }
  1411. .area_module_table{
  1412. width: 65% !important;
  1413. }
  1414. }
  1415. .area_module_chart{
  1416. &.justify_content{
  1417. display: flex;
  1418. gap: 0px 48px;
  1419. flex-wrap: wrap;
  1420. .item_progress{
  1421. width: 170px;
  1422. height: 180px;
  1423. display: inline-flex;
  1424. align-items: center;
  1425. position: relative;
  1426. :deep(.el-progress--circle) {
  1427. .el-progress__text{
  1428. font-size: 14px !important;
  1429. color: #5470C6 !important;
  1430. background: rgba(84,112,198,0.1);
  1431. width: 120px;
  1432. height: 120px;
  1433. border-radius: 50%;
  1434. position: absolute;
  1435. left: 50%;
  1436. top: 50%;
  1437. transform: translate(-50%, -50%);
  1438. display: flex;
  1439. align-items: center;
  1440. justify-content: center;
  1441. padding-top: 30px;
  1442. box-sizing: border-box;
  1443. }
  1444. }
  1445. .item_progress_name{
  1446. position: absolute;
  1447. left: 50%;
  1448. top: 37%;
  1449. transform: translate(-50%,0);
  1450. font-weight: 500;
  1451. font-size: 16px !important;
  1452. color: #5470C6 !important;
  1453. }
  1454. }
  1455. }
  1456. }
  1457. .area_module_table{
  1458. &.error{
  1459. :deep() .el-table{
  1460. .el-table__header-wrapper{
  1461. .el-table__header{
  1462. .is-group{
  1463. tr{
  1464. th.el-table__cell:nth-last-child(3){
  1465. border-right: 1px solid #EBEEF5;
  1466. }
  1467. &:nth-child(2){
  1468. display:none;
  1469. }
  1470. }
  1471. }
  1472. }
  1473. }
  1474. .el-table__cell{
  1475. &.white_space_normal{
  1476. .cell{
  1477. white-space: normal;
  1478. padding:10px 0 10px 10px !important;
  1479. }
  1480. }
  1481. }
  1482. // &.el-table--striped {
  1483. // .el-table__body {
  1484. // tr{
  1485. // &.el-table__row--striped{
  1486. // &.row_color_FFFFFF {
  1487. // td.el-table__cell{
  1488. // background: #FFFFFF;
  1489. // }
  1490. // }
  1491. // }
  1492. // }
  1493. // }
  1494. // }
  1495. // &.el-table--striped .el-table__body tr.el-table__row.row_color_FAFAFA td.el-table__cell{
  1496. // background: #FAFAFA;
  1497. // }
  1498. // &.el-table--striped .el-table__body tr.el-table__row--striped.row_color_FAFAFA td.el-table__cell{
  1499. // background: #FAFAFA;
  1500. // }
  1501. // &.el-table--enable-row-hover .el-table__body tr.row_color_FFFFFF:hover > td {
  1502. // background-color: transparent !important;
  1503. // }
  1504. }
  1505. }
  1506. .student_know_paper{
  1507. width: 100%;
  1508. box-sizing: border-box;
  1509. display: flex;
  1510. flex-direction: column;
  1511. border-radius: 6px;
  1512. border: 1px solid #EBEEF5;
  1513. li{
  1514. width: 100%;
  1515. border-top: 1px solid #EBEEF5;
  1516. box-sizing: border-box;
  1517. display: inline-flex;
  1518. &:first-child{
  1519. border-top: 0;
  1520. .li_left{
  1521. background-color: #EEF1FB;
  1522. span{
  1523. color: #5470C6;
  1524. }
  1525. }
  1526. }
  1527. &:nth-child(2){
  1528. .li_left{
  1529. background-color: #ECF6F1;
  1530. span{
  1531. color: #3BA272;
  1532. }
  1533. }
  1534. }
  1535. &:nth-child(3){
  1536. .li_left{
  1537. background-color: #FFFAEF;
  1538. span{
  1539. color: #FAC858;
  1540. }
  1541. }
  1542. }
  1543. .li_left{
  1544. width: 300px;
  1545. padding: 24px;
  1546. border-right: 1px solid #EBEEF5;
  1547. box-sizing: border-box;
  1548. display: inline-flex;
  1549. flex-direction: column;
  1550. justify-content: center;
  1551. flex-shrink: 0;
  1552. span{
  1553. font-weight: 500;
  1554. font-size: 20px;
  1555. line-height: 28px;
  1556. display: block;
  1557. text-align: center;
  1558. &:nth-child(2){
  1559. margin-top: 4px;
  1560. line-height: 20px;
  1561. font-weight: 400;
  1562. font-size: 14px;
  1563. color: #999999;
  1564. }
  1565. }
  1566. }
  1567. .li_know{
  1568. flex: 1;
  1569. padding: 20px;
  1570. box-sizing: border-box;
  1571. font-weight: 400;
  1572. font-size: 14px;
  1573. color: #666666;
  1574. line-height: 24px;
  1575. text-align: justified;
  1576. display: inline-flex;
  1577. align-items: center;
  1578. }
  1579. }
  1580. }
  1581. }
  1582. .difficulty {
  1583. width: 6px;
  1584. height: 6px;
  1585. display: inline-flex;
  1586. border-radius: 50%;
  1587. margin-right: 4px;
  1588. &.easy {
  1589. background: #3ba272;
  1590. }
  1591. &.relatively_easy {
  1592. background: #fac858;
  1593. }
  1594. &.general {
  1595. background: #5470c6;
  1596. }
  1597. &.more_difficult {
  1598. background: #ea7acb;
  1599. }
  1600. &.difficult {
  1601. background: #ee6666;
  1602. }
  1603. }
  1604. }
  1605. </style>