[st] feat: 통계 검증 리포트 페이지 작업

This commit is contained in:
2026-04-21 18:09:11 +09:00
parent 34a0324124
commit a5e50fc576
8 changed files with 812 additions and 587 deletions
+33 -3
View File
@@ -319,8 +319,10 @@ const DataGrid = ({
rowData,
setRowData,
getGridDataRef,
getGridRef,
cellStyleCallback,
cellTooltipCallback,
onCellEdited,
onRowClick,
onItemChecked,
onItemAllChecked,
@@ -345,6 +347,7 @@ const DataGrid = ({
const cellTooltipCallbackRef = useRef<CellTooltipCallback | undefined>(
cellTooltipCallback,
);
const onCellEditedRef = useRef<typeof onCellEdited>(onCellEdited);
const onScrollToBottomRef = useRef<(() => void) | undefined>(
onScrollToBottom,
);
@@ -357,6 +360,7 @@ const DataGrid = ({
onScrollToBottomRef.current = onScrollToBottom;
onItemCheckedRef.current = onItemChecked;
onItemAllCheckedRef.current = onItemAllChecked;
onCellEditedRef.current = onCellEdited;
// highlightedRowId가 변경될 때 해당 행으로 스크롤 및 선택
useEffect(() => {
@@ -1149,6 +1153,33 @@ const DataGrid = ({
};
}, [onItemChecked, onItemAllChecked]);
useEffect(() => {
const gridView = gridRef.current?.gridView;
if (!gridView) return;
gridView.onCellEdited = (grid, itemIndex, _row, field) => {
const fieldName = columns[field]?.fieldName;
if (!fieldName) return;
const newValue = grid.getValue(itemIndex, fieldName);
const prevRow = rowDataRef.current[itemIndex];
const oldValue = prevRow?.[fieldName] ?? "";
onCellEditedRef.current?.({
itemIndex,
fieldName,
oldValue,
newValue,
});
};
return () => {
if (gridView.onCellEdited) {
gridView.onCellEdited = undefined;
}
};
}, [columns, setRowData]);
return (
<div className="mx-[0.6rem] flex flex-col gap-[0.6rem]">
<input
@@ -1223,7 +1254,6 @@ const DataGrid = ({
ref={gridRef}
autoGenerateField={true}
layout={columnLayout}
rows={rowData}
onInitialized={(grid) => {
if (!grid) return;
(
@@ -1259,9 +1289,9 @@ const DataGrid = ({
buildFieldsFromColumns(columns),
);
}
if (dataProvider?.setRows && rowData?.length) {
if (dataProvider?.setRows)
dataProvider.setRows(rowData);
}
if (getGridRef) getGridRef.current = gridRef.current;
const gridView = gridRef.current?.gridView ?? grid;
if (!gridView?.columnByName) return;
setTimeout(() => {