Browse Source

student elective - report table display logic fixed

hare8999@163.com 2 years ago
parent
commit
94f3ee9c0f

+ 1 - 1
src/views/elective/generation/detail.vue

@@ -51,7 +51,7 @@
       <elective-generation-flow-log :groups="prevData.groups" :histories="logRow.histories"
                                     :matched-majors="this.majorsMap[logRow['studentId']]"/>
     </el-dialog>
-    <el-dialog title="查看详情" :visible.sync="studentTableVisible" :width="logDialogWidth">
+    <el-dialog :title="'查看详情 '+activeOpt.title" :visible.sync="studentTableVisible" :width="logDialogWidth">
       <report-table :generation="studentGeneration" :optional-majors="studentMajors" readonly></report-table>
     </el-dialog>
   </div>

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

@@ -5,7 +5,7 @@
         <slot name="header-prefix"></slot>
         <p v-if="generation.active > 1" v-html="currentSupplyInfo"></p>
       </div>
-      <div v-if="!readonly">
+      <div>
         <el-button v-if="aiButtonShow" type="primary" @click="toAiAnalysis">AI分析</el-button>
         <!--        <el-button>选科历史记录</el-button>-->
       </div>
@@ -260,13 +260,16 @@ export default {
       return info
     },
     flagShow() {
-      return (this.generation.current == 3 && this.generation.active == 3) ||
-        (this.generation.current == 5 && this.generation.active == 5) ||
-        (this.generation.current == 5 && this.generation.active == 7)
+      const stepMatched = this.generation.active == this.generation.current
+      const selectStep = !this.generation.activeOpt.decisionMaking
+      return stepMatched && selectStep && !this.readonly
     },
     aiButtonShow() {
-      const aiButtonShow = !this.generation.activeOpt?.decisionMaking && this.generation.activeOpt?.key != 'primary'
-      return aiButtonShow
+      if (!this.generation.activeOpt) return false
+      const options = this.generation.options
+      return !this.generation.activeOpt.decisionMaking &&
+        this.generation.activeOpt != options.primary &&
+        !this.readonly
     },
     resolveTablePrefix() {
       return {
@@ -379,8 +382,10 @@ export default {
     },
     isGroupOverSetting(row) {
       if (this.generation.activeOpt.decisionMaking) {
+        console.log('isGroupOverSetting decisionMaking', row.groupApprovedCount >= row.personCount, row)
         return row.groupApprovedCount >= row.personCount
       } else {
+        console.log('isGroupOverSetting', row.actualCount >= row.groupIndicator, row)
         return row.actualCount >= row.groupIndicator
       }
     },