This commit is contained in:
2026-07-12 00:53:38 +08:00
parent d254377951
commit 25ae6f610c
14 changed files with 1208 additions and 835 deletions
+63 -7
View File
@@ -15,6 +15,7 @@
state.drillView = "trend";
}
render();
loadProjectMasterDataAnalysis(state.view === "enterprise" ? (getEnterpriseMasterRecord(state.enterpriseName)?.unitId || "") : "");
return;
}
@@ -27,6 +28,7 @@
state.selectedIndicator = getWarningIndicators()[0]?.name || "";
}
render();
loadProjectMasterDataAnalysis(state.view === "enterprise" ? (getEnterpriseMasterRecord(state.enterpriseName)?.unitId || "") : "");
return;
}
@@ -41,13 +43,26 @@
window.open(ENTERPRISE_INDICATOR_MORE_URL, "_blank", "noopener,noreferrer");
return;
}
if (action.dataset.action === "group-usage-report-preview") {
window.open(GROUP_USAGE_REPORT_URL, "_blank", "noopener,noreferrer");
return;
}
if (action.dataset.action === "preview-unit-report") {
const unit = action.dataset.unit || "";
const fileName = usageReportFiles[unit];
const unitAliases = {
二建: "二化建",
三建: "三化建",
四建: "四化建",
六建: "六化建",
七建: "七化建",
九建: "九化建",
十一建: "十一化建",
十三建: "十三化建",
十四建: "十四化建",
十六建: "十六化建",
装备科技: "装备",
华谊工程: "华谊",
国际工程公司: "国际",
建投: "北建投",
南投: "南建投"
};
const fileName = usageReportFiles[unit] || usageReportFiles[unitAliases[unit]];
if (!fileName) {
window.alert(`${unit || "该单位"}未上传一览表`);
return;
@@ -56,6 +71,15 @@
window.open(`${OFFICE_PREVIEW_BASE_URL}${encodeURIComponent(fileUrl)}`, "_blank", "noopener,noreferrer");
return;
}
if (action.dataset.action === "master-web-url") {
const url = action.dataset.url || "";
if (!/^https?:\/\//i.test(url)) {
window.alert("该单位未配置有效穿透链接");
return;
}
window.open(url, "_blank", "noopener,noreferrer");
return;
}
if (action.dataset.action === "group-online-stats") {
state.drillOpen = true;
state.drillView = "groupOnlineStats";
@@ -65,6 +89,23 @@
renderDrillModal();
return;
}
if (action.dataset.action === "below-standard-projects") {
state.drillOpen = true;
state.drillView = "belowStandardProjects";
state.drillListType = "below-standard";
state.projectId = "";
renderDrillModal();
return;
}
if (action.dataset.action === "group-unit-metric-usages") {
state.drillOpen = true;
state.drillView = "groupUnitMetricUsages";
state.drillEnterpriseName = "";
state.drillListType = "";
state.projectId = "";
renderDrillModal();
return;
}
if (action.dataset.action === "close-drill") {
state.drillOpen = false;
state.drillView = "trend";
@@ -102,11 +143,13 @@
state.view = "group";
state.enterpriseName = "";
state.projectId = "";
loadProjectMasterDataAnalysis("");
}
if (action.dataset.action === "enterprise") {
state.view = "enterprise";
state.enterpriseName = action.dataset.enterprise || state.enterpriseName;
state.projectId = "";
loadProjectMasterDataAnalysis(getEnterpriseMasterRecord(state.enterpriseName)?.unitId || "");
}
render();
return;
@@ -116,6 +159,7 @@
const indicatorTarget = event.target.closest("[data-indicator]");
if (indicatorTarget) {
state.selectedIndicator = indicatorTarget.dataset.indicator;
const selectedIndicatorField = resolveMetricField(state.selectedIndicator, indicatorTarget.dataset.indicatorField);
state.drillOpen = true;
if (state.view === "enterprise") {
state.drillView = "project";
@@ -126,6 +170,11 @@
}
state.projectId = "";
renderDrillModal();
if (state.drillView === "trend") {
loadGroupMetricAnalysis(selectedIndicatorField);
} else {
loadUnitMetricAnalysis(selectedIndicatorField, getEnterpriseMasterRecord(state.enterpriseName)?.unitId || projectMasterDataState.unitId);
}
return;
}
@@ -147,6 +196,7 @@
state.enterpriseName = enterpriseTarget.dataset.enterprise;
state.projectId = "";
render();
loadProjectMasterDataAnalysis(getEnterpriseMasterRecord(state.enterpriseName)?.unitId || "");
return;
}
@@ -154,17 +204,23 @@
const projectTarget = event.target.closest("[data-project]");
if (projectTarget) {
state.view = "project";
if (projectTarget.dataset.projectEnterprise) {
state.enterpriseName = projectTarget.dataset.projectEnterprise;
}
state.projectId = projectTarget.dataset.project;
state.drillOpen = false;
state.drillView = "trend";
state.drillListType = "";
render();
const unitId = projectTarget.dataset.projectUnitId
|| getEnterpriseMasterRecord(state.enterpriseName)?.unitId
|| projectMasterDataState.unitId;
loadProjectMonitoring(unitId, state.projectId);
}
});
/**
* 初始化顺序:
* 先绑定缩放并渲染兜底数据,再异步加载集团主数据接口;
* 先绑定缩放并渲染加载状态,再异步加载集团主数据接口;
* 接口返回后 loadProjectMasterDataAnalysis 会再次 render,刷新集团上线率卡片和统计弹窗。
*/
window.addEventListener("resize", scaleScreen);