瀏覽代碼

elective report + group score table

hare8999@163.com 2 年之前
父節點
當前提交
80e7b0ad74

+ 9 - 0
src/api/webApi/selection.js

@@ -144,6 +144,15 @@ export function queryScoreImportDetails(data) {
   })
 }
 
+// 查询选科成绩明细 -- 报告{roundId:41}
+export function getStudentScoreDetails(params) {
+  return request({
+    url: '/front/selected/scoreImport/getStudentScoreDetails',
+    method: 'get',
+    params
+  })
+}
+
 ///prod-api/front/selected/scoreImport/generateFaculties
 // 查询默认科目表格
 export function generateFaculties() {

+ 13 - 0
src/views/elective/report/components/elective-flow-table.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'elective-flow-table'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 46 - 0
src/views/elective/report/components/group-score-table.vue

@@ -0,0 +1,46 @@
+<template>
+  <mx-table :prop-defines="queryTableDefines" :rows="pagedDataList">
+    <template #index="{$index}">
+      {{ (localQuery.pageNum - 1) * localQuery.pageSize + $index + 1 }}
+    </template>
+    <template #subjects="{row}">
+      {{ row.subjects.map(s => `${s.subjectName}:${s.score}`).join(' ') }}
+    </template>
+  </mx-table>
+</template>
+
+<script>
+import RoundScoreQuery from '@/views/elective/publish/components/round-score-query'
+import { getStudentScoreDetails } from '@/api/webApi/selection'
+
+export default {
+  name: 'group-score-table',
+  extends: RoundScoreQuery,
+  inject: ['getGeneration'],
+  computed: {
+    roundId() {
+      return this.getGeneration()?.status?.roundId || 0
+    }
+  },
+  watch: {
+    'roundId': function(newVal) {
+      // 重写NOTE: 这个组件与RoundScoreQuery驱动查询的方式已经不一样
+      if (newVal) this.handleQuery()
+    }
+  },
+  methods: {
+    handleQuery() {
+      // 重写RoundScoreQuery.handleQuery
+      this.localQuery.pageNum = 1
+      const query = { roundId: this.roundId }
+      getStudentScoreDetails(query).then(res => {
+        this.dataList = res['rows']
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 5 - 1
src/views/elective/report/index.vue

@@ -9,6 +9,9 @@
       <major-match-optional></major-match-optional>
       <el-divider><h1>专业介绍</h1></el-divider>
       <major-introduce-batch></major-introduce-batch>
+      <el-divider><h1>选科成绩表</h1></el-divider>
+      <group-score-table></group-score-table>
+      <el-divider><h1>选科进程表</h1></el-divider>
     </div>
   </div>
 </template>
@@ -20,11 +23,12 @@ import GroupSubjectQuery from '@/views/permission/components/group-subject-query
 import RoundSelect from '@/views/system/user/profile/round-select'
 import MajorMatchOptional from '@/views/elective/report/components/major-match-optional'
 import MajorIntroduceBatch from '@/views/elective/report/components/major-introduce-batch'
+import GroupScoreTable from '@/views/elective/report/components/group-score-table'
 
 export default {
   name: 'report-index',
   extends: RoundSelect,
-  components: { MajorIntroduceBatch, MajorMatchOptional, RoundSelect, GroupSubjectQuery, ElectiveTestReports },
+  components: { GroupScoreTable, MajorIntroduceBatch, MajorMatchOptional, RoundSelect, GroupSubjectQuery, ElectiveTestReports },
   data() {
     // TODO: 报告应该与学年和轮次相关,先暂时渲染出最近的轮次数据
     return {