Merge remote-tracking branch 'origin/iipbs/st/dev'
Deploy Frontend / deploy (push) Successful in 3m9s
Deploy Frontend / deploy (push) Successful in 3m9s
This commit is contained in:
@@ -729,7 +729,6 @@ const DataGrid = ({
|
||||
idFieldName = "id",
|
||||
enableSort = false,
|
||||
gridHeight = 55, // vh 단위
|
||||
onRowDblClick,
|
||||
headerHeight = 60,
|
||||
fitStyle = GridFitStyle.EVEN,
|
||||
}: DataGridProps) => {
|
||||
@@ -789,20 +788,25 @@ useEffect(() => {
|
||||
const gridView = gridRef.current?.gridView;
|
||||
if (!gridView || !onCellDblClick) return;
|
||||
|
||||
(gridView as any).onCellDblClicked = (_grid: unknown, clickData: { cellType?: string; itemIndex?: number }) => {
|
||||
gridView.onCellDblClicked = (_grid, clickData) => {
|
||||
if (clickData.cellType !== "data" || clickData.itemIndex === undefined) return;
|
||||
const row = rowDataRef.current[clickData.itemIndex];
|
||||
const cellIndex = (gridView as any).getCurrent?.();
|
||||
const fieldName = cellIndex?.fieldName ?? cellIndex?.column ?? "";
|
||||
if (row) onCellDblClick({ // ← 여기는 Props 콜백 호출이라 그대로
|
||||
row: row as Record<string, string | number>,
|
||||
fieldName,
|
||||
itemIndex: clickData.itemIndex
|
||||
});
|
||||
const cellIndex = gridView.getCurrent();
|
||||
const column = cellIndex.column;
|
||||
const fieldName =
|
||||
cellIndex.fieldName ??
|
||||
(typeof column === "string" ? column : "");
|
||||
if (row) {
|
||||
onCellDblClick({
|
||||
row: row as Record<string, string | number>,
|
||||
fieldName,
|
||||
itemIndex: clickData.itemIndex,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return () => {
|
||||
(gridView as any).onCellDblClicked = undefined;
|
||||
gridView.onCellDblClicked = undefined;
|
||||
};
|
||||
}, [onCellDblClick]);
|
||||
useLayoutEffect(() => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button } from "@common/components";
|
||||
import type { RealGridReact } from "realgrid-react";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||
import type { ColumnInfo, GridViewWithEditCommit } from "@/components/type/DataGrid.type";
|
||||
import {
|
||||
DomesticPopulationLeftColumnConfig,
|
||||
DomesticPopulationRightColumnConfig,
|
||||
@@ -12,7 +12,6 @@ import { UpperCodeSelectDialog } from "@/components/statistics/management/UpperC
|
||||
import type { usePopulationMappingTab } from "@/components/statistics/management/hooks/usePopulationMappingTab";
|
||||
import { asGridRowData, asGridRowSetter, fromGridRow } from "@/components/statistics/management/lib/gridCast";
|
||||
import type { DomesticPopulationItem } from "@/entities/statistics/model/ppltn/statistics-domestic-population-interface";
|
||||
import type { DataCellClickCallbackParams } from "@/components/type/DataGrid.type";
|
||||
|
||||
|
||||
const leftColumnInfo: ColumnInfo = {
|
||||
@@ -99,7 +98,10 @@ const DomesticPopulationTab = ({ tab, statsYr, onFileButtonClick }: Props) => {
|
||||
onDataCellClick={({ row, fieldName }) => {
|
||||
if (fieldName === "mpinCd") return;
|
||||
if (fieldName === "admdstCd") {
|
||||
(rightGridRef.current?.gridView as any)?.commit?.(); // ← commit 먼저
|
||||
const gridView = rightGridRef.current?.gridView as
|
||||
| GridViewWithEditCommit
|
||||
| undefined;
|
||||
gridView?.commit?.();
|
||||
setTimeout(() => {
|
||||
tab.setRightRowData((prev) =>
|
||||
prev.map((r) =>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Button } from "@common/components";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||
import type { ColumnInfo, GridViewWithEditCommit } from "@/components/type/DataGrid.type";
|
||||
import { useRef } from "react";
|
||||
import type { RealGridReact } from "realgrid-react";
|
||||
import {
|
||||
@@ -97,7 +97,10 @@ const ForeignPopulationTab = ({ tab, statsYr, onFileButtonClick }: Props) => {
|
||||
onDataCellClick={({ row, fieldName }) => {
|
||||
if (fieldName === "mpinCd") return;
|
||||
if (fieldName === "admdstCd") {
|
||||
(rightGridRef.current?.gridView as any)?.commit?.();
|
||||
const gridView = rightGridRef.current?.gridView as
|
||||
| GridViewWithEditCommit
|
||||
| undefined;
|
||||
gridView?.commit?.();
|
||||
setTimeout(() => {
|
||||
tab.setRightRowData((prev) =>
|
||||
prev.map((r) =>
|
||||
|
||||
@@ -97,7 +97,7 @@ console.log("reducedList 이상한 것:", reducedList.filter(r => r.adstCd.lengt
|
||||
|
||||
};
|
||||
|
||||
const handleRowClick = async (rowData: AdmdstRenewalAddedItem, statsYr: string) => {
|
||||
const handleRowClick = async (rowData: AdmdstRenewalAddedItem, _statsYr: string) => {
|
||||
const adstCd = String(rowData.adstCd ?? "");
|
||||
if (!adstCd) { alert("행정동코드가 없습니다."); return; }
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
} from "@/components/statistics/review/ReviewOpinionDialog";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { ExcretaTreatmentFacilityInfoList } from "@/components/util/column/review/ExcretaTreatmentFacilityRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleExcludeMergeCells, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const excretaTreatmentFacilityTab = ExcretaTreatmentFacilityInfoList[0];
|
||||
|
||||
@@ -67,6 +67,11 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const cellStyleCallback = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleExcludeMergeCells(columnInfo.columns),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const submit =
|
||||
statsStatusInfo.submitStatusCd != null
|
||||
@@ -280,7 +285,7 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={columnInfo.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={cellStyleCallback}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { PrivateSewageFacilityInfoListRvw } from "@/components/util/column/review/PrivateSewageFacilityColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = PrivateSewageFacilityInfoListRvw[0]?.tabKey ?? "ST00080001";
|
||||
|
||||
@@ -85,6 +85,11 @@ const PrivateSewageFacilityRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -391,7 +396,7 @@ const PrivateSewageFacilityRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
type ReviewOpinionDialogContext,
|
||||
} from "@/components/statistics/review/ReviewOpinionDialog";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleExcludeMergeCells, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
import { PublicSewageFacilityInfoList } from "@/components/util/column/review/PublicSewageFacilityRvwColumn";
|
||||
|
||||
@@ -55,6 +55,11 @@ const PublicSewageFacilityRvw = () => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const cellStyleCallback = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleExcludeMergeCells(columnInfo.columns),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const submit = statsStatusInfo.submitStatusCd != null ? String(statsStatusInfo.submitStatusCd) : "";
|
||||
const prvn = statsStatusInfo.prvnStatusCd != null ? String(statsStatusInfo.prvnStatusCd) : "";
|
||||
@@ -250,7 +255,7 @@ const PublicSewageFacilityRvw = () => {
|
||||
rowStartNum={columnInfo.rowStartNum}
|
||||
rowData={rowData}
|
||||
setRowData={setRowData}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={cellStyleCallback}
|
||||
/>
|
||||
<ReviewOpinionDialog
|
||||
open={reviewOpinionOpen}
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
} from "@/components/statistics/review/ReviewOpinionDialog";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { PumpingStationInfoList } from "@/components/util/column/review/PumpingStationRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleExcludeMergeCells, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
/**
|
||||
* 하수도 통계 검토 05.중계펌프장
|
||||
@@ -62,6 +62,11 @@ const PumpingStationRvw = () => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const cellStyleCallback = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleExcludeMergeCells(columnInfo.columns),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const submit =
|
||||
statsStatusInfo.submitStatusCd != null
|
||||
@@ -270,7 +275,7 @@ const PumpingStationRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={columnInfo.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={cellStyleCallback}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewageExcretaRelatedInfoListRvw } from "@/components/util/column/review/SewageExcretaRelatedRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewageExcretaRelatedInfoListRvw[0]?.tabKey ?? "ST00120001";
|
||||
|
||||
@@ -88,6 +88,11 @@ const SewageExcretaRelatedRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -396,7 +401,7 @@ const SewageExcretaRelatedRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewageExcretaSludgeInfoListRvw } from "@/components/util/column/review/SewageExcretaSlurgeRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewageExcretaSludgeInfoListRvw[0]?.tabKey ?? "ST00110001";
|
||||
|
||||
@@ -88,6 +88,11 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -397,7 +402,7 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewagePipeMaintainColumnInfoList } from "@/components/util/column/review/SewagePipeMaintainRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewagePipeMaintainColumnInfoList[0]?.tabKey ?? "ST00030001";
|
||||
|
||||
@@ -103,6 +103,11 @@ const SewagePipeMaintainRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -409,7 +414,7 @@ const SewagePipeMaintainRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -32,7 +32,7 @@ import type {
|
||||
} from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewagePipeColumnInfoListRvw } from "@/components/util/column/review/SewagePipeRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewagePipeColumnInfoListRvw[0]?.tabKey ?? "ST00020001";
|
||||
|
||||
@@ -156,6 +156,12 @@ const SewagePipeRvw = () => {
|
||||
})),
|
||||
[],
|
||||
);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -459,7 +465,7 @@ const SewagePipeRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewageReservoirPumpInfoListRvw } from "@/components/util/column/review/SewageReservoirPumpRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewageReservoirPumpInfoListRvw[0]?.tabKey ?? "ST00040001";
|
||||
|
||||
@@ -107,6 +107,11 @@ const SewageReservoirPumpRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const activeStatsCd = activeStatsStatusInfo.statsCd ?? activeTab;
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
@@ -415,7 +420,7 @@ const SewageReservoirPumpRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewerageFinanceInfoListRvw } from "@/components/util/column/review/SewerageFinanceRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewerageFinanceInfoListRvw[0]?.tabKey ?? "ST00090001";
|
||||
|
||||
@@ -88,6 +88,11 @@ const SewerageFinanceRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -394,7 +399,7 @@ const SewerageFinanceRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { statisticsManagementApi } from "@/entities/statistics/api/statistics-management-service";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleExcludeMergeCells, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import {
|
||||
ReviewOpinionDialog,
|
||||
type ReviewOpinionDialogContext,
|
||||
@@ -54,6 +54,11 @@ const SeweragePenetrationRateRvw = () => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const cellStyleCallback = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleExcludeMergeCells(columnInfo.columns),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const submit = statsStatusInfo.submitStatusCd != null ? String(statsStatusInfo.submitStatusCd) : "";
|
||||
const prvn = statsStatusInfo.prvnStatusCd != null ? String(statsStatusInfo.prvnStatusCd) : "";
|
||||
@@ -245,7 +250,7 @@ const SeweragePenetrationRateRvw = () => {
|
||||
rowStartNum={columnInfo.rowStartNum}
|
||||
rowData={rowData}
|
||||
setRowData={setRowData}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={cellStyleCallback}
|
||||
/>
|
||||
|
||||
<ReviewOpinionDialog
|
||||
|
||||
@@ -34,7 +34,7 @@ import type {
|
||||
} from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { SewerageServiceLevelInfoListRvw } from "@/components/util/column/review/SewerageServiceLevelRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = SewerageServiceLevelInfoListRvw[0]?.tabKey ?? "ST00130001";
|
||||
|
||||
@@ -86,6 +86,11 @@ const SewerageServiceLevelRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -395,7 +400,7 @@ const SewerageServiceLevelRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import type { ColumnConfig, ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { WaterReuseInfoListRvw } from "@/components/util/column/review/WaterReuseRvwColumn";
|
||||
import { reviewRowTypeCurrCellStyleCallback, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { buildReviewRowTypeCurrCellStyleCallbackByTab, toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
const firstTabKey = WaterReuseInfoListRvw[0]?.tabKey ?? "ST00100001";
|
||||
|
||||
@@ -91,6 +91,11 @@ const WaterReuseRvw = () => {
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const reviewCellStyleCallbackByTab = useMemo(
|
||||
() => buildReviewRowTypeCurrCellStyleCallbackByTab(columnInfo),
|
||||
[columnInfo],
|
||||
);
|
||||
|
||||
const reviewOpinionContext = useMemo<ReviewOpinionDialogContext | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
return {
|
||||
@@ -398,7 +403,7 @@ const WaterReuseRvw = () => {
|
||||
showHeaderCheckbox={false}
|
||||
fixedColumns={info.fixedColumns}
|
||||
enableSort={false}
|
||||
cellStyleCallback={reviewRowTypeCurrCellStyleCallback}
|
||||
cellStyleCallback={reviewCellStyleCallbackByTab.get(tabKey)}
|
||||
/>
|
||||
</TabsContent>
|
||||
);
|
||||
|
||||
@@ -81,6 +81,12 @@ export type GridView = {
|
||||
getDataRow(itemIndex: number): number;
|
||||
};
|
||||
|
||||
/** RealGrid gridView 편집 확정 API (realgrid-react gridView 타입에 미포함) */
|
||||
export type GridViewWithEditCommit = {
|
||||
commit?: (force?: boolean) => void;
|
||||
cancel?: () => void;
|
||||
};
|
||||
|
||||
export type MergeCallback = (
|
||||
grid: GridView,
|
||||
column: DataColumn,
|
||||
|
||||
@@ -52,7 +52,7 @@ const rawMaintainList = [
|
||||
]
|
||||
},
|
||||
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
|
||||
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true },
|
||||
// { name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true },
|
||||
{
|
||||
name: 'displayYear',
|
||||
fieldName: 'displayYear',
|
||||
@@ -125,7 +125,7 @@ const rawMaintainList = [
|
||||
items: [
|
||||
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 4 }, { colspan: 4 }] },
|
||||
'sggNm',
|
||||
'admdstNm',
|
||||
// 'admdstNm',
|
||||
]
|
||||
},
|
||||
'displayYear',
|
||||
@@ -197,7 +197,7 @@ const rawMaintainList = [
|
||||
]
|
||||
},
|
||||
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
|
||||
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true },
|
||||
// { name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true },
|
||||
{
|
||||
name: 'displayYear',
|
||||
fieldName: 'displayYear',
|
||||
@@ -277,7 +277,7 @@ const rawMaintainList = [
|
||||
items: [
|
||||
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 4 }, { colspan: 4 }] }, // sido -> ctpvNm
|
||||
'sggNm',
|
||||
'admdstNm'
|
||||
// 'admdstNm'
|
||||
]
|
||||
},
|
||||
'displayYear',
|
||||
|
||||
@@ -51,13 +51,13 @@ const reviewAddressColumns = [
|
||||
mergeCells: true,
|
||||
sortdisable: true,
|
||||
},
|
||||
{
|
||||
name: "admdstNm",
|
||||
fieldName: "admdstNm",
|
||||
header: { text: "행정구역명" },
|
||||
mergeCells: true,
|
||||
sortdisable: true,
|
||||
},
|
||||
// {
|
||||
// name: "admdstNm",
|
||||
// fieldName: "admdstNm",
|
||||
// header: { text: "행정구역명" },
|
||||
// mergeCells: true,
|
||||
// sortdisable: true,
|
||||
// },
|
||||
{
|
||||
name: "displayYear",
|
||||
fieldName: "displayYear",
|
||||
@@ -73,7 +73,7 @@ const reviewAddressLayout = {
|
||||
items: [
|
||||
{ column: "ctpvNm", footerUserSpans: [{ colspan: 4 }, { colspan: 4 }] },
|
||||
"sggNm",
|
||||
"admdstNm",
|
||||
// "admdstNm",
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CellStyleCallback } from "@/components/type/DataGrid.type";
|
||||
import type { CellStyleCallback, ColumnConfig } from "@/components/type/DataGrid.type";
|
||||
|
||||
/** 검토(review) 그리드: rowType이 CURR인 행(당해 연도) 흰색 배경 */
|
||||
export const reviewRowTypeCurrCellStyleCallback: CellStyleCallback = ({ row }) => {
|
||||
@@ -8,6 +8,59 @@ export const reviewRowTypeCurrCellStyleCallback: CellStyleCallback = ({ row }) =
|
||||
return undefined;
|
||||
};
|
||||
|
||||
/** 검토(review) CURR 행 스타일 — 지정 컬럼은 제외(merge/fixed 영역 깜빡임 방지) */
|
||||
export function createReviewRowTypeCurrCellStyleCallback(options?: {
|
||||
excludeFieldNames?: readonly string[];
|
||||
}): CellStyleCallback {
|
||||
const excluded =
|
||||
options?.excludeFieldNames != null
|
||||
? new Set(options.excludeFieldNames)
|
||||
: null;
|
||||
|
||||
return ({ row, fieldName }) => {
|
||||
if (excluded?.has(fieldName)) {
|
||||
return undefined;
|
||||
}
|
||||
if (String(row.rowType ?? "") === "CURR") {
|
||||
return "rg-cell-rowtype-curr";
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
}
|
||||
|
||||
/** mergeCells 컬럼은 CURR 스타일 제외(merge 영역 깜빡임 방지) */
|
||||
function collectMergeCellFieldNames(
|
||||
columns: readonly Pick<ColumnConfig, "fieldName" | "mergeCells">[],
|
||||
): string[] {
|
||||
return columns
|
||||
.filter((col) => col.mergeCells === true && col.fieldName)
|
||||
.map((col) => col.fieldName);
|
||||
}
|
||||
|
||||
export function buildReviewRowTypeCurrCellStyleExcludeMergeCells(
|
||||
columns: readonly Pick<ColumnConfig, "fieldName" | "mergeCells">[],
|
||||
): CellStyleCallback {
|
||||
return createReviewRowTypeCurrCellStyleCallback({
|
||||
excludeFieldNames: collectMergeCellFieldNames(columns),
|
||||
});
|
||||
}
|
||||
|
||||
export function buildReviewRowTypeCurrCellStyleCallbackByTab(
|
||||
tabs: readonly {
|
||||
tabKey: string;
|
||||
columns?: readonly Pick<ColumnConfig, "fieldName" | "mergeCells">[];
|
||||
}[],
|
||||
): Map<string, CellStyleCallback> {
|
||||
const map = new Map<string, CellStyleCallback>();
|
||||
for (const tab of tabs) {
|
||||
map.set(
|
||||
tab.tabKey,
|
||||
buildReviewRowTypeCurrCellStyleExcludeMergeCells(tab.columns ?? []),
|
||||
);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 객체 배열을 그리드 row 형식으로 변환 (null/undefined → "").
|
||||
* 어떤 엔티티 타입이든 공통 사용 가능.
|
||||
|
||||
Reference in New Issue
Block a user