From a385917c1f82edbdf1063ac1505bc9b57c6c1108 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期五, 30 十月 2026 21:46:11 +0800
Subject: [PATCH] feat(hrm,bi): 移植长辉电力的考勤请假展示与 BI 大屏
---
src/views/bi/dashboard/index.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/src/views/bi/dashboard/index.vue b/src/views/bi/dashboard/index.vue
index 0685f54..1a5c3e9 100644
--- a/src/views/bi/dashboard/index.vue
+++ b/src/views/bi/dashboard/index.vue
@@ -80,6 +80,31 @@
const dashboardRef = ref<HTMLElement>();
let resizeObserver: ResizeObserver | null = null;
+/**
+ * 绮剧‘璁$畻鍥捐〃鍖哄彲鐢ㄩ珮搴︼紝鍐欏叆 CSS 鍙橀噺 --fill-h
+ *
+ * 浠呴潬 flex + 1fr 鍦ㄩ儴鍒嗗満鏅笉鐢熸晥锛岃繖閲岀洿鎺ラ噺娴嬪ご閮ㄣ�並PI 琛屻��
+ * 琛ㄦ牸鍗$墖鍗犵敤楂樺害锛屾妸鍓╀綑楂樺害绠楀嚭鏉ョ粰鍥捐〃鍖恒��
+ */
+function layoutFill() {
+ const el = dashboardRef.value;
+ if (!el) return;
+ if (!isFullscreen.value) {
+ el.style.removeProperty('--fill-h');
+ return;
+ }
+ const header = el.querySelector('.dash-header') as HTMLElement | null;
+ const kpi = el.querySelector('.kpi-row') as HTMLElement | null;
+ const tables = el.querySelectorAll<HTMLElement>('.table-card');
+ const cs = getComputedStyle(el);
+ let used = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);
+ if (header) used += header.offsetHeight + 24;
+ if (kpi) used += kpi.offsetHeight + 16;
+ tables.forEach((t) => { used += t.offsetHeight + 16; });
+ const avail = Math.max(240, window.innerHeight - used);
+ el.style.setProperty('--fill-h', `${avail}px`);
+}
+
function resizeAllCharts() {
setTimeout(() => window.dispatchEvent(new Event('resize')), 100);
}
@@ -100,11 +125,11 @@
await document.exitFullscreen();
isFullscreen.value = false;
}
- setTimeout(resizeAllCharts, 400);
+ setTimeout(() => { layoutFill(); resizeAllCharts(); }, 400);
}
function onFullscreenChange() {
isFullscreen.value = !!document.fullscreenElement;
- setTimeout(resizeAllCharts, 300);
+ setTimeout(() => { layoutFill(); resizeAllCharts(); }, 300);
}
// ======== KPI 鏁板瓧鍔ㄧ敾 ========
@@ -667,7 +692,32 @@
/* ======== 鍏ㄥ睆 ======== */
.is-fullscreen {
- max-height: none; min-height: 100vh; padding: 24px 28px; border-radius: 0; overflow-y: auto;
+ height: 100vh;
+ min-height: 100vh;
+ max-height: 100vh;
+ padding: 24px 28px;
+ border-radius: 0;
+ overflow-y: auto;
+}
+
+/* 澶撮儴涓� KPI 琛屼繚鎸佽嚜鐒堕珮搴� */
+.is-fullscreen > .dash-header,
+.is-fullscreen > .kpi-row {
+ flex: 0 0 auto;
+}
+
+/* 鍥捐〃鍖哄悆鎺夊墿浣欓珮搴︼紝琛岄珮鍧囧垎锛岄伩鍏嶅簳閮ㄥぇ鐗囩暀鐧� */
+.is-fullscreen > .chart-row {
+ flex: 0 0 auto;
+ /* 楂樺害鐢� layoutFill() 閲忔祴鍚庡啓鍏ワ紝淇濊瘉姝eソ濉弧瑙嗗彛 */
+ height: var(--fill-h, auto);
+ grid-auto-rows: minmax(200px, 1fr);
+ align-content: stretch;
+}
+
+/* 琛ㄦ牸鍗$墖涓嶆姠楂樺害锛屽唴瀹硅秴鍑烘椂瀹瑰櫒婊氬姩 */
+.is-fullscreen > .table-card {
+ flex: 0 1 auto;
}
.is-fullscreen::before,
.is-fullscreen::after {
--
Gitblit v1.9.3