样式修改

This commit is contained in:
2025-12-17 15:32:58 +08:00
parent ded3eddc56
commit aa8ce553b0
52 changed files with 3145 additions and 2010 deletions

View File

@@ -1,13 +1,20 @@
// ==================== 品牌色变量 ====================
$brand-color: #0055AA;
$brand-color-light: #EBF5FF;
$brand-color-hover: #004488;
.sidebar-layout {
display: flex;
width: 100%;
height: 100vh;
overflow: hidden;
background: #fff;
font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
// ==================== 侧边栏(内层子导航样式)====================
// ==================== 1级侧边栏(全局导航样式)====================
.sidebar {
width: 180px;
width: 256px;
height: 100%;
background: #fff;
display: flex;
@@ -15,13 +22,15 @@
color: #333;
flex-shrink: 0;
transition: width 0.3s ease;
border-right: 1px solid #e4e7ed;
border-right: 1px solid #f1f5f9;
z-index: 50;
&.collapsed {
width: 64px;
width: 80px;
overflow: visible;
.sidebar-header {
padding: 16px 12px;
padding: 16px;
justify-content: center;
.logo {
@@ -29,65 +38,124 @@
}
.collapse-btn {
position: static;
margin-left: 0;
display: none;
}
}
.nav-item {
justify-content: center;
padding: 12px;
border-radius: 8px;
margin: 0 12px;
span {
display: none;
}
// 折叠状态下的 tooltip
&:hover::after {
content: attr(data-label);
position: absolute;
left: calc(100% + 12px);
top: 50%;
transform: translateY(-50%);
background: #1e293b;
color: #fff;
padding: 8px 12px;
border-radius: 8px;
font-size: 12px;
white-space: nowrap;
z-index: 100;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
}
.user-section {
justify-content: center;
padding: 16px 12px;
padding: 16px;
.user-info {
display: none;
}
.user-more {
display: none;
}
}
.nav-divider {
margin: 8px 16px;
}
}
}
// 侧边栏头部
.sidebar-header {
padding: 16px 20px;
border-bottom: 1px solid #e4e7ed;
height: 64px;
padding: 0 16px;
margin-bottom: 8px;
display: flex;
align-items: center;
justify-content: space-between;
user-select: none;
}
.collapse-btn {
width: 28px;
height: 28px;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
border-radius: 8px;
cursor: pointer;
color: #909399;
color: #94a3b8;
transition: all 0.2s;
&:hover {
background: rgba(124, 58, 237, 0.1);
color: #7c3aed;
background: #f1f5f9;
color: #64748b;
}
}
.logo {
display: flex;
align-items: center;
gap: 10px;
gap: 8px;
cursor: pointer;
.logo-img {
width: 36px;
height: 36px;
border-radius: 6px;
width: 32px;
height: 32px;
border-radius: 8px;
object-fit: contain;
}
.logo-text {
font-size: 16px;
font-weight: 600;
color: #303133;
color: #1e293b;
letter-spacing: -0.02em;
}
}
// 新建按钮
.new-chat-btn {
margin: 0 16px 8px;
.el-button {
width: 100%;
height: 44px;
background: $brand-color-light;
border: none;
border-radius: 12px;
color: $brand-color;
font-weight: 600;
font-size: 14px;
transition: all 0.2s;
&:hover {
background: darken($brand-color-light, 5%);
}
}
}
@@ -95,65 +163,143 @@
.nav-menu {
flex: 1;
overflow-y: auto;
padding: 16px 0;
padding: 8px 12px;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.15);
background: rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
}
.nav-section {
padding: 0;
}
.nav-item {
// 导航分隔线
.nav-divider {
height: 1px;
background: #f1f5f9;
margin: 8px 4px;
}
// 导航分组标题
.nav-group-title {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 20px;
margin-bottom: 0;
justify-content: space-between;
padding: 8px 12px;
margin-bottom: 4px;
color: #94a3b8;
font-size: 12px;
font-weight: 500;
user-select: none;
}
.nav-item {
position: relative;
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
margin-bottom: 2px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
color: #606266;
color: #64748b;
font-size: 14px;
font-weight: 500;
&:hover {
background: rgba(124, 58, 237, 0.1);
color: #7c3aed;
background: $brand-color-light;
color: $brand-color;
}
&.active {
background: rgba(124, 58, 237, 0.15);
color: #7c3aed;
border-right: 3px solid #7c3aed;
background: $brand-color;
color: #fff;
box-shadow: 0 4px 12px rgba($brand-color, 0.25);
font-weight: 500;
.el-icon {
color: #fff;
}
}
.el-icon {
font-size: 16px;
font-size: 18px;
flex-shrink: 0;
transition: color 0.2s;
}
span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
letter-spacing: 0.01em;
}
}
// 用户信息
.user-section {
padding: 16px 20px;
border-top: 1px solid #e4e7ed;
// 添加智能体按钮
.add-agent-btn {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 16px;
margin-bottom: 2px;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s;
transition: all 0.2s ease;
color: #94a3b8;
font-size: 14px;
&:hover {
background: rgba(124, 58, 237, 0.05);
background: #f8fafc;
color: #64748b;
.add-icon {
border-color: #64748b;
}
}
.add-icon {
width: 20px;
height: 20px;
border: 1px dashed #94a3b8;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
transition: border-color 0.2s;
.el-icon {
font-size: 12px;
}
}
}
// 用户信息区域
.user-section {
padding: 16px;
border-top: 1px solid #f1f5f9;
background: #f8fafc;
cursor: pointer;
transition: background 0.2s;
user-select: none;
&:hover {
background: #f1f5f9;
.user-name {
color: $brand-color;
}
}
.user-info-wrapper {
@@ -163,16 +309,55 @@
}
.user-avatar {
position: relative;
flex-shrink: 0;
img, .el-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
box-shadow: 0 0 0 2px #fff;
object-fit: cover;
background: #fff;
padding: 2px;
}
// 在线状态指示器
&::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 10px;
height: 10px;
background: #22c55e;
border: 2px solid #fff;
border-radius: 50%;
}
}
.user-info {
flex: 1;
min-width: 0;
}
.user-name {
font-size: 14px;
font-weight: 500;
color: #303133;
color: #374151;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: color 0.2s;
}
.user-more {
color: #94a3b8;
transition: color 0.2s;
&:hover {
color: #64748b;
}
}
}
@@ -181,7 +366,7 @@
flex: 1;
height: 100%;
overflow: hidden;
background: #fff;
background: #f8fafc;
position: relative;
}
@@ -200,15 +385,15 @@
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e5e7eb;
background: #fafafa;
border-bottom: 1px solid #e2e8f0;
background: #fff;
flex-shrink: 0;
}
.iframe-title {
font-size: 16px;
font-weight: 600;
color: #333;
color: #1e293b;
}
.content-iframe {
@@ -228,7 +413,7 @@
flex-direction: column;
align-items: center;
gap: 12px;
color: #7c3aed;
color: $brand-color;
font-size: 14px;
z-index: 10;
@@ -240,15 +425,15 @@
// ==================== 响应式 ====================
@media (max-width: 768px) {
.sidebar {
width: 64px;
width: 80px;
&:not(.collapsed) {
width: 180px;
width: 256px;
position: fixed;
left: 0;
top: 0;
z-index: 1000;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}
}

View File

@@ -8,10 +8,8 @@
<span v-if="!collapsed" class="logo-text">城市生命线</span>
</div>
<div class="collapse-btn" @click="toggleSidebar">
<el-icon>
<DArrowLeft v-if="!collapsed" />
<DArrowRight v-else />
</el-icon>
<ChevronLeft v-if="!collapsed" :size="18" />
<ChevronRight v-else :size="18" />
</div>
</div>
@@ -24,7 +22,7 @@
:class="{ active: activeMenu === item.key }"
@click="handleMenuClick(item)"
>
<el-icon><component :is="item.icon" /></el-icon>
<component :is="item.icon" :size="18" />
<span v-if="!collapsed">{{ item.label }}</span>
</div>
</div>
@@ -54,7 +52,7 @@
@load="handleIframeLoad"
/>
<div v-if="iframeLoading" class="iframe-loading">
<el-icon class="is-loading"><Loading /></el-icon>
<Loader :size="20" class="is-loading" />
<span>加载中...</span>
</div>
</div>
@@ -69,19 +67,22 @@
import { ref, computed, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import {
ChatDotRound,
Grid,
Connection,
Document,
Service,
DArrowLeft,
DArrowRight,
MessageCircle,
LayoutGrid,
Workflow,
FileText,
Headphones,
ChevronLeft,
ChevronRight,
User,
Setting,
SwitchButton,
Refresh,
Loading
} from '@element-plus/icons-vue'
Settings,
LogOut,
RefreshCw,
Loader
} from 'lucide-vue-next'
// el-button 图标需要传入组件
const Refresh = RefreshCw
import { ElMessage } from 'element-plus'
import type { MenuItem } from 'shared/types'

View File

@@ -1,4 +1,4 @@
export { default as SidebarLayout } from './SidebarLayout/SidebarLayout.vue'
// BlankLayout从shared导入
export { BlankLayout, AdminSidebarLayout } from 'shared/layouts';
export { BlankLayout, SubSidebarLayout } from 'shared/layouts';