feat(appearance-patent): 外观专利数据库分组(主管)下拉选中即查——2026-11-11 客户反馈「选了主管应该只显示这一个主管的才对」,原交互选完还要点查询、未点时总数仍显示全量 1725 引发误解;改为选完立刻按该主管过滤刷新(回第一页,group_id 同一过滤面 SQL 下推组长+名下整集),国家/时间仍走查询按钮;挂载测试钉选中即查契约(setValue 后立刻重查+page=1,查询按钮语义不变 13/13 绿,vue-tsc rc=0,扫本文件三支护栏 21/21 绿)

This commit is contained in:
2026-11-11 11:55:32 +08:00
parent 3cfca462ce
commit 2a2e276c32
2 changed files with 18 additions and 4 deletions
@@ -268,7 +268,7 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
})
})
it('分组下拉(主管=组长):选项与去重页同源,选中后 groupId 进列表请求', async () => {
it('分组下拉(主管=组长):选项与去重页同源,选中即查(不必点查询)', async () => {
cleanApi.fetchDedupeTotalGroups.mockResolvedValue([
{ id: 7, name: '甲组', leaderUserId: 9 },
{ id: 8, name: '乙组', leaderUserId: 10 },
@@ -284,11 +284,21 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
expect(optionTexts).toContain('甲组')
expect(optionTexts).toContain('乙组')
// 2026-11-11 四改「选中即查」:选完主管立刻重发请求(回第一页),不等查询按钮
const callsBeforeSelect = cleanApi.fetchAppearancePatentCleanList.mock.calls.length
await groupSelect.setValue('7')
await flushPromises()
expect(cleanApi.fetchAppearancePatentCleanList.mock.calls.length).toBe(callsBeforeSelect + 1, '选中分组必须立刻重查')
expect(cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]).toMatchObject({
groupId: '7',
page: 1,
}, '选中的分组 id 以 groupId 进列表过滤面(服务端解析组长+名下整集),且回第一页')
// 显式点查询仍然生效(同一过滤面再发一次)
await wrapper.findAll('button').find((b) => b.text() === '查询')!.trigger('click')
await flushPromises()
const last = cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]
expect(last.groupId).toBe('7', '选中的分组 id 以 groupId 进列表过滤面(服务端解析组长+名下整集)')
expect(last.groupId).toBe('7', '查询按钮走同一过滤面(分组选中即查不改变查询按钮语义)')
})
it('空态与加载失败条(失败给重试,不把整页打死)', async () => {