Explorar o código

完成AI选科分析

shilipojs %!s(int64=3) %!d(string=hai) anos
pai
achega
7659227aca

+ 3 - 3
mock/modules/elective-subject.js

@@ -118,7 +118,7 @@ module.exports = [
               scoreSumGroup: 514, // 6门成绩
               groupIndicator: 30, // 组合剩余指标
               bestInIndicator: 20, // 该组合成绩为学生最高成绩的学生人数
-              rankInBest: 19, // 该组合成绩为学生最高成绩的学生人数的排名
+              rankInBest: 16, // 该组合成绩为学生最高成绩的学生人数的排名
               rankInIndicator: '', // 组合指标排名
               rankInDisenroll: 14,// 全组合指标排名 如 补录人数排名
               isRecommend: true , // 推荐专业
@@ -137,7 +137,7 @@ module.exports = [
               scoreSumGroup: 578, // 6门成绩
               groupIndicator: 30, // 组合剩余指标
               bestInIndicator: 20, // 该组合成绩为学生最高成绩的学生人数
-              rankInBest: 19, // 该组合成绩为学生最高成绩的学生人数的排名
+              rankInBest: 10, // 该组合成绩为学生最高成绩的学生人数的排名
               rankInIndicator: '', // 组合指标排名
               rankInDisenroll: 14,// 全组合指标排名 如 补录人数排名
               isRecommend: false , // 推荐专业
@@ -156,7 +156,7 @@ module.exports = [
               scoreSumGroup: 549, // 6门成绩
               groupIndicator: 30, // 组合剩余指标
               bestInIndicator: 20, // 该组合成绩为学生最高成绩的学生人数
-              rankInBest: 19, // 该组合成绩为学生最高成绩的学生人数的排名
+              rankInBest: 4, // 该组合成绩为学生最高成绩的学生人数的排名
               rankInIndicator: '', // 组合指标排名
               rankInDisenroll: 14,// 全组合指标排名 如 补录人数排名
               isRecommend: false , // 推荐专业

+ 11 - 4
src/views/system/user/profile/components/ai-analysis-dialog.vue

@@ -5,6 +5,7 @@
     :visible.sync="dialogVisible"
     width="80%"
   >
+    当前Generation   {{current}}
     <mx-table :propDefines="formatTable.cols" :rows="formatTable.rows">
       <template #subjects="{row}">
         <el-row>
@@ -41,6 +42,7 @@ export default {
     return{
       dialogVisible:false,
       tableInfo: {},
+      current: ''
     }
   },
   computed: {
@@ -48,7 +50,7 @@ export default {
       return config.electiveGenerationOptions
     },
     formatTable() {
-      if(!this.tableInfo) return {}
+      if(!Object.keys(this.tableInfo).length) return {}
       const cols = {
         groupName: {
           label: '科目组合',
@@ -87,13 +89,18 @@ export default {
           slot:'report'
         },
       }
+      // 剩余指标累计
+      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,
-          rankInBest: item.rankInBest,
-          bestInIndicator: item.bestInIndicator,
+          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,

+ 2 - 2
src/views/system/user/profile/components/report-table.vue

@@ -88,7 +88,7 @@ export default {
       if (!this.optionalMajors) return {}
       // 行
       const rows = this.modelsWrapper.models.map(item => {
-        item.allowSelect = item.allowSelect ? '报名中' : '无法报名'
+        item.allowSelectTips = item.allowSelect ? '报名中' : '无法报名'
         item.subjects = this.optionalMajors.filter(college => {
           if (college.matchedGroupIds.indexOf(item.groupId) != -1) return college.majorCategoryName
         }).map(item => item.majorCategoryName)
@@ -136,7 +136,7 @@ export default {
         rankInGrade: {
           label: '选科全校排名'
         },
-        allowSelect: {
+        allowSelectTips: {
           label: '报名状态'
         },
         temp: {