소스 검색

elective report compatible for non-finish processing

hare8999@163.com 2 년 전
부모
커밋
f8cb830fd2

+ 2 - 1
src/views/career/bigdataSelectCourse/enrollReport.vue

@@ -95,6 +95,7 @@ export default {
       const dmOpts = allOpts.filter(opt => opt.stepsVisible && opt.decisionMaking)
       const steps = dmOpts.map(opt => {
         const genModel = this.generation.models.find(gm => gm.option == opt)
+        if (!genModel || !genModel.models?.length) return null
         const prevName = allOpts.find(item => item.value == opt.value - 1).title
         const nextName = allOpts.find(item => item.value == opt.value + 1).title
         const nextRecommend = genModel.models.find(item => item.nextRecommend)
@@ -113,7 +114,7 @@ export default {
           nextRecommend
         }
       })
-      const enrollIndex = steps.findIndex(step => step.isEnroll)
+      const enrollIndex = steps.findIndex(step => step?.isEnroll)
       return steps.slice(0, enrollIndex + 1)
     }
   },

+ 1 - 0
src/views/elective/report/components/elective-ai-analysis.vue

@@ -29,6 +29,7 @@ export default {
     hasAISteps() {
       if (!this.generation.models?.length) return []
       const allOpts = this.generation.options
+      if (this.generation.current < allOpts.backTracking.value) return []
       const allModels = this.generation.models
       const applyOpts = Object.values(allOpts)
         .filter(opt => !opt.decisionMaking && opt.stepsVisible && opt.value > allOpts.primary.value)

+ 1 - 1
src/views/elective/report/components/elective-enroll-analysis.vue

@@ -44,7 +44,7 @@ export default {
   methods: {
     loadDispatchInfo() {
       const { year, roundId } = this.generation.status
-      classesResult({ year, roundId }).then(res => this.dispatchInfo = res.rows.first())
+      classesResult({ year, roundId }).then(res => this.dispatchInfo = res.rows.first() || {})
     }
   }
 }