wr: 중수도 단위, 모달 조회 순서, 시설구분 조회
This commit is contained in:
+4
-2
@@ -8,8 +8,10 @@ NEXT_PUBLIC_PROXY_HOST = http://localhost:3000
|
||||
NEXT_PUBLIC_SUB_DOMAIN = http://localhost:13000
|
||||
#NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://localhost:3001/auth/login
|
||||
SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1
|
||||
FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1
|
||||
WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
|
||||
# FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1
|
||||
FO_SERVER_API_URL = http://localhost:3000/operation-service/api/v1
|
||||
# WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
|
||||
WR_SERVER_API_URL = http://localhost:3000/reuse-service/api/v1
|
||||
CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
|
||||
@@ -237,6 +237,26 @@ export const COD_YEAR = 2021;
|
||||
* STORE - API
|
||||
*/
|
||||
|
||||
/** API 선택 목록을 값 기준으로 정규화하고 프런트 표준 전체 항목을 한 번만 추가한다. */
|
||||
const normalizeSelectData = (items: SelectDataType[]): SelectDataType[] => {
|
||||
const uniqueItems = new Map<string, SelectDataType>();
|
||||
|
||||
items.forEach((item) => {
|
||||
const val = String(item.val ?? '').trim();
|
||||
if (!val || val === '0' || uniqueItems.has(val)) return;
|
||||
|
||||
uniqueItems.set(val, {
|
||||
...item,
|
||||
val,
|
||||
});
|
||||
});
|
||||
|
||||
return [
|
||||
{ text: '전체', val: '0' },
|
||||
...uniqueItems.values(),
|
||||
];
|
||||
};
|
||||
|
||||
// 처리시설 계획정보 호출 (알에스원)
|
||||
export const planInfoUrl = '/dc-service/api/v1/nowDmgMtncGnsvy';
|
||||
|
||||
@@ -263,13 +283,12 @@ const fetchSidoData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/city');
|
||||
const data = res.data;
|
||||
selectSidoData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...data.map((item: sidoDataType) => ({
|
||||
selectSidoData = normalizeSelectData(
|
||||
data.map((item: sidoDataType) => ({
|
||||
text: item.sido || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
];
|
||||
})),
|
||||
);
|
||||
return selectSidoData;
|
||||
} catch (error) {
|
||||
console.error('시도 데이터를 가져오는데 실패했습니다:', error);
|
||||
@@ -282,14 +301,12 @@ const fetchSigunData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/sgg');
|
||||
const data = res.data;
|
||||
selectSigunData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: sigunDataType) => ({
|
||||
text: item.gugun || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
];
|
||||
selectSigunData = normalizeSelectData(
|
||||
data.map((item: sigunDataType) => ({
|
||||
text: item.gugun || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
})),
|
||||
);
|
||||
return selectSigunData;
|
||||
} catch (error) {
|
||||
console.error('시군구 데이터를 가져오는데 실패했습니다:', error);
|
||||
@@ -302,13 +319,12 @@ const fetchRegionData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/sarea');
|
||||
const data = res.data;
|
||||
return [
|
||||
{ text: "전체", val: '0' },
|
||||
...data.map((item: regionDataType) => ({
|
||||
return normalizeSelectData(
|
||||
data.map((item: regionDataType) => ({
|
||||
text: item.rvbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
})),
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectRegionData;
|
||||
|
||||
+6
-6
@@ -7,16 +7,16 @@ NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
NEXT_PUBLIC_PROXY_HOST = http://localhost:3001
|
||||
NEXT_PUBLIC_SUB_DOMAIN = http://localhost:13000
|
||||
SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1
|
||||
# FO_SERVER_API_URL = http://localhost:8883/operation-service/api/v1
|
||||
# FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1
|
||||
FO_SERVER_API_URL = http://localhost:8883/operation-service/api/v1
|
||||
CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
|
||||
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
|
||||
# WR_SERVER_API_URL = http://localhost:8883/reuse-service/api/v1
|
||||
SEWERAGE_API_URL = http://con.mind-one.co.kr:11083/sewerage-service # 개발 서버 API
|
||||
# SEWERAGE_API_URL=http://localhost:8883/sewerage-service
|
||||
# WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
|
||||
WR_SERVER_API_URL = http://localhost:8883/reuse-service/api/v1
|
||||
# SEWERAGE_API_URL = http://con.mind-one.co.kr:11083/sewerage-service # 개발 서버 API
|
||||
SEWERAGE_API_URL=http://localhost:8883/sewerage-service
|
||||
NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr
|
||||
NEXT_PUBLIC_NGII_PARAM = 04trYP9_xwLAfALjwZ-B8g&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={x}&tilerow={y}
|
||||
# NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function Page() {
|
||||
isRainSttn, // 빗물이용시설 상세/선택 상태 초기화
|
||||
rswtChkgdnInit, // 중수도시설 지도점검 목록 초기 조회
|
||||
rswtChkNmSearch, // 중수도시설명으로 목록 조회
|
||||
rswtChkPolInit, // 중수도 시설구분 변경 시 조회조건 초기화
|
||||
rswtChkPolInit, // 중수도 시설구분 조회 시 상세 조회조건 초기화
|
||||
rswtChkDetilsUpdate, // 중수도시설 지도점검 상세 수정 저장
|
||||
rswtChkDelete, // 중수도시설 지도점검 선택 건 삭제
|
||||
rswtrChkExcelDownload, // 중수도시설 지도점검 엑셀 양식/데이터 조회
|
||||
@@ -80,6 +80,8 @@ export default function Page() {
|
||||
const [rswtPageNation, setRswtPageNation] = useState(1);
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RNB");
|
||||
// 검색 조건에서 선택한 시설구분과 실제 조회·표시 중인 시설구분을 분리한다.
|
||||
const [appliedFcltDiv, setAppliedFcltDiv] = useState("RNB");
|
||||
const [isModal, setIsModal] = useState({
|
||||
open: false,
|
||||
data: {},
|
||||
@@ -107,7 +109,9 @@ export default function Page() {
|
||||
|
||||
|
||||
const cellClick = () => {
|
||||
if (searchYear)
|
||||
if (searchYear) {
|
||||
if (selFcltDiv === "RST") rswtChkPolInit();
|
||||
setAppliedFcltDiv(selFcltDiv);
|
||||
if (selFcltDiv === "RNB") { // 빗물
|
||||
if (fcltNm) {
|
||||
rainChkNmSearch( rainPageNation, rainPageSize, searchYear, laeSeCd, fcltNm );
|
||||
@@ -123,6 +127,7 @@ export default function Page() {
|
||||
rswtChkgdnInit(rswtPageNation, rswtPageSize, searchYear, laeSeCd);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const rainPageChange = (pageNo: number) => {
|
||||
@@ -176,13 +181,13 @@ export default function Page() {
|
||||
}, [rainChkgdn.excelList]);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
if (selFcltDiv === "RNB") {
|
||||
if (appliedFcltDiv === "RNB") {
|
||||
rainChkExcelDownload(code.cityCd, code.sggCd,laeSeCd);
|
||||
} else {
|
||||
rswtrChkExcelDownload(code.cityCd, code.sggCd,laeSeCd);
|
||||
}
|
||||
},
|
||||
[ rainChkExcelDownload, rswtrChkExcelDownload, code.cityCd, code.sggCd, selFcltDiv, laeSeCd ]
|
||||
[ rainChkExcelDownload, rswtrChkExcelDownload, code.cityCd, code.sggCd, appliedFcltDiv, laeSeCd ]
|
||||
);
|
||||
|
||||
const handleClick = useCallback(
|
||||
@@ -274,7 +279,6 @@ export default function Page() {
|
||||
selectClass={""}
|
||||
selectArray={rainChkgdn.fcltDiv}
|
||||
onSelectValue={(val: string | number) => {
|
||||
if (val === "RST") rswtChkPolInit();
|
||||
setSelFcltDiv(String(val));
|
||||
}}
|
||||
value={selFcltDiv ?? rainChkgdn.fcltDiv[0]?.val}
|
||||
@@ -306,7 +310,7 @@ export default function Page() {
|
||||
<Button
|
||||
className={btnClass}
|
||||
onClick={() => {
|
||||
void clickDelete(deleteIdx, selFcltDiv);
|
||||
void clickDelete(deleteIdx, appliedFcltDiv);
|
||||
}}
|
||||
disabled={delAuthrtYn === 'N'}
|
||||
>
|
||||
@@ -319,7 +323,7 @@ export default function Page() {
|
||||
<Button
|
||||
className={btnClass}
|
||||
onClick={() => {
|
||||
void chkUpdateTable(selFcltDiv);
|
||||
void chkUpdateTable(appliedFcltDiv);
|
||||
}}
|
||||
disabled={mdfcnAuthrtYn === 'N'}
|
||||
>
|
||||
@@ -355,7 +359,7 @@ export default function Page() {
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-6">
|
||||
<ListDiv>
|
||||
{selFcltDiv === "RNB" ? (
|
||||
{appliedFcltDiv === "RNB" ? (
|
||||
<RainChkgdTable
|
||||
deleteData={setDeleteIdx}
|
||||
detailUp={setUpdateRainDetail}
|
||||
@@ -392,7 +396,7 @@ export default function Page() {
|
||||
bodyClass={"w-[80vw] max-w-none"}
|
||||
body={
|
||||
<ChkgdModal
|
||||
type={selFcltDiv}
|
||||
type={appliedFcltDiv}
|
||||
obj={isModal.data}
|
||||
setIsModal={(open) => setIsModal((prev) => ({ ...prev, open }))}
|
||||
readonly={mdfcnAuthrtYn === 'N' ? false : true}
|
||||
@@ -405,7 +409,7 @@ export default function Page() {
|
||||
bodyClass={"w-[30vw] max-w-none"}
|
||||
body={
|
||||
<ChkgdExcel
|
||||
type={selFcltDiv}
|
||||
type={appliedFcltDiv}
|
||||
setIsRegExcel={setIsRegExcel}
|
||||
setYearChange={(year) => {
|
||||
setSearchYear(year);
|
||||
|
||||
@@ -57,6 +57,8 @@ export default function Page() {
|
||||
const fixedSigunValue =
|
||||
!isAllAreaUser && laeSeCd?.length === 5 ? laeSeCd : "0";
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RNB");
|
||||
// 검색 조건에서 선택한 시설구분과 실제 조회·표시 중인 시설구분을 분리한다.
|
||||
const [appliedFcltDiv, setAppliedFcltDiv] = useState("RNB");
|
||||
const [rainPageNation, setRainPageNation] = useState(1);
|
||||
const [rswtPageNation, setRswtPageNation] = useState(1);
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
@@ -118,6 +120,8 @@ export default function Page() {
|
||||
|
||||
const conValue = getFixedConValue();
|
||||
if (searchYear) {
|
||||
if (selFcltDiv === "RST") rswtChkPolInit();
|
||||
setAppliedFcltDiv(selFcltDiv);
|
||||
if (selFcltDiv === "RNB") {
|
||||
if (fcltNm) {
|
||||
rainChkSttnNmSearch(
|
||||
@@ -248,7 +252,7 @@ export default function Page() {
|
||||
const { t } = useTranslation("base");
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const excelDown = () => {
|
||||
if (rainChkSttn.sttnExcelList && selFcltDiv === "RNB") {
|
||||
if (rainChkSttn.sttnExcelList && appliedFcltDiv === "RNB") {
|
||||
if (
|
||||
!rainChkSttn.sttnExcelList ||
|
||||
rainChkSttn.sttnExcelList.length === 0
|
||||
@@ -270,7 +274,7 @@ export default function Page() {
|
||||
"sample_rainChkSttn.xlsx",
|
||||
sheetArray
|
||||
);
|
||||
} else if (rswtChkSttn.sttnExcelList && selFcltDiv === "RST") {
|
||||
} else if (rswtChkSttn.sttnExcelList && appliedFcltDiv === "RST") {
|
||||
if (
|
||||
!rswtChkSttn.sttnExcelList ||
|
||||
rswtChkSttn.sttnExcelList.length === 0
|
||||
@@ -361,7 +365,6 @@ export default function Page() {
|
||||
selectClass={""}
|
||||
selectArray={rainChkSttn.fcltDiv}
|
||||
onSelectValue={(val: string | number) => {
|
||||
if (val === "RST") rswtChkPolInit();
|
||||
setSelFcltDiv(String(val));
|
||||
}}
|
||||
value={selFcltDiv ?? rainChkSttn.fcltDiv[0]?.val}
|
||||
@@ -410,7 +413,7 @@ export default function Page() {
|
||||
<ListDiv>
|
||||
<div className="h-full w-full overflow-x-scroll min-[1900px]:overflow-x-hidden">
|
||||
<div className="w-[160%] min-[1900px]:w-[100%]">
|
||||
{selFcltDiv === "RNB" ? (
|
||||
{appliedFcltDiv === "RNB" ? (
|
||||
<RainChkgdTable
|
||||
deleteData={() => {}}
|
||||
detailUp={() => {}}
|
||||
@@ -447,7 +450,7 @@ export default function Page() {
|
||||
body={
|
||||
<ChkgdModal
|
||||
readonly={true}
|
||||
type={selFcltDiv}
|
||||
type={appliedFcltDiv}
|
||||
obj={isModal.data}
|
||||
setIsModal={() => {}}
|
||||
/>
|
||||
|
||||
@@ -150,7 +150,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [
|
||||
{ id: "splyUswtrUtztnQnt", title: "연간대체수이용량(m³)" ,type: "number", widthPercent: 5 },
|
||||
{ id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)",type: "number", widthPercent: 5 },
|
||||
{ id: "grssClfgUswtr", title: "총대장균군수(개/100㎖)", upName: "useQuilty", upSequnce: 1 ,type: "number", widthPercent: 6 },
|
||||
{ id: "combResdch", title: "결합잔류염소(mh/L)", upName: "useQuilty", upSequnce: 2 ,type: "number", widthPercent: 6 },
|
||||
{ id: "combResdch", title: "결합잔류염소(mg/L)", upName: "useQuilty", upSequnce: 2 ,type: "number", widthPercent: 6 },
|
||||
{ id: "trbt", title: "탁도(NTU)", upName: "useQuilty", upSequnce: 3 ,type: "number", widthPercent: 4 },
|
||||
{ id: "bod", title: "BOD\n(mg/L)", upName: "useQuilty", upSequnce: 4 ,type: "number", widthPercent: 4 },
|
||||
{ id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5 ,type: "text", widthPercent: 4 },
|
||||
|
||||
@@ -15,7 +15,7 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [
|
||||
{ id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)", type: "number", widthPercent: 5 },
|
||||
|
||||
{ id: "grssClfgUswtr", title: "총대장균군수(개/100㎖)", upName: "useQuilty", upSequnce: 1, type: "number", widthPercent: 6 },
|
||||
{ id: "combResdch", title: "결합잔류염소(mh/L)", upName: "useQuilty", upSequnce: 2, type: "number", widthPercent: 6 },
|
||||
{ id: "combResdch", title: "결합잔류염소(mg/L)", upName: "useQuilty", upSequnce: 2, type: "number", widthPercent: 6 },
|
||||
{ id: "trbt", title: "탁도(NTU)", upName: "useQuilty", upSequnce: 3, type: "number", widthPercent: 4 },
|
||||
{ id: "bod", title: "BOD (mg/L)", upName: "useQuilty", upSequnce: 4, type: "number", widthPercent: 4 },
|
||||
{ id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5, type: "text", widthPercent: 4 },
|
||||
|
||||
@@ -297,25 +297,6 @@ export default function ChkgdModal({
|
||||
</div>
|
||||
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{`연간대체수이용량`}
|
||||
</h3>
|
||||
</div>
|
||||
<GuideDetailsTable
|
||||
chgRes={guidData || []}
|
||||
headList={headList.splHeadList}
|
||||
upheadList={
|
||||
type === "RNB"
|
||||
? rainChkgdn.rainSplHeadNm
|
||||
: rswtChkgdn.rswtSplHeadNm
|
||||
}
|
||||
type={""}
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{type === "RNB" ? `연간빗물 이용량` : "연간중수도 이용량"}
|
||||
@@ -335,6 +316,25 @@ export default function ChkgdModal({
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{`연간대체수이용량`}
|
||||
</h3>
|
||||
</div>
|
||||
<GuideDetailsTable
|
||||
chgRes={guidData || []}
|
||||
headList={headList.splHeadList}
|
||||
upheadList={
|
||||
type === "RNB"
|
||||
? rainChkgdn.rainSplHeadNm
|
||||
: rswtChkgdn.rswtSplHeadNm
|
||||
}
|
||||
type={""}
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
{type !== "RNB" && polutionData !== undefined ? (
|
||||
<div key={"polutionData"}>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user