Bläddra i källkod

update

master
CANCERYS\kw093 2 månader sedan
förälder
incheckning
68d69f18a8
6 ändrade filer med 32 tillägg och 7 borttagningar
  1. +11
    -1
      check-translations.js
  2. +1
    -0
      src/app/api/do/actions.tsx
  3. +1
    -0
      src/app/api/do/index.tsx
  4. +2
    -1
      src/components/DoDetail/DoLineTable.tsx
  5. +15
    -4
      src/components/StyledDataGrid/StyledDataGrid.tsx
  6. +2
    -1
      src/i18n/zh/do.json

+ 11
- 1
check-translations.js Visa fil

@@ -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
*/}

+ 1
- 0
src/app/api/do/actions.tsx Visa fil

@@ -35,6 +35,7 @@ export interface DoDetailLine {
status: string;
itemName?: string;
uomCode?: string;
uom?: string;
shortUom?: string;
}



+ 1
- 0
src/app/api/do/index.tsx Visa fil

@@ -21,6 +21,7 @@ export interface DoDetailLine {
status: string;
itemName?: string;
uomCode?: string;
uom?: string;
shortUom?: string;
}



+ 2
- 1
src/components/DoDetail/DoLineTable.tsx Visa fil

@@ -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<Props> = ({
flex: 1,
renderCell: (params: GridRenderCellParams<DoLineWithCalculations>) => {
const name = isEmpty(params.value) ? "N/A" : params.value;
const uom = params.row.uomCode || "";
const uom = params.row.uom || "";
return `${name} (${uom})`;
},
},


+ 15
- 4
src/components/StyledDataGrid/StyledDataGrid.tsx Visa fil

@@ -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<HTMLDivElement, DataGridProps>((props, ref) => {
return (
<StyledDataGridBase
ref={ref}
{...props}
localeText={{
...zhTW.components.MuiDataGrid.defaultProps.localeText,
...props.localeText, // 允许覆盖
}}
/>
);
});
export default StyledDataGrid;

+ 2
- 1
src/i18n/zh/do.json Visa fil

@@ -45,5 +45,6 @@
"Batch release completed successfully.": "已完成批量放單",
"Edit Delivery Order Detail": "編輯交貨單詳情",
"DO released successfully! Pick orders created.": "交貨單放單成功!提料單已建立。",
"Stock Available": "庫存可用"
"Stock Available": "庫存可用",
"row selected": "行已選擇"
}

Laddar…
Avbryt
Spara