feat(phase-4): 京东商品上架用户端页(v1.5 蓝图 docs/ITERATION_PLAN.md §4 Phase 4)——JdPublishTab(分类 jdCollect.groups 唯一源→选品分页 owner 过滤→跨页勾选→改价三档→建单 queuePayload 直推→useLiveTaskBoard 行级面板+credential-fatal 同形接入)+tool-catalog 占位卡转正式+router 注册;后端面板读侧 JdCollectController 同形五端点(products/dashboard/history/progressBatch/delete)+JdPublishBoardService(无 scope_state,进度真源=明细行级四档)+JdProductQueryService.pageForUser(归属表两步下推不夹原生 SQL);激活 Phase 0 预置 5 支 Pending 契约;判据:JdPublishBoardServiceTest 5+JdProductQueryServiceUserPageTest 4+outlet 分母 138/72(写+2 读+3 随面板端点)、endpoints 冻结快照+progress/batch 清单+1、终态窄集合台账+JdPublishTab 1、catch 块 319→324 全非静默、占位 mount 锁翻转两条断言;vue-tsc rc0、用户端 node --test 1078/1078+vitest mount 90/90、后端点名 6 类 41 例 BUILD SUCCESS、快检四面格(后端 9.5/客户端 10.0/用户端 9.6)绿,唯一红格=后管 mount 组件挂载格,甄别=他窗在飞 admin 件输出含 failed 子串触发 ruler vfail 脆弱判据(实跑 cmd /c npx vitest run RC=0、188/188 全过,本笔零后管文件)

This commit is contained in:
zwork
2026-11-18 12:23:27 +08:00
parent b5578561df
commit 917884aa6d
25 changed files with 1888 additions and 33 deletions
@@ -3,8 +3,12 @@
*
* 三件事一起判,缺一条就是假绿:
* ① 两个菜单名都在 DOM 里(获取店铺数据 / 商品上架);
* ② 获取店铺数据是「可用」卡片(有 href → router-link 分支,文案是「打开工具」);
* ③ 商品上架是「假菜单」:没有 href,点开只弹一句「暂未开通」,不发任何请求。
* ② 两张卡都是「可用」卡片(有 href → router-link 分支,文案是「打开工具」);
* ③ 商品上架卡(v1.5 Phase 4 由占位转正式)的 router-link 指向 /jd-publish。
*
* 历史锁(2026-11-17):本文件原本钉「商品上架是假菜单(tool-card--pending,点开只弹
* 暂未开通)」;占位随 Phase 4 转正式后这两条断言翻转为可用卡形状,假菜单分支在
* JdConsolePage 保留为通用防御(后续新工具再用)。
*
* 跑法:cd frontend-vue && npx vitest run(tests/mount/** 由 vitest.config.ts 收)。
*/
@@ -20,8 +24,8 @@ function mountConsole() {
global: {
stubs: {
NotificationBell: true,
RouterLink: { template: '<a class="router-link-stub"><slot /></a>' },
'router-link': { template: '<a class="router-link-stub"><slot /></a>' },
RouterLink: { props: ['to'], template: '<a class="router-link-stub" :data-to="to"><slot /></a>' },
'router-link': { props: ['to'], template: '<a class="router-link-stub" :data-to="to"><slot /></a>' },
},
},
})
@@ -47,21 +51,19 @@ describe('京东工作台两个菜单', () => {
expect(w.findAll('.tool-card').length).toBe(2)
})
it('获取店铺数据是可用卡片,商品上架是占位(暂未开通)', () => {
it('两张卡都是可用卡片(转正式后无占位态)', () => {
const w = mountConsole()
const cards = w.findAll('.tool-card')
expect(cards[0].classes()).not.toContain('tool-card--pending')
expect(cards[0].text()).toContain('打开工具')
expect(cards[1].classes()).toContain('tool-card--pending')
expect(cards[1].text()).toContain('暂未开通')
expect(cards[1].classes()).not.toContain('tool-card--pending')
expect(cards[1].text()).toContain('打开工具')
})
it('点假菜单只弹提示,不跳转', async () => {
it('商品上架卡的 router-link 指向 /jd-publish(占位已转正式)', () => {
const w = mountConsole()
const pending = w.findAll('.tool-card')[1]
await pending.trigger('click')
const toast = w.find('.toast')
expect(toast.text()).toContain('商品上架暂未开通')
expect(toast.classes()).toContain('show')
const links = w.findAll('a.router-link-stub').map((a) => a.attributes('data-to'))
expect(links).toContain('/jd-collect')
expect(links).toContain('/jd-publish')
})
})