[st] - 그리드 style 적용 로직 수정, 로그 조회 일정 선택 로직 수정(최대 1년 제한)
This commit is contained in:
@@ -61,6 +61,25 @@ type GridColumnWithStyleCallback = {
|
||||
) => CellStyleCallbackResult;
|
||||
};
|
||||
|
||||
function mergeGridRowsWithSourceMetadata(
|
||||
rows: Record<string, string | number>[],
|
||||
sourceRows: Record<string, string | number>[],
|
||||
columnFieldNames: string[],
|
||||
): Record<string, string | number>[] {
|
||||
const columnFieldSet = new Set(columnFieldNames);
|
||||
return rows.map((row, index) => {
|
||||
const source = sourceRows[index];
|
||||
if (!source) return row;
|
||||
|
||||
const merged: Record<string, string | number> = { ...row };
|
||||
for (const [key, value] of Object.entries(source)) {
|
||||
if (columnFieldSet.has(key) || value === undefined) continue;
|
||||
merged[key] = value as string | number;
|
||||
}
|
||||
return merged;
|
||||
});
|
||||
}
|
||||
|
||||
function applyCellStyleCallbacksToColumns(
|
||||
gridView: unknown,
|
||||
columns: ColumnConfig[],
|
||||
@@ -1620,7 +1639,11 @@ useEffect(() => {
|
||||
r[f] = ds.getValue(i, f) as string | number;
|
||||
rows.push(r);
|
||||
}
|
||||
return rows;
|
||||
return mergeGridRowsWithSourceMetadata(
|
||||
rows,
|
||||
rowDataRef.current,
|
||||
fieldNames,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user