Browse Source

master elective - ai analysis & log

hare8999@163.com 2 years ago
parent
commit
c38d9554eb

+ 4 - 0
doc/Mind/ElectiveGeneration.cs

@@ -407,6 +407,10 @@ namespace mxdemo.Mind
             //          :''
             public string color;
 
+            // 5.27 hht +迭代至当前查询阶段的录取状态(非最终态,用来展示某阶段未录取学生AI分析表)
+            public bool approved;
+            public bool forceAdjusted;
+
             public long id { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
             public string category { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
             public EnumElectiveGeneration generation { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

+ 3 - 1
doc/Mind/PrimaryElective.cs

@@ -127,7 +127,9 @@ namespace mxdemo.Mind
         // 对应未录学生在决策代匹配算法的推荐组合
         // 报名代从决策代继承
 
-        public int rankInGroup; // 选科实时排名 常量 来自成绩导入
+        public int rankInGroup;
+        // 5.27 注释更正:报名组合在报名人数中的排名 录取组合在录取人数中的排名(录取状态需要迭代)未录取和未录取没有排名
+
         public int rankInGrade; // 选科全校排名 常量 来自成绩导入
         public bool allowSelect; // 是否可以报名 报名代专用
         public string disabledReason; // 不可报名时的原因 报名代专用

+ 33 - 18
src/views/elective/generation/detail.vue

@@ -30,8 +30,8 @@
                                        :rank-descriptors="value.rankDescriptors"></elective-flow-rank-descriptor>
       </template>
       <template #flow-action="{row}">
-        <el-link v-if="enableStudentTableView" @click="handleStudentTable(row)" :underline="false">查看</el-link>
-        <el-link v-if="enableLogView" @click="handleFlowLog(row)" :underline="false">查看</el-link>
+        <el-link v-if="enableStudentTableView(row)" @click="handleStudentTable(row)" :underline="false">查看</el-link>
+        <el-link v-if="enableLogView(row)" @click="handleFlowLog(row)" :underline="false">查看</el-link>
         <el-popover v-if="row['enableForce']" :ref="'force_'+row['studentId']" width="80" trigger="click"
                     popper-class="zero-padding-popover">
           <div class="fx-column">
@@ -51,8 +51,8 @@
       <elective-generation-flow-log :groups="prevData.groups" :histories="logRow.histories"
                                     :matched-majors="this.majorsMap[logRow['studentId']]"/>
     </el-dialog>
-    <el-dialog :title="'查看详情 '+activeOpt.title" :visible.sync="studentTableVisible" :width="logDialogWidth">
-      <report-table :generation="studentGeneration" :optional-majors="studentMajors" readonly></report-table>
+    <el-dialog :title="'查看分析 '+activeOpt.title" :visible.sync="studentTableVisible" :width="logDialogWidth">
+      <elective-ai-table :generation="studentGeneration" :optional-majors="studentMajors" readonly></elective-ai-table>
     </el-dialog>
   </div>
 </template>
@@ -60,6 +60,7 @@
 <script>
 import config from '@/common/mx-config'
 import transferMixin from '@/components/mx-transfer-mixin'
+import ElectiveToolsMixin from '@/views/elective/select/components/elective-tools-mixins'
 import groupTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin'
 import ElectiveColorMap from './components/elective-color-map-mixins'
 import { mapGetters } from 'vuex'
@@ -72,12 +73,18 @@ import {
 import ElectiveGenerationFlowLog from '@/views/elective/generation/components/elective-generation-flow-log'
 import ElectiveFlowMajor from '@/views/elective/generation/components/elective-flow-major'
 import ElectiveFlowRankDescriptor from '@/views/elective/generation/components/elective-flow-rank-descriptor'
-import ReportTable from '@/views/elective/select/components/elective-table'
 import { getStudentElectiveModels } from '@/api/webApi/elective/selected-subject'
+import ElectiveAiTable from '@/views/elective/select/components/elective-ai-table'
 
 export default {
-  components: { ReportTable, ElectiveFlowRankDescriptor, ElectiveFlowMajor, ElectiveGenerationFlowLog, MxCondition },
-  mixins: [transferMixin, groupTranslateMixin, ElectiveColorMap],
+  components: {
+    ElectiveAiTable,
+    ElectiveFlowRankDescriptor,
+    ElectiveFlowMajor,
+    ElectiveGenerationFlowLog,
+    MxCondition
+  },
+  mixins: [transferMixin, groupTranslateMixin, ElectiveColorMap, ElectiveToolsMixin],
   name: 'generation-detail',
   computed: {
     ...mapGetters(['school']),
@@ -142,7 +149,9 @@ export default {
           })
         })
       }
-      columns.actions = { label: '操作', slot: 'flow-action', minWidth: '100px' }
+      // 初选报名不需要展示操作
+      const actionHide = this.activeOpt?.value == this.options.primary.value
+      columns.actions = { label: '操作', slot: 'flow-action', minWidth: '100px', hidden: actionHide }
       return {
         rows,
         columns,
@@ -153,12 +162,6 @@ export default {
       const expectedWidth = (this.prevData.groups.length + 3) * 160 // 假定elective-generation-flow-log 单格宽160
       const finalWidth = Math.min(expectedWidth, window.innerWidth * 0.8)
       return finalWidth + 'px'
-    },
-    enableLogView() {
-      return this.activeOpt?.value >= this.options.forceAdjust.value
-    },
-    enableStudentTableView() {
-      return this.activeOpt?.value < this.options.forceAdjust.value
     }
   },
   data() {
@@ -224,7 +227,7 @@ export default {
         ?.majors?.filter(m => m['matchedGroupIds'].some(id => id == groupId)) || [])
         .groupBy(m => m.collegeName)
       const current = this.prevData.activeGeneration
-      const options = Object.values(config.electiveGenerationOptions)
+      const options = Object.values(this.options)
       const histories = row['histories'] || []
       const filterHistories = []
       for (let g = current; g > 0; g--) {
@@ -251,6 +254,15 @@ export default {
       if (row.color) style.color = this.matchElectiveColor(row.color)
       return style
     },
+    enableLogView(student) {
+      return this.activeOpt?.value > this.options.primary.value
+        && !this.enableStudentTableView(student)
+    },
+    enableStudentTableView(student) {
+      return !this.isGroupEnrolled(student)
+        && this.activeOpt?.value > this.options.primary.value
+        && this.activeOpt?.value < this.options.forceAdjust.value
+    },
     handleFlowLog(row) {
       this.logRow = row
       this.logVisible = true
@@ -264,15 +276,18 @@ export default {
       const majors = this.majorsMap[query.studentId]?.majors || []
       getStudentElectiveModels(query).then(res => {
         this.studentMajors = majors
+        const generationModels = res.data?.filter(g => g.generation <= query.generation) || []
+        this.initGenerationModels(generationModels, this.options)
         this.studentGeneration = {
-          options: config.electiveGenerationOptions,
+          options: this.options,
           current: query.generation,
           currentOpt: this.activeOpt,
           active: query.generation,
           activeOpt: this.activeOpt,
           roundGroups: this.prevData.groups,
-          models: res.data,
-          activeModels: res.data?.filter(g => g.generation <= query.generation) || []
+          models: generationModels,
+          activeModels: generationModels,
+          activeModel: generationModels.find(g => g.generation == query.generation)
         }
         this.studentTableVisible = true
       }).finally(() => this.loading = false)