From 91e505f37fd521ca1a0838571a4b00d0f4668613 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Mon, 18 May 2026 16:26:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[st]=20-=20fix:=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EB=B0=8F=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B2=84=ED=8A=BC=20=ED=91=9C?= =?UTF-8?q?=EC=B6=9C=20=EC=A1=B0=EA=B1=B4=EC=8B=9D=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=202-6=20&=206-2=20=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=20=EC=97=AC=EB=B6=80=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/SidoSggFacilityNameSearchForm.tsx | 18 ++++- .../input/MainFacilityMappingSaveDialog.tsx | 10 +-- .../input/PublicSewageFacilityInp.tsx | 81 ++++++++++++++----- .../statistics/input/SewagePipeInp.tsx | 11 ++- .../input/SeweragePenetrationRateInp.tsx | 9 ++- .../review/PublicSewageFacilityRvw.tsx | 2 +- .../PublicSewageFactColumn.ts | 4 +- .../review/PublicSewageFacilityRvwColumn.ts | 4 +- .../statistics/api/statistics-service.ts | 10 +++ ...-public-sewage-facility-input-interface.ts | 2 +- .../statistics/model/statistics-interface.ts | 12 +++ 11 files changed, 127 insertions(+), 36 deletions(-) diff --git a/apps/st/src/components/module/SidoSggFacilityNameSearchForm.tsx b/apps/st/src/components/module/SidoSggFacilityNameSearchForm.tsx index 82a1bae17..f32bd5300 100644 --- a/apps/st/src/components/module/SidoSggFacilityNameSearchForm.tsx +++ b/apps/st/src/components/module/SidoSggFacilityNameSearchForm.tsx @@ -334,7 +334,23 @@ const SidoSggFacilityNameSearchForm = ({ } }; - const handleSaveAdminRegions = () => { + const handleSaveAdminRegions = async () => { + const statusCodeResponse = await statisticsApi.CheckStatusCode({ + sewerBzmnCd: initialSearchValues?.bsnmCd?.trim() ?? "", + statsCd: 'ST00020002', + statsYr: statsYr?.trim() ?? '' + }); + + if (statusCodeResponse.status === 'success') { + if (!['0', '1', '4'].includes(statusCodeResponse.data)) { + const codeName = statusCodeResponse.data === '2' ? '제출' : (statusCodeResponse.data === '3' ? '승인' : '검증중'); + alert(`시설별 설치 현황 데이터가 ${codeName} 상태일 때는 처리 시설 정보를 변경할 수 없습니다.`); + return; + } + } else { + alert('오류가 발생했습니다.\n관리자에게 문의하세요') + } + if (!statsYr?.trim()) { alert("상단에서 통계연도로 조회한 뒤 이용해 주세요."); return; diff --git a/apps/st/src/components/statistics/input/MainFacilityMappingSaveDialog.tsx b/apps/st/src/components/statistics/input/MainFacilityMappingSaveDialog.tsx index a1cc85b52..d9f9de404 100644 --- a/apps/st/src/components/statistics/input/MainFacilityMappingSaveDialog.tsx +++ b/apps/st/src/components/statistics/input/MainFacilityMappingSaveDialog.tsx @@ -240,11 +240,6 @@ export function MainFacilityMappingSaveDialog({ - - - + + + diff --git a/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx b/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx index 6735f9752..84ad50646 100644 --- a/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx @@ -87,13 +87,16 @@ function computeTabToolbarSnapshot( ): TabToolbarSnapshot { const gugunOk = buildGugunOkForToolbar(searchContext); const enterable = computeTabEnterable(statusInfo, periodEnterable); + const isSubmitted = statusInfo?.laeSbmsnSttsCd === '2'; const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk; const showEnterableToolbarButtons = enterable && gugunOk; + const showSubmittedInInputPeriodToolbar = isSubmitted && periodEnterable && gugunOk; const showActionToolbarCard = (hasRowData || treatAsSearched) && (showSaveInToolbar || - (statusInfo?.laeSbmsnSttsCd === '2' && - (isAdminInfo || (enterable && gugunOk)))); + showEnterableToolbarButtons || + showSubmittedInInputPeriodToolbar || + (isSubmitted && isAdminInfo)); return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; } @@ -411,6 +414,22 @@ const PublicSewageFacilityInp = () => { } if (activeTab === 'ST00060002') { + const statusCodeResponse = await statisticsApi.CheckStatusCode({ + sewerBzmnCd: lastSearchedValues.bsnmCd ?? '', + statsCd: 'ST00060001', + statsYr: lastSearchedValues.year ?? '' + }); + + if (statusCodeResponse.status === 'success') { + if (!['0', '1', '4'].includes(statusCodeResponse.data)) { + const codeName = statusCodeResponse.data === '2' ? '제출' : (statusCodeResponse.data === '3' ? '승인' : '검증중'); + alert(`공공 하수처리 시설 데이터가 ${codeName} 상태일 때는 중심 처리 시설 데이터를 변경할 수 없습니다.`); + return; + } + } else { + alert('오류가 발생했습니다.\n관리자에게 문의하세요') + } + if (!(await confirm('저장 하시겠습니까?'))) return; const leftRows = rowDataMap.get('MainFacility') ?? []; @@ -980,26 +999,34 @@ const PublicSewageFacilityInp = () => { }; const searchContextForToolbar = lastSearchedValues ?? searchValues; + const gugunOkOrNotDoList = buildGugunOkForToolbar(searchContextForToolbar); const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null; - const activeTabToolbar = - toolbarSnapshotByTab.get(activeTab) ?? - computeTabToolbarSnapshot( - activeTabStatus, - tabRowDataExists(activeTab), - hasSearched, - searchContextForToolbar, - inputPeriodEnterable, - isAdminInfo, - ); + const activeTabToolbar = computeTabToolbarSnapshot( + activeTabStatus, + tabRowDataExists(activeTab), + hasSearched, + searchContextForToolbar, + inputPeriodEnterable, + isAdminInfo, + ); const { showSaveInToolbar: baseShowSaveInToolbar, showEnterableToolbarButtons: baseShowEnterableToolbarButtons, showActionToolbarCard: baseShowActionToolbarCard, } = activeTabToolbar; - const showSaveInToolbar = baseShowSaveInToolbar && toolbarGroupAllowed; - const showEnterableToolbarButtons = baseShowEnterableToolbarButtons && toolbarGroupAllowed; - const showActionToolbarCard = baseShowActionToolbarCard && toolbarGroupAllowed; const isMainFacilityTab = activeTab === 'ST00060002'; + const showMainFacilitySaveInToolbar = + isMainFacilityTab && + tabRowDataExists('ST00060002') && + gugunOkOrNotDoList && + (isAdminInfo || inputPeriodEnterable); + const showSaveInToolbar = + toolbarGroupAllowed && (baseShowSaveInToolbar || showMainFacilitySaveInToolbar); + const showEnterableToolbarButtons = + baseShowEnterableToolbarButtons && toolbarGroupAllowed; + const showActionToolbarCard = + toolbarGroupAllowed && + (baseShowActionToolbarCard || showMainFacilitySaveInToolbar); const openVerificationHistoryDialog = () => { const ctx = lastSearchedValues ?? searchValues; @@ -1037,9 +1064,11 @@ const PublicSewageFacilityInp = () => { {showActionToolbarCard && (
- + {!isMainFacilityTab && ( + + )} {showEnterableToolbarButtons && !isMainFacilityTab && ( <> {showIsNotApplicable && } @@ -1159,13 +1188,25 @@ const PublicSewageFacilityInp = () => { } const gridColumnInfo = getGridColumnInfo(tab); + const tabStatus = tabStatusInfoMap.get(tab.tabKey) ?? null; + const tabEnterableForGrid = computeTabEnterable( + tabStatus, + inputPeriodEnterable, + ); + const excelToolbarEnabledForTab = + tabRowDataExists(tab.tabKey) && + tabEnterableForGrid && + gugunOkOrNotDoList; + return ( { setRowDataMap((prev) => { @@ -1182,6 +1223,8 @@ const PublicSewageFacilityInp = () => { getGridDataRef={ tab.tabKey === 'ST00060001' ? st60001GridGetRowsRef : undefined } + isExcelImport={excelToolbarEnabledForTab} + isExcelExport showHeaderCheckbox={false} enableSort={false} cellStyleCallback={({ row, fieldName }) => { diff --git a/apps/st/src/components/statistics/input/SewagePipeInp.tsx b/apps/st/src/components/statistics/input/SewagePipeInp.tsx index 9329dc967..d8ffdde0d 100644 --- a/apps/st/src/components/statistics/input/SewagePipeInp.tsx +++ b/apps/st/src/components/statistics/input/SewagePipeInp.tsx @@ -332,13 +332,16 @@ function computeTabToolbarSnapshot( ): TabToolbarSnapshot { const gugunOk = buildGugunOkForToolbar(searchContext); const enterable = computeTabEnterable(statusInfo, periodEnterable); + const isSubmitted = statusInfo?.laeSbmsnSttsCd === "2"; const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk; const showEnterableToolbarButtons = enterable && gugunOk; + const showSubmittedInInputPeriodToolbar = isSubmitted && periodEnterable && gugunOk; const showActionToolbarCard = (hasRowData || treatAsSearched) && (showSaveInToolbar || - (statusInfo?.laeSbmsnSttsCd === "2" && - (isAdminInfo || (enterable && gugunOk)))); + showEnterableToolbarButtons || + showSubmittedInInputPeriodToolbar || + (isSubmitted && isAdminInfo)); return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; } @@ -1887,9 +1890,11 @@ const SewagePipeInp = () => { const rightRowData = rowDataMap.get(rightKey) ?? []; const splitTopButton = info.right.topButton; const showSplitTopButton = + activeTab === tabKey && Boolean(splitTopButton?.text) && (splitTopButton?.visible ?? true) && - excelToolbarEnabledForTab; + tabRowDataExists(rowDataMap, tabKey) && + gugunOkOrNotDoList; const leftColumnInfo: ColumnInfo = { columns: info.left.columns ?? [], columnLayout: info.left.columnLayout ?? [], diff --git a/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx b/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx index 2e0f318f9..4193f2535 100644 --- a/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx +++ b/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx @@ -748,16 +748,21 @@ const SeweragePenetrationRateInp = () => { ? Boolean(lastSearchedValues?.gugun && lastSearchedValues.gugun !== 'ALL') : true; + const inputPeriodCurrent = isInputPeriodCurrent(periodCheckList); + const isSubmitted = statusInfo?.laeSbmsnSttsCd === '2'; const baseShowSaveInToolbar = (isEnterable || isAdminInfo) && gugunOkOrNotDoList; const baseShowEnterableToolbarButtons = isEnterable && gugunOkOrNotDoList; + const showSubmittedInInputPeriodToolbar = + isSubmitted && inputPeriodCurrent && gugunOkOrNotDoList; const showSaveInToolbar = baseShowSaveInToolbar && toolbarGroupAllowed; const showEnterableToolbarButtons = baseShowEnterableToolbarButtons && toolbarGroupAllowed; - /** 카드는 저장/제출줄/제출취소 중 하나라도 보일 때만 (관리자만으로 빈 카드 방지) */ const showActionToolbarCard = rowData.length > 0 && toolbarGroupAllowed && (baseShowSaveInToolbar || - (statusInfo?.laeSbmsnSttsCd === '2' && (isAdminInfo || (isEnterable && gugunOkOrNotDoList)))); + baseShowEnterableToolbarButtons || + showSubmittedInInputPeriodToolbar || + (isSubmitted && isAdminInfo)); return ( <> diff --git a/apps/st/src/components/statistics/review/PublicSewageFacilityRvw.tsx b/apps/st/src/components/statistics/review/PublicSewageFacilityRvw.tsx index 37dff9b7e..6d23f3c87 100644 --- a/apps/st/src/components/statistics/review/PublicSewageFacilityRvw.tsx +++ b/apps/st/src/components/statistics/review/PublicSewageFacilityRvw.tsx @@ -120,7 +120,7 @@ const PublicSewageFacilityRvw = () => { const rawList = response.data.publicSewageList; const convertedData: PublicSewageFacilityReviewItem[] = rawList.map((item) => ({ ...item, - impdFcltPstnCn: item.fcltPstnCn ?? "", + fcltPstnCn: item.fcltPstnCn ?? "", prxyBzentyNmCn: item.prxyBzentyNmCn ?? "", prxyCtrtCn: item.prxyCtrtCn ?? "", intgPrcsFcltCn: item.intgPrcsFcltCn ?? "", diff --git a/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts b/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts index fa2f73317..db0c550ff 100644 --- a/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts +++ b/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts @@ -15,7 +15,7 @@ export const PublicSewageFactColumn = { { name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' }, editable: false, styleName: 'rg-cell-readonly' }, // 소재지 - { name: 'impdFcltPstnCn', fieldName: 'impdFcltPstnCn', header: { text: '소재지' }, editable: false, styleName: 'rg-cell-readonly' }, + { name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' }, editable: false, styleName: 'rg-cell-readonly' }, // 시설용량 { name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(500m³/일 이상/미만)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-total' }, @@ -126,7 +126,7 @@ export const PublicSewageFactColumn = { items: ['ctpvNm', 'sggNm'], }, 'swtrmtFcltNm', - 'impdFcltPstnCn', + 'fcltPstnCn', 'prcsFcltCpct', { name: 'facilityCapacityDetail', diff --git a/apps/st/src/components/util/column/review/PublicSewageFacilityRvwColumn.ts b/apps/st/src/components/util/column/review/PublicSewageFacilityRvwColumn.ts index cbfec445a..d02b5360b 100644 --- a/apps/st/src/components/util/column/review/PublicSewageFacilityRvwColumn.ts +++ b/apps/st/src/components/util/column/review/PublicSewageFacilityRvwColumn.ts @@ -49,7 +49,7 @@ export const rawPublicSewageFacilityInfoList = { ], }, { name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' } }, - { name: 'impdFcltPstnCn', fieldName: 'impdFcltPstnCn', header: { text: '소재지' } }, + { name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' } }, /* 2. 시설용량 (㎥/일) */ { name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(500m³/일 이상/미만)' }, footer: footerDecimal1ArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' }, @@ -132,7 +132,7 @@ export const rawPublicSewageFacilityInfoList = { header: { text: '행정구역' }, items: [{ column: 'ctpvNm', footerUserSpans: [{ colspan: 3 }, { colspan: 3 }] }, 'sggNm'], }, - 'displayYear', 'swtrmtFcltNm', 'impdFcltPstnCn', 'prcsFcltCpct', + 'displayYear', 'swtrmtFcltNm', 'fcltPstnCn', 'prcsFcltCpct', { name: 'groupB', header: { text: '시설용량(㎥/일)' }, diff --git a/apps/st/src/entities/statistics/api/statistics-service.ts b/apps/st/src/entities/statistics/api/statistics-service.ts index fc36b73c8..7186240c4 100644 --- a/apps/st/src/entities/statistics/api/statistics-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-service.ts @@ -5,6 +5,8 @@ import { type ApiResponse, type cancelSubmitRequest, type cancelSubmitResponse, + type CheckStatusCodeRequest, + type CheckStatusCodeResponse, type getReviewOpinionDetailRequest, type getReviewOpinionDetailResponse, type ImrRequest, @@ -321,6 +323,14 @@ export class StatisticsApiService implements StatisticsService { ); return response.data; } + + public async CheckStatusCode(param: CheckStatusCodeRequest): Promise { + const response = await stClient.get( + `${ENDPOINT.ST_SERVICE.INPUTCOMMON}/status-code`, + { params: param }, + ); + return response.data; + } } export const statisticsApi = new StatisticsApiService(); diff --git a/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts index 328818e48..093ea859b 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts @@ -37,7 +37,7 @@ export interface PublicSewageFacilityItem { fcltSn: number; swtrmtFcltCd: string; swtrmtFcltNm: string; - impdFcltPstnCn: string | null; + fcltPstnCn: string | null; prcsFcltCpct: number; prcsFcltPhysCpct: number; prcsFcltBoilCpct: number; diff --git a/apps/st/src/entities/statistics/model/statistics-interface.ts b/apps/st/src/entities/statistics/model/statistics-interface.ts index 464c391c4..5081952c7 100644 --- a/apps/st/src/entities/statistics/model/statistics-interface.ts +++ b/apps/st/src/entities/statistics/model/statistics-interface.ts @@ -475,6 +475,17 @@ export interface StatiscicsExceptionResetResponse { message?: string; } +export interface CheckStatusCodeRequest { + statsCd: string; + statsYr: string; + sewerBzmnCd: string; +} + +export interface CheckStatusCodeResponse { + status: string; + data: string; +} + export interface StatisticsService { getSidoList(params?: { instSeCd?: string }): Promise>; getSggList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise>; @@ -504,4 +515,5 @@ export interface StatisticsService { getReviewerInfo(param: ReviewerInfoRequest): Promise; getStatiscicsManagementReviewHistory(param: StatiscicsManagementReviewHistoryRequest): Promise; StatiscicsExceptionReset(param: StatiscicsExceptionResetRequest): Promise; + CheckStatusCode(param: CheckStatusCodeRequest): Promise; } \ No newline at end of file From 404624a583c01c0e67d5d14088d8c77ea4e98cc9 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Mon, 18 May 2026 16:57:18 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[st]=20-=20fix:=20=ED=86=B5=EA=B3=84?= =?UTF-8?q?=EC=9D=B4=EB=A0=A5=EC=A1=B0=ED=9A=8C=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../input/ExcretaTreatmentFacilityInp.tsx | 2 +- .../input/PrivateSewageFacilityInp.tsx | 2 +- .../statistics/input/PumpingStationInp.tsx | 2 +- .../input/SewageExcretaRelatedInp.tsx | 2 +- .../input/SewageExcretaSlurgeInp.tsx | 2 +- .../input/SewageReservoirPumpInp.tsx | 122 ++++++++++++------ .../statistics/input/SewerageFinanceInp.tsx | 2 +- .../input/SewerageServiceLevelInp.tsx | 2 +- .../StatisticsReviewHistory.tsx | 0 .../statistics/input/WaterReuseInp.tsx | 2 +- 10 files changed, 89 insertions(+), 49 deletions(-) rename apps/st/src/components/statistics/{management => input}/StatisticsReviewHistory.tsx (100%) diff --git a/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx b/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx index 94fbb6a3e..626682536 100644 --- a/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { DataGrid } from "@rsone/components"; +import DataGrid from "@/components/module/DataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import LastYearDataButton from "@/components/button/LastYearDataButton"; diff --git a/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx b/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx index 0dabb52c8..b430d6584 100644 --- a/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from "@rsone/components"; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; diff --git a/apps/st/src/components/statistics/input/PumpingStationInp.tsx b/apps/st/src/components/statistics/input/PumpingStationInp.tsx index 2261a8eac..001d3ba4b 100644 --- a/apps/st/src/components/statistics/input/PumpingStationInp.tsx +++ b/apps/st/src/components/statistics/input/PumpingStationInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { DataGrid } from '@rsone/components'; +import DataGrid from "@/components/module/DataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import LastYearDataButton from "@/components/button/LastYearDataButton"; diff --git a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx index 726d5718a..b4470e438 100644 --- a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx +++ b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from "@rsone/components"; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; diff --git a/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx b/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx index a4ab5c947..6df8ce665 100644 --- a/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx +++ b/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from "@rsone/components"; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; diff --git a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx index 1ea0892c5..88d92eeaf 100644 --- a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx +++ b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx @@ -1,85 +1,125 @@ import { useState } from "react"; -import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from '@rsone/components'; -import SubmitButton from "@/components/button/SumitButton"; -import SaveButton from "@/components/button/SaveButton"; -import LastYearDataButton from "@/components/button/LastYearDataButton"; -import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components"; + import AddArticleButton from "@/components/button/AddArticleButton"; import DeleteArticleButton from "@/components/button/DeleteArticleButton"; +import LastYearDataButton from "@/components/button/LastYearDataButton"; import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton"; - -import { SewageReservoirInpColumn } from "@/components/util/column/input/sewageReservoirPump/SewageReservoirInpColumn"; +import SaveButton from "@/components/button/SaveButton"; +import SubmitButton from "@/components/button/SumitButton"; +import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; +import DataGrid from "@/components/module/DataGrid"; +import SearchForm from "@/components/module/SearchForm"; +import type { ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type"; import { RainfallPumpStationInpColumn } from "@/components/util/column/input/sewageReservoirPump/RainfallPumpStationInpColumn"; +import { SewageReservoirInpColumn } from "@/components/util/column/input/sewageReservoirPump/SewageReservoirInpColumn"; + +const SewageReservoirPumpInpTabList = [ + SewageReservoirInpColumn, + RainfallPumpStationInpColumn, +] as ColumnInfoList[]; + +const toGridColumnInfo = (tab: ColumnInfoList): ColumnInfo => ({ + columns: tab.columns ?? [], + columnLayout: tab.columnLayout ?? [], +}); + +const firstTabKey = SewageReservoirPumpInpTabList[0]?.tabKey ?? "sewageReservoirInp"; // 하수도 통계 관리 > 04. 하수저류 시설 및 빗물 펌프장 const SewageReservoirPumpInp = () => { - - // tab List - const SewageReservoirPumpInpTabList = [ - SewageReservoirInpColumn, - RainfallPumpStationInpColumn - ]; - const submitExceptionFunc = () => { - console.log('submit exception'); + console.log("submit exception"); // 예외 제출 로직 }; const getLastYearDataFunc = () => { - console.log('get last year data'); + console.log("get last year data"); // 지난연도 데이터 가져오기 로직 }; const submitFunc = () => { - console.log('submit'); + console.log("submit"); // 제출 로직 }; const saveFunc = () => { - console.log('save'); + console.log("save"); // 저장 로직 }; const addArticleFunc = () => { - console.log('save'); + console.log("save"); // 항목 추가 로직 }; const deleteArticleFunc = () => { - console.log('save'); + console.log("save"); // 항목 제외 로직 }; + const [activeTab, setActiveTab] = useState(firstTabKey); const [rowDataMap, setRowDataMap] = useState[]>>(new Map()); const [isNotApplicable, setIsNotApplicable] = useState(false); - + return ( <> - -
-
- - - - +
+ +
+
+ + + + +
-
-
-
- - - +
+
+ + + +
+ + + {SewageReservoirPumpInpTabList.map((tab) => ( + + {tab.tabLabel || tab.tabKey} + + ))} + + {SewageReservoirPumpInpTabList.map((tab) => { + const tabKey = tab.tabKey ?? ""; + return ( + + { + setRowDataMap((prev) => { + const next = new Map(prev); + const cur = next.get(tabKey) ?? []; + const n = + typeof updater === "function" + ? (updater as (p: Record[]) => Record[])(cur) + : updater; + next.set(tabKey, n); + return next; + }); + }} + showHeaderCheckbox={false} + /> + + ); + })} +
- ); }; -export default SewageReservoirPumpInp; \ No newline at end of file +export default SewageReservoirPumpInp; diff --git a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx index c1c2177de..3f3d57f4e 100644 --- a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx +++ b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from '@rsone/components'; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; diff --git a/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx b/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx index 7ce370bbb..f79b2e667 100644 --- a/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx +++ b/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from '@rsone/components'; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import LastYearDataButton from "@/components/button/LastYearDataButton"; diff --git a/apps/st/src/components/statistics/management/StatisticsReviewHistory.tsx b/apps/st/src/components/statistics/input/StatisticsReviewHistory.tsx similarity index 100% rename from apps/st/src/components/statistics/management/StatisticsReviewHistory.tsx rename to apps/st/src/components/statistics/input/StatisticsReviewHistory.tsx diff --git a/apps/st/src/components/statistics/input/WaterReuseInp.tsx b/apps/st/src/components/statistics/input/WaterReuseInp.tsx index 2479ef030..26798d169 100644 --- a/apps/st/src/components/statistics/input/WaterReuseInp.tsx +++ b/apps/st/src/components/statistics/input/WaterReuseInp.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import SearchForm from "@/components/module/SearchForm"; -import { TabDataGrid } from '@rsone/components'; +import TabDataGrid from "@/components/module/TabDataGrid"; import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import LastYearDataButton from "@/components/button/LastYearDataButton"; From ac75188980f55e71164d269608ee8634e8cbc271 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Mon, 18 May 2026 17:02:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[st]=20-=20fix:=20DataGrid=20height=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/st/src/components/module/CompactDataGrid.tsx | 2 +- apps/st/src/components/module/DataGrid.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/st/src/components/module/CompactDataGrid.tsx b/apps/st/src/components/module/CompactDataGrid.tsx index 6de651a1d..f7d66477d 100644 --- a/apps/st/src/components/module/CompactDataGrid.tsx +++ b/apps/st/src/components/module/CompactDataGrid.tsx @@ -116,7 +116,7 @@ const CompactDataGrid = ({ onItemChecked, onItemAllChecked, compactFullWidth = false, - compactGridHeightClass = "h-[65vh]", + compactGridHeightClass = "h-[55vh]", }: DataGridProps) => { const { columns, columnLayout } = columnInfo; const gridRef = useRef(null); diff --git a/apps/st/src/components/module/DataGrid.tsx b/apps/st/src/components/module/DataGrid.tsx index f32d3d72d..d5d334269 100644 --- a/apps/st/src/components/module/DataGrid.tsx +++ b/apps/st/src/components/module/DataGrid.tsx @@ -408,7 +408,7 @@ const DataGrid = ({ highlightedRowId, idFieldName = "id", enableSort = false, - gridHeight = 65, // vh 단위 + gridHeight = 55, // vh 단위 }: DataGridProps) => { const { columns, columnLayout } = columnInfo; const gridRef = useRef(null);