하수처리시설 기본계획다운로드
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
|
|||||||
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||||
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
|
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_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||||
NEXT_PUBLIC_DC_URL = https://apigateway.rsonesoft.com #자료관 데이터
|
NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com #자료관 데이터
|
||||||
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
||||||
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ type LayerComponentProps = {
|
|||||||
rainMeasureData?: any;
|
rainMeasureData?: any;
|
||||||
onSaveClick?: () => void;
|
onSaveClick?: () => void;
|
||||||
onFormDataChange?: (data: any) => void; // 추가
|
onFormDataChange?: (data: any) => void; // 추가
|
||||||
|
gisObject?: Record<string, any>; // GIS 객체 추가
|
||||||
};
|
};
|
||||||
type LayerContentMap = {
|
type LayerContentMap = {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
@@ -22,7 +23,7 @@ type LayerContentMap = {
|
|||||||
// 레이어 이름과 컴포넌트를 매핑
|
// 레이어 이름과 컴포넌트를 매핑
|
||||||
// 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업
|
// 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업
|
||||||
const layerContentMap: LayerContentMap = {
|
const layerContentMap: LayerContentMap = {
|
||||||
// "하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리
|
"하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리
|
||||||
"하수처리구역": {},
|
"하수처리구역": {},
|
||||||
"우수토실": { component: Ssc, },
|
"우수토실": { component: Ssc, },
|
||||||
"중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정
|
"중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
|
'use client'
|
||||||
|
import React, { useState,useEffect } from 'react'
|
||||||
import Modal from '@/components/ui/modal';
|
import Modal from '@/components/ui/modal';
|
||||||
import { VerticalTable } from '@/components/ui/verticalTable';
|
import { VerticalTable } from '@/components/ui/verticalTable';
|
||||||
import { UiTable } from '@common/business_components/ui';
|
import { UiTable } from '@common/business_components/ui';
|
||||||
import { Button, TableCell } from '@common/components/ui';
|
import { Button } from '@common/components/ui';
|
||||||
import React, { useState } from 'react'
|
import { useDcTree, flattenFolders, getFileDownload, addFileName, type FlattenedFolder} from '../../searchModal/searchModalReportApi';
|
||||||
|
|
||||||
// 하수처리시설
|
// 하수처리시설
|
||||||
const headList = [
|
const headList = [
|
||||||
{ id: "title", title: "하수도정비 기본계획보고서" },
|
{ id: "title", title: "하수도정비 기본계획보고서" },
|
||||||
{ id: "cad", title: "하수도대장 평면도" },]
|
];
|
||||||
const modalHeadList = [
|
const modalHeadList = [
|
||||||
{ id: "no", title: "번호" },
|
{ id: "no", title: "번호" },
|
||||||
{ id: "year", title: "승인연도" },
|
{ id: "year", title: "승인연도" },
|
||||||
@@ -16,9 +18,10 @@ const modalHeadList = [
|
|||||||
{ id: "date", title: "입력시간" },
|
{ id: "date", title: "입력시간" },
|
||||||
]
|
]
|
||||||
|
|
||||||
const SwtrmtFclt = () => {
|
const SwtrmtFclt = ({ gisObject }: { gisObject: any }) => {
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
const [modalTitle, setModalTitle] = useState<string>('');
|
const [modalTitle, setModalTitle] = useState<string>('');
|
||||||
|
const [dcDataOne, setDcDataOne] = useState<FlattenedFolder|undefined>({});
|
||||||
const openModal = (title: string) => {
|
const openModal = (title: string) => {
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
setModalTitle(title)
|
setModalTitle(title)
|
||||||
@@ -26,22 +29,59 @@ const SwtrmtFclt = () => {
|
|||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
};
|
};
|
||||||
|
const ctpvNm = gisObject?.ctpv_nm;
|
||||||
|
//const reportOriginData = useDcTree(ctpvNm);
|
||||||
|
const reportOriginData = useDcTree("강원특별자치도");
|
||||||
|
useEffect(() => {
|
||||||
|
const fetch = async () => {
|
||||||
|
|
||||||
|
if (!reportOriginData || reportOriginData.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const reportData = flattenFolders(reportOriginData);
|
||||||
|
let filterReportData = [...reportData];
|
||||||
|
if (gisObject && gisObject.sgg_nm !== undefined && gisObject.sgg_nm !== "") { // 시군구검색
|
||||||
|
//const sggNm = gisObject?.sgg_nm;
|
||||||
|
const sggNm = "강릉시";
|
||||||
|
filterReportData = filterReportData.filter(item => item.sigungu === sggNm);
|
||||||
|
}
|
||||||
|
addFileName(filterReportData).then(data => {
|
||||||
|
filterReportData = data.filter(item => item.filePath !== undefined && item.filePath !== "");
|
||||||
|
if (filterReportData !== undefined && filterReportData.length > 0) {
|
||||||
|
setDcDataOne(filterReportData[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log("filterReportData", filterReportData);
|
||||||
|
};
|
||||||
|
fetch();
|
||||||
|
}, [reportOriginData]);
|
||||||
|
|
||||||
|
// 하수도정비기본계획 filedownload 핸들러
|
||||||
|
const handleFileDownloadClick = () => {
|
||||||
|
if (dcDataOne && dcDataOne !== undefined && dcDataOne.fileSn !== undefined && dcDataOne.fileSn !== ""
|
||||||
|
&& dcDataOne.filePath !== undefined && dcDataOne.filePath !== "" && dcDataOne.fileName !== undefined && dcDataOne.fileName !== "" ) {
|
||||||
|
console.log("dcDataOne", dcDataOne);
|
||||||
|
getFileDownload(String(dcDataOne.fileSn), String(dcDataOne.fileName), String(dcDataOne.filePath));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//cad: <Button onClick={() => openModal('하수도대장 평면도')}>평면도</Button>,
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<VerticalTable children={{
|
<VerticalTable
|
||||||
title: <Button onClick={() => openModal('하수도정비 기본계획보고서')}>보고서</Button>,
|
children={{
|
||||||
cad: <Button onClick={() => openModal('하수도대장 평면도')}>평면도</Button>,
|
title: <Button className="gray" onClick={() => handleFileDownloadClick()}>다운로드</Button>
|
||||||
}} headName='디지털 자료관 연계정보' tableData={[]} headlist={headList} pageSize={20} total={0} cellClick={undefined} isEditable={true} onPageChange={function (page: number): void {
|
}} headName='디지털 자료관 연계정보' tableData={[]} headlist={headList} pageSize={20} total={0} cellClick={undefined} isEditable={true} onPageChange={function (page: number): void {
|
||||||
throw new Error("Function not implemented.");
|
throw new Error("Function not implemented.");
|
||||||
}}></VerticalTable>
|
}}></VerticalTable>
|
||||||
<Modal isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} closeModal={closeModal}>
|
{/* <Modal isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} closeModal={closeModal}>
|
||||||
<div className='grid grid-col-2'>
|
<div className='grid grid-col-2'>
|
||||||
<UiTable headName={modalTitle} tableData={[]} headlist={modalHeadList} pageSize={20} total={0} cellClick={undefined} children={undefined} onPageChange={function (page: number): void {
|
<UiTable headName={modalTitle} tableData={[]} headlist={modalHeadList} pageSize={20} total={0} cellClick={undefined} onPageChange={function (page: number): void {
|
||||||
throw new Error("Function not implemented.");
|
throw new Error("Function not implemented.");
|
||||||
}
|
}
|
||||||
}></UiTable>
|
}></UiTable>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal> */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
onSaveClick={handleSaveClick}
|
onSaveClick={handleSaveClick}
|
||||||
chmbrXcnts={chmbrXcnts}
|
chmbrXcnts={chmbrXcnts}
|
||||||
chmbrYdnts={chmbrYdnts}
|
chmbrYdnts={chmbrYdnts}
|
||||||
|
gisObject={featureData.values_}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ export function flattenFolders(data: Folder[]): FlattenedFolder[] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.forEach((root) => traverse(root, {}, 0));
|
if (data && data.length > 0 && data[0].clsfSystmNm == "기본계획") { // data가 비어있지 않고 children이 있는 경우에만 처리
|
||||||
|
data.forEach((root) => traverse(root, {}, 0));
|
||||||
|
} else {
|
||||||
|
data.forEach((root) => traverse(root, {}, 1));
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,13 +100,15 @@ export const useDcTree = (clsfSystmNm:string) => {
|
|||||||
if (result) {
|
if (result) {
|
||||||
setData(result);
|
setData(result);
|
||||||
}
|
}
|
||||||
|
console.log("useDcTree호출");
|
||||||
|
console.log("clsfSystmNm:", clsfSystmNm, "data:", result);
|
||||||
};
|
};
|
||||||
fetch();
|
fetch();
|
||||||
console.log("useDcTree호출");
|
|
||||||
}, [clsfSystmNm]);
|
}, [clsfSystmNm]);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDcFile = async (clsfSystmSn:string) => {
|
export const getDcFile = async (clsfSystmSn:string) => {
|
||||||
const queryString = 'clsfSystmSn='+clsfSystmSn;
|
const queryString = 'clsfSystmSn='+clsfSystmSn;
|
||||||
const result = await getDcData(`/api/v1/dc/file${queryString ? `?${queryString}` : ''}`);
|
const result = await getDcData(`/api/v1/dc/file${queryString ? `?${queryString}` : ''}`);
|
||||||
@@ -119,7 +125,7 @@ export const addFileName = async (data:FlattenedFolder[]) => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
return fileReportData;
|
return fileReportData;
|
||||||
}
|
};
|
||||||
export const getDcFileprcs = async (fileSn:string) => {
|
export const getDcFileprcs = async (fileSn:string) => {
|
||||||
const queryString = 'fileSn='+fileSn;
|
const queryString = 'fileSn='+fileSn;
|
||||||
const result = await getDcData(`/api/v1/dc/fileprcs${queryString ? `?${queryString}` : ''}`);
|
const result = await getDcData(`/api/v1/dc/fileprcs${queryString ? `?${queryString}` : ''}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user