优化前端控制台样式并更新文档
This commit is contained in:
@@ -7,15 +7,6 @@ import {
|
||||
Files,
|
||||
Grid,
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { useAppStore } from '@/stores/app';
|
||||
|
||||
const route = useRoute();
|
||||
const appStore = useAppStore();
|
||||
|
||||
const pageTitle = computed(() => String(route.meta.title ?? 'Common Agent'));
|
||||
|
||||
const menuItems = [
|
||||
{ path: '/dashboard', label: '工作台', icon: DataBoard },
|
||||
@@ -47,13 +38,6 @@ const menuItems = [
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
<el-header class="admin-header">
|
||||
<div>
|
||||
<h1>{{ pageTitle }}</h1>
|
||||
<p>{{ appStore.environmentName }}</p>
|
||||
</div>
|
||||
</el-header>
|
||||
|
||||
<el-main class="admin-main">
|
||||
<RouterView />
|
||||
</el-main>
|
||||
|
||||
29
frontend/src/layouts/__tests__/AdminLayout.spec.ts
Normal file
29
frontend/src/layouts/__tests__/AdminLayout.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { mount } from '@vue/test-utils';
|
||||
import ElementPlus from 'element-plus';
|
||||
import { createPinia } from 'pinia';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import AdminLayout from '../AdminLayout.vue';
|
||||
|
||||
vi.mock('vue-router', () => ({
|
||||
useRoute: () => ({ meta: { title: '系统枚举' } }),
|
||||
}));
|
||||
|
||||
describe('AdminLayout', () => {
|
||||
it('does not render a duplicate page header above the main page content', () => {
|
||||
const wrapper = mount(AdminLayout, {
|
||||
global: {
|
||||
plugins: [createPinia(), ElementPlus],
|
||||
mocks: {
|
||||
$route: { path: '/system/enums' },
|
||||
},
|
||||
stubs: {
|
||||
RouterView: { template: '<main data-test="router-view" />' },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.admin-header').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-test="router-view"]').exists()).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user