index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="app-container" v-loading="loading">
  3. <div class="elective-report-container">
  4. <!-- print-hidden定义在PDF生成程序中 -->
  5. <div v-if="electiveVisible" class="print-hidden text-right mb10">
  6. <el-button type="primary" icon="el-icon-printer" @click="handlePrint">打印</el-button>
  7. </div>
  8. <div class="width100">
  9. <el-image :src="require('@/assets/images/elective/elective_report_cover.png')"></el-image>
  10. </div>
  11. <elective-test-reports></elective-test-reports>
  12. <el-divider class="new-page"><h1>选科大数据分析</h1></el-divider>
  13. <group-subject-query class="print-page"></group-subject-query>
  14. <el-divider class="new-page"><h1>自选专业</h1></el-divider>
  15. <major-match-optional class="print-page"></major-match-optional>
  16. <major-introduce-batch></major-introduce-batch>
  17. <el-divider class="new-page"><h1>选科成绩表</h1></el-divider>
  18. <group-score-table class="print-page"></group-score-table>
  19. <el-divider class="new-page"><h1>选科进程表</h1></el-divider>
  20. <elective-flow-table class="print-page"></elective-flow-table>
  21. <!-- AI分析可能有也可能没有,在elective-ai-analysis内部控制 -->
  22. <elective-ai-analysis></elective-ai-analysis>
  23. <el-divider class="new-page"><h1>选科录取分析报告</h1></el-divider>
  24. <elective-enroll-analysis class="print-page"></elective-enroll-analysis>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import consts from '@/common/mx-const'
  30. import ElectiveTestReports from '@/views/elective/report/components/elective-test-reports'
  31. import GroupSubjectQuery from '@/views/permission/components/group-subject-query'
  32. import RoundSelect from '@/views/system/user/profile/round-select'
  33. import MajorMatchOptional from '@/views/elective/report/components/major-match-optional'
  34. import MajorIntroduceBatch from '@/views/elective/report/components/major-introduce-batch'
  35. import GroupScoreTable from '@/views/elective/report/components/group-score-table'
  36. import ElectiveFlowTable from '@/views/elective/report/components/elective-flow-table'
  37. import ElectiveEnrollAnalysis from '@/views/elective/report/components/elective-enroll-analysis'
  38. import ElectiveAiAnalysis from '@/views/elective/report/components/elective-ai-analysis'
  39. import { getSelectedBookReport } from '@/api/webApi/elective/selected-subject'
  40. export default {
  41. name: 'report-index',
  42. extends: RoundSelect,
  43. components: {
  44. ElectiveAiAnalysis,
  45. ElectiveEnrollAnalysis,
  46. ElectiveFlowTable,
  47. GroupScoreTable,
  48. MajorIntroduceBatch,
  49. MajorMatchOptional,
  50. RoundSelect,
  51. GroupSubjectQuery,
  52. ElectiveTestReports
  53. },
  54. data() {
  55. // TODO: 报告应该与学年和轮次相关,先暂时渲染出最近的轮次数据
  56. return {
  57. year: '',
  58. roundId: ''
  59. }
  60. },
  61. provide() {
  62. // 扩展一些注入,方便报告内部组件直接获取依赖数据
  63. // 需要把数据转方法,不然注入的数据无法动态更新
  64. return {
  65. getGeneration: () => this.generation,
  66. getOptionalMajors: () => this.optionalMajors,
  67. getEvaluationMajors: () => this.evaluationMajors
  68. }
  69. },
  70. methods: {
  71. handlePrint() {
  72. if (!this.generation?.status?.roundId) return
  73. this.loading = true
  74. getSelectedBookReport({
  75. roundId: this.generation.status.roundId,
  76. reportType: consts.enum.electiveReportType.student
  77. }).then(res => {
  78. this.loading = false
  79. if (res.data?.url) {
  80. this.$router.push({ path: '/elective/report/flip', query: { path: res.data.url } })
  81. }
  82. }).catch(e => {
  83. this.loading = false
  84. this.$message.error(e)
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. .elective-report-container {
  92. max-width: 1350px;
  93. width: 80vw;
  94. }
  95. /deep/ .elective-report-container > .el-divider {
  96. margin: 40px 0;
  97. }
  98. h1 {
  99. font-size: 36px;
  100. margin: 0;
  101. }
  102. </style>