| @@ -244,16 +244,22 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| </Typography> | </Typography> | ||||
| <TableContainer component={Paper} sx={{ maxHeight: 440, overflow: 'auto' }}> | <TableContainer component={Paper} sx={{ maxHeight: 440, overflow: 'auto' }}> | ||||
| <Table size="small"> | |||||
| <Table size="small" sx={{ tableLayout: 'fixed', width: '100%' }}> | |||||
| <TableHead> | <TableHead> | ||||
| <TableRow sx={{ position: 'sticky', top: 0, zIndex: 1, backgroundColor: 'background.paper' }}> | <TableRow sx={{ position: 'sticky', top: 0, zIndex: 1, backgroundColor: 'background.paper' }}> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("Equipment Name and Code")} | {t("Equipment Name and Code")} | ||||
| </Typography> | </Typography> | ||||
| </TableCell> | </TableCell> | ||||
| {details.map((d) => ( | {details.map((d) => ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| <Box sx={{ display: "flex", flexDirection: "column" }}> | <Box sx={{ display: "flex", flexDirection: "column" }}> | ||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {d.equipmentDetailName || "-"} | {d.equipmentDetailName || "-"} | ||||
| @@ -269,13 +275,19 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| <TableBody> | <TableBody> | ||||
| {/* 工序 Row */} | {/* 工序 Row */} | ||||
| <TableRow> | <TableRow> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("Process")} | {t("Process")} | ||||
| </Typography> | </Typography> | ||||
| </TableCell> | </TableCell> | ||||
| {details.map((d) => ( | {details.map((d) => ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| {d.status === "Processing" ? d.currentProcess?.processName || "-" : "-"} | {d.status === "Processing" ? d.currentProcess?.processName || "-" : "-"} | ||||
| </TableCell> | </TableCell> | ||||
| ))} | ))} | ||||
| @@ -283,7 +295,7 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| {/* 狀態 Row - 修改:Processing 时只显示 job order code */} | {/* 狀態 Row - 修改:Processing 时只显示 job order code */} | ||||
| <TableRow> | <TableRow> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("Status")} | {t("Status")} | ||||
| </Typography> | </Typography> | ||||
| @@ -295,7 +307,13 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| // Processing 时只显示 job order code,不显示 Chip | // Processing 时只显示 job order code,不显示 Chip | ||||
| if (d.status === "Processing" && cp?.jobOrderCode) { | if (d.status === "Processing" && cp?.jobOrderCode) { | ||||
| return ( | return ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| <Typography variant="body2" sx={{ fontWeight: 500 }}> | <Typography variant="body2" sx={{ fontWeight: 500 }}> | ||||
| {cp.jobOrderCode} | {cp.jobOrderCode} | ||||
| </Typography> | </Typography> | ||||
| @@ -305,7 +323,13 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| // 其他状态显示 Chip | // 其他状态显示 Chip | ||||
| return ( | return ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| <Chip label={t(`${d.status}`)} color={chipColor} size="small" /> | <Chip label={t(`${d.status}`)} color={chipColor} size="small" /> | ||||
| </TableCell> | </TableCell> | ||||
| ); | ); | ||||
| @@ -316,13 +340,19 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| {/* 開始時間 Row */} | {/* 開始時間 Row */} | ||||
| <TableRow> | <TableRow> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("Start Time")} | {t("Start Time")} | ||||
| </Typography> | </Typography> | ||||
| </TableCell> | </TableCell> | ||||
| {details.map((d) => ( | {details.map((d) => ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| {d.status === "Processing" | {d.status === "Processing" | ||||
| ? formatDateTime(d.currentProcess?.startTime) | ? formatDateTime(d.currentProcess?.startTime) | ||||
| : "-"} | : "-"} | ||||
| @@ -332,13 +362,19 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| {/* 預計完成時間 Row */} | {/* 預計完成時間 Row */} | ||||
| <TableRow> | <TableRow> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("預計完成時間")} | {t("預計完成時間")} | ||||
| </Typography> | </Typography> | ||||
| </TableCell> | </TableCell> | ||||
| {details.map((d) => ( | {details.map((d) => ( | ||||
| <TableCell key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| {d.status === "Processing" | {d.status === "Processing" | ||||
| ? calculateEstimatedCompletionTime( | ? calculateEstimatedCompletionTime( | ||||
| d.currentProcess?.startTime, | d.currentProcess?.startTime, | ||||
| @@ -351,13 +387,19 @@ const EquipmentStatusDashboard: React.FC = () => { | |||||
| {/* 剩餘時間 Row */} | {/* 剩餘時間 Row */} | ||||
| <TableRow> | <TableRow> | ||||
| <TableCell> | |||||
| <TableCell sx={{ width: '15%', minWidth: 150 }}> | |||||
| <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | <Typography variant="subtitle2" sx={{ fontWeight: 600 }}> | ||||
| {t("Remaining Time (min)")} | {t("Remaining Time (min)")} | ||||
| </Typography> | </Typography> | ||||
| </TableCell> | </TableCell> | ||||
| {details.map((d) => ( | {details.map((d) => ( | ||||
| <TableCell align="right" key={d.equipmentDetailId}> | |||||
| <TableCell | |||||
| key={d.equipmentDetailId} | |||||
| sx={{ | |||||
| width: `${85 / details.length}%`, | |||||
| textAlign: 'left' | |||||
| }} | |||||
| > | |||||
| {d.status === "Processing" | {d.status === "Processing" | ||||
| ? calculateRemainingTime( | ? calculateRemainingTime( | ||||
| d.currentProcess?.startTime, | d.currentProcess?.startTime, | ||||