|
56 | 56 | title='提示', |
57 | 57 | type='info', |
58 | 58 | description='您现在还没有添加预期课程~点击下面按钮新增预期课程,就可以估计预期成绩了!', |
59 | | - :show-icon='true' |
| 59 | + :show-icon='true', |
60 | 60 | :closable='false' |
61 | 61 | ) |
62 | 62 | .input-line-list(v-for='(v, i) in newCourses', :key='i') |
@@ -156,10 +156,12 @@ import { |
156 | 156 | getAllCoursesGPA, |
157 | 157 | getAllCoursesScore, |
158 | 158 | getCompulsoryCourses, |
159 | | - getPointByScore |
| 159 | + getPointByScore, |
| 160 | + reserveHigherCoursesForRetakenCourses, |
| 161 | + removeMinorCourses |
160 | 162 | } from '@/plugins/score/utils' |
161 | 163 | import { pluck, sum } from 'ramda' |
162 | | -import { requestAllTermsCourseScoreInfoList } from '@/store/actions/request' |
| 164 | +import { requestAllPassingScores } from '@/store/actions/request' |
163 | 165 | import { notifyError } from '@/helper/util' |
164 | 166 |
|
165 | 167 | type NewCourseType = 'compulsory' | 'optional' |
@@ -235,13 +237,17 @@ export default class ExpectedGradeEstimation extends Vue { |
235 | 237 | } |
236 | 238 |
|
237 | 239 | get hasNoError(): boolean { |
238 | | - return this.alerts.every(v => v.type !== 'error') |
| 240 | + return this.alerts.every((v) => v.type !== 'error') |
239 | 241 | } |
240 | 242 |
|
241 | 243 | get allCourses(): CourseScoreRecord[] { |
242 | | - return this.records.reduce( |
243 | | - (acc, cur) => acc.concat(cur.courses), |
244 | | - [] as CourseScoreRecord[] |
| 244 | + return reserveHigherCoursesForRetakenCourses( |
| 245 | + removeMinorCourses( |
| 246 | + this.records.reduce( |
| 247 | + (acc, cur) => acc.concat(cur.courses), |
| 248 | + [] as CourseScoreRecord[] |
| 249 | + ) |
| 250 | + ) |
245 | 251 | ) |
246 | 252 | } |
247 | 253 |
|
@@ -349,7 +355,7 @@ export default class ExpectedGradeEstimation extends Vue { |
349 | 355 | async created(): Promise<void> { |
350 | 356 | try { |
351 | 357 | const records = await convertCourseScoreInfoListToScoreRecords( |
352 | | - await requestAllTermsCourseScoreInfoList() |
| 358 | + await requestAllPassingScores() |
353 | 359 | ) |
354 | 360 | this.records = records |
355 | 361 | this.loadingIsDone = true |
|
0 commit comments