浏览代码

hidden province big-data history query

hare8999@163.com 2 年之前
父节点
当前提交
25b394f7ee

+ 60 - 0
src/views/elective/report/components/elective-head-page.vue

@@ -0,0 +1,60 @@
+<template>
+  <div class="width100 relative">
+    <el-image :src="require('@/assets/images/elective/elective_report_cover.png')"></el-image>
+    <div v-if="electiveVisible" class="absolute f24 bold elective-report-info-container">
+      <div class="landing-item">
+        学校:<span>{{ schoolName }}</span>
+      </div>
+      <div class="landing-item">
+        轮次:<span>{{ this.generation.status.year }}学年{{ this.generation.status.roundName }}</span>
+      </div>
+      <div class="landing-item">
+        班级:<span>{{ firstClassName | classTailing }}</span>
+      </div>
+      <div class="landing-item">
+        学生:<span>{{ nickName }}({{ name }})</span>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'elective-head-page',
+  props: ['electiveVisible'],
+  inject: ['getGeneration'],
+  computed: {
+    ...mapGetters(['schoolName', 'firstClassName', 'nickName', 'name']),
+    generation() {
+      return this.getGeneration()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+.elective-report-info-container {
+  right: 100px;
+  bottom: 0;
+}
+
+.landing-item + .landing-item {
+  margin-top: 10px;
+}
+
+.landing-item {
+  display: flex;
+  flex-direction: row;
+
+  span {
+    display: inline-block;
+    flex: 1;
+    border-bottom: 1px solid #666666;
+  }
+
+}
+
+</style>

+ 20 - 0
src/views/elective/report/components/elective-province-history.vue

@@ -0,0 +1,20 @@
+<template>
+  <div>
+    <group-subject-query class="print-page" no-data-hidden>
+      <report-section-title slot="prefix" class="new-page">选科大数据分析</report-section-title>
+    </group-subject-query>
+  </div>
+</template>
+
+<script>
+import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
+import GroupSubjectQuery from '@/views/permission/components/group-subject-query'
+export default {
+  name: 'elective-province-history',
+  components: { GroupSubjectQuery, ReportSectionTitle }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/elective/report/components/major-match-optional.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div v-if="majors.length&&groups.length">
+  <div v-if="majors.length&&groups.length" class="print-page">
     <report-section-title class="new-page">自选专业</report-section-title>
     <report-section-title class="new-page">自选专业</report-section-title>
     <groups-match-table :groups="groups" :majors="majors" hidden-rank></groups-match-table>
     <groups-match-table :groups="groups" :majors="majors" hidden-rank></groups-match-table>
   </div>
   </div>

+ 8 - 45
src/views/elective/report/index.vue

@@ -5,27 +5,10 @@
       <div v-if="electiveVisible" class="print-hidden text-right mb10">
       <div v-if="electiveVisible" class="print-hidden text-right mb10">
         <el-button type="primary" icon="el-icon-printer" @click="handlePrint">打印</el-button>
         <el-button type="primary" icon="el-icon-printer" @click="handlePrint">打印</el-button>
       </div>
       </div>
-      <div class="width100 relative">
-        <el-image :src="require('@/assets/images/elective/elective_report_cover.png')"></el-image>
-        <div v-if="electiveVisible" class="absolute f24 bold elective-report-info-container">
-          <div class="landing-item">
-            学校:<span>{{ schoolName }}</span>
-          </div>
-          <div class="landing-item">
-            轮次:<span>{{ this.generation.status.year }}学年{{ this.generation.status.roundName }}</span>
-          </div>
-          <div class="landing-item">
-            班级:<span>{{ firstClassName | classTailing }}</span>
-          </div>
-          <div class="landing-item">
-            学生:<span>{{ nickName }}({{ name }})</span>
-          </div>
-        </div>
-      </div>
+      <elective-head-page :elective-visible="electiveVisible"></elective-head-page>
       <elective-test-reports></elective-test-reports>
       <elective-test-reports></elective-test-reports>
-      <report-section-title class="new-page">选科大数据分析</report-section-title>
-      <group-subject-query class="print-page"></group-subject-query>
-      <major-match-optional class="print-page"></major-match-optional>
+      <elective-province-history></elective-province-history>
+      <major-match-optional></major-match-optional>
       <major-introduce-batch></major-introduce-batch>
       <major-introduce-batch></major-introduce-batch>
       <template v-if="showScore">
       <template v-if="showScore">
         <report-section-title class="new-page">选科成绩表</report-section-title>
         <report-section-title class="new-page">选科成绩表</report-section-title>
@@ -45,7 +28,6 @@
 
 
 import consts from '@/common/mx-const'
 import consts from '@/common/mx-const'
 import ElectiveTestReports from '@/views/elective/report/components/elective-test-reports'
 import ElectiveTestReports from '@/views/elective/report/components/elective-test-reports'
-import GroupSubjectQuery from '@/views/permission/components/group-subject-query'
 import RoundSelect from '@/views/system/user/profile/round-select'
 import RoundSelect from '@/views/system/user/profile/round-select'
 import MajorMatchOptional from '@/views/elective/report/components/major-match-optional'
 import MajorMatchOptional from '@/views/elective/report/components/major-match-optional'
 import MajorIntroduceBatch from '@/views/elective/report/components/major-introduce-batch'
 import MajorIntroduceBatch from '@/views/elective/report/components/major-introduce-batch'
@@ -53,14 +35,17 @@ import GroupScoreTable from '@/views/elective/report/components/group-score-tabl
 import ElectiveFlowTable from '@/views/elective/report/components/elective-flow-table'
 import ElectiveFlowTable from '@/views/elective/report/components/elective-flow-table'
 import ElectiveEnrollAnalysis from '@/views/elective/report/components/elective-enroll-analysis'
 import ElectiveEnrollAnalysis from '@/views/elective/report/components/elective-enroll-analysis'
 import ElectiveAiAnalysis from '@/views/elective/report/components/elective-ai-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'
 import ReportSectionTitle from '@/views/elective/report/components/report-section-title'
-import { mapGetters } from 'vuex'
+import ElectiveHeadPage from '@/views/elective/report/components/elective-head-page'
+import ElectiveProvinceHistory from '@/views/elective/report/components/elective-province-history'
+import { getSelectedBookReport } from '@/api/webApi/elective/selected-subject'
 
 
 export default {
 export default {
   name: 'report-index',
   name: 'report-index',
   extends: RoundSelect,
   extends: RoundSelect,
   components: {
   components: {
+    ElectiveProvinceHistory,
+    ElectiveHeadPage,
     ReportSectionTitle,
     ReportSectionTitle,
     ElectiveAiAnalysis,
     ElectiveAiAnalysis,
     ElectiveEnrollAnalysis,
     ElectiveEnrollAnalysis,
@@ -69,7 +54,6 @@ export default {
     MajorIntroduceBatch,
     MajorIntroduceBatch,
     MajorMatchOptional,
     MajorMatchOptional,
     RoundSelect,
     RoundSelect,
-    GroupSubjectQuery,
     ElectiveTestReports
     ElectiveTestReports
   },
   },
   data() {
   data() {
@@ -80,7 +64,6 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
-    ...mapGetters(['schoolName', 'firstClassName', 'nickName', 'name']),
     showScore() {
     showScore() {
       return !this.generation?.status?.scoreInvisible
       return !this.generation?.status?.scoreInvisible
     }
     }
@@ -118,25 +101,5 @@ export default {
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .elective-report-container {
 .elective-report-container {
   width: 100%;
   width: 100%;
-
-  .elective-report-info-container {
-    right: 100px;
-    bottom: 0;
-  }
-
-  .landing-item + .landing-item {
-    margin-top: 10px;
-  }
-
-  .landing-item {
-    display: flex;
-    flex-direction: row;
-
-    span {
-      display: inline-block;
-      flex: 1;
-      border-bottom: 1px solid #666666;
-    }
-  }
 }
 }
 </style>
 </style>

+ 10 - 2
src/views/permission/components/group-subject-query.vue

@@ -1,6 +1,7 @@
 <template>
 <template>
   <div>
   <div>
-    <div v-if="Object.keys(model).length > 0">
+    <div v-if="hasData">
+      <slot name="prefix"></slot>
       <h3 class="text-center f28">{{ `${year}年${model.location}省选科大数据分析` }}</h3>
       <h3 class="text-center f28">{{ `${year}年${model.location}省选科大数据分析` }}</h3>
       <el-row class="mb20" :gutter="10">
       <el-row class="mb20" :gutter="10">
         <el-col class="f14" :span="col.span" v-for="col in cols">
         <el-col class="f14" :span="col.span" v-for="col in cols">
@@ -19,7 +20,7 @@
         </template>
         </template>
       </mx-table>
       </mx-table>
     </div>
     </div>
-    <div v-else>
+    <div v-else-if="!noDataHidden">
       暂无数据
       暂无数据
     </div>
     </div>
   </div>
   </div>
@@ -34,6 +35,10 @@ export default {
     level: {
     level: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    noDataHidden: {
+      type: Boolean,
+      default: false
     }
     }
   },
   },
   data() {
   data() {
@@ -62,6 +67,9 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
+    hasData() {
+      return Object.keys(this.model).length > 0
+    },
     cols() {
     cols() {
       if (!this.model) return []
       if (!this.model) return []
       const cols = [
       const cols = [