fix: 出勤率/出勤/闲置显示为-(数据接入中),移动端隐藏标题
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- 部门Tab顶部汇总、桌面表格、移动端卡片的出勤率/出勤/闲置
  全部显示为"-",移除点击下钻(数据未就绪)
- 移动端隐藏"羚牛氢能车辆资产"标题

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-03-28 20:28:25 +08:00
parent ba6f595591
commit 24b66f68b5

View File

@@ -412,7 +412,7 @@ export default function App() {
<div className="sticky top-0 z-40 -mx-6 -mt-6 mb-4 bg-white/95 backdrop-blur-sm border-b border-gray-100/80"> <div className="sticky top-0 z-40 -mx-6 -mt-6 mb-4 bg-white/95 backdrop-blur-sm border-b border-gray-100/80">
{/* Title row */} {/* Title row */}
<div className="relative flex items-center justify-center px-4 pt-3 pb-1"> <div className="relative flex items-center justify-center px-4 pt-3 pb-1">
<h1 className="text-base font-semibold text-gray-800 tracking-wide"></h1> <h1 className="hidden sm:block text-base font-semibold text-gray-800 tracking-wide"></h1>
{/* Right: status + theme */} {/* Right: status + theme */}
<div className="absolute right-4 top-1/2 -translate-y-1/2 flex items-center gap-2"> <div className="absolute right-4 top-1/2 -translate-y-1/2 flex items-center gap-2">
<div className="hidden sm:flex items-center gap-1 text-[10px] text-gray-400"> <div className="hidden sm:flex items-center gap-1 text-[10px] text-gray-400">
@@ -1275,25 +1275,17 @@ export default function App() {
<span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5"></span> <span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5"></span>
<span className="text-xl font-black">{deptData.reduce((s, d) => s + d.totalAssets, 0)}</span> <span className="text-xl font-black">{deptData.reduce((s, d) => s + d.totalAssets, 0)}</span>
</div> </div>
<div className="flex flex-col cursor-pointer hover:opacity-80 transition-opacity" <div className="flex flex-col">
onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', attendance: 'active', source: 'department', title: '部门运营统计 - 出勤车辆' })}>
<span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-green-400"></span> <span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-green-400"></span>
<span className="text-xl font-black text-green-400"> <span className="text-xl font-black text-green-400">-</span>
{deptData.reduce((acc, d) => acc + d.operatingCount, 0)}
</span>
</div> </div>
<div className="flex flex-col cursor-pointer hover:opacity-80 transition-opacity" <div className="flex flex-col">
onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', attendance: 'idle', source: 'department', title: '部门运营统计 - 闲置车辆' })}>
<span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-slate-400"></span> <span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-slate-400"></span>
<span className="text-xl font-black text-slate-400"> <span className="text-xl font-black text-slate-400">-</span>
{deptData.reduce((acc, d) => acc + d.idleCount, 0)}
</span>
</div> </div>
<div className="flex flex-col"> <div className="flex flex-col">
<span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-blue-400"></span> <span className="text-[9px] opacity-50 uppercase font-bold tracking-widest mb-0.5 text-blue-400"></span>
<span className="text-xl font-black text-blue-400"> <span className="text-xl font-black text-blue-400">-</span>
{deptData.length > 0 ? (deptData.reduce((acc, d) => acc + d.attendanceRate, 0) / deptData.length).toFixed(1) : 0}%
</span>
</div> </div>
</div> </div>
</div> </div>
@@ -1379,9 +1371,7 @@ export default function App() {
{dept.department} {dept.department}
</td> </td>
<td className="p-2 border-r border-gray-100 text-center"> <td className="p-2 border-r border-gray-100 text-center">
<span className="bg-blue-50 text-blue-600 text-[10px] font-bold px-2 py-0.5 rounded-full"> <span className="bg-gray-50 text-gray-400 text-[10px] font-bold px-2 py-0.5 rounded-full">-</span>
{dept.attendanceRate}%
</span>
</td> </td>
<td className="p-2 border-r border-gray-100 text-center font-black text-gray-800 text-sm"> <td className="p-2 border-r border-gray-100 text-center font-black text-gray-800 text-sm">
<button <button
@@ -1394,28 +1384,8 @@ export default function App() {
{dept.totalAssets} {dept.totalAssets}
</button> </button>
</td> </td>
<td className="p-2 border-r border-gray-100 text-center font-black text-green-500 text-sm"> <td className="p-2 border-r border-gray-100 text-center font-black text-gray-400 text-sm">-</td>
<button <td className="p-2 border-r border-gray-100 text-center font-black text-gray-400 text-sm">-</td>
onClick={(e) => {
e.stopPropagation();
setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', department: dept.department, attendance: 'active', source: 'department', title: `部门运营统计 - ${dept.department} - 出勤车辆` });
}}
className="text-green-500 hover:underline font-black"
>
{dept.operatingCount}
</button>
</td>
<td className="p-2 border-r border-gray-100 text-center font-black text-gray-400 text-sm">
<button
onClick={(e) => {
e.stopPropagation();
setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', department: dept.department, attendance: 'idle', source: 'department', title: `部门运营统计 - ${dept.department} - 闲置车辆` });
}}
className="text-gray-400 hover:underline font-black"
>
{dept.idleCount}
</button>
</td>
<td className="p-2 text-center"> <td className="p-2 text-center">
{isExpanded ? <ChevronDown size={16} className="text-blue-500 inline" /> : <ChevronRight size={16} className="text-gray-300 inline" />} {isExpanded ? <ChevronDown size={16} className="text-blue-500 inline" /> : <ChevronRight size={16} className="text-gray-300 inline" />}
</td> </td>
@@ -1599,8 +1569,8 @@ export default function App() {
> >
<div className="flex justify-between items-center mb-2"> <div className="flex justify-between items-center mb-2">
<h3 className="text-sm font-bold text-gray-800">{dept.department}</h3> <h3 className="text-sm font-bold text-gray-800">{dept.department}</h3>
<span className="bg-blue-50 text-blue-600 text-[9px] font-bold px-2 py-0.5 rounded-full"> <span className="bg-gray-50 text-gray-400 text-[9px] font-bold px-2 py-0.5 rounded-full">
: {dept.attendanceRate}% : -
</span> </span>
</div> </div>
<div className="grid grid-cols-3 gap-2"> <div className="grid grid-cols-3 gap-2">
@@ -1609,15 +1579,13 @@ export default function App() {
<div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5"></div> <div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5"></div>
<div className="text-xs font-black text-gray-800">{dept.totalAssets}</div> <div className="text-xs font-black text-gray-800">{dept.totalAssets}</div>
</div> </div>
<div className="text-center cursor-pointer hover:bg-green-50 rounded p-1" <div className="text-center rounded p-1">
onClick={(e) => { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', department: dept.department, attendance: 'active', source: 'department', title: `部门运营统计 - ${dept.department} - 出勤车辆` }); }}> <div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5"></div>
<div className="text-[8px] text-green-500 uppercase font-bold mb-0.5"></div> <div className="text-xs font-black text-gray-400">-</div>
<div className="text-xs font-black text-green-500">{dept.operatingCount}</div>
</div> </div>
<div className="text-center cursor-pointer hover:bg-gray-100 rounded p-1" <div className="text-center rounded p-1">
onClick={(e) => { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', department: dept.department, attendance: 'idle', source: 'department', title: `部门运营统计 - ${dept.department} - 闲置车辆` }); }}>
<div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5"></div> <div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5"></div>
<div className="text-xs font-black text-gray-400">{dept.idleCount}</div> <div className="text-xs font-black text-gray-400">-</div>
</div> </div>
</div> </div>
<div className="mt-1 flex justify-center"> <div className="mt-1 flex justify-center">