v2.0 — 多项目支持:右上角下拉切换科普/科研/医患三个项目

This commit is contained in:
mac
2026-06-16 15:42:28 +08:00
parent 4d1dc3b355
commit c42abb05da
3 changed files with 40 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
const state = {
active: "home",
data: null,
tenant: "科普·无界",
opFilter: "all",
projectView: null,
chart: null,
@@ -48,7 +49,7 @@ function renderTable(headers, rows, rowClicks) {
}
async function load() {
state.data = await api("/api/bootstrap");
state.data = await api(`/api/bootstrap?tenant=${encodeURIComponent(state.tenant)}`);
render();
}
@@ -231,6 +232,11 @@ window.submitTaskForm = async (event, projectId) => {
};
window.createFinance = (event) => createResource(event, "finance");
window.switchTab = switchTab;
window.switchTenant = (tenant) => {
state.tenant = tenant;
state.projectView = null;
load();
};
function renderProjects() {
// 二级页面:项目任务详情