refactor(M08-D-R1): 后台改用权限路由与懒加载

This commit is contained in:
Codex
2026-08-10 20:57:30 +08:00
parent bb89061671
commit 3faf86872d
17 changed files with 1768 additions and 814 deletions
+23 -28
View File
@@ -8,39 +8,31 @@ const read = (path) => readFileSync(join(root, path), 'utf8');
const app = read('admin/src/App.vue');
for (const pattern of [
'OperationsOverviewPanel',
"activeModule = 'overview'",
"activeModule = 'cleaning'",
"activeModule = 'stores'",
"activeModule = 'orders'",
"activeModule = 'payments'",
"activeModule = 'thirdParty'",
"activeModule = 'people'",
"activeModule = 'devices'",
"activeModule = 'platformApps'",
"activeModule = 'content'",
"activeModule = 'franchise'",
"activeModule = 'system'",
'平台运营总览',
'StoresRoomsPanel',
'OrdersPanel',
'PaymentsPanel',
'ThirdPartyPanel',
'MembersStaffPanel',
'DevicesPanel',
'PlatformAppsPanel',
'ContentManagementPanel',
'FranchisePanel',
'LogsSystemPanel',
'RouterLink',
'RouterView',
'visibleNavigation',
'isNavigationAllowed',
'restoreSession',
'routeLoadError',
'AdminLoginPanel',
'运营总览',
'savedToken',
'handleAuthenticated',
'handleLogout',
'loadCleaningWorkspace'
'openCleaning'
]) {
assert.match(app, new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
}
assert.doesNotMatch(app, /import\s+(?!AdminLoginPanel\b)\w+Panel\s+from/);
const router = read('admin/src/router.ts');
assert.equal((router.match(/\(\) => import\('/g) || []).length, 12);
assert.match(router, /router\.beforeEach/);
const navigation = read('admin/src/navigation.mjs');
for (const path of ['/overview', '/stores', '/orders', '/payments', '/third-party', '/people',
'/cleaning', '/devices', '/apps', '/content', '/franchise', '/system']) assert.ok(navigation.includes(`path: '${path}'`));
const cleaningWorkspace = read('admin/src/components/CleaningWorkspace.vue');
for (const pattern of ['CleaningTasksPanel', 'CleaningSettlementsPanel', 'CleaningStatisticsPanel',
'CleanersPanel', 'CleaningFieldHandoffPanel', 'loadCleaningWorkspace']) assert.match(cleaningWorkspace, new RegExp(pattern));
const overview = read('admin/src/components/OperationsOverviewPanel.vue');
for (const pattern of [
@@ -301,10 +293,13 @@ for (const pattern of [
'.audit-filters',
'.login-shell',
'.session-box',
'.session-recovery',
'.route-state',
'@media (max-width: 980px)',
'@media (max-width: 768px)',
'@media (max-width: 560px)'
]) {
assert.match(styles, new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
}
console.log('PASS: M08-D admin operations overview and scoped business statistics are present.');
console.log('PASS: M08-D admin operations and M08-D-R1 route architecture are present.');