|
@ -17,12 +17,24 @@ export default function MeasureItem({ |
|
|
item: Measurement; |
|
|
item: Measurement; |
|
|
onDetail?: () => void; |
|
|
onDetail?: () => void; |
|
|
}) { |
|
|
}) { |
|
|
|
|
|
const stateText = () => { |
|
|
|
|
|
if (item.syncStatus === 'wait') { |
|
|
|
|
|
return <span className="text-[#A3ACC0] text-xs">等待中</span>; |
|
|
|
|
|
} else if (item.syncStatus === 'fail') { |
|
|
|
|
|
return <span className="text-[red] text-xs">上传失败</span>; |
|
|
|
|
|
} else if (item.syncStatus === 'finish') { |
|
|
|
|
|
return <span className="text-[#04CA17] text-xs">上传完成</span>; |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
const direct = XB_CODES.find((dire) => dire.value === item.direction); |
|
|
const direct = XB_CODES.find((dire) => dire.value === item.direction); |
|
|
return ( |
|
|
return ( |
|
|
<div className="flex mx-2 gap-3"> |
|
|
<div className="flex mx-2 gap-3"> |
|
|
<main className="flex-1"> |
|
|
<main className="flex-1"> |
|
|
<header className="flex items-center gap-2"> |
|
|
<header className="flex items-center gap-2"> |
|
|
<h1 className="text-[15px] font-medium ">{item.name}</h1> |
|
|
<h1 className="text-[15px] font-medium ">{item.name}</h1> |
|
|
|
|
|
{stateText()} |
|
|
</header> |
|
|
</header> |
|
|
<main className="flex my-2"> |
|
|
<main className="flex my-2"> |
|
|
<p className="flex-1 text-sm ">{`${item.lineName}`}</p> |
|
|
<p className="flex-1 text-sm ">{`${item.lineName}`}</p> |
|
|