Merge branch 'iipbs/wr/dev'
This commit is contained in:
+32
-10
@@ -1,17 +1,39 @@
|
||||
# NEXT_PUBLIC_SITE_ID = WR
|
||||
# NEXT_PUBLIC_PORT = 3000
|
||||
# NEXT_PUBLIC_PROXY_HOST = http://wr.hasuon.or.kr
|
||||
# NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/api/v1
|
||||
# NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/operation-service/api/v1
|
||||
# NEXT_PUBLIC_CS_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000
|
||||
# NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
|
||||
# NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/geoserver
|
||||
# NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl
|
||||
# NEXT_PUBLIC_CLAIM_NAME = Authorization
|
||||
# NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||
# NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||
# NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
|
||||
# NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/sewerage-service/api
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NEXT_PUBLIC_SITE_ID = WR
|
||||
NEXT_PUBLIC_PORT = 3000
|
||||
NEXT_PUBLIC_PROXY_HOST = http://wr.hasuon.or.kr
|
||||
NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/api/v1
|
||||
NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/operation-service/api/v1
|
||||
NEXT_PUBLIC_CS_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000
|
||||
NEXT_PUBLIC_PORT = 11301
|
||||
NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11301
|
||||
# NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
|
||||
NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
|
||||
NEXT_PUBLIC_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 = http://172.29.143.87:8080/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl
|
||||
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
||||
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/sewerage-service/api
|
||||
|
||||
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
|
||||
@@ -7,12 +7,14 @@ import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
import { fetchType, getFetch, postFectch } from "@/components/lib/api";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { formatPhoneNumber, tableData } from "@/components/lib/func/commom";
|
||||
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
|
||||
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
|
||||
import { Title, UITab, UiTable } from '@common/business_components';
|
||||
import { useGisContext } from "@common/business_components/ui/map/Gis";
|
||||
import type { DemandCompType } from '@common/business_components/ui/sdmInsertForm/form';
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import moment from 'moment';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
interface NewWindowPopupProps {
|
||||
@@ -74,7 +76,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
|
||||
// 온배수시설 변수
|
||||
const { htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore((state) => state);
|
||||
const { htdflSttnRes,htdflSttnResCount } = htdflSttn;
|
||||
const { htdflSttnRes, htdflSttnResCount } = htdflSttn;
|
||||
const [htdflTable, setHtdflTable] = useState<customHtdflBdst[]>();
|
||||
const [htdflDetailModal, setHtdflDetailModal] = useState<{ isOpen: boolean, data: customHtdflBdst | undefined }>({ data: undefined, isOpen: false });
|
||||
const [htdflPage, setHtdflPage] = useState(1)
|
||||
@@ -92,11 +94,31 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
}>({ data: undefined });
|
||||
const [hasuTable, setHasuTable] = useState<pubHasuType[]>();
|
||||
const [hasuPage, setHasuPage] = useState<number>(1);
|
||||
|
||||
// 수요처관리 변수
|
||||
const {
|
||||
coSttn,
|
||||
coSttnInit,
|
||||
coSttnSearch,
|
||||
// getDemandCompList,
|
||||
// regDemandCompany,
|
||||
// updateDemandCompany,
|
||||
// coSttnTxtSearch,
|
||||
// demandCompList,
|
||||
} = useWrStore((state) => state);
|
||||
const [mngTable, setMngTable] = useState<DemandCompType[]>();
|
||||
const [mngPage, setMngPage] = useState(1);
|
||||
const { coSttnRes, coSttnResCount, coSttHeadList } = coSttn;
|
||||
const [isDmdModal, setIsDmdModal] = useState<{
|
||||
isMoal: boolean;
|
||||
data: any | undefined;
|
||||
}>({ isMoal: false, data: undefined});
|
||||
const [mngList, setMngList] = useState<DemandCompType[]>(coSttnRes || []);
|
||||
///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
|
||||
const getSelectedLayers = () => {
|
||||
let result = null;
|
||||
const layers = gisMap ? gisMap.getLayers().getArray().filter((l: any) => l.getVisible()) : []; // gisMap이 null인지 확인 후 레이어 가져오기
|
||||
let featureLayer: { get: (key: string) => any } = {get:()=> null};
|
||||
let featureLayer: { get: (key: string) => any } = { get: () => null };
|
||||
layers.forEach((layer: any) => {
|
||||
const source = layer.getSource();
|
||||
if (source && source.hasFeature && featureData
|
||||
@@ -122,13 +144,13 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
const rainRes = await postFectch(`/prcsFclt/ruseInfo/1/10/A/0/0/1/SW/${featureCd}`, [data], fetchType.COMMON)
|
||||
setHasuList(
|
||||
rainRes.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
fctCpc: Number(item.fctCpc) || 0,
|
||||
ruse: item.ruse === false ? "N" : "Y",
|
||||
};
|
||||
})
|
||||
)
|
||||
return {
|
||||
...item,
|
||||
fctCpc: Number(item.fctCpc) || 0,
|
||||
ruse: item.ruse === false ? "N" : "Y",
|
||||
};
|
||||
})
|
||||
)
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
}
|
||||
@@ -138,56 +160,63 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/rainyInfoList/1/20/0/${featureCd}`)
|
||||
setRainList(res)
|
||||
}
|
||||
else if(layerNm == '중수도시설'){
|
||||
const res = await getFetch(fetchType.WR,`/reuseFc/waterreuseFc/1/20/0/${featureCd}`)
|
||||
else if (layerNm == '중수도시설') {
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/waterreuseFc/1/20/0/${featureCd}`)
|
||||
setRswtrList(res)
|
||||
}
|
||||
else{
|
||||
else if(layerNm =='수요처'){
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/request/1/20/0/${featureCd}`)
|
||||
setMngList(res)
|
||||
}
|
||||
else {
|
||||
const res = await getFetch(fetchType.WR, `/drain/facilityList/1/20/0/${featureCd}`)
|
||||
setHtdflList(res)
|
||||
setHtdflDetailModal({ isOpen: true, data: htdflSttnRes[0] });
|
||||
}
|
||||
}
|
||||
// 상세 목록 데이터 상태 처리
|
||||
useEffect(()=>{
|
||||
useEffect(() => {
|
||||
if (hasuList.length > 0) setIsRuseReg({ data: [hasuList[0]] });
|
||||
},[hasuList])
|
||||
useEffect(()=>{
|
||||
}, [hasuList])
|
||||
useEffect(() => {
|
||||
if (rainList.length > 0) setRainDetailModal({ isOpen: true, data: rainList[0] });
|
||||
},[rainList])
|
||||
useEffect(()=>{
|
||||
}, [rainList])
|
||||
useEffect(() => {
|
||||
if (rswtrList.length > 0) setRswtrDetailModal({ isOpen: true, data: rswtrList[0] });
|
||||
},[rswtrList])
|
||||
useEffect(()=>{
|
||||
}, [rswtrList])
|
||||
useEffect(() => {
|
||||
if (htdflList.length > 0) setHtdflDetailModal({ isOpen: true, data: htdflList[0] });
|
||||
},[htdflList])
|
||||
}, [htdflList])
|
||||
useEffect(() => {
|
||||
if(mngList.length > 0) setIsDmdModal({ isMoal: true, data: [mngList[0]] });
|
||||
},[mngList])
|
||||
|
||||
const layerId = getSelectedLayers();
|
||||
if (featureData && typeof featureData.getProperties === "function") {
|
||||
const selectedVal = featureData.getProperties();
|
||||
let featureCd = layerId == '하수재이용시설' ? selectedVal?.swtrmt_fclt_cd : layerId == '빗물이용시설' || layerId == '중수도시설' || layerId == '온배수시설' ? selectedVal?.bdst_nm : layerId == '하수처리시설' ? selectedVal?.swtrmt_fclt_nm : null;
|
||||
if (featureCd && featureCd !== fcltPk) {
|
||||
if (layerId == '하수재이용시설') {
|
||||
featureCd = selectedVal?.swtrmt_fclt_cd;
|
||||
setFcltPk(featureCd); // 현재 호출된 featureCd 저장
|
||||
setActiveTab(featureCd)
|
||||
fetchpbnstDetail(featureCd); // 상세정보
|
||||
}
|
||||
else if (layerId == '하수처리시설') {
|
||||
featureCd = selectedVal?.swtrmt_fclt_nm;
|
||||
setFcltPk(featureCd); // 현재 호출된 featureCd 저장
|
||||
fetchHasuDetail(featureCd, selectedVal?.swtrmt_fclt_cd);
|
||||
}
|
||||
else {
|
||||
featureCd = selectedVal?.bdst_nm;
|
||||
setFcltPk(featureCd)
|
||||
if (layerId) {
|
||||
detainSttn(featureCd, layerId);
|
||||
}
|
||||
}
|
||||
setViewMode("detail")
|
||||
if (featureData && typeof featureData.getProperties === "function") {
|
||||
const selectedVal = featureData.getProperties();
|
||||
let featureCd = layerId == '하수재이용시설' ? selectedVal?.swtrmt_fclt_cd : layerId == '빗물이용시설' || layerId == '중수도시설' || layerId == '온배수시설' || layerId == '수요처' ? selectedVal?.bdst_nm : layerId == '하수처리시설' ? selectedVal?.swtrmt_fclt_nm : null;
|
||||
if (featureCd && featureCd !== fcltPk) {
|
||||
if (layerId == '하수재이용시설') {
|
||||
featureCd = selectedVal?.swtrmt_fclt_cd;
|
||||
setFcltPk(featureCd); // 현재 호출된 featureCd 저장
|
||||
setActiveTab(featureCd)
|
||||
fetchpbnstDetail(featureCd); // 상세정보
|
||||
}
|
||||
} else if (layerId === null && seletectedLayerNm) { setViewMode("list") }
|
||||
else if (layerId == '하수처리시설') {
|
||||
featureCd = selectedVal?.swtrmt_fclt_nm;
|
||||
setFcltPk(featureCd); // 현재 호출된 featureCd 저장
|
||||
fetchHasuDetail(featureCd, selectedVal?.swtrmt_fclt_cd);
|
||||
}
|
||||
else {
|
||||
featureCd = selectedVal?.bdst_nm;
|
||||
setFcltPk(featureCd)
|
||||
if (layerId) {
|
||||
detainSttn(featureCd, layerId);
|
||||
}
|
||||
}
|
||||
setViewMode("detail")
|
||||
}
|
||||
} else if (layerId === null && seletectedLayerNm) { setViewMode("list") }
|
||||
///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////// 하수재이용시설 //////////////////////////////////////////////////
|
||||
@@ -210,7 +239,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
getFlcts()
|
||||
}
|
||||
}, [seletectedLayerNm, pbnstSttn.isInit, getFlcts]);
|
||||
useEffect(()=>{
|
||||
useEffect(() => {
|
||||
pbnSttnInit("1", "15", {
|
||||
partValue: "A",
|
||||
sidoValue: '0',
|
||||
@@ -258,7 +287,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
String(new Date().getFullYear()), fclts
|
||||
);
|
||||
}, [fclts, pbnstSttnSearch]);
|
||||
// FIXME: 윤선화차장님 요구사항으로 엑셀 다운로드 삭제.
|
||||
// FIXME: 윤선화차장님 요구사항으로 엑셀 다운로드 삭제.
|
||||
// const excelClick = useCallback(() => {
|
||||
// // if (codeData) pbnstSttnSearch(1, "10000", codeData);
|
||||
// excelDownload(
|
||||
@@ -283,7 +312,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
onClose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!rainSttn.isInit) {
|
||||
@@ -427,7 +456,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
useEffect(() => {
|
||||
pubHasuInit(String(hasuPage), "0");
|
||||
}, [hasuPage, pubHasuInit]);
|
||||
|
||||
|
||||
const hasuCellClick = (index: number | undefined) => {
|
||||
if (index !== undefined && pbnstHasuRes !== undefined) {
|
||||
onFeatureSelect(pbnstHasuRes[index]);
|
||||
@@ -436,10 +465,42 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
};
|
||||
///////////////////////////////////////////// 하수처리 시설 //////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////// 수요처 관리 //////////////////////////////////////////////////
|
||||
useEffect(() => {
|
||||
if (!coSttn.isInit) {
|
||||
coSttnInit("1", "13", "0");
|
||||
}
|
||||
}, [coSttn.isInit, coSttnInit]);
|
||||
const coMngCellClick = (index: number | undefined) => {
|
||||
if (index !== undefined && mngTable !== undefined) {
|
||||
onFeatureSelect(mngTable[index]);
|
||||
onClose();
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
if (coSttnRes) {
|
||||
if (coSttnRes?.length > 0 && code.cityCd.length > 0) {
|
||||
const data = tableData(coSttnRes, { code });
|
||||
const chData = data.map((item: any) => ({
|
||||
...item,
|
||||
telno: formatPhoneNumber(item.telno || undefined),
|
||||
regDt: moment(item.regDt).format("YYYY-MM-DD"),
|
||||
dmdInfoId: `${item.dmdInfoId.slice(0, 3)}-${item.dmdInfoId.slice(3, 5)}-${item.dmdInfoId.slice(5, 10)}-${item.dmdInfoId.slice(10)}`
|
||||
}));
|
||||
// .filter((item: any) => item !== undefined);
|
||||
setMngTable(chData);
|
||||
}
|
||||
}
|
||||
}, [coSttnRes, code]);
|
||||
useEffect(() => {
|
||||
coSttnSearch(String(mngPage), "13", String(0));
|
||||
}, [coSttnSearch, mngPage]);
|
||||
///////////////////////////////////////////// 수요처 관리 //////////////////////////////////////////////////
|
||||
|
||||
// 체크된 레이어에 따른 조건부 컴포넌트 렌더링 함수
|
||||
const renderConditionalContent = () => {
|
||||
const actTabData = tabData.find((tab) => tab.id === activeTab);
|
||||
let layerId:string | undefined | null = getSelectedLayers();
|
||||
let layerId: string | undefined | null = getSelectedLayers();
|
||||
if (layerId === null || layerId === undefined) {
|
||||
layerId = seletectedLayerNm || '';
|
||||
}
|
||||
@@ -453,10 +514,12 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
const isRswt = layerId == '중수도시설';
|
||||
// 온배수시설
|
||||
const isHtdfl = layerId == '온배수시설';
|
||||
// 수요처관리
|
||||
const isReuseMng = layerId == '수요처';
|
||||
if (isPrcsFclt) {
|
||||
if (viewMode == 'list') {
|
||||
return (
|
||||
<>
|
||||
<div style={{ overflowY: 'auto' }}>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="하수처리시설 현황" />
|
||||
</div>
|
||||
@@ -470,11 +533,11 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
cellClick={hasuCellClick}
|
||||
onPageChange={setHasuPage}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<div style={{ overflowX: 'hidden' }}>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="하수처리시설 상세정보" />
|
||||
</div>
|
||||
@@ -497,7 +560,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
cellClick={() => { }}
|
||||
onPageChange={() => { }}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -528,7 +591,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
} else {
|
||||
// 재이용시설 목록
|
||||
return (
|
||||
<>
|
||||
<div style={{ overflowY: 'auto' }}>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="하수재이용시설 현황" />
|
||||
{/* <div className="flex gap-2 mt-8">
|
||||
@@ -550,7 +613,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
>
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />
|
||||
</UiTable>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -600,7 +663,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
} else {
|
||||
// 중수도시설 목록
|
||||
return (
|
||||
<>
|
||||
<div style={{ overflowY: 'auto' }}>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="중수도시설 현황" />
|
||||
{/* <div className="flex gap-2 mt-8">
|
||||
@@ -622,7 +685,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
>
|
||||
<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />
|
||||
</UiTable>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -636,7 +699,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
} else {
|
||||
// 온배수시설 목록
|
||||
return (
|
||||
<>
|
||||
<div style={{ overflowY: 'auto' }}>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="온배수시설 현황" />
|
||||
{/* <div className="flex gap-2 mt-8">
|
||||
@@ -658,17 +721,71 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
>
|
||||
<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />
|
||||
</UiTable>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isReuseMng) {
|
||||
if (viewMode == 'detail') {
|
||||
return (
|
||||
<div style={{ overflowX: 'hidden' }}>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="수요처 상세정보" />
|
||||
</div>
|
||||
{/* 높이 조정 */}
|
||||
<UiTable
|
||||
tableData={isDmdModal?.data || []}
|
||||
headlist={coSttHeadList.slice(0, 3)}
|
||||
pageSize={1}
|
||||
total={0}
|
||||
headName={"위치정보"}
|
||||
cellClick={() => { }}
|
||||
onPageChange={() => { }}
|
||||
/>
|
||||
<UiTable
|
||||
tableData={isDmdModal?.data || []}
|
||||
headlist={coSttHeadList.slice(3)}
|
||||
pageSize={1}
|
||||
total={0}
|
||||
headName={"기본정보"}
|
||||
cellClick={() => { }}
|
||||
onPageChange={() => { }}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
} else if(viewMode == 'list') {
|
||||
return ( <div>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="수요처 현황" />
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={mngTable || []}
|
||||
headlist={coSttHeadList}
|
||||
pageSize={20}
|
||||
total={coSttnResCount + 10 || 0}
|
||||
cellClick={(index: number | undefined) => {
|
||||
coMngCellClick(index);
|
||||
// setUpdateData(coSttnRes[index as number]);
|
||||
}}
|
||||
onPageChange={(page) => {
|
||||
setMngPage(page);
|
||||
}}
|
||||
></UiTable></div>)
|
||||
}
|
||||
}
|
||||
return null; // 조건에 맞는 콘텐츠가 없을 경우
|
||||
};
|
||||
|
||||
return (
|
||||
viewMode == 'nothing' ? <></> :
|
||||
<NewWindowPortal onClose={memoizedOnClose} title="시설 상세 정보">
|
||||
<NewWindowPortal
|
||||
onClose={memoizedOnClose}
|
||||
title="시설 상세 정보"
|
||||
width={viewMode == 'list' ? window.screen.availWidth : 1100}
|
||||
height={viewMode == 'list' ? window.screen.availHeight : layerId == '하수처리시설' && viewMode == 'detail' ? 450 : 900}
|
||||
scrollbars='yes'
|
||||
resizable='no'>
|
||||
{/* 체크된 레이어에 따른 조건부 렌더링 */}
|
||||
{renderConditionalContent()}
|
||||
</NewWindowPortal>
|
||||
|
||||
@@ -27,9 +27,13 @@ interface NewWindowPortalProps {
|
||||
children: React.ReactNode;
|
||||
onClose: () => void;
|
||||
title?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
resizable?: string;
|
||||
scrollbars?: string;
|
||||
}
|
||||
|
||||
const NewWindowPortal: React.FC<NewWindowPortalProps> = ({ children, onClose, title = "Detail" }) => {
|
||||
const NewWindowPortal: React.FC<NewWindowPortalProps> = ({ children, onClose, title = "", width = 900, height = 800, resizable = "yes", scrollbars = "yes" }) => {
|
||||
const [container, setContainer] = useState<HTMLElement | null>(null);
|
||||
const newWindowRef = useRef<Window | null>(null);
|
||||
const onCloseRef = useRef(onClose);
|
||||
@@ -46,13 +50,23 @@ const NewWindowPortal: React.FC<NewWindowPortalProps> = ({ children, onClose, ti
|
||||
useEffect(() => {
|
||||
// 이미 창이 열려있으면 새로 열지 않음
|
||||
if (newWindowRef.current && !newWindowRef.current.closed) return;
|
||||
// 브라우저 화면 정보
|
||||
const screenLeft = window.screenLeft ?? window.screenX;
|
||||
const screenTop = window.screenTop ?? window.screenY;
|
||||
const screenWidth = window.innerWidth ?? document.documentElement.clientWidth;
|
||||
const screenHeight = window.innerHeight ?? document.documentElement.clientHeight;
|
||||
|
||||
// 중앙 위치 계산
|
||||
const left = screenLeft + (screenWidth - width) / 2;
|
||||
const top = screenTop + (screenHeight - height) / 2;
|
||||
|
||||
// 1. 새 창을 열고 참조를 저장합니다.
|
||||
newWindowRef.current = window.open('', title, 'width=900,height=800,resizable=yes,scrollbars=yes');
|
||||
|
||||
const popupOptions = `width=${width},height=${height},left=${left}, top=${top}, resizable=${resizable},scrollbars=${scrollbars}`;
|
||||
newWindowRef.current = window.open('', title, popupOptions);
|
||||
|
||||
if (newWindowRef.current) {
|
||||
newWindowRef.current.document.title = title;
|
||||
|
||||
|
||||
// 2. React 컴포넌트를 마운트할 컨테이너 div를 생성하여 새 창의 body에 추가합니다.
|
||||
const div = newWindowRef.current.document.createElement('div');
|
||||
newWindowRef.current.document.body.appendChild(div);
|
||||
@@ -60,7 +74,6 @@ const NewWindowPortal: React.FC<NewWindowPortalProps> = ({ children, onClose, ti
|
||||
|
||||
// 3. 메인 창의 스타일을 새 창으로 복사합니다. (매우 중요)
|
||||
copyStyles(document, newWindowRef.current.document);
|
||||
|
||||
// 4. 사용자가 창을 닫을 때 부모에게 알리기 위한 이벤트 리스너를 설정합니다.
|
||||
// const handleUnload = () => {
|
||||
// onClose();
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
"use client";
|
||||
|
||||
import Gis from "@common/business_components/ui/map/Gis";
|
||||
import { useEffect, useRef, useState, useCallback } from "react";
|
||||
import { mapService } from "../service";
|
||||
import NewWindowPopup from "../newWindowPopup";
|
||||
import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
||||
|
||||
const Map = () => {
|
||||
const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정
|
||||
const gisMaps = useRef<any | null>(null);
|
||||
const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태
|
||||
const [isSearchModalOpen, setIsSearchModalOpen] = useState(true); // SearchModal 열림 상태
|
||||
const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터
|
||||
const [checkedLayers, setCheckedLayers] = useState<string[]>([]);
|
||||
const [checkedLayersData, setCheckedLayersData] = useState<any[]>([]);
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await mapService.getLyrStngs();
|
||||
setTreeData(response); // API 응답 저장
|
||||
} catch (error) {
|
||||
console.error("데이터 불러오기 실패:", error);
|
||||
}
|
||||
};
|
||||
|
||||
// 팝업 닫기 핸들러를 useCallback으로 메모이제이션
|
||||
const handlePopupClose = useCallback(() => {
|
||||
setIsOpen(false);
|
||||
setFeatureData(null);
|
||||
}, []);
|
||||
|
||||
// 컴포넌트 마운트 시 1회 실행
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
// 체크된 레이어 정보를 받는 핸들러
|
||||
const handleCheckedLayersChange = (checkedIds: string[], checkedNodesData: any[]) => {
|
||||
setCheckedLayers(checkedIds);
|
||||
setCheckedLayersData(checkedNodesData);
|
||||
};
|
||||
|
||||
// SearchModal, GisContent 등에서 호출
|
||||
const onFeatureSelect = (data: any) => {
|
||||
const map = gisMaps.current;
|
||||
if (!map) {
|
||||
console.warn("지도가 초기화되지 않았습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 항상 같은 select 객체 사용
|
||||
const select = GisApp.Module.select as any;
|
||||
if (!select) return;
|
||||
|
||||
// 1. 기존 선택 초기화
|
||||
select.resetSelectedFeature();
|
||||
|
||||
// 2. data가 OpenLayers Feature 인스턴스인지 확인
|
||||
let foundFeature: any = null;
|
||||
if (
|
||||
data &&
|
||||
typeof data.getGeometry === "function" &&
|
||||
typeof data.setStyle === "function"
|
||||
) {
|
||||
// 이미 Feature 인스턴스라면 그대로 사용
|
||||
foundFeature = data;
|
||||
} else {
|
||||
// 아니면 featureId로 맵에서 Feature 인스턴스를 찾아서 사용
|
||||
const featureId = data.fid || data.ftrIdn || data.id;
|
||||
map
|
||||
.getLayers()
|
||||
.getArray()
|
||||
.forEach((layer: any) => {
|
||||
const source = layer.getSource?.();
|
||||
if (source?.getFeatureById) {
|
||||
const feature = source.getFeatureById(String(featureId).trim());
|
||||
if (feature) foundFeature = feature;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 3. 피처 선택
|
||||
if (foundFeature) {
|
||||
const geometry = foundFeature.getGeometry();
|
||||
if (geometry) {
|
||||
const extent = geometry.getExtent();
|
||||
|
||||
map.getView().fit(extent, {
|
||||
duration: 300,
|
||||
padding: [50, 50, 50, 50],
|
||||
maxZoom: 16,
|
||||
constrainResolution: true,
|
||||
nearest: true,
|
||||
});
|
||||
}
|
||||
select.selectFeature(foundFeature, true);
|
||||
} else {
|
||||
console.warn("OpenLayers Feature를 찾을 수 없습니다:", data);
|
||||
}
|
||||
|
||||
setFeatureData(data);
|
||||
setIsOpen(true);
|
||||
setIsSearchModalOpen(false);
|
||||
};
|
||||
|
||||
// MapSearchBar 래퍼 컴포넌트
|
||||
// const CustomMapSearchBar = (props: any) => {
|
||||
// return (
|
||||
// <MapSearchBar
|
||||
// {...props}
|
||||
// searchType="공급처 후보지 조회"
|
||||
// showApplyButton={false}
|
||||
// />
|
||||
// );
|
||||
// };
|
||||
|
||||
return (
|
||||
<div className="bg-container">
|
||||
<Gis
|
||||
treeData={treeData}
|
||||
isSearch={false}
|
||||
gisMaps={gisMaps}
|
||||
isMiniMap={false}
|
||||
searchView={undefined}
|
||||
// searchView={(props: any) => (
|
||||
// <MapSearchBar
|
||||
// searchType="공급처 후보지 조회"
|
||||
// showApplyButton={false}
|
||||
// checkedLayers={checkedLayers}
|
||||
// checkedLayersData={checkedLayersData}
|
||||
// {...props}
|
||||
// />
|
||||
// )
|
||||
// }
|
||||
detailView={(props: any) =>(
|
||||
<NewWindowPopup
|
||||
onClose={handlePopupClose} // 메모이제이션된 함수 사용
|
||||
checkedLayers={checkedLayers}
|
||||
checkedLayersData={checkedLayersData}
|
||||
{...props}
|
||||
/>
|
||||
)}
|
||||
onFeatureSelect={onFeatureSelect}
|
||||
setIsOpen={setIsOpen}
|
||||
setFeatureData={setFeatureData}
|
||||
featureData={featureData}
|
||||
setIsSearchModalOpen={setIsSearchModalOpen}
|
||||
isOpen={isOpen}
|
||||
isSearchModalOpen={isSearchModalOpen}
|
||||
onCheckedLayersChange={handleCheckedLayersChange}
|
||||
imgVisble={true}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Map;
|
||||
@@ -41,9 +41,11 @@ import toast, { Toaster } from "react-hot-toast";
|
||||
import { z } from "zod";
|
||||
|
||||
export default function CoMatRvw() {
|
||||
const { code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } =
|
||||
const { auth, code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } =
|
||||
useWrStore((state) => state);
|
||||
const { coMatRvwRes,coMatRvwCount } = coRvw;
|
||||
const { coMatRvwRes, coMatRvwCount } = coRvw;
|
||||
const { regAuthrtYn } = auth;
|
||||
|
||||
//init, sub, match
|
||||
const initRef = useRef<boolean>(false);
|
||||
const { coRvwHeadList } = coRvw;
|
||||
@@ -91,10 +93,9 @@ export default function CoMatRvw() {
|
||||
const form = useForm<z.infer<typeof DmdCoReqSchema>>({
|
||||
resolver: zodResolver(DmdCoReqSchema),
|
||||
shouldUnregister: false,
|
||||
// defaultValues: DmdCoReqSchema.parse({})
|
||||
// defaultValues: DmdCoReqSchema.parse({})
|
||||
});
|
||||
|
||||
|
||||
const TableCellClick = (index: number) => {
|
||||
if (coMatRvwRes && coMatRvwRes[index]) {
|
||||
setSelectData(coMatRvwRes[index]);
|
||||
@@ -103,23 +104,21 @@ export default function CoMatRvw() {
|
||||
};
|
||||
const useUsgCdWatch = useWatch({ control: form.control, name: "useUsgCd" });
|
||||
useEffect(() => {
|
||||
|
||||
if (useUsgCdWatch) {
|
||||
form.setValue(
|
||||
"demandCst.usgPrcsProcs",
|
||||
usageProcData?.find(
|
||||
(item) => item.usage === useUsgCdWatch
|
||||
)?.process ?? ""
|
||||
usageProcData?.find((item) => item.usage === useUsgCdWatch)?.process ??
|
||||
""
|
||||
);
|
||||
}
|
||||
}, [useUsgCdWatch, form,selectionVersion]);
|
||||
}, [useUsgCdWatch, form, selectionVersion]);
|
||||
|
||||
useEffect(() => {
|
||||
if (coMatRvwRes&&coMatRvwRes.length > 0) {
|
||||
if (coMatRvwRes && coMatRvwRes.length > 0) {
|
||||
const data = coMatRvwRes?.map((item) => {
|
||||
let flag = "";
|
||||
|
||||
flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg ||undefined);
|
||||
|
||||
flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg || undefined);
|
||||
|
||||
return {
|
||||
...item,
|
||||
@@ -127,7 +126,7 @@ export default function CoMatRvw() {
|
||||
sggCd: item.demandCo?.sggCd,
|
||||
dmdCoNm: item.demandCo?.dmdCoNm,
|
||||
daddr: item.demandCo?.daddr,
|
||||
telno: formatPhoneNumber(item?.demandCo?.telno||''),
|
||||
telno: formatPhoneNumber(item?.demandCo?.telno || ""),
|
||||
dmndTmng: item?.dmndTmng,
|
||||
splyFcltFlg: flag,
|
||||
};
|
||||
@@ -156,7 +155,6 @@ export default function CoMatRvw() {
|
||||
|
||||
useEffect(() => {
|
||||
if (selectData) {
|
||||
|
||||
try {
|
||||
DmdCoReqSchema.parse(selectData);
|
||||
} catch (e) {
|
||||
@@ -164,15 +162,14 @@ export default function CoMatRvw() {
|
||||
console.log(e.flatten());
|
||||
}
|
||||
}
|
||||
form.reset( selectData);
|
||||
setSelectionVersion((v) => v + 1); // 강제로 바뀌었다고 알리기
|
||||
form.reset(selectData);
|
||||
setSelectionVersion((v) => v + 1); // 강제로 바뀌었다고 알리기
|
||||
}
|
||||
}, [selectData, form]);
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4">
|
||||
|
||||
<div className="col-span-4">
|
||||
<Title title={"수요매칭검토"} />
|
||||
<SearchDiv>
|
||||
@@ -195,7 +192,7 @@ export default function CoMatRvw() {
|
||||
<div className="col-span-7 w-full">
|
||||
<div className="flex flex-row items-center">
|
||||
<Label className="text-xl text-gray-600 mx-6">
|
||||
수요신청년도
|
||||
수요신청년도
|
||||
</Label>
|
||||
<SelectBox
|
||||
className="h-full w-32 text-2xl"
|
||||
@@ -248,7 +245,10 @@ export default function CoMatRvw() {
|
||||
if (String(objSearch.city).length > 0) {
|
||||
con = String(objSearch.city);
|
||||
}
|
||||
if (String(objSearch.sgg).length > 0 && String(objSearch.sgg) !== "0") {
|
||||
if (
|
||||
String(objSearch.sgg).length > 0 &&
|
||||
String(objSearch.sgg) !== "0"
|
||||
) {
|
||||
con = String(objSearch.sgg);
|
||||
}
|
||||
getSearch(fromNum, toNum, con, dmdCoNm);
|
||||
@@ -279,403 +279,410 @@ export default function CoMatRvw() {
|
||||
TableCellClick(index);
|
||||
}
|
||||
}}
|
||||
onPageChange={(val) => {setPageNatiion(val)}}
|
||||
onPageChange={(val) => {
|
||||
setPageNatiion(val);
|
||||
}}
|
||||
></UiTable>
|
||||
</ListDiv>
|
||||
<hr />
|
||||
{/* <ScrollArea className="h-[49vh]"> */}
|
||||
<ListDiv>
|
||||
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">
|
||||
수요신청 상세현황
|
||||
</h3>
|
||||
<Form {...form}>
|
||||
<div className="grid grid-cols-12 gap-4 ml-4 mr-4">
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmndTmng"
|
||||
render={({ field }) => (
|
||||
<FormUi label="요구시기">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={
|
||||
moment(field.value).format("YYYY-MM-DD") ?? ""
|
||||
}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmndQty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="요구수량(m³/일)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="useUsgCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사용용도">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="wntUntprc"
|
||||
render={({ field }) => (
|
||||
<FormUi label="희망단가(원/m3)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 w-full">
|
||||
<h1 className={formH1Class}>요구수질</h1>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="grssClfg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총대장균군수 (개/100ml)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="combResdch"
|
||||
render={({ field }) => (
|
||||
<FormUi label="결합잔류염소(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="trbt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="탁도(NTU)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="blgcOxygDmndQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="생물학적 산소요구량(BOD)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="smll"
|
||||
render={({ field }) => (
|
||||
<FormUi label="냄새">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="crmty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="색도(도)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총질소 (T-N)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총인(T-P)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도(pH)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="clIonQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="염화물(mgCL/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cdtnv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="전기전도도(㎲/cm)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="rmrk"
|
||||
render={({ field }) => (
|
||||
<FormUi label="비고">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 w-full">
|
||||
<h1 className={formH1Class}>공급처 후보지</h1>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${0}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지1">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${1}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지2">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${2}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지3">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<ListDiv>
|
||||
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">
|
||||
수요신청 상세현황
|
||||
</h3>
|
||||
<Form {...form}>
|
||||
<div className="grid grid-cols-12 gap-4 ml-4 mr-4">
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmndTmng"
|
||||
render={({ field }) => (
|
||||
<FormUi label="요구시기">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={
|
||||
moment(field.value).format("YYYY-MM-DD") ?? ""
|
||||
}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</Form>
|
||||
<ConCostForm form={form} type={"mat"} selectionVersion={selectionVersion} />
|
||||
</ListDiv>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmndQty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="요구수량(m³/일)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="useUsgCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사용용도">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="wntUntprc"
|
||||
render={({ field }) => (
|
||||
<FormUi label="희망단가(원/m3)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 w-full">
|
||||
<h1 className={formH1Class}>요구수질</h1>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="grssClfg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총대장균군수 (개/100ml)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="combResdch"
|
||||
render={({ field }) => (
|
||||
<FormUi label="결합잔류염소(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="trbt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="탁도(NTU)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="blgcOxygDmndQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="생물학적 산소요구량(BOD)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="smll"
|
||||
render={({ field }) => (
|
||||
<FormUi label="냄새">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="crmty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="색도(도)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총질소 (T-N)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총인(T-P)(mg/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도(pH)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="clIonQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="염화물(mgCL/L)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cdtnv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="전기전도도(㎲/cm)">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="number"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="rmrk"
|
||||
render={({ field }) => (
|
||||
<FormUi label="비고">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 w-full">
|
||||
<h1 className={formH1Class}>공급처 후보지</h1>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${0}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지1">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${1}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지2">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`demandMatching.splyCndtList.${2}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지3">
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
<ConCostForm
|
||||
form={form}
|
||||
type={"mat"}
|
||||
selectionVersion={selectionVersion}
|
||||
readonly={regAuthrtYn ==="N"}
|
||||
/>
|
||||
</ListDiv>
|
||||
{/* </ScrollArea> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function RuseRvwHstry() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
ruseHist,
|
||||
ruseRvwHistInit,
|
||||
@@ -38,6 +39,8 @@ export default function RuseRvwHstry() {
|
||||
ruseRvwComplete,
|
||||
} = useWrStore((state) => state);
|
||||
const { rvwHistRes, ruseHistHeadList, rvwHistCount } = ruseHist;
|
||||
const { regAuthrtYn } = auth;
|
||||
|
||||
const [pageNation, setPageNatiion] = useState<number>(1);
|
||||
|
||||
const [dmdCoNm, setDmdCoNm] = useState<string>("");
|
||||
@@ -305,7 +308,7 @@ export default function RuseRvwHstry() {
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={confrirmToast}>
|
||||
<Button size={"sm"} onClick={confrirmToast} disabled={regAuthrtYn==='N'}>
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,7 @@ import toast, { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function CoSttn() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
coSttn,
|
||||
coSttnInit,
|
||||
@@ -43,6 +44,7 @@ export default function CoSttn() {
|
||||
coSttnTxtSearch,
|
||||
demandCompList,
|
||||
} = useWrStore((state) => state);
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const [bdstTable, setBdstTable] = useState<DemandCompType[]>();
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
@@ -205,6 +207,7 @@ export default function CoSttn() {
|
||||
setUpdateData(undefined);
|
||||
setIsDmdModal({ ...isDmdModal, isMoal: true });
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
등록
|
||||
</Button>
|
||||
@@ -222,6 +225,7 @@ export default function CoSttn() {
|
||||
});
|
||||
}
|
||||
}}
|
||||
disabled={mdfcnAuthrtYn === "N"}
|
||||
>
|
||||
수정
|
||||
</Button>
|
||||
|
||||
@@ -15,9 +15,9 @@ import { toast, Toaster } from "react-hot-toast";
|
||||
export default function DrgtSttn() {
|
||||
const { code, drgt, drgtSearch, drgtModalSearch, drgtInit } = useWrStore((state) => state);
|
||||
const { drgtRes, drgtMoRes } = drgt;
|
||||
const [fromDate, setFromDate] = useState<string>();
|
||||
const [toDate, setToDate] = useState<string>();
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>();
|
||||
const [fromDate, setFromDate] = useState<string>('202506');
|
||||
const [toDate, setToDate] = useState<string>('202506');
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[]>([{ val: '0', text: '전체' }]);
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
|
||||
const [tableData, setTableData] = useState<customDrgt[]>();
|
||||
const [selectedSgg, setSelectedSgg] = useState<string>('');
|
||||
@@ -93,9 +93,9 @@ export default function DrgtSttn() {
|
||||
const cityValue = String(val);
|
||||
|
||||
if (cityValue === "0") {
|
||||
setSelectSgg([]);
|
||||
setSelectedSgg('');
|
||||
setObjSearch({ city: cityValue, sgg: '' });
|
||||
setSelectSgg([{ val: '0', text: '전체' }]);
|
||||
setSelectedSgg('0');
|
||||
setObjSearch({ city: cityValue, sgg: '0' });
|
||||
} else {
|
||||
const data = getCity(cityValue, code.sggCd);
|
||||
setSelectSgg(data);
|
||||
@@ -136,14 +136,15 @@ export default function DrgtSttn() {
|
||||
selectClass={""}
|
||||
selectArray={code.cityCd || []}
|
||||
onSelectValue={getSelCity}
|
||||
value={objSearch?.city ||code.cityCd[0]?.val ||""}
|
||||
/>
|
||||
<SelectBox
|
||||
className="col-span-2 w-1/6 h-full text-2xl ml-8"
|
||||
label="시군구"
|
||||
selectClass={""}
|
||||
selectArray={selectSgg || []}
|
||||
selectArray={selectSgg || [{ val: '0', text: '전체' }]}
|
||||
onSelectValue={getSgg}
|
||||
value={selectedSgg}
|
||||
value={selectedSgg ||'0'}
|
||||
/>
|
||||
<div className="col-span-5 w-auto">
|
||||
<div className="flex flex-row items-center">
|
||||
|
||||
@@ -33,7 +33,7 @@ import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function LdrmntCoSttn() {
|
||||
const { code, ldrmnt, ldrmntInit, ldrmntSearch, ldrmntUpdate } = useWrStore(
|
||||
const { auth, code, ldrmnt, ldrmntInit, ldrmntSearch, ldrmntUpdate } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { ldrmntRes, excelList, ldrmntResCount } = ldrmnt;
|
||||
@@ -47,6 +47,7 @@ export default function LdrmntCoSttn() {
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const [isDownloadClicked, setIsDownloadClicked] = useState(false);
|
||||
const { t } = useTranslation('base');
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
excelDownload(
|
||||
@@ -224,6 +225,7 @@ export default function LdrmntCoSttn() {
|
||||
onClick={() => {
|
||||
setIsExcelOpen({ isModal: true });
|
||||
}}
|
||||
disabled={regAuthrtYn === 'N'}
|
||||
>
|
||||
엑셀등록
|
||||
</Button>
|
||||
@@ -269,14 +271,16 @@ export default function LdrmntCoSttn() {
|
||||
setDetailModal({ ...detailModal, isOpen: !detailModal.isOpen })
|
||||
}}
|
||||
bodyClass={"w-[40vw] max-w-none max-h-[calc(100%-70px)]"}
|
||||
body={<CoDetailModal formObj={detailModal.data} onFormSubmit={async (value) => {
|
||||
const handleConfirm = async () => {
|
||||
await ldrmntUpdate(value);
|
||||
setDetailModal({ ...detailModal, isOpen: false });
|
||||
ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}} />}
|
||||
body={<CoDetailModal formObj={detailModal.data}
|
||||
readonly={mdfcnAuthrtYn === 'N'}
|
||||
onFormSubmit={async (value) => {
|
||||
const handleConfirm = async () => {
|
||||
await ldrmntUpdate(value);
|
||||
setDetailModal({ ...detailModal, isOpen: false });
|
||||
ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}} />}
|
||||
/>
|
||||
|
||||
<UiModal
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } =
|
||||
const { auth,code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } =
|
||||
useWrStore((state) => state);
|
||||
const [searchTxt, setSearchTxt] = useState("");
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
@@ -30,12 +30,9 @@ export default function Home() {
|
||||
const [bdstTable, setbdstTable] = useState<customHtdflBdst[]>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
|
||||
// const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
// isOpen: boolean;
|
||||
// chgBuilding: chgBuilding[];
|
||||
// }>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { htdflRes ,htdflResCount} = htdfl;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
useEffect(() => {
|
||||
if (!htdfl.isInit) {
|
||||
@@ -116,7 +113,10 @@ export default function Home() {
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => setIsNewReg(!issNewReg)}>
|
||||
<Button size={"sm"}
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
@@ -149,6 +149,7 @@ export default function Home() {
|
||||
<HtdflRegForm
|
||||
htdflForm={htdflForm ?? ({} as customHtdflBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -38,6 +38,7 @@ import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
pbnst,
|
||||
pubHasuInit,
|
||||
@@ -47,8 +48,10 @@ export default function PublicReuseFaciltyInsert() {
|
||||
pubHasuSearch,
|
||||
pbnstRuseBizUpdate,
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const { t } = useTranslation("base");
|
||||
const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
const [, setCurrentTab] = useState<string>("mng");
|
||||
const [isRuseReg, setIsRuseReg] = useState<{
|
||||
isModal: boolean;
|
||||
@@ -290,6 +293,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
}
|
||||
isResetPage(true);
|
||||
}}
|
||||
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
@@ -307,6 +311,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
appendPbnstRuseFclt();
|
||||
}
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -319,19 +324,17 @@ export default function PublicReuseFaciltyInsert() {
|
||||
<div className="grid grid-cols-8 gap-4">
|
||||
<div className="col-span-5 h-full min-h-0">
|
||||
<ListDiv className="min-h-0">
|
||||
{/* <ScrollArea className="h-[60vh]"> */}
|
||||
{" "}
|
||||
{/* 높이 조정 */}
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={pubFacHeadList}
|
||||
pageSize={10}
|
||||
total={pbnstHasuResCount || 20}
|
||||
headName={"공공 하수처리시설 목록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
resetPageNo={resetPage}
|
||||
/>
|
||||
{/* <ScrollArea className="h-[60vh]"> */} {/* 높이 조정 */}
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={pubFacHeadList}
|
||||
pageSize={10}
|
||||
total={pbnstHasuResCount || 20}
|
||||
headName={"공공 하수처리시설 목록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
resetPageNo={resetPage}
|
||||
/>
|
||||
{/* </ScrollArea> */}
|
||||
</ListDiv>
|
||||
</div>
|
||||
@@ -351,6 +354,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
size={"sm"}
|
||||
onClick={form.handleSubmit(onSubmit, onInvalid)}
|
||||
className="mr-5 mt-2"
|
||||
disabled={mdfcnAuthrtYn === "N"}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -364,7 +368,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
setIndexMng(index);
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
readonly={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
@@ -376,9 +380,9 @@ export default function PublicReuseFaciltyInsert() {
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
</ScrollArea>
|
||||
</Tabs>
|
||||
) : (
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { type customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formatCommaNumber, tableData } from "@/components/lib/func/commom";
|
||||
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
@@ -19,14 +17,19 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { rain, code, initRain, rainSearch, getRainData } = useWrStore(
|
||||
const { auth, rain, code, initRain, rainSearch, getRainData } = useWrStore(
|
||||
(state) => {
|
||||
return state;
|
||||
}
|
||||
);
|
||||
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
|
||||
|
||||
const { rainRes, rainResCount } = rain;
|
||||
const [rainForm, setRainForm] = useState<customRainBdst>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
@@ -53,7 +56,7 @@ export default function Home() {
|
||||
return {
|
||||
...item,
|
||||
archArea: formatCommaNumber(archArea),
|
||||
|
||||
bdstChgYn: item.chgBuilding[0]?.bdstChgNm != null ? "Y" : "N",
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -64,13 +67,10 @@ export default function Home() {
|
||||
}
|
||||
}
|
||||
}, [code, rainRes]);
|
||||
const cellClick: (val: number | undefined) => void = (
|
||||
val
|
||||
) => {
|
||||
const cellClick: (val: number | undefined) => void = (val) => {
|
||||
if (val !== undefined) {
|
||||
setRainForm(rainRes[val]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -99,7 +99,7 @@ export default function Home() {
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
rainSearch(searchTxt || "", 1, "41");
|
||||
//rainSearch(searchTxt || "", pageNation, "41");
|
||||
//rainSearch(searchTxt || "", pageNation, "41");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
@@ -107,7 +107,10 @@ export default function Home() {
|
||||
<Button
|
||||
size={"sm"}
|
||||
className=""
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
onClick={() => {
|
||||
setIsNewReg(!issNewReg);
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -143,6 +146,7 @@ export default function Home() {
|
||||
<RainRegForm
|
||||
rainForm={rainForm ?? ({} as customRainBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn !== "Y"}
|
||||
></RainRegForm>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -20,9 +20,11 @@ import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore(
|
||||
const { auth,code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const [rswtForm, setRswtForm] = useState<customRswtBdst>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
@@ -114,6 +116,7 @@ export default function Home() {
|
||||
size={"sm"}
|
||||
className="mr-4"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -146,6 +149,7 @@ export default function Home() {
|
||||
<RswtrRegForm
|
||||
rswtForm={rswtForm ?? ({} as customRswtBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { btnClass } from "@/app/store/common/code";
|
||||
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
||||
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
|
||||
import {
|
||||
ContentsDiv,
|
||||
SearchBaseForm,
|
||||
@@ -12,14 +17,9 @@ import {
|
||||
type ReturnType,
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
|
||||
export default function PbnstSttn() {
|
||||
const {
|
||||
@@ -29,6 +29,7 @@ export default function PbnstSttn() {
|
||||
pbnSttnInit,
|
||||
getPbnStnDetail,
|
||||
getFlcts,
|
||||
resetPbnstDetail
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const { pbnstSttnRes, fclts, pbnstSttnResCount } = pbnstSttn;
|
||||
@@ -103,9 +104,6 @@ export default function PbnstSttn() {
|
||||
});
|
||||
}, [pbnstSttn.pbnstDetail]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("pbnDetaileData.isModal ", pbnDetaileData.isModal);
|
||||
}, [pbnDetaileData.isModal]);
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
@@ -233,8 +231,9 @@ export default function PbnstSttn() {
|
||||
open={pbnDetaileData.isModal}
|
||||
onOpenChange={(open) => {
|
||||
//TODO:OPEN 상태 확인필요
|
||||
if(!open)
|
||||
setPbnDetaileData({ data: {} as customPbnst, isModal: open });
|
||||
if (!open)
|
||||
setPbnDetaileData({ data: {} as customPbnst, isModal: open });
|
||||
resetPbnstDetail();
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -44,6 +44,7 @@ import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Page() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
rainChkgdn,
|
||||
rswtChkgdn,
|
||||
@@ -64,6 +65,7 @@ export default function Page() {
|
||||
} = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const { regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn } = auth;
|
||||
const [isRegExcel, setIsRegExcel] = useState(false);
|
||||
const [updateRainDetail, setUpdateRainDetail] = useState<rainChkZodType[]>(
|
||||
[]
|
||||
@@ -301,6 +303,7 @@ export default function Page() {
|
||||
onClick={() => {
|
||||
clickDelete(deleteIdx, selFcltDiv);
|
||||
}}
|
||||
disabled={delAuthrtYn === 'N'}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
@@ -313,6 +316,7 @@ export default function Page() {
|
||||
onClick={() => {
|
||||
chkUpdateTable(selFcltDiv);
|
||||
}}
|
||||
disabled={mdfcnAuthrtYn === 'N'}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -330,6 +334,7 @@ export default function Page() {
|
||||
onClick={() => {
|
||||
setIsRegExcel(!isRegExcel);
|
||||
}}
|
||||
disabled={regAuthrtYn === 'N'}
|
||||
>
|
||||
결과등록
|
||||
</Button>
|
||||
@@ -354,6 +359,7 @@ export default function Page() {
|
||||
pageNation={rainPageNation}
|
||||
onPageChange={rainPageChange}
|
||||
pageCount={rainChkgdn.rainChkCount}
|
||||
readonly={mdfcnAuthrtYn === 'N'}
|
||||
/>
|
||||
) : (
|
||||
<RswtChkgdTable
|
||||
@@ -364,6 +370,7 @@ export default function Page() {
|
||||
pageNation={rswtPageNation}
|
||||
onPageChange={rswtPageChange}
|
||||
pageCount={rswtChkgdn.rswtChkCount}
|
||||
readonly={mdfcnAuthrtYn === 'N'}
|
||||
/>
|
||||
)}
|
||||
</ListDiv>
|
||||
@@ -380,6 +387,7 @@ export default function Page() {
|
||||
type={selFcltDiv}
|
||||
obj={isModal.data}
|
||||
setIsModal={(open) => setIsModal((prev) => ({ ...prev, open }))}
|
||||
readonly={mdfcnAuthrtYn === 'N' ? false : true}
|
||||
/>
|
||||
}
|
||||
></UiModal>
|
||||
|
||||
@@ -38,10 +38,11 @@ import { useTranslation } from "react-i18next";
|
||||
import { headMakeprfmnc } from "../chkgdnReg/TableHead";
|
||||
|
||||
export default function PrfmncPrfmncReg() {
|
||||
const { prfmnc, prfmncHasuInit, prfmnRegData, prfmncHasuNmSearch } = useWrStore(
|
||||
const { auth, prfmnc, prfmncHasuInit, prfmnRegData, prfmncHasuNmSearch } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { pbnstPrfmncHeadList, monthHeadList, prfmncRes, prfmncResCount } = prfmnc;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
const [bdstTable, setbdstTable] = useState<FcPrfType[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [isExcelOpen, setIsExcelOPen] = useState<{
|
||||
@@ -92,7 +93,7 @@ export default function PrfmncPrfmncReg() {
|
||||
searchYear,
|
||||
pbnstRuseFcltId
|
||||
) as unknown as PrfType
|
||||
,searchYear
|
||||
, searchYear
|
||||
);
|
||||
};
|
||||
|
||||
@@ -124,6 +125,9 @@ export default function PrfmncPrfmncReg() {
|
||||
};
|
||||
if (prfmncRes[index]?.prfList) {
|
||||
prfmncRes[index].prfList?.forEach((prfItem) => {
|
||||
const yr = Number(prfItem.ym?.slice(0, 4)); // "YYYY"
|
||||
|
||||
if(yr === Number(searchYear)) {
|
||||
const month = Number(prfItem?.ym?.slice(4)); // "MM"
|
||||
const monthKey = `${month}월`;
|
||||
|
||||
@@ -154,7 +158,11 @@ export default function PrfmncPrfmncReg() {
|
||||
outSubtotal.total += value;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if(inSubtotal.total!==0 && outSubtotal.total!==0) {
|
||||
|
||||
inUsageData.push(inSubtotal);
|
||||
outUsageData.push(outSubtotal);
|
||||
const usageTotalObj: { [key: string]: any } = {
|
||||
@@ -173,18 +181,21 @@ export default function PrfmncPrfmncReg() {
|
||||
const tableData = [...inUsageData, ...outUsageData, usageTotalObj];
|
||||
setpbnstRuseFcltId(prfmncRes[index].pbnstRuseFcltId);
|
||||
setInputData(tableData);
|
||||
}else{
|
||||
setInputData([]);
|
||||
}
|
||||
} else {
|
||||
setInputData([]);
|
||||
}
|
||||
}
|
||||
},
|
||||
[prfmncRes]
|
||||
[prfmncRes,searchYear]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!prfmnc.isInit) {
|
||||
const year = new Date().getFullYear()
|
||||
prfmncHasuInit(1, "41", String(year));
|
||||
prfmncHasuInit(1, '41', String(year));
|
||||
}
|
||||
}, [prfmnc.isInit, prfmncHasuInit]);
|
||||
useEffect(() => {
|
||||
@@ -259,6 +270,7 @@ export default function PrfmncPrfmncReg() {
|
||||
onClick={() => {
|
||||
onSave();
|
||||
}}
|
||||
disabled={mdfcnAuthrtYn === 'N'}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -272,6 +284,7 @@ export default function PrfmncPrfmncReg() {
|
||||
setIsExcelOPen({ ...isExcelOpen, isModal: true });
|
||||
}
|
||||
}}
|
||||
disabled={regAuthrtYn === 'N'}
|
||||
>
|
||||
파일등록
|
||||
</Button>
|
||||
@@ -302,7 +315,7 @@ export default function PrfmncPrfmncReg() {
|
||||
}}
|
||||
onPageChange={
|
||||
(page) => {
|
||||
prfmncHasuInit(page, "41", searchYear);
|
||||
prfmncHasuInit(page, '41', searchYear);
|
||||
setPageNation(page)
|
||||
}}
|
||||
/>
|
||||
@@ -321,7 +334,7 @@ export default function PrfmncPrfmncReg() {
|
||||
{headMakeprfmnc(monthHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(inputData ?? [], monthHeadList, setInputData)}
|
||||
{InputTableBody(inputData ?? [], monthHeadList, setInputData, mdfcnAuthrtYn === 'N' ? false : true)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
@@ -348,7 +361,7 @@ export default function PrfmncPrfmncReg() {
|
||||
}
|
||||
open={isExcelOpen.isModal}
|
||||
onOpenChange={() => {
|
||||
setIsExcelOPen({ isModal: false, data: {} as FcPrfType });
|
||||
setIsExcelOPen({ ...isExcelOpen, isModal: false });
|
||||
}}
|
||||
></UiModal>
|
||||
<Toaster position="top-center" />
|
||||
|
||||
@@ -99,7 +99,9 @@ export default function Page() {
|
||||
isRainSttn(true)
|
||||
rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd);
|
||||
setIsModal({ data: {}, open: false });
|
||||
|
||||
}
|
||||
|
||||
}, [rainChkSttn.isInit, rainChkSttnInit, rainPageSize]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -226,6 +228,7 @@ export default function Page() {
|
||||
pageNation={rainPageNation}
|
||||
onPageChange={rainPageChange}
|
||||
pageCount={rainChkSttn.rainChkCount}
|
||||
readonly={true}
|
||||
/>
|
||||
) : (
|
||||
<RswtChkgdTable
|
||||
@@ -236,6 +239,7 @@ export default function Page() {
|
||||
pageNation={rswtPageNation}
|
||||
onPageChange={rswtPageChange}
|
||||
pageCount={rswtChkSttn.rswtChkCount}
|
||||
readonly={true}
|
||||
/>
|
||||
)}
|
||||
</ListDiv>
|
||||
@@ -247,7 +251,7 @@ export default function Page() {
|
||||
setIsModal({ open: !open, data: {} });
|
||||
}}
|
||||
bodyClass={"w-[80vw] max-w-none"}
|
||||
body={<ChkgdModal type={selFcltDiv} obj={isModal.data} setIsModal={() => { }} />}
|
||||
body={<ChkgdModal readonly={true} type={selFcltDiv} obj={isModal.data} setIsModal={() => { }} />}
|
||||
></UiModal>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
import { getFetch, getFetchWithCount } from "@/components/lib/api";
|
||||
import { getFetchWithCount } from "@/components/lib/api";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const getMenuAuthrts = async (menuCd: number) => {
|
||||
const response = await getFetch(
|
||||
"LOCAL",
|
||||
`/cms-service/api/v1/menu-authrts/pageinfo/${menuCd}`
|
||||
);
|
||||
|
||||
authStateExport.auth = {
|
||||
mngAuthrtYn: response[0].mngAuthrtYn,
|
||||
inqAuthrtYn: response[0].mngAuthrtYn,
|
||||
regAuthrtYn: response[0].mngAuthrtYn,
|
||||
mdfcnAuthrtYn: response[0].mngAuthrtYn,
|
||||
delAuthrtYn: response[0].mngAuthrtYn,
|
||||
};
|
||||
};
|
||||
|
||||
export type authState = {
|
||||
auth: {
|
||||
mngAuthrtYn: string;
|
||||
|
||||
@@ -98,9 +98,10 @@ export const drgtActionsExport: (set: any) => drgtActions = (
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const formatted = `${year}${month}`;
|
||||
const fromDate = formatted;
|
||||
const toDate = formatted;
|
||||
|
||||
let fromDate = formatted;
|
||||
let toDate = formatted;
|
||||
fromDate='202506'
|
||||
toDate='202506'
|
||||
const drgtRes = await initFetch(fromDate, toDate, []);
|
||||
set((state: drgtState) => {
|
||||
return {
|
||||
|
||||
@@ -27,9 +27,9 @@ export type pbnstSttnState = {
|
||||
ruseGuranteeHeadList: TableUpperProps[]
|
||||
ruseDmdHeadList: TableUpperProps[]
|
||||
ruseFcltHeadList: TableUpperProps[]
|
||||
pbnstSttnResCount:number;
|
||||
pbnstSttnResCount: number;
|
||||
excelList: [];
|
||||
fclts:string[]
|
||||
fclts: string[]
|
||||
isInit: boolean;
|
||||
};
|
||||
};
|
||||
@@ -43,15 +43,15 @@ type pbnstSttnActions = {
|
||||
reurnValue: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
fclts:string[]
|
||||
fclts: string[]
|
||||
) => void;
|
||||
getFlcts:()=>void;
|
||||
getFlcts: () => void;
|
||||
pbnSttnInit: (
|
||||
page: string,
|
||||
total: string,
|
||||
reurnValue: ReturnType,
|
||||
year: string,
|
||||
flcts:string[]
|
||||
flcts: string[]
|
||||
) => void;
|
||||
getPbnStnDetail: (pbnstRuseFcltId: string) => void;
|
||||
pbnNmSearch: (
|
||||
@@ -60,8 +60,9 @@ type pbnstSttnActions = {
|
||||
reurnValue: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
flcts:string[]
|
||||
flcts: string[]
|
||||
) => void;
|
||||
resetPbnstDetail: () => void;
|
||||
};
|
||||
|
||||
export type pbnstSttnType = pbnstSttnState & pbnstSttnActions;
|
||||
@@ -77,11 +78,11 @@ export const pbnstSttnStateExport: pbnstSttnState = {
|
||||
ruseDmdHeadList: ruseDmdHeadListExport,
|
||||
ruseFcltHeadList: ruseFcltHeadListExport,
|
||||
pbnstSttnRes: [],
|
||||
pbnstSttnResCount:1,
|
||||
pbnstSttnResCount: 1,
|
||||
pbnstDetail: {} as customPbnst,
|
||||
pbnstSearchData: [],
|
||||
excelList: [],
|
||||
fclts:[],
|
||||
fclts: [],
|
||||
isInit: false,
|
||||
},
|
||||
};
|
||||
@@ -92,12 +93,12 @@ const hasuListFetch = async (
|
||||
reurnValue: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
flcts:string[]
|
||||
flcts: string[]
|
||||
) => {
|
||||
let url = `/prcsFclt/ruseInfo/`;
|
||||
|
||||
if (reurnValue.partValue === "A") {
|
||||
url+=`${page}/${total}/${reurnValue.partValue}/${
|
||||
url += `${page}/${total}/${reurnValue.partValue}/${
|
||||
// reurnValue.sidoValue ? reurnValue.sidoValue : reurnValue.sigunValue
|
||||
reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue
|
||||
}/0/1/SW`
|
||||
@@ -108,12 +109,12 @@ const hasuListFetch = async (
|
||||
? reurnValue.unitWaterShedValue
|
||||
: reurnValue.middleRegionValue
|
||||
}/0/1/SW`
|
||||
} else if( reurnValue.partValue === 'G'){
|
||||
} else if (reurnValue.partValue === 'G') {
|
||||
|
||||
|
||||
url += `${page}/${total}/${reurnValue.envPartValue}/${reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue}/0/1/SW`
|
||||
|
||||
}else{
|
||||
} else {
|
||||
url += `1/2/A/0/0/1/SW`
|
||||
}
|
||||
|
||||
@@ -121,8 +122,7 @@ const hasuListFetch = async (
|
||||
url += "/" + searchNm
|
||||
}
|
||||
|
||||
console.log(' flcts ' ,flcts)
|
||||
const pbnList = await postFectch(url, flcts,fetchType.COMMON);
|
||||
const pbnList = await postFectch(url, flcts, fetchType.COMMON);
|
||||
const getRuseList = await postFectch(
|
||||
`/reuseFc/pubDetailList/${year}`,
|
||||
flcts,
|
||||
@@ -139,7 +139,7 @@ const hasuListFetch = async (
|
||||
fclt.bscFctCd === item.pbnstRuseFcltId.substring(0, 11)
|
||||
);
|
||||
|
||||
if(findData){
|
||||
if (findData) {
|
||||
|
||||
const usage = item.prfList.reduce(
|
||||
(acc, cur) => {
|
||||
@@ -161,48 +161,42 @@ const hasuListFetch = async (
|
||||
cur.rvrKeepUswtr +
|
||||
cur.indstUswtr;
|
||||
acc.total = acc.inUsage + acc.outUsage;
|
||||
|
||||
|
||||
return acc;
|
||||
},
|
||||
{ total: 0, inUsage: 0, outUsage: 0 }
|
||||
);
|
||||
console.log('findData ', findData)
|
||||
return {
|
||||
rvbsn: findData?.rvbsn ||'-',
|
||||
lgbsn: findData?.lgbsn||'-',
|
||||
mdmbsn: findData?.mdmbsn||'-',
|
||||
rgnNm: findData?.rgnNm||'-',
|
||||
sido: findData?.sido||'-',
|
||||
gugun: findData?.gugun||'-',
|
||||
bscFctNm: findData?.bscFctNm||'-',
|
||||
efflWqltStndrdNm: findData?.efflWqltStndrdNm||'-',
|
||||
fctCpc: Number(findData?.fctCpc)||0,
|
||||
rvbsn: findData?.rvbsn || '-',
|
||||
lgbsn: findData?.lgbsn || '-',
|
||||
mdmbsn: findData?.mdmbsn || '-',
|
||||
rgnNm: findData?.rgnNm || '-',
|
||||
sido: findData?.sido || '-',
|
||||
gugun: findData?.gugun || '-',
|
||||
bscFctNm: findData?.bscFctNm || '-',
|
||||
efflWqltStndrdNm: findData?.efflWqltStndrdNm || '-',
|
||||
fctCpc: Number(findData?.fctCpc) || 0,
|
||||
tel: findData?.tel ?? "-",
|
||||
ruseUtztnFcltNm: item?.ruseUtztnFcltNm||'-',
|
||||
fcltCpct: item?.fcltCpct||'-',
|
||||
splyExtraCpct: item?.splyExtraCpct||'-',
|
||||
ruseCpct: item?.ruseCpct||'-',
|
||||
pbnstRuseFcltId: item.pbnstRuseFcltId||'-',
|
||||
ruseUtztnFcltNm: item?.ruseUtztnFcltNm || '-',
|
||||
fcltCpct: item?.fcltCpct || '-',
|
||||
splyExtraCpct: item?.splyExtraCpct || '-',
|
||||
ruseCpct: item?.ruseCpct || '-',
|
||||
pbnstRuseFcltId: item.pbnstRuseFcltId || '-',
|
||||
usageTotal: usage?.total,
|
||||
inUsage: usage?.inUsage,
|
||||
outUsage: usage?.outUsage,
|
||||
operMthd: item.operList[0]?.operMthd||'-',
|
||||
operMthd: item.operList[0]?.operMthd || '-',
|
||||
rprtvBzenty: item.operList[0]?.rprtvBzenty,
|
||||
bgngDt: moment(item.operList[0]?.bgngDt).format("YYYY-MM-DD") ?? "",
|
||||
endDt: moment(item.operList[0]?.endDt).format("YYYY-MM-DD") ?? "",
|
||||
searchNm: findData?.bscFctNm||'-',
|
||||
searchPk: findData?.bscFctCd||'-',
|
||||
searchNm: findData?.bscFctNm || '-',
|
||||
searchPk: findData?.bscFctCd || '-',
|
||||
prfList: item?.prfList ?? []
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
).filter(Boolean);
|
||||
|
||||
|
||||
console.log( ' checkWrRegListRes ', getRuseList.data)
|
||||
console.log( ' data ', data)
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -210,12 +204,12 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
getFlcts:async ()=>{
|
||||
const fclts= await getFetch(fetchType.WR,'/reuseFc/pubFc')
|
||||
getFlcts: async () => {
|
||||
const fclts = await getFetch(fetchType.WR, '/reuseFc/pubFc')
|
||||
return set((state: pbnstSttnState) => ({
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
fclts:fclts
|
||||
fclts: fclts
|
||||
},
|
||||
}));
|
||||
},
|
||||
@@ -239,11 +233,11 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
reurnValue: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
fclts:string[]
|
||||
fclts: string[]
|
||||
) => {
|
||||
try {
|
||||
|
||||
|
||||
|
||||
|
||||
const pbnstSttnRes = await hasuListFetch(
|
||||
page,
|
||||
total,
|
||||
@@ -265,7 +259,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
},
|
||||
};
|
||||
});
|
||||
} else{
|
||||
} else {
|
||||
|
||||
set((state: pbnstSttnState) => {
|
||||
return {
|
||||
@@ -273,8 +267,8 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
pbnstSttnRes: pbnstSttnRes,
|
||||
pbnstSttnResCount:pbnstSttnRes.length
|
||||
// isInit: false,
|
||||
pbnstSttnResCount: pbnstSttnRes.length
|
||||
// isInit: false,
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -283,31 +277,31 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
console.log("error", erTxt);
|
||||
}
|
||||
},
|
||||
pbnSttnInit: async(
|
||||
pbnSttnInit: async (
|
||||
page: string,
|
||||
total: string,
|
||||
reurnValue: ReturnType,
|
||||
year: string,
|
||||
fclts:string[]
|
||||
fclts: string[]
|
||||
) => {
|
||||
try {
|
||||
const pbnstSttnRes = await hasuListFetch(
|
||||
page,
|
||||
total,
|
||||
reurnValue,
|
||||
undefined,
|
||||
year,
|
||||
fclts
|
||||
);
|
||||
console.log('pbnstSttnRes ' , pbnstSttnRes)
|
||||
set( (state: pbnstSttnState) => {
|
||||
page,
|
||||
total,
|
||||
reurnValue,
|
||||
undefined,
|
||||
year,
|
||||
fclts
|
||||
);
|
||||
set((state: pbnstSttnState) => {
|
||||
return {
|
||||
...state,
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
pbnstSttnRes: pbnstSttnRes,
|
||||
pbnstSttnResCount:pbnstSttnRes.length,
|
||||
pbnstSttnResCount: pbnstSttnRes.length,
|
||||
isInit: false,
|
||||
pbnstDetail: {} as customPbnst
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -315,6 +309,17 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
console.log("error", erTxt);
|
||||
}
|
||||
},
|
||||
resetPbnstDetail: async () => {
|
||||
set((state: pbnstSttnState) => {
|
||||
return {
|
||||
...state,
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
pbnstDetail: {} as customPbnst
|
||||
},
|
||||
};
|
||||
})
|
||||
},
|
||||
getPbnStnDetail: async (pbnstRuseFcltId: string) => {
|
||||
try {
|
||||
let pbnstDetail = await getFetch("wr", `/reuseFc/pubFc/${pbnstRuseFcltId}`);
|
||||
@@ -340,7 +345,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
reurnValue: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
flcts:string[]
|
||||
flcts: string[]
|
||||
) => {
|
||||
try {
|
||||
|
||||
@@ -359,7 +364,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
pbnstSearchData: pbnstSttnRes,
|
||||
pbnstSttnResCount:pbnstSttnRes.length,
|
||||
pbnstSttnResCount: pbnstSttnRes.length,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
import type { customRainBdst } from "../../fcltReg/rainReg";
|
||||
|
||||
import { bdstUsgCd } from "@/app/store/common/code/basicCode";
|
||||
//TODO: 공통코드시 삭제되니 수정 해야됨
|
||||
export const excelRainSttnParsing = (
|
||||
excel: { data: customRainBdst[] },
|
||||
sidoCode: SelectDataType[],
|
||||
@@ -9,14 +10,15 @@ export const excelRainSttnParsing = (
|
||||
const excelExportData: string[][] = [];
|
||||
|
||||
excel.data.forEach((item) => {
|
||||
console.log("item", item)
|
||||
excelExportData.push([
|
||||
sidoCode.find((sido) => sido.val === item.ctpvCd?.toString())?.text ?? "",
|
||||
sggCode.find((sgg) => sgg.val === item.sggCd?.toString())?.text ?? "",
|
||||
item.bdstNm ?? "",
|
||||
item.daddr ?? "",
|
||||
String(item.bdstInfoSn ?? ""),
|
||||
bdstUsgCd.find((cd) => cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도
|
||||
String(item.frstArchPrmsnDt ?? ""),
|
||||
String(item.archArea ?? ""),
|
||||
String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]),
|
||||
String(item.chgBuilding.length > 0 ? "Y" : "N"),
|
||||
String(item.reuseBuilding?.[0]?.lawTrgtYn ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""),
|
||||
@@ -28,7 +30,7 @@ export const excelRainSttnParsing = (
|
||||
String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctPrs ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.rainyObj?.dtfcltCpct ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.instlCstSprtYn ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.instlCstSprtAmt ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.instlCstSprtAmt === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.instlCstSprtAmt) ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.grntchBdstCertYn ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.grntchBdstCertYr ?? ""),
|
||||
String(item.reuseBuilding?.[0]?.grntchBdstCertNo ?? ""),
|
||||
|
||||
@@ -195,7 +195,7 @@ export const StoreZus = (
|
||||
getMiddleRegionCd(set);
|
||||
getUnitWaterShedCd(set);
|
||||
getEnvPartCd(set);
|
||||
LoginApi.login({userId: "tuser10003", password: "test1234!"})
|
||||
LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"})
|
||||
return {
|
||||
...initState,
|
||||
...comFcltSearchAction(set),
|
||||
|
||||
@@ -95,7 +95,8 @@ export const chRowspanTable = (
|
||||
) => void,
|
||||
toggleSelection: (pk: number, checked: boolean) => void,
|
||||
selectedIds: number[],
|
||||
handleCellClick: (index: number, headId: string) => void
|
||||
handleCellClick: (index: number, headId: string) => void,
|
||||
disable? : boolean
|
||||
) => {
|
||||
let order = 0
|
||||
// rowspan된 셀 렌더링 여부 추적용
|
||||
@@ -138,6 +139,7 @@ export const chRowspanTable = (
|
||||
onCheckedChange={(checked) =>
|
||||
toggleSelection(row.chkgdnSn, checked === true)
|
||||
}
|
||||
disabled={disable}
|
||||
></Checkbox>
|
||||
) : key === "order" ? (
|
||||
++order
|
||||
@@ -339,7 +341,9 @@ export const InputTableBody = (
|
||||
// className={`${head.id !== "utztnUsgCd" ? "text-right" : "text-center"} !text-xl h-10 w-full`}
|
||||
className={`${textAlignClass} !text-xl h-10 w-full`}
|
||||
onChange={(e) =>
|
||||
handleChange(dataIndex, head.id, e.target.value, setInputData)
|
||||
handleCommaNumberChange(e, val =>
|
||||
handleChange(dataIndex, head.id, String(val), setInputData)
|
||||
)
|
||||
}
|
||||
value={formatCommaNumber(data[head.id as keyof any]) ?? ""}
|
||||
maxLength={numSize}
|
||||
|
||||
@@ -31,10 +31,12 @@ export default function ConCostForm({
|
||||
form,
|
||||
type,
|
||||
selectionVersion,
|
||||
readonly = false,
|
||||
}: {
|
||||
form: UseFormReturn<DmdCoReqType>;
|
||||
type: string;
|
||||
selectionVersion: number;
|
||||
readonly: boolean;
|
||||
}) {
|
||||
const {
|
||||
constCostRes,
|
||||
@@ -58,14 +60,11 @@ export default function ConCostForm({
|
||||
}
|
||||
}, [ref, getConstCostFee, getRateFee]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
// 다른 행을 선택하면(selectionVersion 변경) 체크박스 상태를 초기화합니다.
|
||||
setCheckFinish(false);
|
||||
}, [selectionVersion]);
|
||||
|
||||
|
||||
|
||||
const zipDowonLoad = () => {
|
||||
fetch(`/2024_constarctFeeProgram.zip`, {}).then(async (response) => {
|
||||
const blobRet = await response.blob();
|
||||
@@ -95,7 +94,7 @@ export default function ConCostForm({
|
||||
return;
|
||||
}
|
||||
|
||||
const dmndQtyYear = dmndQtyWatch * 365;
|
||||
const dmndQtyYear = dmndQtyWatch;
|
||||
if (usgPrcsProcs && usgPrcsProcs?.length > 0) {
|
||||
const firstProc =
|
||||
getConstFctCode(usgPrcsProcs?.split("+")[0] || "") || "";
|
||||
@@ -165,29 +164,32 @@ export default function ConCostForm({
|
||||
cstrnCst: value.demandCst.cstrnCst || 0,
|
||||
fcltSbsdCstrnCst: value.demandCst.fcltSbsdCstrnCst || 0,
|
||||
prcsFcltCpctCstrnCst: value.demandCst.prcsFcltCpctCstrnCst || 0,
|
||||
flg: checkFinish?'Checked':'Sub',
|
||||
flg: checkFinish ? "Checked" : "Sub",
|
||||
rgtr: TEST_UUID,
|
||||
};
|
||||
if (checkFinish) {
|
||||
toast((t) => (
|
||||
<span className="flex flex-col items-center text-2xl" >
|
||||
검토완료 변경시 공사비는 변경할수 없습니다.
|
||||
<span className="flex flex-col items-center text-2xl">
|
||||
검토완료 변경시 공사비는 변경할수 없습니다.
|
||||
<br />
|
||||
진행하시겠습니까?
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button
|
||||
size='sm'
|
||||
|
||||
onClick={() => {
|
||||
toast.dismiss(t.id);
|
||||
coMatRvwUpdate("11000SW001R1", form.getValues("dmdInfoId"), data);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
</Button>
|
||||
<Button
|
||||
size='sm'
|
||||
onClick={() => toast.dismiss(t.id)}>취소</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
toast.dismiss(t.id);
|
||||
coMatRvwUpdate(
|
||||
"11000SW001R1",
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
</Button>
|
||||
<Button size="sm" onClick={() => toast.dismiss(t.id)}>
|
||||
취소
|
||||
</Button>
|
||||
</div>
|
||||
</span>
|
||||
));
|
||||
@@ -229,6 +231,7 @@ export default function ConCostForm({
|
||||
className="mr-3"
|
||||
size={"sm"}
|
||||
onClick={form.handleSubmit(onSubmit)}
|
||||
disabled={readonly}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -236,9 +239,14 @@ export default function ConCostForm({
|
||||
<Checkbox
|
||||
className="ml-3 mr-6"
|
||||
checked={checkFinish}
|
||||
onCheckedChange={(checked) =>
|
||||
onCheckedChange={
|
||||
(checked) => {
|
||||
if (readonly) return;
|
||||
setCheckFinish(checked === true);
|
||||
}
|
||||
|
||||
// 'indeterminate' 상태를 무시하고 순수 boolean 값으로만 상태를 업데이트합니다.
|
||||
setCheckFinish(checked === true)}
|
||||
}
|
||||
></Checkbox>
|
||||
<Label>관로 표준공사비 산정 프로그램</Label>
|
||||
<Button
|
||||
@@ -350,10 +358,11 @@ export default function ConCostForm({
|
||||
type="number"
|
||||
step="0.001"
|
||||
onChange={(e) => {
|
||||
console.log('dmndQty ', e)
|
||||
console.log("dmndQty ", e);
|
||||
//field.onChange(Number(e.target.value) * 365 );
|
||||
}}
|
||||
value={Number(field.value) * 365 || 0}
|
||||
// value={Number(field.value) * 365 || 0}
|
||||
value={Number(field.value) || 0}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
@@ -377,7 +386,7 @@ export default function ConCostForm({
|
||||
}
|
||||
childrenBody={
|
||||
<>
|
||||
<ConstCostFeeTable/>
|
||||
<ConstCostFeeTable />
|
||||
</>
|
||||
}
|
||||
bodyClassName={"w-[40vw] h-full"}
|
||||
@@ -414,8 +423,7 @@ export default function ConCostForm({
|
||||
}
|
||||
childrenBody={
|
||||
<>
|
||||
<RateFeeTableModal/>
|
||||
|
||||
<RateFeeTableModal />
|
||||
</>
|
||||
}
|
||||
bodyClassName={"w-[22vw]"}
|
||||
@@ -476,8 +484,7 @@ export default function ConCostForm({
|
||||
type="number"
|
||||
step="0.01"
|
||||
onChange={(e) => {
|
||||
console.log('totalConstCost ', e)
|
||||
|
||||
console.log("totalConstCost ", e);
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly
|
||||
@@ -521,6 +528,9 @@ export default function ConCostForm({
|
||||
type="number"
|
||||
step="0.01"
|
||||
onChange={(e) => {
|
||||
|
||||
if(readonly) return;
|
||||
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
|
||||
@@ -44,6 +44,7 @@ export function PbnstBuseForm({
|
||||
indexBiz = 0,
|
||||
setIndexBiz,
|
||||
form,
|
||||
readonly = false,
|
||||
}: {
|
||||
formType: string;
|
||||
firstBizData?: fcBizType[];
|
||||
@@ -51,6 +52,7 @@ export function PbnstBuseForm({
|
||||
indexMng: number;
|
||||
indexBiz: number;
|
||||
setIndexBiz: (index: number) => void;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const {
|
||||
code,
|
||||
@@ -329,6 +331,7 @@ export function PbnstBuseForm({
|
||||
onClick={addRuseFcltObj}
|
||||
type="button"
|
||||
size={commonButonSize}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가
|
||||
</Button>
|
||||
@@ -343,6 +346,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`buziMoney-${indexMng}-${indexBiz}`}
|
||||
@@ -353,6 +357,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
<MngRegFormDetail
|
||||
@@ -364,6 +369,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`concertedWater-${indexMng}-${indexBiz}`}
|
||||
@@ -374,6 +380,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`wasteFcltinfo-${indexMng}-${indexBiz}`}
|
||||
@@ -384,6 +391,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
<h1 className={formH1Class}>재이용 원수취수 현황</h1>
|
||||
@@ -394,6 +402,7 @@ export function PbnstBuseForm({
|
||||
onClick={() => setIsFcOrgwts(true)}
|
||||
size={commonButonSize}
|
||||
className=""
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -412,6 +421,7 @@ export function PbnstBuseForm({
|
||||
indexMng={indexMng}
|
||||
formNm={"fcOrgwts"}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
<h1 className={formH1Class}>재이용 공급관로 설치 현황</h1>
|
||||
@@ -424,6 +434,7 @@ export function PbnstBuseForm({
|
||||
className="w-32"
|
||||
selectClass="w-full"
|
||||
onSelectValue={(val) => setPpiYn(String(val))}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
<Label className="text-right">합계</Label>
|
||||
<Input
|
||||
@@ -439,6 +450,7 @@ export function PbnstBuseForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl"
|
||||
onClick={plusHist}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -447,6 +459,7 @@ export function PbnstBuseForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl !bg-red-500 !text-white ml-1"
|
||||
onClick={removeSelected}
|
||||
disabled={readonly}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
@@ -471,6 +484,7 @@ export function PbnstBuseForm({
|
||||
form={form}
|
||||
formNm={"pplInstls"}
|
||||
upHeadList={[]}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -494,7 +508,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={false}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -510,6 +524,7 @@ export function PbnstBuseForm({
|
||||
}}
|
||||
size={commonButonSize}
|
||||
className="mt-6 mr-3"
|
||||
disabled={readonly}
|
||||
>
|
||||
수요처 추가
|
||||
</Button>
|
||||
@@ -523,6 +538,7 @@ export function PbnstBuseForm({
|
||||
}}
|
||||
size={commonButonSize}
|
||||
className="mt-6"
|
||||
disabled={readonly}
|
||||
>
|
||||
수요처 신규등록
|
||||
</Button>
|
||||
@@ -575,6 +591,7 @@ export function PbnstBuseForm({
|
||||
searchPk: item.dmdInfoId,
|
||||
};
|
||||
})}
|
||||
readonly={readonly}
|
||||
></SearchInputText>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -611,6 +628,7 @@ export function PbnstBuseForm({
|
||||
selectArray={code.dmdUszCd}
|
||||
onSelectValue={f.onChange}
|
||||
value={f.value ?? code.dmdUszCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -630,6 +648,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(date),
|
||||
}}
|
||||
selectClass={"rounded-lg !w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -652,6 +671,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(date),
|
||||
}}
|
||||
selectClass={"rounded-lg !w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -670,6 +690,7 @@ export function PbnstBuseForm({
|
||||
handleCommaNumberChange(e, f.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(f.value)}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -690,6 +711,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(val)
|
||||
}
|
||||
value={f.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -41,13 +41,13 @@ export function PbnstMngForm({
|
||||
formType,
|
||||
indexMng,
|
||||
setIndexMng,
|
||||
readonly
|
||||
readonly,
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
formType: string;
|
||||
indexMng: number;
|
||||
setIndexMng: (index: number) => void;
|
||||
readonly:boolean
|
||||
readonly: boolean;
|
||||
}) {
|
||||
const { code, pbnst, fileDelete, fileDownLoad } = useWrStore(
|
||||
(state) => state
|
||||
@@ -60,6 +60,7 @@ export function PbnstMngForm({
|
||||
const [mngMtdCode, setMngMtdCode] =
|
||||
useState<{ name: string; val: SelectDataType[] }[]>();
|
||||
|
||||
|
||||
const {
|
||||
fields: fcOpersField,
|
||||
prepend,
|
||||
@@ -87,7 +88,6 @@ export function PbnstMngForm({
|
||||
endDt: new Date(),
|
||||
});
|
||||
//trigger(`items.${indexMng}.fcOpers`);
|
||||
|
||||
};
|
||||
|
||||
const removeSelected = () => {
|
||||
@@ -318,6 +318,7 @@ export function PbnstMngForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl"
|
||||
onClick={plusHist}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -326,6 +327,7 @@ export function PbnstMngForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl !bg-red-500 !text-white ml-1"
|
||||
onClick={removeSelected}
|
||||
disabled={readonly}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
@@ -335,20 +337,11 @@ export function PbnstMngForm({
|
||||
<div className="h-[200px] overflow-y-auto">
|
||||
<RuseMngTableForm
|
||||
key={`ruse-table-${indexMng}-${fcOpersField.length}`} // 🔥 length까지 넣어야 동기화됨
|
||||
tableData={form.getValues(`items.${indexMng}.fcOpers`) ||[]}
|
||||
headList={
|
||||
formType === "sttn"
|
||||
? pbnst.pbnstMngUpHeadList.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
readonly: true,
|
||||
};
|
||||
})
|
||||
: pbnst.pbnstMngUpHeadList
|
||||
}
|
||||
tableData={form.getValues(`items.${indexMng}.fcOpers`) || []}
|
||||
headList={pbnst.pbnstMngUpHeadList}
|
||||
upHeadList={pbnst.pbnstMngNm}
|
||||
code={mngMtdCode || []}
|
||||
|
||||
readonly={readonly}
|
||||
indexMng={indexMng}
|
||||
form={form}
|
||||
formNm={"fcOpers"}
|
||||
@@ -372,7 +365,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -396,7 +388,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -419,7 +410,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -435,7 +425,7 @@ export function PbnstMngForm({
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4 my-4">
|
||||
<div className="col-span-6">
|
||||
{formType === "sttn" ? (
|
||||
{readonly ? (
|
||||
relationfiles && relationfiles?.length > 0 ? (
|
||||
<>
|
||||
<Label className="text-3xl">계통도</Label>
|
||||
@@ -472,7 +462,7 @@ export function PbnstMngForm({
|
||||
)}
|
||||
</div>
|
||||
<div className="col-span-6">
|
||||
{formType === "sttn" ? (
|
||||
{readonly ? (
|
||||
planFiles && planFiles?.length > 0 ? (
|
||||
<>
|
||||
<Label className="text-3xl">평면도</Label>
|
||||
|
||||
+15
-4
@@ -21,6 +21,7 @@ export default function MngRegFormDetail({
|
||||
sonClass,
|
||||
indexBiz,
|
||||
indexMng,
|
||||
readonly
|
||||
}: {
|
||||
formList: formDetailType[];
|
||||
h1Title?: string;
|
||||
@@ -30,6 +31,7 @@ export default function MngRegFormDetail({
|
||||
indexBiz?: number;
|
||||
indexMng?: number;
|
||||
sonClass?: string;
|
||||
readonly?:boolean
|
||||
}) {
|
||||
const { code } = useWrStore((state) => state);
|
||||
|
||||
@@ -67,7 +69,10 @@ export default function MngRegFormDetail({
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
readOnly={readonly
|
||||
//|| formHead.option === "disabled" ? true : false
|
||||
|
||||
}
|
||||
|
||||
/>
|
||||
) : formHead.type === "number" ? (
|
||||
@@ -81,7 +86,9 @@ export default function MngRegFormDetail({
|
||||
);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formHead.option === "readOnly" ? true : false}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly" ? true : false
|
||||
}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
@@ -103,7 +110,9 @@ export default function MngRegFormDetail({
|
||||
}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value?.trim() ?? (Array.isArray(potentialOptions) && potentialOptions[0]?.val)}
|
||||
readOnly={formHead.option === "readOnly"}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly"
|
||||
}
|
||||
/>
|
||||
);
|
||||
})()
|
||||
@@ -113,7 +122,9 @@ export default function MngRegFormDetail({
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={formHead.option === "readOnly" ? true : false}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly" ? true : false
|
||||
}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
|
||||
@@ -511,6 +511,7 @@ export default function RainRegForm({
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Button } from "@common/components/ui";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import type { z } from "zod";
|
||||
|
||||
export default function ChkgdModal({ type, obj, setIsModal }: { type: string; obj: any, setIsModal: (open: boolean) => void }) {
|
||||
export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: string; obj: any, setIsModal: (open: boolean) => void, readonly: boolean }) {
|
||||
const {
|
||||
rainChkgdn,
|
||||
rswtChkgdn,
|
||||
@@ -247,7 +247,7 @@ export default function ChkgdModal({ type, obj, setIsModal }: { type: string; ob
|
||||
}
|
||||
></Title>
|
||||
{!rainChkSttn.isSttn ? (
|
||||
<Button className="mt-8 mr-7" onClick={allDataUpdate}>
|
||||
<Button className="mt-8 mr-7" onClick={allDataUpdate} disabled={!readonly}>
|
||||
저장
|
||||
</Button>
|
||||
) : (
|
||||
@@ -274,6 +274,7 @@ export default function ChkgdModal({ type, obj, setIsModal }: { type: string; ob
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
@@ -288,6 +289,7 @@ export default function ChkgdModal({ type, obj, setIsModal }: { type: string; ob
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
{type !== "RNB" && polutionData !== undefined ? (
|
||||
@@ -310,6 +312,7 @@ export default function ChkgdModal({ type, obj, setIsModal }: { type: string; ob
|
||||
setChGuidData={(data) => {
|
||||
getPolutionData(data);
|
||||
}}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
@@ -138,7 +138,6 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
});
|
||||
});
|
||||
}
|
||||
console.log(tableData);
|
||||
if (tableData && tableData.length > 0) {
|
||||
setRuseTableData(tableData as any[]);
|
||||
}
|
||||
@@ -216,9 +215,6 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
(usageTotalObj as any)[key] = val;
|
||||
}
|
||||
const tableData = [...inUsageData, ...outUsageData, usageTotalObj];
|
||||
console.log("inusageData", inUsageData)
|
||||
console.log("outUsageData", outUsageData)
|
||||
console.log("tableData", tableData)
|
||||
setPrfData({
|
||||
inPrf: inUsageData,
|
||||
outPrf: outUsageData,
|
||||
@@ -248,10 +244,6 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
|
||||
}, [data, form])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
console.log("prfData", prfData);
|
||||
}, [prfData])
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
|
||||
@@ -12,10 +12,13 @@ import { useForm } from "react-hook-form";
|
||||
import type { z } from "zod";
|
||||
|
||||
export default function CoDetailModal({
|
||||
formObj,onFormSubmit
|
||||
formObj,
|
||||
onFormSubmit,
|
||||
readonly
|
||||
}: {
|
||||
formObj: any;
|
||||
onFormSubmit:(values:customLdrmnt)=>void;
|
||||
onFormSubmit: (values: customLdrmnt) => void;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const defaultValues: z.infer<typeof ldrmntZod> = ldrmntZod.parse({});
|
||||
const form = useForm<z.infer<typeof ldrmntZod>>({
|
||||
@@ -52,7 +55,11 @@ export default function CoDetailModal({
|
||||
<h1 className="text-2xl font-medium text-label col-span-10">
|
||||
잠재수요처 상세정보
|
||||
</h1>
|
||||
<Button type="submit" className="col-start-12 col-span-1" size={"sm"}>
|
||||
<Button type="submit"
|
||||
className="col-start-12 col-span-1"
|
||||
size={"sm"}
|
||||
disabled={readonly}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
@@ -71,7 +78,6 @@ export default function CoDetailModal({
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-4 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
@@ -86,8 +92,9 @@ export default function CoDetailModal({
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -108,13 +115,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-4 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
@@ -131,6 +138,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -151,6 +159,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -173,6 +182,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -193,6 +203,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -213,6 +224,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -235,12 +247,12 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
@@ -256,6 +268,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -278,6 +291,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -298,6 +312,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -318,14 +333,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={13}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="grid grid-cols-5 gap-2 mt-4">
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
@@ -344,6 +358,7 @@ export default function CoDetailModal({
|
||||
value={formatCommaNumber(field.value)}
|
||||
min={0}
|
||||
maxLength={8}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -365,6 +380,7 @@ export default function CoDetailModal({
|
||||
value={formatCommaNumber(field.value)}
|
||||
min={0}
|
||||
maxLength={8}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -386,6 +402,7 @@ export default function CoDetailModal({
|
||||
value={formatCommaNumber(field.value)}
|
||||
min={0}
|
||||
maxLength={8}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -407,6 +424,7 @@ export default function CoDetailModal({
|
||||
value={formatCommaNumber(field.value)}
|
||||
min={0}
|
||||
maxLength={8}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -434,7 +452,6 @@ export default function CoDetailModal({
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
@@ -451,6 +468,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -471,6 +489,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -491,13 +510,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
@@ -514,6 +533,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -534,6 +554,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -554,14 +575,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
@@ -578,6 +598,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -598,6 +619,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -618,14 +640,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
@@ -642,6 +663,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -662,6 +684,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -682,13 +705,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
@@ -705,6 +728,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -725,6 +749,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -745,6 +770,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -767,6 +793,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -787,13 +814,13 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={txtSize}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-4 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
@@ -810,6 +837,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={50}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -830,6 +858,7 @@ export default function CoDetailModal({
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
maxLength={50}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Input } from "@common/components/ui";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
|
||||
type SearchType = {
|
||||
@@ -10,6 +11,7 @@ type thisProps = {
|
||||
setValue: (searchNm?: string) => void;
|
||||
setRtnData: (rtnData: any) => void;
|
||||
searchList?: any[];
|
||||
readonly?:boolean
|
||||
};
|
||||
export default function SearchInputText({
|
||||
label = undefined,
|
||||
@@ -17,6 +19,7 @@ export default function SearchInputText({
|
||||
setValue = () => {},
|
||||
setRtnData = () => {},
|
||||
searchList = undefined,
|
||||
readonly = false, // 추가: readonly prop
|
||||
}: thisProps) {
|
||||
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
@@ -65,13 +68,14 @@ export default function SearchInputText({
|
||||
|
||||
return (
|
||||
<div ref={wrapperRef}>
|
||||
<input
|
||||
<Input
|
||||
type="text"
|
||||
value={textValue}
|
||||
onChange={handleInputChange}
|
||||
/* onFocus={() => setIsOpen(true)} */
|
||||
className="w-full h-[3.2rem] !text-xl pl-3 text-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
placeholder={`${label}을(를) 입력하세요`}
|
||||
readOnly={readonly} // readonly 상태 적용
|
||||
/>
|
||||
{isOpen && (
|
||||
<div className=" z-1 w-full mt-2 bg-white border border-gray-300 rounded-md shadow-lg h-90 overflow-auto">
|
||||
|
||||
@@ -17,12 +17,14 @@ export function GuideDetailsTable({
|
||||
headList,
|
||||
upheadList,
|
||||
setChGuidData,
|
||||
readonly
|
||||
}: {
|
||||
chgRes: any[];
|
||||
headList: TableUpperProps[];
|
||||
upheadList: chHeadType[];
|
||||
type: string;
|
||||
setChGuidData: (chgRes: any[]) => void;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const [inputData, setInputData] = useState<any[]>();
|
||||
|
||||
@@ -30,7 +32,6 @@ export function GuideDetailsTable({
|
||||
setInputData(chgRes);
|
||||
}, [chgRes]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setChGuidData(inputData ?? []);
|
||||
|
||||
@@ -43,7 +44,7 @@ export function GuideDetailsTable({
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">{headMakeprfmnc(headList, upheadList)}</TableHeader>
|
||||
<TableBody >
|
||||
{InputTableBody(inputData ?? [], headList, setInputData)}
|
||||
{InputTableBody(inputData ?? [], headList, setInputData, readonly)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@ export default function RainChkgdTable({
|
||||
pageNation,
|
||||
onPageChange,
|
||||
pageCount,
|
||||
readonly,
|
||||
}: {
|
||||
detailUp: (data: rainChkZodType[]) => void;
|
||||
handleClick?: (data: any) => void;
|
||||
@@ -33,6 +34,7 @@ export default function RainChkgdTable({
|
||||
pageNation: number;
|
||||
onPageChange: (page: number) => void;
|
||||
pageCount: number;
|
||||
readonly: boolean;
|
||||
}) {
|
||||
const { code, rainChkgdn, rainChkSttn, getRainSttnExcel } = useWrStore((state) => state);
|
||||
const [makeTableData, setMakeTableData] = useState<any[]>([]);
|
||||
@@ -191,7 +193,8 @@ export default function RainChkgdTable({
|
||||
handleChange,
|
||||
toggleSelection,
|
||||
selectedIds,
|
||||
handleCellClick
|
||||
handleCellClick,
|
||||
readonly
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
@@ -26,6 +26,7 @@ export default function RswtChkgdTable({
|
||||
pageNation,
|
||||
onPageChange,
|
||||
pageCount,
|
||||
readonly = false,
|
||||
}: {
|
||||
detaiRswtlUpdate: (data: rswtrChkDetailsZodType[]) => void;
|
||||
handleRswtClick?: (data: any) => void;
|
||||
@@ -34,6 +35,7 @@ export default function RswtChkgdTable({
|
||||
pageNation: number;
|
||||
onPageChange: (page: number) => void;
|
||||
pageCount: number;
|
||||
readonly:boolean
|
||||
}) {
|
||||
const { code, rswtChkgdn, rswtChkSttn, rswtChkPolAndGuide, getRswtSttnExcel } = useWrStore(
|
||||
(state) => state
|
||||
@@ -149,7 +151,8 @@ export default function RswtChkgdTable({
|
||||
handleChange,
|
||||
toggleSelection,
|
||||
selectedIds,
|
||||
handleCellClick
|
||||
handleCellClick,
|
||||
readonly
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
@@ -35,6 +35,7 @@ type RuseMngTableProps = {
|
||||
indexBiz?: number;
|
||||
form?: any;
|
||||
formNm?: string;
|
||||
readonly?: boolean;
|
||||
};
|
||||
|
||||
const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
@@ -48,6 +49,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
form,
|
||||
formNm,
|
||||
indexBiz,
|
||||
readonly= false
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
@@ -111,7 +113,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
? formatCommaNumber(field.value)
|
||||
: field.value || ""
|
||||
}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={readonly|| head.readonly ? true : false}
|
||||
maxLength={head.maxLength?head.maxLength:15}
|
||||
/>
|
||||
) : head.type === "select" ? (
|
||||
@@ -132,7 +134,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
field.onChange(val);
|
||||
}
|
||||
}}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={ readonly||head.readonly ? true : false}
|
||||
// Disabled prop removed as SelectBox does not support it
|
||||
></SelectBox>
|
||||
) : head.type === "date" ? (
|
||||
@@ -149,14 +151,18 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
},
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={readonly||head.readonly ? true : false}
|
||||
/>
|
||||
) : head.type === "checkbox" ? (
|
||||
<Checkbox
|
||||
className=""
|
||||
checked={field.value || false}
|
||||
onCheckedChange={(checked) => {
|
||||
field.onChange(checked);
|
||||
if(readonly || head.readonly) {
|
||||
return;
|
||||
}else{
|
||||
field.onChange(checked);
|
||||
}
|
||||
}}
|
||||
></Checkbox>
|
||||
) : (
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -163,7 +163,10 @@ function Gis({
|
||||
featureId = data.bscFctCd;
|
||||
} else if (layerName === '온배수시설') {
|
||||
featureId = data.bdstRuseFcltSn;
|
||||
} else {
|
||||
} else if(layerName == '수요처'){
|
||||
featureId = data.dmdInfoId.replaceAll('-','')
|
||||
}
|
||||
else {
|
||||
console.warn('해당 레이어에 대한 featureId 매핑 없음', layerNm);
|
||||
featureId = data.fid || data.id || data.ftrIdn;
|
||||
}
|
||||
|
||||
@@ -215,6 +215,8 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
form.setValue('rgtr', '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e');
|
||||
|
||||
if(updateList?.dmdInfoId){
|
||||
form.reset(updateList)
|
||||
if(updateList?.dmdInfoId.slice(10,14) !== '0000') {
|
||||
|
||||
@@ -122,8 +122,8 @@ export function UiTable({
|
||||
: cellClick
|
||||
? "cursor-pointer"
|
||||
: ""
|
||||
} sticky z-40 bg-secondary !font-bold`}
|
||||
style={{ top: `${headerHeight + index * 39}px` }}
|
||||
} sticky top-20 z-40 bg-secondary !font-bold`}
|
||||
style={{ top: `${headerHeight + index * 32-4}px` }}
|
||||
onClick={() => handleCellClick(index, head.id)}
|
||||
key={`cell-${head.id}-${index}`}
|
||||
>
|
||||
|
||||
@@ -31,7 +31,7 @@ const TableHeader = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<thead
|
||||
ref={ref}
|
||||
className={cn("sticky top-0 z-10 bg-secondary [&_tr]:border-b", className)}
|
||||
className={cn("sticky -top-3 z-10 bg-secondary [&_tr]:border-b", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user