From 68d69f18a887e5f5fb554bf1cc80c854fd85b7e4 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Wed, 1 Oct 2025 22:22:58 +0800 Subject: [PATCH] update --- check-translations.js | 12 +++++++++++- src/app/api/do/actions.tsx | 1 + src/app/api/do/index.tsx | 1 + src/components/DoDetail/DoLineTable.tsx | 3 ++- .../StyledDataGrid/StyledDataGrid.tsx | 19 +++++++++++++++---- src/i18n/zh/do.json | 3 ++- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/check-translations.js b/check-translations.js index f89fe00..fdd0cc9 100644 --- a/check-translations.js +++ b/check-translations.js @@ -168,4 +168,14 @@ if (args[0] === '--dir') { } } -console.log('\n'); \ No newline at end of file +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 +*/} \ No newline at end of file diff --git a/src/app/api/do/actions.tsx b/src/app/api/do/actions.tsx index 7d85247..03c64fb 100644 --- a/src/app/api/do/actions.tsx +++ b/src/app/api/do/actions.tsx @@ -35,6 +35,7 @@ export interface DoDetailLine { status: string; itemName?: string; uomCode?: string; + uom?: string; shortUom?: string; } diff --git a/src/app/api/do/index.tsx b/src/app/api/do/index.tsx index ae6c7df..ecdaeaa 100644 --- a/src/app/api/do/index.tsx +++ b/src/app/api/do/index.tsx @@ -21,6 +21,7 @@ export interface DoDetailLine { status: string; itemName?: string; uomCode?: string; + uom?: string; shortUom?: string; } diff --git a/src/components/DoDetail/DoLineTable.tsx b/src/components/DoDetail/DoLineTable.tsx index c5a23a2..302d2a2 100644 --- a/src/components/DoDetail/DoLineTable.tsx +++ b/src/components/DoDetail/DoLineTable.tsx @@ -17,6 +17,7 @@ type DoLineWithCalculations = { itemName: string; qty: number; uomCode: string; + uom?: string; shortUom?: string; status: string; stockAvailable: number; @@ -104,7 +105,7 @@ const DoLineTable: React.FC = ({ flex: 1, renderCell: (params: GridRenderCellParams) => { const name = isEmpty(params.value) ? "N/A" : params.value; - const uom = params.row.uomCode || ""; + const uom = params.row.uom || ""; return `${name} (${uom})`; }, }, diff --git a/src/components/StyledDataGrid/StyledDataGrid.tsx b/src/components/StyledDataGrid/StyledDataGrid.tsx index 639a8d2..368cbfe 100644 --- a/src/components/StyledDataGrid/StyledDataGrid.tsx +++ b/src/components/StyledDataGrid/StyledDataGrid.tsx @@ -1,7 +1,7 @@ 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, // "& .MuiDataGrid-columnHeader": { // height: "unset !important" @@ -31,5 +31,16 @@ const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ padding: '1px 6px', }, })); - +const StyledDataGrid = forwardRef((props, ref) => { + return ( + + ); +}); export default StyledDataGrid; diff --git a/src/i18n/zh/do.json b/src/i18n/zh/do.json index 96509ea..44fffd0 100644 --- a/src/i18n/zh/do.json +++ b/src/i18n/zh/do.json @@ -45,5 +45,6 @@ "Batch release completed successfully.": "已完成批量放單", "Edit Delivery Order Detail": "編輯交貨單詳情", "DO released successfully! Pick orders created.": "交貨單放單成功!提料單已建立。", - "Stock Available": "庫存可用" + "Stock Available": "庫存可用", + "row selected": "行已選擇" } \ No newline at end of file