模拟了模型对比对话的页面
This commit is contained in:
@@ -139,6 +139,30 @@
|
||||
--danger: #f5222d;
|
||||
--success: #52c41a;
|
||||
}
|
||||
|
||||
/* 侧边栏滑块动画 */
|
||||
.sidebar-slider {
|
||||
position: absolute;
|
||||
width: 4px;
|
||||
height: 0;
|
||||
background-color: var(--primary);
|
||||
border-radius: 0 2px 2px 0;
|
||||
transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 菜单项相对定位 */
|
||||
.nav-item-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 选中项背景动画 */
|
||||
.nav-link {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="antialiased bg-gray-50 flex h-screen overflow-hidden">
|
||||
@@ -151,47 +175,66 @@
|
||||
</div>
|
||||
|
||||
<!-- 导航主区域 -->
|
||||
<nav class="flex-1 overflow-y-auto py-2">
|
||||
<nav class="flex-1 overflow-y-auto py-2 relative">
|
||||
<!-- 滑块指示器 -->
|
||||
<div class="sidebar-slider" id="sidebar-slider"></div>
|
||||
|
||||
<!-- 第一分区:模型服务 -->
|
||||
<div class="sidebar-section-title">模型服务</div>
|
||||
<a href="#" data-page="fine-tune" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-cogs w-5 text-center"></i>
|
||||
<span class="ml-2">模型调优</span>
|
||||
</a>
|
||||
<a href="#" data-page="my-models" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-database w-5 text-center"></i>
|
||||
<span class="ml-2">我的模型</span>
|
||||
</a>
|
||||
<a href="#" data-page="model-eval" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-line-chart w-5 text-center"></i>
|
||||
<span class="ml-2">模型评测</span>
|
||||
</a>
|
||||
<a href="#" data-page="model-compare" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-server w-5 text-center"></i>
|
||||
<span class="ml-2">模型对比</span>
|
||||
</a>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="fine-tune" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-cogs w-5 text-center"></i>
|
||||
<span class="ml-2">模型调优</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="my-models" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-database w-5 text-center"></i>
|
||||
<span class="ml-2">我的模型</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="model-eval" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-line-chart w-5 text-center"></i>
|
||||
<span class="ml-2">模型评测</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="model-compare" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-server w-5 text-center"></i>
|
||||
<span class="ml-2">模型对比</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- 第二分区:资源管理 -->
|
||||
<div class="sidebar-section-title mt-6">资源管理</div>
|
||||
<a href="#" data-page="model-manage" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-cube w-5 text-center"></i>
|
||||
<span class="ml-2">模型管理</span>
|
||||
</a>
|
||||
<a href="#" data-page="dataset-manage" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-file-text w-5 text-center"></i>
|
||||
<span class="ml-2">数据集管理</span>
|
||||
</a>
|
||||
<a href="#" data-page="data-generate" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-database w-5 text-center"></i>
|
||||
<span class="ml-2">其他工具</span>
|
||||
</a>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="model-manage" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-cube w-5 text-center"></i>
|
||||
<span class="ml-2">模型管理</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="dataset-manage" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-file-text w-5 text-center"></i>
|
||||
<span class="ml-2">数据集管理</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="data-generate" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-database w-5 text-center"></i>
|
||||
<span class="ml-2">其他工具</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- 第三分区:系统设置 -->
|
||||
<div class="sidebar-section-title mt-6">系统设置</div>
|
||||
<a href="#" data-page="config" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-bar-chart w-5 text-center"></i>
|
||||
<span class="ml-2">平台性能</span>
|
||||
</a>
|
||||
<div class="nav-item-wrapper">
|
||||
<a href="#" data-page="config" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
|
||||
<i class="fa fa-bar-chart w-5 text-center"></i>
|
||||
<span class="ml-2">平台性能</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 底部信息区域 -->
|
||||
@@ -404,7 +447,8 @@
|
||||
'download': '下载',
|
||||
'detail': '详情',
|
||||
'edit': '编辑',
|
||||
'compare': '开始对比'
|
||||
'compare': '开始对话',
|
||||
'chat': '对话'
|
||||
};
|
||||
|
||||
// 页面加载完成后初始化
|
||||
@@ -459,6 +503,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化滑块位置
|
||||
initSlider();
|
||||
// 设置初始选中项的滑块位置
|
||||
setTimeout(() => {
|
||||
const activeLink = document.querySelector('.nav-link.sidebar-item-active');
|
||||
if (activeLink) {
|
||||
updateSliderPosition(activeLink.closest('.nav-item-wrapper'));
|
||||
}
|
||||
}, 50);
|
||||
|
||||
// 绑定导航点击事件
|
||||
document.querySelectorAll('.nav-link').forEach(link => {
|
||||
link.addEventListener('click', function(e) {
|
||||
@@ -477,10 +531,41 @@
|
||||
});
|
||||
this.classList.add('sidebar-item-active');
|
||||
this.classList.remove('hover:bg-[#001529]/20', 'transition-colors');
|
||||
|
||||
// 更新滑块位置
|
||||
updateSliderPosition(this.closest('.nav-item-wrapper'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化滑块
|
||||
function initSlider() {
|
||||
const slider = document.getElementById('sidebar-slider');
|
||||
if (!slider) return;
|
||||
// 确保滑块初始不可见
|
||||
slider.style.height = '0';
|
||||
slider.style.opacity = '0';
|
||||
}
|
||||
|
||||
// 更新滑块位置
|
||||
function updateSliderPosition(targetWrapper) {
|
||||
const slider = document.getElementById('sidebar-slider');
|
||||
if (!slider || !targetWrapper) return;
|
||||
|
||||
const nav = document.querySelector('nav');
|
||||
const navRect = nav.getBoundingClientRect();
|
||||
const wrapperRect = targetWrapper.getBoundingClientRect();
|
||||
|
||||
// 计算相对于nav的位置
|
||||
const top = wrapperRect.top - navRect.top + nav.scrollTop;
|
||||
const height = wrapperRect.height;
|
||||
|
||||
// 应用新位置(带动画)
|
||||
slider.style.top = top + 'px';
|
||||
slider.style.height = height + 'px';
|
||||
slider.style.opacity = '1';
|
||||
}
|
||||
|
||||
// 加载页面内容
|
||||
async function loadPage(pageName) {
|
||||
// 切换页面时清除选中状态
|
||||
@@ -708,7 +793,8 @@
|
||||
|
||||
// 开始模型对比
|
||||
async function startCompare(id) {
|
||||
showMessage('提示', '模型对比功能开发中...', 'info');
|
||||
// 跳转到模型对比聊天页面
|
||||
window.location.href = `model-compare-chat.html?id=${id}`;
|
||||
}
|
||||
|
||||
// 筛选表格
|
||||
|
||||
Reference in New Issue
Block a user