v3.3.0 — 左侧增加工作台切换侧边栏(科普/科研/医患)

This commit is contained in:
mac
2026-06-17 15:41:02 +08:00
parent f3cf6902dd
commit 353f11663c
3 changed files with 46 additions and 1 deletions

View File

@@ -265,6 +265,8 @@ window.switchTenant = (tenant) => {
state.projectView = null; state.projectView = null;
const label = tenant.replace("·无界", ""); const label = tenant.replace("·无界", "");
document.querySelector("#workspaceTitle").textContent = label + " OPC 工作台"; document.querySelector("#workspaceTitle").textContent = label + " OPC 工作台";
document.querySelector("#tenantSelect").value = tenant;
document.querySelectorAll(".workspace-nav-item").forEach(el => el.classList.toggle("active", el.dataset.tenant === tenant));
load(); load();
}; };

View File

@@ -9,6 +9,29 @@ body {
justify-content: space-between; justify-content: space-between;
} }
/* 工作台侧边栏 */
.workspace-nav-item {
width: 52px;
height: 52px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 14px;
color: #94a3b8;
cursor: pointer;
transition: all 0.15s;
margin-bottom: 2px;
}
.workspace-nav-item:hover {
color: #e2e8f0;
background: rgba(255,255,255,0.08);
}
.workspace-nav-item.active {
color: #60a5fa;
background: rgba(96,165,250,0.15);
}
.tabs { .tabs {
display: flex; display: flex;
gap: 4px; gap: 4px;

View File

@@ -26,6 +26,25 @@
<script src="{{ url_for('static', filename='vendor/lucide.js') }}" defer></script> <script src="{{ url_for('static', filename='vendor/lucide.js') }}" defer></script>
</head> </head>
<body class="min-h-screen bg-slate-50 text-slate-950"> <body class="min-h-screen bg-slate-50 text-slate-950">
<div class="flex min-h-screen">
<!-- 左侧工作台切换栏 -->
<aside class="w-[72px] bg-slate-900 flex flex-col items-center py-6 gap-1 shrink-0" id="workspaceSidebar">
<div class="w-10 h-10 rounded-xl bg-blue-600 flex items-center justify-center mb-6 text-white font-bold text-sm">OPC</div>
<div class="workspace-nav-item active" data-tenant="科普·无界" onclick="switchTenant('科普·无界')" title="科普·无界">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M8 12h8"/><path d="M12 8v8"/></svg>
<span class="text-[10px] mt-1">科普</span>
</div>
<div class="workspace-nav-item" data-tenant="科研·无界" onclick="switchTenant('科研·无界')" title="科研·无界">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>
<span class="text-[10px] mt-1">科研</span>
</div>
<div class="workspace-nav-item" data-tenant="医患·无界" onclick="switchTenant('医患·无界')" title="医患·无界">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
<span class="text-[10px] mt-1">医患</span>
</div>
</aside>
<!-- 主内容区 -->
<div class="flex-1 min-w-0">
<header class="topbar border-b border-slate-200 bg-white px-8 py-5"> <header class="topbar border-b border-slate-200 bg-white px-8 py-5">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<div> <div>
@@ -57,7 +76,8 @@
<section id="products" class="panel"></section> <section id="products" class="panel"></section>
<section id="finance" class="panel"></section> <section id="finance" class="panel"></section>
</main> </main>
</div><!-- 关闭主内容区 -->
</div><!-- 关闭 flex 容器 -->
<aside id="drawer" class="drawer" aria-hidden="true"></aside> <aside id="drawer" class="drawer" aria-hidden="true"></aside>
<div id="taskModal" class="task-modal"></div> <div id="taskModal" class="task-modal"></div>
<script src="{{ url_for('static', filename='app.js') }}"></script> <script src="{{ url_for('static', filename='app.js') }}"></script>