实现系统管理后台 V1

This commit is contained in:
andy committed 2026-07-10 18:32:34 +08:00
1 parent e76cb80f28
commit aa5783ba61
92 files changed
+9383 -21

No files matched your search

@@ -79,6 +79,18 @@ function createDebugMenu(): AuthMenuResult {
}
}
function createSystemMenu(): AuthMenuResult {
return {
menu_code: 'SYSTEM_SETTINGS',
menu_name: '系统设置',
route_path: '/system',
component_key: 'SystemSettings',
icon_key: 'pi pi-cog',
permission_code: 'SYSTEM_ADMIN_CONSOLE_ACCESS',
sort_order: 40,
}
}
async function mountShell(menus = [createReservationOrdersMenu(), createReservationTasksMenu()]) {
const i18n = createI18n({
legacy: false,
@@ -108,6 +120,11 @@ async function mountShell(menus = [createReservationOrdersMenu(), createReservat
component: { template: '<div />' },
meta: { titleKey: 'debugEml.title' },
},
{
path: '/system',
component: { template: '<div />' },
meta: { titleKey: 'nav.systemSettings' },
},
],
})
const pinia = createPinia()
@@ -158,6 +175,13 @@ describe('ReservationAppShell', () => {
expect(wrapper.text()).toContain('Debug EML')
})
it('shows System Settings only when backend menus include it', async () => {
const wrapper = await mountShell([createReservationOrdersMenu(), createSystemMenu()])
expect(wrapper.find('a[href="/system"]').exists()).toBe(true)
expect(wrapper.text()).toContain('系统设置')
})
it('shows current user and hotel context in the top bar', async () => {
const wrapper = await mountShell()