From c13f341d5e66520048dca4bb386af1955d8241a3 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Thu, 11 Jun 2026 15:30:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E9=A1=B5=E9=9D=A2=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=8C=BA=E5=88=86=E8=83=BD=E6=BA=90BI=E4=B8=8E?= =?UTF-8?q?=E8=B5=84=E4=BA=A7BI=EF=BC=8C=E8=B5=84=E4=BA=A7=E9=A1=B5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0OneOS=E8=BF=81=E7=A7=BB=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- src/App.tsx | 4 +++ src/index.css | 9 +++++ src/modules/assets/AssetsModule.tsx | 48 +++++++++++++++++++++++--- src/modules/mileage/MonitoringView.tsx | 2 +- 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index ebda57b..b64b810 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - 羚牛氢能车辆资产 + 羚牛氢能
diff --git a/src/App.tsx b/src/App.tsx index 3a42fb0..9b7527e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -128,6 +128,10 @@ function AuthGate() { }; }, []); + useEffect(() => { + document.title = pathSet === "energy" ? "羚牛氢能-能源BI" : "羚牛氢能-资产BI"; + }, [pathSet]); + const modules = useMemo(() => { if (pathSet === "energy") { return [HYDROGEN_MODULE, ELECTRIC_MODULE, ETC_MODULE]; diff --git a/src/index.css b/src/index.css index 7fdd18d..8334740 100644 --- a/src/index.css +++ b/src/index.css @@ -14,3 +14,12 @@ body { overflow: auto; height: 100%; } + +@keyframes marquee { + from { transform: translateX(0); } + to { transform: translateX(-50%); } +} + +@utility animate-marquee { + animation: marquee 30s linear infinite; +} diff --git a/src/modules/assets/AssetsModule.tsx b/src/modules/assets/AssetsModule.tsx index 23cba41..3481999 100644 --- a/src/modules/assets/AssetsModule.tsx +++ b/src/modules/assets/AssetsModule.tsx @@ -46,6 +46,42 @@ const TABS = [ { id: 'customer', label: '按客户' }, ]; +function MarqueeBanner() { + const trackRef = useRef(null); + const innerRef = useRef(null); + const [overflow, setOverflow] = useState(false); + + useEffect(() => { + const check = () => { + if (!trackRef.current || !innerRef.current) return; + setOverflow(innerRef.current.scrollWidth > trackRef.current.clientWidth); + }; + check(); + const ro = new ResizeObserver(check); + ro.observe(trackRef.current!); + return () => ro.disconnect(); + }, []); + + const text = '⚠️ 因 OneOS 数据迁移未完成,当前状态暂不准确,预计下周完成对接后恢复正常。'; + + return ( +
+
+
+ + {text} + + {overflow && ( + + {text} + + )} +
+
+
+ ); +} + export default function AssetsModule() { const [activeTab, setActiveTab] = useState<'overview' | 'department' | 'region' | 'customer'>('overview'); const [tabReady, setTabReady] = useState(true); @@ -92,7 +128,7 @@ export default function AssetsModule() { const [modalWeeklyDetail, setModalWeeklyDetail] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); - const [lastUpdate, setLastUpdate] = useState(''); + const [lastUpdate] = useState('2026-06-03 23:59:59'); const [modalLoading, setModalLoading] = useState(false); // Dept/Region/Customer data @@ -162,7 +198,6 @@ export default function AssetsModule() { setRegionData(region); setCustomerData(cust); setInventoryData(inv); - setLastUpdate(new Date().toLocaleString('zh-CN')); } catch (e) { setError(e instanceof Error ? e.message : '数据加载失败'); } finally { @@ -526,7 +561,7 @@ export default function AssetsModule() {
{/* Title row */}
-

羚牛氢能车辆资产

+

羚牛氢能-资产BI

{/* Right: status + theme */}
@@ -690,12 +725,15 @@ export default function AssetsModule() { 最后更新: {lastUpdate}
- - 每分钟更新一次 + + OneOS数据源接入中
+ {/* OneOS 迁移提示滚动条 */} + + {/* Main Content Area */}
diff --git a/src/modules/mileage/MonitoringView.tsx b/src/modules/mileage/MonitoringView.tsx index 723f505..869c50b 100644 --- a/src/modules/mileage/MonitoringView.tsx +++ b/src/modules/mileage/MonitoringView.tsx @@ -596,7 +596,7 @@ export default function MonitoringView() {
- 实时监控 • 每分钟更新 + 数据监控 • 每15分钟更新