feat: 집계표 비고 제거 , 행정동 인구관리 갱신 버튼추가

This commit is contained in:
yangsein
2026-07-03 16:15:34 +09:00
parent 5580b4301f
commit afcfbbbf61
6 changed files with 37 additions and 17 deletions
@@ -55,7 +55,16 @@ const AdmdstRenewalTab = ({ tab, statsYr }: Props) => {
추가된 행정구역 자료
</span>
</div>
<div className="flex justify-end pr-[1rem] mb-[0.4rem]">
<div className="flex justify-end pr-[1rem] mb-[0.4rem] gap-4">
<Button
type="button"
color="red"
disabled={tab.isLoading}
onClick={() => void tab.handleRefresh()}
className="mt-[0.5rem] px-[4rem] py-[0.8rem] text-[1.4rem]"
>
갱신
</Button>
<Button
type="button"
color="primary"
@@ -60,6 +60,7 @@ export function useAdmdstRenewalTab() {
return;
}
await run(async () => {
const userInfo = await getUserInfo();
const addedList: AdmdstRenewalAddedSaveItem[] = addedRowData
@@ -79,13 +80,12 @@ const addedList: AdmdstRenewalAddedSaveItem[] = addedRowData
userId: userInfo.userUnqId,
}));
const reducedList: AdmdstRenewalReducedSaveItem[] = reducedRowData.map((row) => ({
adstCd: String(row.adstCd ?? ""),
}));
console.log("reducedList:", reducedList);
console.log("addedList:", addedList);
console.log("reducedList 이상한 것:", reducedList.filter(r => r.adstCd.length !== 10));
const res = await statisticsPpltnApi.saveChangedArea(reducedList, addedList);
if (res.status === "success") {
await loadAll(statsYr);
@@ -110,8 +110,6 @@ console.log("reducedList 이상한 것:", reducedList.filter(r => r.adstCd.lengt
if (res.status === "success" && Array.isArray(res.data) && res.data.length > 0) {
setCandidates(res.data);
const rowIndex = addedRowData.findIndex((r) => r.adstCd === rowData.adstCd);
console.log("rowData.adstCd:", rowData.adstCd); // ← 여기
console.log("rowIndex:", rowIndex); // ← 여기
selectedRowIndexRef.current = rowIndex;
setDialogOpen(true);
} else {
@@ -131,9 +129,20 @@ console.log("reducedList 이상한 것:", reducedList.filter(r => r.adstCd.lengt
: row,
),
);
selectedRowIndexRef.current = null;
};
const handleRefresh = async () => {
await run(async () => {
const res = await statisticsPpltnApi.refreshMaterializedViews();
if (res.status === "success") {
alert("뷰 갱신이 완료되었습니다.");
} else {
alert("뷰 갱신 중 오류가 발생했습니다.");
}
});
};
const reset = () => {
setReducedRowData([]);
setAddedRowData([]);
@@ -156,6 +165,7 @@ console.log("reducedList 이상한 것:", reducedList.filter(r => r.adstCd.lengt
handleFinal,
handleRowClick,
handleCodeSelect,
handleRefresh,
reset,
};
}