fix: 出勤率/出勤/闲置显示为-(数据接入中),移动端隐藏标题
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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:
64
src/App.tsx
64
src/App.tsx
@@ -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">
|
||||
{/* Title row */}
|
||||
<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 */}
|
||||
<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">
|
||||
@@ -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-xl font-black">{deptData.reduce((s, d) => s + d.totalAssets, 0)}</span>
|
||||
</div>
|
||||
<div className="flex flex-col cursor-pointer hover:opacity-80 transition-opacity"
|
||||
onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', attendance: 'active', source: 'department', title: '部门运营统计 - 出勤车辆' })}>
|
||||
<div className="flex flex-col">
|
||||
<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">
|
||||
{deptData.reduce((acc, d) => acc + d.operatingCount, 0)}
|
||||
</span>
|
||||
<span className="text-xl font-black text-green-400">-</span>
|
||||
</div>
|
||||
<div className="flex flex-col cursor-pointer hover:opacity-80 transition-opacity"
|
||||
onClick={() => setShowPlateNumbers({ batch: 'All', model: 'All', location: 'All', attendance: 'idle', source: 'department', title: '部门运营统计 - 闲置车辆' })}>
|
||||
<div className="flex flex-col">
|
||||
<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">
|
||||
{deptData.reduce((acc, d) => acc + d.idleCount, 0)}
|
||||
</span>
|
||||
<span className="text-xl font-black text-slate-400">-</span>
|
||||
</div>
|
||||
<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-xl font-black text-blue-400">
|
||||
{deptData.length > 0 ? (deptData.reduce((acc, d) => acc + d.attendanceRate, 0) / deptData.length).toFixed(1) : 0}%
|
||||
</span>
|
||||
<span className="text-xl font-black text-blue-400">-</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1379,9 +1371,7 @@ export default function App() {
|
||||
{dept.department}
|
||||
</td>
|
||||
<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">
|
||||
{dept.attendanceRate}%
|
||||
</span>
|
||||
<span className="bg-gray-50 text-gray-400 text-[10px] font-bold px-2 py-0.5 rounded-full">-</span>
|
||||
</td>
|
||||
<td className="p-2 border-r border-gray-100 text-center font-black text-gray-800 text-sm">
|
||||
<button
|
||||
@@ -1394,28 +1384,8 @@ export default function App() {
|
||||
{dept.totalAssets}
|
||||
</button>
|
||||
</td>
|
||||
<td className="p-2 border-r border-gray-100 text-center font-black text-green-500 text-sm">
|
||||
<button
|
||||
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 border-r border-gray-100 text-center font-black text-gray-400 text-sm">-</td>
|
||||
<td className="p-2 border-r border-gray-100 text-center font-black text-gray-400 text-sm">-</td>
|
||||
<td className="p-2 text-center">
|
||||
{isExpanded ? <ChevronDown size={16} className="text-blue-500 inline" /> : <ChevronRight size={16} className="text-gray-300 inline" />}
|
||||
</td>
|
||||
@@ -1599,8 +1569,8 @@ export default function App() {
|
||||
>
|
||||
<div className="flex justify-between items-center mb-2">
|
||||
<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">
|
||||
出勤率: {dept.attendanceRate}%
|
||||
<span className="bg-gray-50 text-gray-400 text-[9px] font-bold px-2 py-0.5 rounded-full">
|
||||
出勤率: -
|
||||
</span>
|
||||
</div>
|
||||
<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-xs font-black text-gray-800">{dept.totalAssets}</div>
|
||||
</div>
|
||||
<div className="text-center cursor-pointer hover:bg-green-50 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-green-500 uppercase font-bold mb-0.5">出勤</div>
|
||||
<div className="text-xs font-black text-green-500">{dept.operatingCount}</div>
|
||||
<div className="text-center rounded p-1">
|
||||
<div className="text-[8px] text-gray-400 uppercase font-bold mb-0.5">出勤</div>
|
||||
<div className="text-xs font-black text-gray-400">-</div>
|
||||
</div>
|
||||
<div className="text-center cursor-pointer hover:bg-gray-100 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-center rounded p-1">
|
||||
<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 className="mt-1 flex justify-center">
|
||||
|
||||
Reference in New Issue
Block a user