瀏覽代碼

update

tags/Baseline_30082024_FRONTEND_UAT
MSI\derek 1 年之前
父節點
當前提交
0f5752fa18
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. +7
    -3
      src/components/EditStaff/SalaryEffectiveModel.tsx

+ 7
- 3
src/components/EditStaff/SalaryEffectiveModel.tsx 查看文件

@@ -102,17 +102,21 @@ const SalaryEffectiveModel: React.FC<SalaryEffectiveModelProps> = ({ open, onClo
}
};

const processRowUpdate = useCallback((newRow: GridRowModel) => {
const processRowUpdate =
// useCallback(
(newRow: GridRowModel) => {
console.log(newRow)
const updatedRow = { ...newRow, updated: true };
console.log(_rows)
if (_rows.length != 0) {
setRows(_rows?.map((row: any) => (row.id === newRow.id ? updatedRow : row)));
setRows((prev: any[]) => prev?.map((row: any) => (row.id === newRow.id ? updatedRow : row)));
}
return updatedRow;
}, [_rows, setValue, setRows])
}
// , [_rows, setValue, setRows])

useEffect(()=> {
console.log(_rows)
setValue('salaryEffectiveInfo', _rows)
}, [_rows])



Loading…
取消
儲存