|
@@ -1,11 +1,14 @@
|
|
|
<template>
|
|
|
<div class="app-container" v-loading="loading">
|
|
|
<el-card>
|
|
|
- <mx-condition :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
|
|
|
+ <mx-condition ref="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>
|
|
|
+ <template v-else>
|
|
|
+ <el-button circle class="el-icon-refresh mt20 mb10" @click="handleQuery"></el-button>
|
|
|
+ <dynamic-table :columns="tableData.columns" :rows="tableData.rows"></dynamic-table>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -15,6 +18,7 @@ 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'
|
|
|
+import { getClassGenerationDetails } from '@/api/webApi/elective/generation'
|
|
|
|
|
|
export default {
|
|
|
name: 'ElectiveReleaseList',
|
|
@@ -50,21 +54,61 @@ export default {
|
|
|
releaseOpt() {
|
|
|
return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.queryParams.releaseGeneration)
|
|
|
},
|
|
|
+ queryCodeOpt() {
|
|
|
+ return config.studentReleaseQueryCodes.find(opt => opt.id == this.queryParams.releaseQueryCode)
|
|
|
+ },
|
|
|
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 ''
|
|
|
+ },
|
|
|
+ roundName() {
|
|
|
+ return this.$refs.condition.getConditionLabel('studentRoundId', this.queryParams.studentRoundId)
|
|
|
+ },
|
|
|
+ tableData() {
|
|
|
+ const rows = this.releaseSummary?.details || []
|
|
|
+ const columns = [
|
|
|
+ { prop: 'localRoundName', label: '选科次数' },
|
|
|
+ { prop: 'className', label: '班级' },
|
|
|
+ { prop: 'studentName', label: '姓名' },
|
|
|
+ { prop: 'localApplyGroupNames', label: '报名组合', hidden: this.queryCodeOpt.isEnroll },
|
|
|
+ { prop: 'rankInAppliedGroup', label: '报名排名', hidden: this.queryCodeOpt.isEnroll },
|
|
|
+ { prop: 'enrollGroupName', label: '录取组合', hidden: !this.queryCodeOpt.isEnroll },
|
|
|
+ { prop: 'rankInEnrolledGroup', label: '录取排名', hidden: !this.queryCodeOpt.isEnroll },
|
|
|
+ { prop: 'localEnrollGeneration', label: '录取情况' },
|
|
|
+ { prop: 'action', label: '操作', slotBody: 'history' }
|
|
|
+ ]
|
|
|
+ rows.forEach(row => {
|
|
|
+ row.localRoundName = this.roundName
|
|
|
+ if (this.queryCodeOpt.isEnroll) {
|
|
|
+ const enrollGenOpt = Object.values(config.electiveGenerationOptions).find(opt => opt.value == row['enrollGeneration'])
|
|
|
+ row.localEnrollGeneration = enrollGenOpt.enrollName
|
|
|
+ } else {
|
|
|
+ row.localApplyGroupNames = Array.isArray(row['applyGroupNames'])
|
|
|
+ ? row['applyGroupNames'].join('/')
|
|
|
+ : row['applyGroupNames']
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ rows,
|
|
|
+ columns
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
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
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ if (this.queryParams.studentRoundId != this.electiveStatus?.selectResult?.roundId) {
|
|
|
+ const resStatus = await getStudentSelected(this.mappedParams)
|
|
|
+ this.electiveStatus = resStatus.data
|
|
|
+ }
|
|
|
+ const resSummary = await getClassGenerationDetails(this.mappedParams)
|
|
|
+ this.releaseSummary = resSummary.data
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
- // const summary = await getClass
|
|
|
},
|
|
|
handleInvalid() {
|
|
|
this.electiveStatus = null
|