|
@@ -6,9 +6,9 @@
|
|
|
:close-on-click-modal ="false"
|
|
|
width="80%"
|
|
|
>
|
|
|
- <p class="mb10 fx-row jc-between">当前Generation {{current}} <el-button type="primary">整体报告</el-button></p>
|
|
|
+ <p class="mb10"><el-button type="primary">整体报告</el-button></p>
|
|
|
|
|
|
- <mx-table :propDefines="formatTable.cols" :rows="formatTable.rows">
|
|
|
+ <mx-table :propDefines="propDefines" :rows="formatRows">
|
|
|
<template #subjects="{row}">
|
|
|
<el-row>
|
|
|
<el-col :span="8" v-for="subject in row.subjects">
|
|
@@ -35,61 +35,43 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
</span>
|
|
|
- <single-subject-report :prevPreferences="prevPreferences" :reportInfo="tableInfo.rows" :currentGroup="currentReportName" ref="SingleSubjectReport"></single-subject-report>
|
|
|
+<!-- <single-subject-report :prevPreferences="prevPreferences" :reportInfo="tableInfo.rows" :currentGroup="currentReportName" ref="SingleSubjectReport"></single-subject-report>-->
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import config from '@/common/mx-config'
|
|
|
import SingleSubjectReport from './single-subject-report'
|
|
|
+import BackTrackingAiResolverMixins from './ai-round-select-resolvers/backTracking-ai-resolver-mixins'
|
|
|
export default {
|
|
|
components:{
|
|
|
SingleSubjectReport
|
|
|
},
|
|
|
props: {
|
|
|
- prevPreferences: {
|
|
|
- type:Array,
|
|
|
- default: []
|
|
|
- }
|
|
|
+ generation: Object
|
|
|
},
|
|
|
+ mixins: [BackTrackingAiResolverMixins],
|
|
|
data() {
|
|
|
return{
|
|
|
dialogVisible:false,
|
|
|
+ formatRows: [],
|
|
|
tableInfo: {},
|
|
|
currentReportName: '',
|
|
|
- current: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- steps() {
|
|
|
- return config.electiveGenerationOptions
|
|
|
- },
|
|
|
- formatTable() {
|
|
|
- if(!Object.keys(this.tableInfo).length) return {}
|
|
|
- const cols = {
|
|
|
+ resolveTablePrefix() {
|
|
|
+ return {
|
|
|
groupName: {
|
|
|
- label: '科目组合',
|
|
|
- width: '80',
|
|
|
- slot:'group'
|
|
|
+ label: '选科组合'
|
|
|
},
|
|
|
scoreSumGroup: {
|
|
|
- label: '组合成绩',
|
|
|
- width: '80'
|
|
|
- },
|
|
|
- groupIndicator: {
|
|
|
- label: '剩余计划',
|
|
|
- width: '80'
|
|
|
- },
|
|
|
- bestInIndicator: {
|
|
|
- label: '组合成绩最高人数'
|
|
|
- },
|
|
|
- rankInBest: {
|
|
|
- label: '组合成绩最高人数排名'
|
|
|
- },
|
|
|
- rankInDisenroll: {
|
|
|
- label: '补录人数排名'
|
|
|
+ label: '组合成绩'
|
|
|
},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resolveTableSuffix() {
|
|
|
+ return{
|
|
|
subjects: {
|
|
|
- label: '已选专业',
|
|
|
+ label: '自选专业',
|
|
|
slot: 'subjects',
|
|
|
width: '150'
|
|
|
},
|
|
@@ -98,34 +80,38 @@ export default {
|
|
|
slot: 'colleges',
|
|
|
width: '250'
|
|
|
},
|
|
|
- report: {
|
|
|
+ signUp: {
|
|
|
label: '报告',
|
|
|
- slot:'report'
|
|
|
- },
|
|
|
+ slot: 'report',
|
|
|
+ width: '100',
|
|
|
+ fixed: 'right',
|
|
|
+ }
|
|
|
}
|
|
|
- // 剩余指标累计
|
|
|
- const groupIndicatorAll = this.tableInfo.rows.reduce((prev,current)=> {
|
|
|
- console.log(current.groupIndicator )
|
|
|
- return prev + current.groupIndicator
|
|
|
- },0)
|
|
|
- const rows = this.tableInfo.rows.map(item => {
|
|
|
- return {
|
|
|
- groupName: item.groupName,
|
|
|
- isRecommend: item.isRecommend,
|
|
|
- rankInDisenroll: item.rankInDisenroll ? `${item.rankInDisenroll}/${groupIndicatorAll}` : '/',
|
|
|
- rankInBest: item.rankInBest ? `${item.rankInBest}/${item.bestInIndicator}` : '/',
|
|
|
- bestInIndicator: item.bestInIndicator || '/',
|
|
|
- groupIndicator: item.groupIndicator,
|
|
|
- scoreSumGroup: item.scoreSumGroup,
|
|
|
- groupId: item.groupId,
|
|
|
- subjects: item.subjects,
|
|
|
- allowSelect: item.allowSelect,
|
|
|
- colleges: item.colleges
|
|
|
+ },
|
|
|
+ formatTable() {
|
|
|
+ if (!this.formatRows) return {}
|
|
|
+ const options = this.generation.options
|
|
|
+ console.log(this.generation)
|
|
|
+ if (!options || !this.generation.active) return {}
|
|
|
+ const optValues = Object.values(options)
|
|
|
+ const dynamicColumns = {}
|
|
|
+ for (let gen = options.primary.value; gen <= this.generation.active; gen++) {
|
|
|
+ const opt = optValues.find(opt => opt.value == gen)
|
|
|
+ const resolverKey = opt.key + 'Resolver'
|
|
|
+ const resolver = this[resolverKey]
|
|
|
+ if (typeof resolver === 'function') {
|
|
|
+ const genColumns = resolver(gen, this.generation.active)
|
|
|
+ Object.assign(dynamicColumns, genColumns)
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ console.log(dynamicColumns)
|
|
|
+ return dynamicColumns
|
|
|
+ },
|
|
|
+ propDefines() {
|
|
|
return {
|
|
|
- cols,
|
|
|
- rows
|
|
|
+ ...this.resolveTablePrefix,
|
|
|
+ ...this.formatTable,
|
|
|
+ ...this.resolveTableSuffix,
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -134,11 +120,9 @@ export default {
|
|
|
this.currentReportName = row.groupName
|
|
|
this.$refs.SingleSubjectReport.dialogVisible = true
|
|
|
},
|
|
|
- open(tableInfo,currentGeneration) {
|
|
|
- this.current = currentGeneration
|
|
|
+ open(rows) {
|
|
|
this.dialogVisible = true
|
|
|
- console.log(this.$store.getters.currentUser)
|
|
|
- this.tableInfo = tableInfo
|
|
|
+ this.formatRows = rows
|
|
|
},
|
|
|
handleClose() {
|
|
|
|