fix(P1): Mock 数据对接后端 API — editPlans.ts + GeneratePage.tsx #162

Closed
xiaoxia wants to merge 1 commits from feature/fix-p1-mock-data into main

1 Commits

Author SHA1 Message Date
灵应 c5f4a1656f fix(P1-2): GeneratePage.tsx MOCK_MATERIALS → 真实 API
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Tests / lint (pull_request) Failing after 172h19m55s
Tests / test (pull_request) Failing after 172h20m59s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 172h21m26s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 172h21m31s
Deploy / Deploy Staging (push) Failing after 172h21m57s
CI/CD Pipeline / Frontend Lint (push) Failing after 172h22m25s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 172h22m32s
- 删除 MOCK_MATERIALS,改用 useQuery 从 /api/v1/assets 获取素材
- handleGenerate 改为 async:createEditPlan → generateEditPlan → 轮询任务状态
- 素材列表增加 loading/empty 状态展示
- materialIcon 兼容 MediaAsset.type → mime 映射
- 修复 Tag variant='danger' → 'error'(TypeScript 类型错误)
- 移除未使用的 AssetItem 导入

editPlans.ts 同步完成 P1-1:
- 全部 Mock 数据替换为真实 API 调用
- 新增 getMediaAssets/getMediaAsset/generateEditPlan/getEditPlanTask
- AssetItem → MediaAsset 映射函数

验收:npx tsc --noEmit 零错误(GeneratePage.tsx + editPlans.ts)
2026-07-02 08:31:58 +08:00