fix(jd-admin): 类目面板重开自动展开到已选节点(2026-11-19 客户「选中没实心」追问)——选中后面板即收,旧形状重开只铺第一栏,实心圆点要手动下钻两级才看得见,第一眼只见「全部类目」空心像选中丢了;重开按 selectedPath 前缀铺栏、末级亮蓝芯直接可见(路径无效列算自然止步,树外兜底行不受影响)。判据:vue-tsc rc0+jd-database-page.mount 44/44(回显断言改钉「重开即两栏、女装圆点直接蓝芯」)

This commit is contained in:
2026-11-19 10:24:31 +08:00
parent b030ce392c
commit 8453091630
2 changed files with 13 additions and 8 deletions
@@ -128,7 +128,12 @@ function toggle(): void {
close()
return
}
activePath.value = []
// 重开面板自动展开到已选节点(2026-11-19 客户「选中没实心」):选中后面板即收,重开
// 若从头铺第一栏,实心圆点要手动下钻两级才看得见,第一眼只见「全部类目」空心、像是
// 选中丢了——按 selectedPath 前缀铺栏(末级留在最后一栏亮蓝芯);路径无效时列算到
// children 空自然止步,树外兜底行 path 空不受影响。
const picked = props.selectedPath ?? []
activePath.value = picked.length ? picked.slice(0, -1) : []
searchText.value = ''
open.value = true
nextTick(reposition)
@@ -639,15 +639,15 @@ describe('京东数据库页(v1.4 Phase 5)', () => {
page: 1,
})
// 选中态回显:重新打开面板并下钻,被选节点(女装)的圆点是蓝芯(.cat-dot.on),
// 其余行空心——11-16 旧形状里非末级行圆点永远空心、无法表达选中。
// 选中态回显:重开面板自动按已选路径展开(2026-11-19 客户「选中没实心」——旧形状
// 重开只铺第一栏,实心圆点要手动下钻两级才看得见),女装圆点直接蓝芯(.cat-dot.on),
// 同栏未选中行空心。
await wrapper.find('.cat-trigger').trigger('click')
const reopened1 = wrapper.findAll('.cat-col')[0]
await reopened1.findAll('.cat-row').find((row) => row.text().includes('服饰内衣'))!.trigger('click')
const reopened2 = wrapper.findAll('.cat-col')[1]
const womenRow = reopened2.findAll('.cat-row').find((row) => row.text().includes('女装'))!
const reopenedCols = wrapper.findAll('.cat-col')
expect(reopenedCols).toHaveLength(2, '重开面板按已选路径自动展开到末级所在栏')
const womenRow = reopenedCols[1].findAll('.cat-row').find((row) => row.text().includes('女装'))!
expect(womenRow.find('.cat-dot').classes()).toContain('on', '二级选中态圆点回显')
const menRow = reopened2.findAll('.cat-row').find((row) => row.text().includes('男装'))!
const menRow = reopenedCols[1].findAll('.cat-row').find((row) => row.text().includes('男装'))!
expect(menRow.find('.cat-dot').classes()).not.toContain('on', '未选中行保持空心圆')
})