feat(admin): 管理端改为多标签导航

- 菜单点击打开标签页,标签可关闭,关闭当前标签自动切换相邻标签
- 页面面板 v-show 保活,切换标签保留筛选/分页/选中状态
- 激活标签仍刷新数据,登录/退出重置标签
- 补充多标签契约测试
This commit is contained in:
wangheng
2026-09-23 13:03:16 +08:00
parent c1ebb30cce
commit 51f8639a3a
3 changed files with 62 additions and 5 deletions
@@ -29,3 +29,16 @@ test('prototype interactions expose stable test ids', async () => {
assert.match(source, new RegExp(`data-testid=["']${testId}["']`), testId)
}
})
test('multi-tab navigation exposes tab bar and close controls', async () => {
const source = await readFile(new URL('../src/App.vue', import.meta.url), 'utf8')
assert.match(source, /data-testid=["']admin-tabbar["']/, 'admin-tabbar')
assert.match(source, /admin-tab-\$\{tab\.id\}/, 'admin-tab-*')
assert.match(source, /admin-tab-close-\$\{tab\.id\}/, 'admin-tab-close-*')
assert.match(source, /openTabs\.includes\('tokens'\)/, 'tokens panel gated by openTabs')
assert.match(source, /openTabs\.includes\('clients'\)/, 'clients panel gated by openTabs')
assert.match(source, /openTabs\.includes\('tools'\)/, 'tools panel gated by openTabs')
assert.match(source, /openTabs\.includes\('scopes'\)/, 'scopes panel gated by openTabs')
assert.match(source, /openTabs\.includes\('audit'\)/, 'audit panel gated by openTabs')
assert.match(source, /function closeTab\(/, 'closeTab handler')
})