transcript_total.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="page_report">
  3. <div class="report_module">
  4. <div class="module_title">
  5. <div class="title_left">成绩总览</div>
  6. </div>
  7. <div class="module_table">
  8. <el-table :data="subjectData.tableData" v-loading="subjectLoading" :element-loading-text="loadingText"
  9. element-loading-spinner="el-icon-loading" element-loading-background="#ffffff" border stripe align="left">
  10. <el-table-column v-for="title in subjectData.titleData" :key="title.prop" align="center" :label="title.name">
  11. <template slot-scope="scope">
  12. <template v-if="title.prop == 'score' || title.prop == 'scoreRate'">
  13. <!-- * 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错
  14. * 3-得分显示对错,小题分显示分数,4-得分显示对错,小题分显示对错
  15. * 5-得分显示等级,小题分显示分数,6-得分显示等级,小题分显示对错 -->
  16. <template v-if="subjectData.studentOpenness == 3 || subjectData.studentOpenness == 4">
  17. <img v-if="scope.row.fullScore == scope.row?.[title.prop]" src="@/assets/stuIcon/icon_right.png" />
  18. <img v-else-if="scope.row?.[title.prop] == 0" src="@/assets/stuIcon/icon_error.png" />
  19. <img v-else src="@/assets/stuIcon/icon_half_right.png" />
  20. </template>
  21. <template v-else>{{ scope.row?.[title.prop] || "-" }}</template>
  22. </template>
  23. <template v-else-if="title.prop == 'imgUrlList'">
  24. <el-button v-if="scope.row.isTotal==0 || scope.row.subjectGroupType==0" type="text" :disabled="!scope?.row?.imgUrlList || scope?.row?.imgUrlList == '-'" @click="OpenStudentPaper(scope.row.subjectCode)">查看答题卡</el-button>
  25. <template v-else>-</template>
  26. </template>
  27. <template v-else>{{ scope.row?.[title.prop] || "-" }}</template>
  28. </template>
  29. </el-table-column>
  30. </el-table>
  31. <div class="page_jg_20"></div>
  32. </div>
  33. </div>
  34. <div class="report_module" v-if="suggestionData">
  35. <div class="module_title">
  36. <div class="title_left">总结建议</div>
  37. </div>
  38. <div class="module_describe suggestion">
  39. <ExpandableText :isExpanded="false" :shouldShowButton="false">
  40. {{ suggestionData?.studentName }}同学,本次考试{{ suggestionData?.studentOpenness == 1 ||
  41. suggestionData?.studentOpenness == 2 ?'总分':'总分标准分为' }}<span style="color: #2E64FA;">{{ suggestionData?.fullScore
  42. }}</span>{{ suggestionData?.studentOpenness == 1 || suggestionData?.studentOpenness == 2 ? '分' : '' }},整体处于{{
  43. suggestionData?.summarySuggestionLevel }},<template v-if="suggestionData?.upSubjectData"><span
  44. style="color: #3BA272;">{{
  45. suggestionData?.upSubjectData }}</span>是你的优势学科,建议通过提分练习进行强化,继续保持这类学科的优势性{{ suggestionData?.downSubjectData
  46. ? ';' :
  47. '。'
  48. }}</template><template v-if="suggestionData?.downSubjectData"><span style="color: #F56C6C;">{{
  49. suggestionData?.downSubjectData
  50. }}</span>是你的劣势学科,建议先加强学习,熟练掌握薄弱知识点的基础,然后通过提分练习进行巩固和强化,争取下次考试获得更优异的成绩!</template>
  51. </ExpandableText>
  52. </div>
  53. </div>
  54. <!-- 科目标准分分析 -->
  55. <div class="report_module">
  56. <div class="module_title" style="position: relative">
  57. <div class="title_left">科目标准分分析</div>
  58. </div>
  59. <div class="module_chart" v-if="subjectData.tableData.length > 0">
  60. <DifferenceChart :datax="subjectData.datax" :tooltipData="subjectData.tooltipData" :datay="subjectData.datay"
  61. :rate="0" :isClick="false"></DifferenceChart>
  62. </div>
  63. <div class="module_chart no_content_data" v-loading="subjectLoading" :element-loading-text="loadingText"
  64. element-loading-spinner="el-icon-loading" element-loading-background="#ffffff" v-else>
  65. <span>暂无数据</span>
  66. </div>
  67. <div class="module_describe">
  68. <ExpandableText>
  69. 说明:从标准分情况来看,这次考试<template v-if="subjectData.maxSubject"><span style="color: #3BA272">{{ subjectData.maxSubject
  70. }}</span>表现突出,请继续保持</template><template v-if="subjectData.minSubject">;<span style="color: #EE6666">{{
  71. subjectData.minSubject
  72. }}</span>标准分明显低于其他学科,可能会对总体排名造成影响,可结合错题梳理核心知识点,精准定位薄弱环节,制定针对性的提升计划,以实现各科均衡发展,进一步巩固整体成绩</template>。
  73. </ExpandableText>
  74. </div>
  75. </div>
  76. <div class="report_module">
  77. <div class="module_title">
  78. <div class="title_left">历次考试分析</div>
  79. <div class="title_right report_button">
  80. <div class="module_tab">
  81. <div class="tab_item" v-for="item in historyExamData.selectNames"
  82. :class="historyExamData.selectVal == item.prop ? 'tab_active' : ''" :key="item.prop"
  83. @click="ChangeSelectVal(item.prop, item.name)">
  84. {{ item.name }}
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="module_chart" v-if="historyExamData.chartData.length > 0">
  90. <LineChart :extraText="false" :showCheckBox="false" :showMarkPoint="false" :showBackground="false"
  91. :markNumber="historyExamData.markNumber" :datax="historyExamData.datax" :datay="historyExamData.datay"
  92. :title="historyExamData.title" :legendList="historyExamData.title"
  93. :yInverse="historyExamData.selectVal == 'examRank' || historyExamData.selectVal == 'schoolRank'? true : false" :tooltipData="historyExamData.tooltipData"
  94. :gridRight="40"></LineChart>
  95. </div>
  96. <div class="module_chart no_content_data" v-loading="historyExamLoading" :element-loading-text="loadingText"
  97. element-loading-spinner="el-icon-loading" element-loading-background="#ffffff" v-else>
  98. <span>暂无数据</span>
  99. </div>
  100. <div class="page_jg_20"></div>
  101. </div>
  102. <GotoTop></GotoTop>
  103. <!-- 学生答题卡预览组件 -->
  104. <StudentPaper v-model="showStudentPaperDialog" :paperInfo="paperInfo" :currentPageIndex="currentPageIndex" :pageTitle="paperTitle"></StudentPaper>
  105. </div>
  106. </template>
  107. <script>
  108. import DifferenceChart from "@/views/analysisReport/components/dCharts/differenceChart"; //率差图
  109. import ExpandableText from "@/views/analysisReport/components/ExpandableText"; //文本内容展开收缩组件
  110. import LineChart from "@/views/analysisReport/components/dCharts/lineChart"; //折线图
  111. import GotoTop from "@/views/analysisReport/components/GotoTop"; //分析报告页面底部回到顶部组件
  112. import StudentPaper from '@/components/StudentPaper.vue';//学生答题卡预览组件
  113. import { mapGetters } from "vuex";
  114. export default {
  115. name: "subjectQuality",
  116. props: {},
  117. components: {
  118. DifferenceChart,
  119. ExpandableText,
  120. LineChart,
  121. GotoTop,
  122. StudentPaper
  123. },
  124. data() {
  125. return {
  126. subjectData: {
  127. titleData: [],
  128. studentOpenness: '',//学生信息
  129. tableData: [],
  130. datax: [], //图数据
  131. datay: [], //图数据
  132. tooltipData: [],
  133. maxSubject: '',
  134. minSubject: ''
  135. },
  136. subjectLoading: false, //加载状态
  137. historyExamLoading: false,
  138. loadingText: "加载中,请稍后……",
  139. historyExamData: {
  140. chartData: [],
  141. datax: [],
  142. datay: [],
  143. title: [],
  144. colors: ["#5470C6"],
  145. markNumber: [],
  146. selectNames: [],
  147. selectVal: 'standardScore'
  148. }, //线面积图
  149. suggestionData: null,
  150. showStudentPaperDialog:false,//显示答题卡弹框
  151. paperInfo:{},
  152. paperTitle:'',//答题卡弹框标题
  153. currentPageIndex:0,//当前选中的答题卡第几页
  154. };
  155. },
  156. watch: {
  157. reportParam() {
  158. this.PageInit();//初始加载数据
  159. },//监听筛选数据变化
  160. },
  161. computed: {
  162. ...mapGetters(["userInfo"]),
  163. pageName() {
  164. return this.$store.state.report.examSelectItem.examName
  165. },//考试名称
  166. reportParam() {
  167. return {
  168. examLevel: this.$store.state.report.filterObject.examLevel, //1-联考 2-单校
  169. contrastExamIds: this.$store.state.report.filterObject.contrastExamIds, //多次考试任务对比ID,不包含当前任务ID
  170. examId: this.$store.state.report.filterObject.examId, //考试id
  171. subjectCode: this.$store.state.report.filterObject.subjectCode, //科目code
  172. subjectGroupType:
  173. this.$store.state.report.filterObject.subjectGroupType, //是否为组合科目 1为组合科目 0为非组合科目
  174. isTotal: this.$store.state.report.filterObject.isTotal, //是否为总分科目 1为总分 0为非总分
  175. };
  176. }, //分析报告公共参数变量
  177. getSubjectName(){
  178. return this.$store.state.report.filterObject.subjectName
  179. },
  180. },
  181. created() { },
  182. mounted() {
  183. this.PageInit(); //页面初始加载数据
  184. },
  185. methods: {
  186. PageInit() {
  187. this.QueryMultiSubjectData();//多科成绩总览-科目标准分分析
  188. this.QueryHistoryExamData();//学生端查询总分,多科历次信息
  189. this.QuerySuggestionData();//学生端查询总分,多科总结建议信息
  190. },
  191. //多科成绩总览-科目标准分分析
  192. QueryMultiSubjectData() {
  193. // 获取表格数据
  194. this.subjectLoading = true;
  195. this.$api.reportStudent
  196. .queryMultiSubjectData(this.reportParam)
  197. .then((res) => {
  198. if (res.code == 200 && res.data) {
  199. this.subjectData.tableData = res.data.tableData || [];
  200. this.subjectData.studentOpenness = res.data.studentOpenness ?? '';
  201. this.subjectData.titleData = res.data.titleData || [];
  202. this.subjectData.datax = this.subjectData.tableData.map(item => item.subjectName);
  203. this.subjectData.datay = this.subjectData.tableData.map(item => item.standardScore);
  204. this.subjectData.tooltipData = this.subjectData.tableData.map(item => ({
  205. list: [{
  206. name: '标准分',
  207. value: item.standardScore ?? '',
  208. }],
  209. name: item.subjectName,
  210. }));
  211. let maxSubject = [], minSubject = [];
  212. this.subjectData.datay.forEach((item, k) => {
  213. if (Number(item) > 0) {
  214. maxSubject.push(this.subjectData.datax[k])
  215. }
  216. if (Number(item) < 0) {
  217. minSubject.push(this.subjectData.datax[k])
  218. }
  219. });
  220. this.subjectData.maxSubject = maxSubject.join('、');
  221. this.subjectData.minSubject = minSubject.join('、');
  222. } else {
  223. this.subjectData.tableData = [];
  224. this.subjectData.studentOpenness = '';
  225. this.subjectData.titleData = [];
  226. this.subjectData.datax = [];
  227. this.subjectData.datay = [];
  228. this.subjectData.tooltipData = [];
  229. this.subjectData.maxSubject = '';
  230. this.subjectData.minSubject = '';
  231. }
  232. })
  233. .finally(() => {
  234. this.subjectLoading = false;
  235. });
  236. },
  237. //学生端查询总分,多科历次信息
  238. QueryHistoryExamData() {
  239. this.historyExamLoading = true;
  240. let param = {
  241. ...this.reportParam
  242. }
  243. if(this.reportParam.subjectGroupType==1 && this.reportParam.isTotal==0){//学生端查询总分,多科历次信息,组合科目时,一定要传组合科目的名称,组合科目的历次是按照组合科目名称来查询
  244. param.subjectName = this.getSubjectName
  245. }
  246. this.$api.reportStudent.queryHistoryExamData({...param}).then((res) => {
  247. if (res.code == 200 && res.data) {
  248. const detailData = res.data?.detailData || [];
  249. this.historyExamData.chartData = detailData;
  250. this.historyExamData.selectNames = res.data.selectNames || [];
  251. this.historyExamData.selectVal = this.historyExamData?.selectNames?.[0]?.prop ?? '';
  252. this.historyExamData.datax = [];
  253. let datay = [], tooltipData = [];
  254. detailData.forEach(item => {
  255. this.historyExamData.datax.push(item.examName)
  256. datay.push(item[this.historyExamData.selectVal])
  257. tooltipData.push({
  258. name: this.historyExamData?.selectNames?.[0]?.name ?? '',
  259. value: item[this.historyExamData.selectVal]
  260. })
  261. });
  262. this.historyExamData.datay = [datay];
  263. this.historyExamData.tooltipData = [tooltipData];
  264. } else {
  265. this.historyExamData.chartData = [];
  266. this.historyExamData.datax = [];
  267. this.historyExamData.datay = [];
  268. this.historyExamData.selectNames = [];
  269. this.historyExamData.tooltipData = [];
  270. this.historyExamData.selectVal = '';
  271. }
  272. })
  273. .finally(() => {
  274. this.historyExamLoading = false;
  275. });
  276. },
  277. ChangeSelectVal(prop, name) {
  278. this.historyExamData.selectVal = prop;
  279. let datay = [], tooltipData = [];
  280. this.historyExamData.chartData.forEach(item => {
  281. datay.push(item[prop])
  282. tooltipData.push({
  283. name: name,
  284. value: item[prop]
  285. })
  286. });
  287. this.historyExamData.datay = [datay];
  288. this.historyExamData.tooltipData = [tooltipData];
  289. },
  290. //学生端查询总分,多科总结建议信息
  291. QuerySuggestionData() {
  292. this.$api.reportStudent
  293. .querySuggestionData(this.reportParam)
  294. .then((res) => {
  295. if (res.code == 200 && res.data) {
  296. const data = res.data;
  297. this.suggestionData = data;
  298. this.suggestionData.upSubjectData = data.upSubjectData.map(item => {
  299. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  300. return `${item.subjectName}(得分${item.score})`
  301. } else {
  302. return `${item.subjectName}(${item.score})`
  303. }
  304. }).join('、')
  305. this.suggestionData.downSubjectData = data.downSubjectData.map(item => {
  306. if (data.studentOpenness == 1 || data.studentOpenness == 2) {
  307. return `${item.subjectName}(得分${item.score})`
  308. } else {
  309. return `${item.subjectName}(${item.score})`
  310. }
  311. }).join('、')
  312. } else {
  313. this.suggestionData = null
  314. }
  315. });
  316. },
  317. //答题卡预览
  318. OpenStudentPaper(subjectCode){
  319. this.paperTitle = `${this.pageName}_${this.userInfo.userName}【${this.userInfo.registrationCode}】`;
  320. this.paperInfo = {examId:this.reportParam.examId,subjectCode:subjectCode};
  321. this.showStudentPaperDialog = true;
  322. },
  323. },
  324. };
  325. </script>
  326. <style lang="scss" scoped>
  327. .module_tab {
  328. width: auto !important;
  329. height: auto !important;
  330. padding: 0 10px !important;
  331. .tab_item {
  332. padding-bottom: 0 !important;
  333. &.tab_active {
  334. border-bottom: 0 !important;
  335. }
  336. }
  337. }
  338. .module_describe {
  339. &.suggestion {
  340. padding-top: 0 !important;
  341. }
  342. }
  343. </style>