Przeglądaj źródła

hidden score table when `scoreInvisible` -- report

hare8999@163.com 2 lat temu
rodzic
commit
5c9ec2835c

+ 8 - 6
src/components/MxTable/index.vue

@@ -57,7 +57,8 @@
           </el-table-column>
         </template>
       </el-table-column>
-      <el-table-column :key="key" v-else-if="prop.type == 'expand'" :type="prop.type" :reserve-selection="reserveSelection" :label="prop.label" :width="prop.width"
+      <el-table-column :key="key" v-else-if="prop.type == 'expand'" :type="prop.type"
+                       :reserve-selection="reserveSelection" :label="prop.label" :width="prop.width"
                        :align="prop.align || 'center'">
         <template slot-scope="scope">
           <slot v-if="prop.type == 'expand' && prop.slot" :name="prop.slot" v-bind="{
@@ -72,7 +73,8 @@
           <span v-else>{{ scope.row[key] }}</span>
         </template>
       </el-table-column>
-      <el-table-column :key="key" v-else :type="prop.type" :reserve-selection="reserveSelection" :label="prop.label" :width="prop.width"
+      <el-table-column :key="key" v-else :type="prop.type" :reserve-selection="reserveSelection" :label="prop.label"
+                       :width="prop.width"
                        :align="prop.align || 'center'">
       </el-table-column>
     </template>
@@ -91,7 +93,7 @@ export default {
     }
   },
   props: {
-    showHeader:{
+    showHeader: {
       type: Boolean,
       default: true
     },
@@ -132,7 +134,7 @@ export default {
   },
   activated() {
     if (this.keepScroll && (this.cacheScrollLeft || this.cacheScrollTop)) {
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs.table.bodyWrapper.scrollLeft = this.cacheScrollLeft
         this.$refs.table.bodyWrapper.scrollTop = this.cacheScrollTop
       })
@@ -160,8 +162,8 @@ export default {
         this.$refs.table.bodyWrapper.scrollLeft = Number(this.$refs.table.bodyWidth.replace('px', ''))
       }, 500)
     },
-    expand(item){
-      this.$emit('expand-change',item)
+    expand(item) {
+      this.$emit('expand-change', item)
     }
   }
 }

+ 2 - 2
src/views/career/bigdataSelectCourse/enrollReport.vue

@@ -2,7 +2,7 @@
   <div class="report f16">
     <p class="mb10">{{ nickName }}同学:</p>
     <p class="mb10">您好!</p>
-    <div style="letterSpacing:1px">
+    <div style="letterSpacing:1px" v-if="groupsDemo.length">
       <span>您所在的学校开设了</span>
       <span v-for="group in groupsDemo" :key="group.groupId">
         {{ `${group.groupName}(${group.classCount}个班级)(${group.actualCount})` }},
@@ -53,7 +53,7 @@
         </el-step>
       </template>
       <template>
-        <el-step status="process">
+        <el-step status="process" v-if="dispatchInfo.className">
           <div slot="description" class="f16">
             选科完成后您将从原{{ dispatchInfo.originalClassName }}班,重新分班至{{ dispatchInfo.className }}班。
           </div>

+ 3 - 10
src/views/elective/report/components/elective-ai-analysis-step.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="elective-ai-container">
-    <el-divider class="new-page"><h1>{{ simulateActive.title }}AI分析</h1></el-divider>
+    <report-section-title class="new-page">{{ simulateActive.title }}AI分析</report-section-title>
     <index-card :title="`${simulateActive.title}AI分析表`">
       <elective-ai-table :generation="generation" :optional-majors="inheritOptionalMajors" readonly></elective-ai-table>
     </index-card>
@@ -15,10 +15,11 @@ import RoundSelect from '@/views/system/user/profile/round-select'
 import ElectiveAiTable from '@/views/elective/select/components/elective-ai-table'
 import ElectiveAiReport from '@/views/elective/select/components/elective-ai-report'
 import IndexCard from '@/views/index/components/index-card'
+import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
 
 export default {
   name: 'elective-ai-analysis-step',
-  components: { IndexCard, ElectiveAiReport, ElectiveAiTable },
+  components: { ReportSectionTitle, IndexCard, ElectiveAiReport, ElectiveAiTable },
   extends: RoundSelect, // NOTE: 这里也扩展了RoundSelect,是想以最小的代码成本,制造generation的副本
   props: ['simulateActive', 'inheritGeneration', 'inheritOptionalMajors'],
   data() {
@@ -33,12 +34,4 @@ export default {
 </script>
 
 <style scoped>
-/deep/ .elective-ai-container > .el-divider {
-  margin: 40px 0;
-}
-
-h1 {
-  font-size: 36px;
-  margin: 0;
-}
 </style>

+ 3 - 11
src/views/elective/report/components/elective-test-reports.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-if="hasFinalResult" class="elective-test-container">
-    <el-divider class="new-page"><h1>选科测评报告</h1></el-divider>
+    <report-section-title class="new-page">选科测评报告</report-section-title>
     <div v-for="test in testResults" :key="test.key" class="print-page elective-report-card">
       <index-card :title="test.title">
         <test-report :category="test.key" :source="test.result" readonly></test-report>
@@ -20,11 +20,12 @@ import TestSummary from '@/views/elective/test/components/test-summary'
 import IndexCard from '@/views/index/components/index-card'
 import TestReport from '@/views/elective/test/components/test-report'
 import MajorMatchEvaluation from '@/views/elective/report/components/major-match-evaluation'
+import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
 
 export default {
   name: 'elective-test-reports',
   extends: TestSummary, // NOTE: 这里直接继承了TestSummary页面的关键能力
-  components: { MajorMatchEvaluation, TestReport, IndexCard },
+  components: { ReportSectionTitle, MajorMatchEvaluation, TestReport, IndexCard },
   computed: {
     hasFinalResult() {
       return this.summary?.selectedList?.length || false
@@ -34,15 +35,6 @@ export default {
 </script>
 
 <style scoped>
-/deep/ .elective-test-container > .el-divider {
-  margin: 40px 0;
-}
-
-h1 {
-  font-size: 36px;
-  margin: 0;
-}
-
 .elective-report-card > /deep/ .el-card__body {
   padding: 0;
 }

+ 3 - 11
src/views/elective/report/components/major-introduce-batch.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="professDetail" v-if="details.length">
-    <el-divider class="new-page"><h1>专业介绍</h1></el-divider>
+    <report-section-title class="new-page">专业介绍</report-section-title>
     <index-card v-for="detail in details" :key="detail.code" :title="majors[detail.code]" class="index-card print-page">
       <el-divider content-position="left"><span class="f28">专业概况</span></el-divider>
       <major-introduce-info :major-detail="detail.overview" class="print-page"></major-introduce-info>
@@ -15,10 +15,11 @@ import { getMajorDetailByCodes } from '@/api/webApi/professlib'
 import IndexCard from '@/views/index/components/index-card'
 import MajorIntroduceInfo from '@/views/career/plan/compoents/major-introduce-info'
 import MajorIntroduceJob from '@/views/career/plan/compoents/major-introduce-job'
+import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
 
 export default {
   name: 'major-introduce-batch',
-  components: { MajorIntroduceJob, MajorIntroduceInfo, IndexCard },
+  components: { ReportSectionTitle, MajorIntroduceJob, MajorIntroduceInfo, IndexCard },
   inject: ['getOptionalMajors'],
   data() {
     return {
@@ -60,15 +61,6 @@ export default {
 </script>
 
 <style scoped>
-.professDetail > .el-divider {
-  margin: 40px 0;
-}
-
-h1 {
-  font-size: 36px;
-  margin: 0;
-}
-
 .index-card + .index-card {
   margin-top: 20px;
 }

+ 25 - 0
src/views/elective/report/components/report-section-title.vue

@@ -0,0 +1,25 @@
+<template>
+  <el-divider class="report-section-title" v-bind="$attrs">
+    <h1>
+      <slot></slot>
+    </h1>
+  </el-divider>
+</template>
+
+<script>
+export default {
+  name: 'report-section-title'
+}
+</script>
+
+<style lang="scss" scoped>
+
+.report-section-title.el-divider {
+  margin: 40px 0;
+
+  h1 {
+    font-size: 36px;
+    margin: 0;
+  }
+}
+</style>

+ 15 - 15
src/views/elective/report/index.vue

@@ -9,18 +9,20 @@
         <el-image :src="require('@/assets/images/elective/elective_report_cover.png')"></el-image>
       </div>
       <elective-test-reports></elective-test-reports>
-      <el-divider class="new-page"><h1>选科大数据分析</h1></el-divider>
+      <report-section-title class="new-page">选科大数据分析</report-section-title>
       <group-subject-query class="print-page"></group-subject-query>
-      <el-divider class="new-page"><h1>自选专业</h1></el-divider>
+      <report-section-title class="new-page">自选专业</report-section-title>
       <major-match-optional class="print-page"></major-match-optional>
       <major-introduce-batch></major-introduce-batch>
-      <el-divider class="new-page"><h1>选科成绩表</h1></el-divider>
-      <group-score-table class="print-page"></group-score-table>
-      <el-divider class="new-page"><h1>选科进程表</h1></el-divider>
+      <template v-if="showScore">
+        <report-section-title class="new-page">选科成绩表</report-section-title>
+        <group-score-table class="print-page"></group-score-table>
+      </template>
+      <report-section-title class="new-page">选科进程表</report-section-title>
       <elective-flow-table class="print-page"></elective-flow-table>
       <!-- AI分析可能有也可能没有,在elective-ai-analysis内部控制 -->
       <elective-ai-analysis></elective-ai-analysis>
-      <el-divider class="new-page"><h1>选科录取分析报告</h1></el-divider>
+      <report-section-title class="new-page">选科录取分析报告</report-section-title>
       <elective-enroll-analysis class="print-page"></elective-enroll-analysis>
     </div>
   </div>
@@ -39,11 +41,13 @@ import ElectiveFlowTable from '@/views/elective/report/components/elective-flow-
 import ElectiveEnrollAnalysis from '@/views/elective/report/components/elective-enroll-analysis'
 import ElectiveAiAnalysis from '@/views/elective/report/components/elective-ai-analysis'
 import { getSelectedBookReport } from '@/api/webApi/elective/selected-subject'
+import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
 
 export default {
   name: 'report-index',
   extends: RoundSelect,
   components: {
+    ReportSectionTitle,
     ElectiveAiAnalysis,
     ElectiveEnrollAnalysis,
     ElectiveFlowTable,
@@ -61,6 +65,11 @@ export default {
       roundId: ''
     }
   },
+  computed: {
+    showScore() {
+      return !this.generation?.status?.scoreInvisible
+    }
+  },
   provide() {
     // 扩展一些注入,方便报告内部组件直接获取依赖数据
     // 需要把数据转方法,不然注入的数据无法动态更新
@@ -95,13 +104,4 @@ export default {
 .elective-report-container {
   width: 100%;
 }
-
-/deep/ .elective-report-container > .el-divider {
-  margin: 40px 0;
-}
-
-h1 {
-  font-size: 36px;
-  margin: 0;
-}
 </style>

+ 6 - 3
src/views/elective/select/components/elective-table-mixins.js

@@ -44,7 +44,8 @@ export default {
         },
         scoreSumGroup: {
           label: '组合成绩',
-          hidden: !this.hasPermissions([consts.enum.electivePermission.scoreByGroup])
+          hidden: !this.hasPermissions([consts.enum.electivePermission.scoreByGroup]) ||
+            this.generation?.status?.scoreInvisible == true
         },
         classCount: {
           label: '开设班级数'
@@ -63,11 +64,13 @@ export default {
       return {
         rankInGroup: {
           label: '当前组合实时排名',
-          hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGroup])
+          hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGroup]) ||
+            this.generation?.status?.rankInvisible == true
         },
         rankInGrade: {
           label: '选科全校排名',
-          hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGrade])
+          hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGrade]) ||
+            this.generation?.status?.rankInvisible == true
         },
         allowSelectTips: {
           label: '报名状态'