Browse Source

student release list temporary save

hare8999@163.com 2 years ago
parent
commit
447a5e57a3

+ 8 - 1
src/api/webApi/elective/selected-subject.js

@@ -73,7 +73,14 @@ export function rejectRecommend(data) {
   })
 }
 
-
+// 班级放榜查询
+export function getClassGenerationDetails(params) {
+  return request({
+    url: '/front/elective/enroll/getClassGenerationDetails',
+    method: 'get',
+    params
+  })
+}
 
 
 

+ 6 - 2
src/common/mx-config.js

@@ -154,7 +154,7 @@ export default {
       code: 'ForceAdjust',
       decisionMaking: true,
       stepsVisible: true,
-      title: '补录调剂',
+      title: '调剂结果',
       description: '',
       icon: ''
     },
@@ -190,5 +190,9 @@ export default {
       value: 'MajorFirst',
       title: '按专业'
     }
-  }
+  },
+  studentReleaseQueryCodes: [
+    { id: 'acceptCount', name: '已录取', isEnroll: true },
+    { id: 'unfinishedCount', name: '未录取', isEnroll: false }
+  ]
 }

+ 16 - 0
src/components/MxCondition/condition-object/condition-release-generation.js

@@ -0,0 +1,16 @@
+import conditionObjectBase from '../condition-object-base.js'
+import config from '@/common/mx-config'
+
+export default {
+  ...conditionObjectBase,
+  key: 'releaseGeneration',
+  title: '选科状态',
+  getList: function() {
+    return new Promise((resolve, reject) => {
+      const dmGenerations = Object.values(config.electiveGenerationOptions)
+        .filter(opt => opt.decisionMaking && opt.stepsVisible)
+        .map(opt => ({ name: opt.title, id: opt.value }))
+      resolve(dmGenerations)
+    })
+  }
+}

+ 14 - 0
src/components/MxCondition/condition-object/condition-release-query-code.js

@@ -0,0 +1,14 @@
+import conditionObjectBase from '../condition-object-base.js'
+import config from '@/common/mx-config'
+
+export default {
+  ...conditionObjectBase,
+  key: 'releaseQueryCode',
+  title: '录取情况',
+  getList: function() {
+    return new Promise((resolve, reject) => {
+      const queryCodes = config.studentReleaseQueryCodes
+      resolve(queryCodes)
+    })
+  }
+}

+ 24 - 0
src/components/MxCondition/condition-object/condition-student-round.js

@@ -0,0 +1,24 @@
+import conditionObjectBase from '../condition-object-base.js'
+import {
+  getSchoolRounds
+} from '@/api/webApi/selection.js'
+import store from '@/store/index'
+
+export default {
+  ...conditionObjectBase,
+  key: 'studentRoundId',
+  title: '选科次数',
+  getList: function() {
+    return new Promise((resolve, reject) => {
+      getSchoolRounds({ year: store.getters.currentUser.year })
+        .then(res => resolve(res.data))
+        .catch(e => reject(e))
+    })
+  },
+  getCode: function(item) {
+    return item.roundId
+  },
+  getLabel: function(item) {
+    return item.name
+  }
+}

+ 3 - 1
src/views/elective/select/components/elective-preference-info.vue

@@ -22,7 +22,9 @@ export default {
   props: ['generation'],
   computed: {
     appliedModel() {
-      return this.generation.activeModel.prevModel
+      let prev = this.generation.activeModel.prevModel
+      while (prev.option.decisionMaking) prev = prev.prevModel
+      return prev
     },
     allSelectedGroupNames() {
       return this.appliedModel.selectedList.map(g => g.groupName).join('、 ')

+ 79 - 0
src/views/elective/select/release-list.vue

@@ -0,0 +1,79 @@
+<template>
+  <div class="app-container" v-loading="loading">
+    <el-card>
+      <mx-condition :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
+                    @invalid="handleInvalid" label-width="80px"></mx-condition>
+    </el-card>
+    <evaluation-empty v-if="emptyTitle" :title="emptyTitle" class="mt20"></evaluation-empty>
+    <dynamic-table v-else class="mt20"></dynamic-table>
+  </div>
+</template>
+
+<script>
+import MxCondition from '@/components/MxCondition/mx-condition'
+import { getStudentSelected } from '@/api/webApi/elective/selected-subject'
+import config from '@/common/mx-config'
+import { mapGetters } from 'vuex'
+import DynamicTable from '@/components/dynamic-table/index'
+
+export default {
+  name: 'ElectiveReleaseList',
+  components: { DynamicTable, MxCondition },
+  data() {
+    return {
+      loading: false,
+      // query params
+      queryParams: {
+        studentRoundId: '',
+        releaseGeneration: '',
+        releaseQueryCode: ''
+      },
+      requireFields: ['studentRoundId', 'releaseGeneration', 'releaseQueryCode'],
+      // status & results
+      electiveStatus: null,
+      releaseSummary: null
+    }
+  },
+  computed: {
+    ...mapGetters(['currentUser']),
+    mappedParams() {
+      return {
+        year: this.currentUser.year,
+        roundId: this.queryParams.studentRoundId,
+        generation: this.queryParams.releaseGeneration,
+        queryCode: this.queryParams.releaseQueryCode
+      }
+    },
+    currentOpt() {
+      return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.electiveStatus?.currentGeneration)
+    },
+    releaseOpt() {
+      return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.queryParams.releaseGeneration)
+    },
+    emptyTitle() {
+      if (!this.electiveStatus) return '暂无数据'
+      if (this.electiveStatus.currentGeneration <= config.electiveGenerationOptions.init.value) return '选科未开启'
+      if (this.queryParams.releaseGeneration > this.electiveStatus.currentGeneration) return '选科还未进行至' + this.releaseOpt.title
+      return ''
+    }
+  },
+  methods: {
+    async handleQuery() {
+      if (this.queryParams.studentRoundId != this.electiveStatus?.selectResult?.roundId) {
+        const resStatus = await getStudentSelected(this.mappedParams)
+        this.electiveStatus = resStatus.data
+        this.electiveStatus.currentGeneration = 3
+      }
+      // const summary = await getClass
+    },
+    handleInvalid() {
+      this.electiveStatus = null
+      this.releaseSummary = null
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
src/views/system/user/profile/round-select.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container" v-loading="loading">
-    <el-card shadow="hover">
+    <el-card>
       <template #header>选科信息</template>
       <el-row :gutter="20">
         <el-col :span="12">
@@ -31,7 +31,7 @@
                     :optional-majors="optionalMajors"></report-table>
       <evaluation-empty v-else :shadow="false" :title="emptyTitle"></evaluation-empty>
     </el-card>
-    <el-card shadow="hover" class="mt20">
+    <el-card class="mt20">
       <template #header>选科报告</template>
       <el-button v-if="false" @click="goReportDemo">选科报告1</el-button>
       <el-button @click="goReportDemoOnline">选科报告</el-button>