feat: 修改大屏样式布局
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="sidebar-header">
|
||||
<div class="logo-wrapper">
|
||||
<span class="logo-icon">📊</span>
|
||||
<span v-show="sidebar.opened" class="logo-text">数据管理平台</span>
|
||||
<span v-show="sidebar.opened" class="logo-text">数据大屏</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-scrollbar class="sidebar-scroll">
|
||||
@@ -16,24 +16,10 @@
|
||||
router
|
||||
unique-opened
|
||||
>
|
||||
<template v-for="item in menuItems" :key="item.path">
|
||||
<el-menu-item v-if="!item.children || item.children.length === 0" :index="item.path">
|
||||
<el-icon :size="14"><component :is="getIcon(item.meta?.icon)" /></el-icon>
|
||||
<span>{{ item.meta?.title }}</span>
|
||||
</el-menu-item>
|
||||
<el-sub-menu v-else :index="item.path">
|
||||
<template #title>
|
||||
<el-icon :size="14"><component :is="getIcon(item.meta?.icon)" /></el-icon>
|
||||
<span>{{ item.meta?.title }}</span>
|
||||
</template>
|
||||
<template v-for="child in item.children" :key="child.path">
|
||||
<el-menu-item v-if="!child.children || child.children.length === 0" :index="child.path">
|
||||
<el-icon :size="12"><component :is="getIcon(child.meta?.icon)" /></el-icon>
|
||||
<span>{{ child.meta?.title }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-sub-menu>
|
||||
</template>
|
||||
<el-menu-item v-for="item in menuItems" :key="item.path" :index="item.path">
|
||||
<el-icon :size="14"><component :is="getIcon(item.meta?.icon)" /></el-icon>
|
||||
<span>{{ item.meta?.title }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -43,7 +29,7 @@
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useStore } from 'vuex'
|
||||
import { Refresh, Monitor, PieChart, Document, List, Plus, Bell, Setting } from '@element-plus/icons-vue'
|
||||
import { Monitor, PieChart, Document, Bell } from '@element-plus/icons-vue'
|
||||
|
||||
const route = useRoute()
|
||||
const store = useStore()
|
||||
@@ -52,24 +38,14 @@ const sidebar = computed(() => store.state.app.sidebar)
|
||||
const activeMenu = computed(() => route.path)
|
||||
|
||||
const iconMap = {
|
||||
'dashboard': Monitor,
|
||||
'monitor': Monitor,
|
||||
'example': PieChart,
|
||||
'order': Document,
|
||||
'cost': PieChart,
|
||||
'energy': Monitor,
|
||||
'pie-chart': PieChart,
|
||||
'list': List,
|
||||
'plus': Plus,
|
||||
'document': Document,
|
||||
'oee': PieChart,
|
||||
'output': PieChart,
|
||||
'stop': Bell,
|
||||
'system': Setting,
|
||||
'user': Refresh,
|
||||
'role': Refresh,
|
||||
'menu': List,
|
||||
'config': Setting,
|
||||
'database': Monitor
|
||||
'stop': Bell
|
||||
}
|
||||
|
||||
const getIcon = (iconName) => {
|
||||
@@ -77,52 +53,14 @@ const getIcon = (iconName) => {
|
||||
}
|
||||
|
||||
const menuItems = [
|
||||
{
|
||||
path: '/index',
|
||||
meta: { title: '工作台', icon: 'dashboard' },
|
||||
children: []
|
||||
},
|
||||
{
|
||||
path: '/dashboard',
|
||||
meta: { title: '数据大屏', icon: 'monitor' },
|
||||
children: [
|
||||
{ path: '/dashboard/demo', meta: { title: '示例大屏', icon: 'example' }, children: [] },
|
||||
{ path: '/dashboard/order', meta: { title: '订单大屏', icon: 'order' }, children: [] },
|
||||
{ path: '/dashboard/cost', meta: { title: '成本大屏', icon: 'cost' }, children: [] },
|
||||
{ path: '/dashboard/energy', meta: { title: '能源大屏', icon: 'energy' }, children: [] },
|
||||
{ path: '/dashboard/acid-rolling', meta: { title: '酸轧数据大屏', icon: 'example' }, children: [] }
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/screen-manage',
|
||||
meta: { title: '大屏管理', icon: 'pie-chart' },
|
||||
children: [
|
||||
{ path: '/screen-manage', meta: { title: '大屏列表', icon: 'list' }, children: [] },
|
||||
{ path: '/screen-manage/create', meta: { title: '新建大屏', icon: 'plus' }, children: [] }
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/reports',
|
||||
meta: { title: '报表管理', icon: 'document' },
|
||||
children: [
|
||||
{ path: '/reports', meta: { title: '报表列表', icon: 'list' }, children: [] },
|
||||
{ path: '/reports/acid-rolling', meta: { title: '酸轧产出报表', icon: 'output' }, children: [] },
|
||||
{ path: '/reports/acid-stop', meta: { title: '酸轧停机报表', icon: 'stop' }, children: [] }
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system',
|
||||
meta: { title: '系统管理', icon: 'system' },
|
||||
children: [
|
||||
{ path: '/system/menu', meta: { title: '菜单管理', icon: 'menu' }, children: [] },
|
||||
{ path: '/system/config', meta: { title: '系统配置', icon: 'config' }, children: [] }
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/data-source',
|
||||
meta: { title: '数据源配置', icon: 'database' },
|
||||
children: []
|
||||
}
|
||||
{ path: '/dashboard/demo', meta: { title: '示例大屏', icon: 'example' } },
|
||||
{ path: '/dashboard/order', meta: { title: '订单大屏', icon: 'order' } },
|
||||
{ path: '/dashboard/cost', meta: { title: '成本大屏', icon: 'cost' } },
|
||||
{ path: '/dashboard/energy', meta: { title: '能源大屏', icon: 'energy' } },
|
||||
{ path: '/dashboard/oee', meta: { title: 'OEE综合大屏', icon: 'oee' } },
|
||||
{ path: '/dashboard/output', meta: { title: '产出监控大屏', icon: 'output' } },
|
||||
{ path: '/dashboard/stop-analysis', meta: { title: '停机分析大屏', icon: 'stop' } },
|
||||
{ path: '/dashboard/acid-rolling', meta: { title: '酸轧数据大屏', icon: 'example' } }
|
||||
]
|
||||
</script>
|
||||
|
||||
@@ -131,9 +69,9 @@ const menuItems = [
|
||||
flex-shrink: 0;
|
||||
width: 200px;
|
||||
height: 100vh;
|
||||
background: #ffffff;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
|
||||
background: linear-gradient(180deg, #0a1428 0%, #0d1b34 100%);
|
||||
border-right: 1px solid rgba(0, 212, 255, 0.2);
|
||||
box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.3);
|
||||
transition: width 0.28s ease;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -147,8 +85,8 @@ const menuItems = [
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #3A71A8, #324157);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
background: linear-gradient(90deg, #00a8cc 0%, #00d4ff 50%, #00a8cc 100%);
|
||||
border-bottom: 1px solid rgba(0, 212, 255, 0.3);
|
||||
|
||||
.logo-wrapper {
|
||||
display: flex;
|
||||
@@ -157,13 +95,13 @@ const menuItems = [
|
||||
|
||||
.logo-icon {
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
color: #0a1428;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
color: #0a1428;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
}
|
||||
@@ -175,22 +113,22 @@ const menuItems = [
|
||||
overflow-x: hidden;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 4px;
|
||||
background: rgba(0, 212, 255, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #c1c1c1;
|
||||
border-radius: 4px;
|
||||
background: rgba(0, 212, 255, 0.3);
|
||||
border-radius: 3px;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: #a8a8a8;
|
||||
background: rgba(0, 212, 255, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,78 +136,62 @@ const menuItems = [
|
||||
.sidebar-menu {
|
||||
border-right: none;
|
||||
background: transparent;
|
||||
padding: 4px;
|
||||
padding: 8px;
|
||||
|
||||
:deep(.el-menu) {
|
||||
border-right: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-menu-item),
|
||||
:deep(.el-sub-menu__title) {
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
color: #333333;
|
||||
margin: 2px 0;
|
||||
padding: 0 8px;
|
||||
border-radius: 0;
|
||||
:deep(.el-menu-item) {
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
color: #ffffff;
|
||||
margin: 6px 4px;
|
||||
padding: 0 16px;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
border-left: 3px solid transparent;
|
||||
transition: all 0.2s ease;
|
||||
transition: all 0.25s ease;
|
||||
background: rgba(0, 212, 255, 0.08);
|
||||
font-size: 14px;
|
||||
|
||||
.el-icon {
|
||||
color: #8c8c8c;
|
||||
margin-right: 8px;
|
||||
font-size: 14px;
|
||||
color: #00d4ff;
|
||||
margin-right: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.06);
|
||||
color: #1a1a1a;
|
||||
background: rgba(0, 212, 255, 0.25);
|
||||
color: #ffffff;
|
||||
transform: translateX(4px);
|
||||
|
||||
.el-icon {
|
||||
color: #555555;
|
||||
color: #00d4ff;
|
||||
text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-left: 3px solid #409eff;
|
||||
background: rgba(64, 158, 255, 0.1);
|
||||
color: #1a1a1a;
|
||||
border-left: 3px solid #00d4ff;
|
||||
background: rgba(0, 212, 255, 0.3);
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 0 15px rgba(0, 212, 255, 0.25);
|
||||
|
||||
.el-icon {
|
||||
color: #409eff;
|
||||
color: #00d4ff;
|
||||
text-shadow: 0 0 15px rgba(0, 212, 255, 0.9);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-sub-menu__title) {
|
||||
&::after {
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-sub-menu .el-menu-item) {
|
||||
padding-left: 18px !important;
|
||||
font-size: 13px;
|
||||
|
||||
&.is-active {
|
||||
padding-left: 18px !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-sub-menu .el-sub-menu .el-menu-item) {
|
||||
padding-left: 28px !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&.is-collapse {
|
||||
:deep(.el-menu-item),
|
||||
:deep(.el-sub-menu__title) {
|
||||
:deep(.el-menu-item) {
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
border-left: none;
|
||||
|
||||
span {
|
||||
display: none;
|
||||
@@ -278,27 +200,12 @@ const menuItems = [
|
||||
.el-icon {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-left: none;
|
||||
background: rgba(0, 212, 255, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-menu--popup) {
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
|
||||
.el-menu-item {
|
||||
padding: 0 20px;
|
||||
border-left: none;
|
||||
|
||||
&:hover {
|
||||
background: rgba(64, 158, 255, 0.08);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-left: none;
|
||||
background: rgba(64, 158, 255, 0.12);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user