/** * 项目级页面渲染模块。 * 展示单个项目的上线状态、指标启用数量、准确数量和预警指标,并列出项目下所有治理指标。 */ function renderProjectView() { const enterprise = getEnterprise(state.enterpriseName); const project = getProjectById(state.projectId); const rows = buildIndicatorRows(project); const enabledCount = rows.filter((row) => row.enabled).length; const accurateCount = rows.filter((row) => row.enabled && !row.isWarning).length; const warningIndicatorCount = rows.filter((row) => row.isWarning).length; app.innerHTML = `
${miniMetric("项目上线状态", project.systemStatus, "", project.created ? "已创建项目档案并进入系统" : "未创建项目档案,需先完成上线")} ${miniMetric("指标使用数量", `${enabledCount}/${rows.length}`, "", "项目内治理指标动没动")} ${miniMetric("数据准确数量", `${accurateCount}/${rows.length}`, "", "数据准不准")} ${miniMetric("预警指标", warningIndicatorCount, "项", "")}

项目信息

${fieldRow("所属企业", enterprise.name)} ${fieldRow("项目名称", project.name)} ${fieldRow("系统状态", project.systemStatus)} ${fieldRow("开工日期", project.startDate)} ${fieldRow("最近更新", project.lastUpdate)}

指标分析

${renderIndicatorTable(rows)}
`; } /** * 统一弹窗渲染入口。 * state.drillView 决定展示集团上线统计、企业项目清单、指标项目穿透或指标趋势; * 关闭弹窗时清空 body,避免旧内容残留到下一次打开。 */ function renderDrillModal() { if (!state.drillOpen) { drillModal.hidden = true; drillModalBody.innerHTML = ""; return; } const indicator = getSelectedIndicator(); drillModal.hidden = false; if (state.drillView === "groupOnlineStats") { drillModalTitle.textContent = "集团项目上线统计"; drillModalBody.innerHTML = renderGroupOnlineStatsModal(); return; } if (state.drillView === "enterpriseProjectList") { drillModalTitle.textContent = `${state.enterpriseName} · 项目清单`; drillModalBody.innerHTML = renderEnterpriseProjectListModal(state.drillListType); return; } drillModalTitle.textContent = `${indicator.name} · 指标穿透分析`; if (state.drillView === "project") { drillModalBody.innerHTML = renderIndicatorProjectView(); return; } drillModalBody.innerHTML = renderIndicatorTrendView(); }