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分钟更新