vitesse-yitisheng-web/task_detail.md

29 lines
2.0 KiB
Markdown

# Task Detail
## Session 2026-01-02 (1)
- **Execution Reason**: User requested to encapsulate the "User Recommended Major List API" and integrate it into the `simulate.vue` page (Panel A).
- **Execution Process**:
1. Analyzed the project structure and existing API encapsulation pattern.
2. Created `src/service/api/major.ts` defining `UserMajorListRequest`, `UserMajorListResponse`, `MajorItem` interfaces and `getUserMajorList` function.
3. Updated `src/pages/simulate.vue`:
- Imported the new API.
- Refactored `schools` state to use `MajorItem` type.
- Implemented `loadMore` function to fetch data from API with pagination and filtering.
- Added helper functions `getProbabilityLabel` and `getStatusColor`.
- Updated the template to bind correct fields from `MajorItem` (e.g., `schoolName`, `enrollProbability`, `historyMajorEnrollMap`).
4. Updated project documentation (`project_index.md`, `project_codebase.md`, `project_task.md`, `project_doing.md`).
- **Execution Result**: Successfully integrated the recommended major list API. Panel A in `simulate.vue` now displays real data structure (mapped from API) and supports loading more data.
## Session 2026-01-02 (2)
- **Execution Reason**: User updated the API response structure (`list` -> `list.items`) and requested dynamic tab counts from `list.probCount`.
- **Execution Process**:
1. Updated `src/service/api/major.ts`: Modified `UserMajorListResponse` to include nested `items` and `probCount`.
2. Updated `src/pages/simulate.vue`:
- Updated `tabs` definition to include 'stable' (较稳妥) and made it reactive.
- Updated `loadMore` function to access data from `res.list.items`.
- Added logic to update `tabs[].count` using `res.list.probCount`.
- Added 'stable' case to filter logic.
- **Execution Result**: The application now correctly handles the new API structure and dynamically updates the tab counts based on backend data.