feat(ui06): B3c form batch — full-page create/edit form + assets tab

- 新增 /albums/form/create 与 /albums/form/:albumId 整页表单路由(隐藏路由,父菜单高亮)
- 编辑模式资料/访问页签(访问=开关行卡:标题+说明+开关);创建模式契约约束下载开关+解释提示
- 校验/提交逻辑与原对话框一致(契约镜像校验;translations 全量替换;创建仅 download 开关)
- 保存成功跳相册详情;manage/detail 两处入口改路由跳转,删除 AlbumFormDialog
- banner 上传收进详情「品牌资产」独立页签(15)
- e2e 适配:整页表单流程(form-page/goback/访问页签)、详情锚点改 summary、banner 页签
- typecheck/lint/vitest/build 全绿

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-23 06:58:01 +08:00
parent d6d012b992
commit 352d7405c2
30 changed files with 565 additions and 337 deletions
+6 -3
View File
@@ -18,14 +18,17 @@ test.beforeAll(() => {
async function createAlbumViaUi(page: Page): Promise<string> {
const suffix = Date.now().toString(36) + Math.random().toString(36).slice(2, 6)
await page.getByTestId('album-create-btn').click()
await expect(page.getByTestId('album-form-dialog')).toBeVisible()
// UI06:创建改整页表单路由
await expect(page.getByTestId('album-form-page')).toBeVisible()
await page.getByTestId('album-form-title-zh-CN').fill(`E2E治理相册 ${suffix}`)
await page.getByRole('tab', { name: '英文' }).click()
await page.getByTestId('album-form-title-en').fill(`E2E Gov Album ${suffix}`)
await page.getByTestId('album-form-start-at').locator('input').fill('2026-10-01 10:00:00')
await page.keyboard.press('Enter')
await page.getByTestId('album-form-submit').click()
await expect(page.getByTestId('album-form-dialog')).toBeHidden()
// 保存成功后跳相册详情;返回列表做断言
await expect(page.getByTestId('album-form-page')).toBeHidden()
await page.goBack()
// UI06:列表默认封面卡片网格;表格断言前先切换
await page.getByTestId('album-view-table').click()
await expect(
@@ -42,7 +45,7 @@ function albumRow(page: Page, suffix: string) {
/** 进入详情页,返回 albumId */
async function openAlbumDetail(page: Page, suffix: string): Promise<string> {
await albumRow(page, suffix).getByTestId('album-detail-btn').click()
await expect(page.getByTestId('album-detail-card')).toBeVisible()
await expect(page.getByTestId('album-summary-cover')).toBeVisible()
const albumId = /\/albums\/detail\/([^/?#]+)/.exec(page.url())?.[1] ?? ''
expect(albumId).not.toBe('')
return albumId
+15 -6
View File
@@ -16,7 +16,8 @@ test.beforeAll(() => {
async function createAlbumViaUi(page: Page): Promise<string> {
const suffix = Date.now().toString(36) + Math.random().toString(36).slice(2, 6)
await page.getByTestId('album-create-btn').click()
await expect(page.getByTestId('album-form-dialog')).toBeVisible()
// UI06:创建改整页表单路由
await expect(page.getByTestId('album-form-page')).toBeVisible()
await page.getByTestId('album-form-title-zh-CN').fill(`E2E相册 ${suffix}`)
// 非激活页签的内容被隐藏(v-show):先切到英文页签再填写
await page.getByRole('tab', { name: '英文' }).click()
@@ -25,7 +26,9 @@ async function createAlbumViaUi(page: Page): Promise<string> {
await page.getByTestId('album-form-start-at').locator('input').fill('2026-10-01 10:00:00')
await page.keyboard.press('Enter')
await page.getByTestId('album-form-submit').click()
await expect(page.getByTestId('album-form-dialog')).toBeHidden()
// 保存成功后跳相册详情;返回列表做断言
await expect(page.getByTestId('album-form-page')).toBeHidden()
await page.goBack()
// UI06:列表默认封面卡片网格;表格断言前先切换
await page.getByTestId('album-view-table').click()
await expect(page.getByTestId('album-list-table').getByText(`E2E相册 ${suffix}`)).toBeVisible()
@@ -43,12 +46,16 @@ test('创建相册(zh+en)→ 列表可见 → 关闭上传开关 → 标签
const row = albumRow(page, suffix)
await row.getByTestId('album-edit-btn').click()
await expect(page.getByTestId('album-form-dialog')).toBeVisible()
// UI06:编辑改整页表单(资料/访问页签)
await expect(page.getByTestId('album-form-page')).toBeVisible()
await page.getByRole('tab', { name: '访问' }).click()
await page.getByTestId('album-form-switch-upload').click()
await page.getByTestId('album-form-submit').click()
await expect(page.getByTestId('album-form-dialog')).toBeHidden()
await expect(page.getByTestId('album-form-page')).toBeHidden()
await page.goBack()
await page.getByTestId('album-view-table').click()
await expect(row.getByTestId('album-switch-upload')).toContainText('关')
await expect(albumRow(page, suffix).getByTestId('album-switch-upload')).toContainText('关')
})
test('详情:邀请成员 → 建分类 → 传 banner → 照片管理(隐藏)', async ({ page }) => {
@@ -57,7 +64,7 @@ test('详情:邀请成员 → 建分类 → 传 banner → 照片管理(隐
// ── 进入详情 ──
await albumRow(page, suffix).getByTestId('album-detail-btn').click()
await expect(page.getByTestId('album-detail-card')).toBeVisible()
await expect(page.getByTestId('album-summary-cover')).toBeVisible()
const albumId = /\/albums\/detail\/([^/?#]+)/.exec(page.url())?.[1] ?? ''
expect(albumId).not.toBe('')
@@ -84,6 +91,8 @@ test('详情:邀请成员 → 建分类 → 传 banner → 照片管理(隐
await expect(page.getByTestId('category-list-table').getByText(`E2E分类 ${suffix}`)).toBeVisible()
// ── banner:真实小 jpeg 走 file chooser → init/PUT/complete → 预览 ──
// UI06:banner 收进「品牌资产」页签
await page.getByTestId('album-assets-tab').click()
const fileChooserPromise = page.waitForEvent('filechooser')
await page.getByTestId('album-banner-pick').click()
const fileChooser = await fileChooserPromise