fix: 模型库前端布局优化

This commit is contained in:
Gsh
2025-12-09 22:08:25 +08:00
parent 54a1d2a66f
commit 909406238c
5 changed files with 813 additions and 565 deletions

View File

@@ -1,7 +0,0 @@
{
"permissions": {
"allow": [
"Bash(dir:*)"
]
}
}

2
.gitignore vendored
View File

@@ -278,3 +278,5 @@ database_backup
/Yi.Abp.Net8/src/Yi.Abp.Web/yi-abp-dev.db
package-lock.json
.claude

View File

@@ -12,4 +12,4 @@ export const COLLAPSE_THRESHOLD: number = 600;
export const SIDE_BAR_WIDTH: number = 280;
// 路由白名单地址[本地存在的路由 staticRouter.ts 中]
export const ROUTER_WHITE_LIST: string[] = ['/chat', '/chat/not_login', '/products', '/403', '/404'];
export const ROUTER_WHITE_LIST: string[] = ['/chat', '/chat/not_login', '/products', '/model-library', '/403', '/404'];

View File

@@ -9,18 +9,33 @@ function goToModelLibrary() {
</script>
<template>
<div class="model-library-btn-container" @click="goToModelLibrary">
<el-tooltip content="查看模型库" placement="bottom">
<el-button link class="header-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7" />
<rect x="14" y="3" width="7" height="7" />
<rect x="14" y="14" width="7" height="7" />
<rect x="3" y="14" width="7" height="7" />
</svg>
<span class="btn-text">模型库</span>
</el-button>
</el-tooltip>
<div class="model-library-btn-container" data-tour="model-library-btn">
<div
class="model-library-btn"
title="查看模型库"
@click="goToModelLibrary"
>
<!-- PC端显示文字 -->
<span class="pc-text">模型库</span>
<!-- 移动端显示图标 -->
<svg
class="mobile-icon"
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="3" y="3" width="7" height="7" />
<rect x="14" y="3" width="7" height="7" />
<rect x="14" y="14" width="7" height="7" />
<rect x="3" y="14" width="7" height="7" />
</svg>
</div>
</div>
</template>
@@ -28,28 +43,45 @@ function goToModelLibrary() {
.model-library-btn-container {
display: flex;
align-items: center;
cursor: pointer;
.header-btn {
.model-library-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
cursor: pointer;
font-size: 1.2rem;
font-weight: bold;
color: #606266;
transition: all 0.3s;
transition: all 0.2s;
&:hover {
color: #409eff;
background-color: rgba(64, 158, 255, 0.1);
color: #606266;
transform: translateY(-1px);
}
.btn-text {
font-size: 14px;
font-weight: 500;
// PC端显示文字隐藏图标
.pc-text {
display: inline;
margin: 0 12px;
}
svg {
flex-shrink: 0;
.mobile-icon {
display: none;
}
}
}
// 移动端显示图标,隐藏文字
@media (max-width: 768px) {
.model-library-btn-container {
.model-library-btn {
.pc-text {
display: none;
}
.mobile-icon {
display: inline;
}
}
}
}

File diff suppressed because it is too large Load Diff