528 lines
25 KiB
TypeScript
528 lines
25 KiB
TypeScript
import { postFetch } from "@/app/components/api";
|
|
import DataForm from "@/app/components/common/DataForm";
|
|
import { fetchPlanInfo } from "../common";
|
|
import type { TableUpperProps } from "../dashboard";
|
|
export type { TableUpperProps };
|
|
/**====================================
|
|
* Store - 타입
|
|
====================================*/
|
|
|
|
/**
|
|
* (1) 메인페이지
|
|
*/
|
|
// 처리구역 리스트
|
|
export type ProcessAreaProps = {
|
|
swtrmtFcltCd : string,
|
|
sido : string,
|
|
gugun : string,
|
|
swtrmtFcltNm : string,
|
|
location : string,
|
|
fctCpc : number | '',
|
|
ruse : boolean,
|
|
yrDt4 : string,
|
|
yr : string,
|
|
yrDc1 : string,
|
|
yrDc2 : string,
|
|
yrDc3 : string,
|
|
yrDc4 : string,
|
|
/**
|
|
* 증설계획
|
|
*/
|
|
// 기승인(당초4단계), 현재, 변경1~4
|
|
planSwageQntSumDt4 : number | '',
|
|
planSwageQntSum : number | '',
|
|
planSwageQntSumDc1 : number | '',
|
|
planSwageQntSumDc2 : number | '',
|
|
planSwageQntSumDc3 : number | '',
|
|
planSwageQntSumDc4 : number | '',
|
|
/**
|
|
* 처리인구
|
|
*/
|
|
// 기승인(당초4단계), 변경1~4
|
|
swtrmtPpltnCntDt4 : number | '',
|
|
swtrmtPpltnCnt : number | '',
|
|
swtrmtPpltnCntDc1 : number | '',
|
|
swtrmtPpltnCntDc2 : number | '',
|
|
swtrmtPpltnCntDc3 : number | '',
|
|
swtrmtPpltnCntDc4 : number | '',
|
|
/**
|
|
* 처리구역면적
|
|
*/
|
|
// 기승인(당초4단계), 변경1~4
|
|
swtrmtZoneAreaDt4 : number | '',
|
|
swtrmtZoneArea : number | '',
|
|
swtrmtZoneAreaDc1 : number | '',
|
|
swtrmtZoneAreaDc2 : number | '',
|
|
swtrmtZoneAreaDc3 : number | '',
|
|
swtrmtZoneAreaDc4 : number | '',
|
|
// 처리구역
|
|
trtDstr : string | '',
|
|
}
|
|
|
|
export interface ExcelType {
|
|
시설코드: string,
|
|
시설명: string,
|
|
주소: string,
|
|
시설용량: number | '',
|
|
증설계획기존: number | '',
|
|
증설계획현재: number | '',
|
|
증설계획1단계: number | '',
|
|
증설계획2단계: number | '',
|
|
증설계획3단계: number | '',
|
|
증설계획4단계: number | '',
|
|
처리인구기존: number | '',
|
|
처리인구현재: number | '',
|
|
처리인구1단계: number | '',
|
|
처리인구2단계: number | '',
|
|
처리인구3단계: number | '',
|
|
처리인구4단계: number | '',
|
|
처리구역기존: number | '',
|
|
처리구역현재: number | '',
|
|
처리구역1단계: number | '',
|
|
처리구역2단계: number | '',
|
|
처리구역3단계: number | '',
|
|
처리구역4단계: number | '',
|
|
처리구역: string | ''
|
|
}
|
|
|
|
// (2) 처리구역 팝업
|
|
// 시설증설 계획
|
|
export type FcltyImproveInfoProps = {
|
|
planSwageQntSumDt4 : number | '',
|
|
planSwageQntSum : number | '',
|
|
planSwageQntSumDc1 : number | '',
|
|
planSwageQntSumDc2 : number | '',
|
|
planSwageQntSumDc3 : number | '',
|
|
planSwageQntSumDc4 : number | '',
|
|
}
|
|
|
|
// 처리인구 계획
|
|
export type ProcessPopulationProps = {
|
|
swtrmtPpltnCntDt4 : number | '',
|
|
swtrmtPpltnCnt : number | '',
|
|
swtrmtPpltnCntDc1 : number | '',
|
|
swtrmtPpltnCntDc2 : number | '',
|
|
swtrmtPpltnCntDc3 : number | '',
|
|
swtrmtPpltnCntDc4 : number | '',
|
|
}
|
|
// 처리구역 계획
|
|
export type ProcessAreaPlanProps = {
|
|
swtrmtZoneAreaDt4 : number | '',
|
|
swtrmtZoneArea : number | '',
|
|
swtrmtZoneAreaDc1 : number | '',
|
|
swtrmtZoneAreaDc2 : number | '',
|
|
swtrmtZoneAreaDc3 : number | '',
|
|
swtrmtZoneAreaDc4 : number | '',
|
|
trtDstr : string,
|
|
}
|
|
|
|
/**====================================
|
|
* Store - data
|
|
====================================*/
|
|
|
|
/**
|
|
* (1) 메인페이지
|
|
*/
|
|
// 검색단
|
|
const ProcessFacilityLabelArray:string[] = ['구분', '시도', '시군구','용량별', '시설명', '시설상태', '연도별', '권역', '단위유역', '중권역', '환경청별'];
|
|
|
|
// 리스트 헤더(행정별)
|
|
const upHeadList1:TableUpperProps[] = [
|
|
{ id: "swtrmtFcltCd", title: "시설코드", rowSpan:3, row:0},
|
|
{ id: "A", title: "행정구역", colSpan:2, rowSpan:2, row:0},
|
|
{ id: "sido", title: "시도", upName:"upChangeRe", row:2 },
|
|
{ id: "sigungo", title: "시군구", upName:"upChangeRe", row:2 },
|
|
{ id: "swtrmtFcltNm", title: "시설명", rowSpan:3, row:0},
|
|
{ id: "location", title: "주소", rowSpan:3, row:0, },
|
|
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", rowSpan:3, row:0},
|
|
{ id: "B", title: "시설계획", colSpan:19, row:0},
|
|
{ id: "C", title: "증설계획(m³/일)", colSpan:6, row:1},
|
|
{ id: "planSwageQntSumDt4", title: "기승인\n4단계", row:2},
|
|
{ id: "planSwageQntSum", title: "현재", row:2},
|
|
{ id: "planSwageQntSumDc1", title: "1단계", row:2},
|
|
{ id: "planSwageQntSumDc2", title: "2단계", row:2},
|
|
{ id: "planSwageQntSumDc3", title: "3단계", row:2},
|
|
{ id: "planSwageQntSumDc4", title: "4단계", row:2},
|
|
{ id: "D", title: "처리인구(인)", colSpan:6, row:1},
|
|
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계", row:2},
|
|
{ id: "swtrmtPpltnCnt", title: "현재", row:2},
|
|
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:2},
|
|
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:2},
|
|
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:2},
|
|
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:2},
|
|
{ id: "E", title: "처리구역(km²)", colSpan:7, row:1},
|
|
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계", row:2},
|
|
{ id: "swtrmtZoneArea", title: "현재", row:2},
|
|
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:2},
|
|
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:2},
|
|
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:2},
|
|
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:2},
|
|
{ id: "trtDstr", title: "처리구역", row:2}
|
|
];
|
|
|
|
const processAreaList:ProcessAreaProps[] = [
|
|
]
|
|
|
|
/**
|
|
* 처리구역정보 상세팝업
|
|
*/
|
|
// 시설증설 계획 (헤더)
|
|
const upHeadListFcltyImproveInfo:TableUpperProps[] = [
|
|
{ id: "planSwageQntSumDt4", title: "기승인\n4단계(m³/일)", rowSpan:2, row:0},
|
|
{ id: "A", title: "증설계획(m³/일)", colSpan:5, row:0},
|
|
{ id: "planSwageQntSum", title: "현재", row:1},
|
|
{ id: "planSwageQntSumDc1", title: "1단계", row:1},
|
|
{ id: "planSwageQntSumDc2", title: "2단계", row:1},
|
|
{ id: "planSwageQntSumDc3", title: "3단계", row:1},
|
|
{ id: "planSwageQntSumDc4", title: "4단계", row:1},
|
|
];
|
|
|
|
// 시설증설 계획 (리스트)
|
|
const gridListFcltyImproveInfo:FcltyImproveInfoProps[] = [
|
|
];
|
|
|
|
// 처리인구 계획 (헤더)
|
|
const upHeadListProcessPopulation:TableUpperProps[] = [
|
|
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계(인)", rowSpan:2, row:0},
|
|
{ id: "A", title: "처리인구(인)", colSpan:5, row:0},
|
|
{ id: "swtrmtPpltnCnt", title: "현재", row:1},
|
|
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:1},
|
|
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:1},
|
|
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:1},
|
|
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:1},
|
|
];
|
|
|
|
// 처리인구 계획 (리스트)
|
|
const gridListProcessPopulation:ProcessPopulationProps[] = [
|
|
];
|
|
|
|
// 처리구역 계획 (헤더)
|
|
const upHeadListProcessAreaPlan:TableUpperProps[] = [
|
|
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계(km²)", rowSpan:2, row:0},
|
|
{ id: "A", title: "처리면적(km²)", colSpan:6, row:0},
|
|
{ id: "swtrmtZoneArea", title: "현재", row:1},
|
|
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:1},
|
|
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:1},
|
|
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:1},
|
|
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:1},
|
|
{ id: "trtDstr", title: "처리구역", row:1}
|
|
];
|
|
|
|
// 시설증설 계획 (리스트)
|
|
const gridListProcessAreaPlan:ProcessAreaPlanProps[] = [
|
|
];
|
|
|
|
/**====================================
|
|
* Store - API
|
|
=====================================*/
|
|
// 시설 상세 정보 조회 API
|
|
const fetchFacilityDetailInfo = async (swtrmtFcltCd: string) => {
|
|
try {
|
|
const tailUrl = '/1/5/A/0/0/0/SW';
|
|
const res = await postFetch('fo', '/prcsFclt/ruseInfo'+tailUrl, [swtrmtFcltCd]);
|
|
return { data:res.data, count:res.count };
|
|
} catch (error) {
|
|
console.error('시설정보 데이터를 가져오는데 실패했습니다:', error);
|
|
return {data: [], count: 0};
|
|
}
|
|
};
|
|
|
|
// 시설정보 리스트 데이터 호출(구분 선택 후 시설명 있을 경우)
|
|
const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : string | undefined, sggNm : string | undefined, targetYear : string | undefined, set : (fn: (state: ProcessAreaType) => ProcessAreaType) => void): Promise<{data:ProcessAreaProps[], count:number}> => {
|
|
try {
|
|
const res = await fetchPlanInfo(targetYear, ctpvNm, sggNm, undefined);
|
|
if(res && res.length > 0){
|
|
const enrichedData = await Promise.all(
|
|
res.map(async (item: ProcessAreaProps) => {
|
|
upHeadList1.forEach((head:TableUpperProps) => {
|
|
/* if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
|
head.title = '현재\n(' + item.yr + '년)';
|
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
|
head.title = '1단계\n(' + item.yrDc1 + '년)';
|
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
|
head.title = '2단계\n(' + item.yrDc2 + '년)';
|
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
|
head.title = '3단계\n(' + item.yrDc3 + '년)';
|
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
|
head.title = '4단계\n(' + item.yrDc4 + '년)';
|
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
|
head.title = '기승인\n4단계(' + item.yrDt4 + '년)';
|
|
} */
|
|
if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
|
head.title = '현재';
|
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
|
head.title = '1단계';
|
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
|
head.title = '2단계';
|
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
|
head.title = '3단계';
|
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
|
head.title = '4단계';
|
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
|
head.title = '기승인\n4단계';
|
|
}
|
|
});
|
|
const res = await fetchFacilityDetailInfo(item.swtrmtFcltCd);
|
|
const detailInfo = res.data.filter((item:ProcessAreaProps) => item.ruse === true);
|
|
return {
|
|
...item,
|
|
sido: detailInfo.length > 0 ? detailInfo[0].sido||'' : '',
|
|
sigungo: detailInfo.length > 0 ? detailInfo[0].gugun||'' : '',
|
|
location: detailInfo.length > 0 ? detailInfo[0].addr||'' : '',
|
|
fctCpc: detailInfo.length > 0 ? detailInfo[0].fctCpc||'' : 0,
|
|
trtDstr: detailInfo.length > 0 ? detailInfo[0].trtDstr||'' : '',
|
|
};
|
|
})
|
|
);
|
|
const startIndex = (pageNo - 1) * pageSize;
|
|
const endIndex = startIndex + pageSize;
|
|
const paginatedData = enrichedData.slice(startIndex, endIndex);
|
|
return {data: paginatedData, count: enrichedData.length};
|
|
}else{
|
|
return {data: [], count: 0};
|
|
}
|
|
} catch (error) {
|
|
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
|
set((state) => ({
|
|
...state,
|
|
ProcessArea : {
|
|
...state.ProcessArea,
|
|
isLoading : false
|
|
}
|
|
}));
|
|
return {data: [], count: 0};
|
|
}
|
|
};
|
|
|
|
/**====================================
|
|
* Store - expaort
|
|
=====================================*/
|
|
export type ProcessAreaActions = {
|
|
searchProcessAreaList : (pageNo: number, pageSize: number, ctpvNm?:string, sggNm?:string, targetYear?:string) => void;
|
|
initModalData : (swtrmtFcltCd:string) => void;
|
|
}
|
|
|
|
export type ProcessAreaType = {
|
|
ProcessAreaSearch: {
|
|
isInit: boolean;
|
|
processFacilityLabelArray:string[];
|
|
},
|
|
|
|
ProcessArea : {
|
|
isInit: boolean;
|
|
upHeadList1: TableUpperProps[];
|
|
processAreaList: ProcessAreaProps[];
|
|
processAreaCount: number;
|
|
excelList: ExcelType[];
|
|
isLoading: boolean;
|
|
},
|
|
|
|
ProcessAreaDetail : {
|
|
isInit: boolean;
|
|
upHeadListFcltyImproveInfo: TableUpperProps[];
|
|
gridListFcltyImproveInfo: FcltyImproveInfoProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
|
upHeadListProcessPopulation: TableUpperProps[];
|
|
gridListProcessPopulation: ProcessPopulationProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
|
upHeadListProcessAreaPlan: TableUpperProps[];
|
|
gridListProcessAreaPlan: ProcessAreaPlanProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
|
},
|
|
}
|
|
|
|
export const processAreaInitState: ProcessAreaType = {
|
|
ProcessAreaSearch: {
|
|
isInit: false,
|
|
processFacilityLabelArray: ProcessFacilityLabelArray,
|
|
},
|
|
|
|
ProcessArea : {
|
|
isInit : false,
|
|
upHeadList1 : upHeadList1,
|
|
processAreaList : processAreaList,
|
|
processAreaCount : 0,
|
|
excelList : [],
|
|
isLoading : true,
|
|
},
|
|
|
|
ProcessAreaDetail : {
|
|
isInit : false,
|
|
upHeadListFcltyImproveInfo : upHeadListFcltyImproveInfo,
|
|
gridListFcltyImproveInfo : gridListFcltyImproveInfo,
|
|
upHeadListProcessPopulation : upHeadListProcessPopulation,
|
|
gridListProcessPopulation : gridListProcessPopulation,
|
|
upHeadListProcessAreaPlan : upHeadListProcessAreaPlan,
|
|
gridListProcessAreaPlan : gridListProcessAreaPlan,
|
|
},
|
|
}
|
|
|
|
// 상태 설정 함수 타입 정의
|
|
type SetStateFunction = (state: ProcessAreaType | ((state: ProcessAreaType) => ProcessAreaType)) => void;
|
|
|
|
export type ProcessAreaStore = ProcessAreaType & ProcessAreaActions;
|
|
|
|
export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set: SetStateFunction) => {
|
|
return {
|
|
/**
|
|
* 시설정보 리스트 데이터 호출
|
|
* @param pageNo : 페이지 번호
|
|
* @param pageSize : 페이지 크기
|
|
*/
|
|
searchProcessAreaList: async ( pageNo:number, pageSize:number, ctpvNm?:string, sggNm?:string, targetYear?:string) => {
|
|
set((state: ProcessAreaType) => ({
|
|
...state,
|
|
ProcessArea: {
|
|
...state.ProcessArea,
|
|
isLoading: true,
|
|
},
|
|
}));
|
|
const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear, set);
|
|
res.data.forEach((item:ProcessAreaProps) => {
|
|
DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record<string, unknown>});
|
|
})
|
|
const excelDownList: ExcelType[] = [];
|
|
if(pageSize>5000){
|
|
res.data.forEach(item => {
|
|
item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : '';
|
|
excelDownList.push({
|
|
시설코드: item.swtrmtFcltCd,
|
|
시설명: item.swtrmtFcltNm,
|
|
주소: item.location,
|
|
시설용량: item.fctCpc,
|
|
증설계획기존: item.planSwageQntSumDt4,
|
|
증설계획현재: item.planSwageQntSum,
|
|
증설계획1단계: item.planSwageQntSumDc1,
|
|
증설계획2단계: item.planSwageQntSumDc2,
|
|
증설계획3단계: item.planSwageQntSumDc3,
|
|
증설계획4단계: item.planSwageQntSumDc4,
|
|
처리인구기존: item.swtrmtPpltnCntDt4,
|
|
처리인구현재: item.swtrmtPpltnCnt,
|
|
처리인구1단계: item.swtrmtPpltnCntDc1,
|
|
처리인구2단계: item.swtrmtPpltnCntDc2,
|
|
처리인구3단계: item.swtrmtPpltnCntDc3,
|
|
처리인구4단계: item.swtrmtPpltnCntDc4,
|
|
처리구역기존: item.swtrmtZoneAreaDt4,
|
|
처리구역현재: item.swtrmtZoneArea,
|
|
처리구역1단계: item.swtrmtZoneAreaDc1,
|
|
처리구역2단계: item.swtrmtZoneAreaDc2,
|
|
처리구역3단계: item.swtrmtZoneAreaDc3,
|
|
처리구역4단계: item.swtrmtZoneAreaDc4,
|
|
처리구역: item.trtDstr
|
|
});
|
|
});
|
|
}else{
|
|
res.data.forEach(item => {
|
|
item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : '';
|
|
})
|
|
}
|
|
set((state:ProcessAreaType) => ({
|
|
...state,
|
|
ProcessArea: pageSize<5000?{
|
|
...state.ProcessArea,
|
|
processAreaList: res.data,
|
|
processAreaCount: res.count,
|
|
isLoading : false,
|
|
}:{
|
|
...state.ProcessArea,
|
|
excelList: excelDownList,
|
|
isLoading : false,
|
|
},
|
|
}))
|
|
},
|
|
|
|
initModalData: async (swtrmtFcltCd:string) => {
|
|
set((state: ProcessAreaType) => {
|
|
const rtnData = state.ProcessArea.processAreaList.find((item: ProcessAreaProps) => item.swtrmtFcltCd === swtrmtFcltCd);
|
|
if (rtnData) {
|
|
upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => {
|
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
|
head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
|
head.title = rtnData.yrDc1? '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
|
head.title = rtnData.yrDc2? '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
|
head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
|
head.title = rtnData.yrDc4? '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
|
head.title = rtnData.yrDt4? '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
|
}
|
|
});
|
|
|
|
upHeadListProcessAreaPlan.forEach((head:TableUpperProps) => {
|
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
|
head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
|
head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
|
head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
|
head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
|
head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
|
head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
|
}
|
|
});
|
|
|
|
upHeadListProcessPopulation.forEach((head:TableUpperProps) => {
|
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
|
head.title = rtnData.yr?'현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
|
head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
|
head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
|
head.title = rtnData.yrDc3?'3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
|
head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
|
head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
|
}
|
|
});
|
|
|
|
// 시설증설 계획 데이터 생성
|
|
const fcltyImproveInfo: FcltyImproveInfoProps = {
|
|
planSwageQntSumDt4: rtnData.planSwageQntSumDt4,
|
|
planSwageQntSum: rtnData.planSwageQntSum,
|
|
planSwageQntSumDc1: rtnData.planSwageQntSumDc1,
|
|
planSwageQntSumDc2: rtnData.planSwageQntSumDc2,
|
|
planSwageQntSumDc3: rtnData.planSwageQntSumDc3,
|
|
planSwageQntSumDc4: rtnData.planSwageQntSumDc4
|
|
};
|
|
|
|
// 처리인구 계획 데이터 생성
|
|
const processPopulation: ProcessPopulationProps = {
|
|
swtrmtPpltnCntDt4: rtnData.swtrmtPpltnCntDt4,
|
|
swtrmtPpltnCnt: rtnData.swtrmtPpltnCnt,
|
|
swtrmtPpltnCntDc1: rtnData.swtrmtPpltnCntDc1,
|
|
swtrmtPpltnCntDc2: rtnData.swtrmtPpltnCntDc2,
|
|
swtrmtPpltnCntDc3: rtnData.swtrmtPpltnCntDc3,
|
|
swtrmtPpltnCntDc4: rtnData.swtrmtPpltnCntDc4
|
|
};
|
|
|
|
// 처리구역 계획 데이터 생성
|
|
const processAreaPlan: ProcessAreaPlanProps = {
|
|
swtrmtZoneAreaDt4: rtnData.swtrmtZoneAreaDt4,
|
|
swtrmtZoneArea: rtnData.swtrmtZoneArea,
|
|
swtrmtZoneAreaDc1: rtnData.swtrmtZoneAreaDc1,
|
|
swtrmtZoneAreaDc2: rtnData.swtrmtZoneAreaDc2,
|
|
swtrmtZoneAreaDc3: rtnData.swtrmtZoneAreaDc3,
|
|
swtrmtZoneAreaDc4: rtnData.swtrmtZoneAreaDc4,
|
|
trtDstr: rtnData.trtDstr
|
|
};
|
|
|
|
return {
|
|
...state,
|
|
ProcessAreaDetail: {
|
|
...state.ProcessAreaDetail,
|
|
gridListFcltyImproveInfo: [fcltyImproveInfo],
|
|
gridListProcessPopulation: [processPopulation],
|
|
gridListProcessAreaPlan: [processAreaPlan]
|
|
}
|
|
};
|
|
}
|
|
return state;
|
|
});
|
|
}
|
|
}
|
|
} |