import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { resolve } from 'node:path' const root = resolve(import.meta.dirname, '..') const read = (file) => readFileSync(resolve(root, file), 'utf8') const theme = read('admin-web/src/theme/index.css') const layout = read('admin-web/src/layouts/MainLayout.vue') for (const token of ['--admin-sidebar-bg', '--admin-page-bg', '--admin-primary', '--admin-card-radius']) { assert.ok(theme.includes(token), `缺少管理端令牌 ${token}`) } for (const group of [ '工作台', '用户与资料审核', '匹配与活动服务', '公益咨询与转介', '服务站、预约与专项服务', 'Banner 与内容运营', '举报、申诉与审计', '组织、人员与权限', '数据统计', ]) { assert.ok(layout.includes(group), `缺少菜单组 ${group}`) } assert.ok(layout.includes('/brand/logo-mark.png'), '管理端未使用正式品牌标志') assert.ok(layout.includes('globalSearch'), '管理端顶部搜索没有可操作状态') assert.ok(layout.includes('showNotifications'), '管理端通知入口没有可操作反馈') for (const file of [ 'admin-web/src/views/LoginView.vue', 'admin-web/src/views/DashboardView.vue', 'admin-web/src/modules/user/UserManagementView.vue', 'admin-web/src/modules/user/UserDetailView.vue', 'admin-web/src/modules/review/ReviewView.vue', ]) { const source = read(file) assert.ok( source.includes('page-shell') || source.includes('login-shell'), `${file} 未接入样板布局`, ) assert.doesNotMatch(source, /[\u{1F300}-\u{1FAFF}]/u, `${file} 仍包含 Emoji`) } console.log('Admin redesign contracts passed')