[st] - 입력단 작업 완료
This commit is contained in:
@@ -1140,8 +1140,8 @@ const PrivateSewageFacilityInp = () => {
|
||||
onValuesChange={setSearchValues}
|
||||
/>
|
||||
{showActionToolbarCard && (
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<VerificationResultButton
|
||||
VerificationResultButtonFunc={openVerificationHistoryDialog}
|
||||
/>
|
||||
@@ -1150,7 +1150,7 @@ const PrivateSewageFacilityInp = () => {
|
||||
<LastYearDataButton
|
||||
getLastYearDataFunc={() => void lastYearDataFunc()}
|
||||
/>
|
||||
<SubmitButton submitFunc={submitFunc} />
|
||||
<SubmitButton submitFunc={submitFunc} />
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.laeSbmsnSttsCd === "2" && (
|
||||
|
||||
@@ -967,7 +967,7 @@ const PumpingStationInp = () => {
|
||||
onValuesChange={setSearchValues}
|
||||
/>
|
||||
{showActionToolbarCard && (
|
||||
<div className="card !py-0">
|
||||
<div className="card !py-0">
|
||||
<div className="m-[0.6rem] flex items-center justify-end gap-[0.6rem]">
|
||||
<VerificationResultButton
|
||||
VerificationResultButtonFunc={openVerificationHistoryDialog}
|
||||
@@ -977,18 +977,18 @@ const PumpingStationInp = () => {
|
||||
<LastYearDataButton
|
||||
getLastYearDataFunc={() => void getLastYearDataFunc()}
|
||||
/>
|
||||
<SubmitButton submitFunc={submitFunc} />
|
||||
<SubmitButton submitFunc={submitFunc} />
|
||||
</>
|
||||
)}
|
||||
{statusInfo?.laeSbmsnSttsCd === "2" && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{showArticleToolbarCard && (
|
||||
<div className="card !py-0">
|
||||
<div className="card !py-0">
|
||||
<div className="m-[0.6rem] flex items-center justify-end gap-[0.6rem]">
|
||||
{showNotApplicable && (
|
||||
<NotApplicableCheckButton
|
||||
@@ -996,10 +996,10 @@ const PumpingStationInp = () => {
|
||||
setIsCheck={setIsNotApplicable}
|
||||
/>
|
||||
)}
|
||||
<AddArticleButton addArticleFunc={addArticleFunc} />
|
||||
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
|
||||
</div>
|
||||
</div>
|
||||
<AddArticleButton addArticleFunc={addArticleFunc} />
|
||||
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{isLoading && (
|
||||
<div className="absolute inset-0 z-50 flex items-center justify-center rounded-lg p-10 [data-theme='black']:bg-transparent">
|
||||
@@ -1008,14 +1008,14 @@ const PumpingStationInp = () => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<DataGrid
|
||||
<DataGrid
|
||||
key={canEditGrid ? "enterable" : "readonly"}
|
||||
getGridRef={gridRef as RefObject<RealGridReact | null>}
|
||||
columnInfo={columnInfo}
|
||||
rowStartNum={PumpingStationInpColumn.rowStartNum}
|
||||
fixedColumns={PumpingStationInpColumn.fixedColumns}
|
||||
rowData={rowData}
|
||||
setRowData={setRowData}
|
||||
rowData={rowData}
|
||||
setRowData={setRowData}
|
||||
getGridDataRef={gridGetRowsRef}
|
||||
showHeaderCheckbox
|
||||
statusInfo={statusInfo}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,11 @@ import {
|
||||
type SewerageServiceLevelResidentFriendlyFactSaveItem,
|
||||
type SewerageServiceLevelVerificationResult,
|
||||
} from "@/entities/statistics/model/input/statistics-input-sewerage-service-level-interface";
|
||||
import type { SewerageStatusInfo, cancelSubmitRequest, ImrStatusResponse } from "@/entities/statistics/model/statistics-interface";
|
||||
import type {
|
||||
SewerageStatusInfo,
|
||||
cancelSubmitRequest,
|
||||
ImrStatusResponse,
|
||||
} from "@/entities/statistics/model/statistics-interface";
|
||||
import type { StatisticsInputSubmitInfoFormData } from "@/entities/statistics/model/statistics-input-submit-info-schema";
|
||||
import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGate } from "@/shared/lib";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
@@ -62,6 +66,18 @@ const SEWERAGE_SERVICE_LEVEL_COLUMN_GUIDE_STATS_CD_BY_TAB_KEY: Record<string, st
|
||||
[ResidentFriendlyFactInpColumn.tabKey]: SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD,
|
||||
};
|
||||
|
||||
const EMPTY_PUBLIC_SEWAGE_FACILITIES_MSG =
|
||||
"06. 공공하수처리시설 데이터가 없으면 전년도 데이터 조회 및 항목 추가가 불가능 합니다.";
|
||||
|
||||
function buildEmptyDataAlertOverrides(
|
||||
tabKey: string,
|
||||
): { alertIfResidentFriendlyEmpty?: boolean } | undefined {
|
||||
if (tabKey === ResidentFriendlyFactInpColumn.tabKey) {
|
||||
return { alertIfResidentFriendlyEmpty: true };
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
type GridRowWithVerification = Record<string, string | number> & {
|
||||
verificationResult?: SewerageServiceLevelVerificationResult;
|
||||
};
|
||||
@@ -299,6 +315,8 @@ const SewerageServiceLevelInp = () => {
|
||||
const periodEnterableRef = useRef(true);
|
||||
const activeTabRef = useRef(activeTab);
|
||||
const getGridDataRef = useRef<(() => Record<string, string | number>[]) | null>(null);
|
||||
/** ST00130002 당해 조회 결과 유무(공공하수처리시설 연동) — 전년도 조회 가능 여부 */
|
||||
const publicSewageFacilitiesAvailableRef = useRef(false);
|
||||
activeTabRef.current = activeTab;
|
||||
|
||||
useEffect(() => {
|
||||
@@ -384,9 +402,10 @@ const SewerageServiceLevelInp = () => {
|
||||
searchContext: SearchFormValues,
|
||||
mergeIntoExistingMap: boolean,
|
||||
updateLastSearchedValues: boolean,
|
||||
overrides?: { mode?: string },
|
||||
overrides?: { mode?: string; alertIfResidentFriendlyEmpty?: boolean },
|
||||
): Promise<boolean> => {
|
||||
const requestParam = overrides?.mode ? { ...param, mode: overrides.mode } : param;
|
||||
const fromPreYear = overrides?.mode === "PRE";
|
||||
|
||||
if (tabKey === ComplaintInpColumn.tabKey) {
|
||||
const response =
|
||||
@@ -426,6 +445,12 @@ const SewerageServiceLevelInp = () => {
|
||||
(residentFriendlyFactList ?? []) as SewerageServiceLevelResidentFriendlyFactItem[],
|
||||
commonInfo.ctpvNm,
|
||||
);
|
||||
if (!fromPreYear) {
|
||||
publicSewageFacilitiesAvailableRef.current = gridRows.length > 0;
|
||||
if (gridRows.length === 0 && overrides?.alertIfResidentFriendlyEmpty) {
|
||||
alert(EMPTY_PUBLIC_SEWAGE_FACILITIES_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
applyRowMap(mergeIntoExistingMap, (m) => {
|
||||
m.set(ResidentFriendlyFactInpColumn.tabKey, gridRows);
|
||||
@@ -460,6 +485,7 @@ const SewerageServiceLevelInp = () => {
|
||||
searchParamRef.current = null;
|
||||
searchDoneRef.current = false;
|
||||
periodEnterableRef.current = true;
|
||||
publicSewageFacilitiesAvailableRef.current = false;
|
||||
};
|
||||
|
||||
const handleSearch = async (values: SearchFormValues) => {
|
||||
@@ -507,6 +533,7 @@ const SewerageServiceLevelInp = () => {
|
||||
values,
|
||||
!yearChangedFromLastSearch,
|
||||
true,
|
||||
buildEmptyDataAlertOverrides(activeTabRef.current),
|
||||
);
|
||||
} catch {
|
||||
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||
@@ -541,6 +568,7 @@ const SewerageServiceLevelInp = () => {
|
||||
lastSearchedValues,
|
||||
true,
|
||||
false,
|
||||
buildEmptyDataAlertOverrides(tabKey),
|
||||
);
|
||||
} catch {
|
||||
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||
@@ -559,6 +587,13 @@ const SewerageServiceLevelInp = () => {
|
||||
alert("먼저 데이터를 조회해주세요.");
|
||||
return;
|
||||
}
|
||||
if (
|
||||
activeTabRef.current === ResidentFriendlyFactInpColumn.tabKey &&
|
||||
!publicSewageFacilitiesAvailableRef.current
|
||||
) {
|
||||
alert(EMPTY_PUBLIC_SEWAGE_FACILITIES_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -481,17 +481,6 @@ function mapTreatWaterReuseStatusListToGridRows<
|
||||
});
|
||||
}
|
||||
|
||||
function mapWaterReuseListToGridRows<
|
||||
T extends { verificationResult?: WaterReuseVerificationResult },
|
||||
>(list: T[], ctpvNm: string): GridRowWithVerification[] {
|
||||
return list.map((item) => {
|
||||
const { verificationResult, ...rest } = item;
|
||||
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
return row;
|
||||
});
|
||||
}
|
||||
|
||||
const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
async function waitForImrJobCompleted(
|
||||
@@ -1871,7 +1860,6 @@ const WaterReuseInp = () => {
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]);
|
||||
|
||||
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
||||
const activeTabRowData = rowDataMap.get(activeTab) ?? [];
|
||||
const activeTabToolbar =
|
||||
toolbarSnapshotByTab.get(activeTab) ??
|
||||
computeTabToolbarSnapshot(
|
||||
|
||||
Reference in New Issue
Block a user