Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend
This commit is contained in:
@@ -15,7 +15,7 @@ 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_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/sewerage-service
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
||||
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
||||
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl
|
||||
NEXT_PUBLIC_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/sewerage-service
|
||||
NEXT_PUBLIC_DC_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/dc-service
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
||||
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
||||
|
||||
@@ -40,6 +40,14 @@ export const generateYearDates = (searchYear: string) => {
|
||||
return dates;
|
||||
}
|
||||
|
||||
type FacilityType = {
|
||||
bscFctCd: string;
|
||||
bscFctNm: string;
|
||||
fcltyCpc: number | '';
|
||||
trtFrfNm: string | '';
|
||||
efflWqltStndrdNm: string | '';
|
||||
}
|
||||
|
||||
export default function DashBoard() {
|
||||
// 입력값 상태 관리
|
||||
const { Common, initializeCommonData, searchMainGraph, searchRainManage, searchOperationStatus, OperationStatus, RainManage, MainGraph, PlanFclty } = useFoStore((state) => state);
|
||||
@@ -48,26 +56,10 @@ export default function DashBoard() {
|
||||
const [filteredSigunData, setFilteredSigunData] = useState<SelectDataType[]>([{ text: "전체", val: '0' }]);
|
||||
const [sidoValue, setSidoValue] = useState<string>('0');
|
||||
const [sigunValue, setSigunValue] = useState<string>('0');
|
||||
const {
|
||||
isInit,
|
||||
selectSearchYear,
|
||||
btnClass,
|
||||
selectSidoData,
|
||||
selectSigunData,
|
||||
} = Common;
|
||||
|
||||
const {
|
||||
planFcltyList
|
||||
} = PlanFclty;
|
||||
|
||||
const {
|
||||
operationalStatusList
|
||||
} = OperationStatus;
|
||||
|
||||
const {
|
||||
excelList
|
||||
} = RainManage;
|
||||
|
||||
const { isInit, selectSearchYear, btnClass, selectSidoData, selectSigunData, } = Common;
|
||||
const { planFcltyList } = PlanFclty;
|
||||
const { operationalStatusList } = OperationStatus;
|
||||
const { excelList } = RainManage;
|
||||
const {
|
||||
chart_inflowRain,
|
||||
chart_bodRain,
|
||||
@@ -79,10 +71,10 @@ export default function DashBoard() {
|
||||
} = MainGraph;
|
||||
|
||||
/******************선택된 데이터******************/
|
||||
// 연도
|
||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || '0');
|
||||
|
||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || '0'); // 연도
|
||||
// 시설명
|
||||
const [fcltyList, setFcltyList] = useState<{ bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | '' }>({
|
||||
const [fcltyList, setFcltyList] = useState<FacilityType>({
|
||||
bscFctCd: '11000SW001R',
|
||||
bscFctNm: '난지',
|
||||
fcltyCpc: 860000,
|
||||
@@ -90,7 +82,7 @@ export default function DashBoard() {
|
||||
efflWqltStndrdNm: '500톤 이상(Ⅲ지역)'
|
||||
});
|
||||
|
||||
const [searchFcltyList, setSearchFcltyList] = useState<{ bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | '' }>({
|
||||
const [searchFcltyList, setSearchFcltyList] = useState<FacilityType>({
|
||||
bscFctCd: '',
|
||||
bscFctNm: '',
|
||||
fcltyCpc: '',
|
||||
@@ -111,7 +103,7 @@ export default function DashBoard() {
|
||||
}
|
||||
}, [isInit, initializeCommonData]);
|
||||
|
||||
const handleFacilityChange = (facility: { bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | '' }) => {
|
||||
const handleFacilityChange = (facility: FacilityType) => {
|
||||
setFcltyList(facility);
|
||||
};
|
||||
|
||||
@@ -255,60 +247,6 @@ export default function DashBoard() {
|
||||
headerRange: 'A1:J1',
|
||||
sheetName: '주요그래프'
|
||||
}
|
||||
/* {
|
||||
data: [['날짜', '강수량'],...chart_inflowRain.map((item) => [item.label, roundNumber(item.barVal0, 1)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '강수량'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '유입하수량'],...chart_inflowRain.map((item) => [item.label, roundNumber(item.lineVal1, 0)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '유입하수량'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '시설용량'],...chart_inflowRain.map((item) => [item.label, roundNumber(item.lineVal0, 0)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '시설용량'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '유입BOD'],...chart_bodRain.map((item) => [item.label, roundNumber(item.lineVal0, 1)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '유입BOD'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '유입T-P'],...chart_inflTp.map((item) => [item.label, roundNumber(item.val, 3)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '유입T-P'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '총인유입T-P'],...chart_chongInTp.map((item) => [item.label, roundNumber(item.val, 3)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '총인유입T-P'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '방류T-P'],...chart_efflTp.map((item) => [item.label, roundNumber(item.val, 3)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '방류T-P'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '유입T-N'],...chart_inflTn.map((item) => [item.label, roundNumber(item.val, 3)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '유입T-N'
|
||||
},
|
||||
{
|
||||
data: [['날짜', '방류T-N'],...chart_efflTn.map((item) => [item.label, roundNumber(item.val, 3)])],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:B1',
|
||||
sheetName: '방류T-N'
|
||||
} */
|
||||
];
|
||||
|
||||
downloadMultipleExcel('주요그래프', sheetParameter);
|
||||
|
||||
@@ -20,13 +20,13 @@ const commentArray = [
|
||||
]
|
||||
|
||||
export default function PlanSewage() {
|
||||
const {Common
|
||||
,PlanSewage
|
||||
,PlanSewageSearch
|
||||
,initializeCommonData
|
||||
,searchPlanSewageList
|
||||
} = useFoStore((state) => state) || { processAreaList: { processAreaList: [] }};
|
||||
|
||||
const { Common
|
||||
, PlanSewage
|
||||
, PlanSewageSearch
|
||||
, initializeCommonData
|
||||
, searchPlanSewageList
|
||||
} = useFoStore((state) => state) || { processAreaList: { processAreaList: [] } };
|
||||
|
||||
const {
|
||||
isInit,
|
||||
selectUpdownData,
|
||||
@@ -42,7 +42,7 @@ export default function PlanSewage() {
|
||||
} = Common;
|
||||
|
||||
const {
|
||||
labelArray,
|
||||
labelArray,
|
||||
} = PlanSewageSearch;
|
||||
|
||||
const {
|
||||
@@ -69,9 +69,9 @@ export default function PlanSewage() {
|
||||
|
||||
// 그리드 관련
|
||||
const searchInputRef = useRef<HTMLDivElement & HTMLInputElement>(null);
|
||||
|
||||
|
||||
// 모달 상태 추가
|
||||
|
||||
|
||||
// 초기화 변수
|
||||
const [resetPage, setResetPage] = useState<boolean>(false);
|
||||
// 표 너비
|
||||
@@ -109,17 +109,17 @@ export default function PlanSewage() {
|
||||
input.value = "";
|
||||
}
|
||||
}
|
||||
ref.current.sidoValue='11';
|
||||
ref.current.sidoValue = '11';
|
||||
searchPlanSewage(ref.current, 1, 10);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if(!excelTrigger) return;
|
||||
if (!excelTrigger) return;
|
||||
|
||||
if (excelList && excelList.length > 0) {
|
||||
downloadExcel({
|
||||
data: excelList as unknown as JSON[],
|
||||
fileName: '계획하수량 산정지표 현황',
|
||||
downloadExcel({
|
||||
data: excelList as unknown as JSON[],
|
||||
fileName: '계획하수량 산정지표 현황',
|
||||
sheetNameArray: ['계획하수량 산정지표 현황'],
|
||||
headerRange: 'A1:M1'
|
||||
});
|
||||
@@ -130,31 +130,31 @@ export default function PlanSewage() {
|
||||
* 콜백함수
|
||||
*/
|
||||
// 조회
|
||||
const searchPlanSewage = useCallback(({ partValue, regionValue, unitWaterShedValue, middleRegionValue, envPartValue, sidoValue, sigunValue }: ReturnType, pageNo: number, pageCnt:number=20) => {
|
||||
const searchPlanSewage = useCallback(({ partValue, regionValue, unitWaterShedValue, middleRegionValue, envPartValue, sidoValue, sigunValue }: ReturnType, pageNo: number, pageCnt: number = 20) => {
|
||||
let nameCd, partStr
|
||||
switch (partValue) {
|
||||
case 'R':
|
||||
if (regionValue !== '0') {
|
||||
if(unitWaterShedValue==='0') nameCd = regionValue;
|
||||
else if (middleRegionValue==='0') nameCd = unitWaterShedValue;
|
||||
if (unitWaterShedValue === '0') nameCd = regionValue;
|
||||
else if (middleRegionValue === '0') nameCd = unitWaterShedValue;
|
||||
else nameCd = middleRegionValue;
|
||||
}
|
||||
partStr = partValue
|
||||
break;
|
||||
default:
|
||||
if(sidoValue !== '0') nameCd = ref.current.sidoValue!="0"?ref.current.sidoValue:sidoValue;
|
||||
if(sigunValue !== '0') nameCd = sigunValue;
|
||||
partStr = envPartValue !== '0' ? envPartValue:partValue;
|
||||
if (sidoValue !== '0') nameCd = ref.current.sidoValue != "0" ? ref.current.sidoValue : sidoValue;
|
||||
if (sigunValue !== '0') nameCd = sigunValue;
|
||||
partStr = envPartValue !== '0' ? envPartValue : partValue;
|
||||
break;
|
||||
}
|
||||
|
||||
if(partStr === 'G'){
|
||||
partValue = partValue==='G'?'A':partValue;
|
||||
if (partStr === 'G') {
|
||||
partValue = partValue === 'G' ? 'A' : partValue;
|
||||
searchPlanSewageList(pageNo, pageCnt, searchYear, partValue);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
searchPlanSewageList(pageNo, pageCnt, searchYear, partStr, nameCd || '0', fcltCpct, operationValue, fcltyName.trim() !== "" || fcltyName.trim() !== null ? fcltyName : undefined);
|
||||
}
|
||||
}
|
||||
}, [operationValue, fcltyName, searchPlanSewageList, searchYear, fcltCpct]);
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ export default function PlanSewage() {
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (!isInit) {
|
||||
if(!initTrigger){
|
||||
if (!initTrigger) {
|
||||
initializeCommonData();
|
||||
searchPlanSewage(ref.current, 1, 10);
|
||||
setInitTrigger(true);
|
||||
@@ -170,9 +170,9 @@ export default function PlanSewage() {
|
||||
}
|
||||
}, [isInit, initializeCommonData, searchPlanSewageList, selectSearchYear, initTrigger, searchPlanSewage]);
|
||||
|
||||
const chkVal = useCallback((returntype:ReturnType) => {
|
||||
const chkVal = useCallback((returntype: ReturnType) => {
|
||||
// setWidthSize(returntype.partValue=='A' ?"w-[120%]":"w-[130%]")
|
||||
setUpheadList(returntype.partValue == 'R' ? upHeadList2 : returntype.partValue == 'G'?upHeadList3:upHeadList1);
|
||||
setUpheadList(returntype.partValue == 'R' ? upHeadList2 : returntype.partValue == 'G' ? upHeadList3 : upHeadList1);
|
||||
setResetPage(true);
|
||||
}, [upHeadList1, upHeadList2, upHeadList3]);
|
||||
|
||||
@@ -190,11 +190,11 @@ export default function PlanSewage() {
|
||||
|
||||
const mainList = planSewageList || [];
|
||||
const total = planSewageCount || 0;
|
||||
|
||||
|
||||
return (
|
||||
<MainDiv>
|
||||
<Title title="계획하수량 산정지표 현황" />
|
||||
<SearchBaseForm
|
||||
<SearchBaseForm
|
||||
leftChildren={<>
|
||||
<SelectBox className="col-span-3" label={labelArray[3] as string} selectArray={selectUpdownData} onSelectValue={(val) => setFcltCpct(val.toString())} value={fcltCpct} selectClass={undefined} />
|
||||
<SearchInput className={"col-span-3"} label={labelArray[4] as string} textValue={fcltyName} setText={setFcltyName} />
|
||||
@@ -212,12 +212,12 @@ export default function PlanSewage() {
|
||||
queryClick={chkVal}
|
||||
excelClick={excelDownload}
|
||||
initClick={resetVal}
|
||||
ref={ref} isAdmin={false} initSidoValue={"11"}/>
|
||||
ref={ref} isAdmin={false} initSidoValue={"11"} />
|
||||
<ListDiv>
|
||||
<LoadingOverlay isLoading={isLoading} />
|
||||
<div className="h-full w-full overflow-x-scroll min-[1200px]:overflow-x-hidden">
|
||||
<div className="w-[120%] min-[1200px]:w-[100%]">
|
||||
<UiTable cellClick={ undefined } headName={"계획하수량 산정지표 현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} widthFixed={true} />
|
||||
<div className="w-[120%] min-[1200px]:w-[100%]">
|
||||
<UiTable cellClick={undefined} headName={"계획하수량 산정지표 현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} widthFixed={true} />
|
||||
</div>
|
||||
<UnderComment divHeight={"5"} commentArray={commentArray} />
|
||||
</div>
|
||||
|
||||
@@ -129,14 +129,14 @@ const selectEnvPartSigunData: SelectDataType[] = [
|
||||
// ];
|
||||
|
||||
// 상향 하향 데이터
|
||||
const selectUpdownData:SelectDataType[] = [
|
||||
const selectUpdownData: SelectDataType[] = [
|
||||
{ text: "전체", val: '0' },
|
||||
{ text: "500미만", val: '400' },
|
||||
{ text: "500이상", val: '500' },
|
||||
];
|
||||
|
||||
// 운영 상태 데이터
|
||||
const selectOperationData:SelectDataType[] = [
|
||||
const selectOperationData: SelectDataType[] = [
|
||||
{ text: "전체", val: '0' },
|
||||
{ text: "가동중", val: '1' },
|
||||
{ text: "재가동", val: '2' },
|
||||
@@ -145,7 +145,7 @@ const selectOperationData:SelectDataType[] = [
|
||||
];
|
||||
|
||||
// 시설 구분 데이터
|
||||
const selectFacilityPartData:SelectDataType[] = [
|
||||
const selectFacilityPartData: SelectDataType[] = [
|
||||
{ text: "전체", val: '0' },
|
||||
{ text: "공공하수처리시설", val: 'SW' },
|
||||
{ text: "오수처리장", val: 'SS' },
|
||||
@@ -158,12 +158,18 @@ const selectFacilityPartData:SelectDataType[] = [
|
||||
|
||||
// 년도 데이터
|
||||
const getYearData = () => {
|
||||
const year = new Date().getFullYear();
|
||||
const year1 = year - 1;
|
||||
const year2 = year - 2;
|
||||
const year3 = year - 3;
|
||||
const year4 = year - 4;
|
||||
const year5 = year - 5;
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = today.getMonth() + 1;
|
||||
|
||||
// 상반기(6월까지)는 2년 전, 하반기는 1년 전부터 시작
|
||||
const startYear = month <= 6 ? (year - 2) : (year - 1);
|
||||
|
||||
const year1 = startYear;
|
||||
const year2 = startYear - 1;
|
||||
const year3 = startYear - 2;
|
||||
const year4 = startYear - 3;
|
||||
const year5 = startYear - 4;
|
||||
return [
|
||||
{ text: year1 + "년", val: year1.toString() },
|
||||
{ text: year2 + "년", val: year2.toString() },
|
||||
@@ -173,10 +179,10 @@ const getYearData = () => {
|
||||
]
|
||||
}
|
||||
|
||||
const selectSearchYear:SelectDataType[] = getYearData();
|
||||
const selectSearchYear: SelectDataType[] = getYearData();
|
||||
|
||||
// 유량 기간 구분
|
||||
const selectFlowTerm : SelectDataType[] = [
|
||||
const selectFlowTerm: SelectDataType[] = [
|
||||
{ text: "연간", val: '0' },
|
||||
{ text: "하절기", val: '01' },
|
||||
{ text: "동절기", val: '02' },
|
||||
@@ -185,15 +191,15 @@ const selectFlowTerm : SelectDataType[] = [
|
||||
];
|
||||
|
||||
// 유량 기간 구분
|
||||
const selectFlowPanel : SelectDataType[] = [
|
||||
{ text: "전체", val: '0'},
|
||||
{ text: "3~10mm미만", val: '2'},
|
||||
{ text: "10~20mm미만", val: '3'},
|
||||
{ text: "20~30mm미만", val: '4'},
|
||||
{ text: "30~40mm미만", val: '5'},
|
||||
{ text: "40~50mm미만", val: '6'},
|
||||
{ text: "50~60mm미만", val: '7'},
|
||||
{ text: "60mm이상", val: '8'},
|
||||
const selectFlowPanel: SelectDataType[] = [
|
||||
{ text: "전체", val: '0' },
|
||||
{ text: "3~10mm미만", val: '2' },
|
||||
{ text: "10~20mm미만", val: '3' },
|
||||
{ text: "20~30mm미만", val: '4' },
|
||||
{ text: "30~40mm미만", val: '5' },
|
||||
{ text: "40~50mm미만", val: '6' },
|
||||
{ text: "50~60mm미만", val: '7' },
|
||||
{ text: "60mm이상", val: '8' },
|
||||
];
|
||||
|
||||
// 중권역 데이터
|
||||
@@ -220,9 +226,9 @@ export const roundUp = (value: number, precision: number = 1): number => {
|
||||
* @param day : 일수
|
||||
* @param digit : 소수점 자리수
|
||||
*/
|
||||
export const qltyDataSetting = (value: number, day : number, digit: number) => {
|
||||
const toZero = digit === 1 ? '0.0' : digit === 2 ? '0.00' : '0.000';
|
||||
return value > 0 ? roundUp((value/day), digit).toFixed(digit) : toZero;
|
||||
export const qltyDataSetting = (value: number, day: number, digit: number) => {
|
||||
const toZero = digit === 1 ? '0.0' : digit === 2 ? '0.00' : '0.000';
|
||||
return value > 0 ? roundUp((value / day), digit).toFixed(digit) : toZero;
|
||||
};
|
||||
|
||||
export const COD_YEAR = 2021;
|
||||
@@ -234,13 +240,13 @@ export const COD_YEAR = 2021;
|
||||
// 처리시설 계획정보 호출 (알에스원)
|
||||
export const planInfoUrl = '/dc-service/api/v1/nowDmgMtncGnsvy';
|
||||
|
||||
export const fetchPlanInfo = async (targetYear : string | undefined, ctpvNm : string | undefined, sggNm : string | undefined, fcltyCd : string | undefined) => {
|
||||
export const fetchPlanInfo = async (targetYear: string | undefined, ctpvNm: string | undefined, sggNm: string | undefined, fcltyCd: string | undefined) => {
|
||||
try {
|
||||
const baseUrl = planInfoUrl;
|
||||
const queryParams = new URLSearchParams();
|
||||
if (ctpvNm && ctpvNm !== '전체') queryParams.append('ctpvNm', ctpvNm);
|
||||
if (sggNm && sggNm !== '전체') queryParams.append('sggNm', sggNm);
|
||||
if (targetYear) queryParams.append('targetYear',targetYear);
|
||||
if (targetYear) queryParams.append('targetYear', targetYear);
|
||||
if (fcltyCd) queryParams.append('swtrmtFcltCd', fcltyCd);
|
||||
const queryString = queryParams.toString();
|
||||
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
||||
@@ -258,16 +264,16 @@ const fetchSidoData = async (): Promise<SelectDataType[]> => {
|
||||
const res = await getFetch('fo', '/addr/city');
|
||||
const data = res.data;
|
||||
selectSidoData = [
|
||||
{ text: "전체", val: '0'},
|
||||
{ text: "전체", val: '0' },
|
||||
...data.map((item: sidoDataType) => ({
|
||||
text: item.sido || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
text: item.sido || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
];
|
||||
return selectSidoData;
|
||||
} catch (error) {
|
||||
console.error('시도 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectSidoData;
|
||||
console.error('시도 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectSidoData;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -279,10 +285,10 @@ const fetchSigunData = async (): Promise<SelectDataType[]> => {
|
||||
selectSigunData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: sigunDataType) => ({
|
||||
.map((item: sigunDataType) => ({
|
||||
text: item.gugun || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
}))
|
||||
];
|
||||
return selectSigunData;
|
||||
} catch (error) {
|
||||
@@ -297,7 +303,7 @@ const fetchRegionData = async (): Promise<SelectDataType[]> => {
|
||||
const res = await getFetch('fo', '/addr/sarea');
|
||||
const data = res.data;
|
||||
return [
|
||||
{ text: "전체", val: '0'},
|
||||
{ text: "전체", val: '0' },
|
||||
...data.map((item: regionDataType) => ({
|
||||
text: item.rvbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
@@ -317,10 +323,10 @@ const fetchMiddleRegionData = async (): Promise<SelectDataType[]> => {
|
||||
return [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: middleRegionDataType) => ({
|
||||
text: item.mdmbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
.map((item: middleRegionDataType) => ({
|
||||
text: item.mdmbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
} catch (error) {
|
||||
console.error('중권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
@@ -336,10 +342,10 @@ const fetchUnitWaterShedData = async (): Promise<SelectDataType[]> => {
|
||||
return [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: unitWaterShedDataType) => ({
|
||||
text: item.lgbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
.map((item: unitWaterShedDataType) => ({
|
||||
text: item.lgbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
} catch (error) {
|
||||
console.error('단위유역 데이터를 가져오는데 실패했습니다:', error);
|
||||
@@ -355,11 +361,11 @@ const fetchEnvPartData = async (): Promise<envPartSelectDataType[]> => {
|
||||
selectEnvPartData = [
|
||||
{ text: "전체", val: '0', adstDliStrCd: '' },
|
||||
...data
|
||||
.map((item: envPartDataType) => ({
|
||||
text: item.lclgvrnmntNm || '',
|
||||
val: String(item.lclgvrnmntCd) || '',
|
||||
adstDliStrCd: item.adstDliStrCd || ''
|
||||
}))
|
||||
.map((item: envPartDataType) => ({
|
||||
text: item.lclgvrnmntNm || '',
|
||||
val: String(item.lclgvrnmntCd) || '',
|
||||
adstDliStrCd: item.adstDliStrCd || ''
|
||||
}))
|
||||
];
|
||||
return selectEnvPartData;
|
||||
} catch (error) {
|
||||
@@ -372,7 +378,7 @@ const fetchEnvPartData = async (): Promise<envPartSelectDataType[]> => {
|
||||
* Store - expaort
|
||||
====================================*/
|
||||
export type CommonAction = {
|
||||
getMenuAuth : (menuCd : number) => Promise<void>;
|
||||
getMenuAuth: (menuCd: number) => Promise<void>;
|
||||
initializeCommonData: () => Promise<void>;
|
||||
}
|
||||
|
||||
@@ -394,7 +400,7 @@ export type CommonType = {
|
||||
selectFlowPanel: SelectDataType[];
|
||||
selectEnvPartData: envPartSelectDataType[];
|
||||
btnClass: string;
|
||||
COD_YEAR : number;
|
||||
COD_YEAR: number;
|
||||
};
|
||||
|
||||
auth: {
|
||||
@@ -424,7 +430,7 @@ export const commonState: CommonType = {
|
||||
selectFlowPanel: selectFlowPanel,
|
||||
selectEnvPartData: selectEnvPartData,
|
||||
btnClass: "p-4 m-2 !mr-10 text-white rounded-sm text-lg font-medium",
|
||||
COD_YEAR : COD_YEAR,
|
||||
COD_YEAR: COD_YEAR,
|
||||
},
|
||||
|
||||
auth: {
|
||||
@@ -436,10 +442,12 @@ export const commonState: CommonType = {
|
||||
},
|
||||
};
|
||||
|
||||
export const CommonReducer:(set:(fn: (state: CommonType) => CommonType) => void)=>CommonAction=(set: (fn: (state: CommonType) => CommonType) => void) => {
|
||||
export const CommonReducer = (
|
||||
set: (fn: (state: CommonType) => CommonType) => void
|
||||
): CommonAction => {
|
||||
return {
|
||||
// 메뉴 권한 확인
|
||||
getMenuAuth : async (menuCd : number) =>{
|
||||
getMenuAuth: async (menuCd: number) => {
|
||||
const response = await getFetch(
|
||||
"local",
|
||||
`/cms-service/api/v1/menu-authrts/pageinfo/${menuCd}`
|
||||
|
||||
+1104
-1194
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11302
|
||||
NEXT_PUBLIC_SUB_DOMAIN = http://con.mind-one.co.kr:11300
|
||||
NEXT_PUBLIC_SUB_DOMAIN = http://con.mind-one.co.kr:13000
|
||||
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
|
||||
@@ -11,7 +11,7 @@ NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000
|
||||
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_NGII_URL = http://172.29.143.87
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
||||
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000
|
||||
NEXT_PUBLIC_DC_URL = http://apigateway.iipbs-was.svc.cluster.local:8000
|
||||
|
||||
@@ -19,15 +19,14 @@ import { LoginApi } from "@/entities/auth";
|
||||
import { useEffect } from "react";
|
||||
import { getCookie } from "@/shared/lib";
|
||||
import { AUTH_USER_ID } from "@/shared/config";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function Home() {
|
||||
const router = useRouter();
|
||||
const checkToken = getCookie(AUTH_USER_ID);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
const hostname = window.location.hostname;
|
||||
|
||||
|
||||
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "con.mind-one.co.kr") {
|
||||
if (!checkToken) {
|
||||
async function doLogin() {
|
||||
@@ -39,7 +38,7 @@ export default function Home() {
|
||||
}
|
||||
}
|
||||
doLogin();
|
||||
} else router.push("/map");
|
||||
} else router.push("/map");
|
||||
} else window.location.href = "/map";
|
||||
} else window.location.href = "/map";
|
||||
}, []);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => {
|
||||
|
||||
// 개발 환경에서는 localhost 도메인 사용
|
||||
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "con.mind-one.co.kr")
|
||||
router.push("/"); // 개발시 홈으로 돌아가기
|
||||
window.location.href = "/";
|
||||
|
||||
// 운영 환경에서는 서브도메인을 포함한 최상위 도메인 사용
|
||||
// router.push는 같은 Next.js 앱 내에서만 작동하므로 다른 앱으로 이동할 때는 window.location.href 사용
|
||||
|
||||
@@ -3,7 +3,7 @@ import { PROXY_HOST } from "./env";
|
||||
// 브라우저에서는 동일 오리진으로 상대경로 호출 → CORS/localhost 고정 문제 방지
|
||||
// (Next middleware가 /server/* 요청을 백엔드로 rewrite)
|
||||
// 서버 환경(SSR 등)에서는 절대 URL이 필요할 수 있어 기존 PROXY_HOST 기반 유지
|
||||
export const BASE_URL = typeof window === "undefined" ? `${PROXY_HOST}/server` : "/server";
|
||||
export const BASE_URL = `${PROXY_HOST}/server`;
|
||||
|
||||
export const ENDPOINT = {
|
||||
ATTACH_SERVICE: {
|
||||
|
||||
@@ -15,7 +15,7 @@ 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_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/sewerage-service
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87
|
||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
||||
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
||||
NEXT_PUBLIC_HASUDOINFO = https://www.hasudoinfo.or.kr
|
||||
NEXT_PUBLIC_HASUDOINFO_IN = http://10.101.163.102:8889
|
||||
|
||||
@@ -43,6 +43,7 @@ type UiHeadProps = {
|
||||
row?: number;
|
||||
widthPercent?: number;
|
||||
rowSpan?: number;
|
||||
colSpan?: number;
|
||||
};
|
||||
|
||||
export function UiTable({
|
||||
@@ -136,13 +137,13 @@ export function UiTable({
|
||||
<></>
|
||||
)}
|
||||
<div className={`card !p-0r !m-[1.2rem] ${className}`}>
|
||||
<Table variant="secondary" className={widthFixed?"table-fixed":""}>
|
||||
{widthFixed?
|
||||
<colgroup>
|
||||
{leafCols.map(col => (
|
||||
<col key={col.id} style={{ width: col.widthPercent ? `${col.widthPercent}%` : undefined }} />
|
||||
))}
|
||||
</colgroup>:""}
|
||||
<Table variant="secondary" className={widthFixed ? "table-fixed" : ""}>
|
||||
{widthFixed ?
|
||||
<colgroup>
|
||||
{leafCols.map(col => (
|
||||
<col key={col.id} style={{ width: col.widthPercent ? `${col.widthPercent}%` : undefined }} />
|
||||
))}
|
||||
</colgroup> : ""}
|
||||
<TableHeader ref={headerRef} className="font-bold">
|
||||
{children ? children : <HeadMakeColSpan upHeadList={headlist} />}
|
||||
</TableHeader>
|
||||
@@ -261,7 +262,8 @@ export function UiTable({
|
||||
<TableRow>
|
||||
<TableCell
|
||||
colSpan={
|
||||
headlist.filter((item) => item.visible != false).length
|
||||
headlist.filter((item) => item.visible != false).length -
|
||||
headlist.filter((item) => item.visible != false && item.colSpan).length
|
||||
}
|
||||
className="h-24 text-center text-gray-500"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user