| @@ -168,4 +168,14 @@ if (args[0] === '--dir') { | |||||
| } | } | ||||
| } | } | ||||
| console.log('\n'); | |||||
| console.log('\n'); | |||||
| {/* | |||||
| # 检查单个文件 | |||||
| node check-translations.js src/components/Jodetail/JodetailSearch.tsx src/i18n/zh/jo.json | |||||
| # 检查整个 Jodetail 目录 | |||||
| node check-translations.js --dir src/components/Jodetail src/i18n/zh/jo.json | |||||
| # 检查所有组件 | |||||
| node check-translations.js --dir src/components src/i18n/zh/jo.json | |||||
| */} | |||||
| @@ -35,6 +35,7 @@ export interface DoDetailLine { | |||||
| status: string; | status: string; | ||||
| itemName?: string; | itemName?: string; | ||||
| uomCode?: string; | uomCode?: string; | ||||
| uom?: string; | |||||
| shortUom?: string; | shortUom?: string; | ||||
| } | } | ||||
| @@ -21,6 +21,7 @@ export interface DoDetailLine { | |||||
| status: string; | status: string; | ||||
| itemName?: string; | itemName?: string; | ||||
| uomCode?: string; | uomCode?: string; | ||||
| uom?: string; | |||||
| shortUom?: string; | shortUom?: string; | ||||
| } | } | ||||
| @@ -17,6 +17,7 @@ type DoLineWithCalculations = { | |||||
| itemName: string; | itemName: string; | ||||
| qty: number; | qty: number; | ||||
| uomCode: string; | uomCode: string; | ||||
| uom?: string; | |||||
| shortUom?: string; | shortUom?: string; | ||||
| status: string; | status: string; | ||||
| stockAvailable: number; | stockAvailable: number; | ||||
| @@ -104,7 +105,7 @@ const DoLineTable: React.FC<Props> = ({ | |||||
| flex: 1, | flex: 1, | ||||
| renderCell: (params: GridRenderCellParams<DoLineWithCalculations>) => { | renderCell: (params: GridRenderCellParams<DoLineWithCalculations>) => { | ||||
| const name = isEmpty(params.value) ? "N/A" : params.value; | const name = isEmpty(params.value) ? "N/A" : params.value; | ||||
| const uom = params.row.uomCode || ""; | |||||
| const uom = params.row.uom || ""; | |||||
| return `${name} (${uom})`; | return `${name} (${uom})`; | ||||
| }, | }, | ||||
| }, | }, | ||||
| @@ -1,7 +1,7 @@ | |||||
| import { styled } from "@mui/material"; | import { styled } from "@mui/material"; | ||||
| import { DataGrid } from "@mui/x-data-grid"; | |||||
| const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ | |||||
| import { DataGrid ,DataGridProps,zhTW} from "@mui/x-data-grid"; | |||||
| import { forwardRef } from "react"; | |||||
| const StyledDataGridBase = styled(DataGrid)(({ theme }) => ({ | |||||
| "--unstable_DataGrid-radius": 0, | "--unstable_DataGrid-radius": 0, | ||||
| // "& .MuiDataGrid-columnHeader": { | // "& .MuiDataGrid-columnHeader": { | ||||
| // height: "unset !important" | // height: "unset !important" | ||||
| @@ -31,5 +31,16 @@ const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ | |||||
| padding: '1px 6px', | padding: '1px 6px', | ||||
| }, | }, | ||||
| })); | })); | ||||
| const StyledDataGrid = forwardRef<HTMLDivElement, DataGridProps>((props, ref) => { | |||||
| return ( | |||||
| <StyledDataGridBase | |||||
| ref={ref} | |||||
| {...props} | |||||
| localeText={{ | |||||
| ...zhTW.components.MuiDataGrid.defaultProps.localeText, | |||||
| ...props.localeText, // 允许覆盖 | |||||
| }} | |||||
| /> | |||||
| ); | |||||
| }); | |||||
| export default StyledDataGrid; | export default StyledDataGrid; | ||||
| @@ -45,5 +45,6 @@ | |||||
| "Batch release completed successfully.": "已完成批量放單", | "Batch release completed successfully.": "已完成批量放單", | ||||
| "Edit Delivery Order Detail": "編輯交貨單詳情", | "Edit Delivery Order Detail": "編輯交貨單詳情", | ||||
| "DO released successfully! Pick orders created.": "交貨單放單成功!提料單已建立。", | "DO released successfully! Pick orders created.": "交貨單放單成功!提料單已建立。", | ||||
| "Stock Available": "庫存可用" | |||||
| "Stock Available": "庫存可用", | |||||
| "row selected": "行已選擇" | |||||
| } | } | ||||