|
@@ -96,12 +96,32 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 页内 tab:湖全景 / 明细数据(明细区首次激活时才初始化报表浏览,懒加载)
|
|
|
|
|
+ function activateLakeTab(tab) {
|
|
|
|
|
+ const tabs = $('lakeTabs');
|
|
|
|
|
+ if (!tabs) return;
|
|
|
|
|
+ tabs.querySelectorAll('button').forEach((b) => b.classList.toggle('active', b.dataset.tab === tab));
|
|
|
|
|
+ $('lakeTabOverview').hidden = tab !== 'overview';
|
|
|
|
|
+ $('lakeTabDetail').hidden = tab !== 'detail';
|
|
|
|
|
+ if (tab === 'overview') loadLake();
|
|
|
|
|
+ else if (window.shanReportsInit) window.shanReportsInit();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
window.shanLakeInit = function () {
|
|
window.shanLakeInit = function () {
|
|
|
if (!inited) {
|
|
if (!inited) {
|
|
|
inited = true;
|
|
inited = true;
|
|
|
$('btnLakeRefresh').addEventListener('click', loadLake);
|
|
$('btnLakeRefresh').addEventListener('click', loadLake);
|
|
|
$('btnLakePull').addEventListener('click', pullAll);
|
|
$('btnLakePull').addEventListener('click', pullAll);
|
|
|
|
|
+ $('lakeTabs').addEventListener('click', (event) => {
|
|
|
|
|
+ const btn = event.target.closest('button[data-tab]');
|
|
|
|
|
+ if (btn) activateLakeTab(btn.dataset.tab);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- loadLake();
|
|
|
|
|
|
|
+ activateLakeTab('overview');
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 供问数「应用到报表」等外部入口直接落到明细 tab
|
|
|
|
|
+ window.shanLakeShowDetail = function () {
|
|
|
|
|
+ activateLakeTab('detail');
|
|
|
};
|
|
};
|
|
|
})();
|
|
})();
|