[st] - 검토단 작업 완료 및 입력6-1, 10-1 운영데이터업데이트 기능 추가, 텝 영역 우클릭 후 텝 닫기 기능 추가
This commit is contained in:
@@ -582,11 +582,6 @@ const PublicSewageFacilityInp = () => {
|
||||
})();
|
||||
};
|
||||
|
||||
const updateOperateDataButtonFunc = () => {
|
||||
console.log('updatedOperateData');
|
||||
// 운영 데이터 업데이트 로직
|
||||
};
|
||||
|
||||
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||
const [activeTab, setActiveTab] = useState<string>(
|
||||
PublicSewageFactInpColumnList[0]?.tabKey ?? 'ST00060001',
|
||||
@@ -766,6 +761,52 @@ const PublicSewageFacilityInp = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const updateOperateDataButtonFunc = () => {
|
||||
void (async () => {
|
||||
if (!lastSearchedValues) {
|
||||
alert('먼저 조회를 진행해주세요.');
|
||||
return;
|
||||
}
|
||||
if (!(await confirm('운영 데이터를 업데이트 하시겠습니까?'))) return;
|
||||
|
||||
try {
|
||||
showGlobalProgress({ label: '운영 데이터 업데이트 중...', progress: 0 });
|
||||
const userInfo = await getUserInfo();
|
||||
const request = {
|
||||
statsYr: lastSearchedValues.year ?? '',
|
||||
ctpvNm: lastSearchedValues.sido ?? '',
|
||||
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : lastSearchedValues.gugun ?? '',
|
||||
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
|
||||
userId: userInfo.userUnqId,
|
||||
};
|
||||
|
||||
const response =
|
||||
await statisticsInputPublicSewageFacilityApiService.updatePublicSewageFacilityOperationData(
|
||||
request,
|
||||
);
|
||||
if (response.status !== 'success') {
|
||||
alert(response.message || '운영 데이터 업데이트 중 오류가 발생했습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
setGlobalProgress(50);
|
||||
const param: PublicSewageFacilityRequestParams = {
|
||||
statsYr: request.statsYr,
|
||||
ctpvNm: request.ctpvNm,
|
||||
sggNm: request.sggNm,
|
||||
sewerBzmnCd: request.sewerBzmnCd,
|
||||
};
|
||||
await loadPublicSewageFacilityActiveTabData('ST00060001', param, lastSearchedValues);
|
||||
setGlobalProgress(100);
|
||||
alert('운영 데이터가 업데이트되었습니다.');
|
||||
} catch {
|
||||
alert('운영 데이터 업데이트 중 오류가 발생했습니다.');
|
||||
} finally {
|
||||
hideGlobalProgress();
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
const runMainFacilityMappingSave = async (
|
||||
draft: MainFacilityMappingSaveDraft,
|
||||
dialogInput: MainFacilityMappingSaveDialogValues | null,
|
||||
|
||||
@@ -660,7 +660,7 @@ const SewageExcretaSlurgeInp = () => {
|
||||
Map<string, SewerageStatusInfo | null>
|
||||
>(new Map());
|
||||
const [tabStatsCdMap, setTabStatsCdMap] = useState<Map<string, string>>(new Map());
|
||||
const [toolbarSnapshotByTab, setToolbarSnapshotByTab] = useState<
|
||||
const [_toolbarSnapshotByTab, setToolbarSnapshotByTab] = useState<
|
||||
Map<string, TabToolbarSnapshot>
|
||||
>(new Map());
|
||||
const [sggOptions, setSggOptions] = useState<Sgg[]>([]);
|
||||
|
||||
@@ -50,7 +50,7 @@ import SearchForm from "@/components/module/SearchForm";
|
||||
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
|
||||
import { VerificationResultDialog } from "@/components/module/VerificationResultDialog";
|
||||
import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog";
|
||||
import type { ColumnConfig, ColumnInfo } from "@/components/type/DataGrid.type";
|
||||
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { doList } from "@/components/util/column/input/DoList";
|
||||
import { PipeDredgingStatusInpColumn } from "@/components/util/column/input/sewagePipeMaintain/PipeDredgingStatusInpColumn";
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
type RefObject,
|
||||
type Dispatch,
|
||||
type SetStateAction,
|
||||
} from "react";
|
||||
@@ -25,7 +24,7 @@ import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButt
|
||||
import SaveButton from "@/components/button/SaveButton";
|
||||
import SubmitButton from "@/components/button/SumitButton";
|
||||
import VerificationResultButton from "@/components/button/VerificationResultButton";
|
||||
import DataGrid, { applyDropDownColumnToGrid } from "@/components/module/DataGrid";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
import { VerificationResultDialog } from "@/components/module/VerificationResultDialog";
|
||||
@@ -200,20 +199,6 @@ function createEmptyRainfallPumpStationRow(
|
||||
return row;
|
||||
}
|
||||
|
||||
function applySggNmDropDownToReservoirGrid(
|
||||
gridRef: RefObject<RealGridReact | null>,
|
||||
labels: string[],
|
||||
) {
|
||||
if (labels.length === 0) return;
|
||||
applyDropDownColumnToGrid(
|
||||
gridRef.current?.gridView as {
|
||||
setColumnProperty?: (col: string, key: string, value: unknown) => void;
|
||||
},
|
||||
"sggNm",
|
||||
labels,
|
||||
);
|
||||
}
|
||||
|
||||
function parseSggListFromResponse(res: ApiResponse<Sgg[]>): Sgg[] {
|
||||
if (res.status !== "success" || res.data == null) return [];
|
||||
return Array.isArray(res.data) ? res.data : [];
|
||||
@@ -283,6 +268,16 @@ function toGridNumber(value: string | number | null | undefined): number {
|
||||
return Number.isFinite(n) ? n : 0;
|
||||
}
|
||||
|
||||
/** 펌프 구경(mm) — 콤마 제거 후 숫자 변환, 소수점 버림 */
|
||||
function toPumpDmtrExpln(value: string | number | null | undefined): number {
|
||||
const raw = String(value ?? "").trim();
|
||||
if (raw === "") return 0;
|
||||
const normalized = raw.replace(/,/g, "");
|
||||
const num = Number(normalized);
|
||||
if (!Number.isFinite(num)) return 0;
|
||||
return Math.floor(num);
|
||||
}
|
||||
|
||||
/** 시군구명(`sggNm`) 기준 `admdstCd`(bsnmCd)·`admdstNm`(시군구명) */
|
||||
function resolveSewageReservoirAdmdst(
|
||||
sggNm: string,
|
||||
@@ -322,15 +317,15 @@ function buildSewageReservoirSaveItem(
|
||||
wtrStrgZoneArea: toGridNumber(row.wtrStrgZoneArea),
|
||||
impdFcltCpct: toGridNumber(row.impdFcltCpct),
|
||||
grssPpqty: toGridNumber(row.grssPpqty),
|
||||
pumpFcltN1DmtrExpln: String(row.pumpFcltN1DmtrExpln ?? ""),
|
||||
pumpFcltN1DmtrExpln: toPumpDmtrExpln(row.pumpFcltN1DmtrExpln),
|
||||
pumpFcltN1PerPpqty: toGridNumber(row.pumpFcltN1PerPpqty),
|
||||
pumpFcltN1PumpCnt: toGridNumber(row.pumpFcltN1PumpCnt),
|
||||
pumpFcltN1RsrvPumpCnt: toGridNumber(row.pumpFcltN1RsrvPumpCnt),
|
||||
pumpFcltN2DmtrExpln: String(row.pumpFcltN2DmtrExpln ?? ""),
|
||||
pumpFcltN2DmtrExpln: toPumpDmtrExpln(row.pumpFcltN2DmtrExpln),
|
||||
pumpFcltN2PerPpqty: toGridNumber(row.pumpFcltN2PerPpqty),
|
||||
pumpFcltN2PumpCnt: toGridNumber(row.pumpFcltN2PumpCnt),
|
||||
pumpFcltN2RsrvPumpCnt: toGridNumber(row.pumpFcltN2RsrvPumpCnt),
|
||||
pumpFcltN3DmtrExpln: String(row.pumpFcltN3DmtrExpln ?? ""),
|
||||
pumpFcltN3DmtrExpln: toPumpDmtrExpln(row.pumpFcltN3DmtrExpln),
|
||||
pumpFcltN3PerPpqty: toGridNumber(row.pumpFcltN3PerPpqty),
|
||||
pumpFcltN3PumpCnt: toGridNumber(row.pumpFcltN3PumpCnt),
|
||||
pumpFcltN3RsrvPumpCnt: toGridNumber(row.pumpFcltN3RsrvPumpCnt),
|
||||
@@ -375,15 +370,15 @@ function buildRainfallPumpStationSaveItem(
|
||||
rsvrImpndQnt: toGridNumber(row.rsvrImpndQnt),
|
||||
abstnRgnImpdQnt: toGridNumber(row.abstnRgnImpdQnt),
|
||||
grssPpqty: toGridNumber(row.grssPpqty),
|
||||
pumpFcltN1DmtrExpln: String(row.pumpFcltN1DmtrExpln ?? ""),
|
||||
pumpFcltN1DmtrExpln: toPumpDmtrExpln(row.pumpFcltN1DmtrExpln),
|
||||
pumpFcltN1PerPpqty: toGridNumber(row.pumpFcltN1PerPpqty),
|
||||
pumpFcltN1PumpCnt: toGridNumber(row.pumpFcltN1PumpCnt),
|
||||
pumpFcltN1RsrvPumpCnt: toGridNumber(row.pumpFcltN1RsrvPumpCnt),
|
||||
pumpFcltN2DmtrExpln: String(row.pumpFcltN2DmtrExpln ?? ""),
|
||||
pumpFcltN2DmtrExpln: toPumpDmtrExpln(row.pumpFcltN2DmtrExpln),
|
||||
pumpFcltN2PerPpqty: toGridNumber(row.pumpFcltN2PerPpqty),
|
||||
pumpFcltN2PumpCnt: toGridNumber(row.pumpFcltN2PumpCnt),
|
||||
pumpFcltN2RsrvPumpCnt: toGridNumber(row.pumpFcltN2RsrvPumpCnt),
|
||||
pumpFcltN3DmtrExpln: String(row.pumpFcltN3DmtrExpln ?? ""),
|
||||
pumpFcltN3DmtrExpln: toPumpDmtrExpln(row.pumpFcltN3DmtrExpln),
|
||||
pumpFcltN3PerPpqty: toGridNumber(row.pumpFcltN3PerPpqty),
|
||||
pumpFcltN3PumpCnt: toGridNumber(row.pumpFcltN3PumpCnt),
|
||||
pumpFcltN3RsrvPumpCnt: toGridNumber(row.pumpFcltN3RsrvPumpCnt),
|
||||
|
||||
@@ -850,8 +850,8 @@ const WaterReuseInp = () => {
|
||||
(typeof gridView.getCheckedItems === "function"
|
||||
? gridView.getCheckedItems()
|
||||
: typeof gridView.getCheckedRows === "function"
|
||||
? gridView.getCheckedRows()
|
||||
: []) ?? [];
|
||||
? gridView.getCheckedRows()
|
||||
: []) ?? [];
|
||||
|
||||
return checked.filter(
|
||||
(idx) => Number.isInteger(idx) && idx >= 0 && idx < rowCount,
|
||||
@@ -1166,8 +1166,8 @@ const WaterReuseInp = () => {
|
||||
const submitList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildRecycledWaterStatusSaveItem(row, list),
|
||||
);
|
||||
buildRecycledWaterStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) => buildRecycledWaterStatusSaveItem(row, list));
|
||||
@@ -1186,8 +1186,8 @@ const WaterReuseInp = () => {
|
||||
const submitList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildRainFallUtilFactStatusSaveItem(row, list),
|
||||
);
|
||||
buildRainFallUtilFactStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) => buildRainFallUtilFactStatusSaveItem(row, list));
|
||||
@@ -1206,8 +1206,8 @@ const WaterReuseInp = () => {
|
||||
const submitList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildTreatWaterReuseDesignConstStatusSaveItem(row, list),
|
||||
);
|
||||
buildTreatWaterReuseDesignConstStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) =>
|
||||
@@ -1231,8 +1231,8 @@ const WaterReuseInp = () => {
|
||||
const submitList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildTreatWaterReuseBusinessApprStatusSaveItem(row, list),
|
||||
);
|
||||
buildTreatWaterReuseBusinessApprStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) =>
|
||||
@@ -1417,8 +1417,8 @@ const WaterReuseInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildRecycledWaterStatusSaveItem(row, list),
|
||||
);
|
||||
buildRecycledWaterStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) => buildRecycledWaterStatusSaveItem(row, list));
|
||||
@@ -1477,8 +1477,8 @@ const WaterReuseInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildRainFallUtilFactStatusSaveItem(row, list),
|
||||
);
|
||||
buildRainFallUtilFactStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) => buildRainFallUtilFactStatusSaveItem(row, list));
|
||||
@@ -1538,8 +1538,8 @@ const WaterReuseInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildTreatWaterReuseDesignConstStatusSaveItem(row, list),
|
||||
);
|
||||
buildTreatWaterReuseDesignConstStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) =>
|
||||
@@ -1603,8 +1603,8 @@ const WaterReuseInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: currentData.map((row) =>
|
||||
buildTreatWaterReuseBusinessApprStatusSaveItem(row, list),
|
||||
);
|
||||
buildTreatWaterReuseBusinessApprStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRow(tabKey, row))
|
||||
.map((row) =>
|
||||
@@ -1652,7 +1652,56 @@ const WaterReuseInp = () => {
|
||||
};
|
||||
|
||||
const updateOperateDataButtonFunc = () => {
|
||||
alert("운영 데이터 업데이트 API 연동 준비 중입니다.");
|
||||
void (async () => {
|
||||
if (!lastSearchedValues) {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!(await confirm("운영 데이터를 업데이트 하시겠습니까?"))) return;
|
||||
|
||||
try {
|
||||
showGlobalProgress({ label: "운영 데이터 업데이트 중...", progress: 0 });
|
||||
const userInfo = await getUserInfo();
|
||||
const request = {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
ctpvNm: lastSearchedValues.sido ?? "",
|
||||
sggNm:
|
||||
lastSearchedValues.gugun === "ALL"
|
||||
? ""
|
||||
: (lastSearchedValues.gugun ?? ""),
|
||||
sewerBzmnCd: lastSearchedValues.bsnmCd ?? "",
|
||||
userId: userInfo.userUnqId,
|
||||
};
|
||||
|
||||
const response =
|
||||
await statisticsInputWaterReuseApi.updateWaterReuseOperationData(request);
|
||||
if (response.status !== "success") {
|
||||
alert(response.message || "운영 데이터 업데이트 중 오류가 발생했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
setGlobalProgress(50);
|
||||
const param: WaterReuseRequestParams = {
|
||||
statsYr: request.statsYr,
|
||||
ctpvNm: request.ctpvNm,
|
||||
sggNm: request.sggNm,
|
||||
sewerBzmnCd: request.sewerBzmnCd,
|
||||
};
|
||||
await loadActiveTabData(
|
||||
PublicSewageTreatWaterReuseInpColumn.tabKey,
|
||||
param,
|
||||
lastSearchedValues,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
setGlobalProgress(100);
|
||||
alert("운영 데이터가 업데이트되었습니다.");
|
||||
} catch {
|
||||
alert("운영 데이터 업데이트 중 오류가 발생했습니다.");
|
||||
} finally {
|
||||
hideGlobalProgress();
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
const addArticleFunc = async () => {
|
||||
@@ -1716,10 +1765,10 @@ const WaterReuseInp = () => {
|
||||
checkedIndexes.length > 0
|
||||
? new Set(checkedIndexes)
|
||||
: new Set(
|
||||
currentRows
|
||||
.map((row, idx) => (isCheckedRow(row) ? idx : -1))
|
||||
.filter((idx) => idx >= 0),
|
||||
);
|
||||
currentRows
|
||||
.map((row, idx) => (isCheckedRow(row) ? idx : -1))
|
||||
.filter((idx) => idx >= 0),
|
||||
);
|
||||
|
||||
const removedRows = currentRows.filter((_, idx) => checkedIndexSet.has(idx));
|
||||
const nextRows = currentRows.filter((_, idx) => !checkedIndexSet.has(idx));
|
||||
@@ -1951,8 +2000,8 @@ const WaterReuseInp = () => {
|
||||
e.vrfcCd === "IMR"
|
||||
? "IMR검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "HB검증 - ";
|
||||
? "일반검증 - "
|
||||
: "HB검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.compVlCn} / 현재 입력값: ${e.nowVlCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
Reference in New Issue
Block a user