Merge remote-tracking branch 'origin/iipbs/wr/dev'
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
NEXT_PUBLIC_SITE_ID = WR
|
||||
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_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||
NEXT_PUBLIC_WR_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
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
NEXT_PUBLIC_SITE_ID = WR
|
||||
NEXT_PUBLIC_PORT = 3001
|
||||
NEXT_PUBLIC_PROXY_HOST = http://localhost:3001
|
||||
NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
|
||||
NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
|
||||
NEXT_PUBLIC_SERVER_API_URL=http://dev.onasys.co.kr:8000
|
||||
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
|
||||
|
||||
+32
-32
@@ -1,39 +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 = 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_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://rsone.iptime.org:10010/geoserver
|
||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
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://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/sewerage-service/api
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# NEXT_PUBLIC_SITE_ID = WR
|
||||
# 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://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://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
|
||||
@@ -617,63 +617,31 @@ export default function CoMatRvw() {
|
||||
<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>
|
||||
{[0, 1, 2].map((idx) => (
|
||||
<div key={idx} className="col-span-4 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`splyCndtList.${idx}`}
|
||||
render={({ field }) => (
|
||||
<FormUi label={`후보지${idx + 1}`}>
|
||||
<Input
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
const newValue = {
|
||||
...(field.value || {}),
|
||||
ruseUtztnFcltNm: e.target.value,
|
||||
};
|
||||
field.onChange(newValue);
|
||||
}}
|
||||
value={field.value?.ruseUtztnFcltNm ?? ""}
|
||||
readOnly
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Form>
|
||||
<ConCostForm
|
||||
|
||||
@@ -80,6 +80,7 @@ export default function PbnstSttn() {
|
||||
}
|
||||
}, [pbnstSttn.excelList]);
|
||||
useEffect(() => {
|
||||
|
||||
if (!pbnstSttn.isInit) {
|
||||
getFlcts();
|
||||
}
|
||||
@@ -93,7 +94,7 @@ export default function PbnstSttn() {
|
||||
}, [pbnstSttnRes]);
|
||||
|
||||
useEffect(() => {
|
||||
pbnSttnInit("1", "15", ref.current, searchYear, pbnstSttn.fclts);
|
||||
pbnSttnInit("1", "15", ref.current, searchYear, fclts);
|
||||
}, [fclts]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -117,6 +118,7 @@ export default function PbnstSttn() {
|
||||
selectUnitWaterShedData={code.lgbsnCd}
|
||||
selectMiddleRegionData={code.mdmbsnCd}
|
||||
selectEnvPartData={code.lclgvrnmntCd}
|
||||
buttonOrder={["query", "init", "excel"]}
|
||||
rightClassName="ml-auto mr-6 flex items-center space-x-1"
|
||||
leftClassName="flex gap-5 w-9/12 m-4"
|
||||
leftSelectClassName="w-1/4"
|
||||
|
||||
@@ -6,8 +6,7 @@ import { initValInUsage, initValOutUsage, subTotalObj, totalObj, type FcPrfType,
|
||||
import { excelPrfmncSttnParsing } from "@/app/store/prfmncSttn/pbnstPrfmncSttn/excel";
|
||||
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import { InputTableBody } from "@/components/lib/func/TableData";
|
||||
import SearchInputText from "@/components/ui/searchInput/searchInput";
|
||||
import { CHART_FORM, ContentsDiv, MainChart, ScrollArea, SearchBaseForm, SelectBox, Title, UiTable, type ChartConfig, type ReturnType } from "@common/business_components";
|
||||
import { CHART_FORM, ContentsDiv, MainChart, ScrollArea, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ChartConfig, type ReturnType } from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Label, Table, TableBody, TableHeader } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
@@ -22,12 +21,12 @@ export default function PbnstPrfmncSttn() {
|
||||
pbnstPrfmncSttn,
|
||||
// pbnstPrfmncInit,
|
||||
pbnstPrfmncSearch,
|
||||
getFlctsSttn,
|
||||
prfmnc,
|
||||
pbnstSttn,
|
||||
pbnNmSearch
|
||||
} = useWrStore((state) => state);
|
||||
const { monthHeadList } = prfmnc
|
||||
const { pbnstPrfHeadList, prfmncRes, rawData, selectYearList } = pbnstPrfmncSttn;
|
||||
const { pbnstPrfHeadList, prfmncResCount, prfmncRes, rawData, selectYearList, fclts } = pbnstPrfmncSttn;
|
||||
// const [isChHead, setIsChHead] = useState(false);
|
||||
const [fromDate, setFromDate] = useState<string>(String(new Date().getFullYear()));
|
||||
const [toDate, setToDate] = useState<string>(String(new Date().getFullYear()));
|
||||
@@ -39,6 +38,9 @@ export default function PbnstPrfmncSttn() {
|
||||
const { t } = useTranslation('base');
|
||||
const searchYear = String(new Date().getFullYear());
|
||||
const [excelData, setExcelData] = useState<any[]>([]);
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
if (!excelData || excelData.length === 0) {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
@@ -98,11 +100,12 @@ export default function PbnstPrfmncSttn() {
|
||||
}));
|
||||
const inSubtotal = { ...structuredClone(subTotalObj), 구분: "장내용수" };
|
||||
const outSubtotal = { ...structuredClone(subTotalObj), 구분: "장외용수" };
|
||||
|
||||
const prfFilter = prfList?.filter((e) => e.ym.slice(0, 4) === year)
|
||||
const prfFilter = prfList?.filter((e) =>
|
||||
e.ym.slice(0, 4) === year
|
||||
)
|
||||
if (prfList && prfFilter.length > 0) {
|
||||
|
||||
prfList?.forEach((prfItem) => {
|
||||
prfFilter.forEach((prfItem) => {
|
||||
const month = Number(prfItem?.ym?.slice(4)); // "MM"
|
||||
const monthKey = `${month}월`;
|
||||
|
||||
@@ -148,6 +151,7 @@ export default function PbnstPrfmncSttn() {
|
||||
const tableData = [...inUsageData, ...outUsageData, usageTotalObj];
|
||||
setPrfData(tableData);
|
||||
setExcelData(excelPrfmncSttnParsing(prfData ?? []))
|
||||
// });
|
||||
} else {
|
||||
setPrfData([]);
|
||||
}
|
||||
@@ -209,9 +213,10 @@ export default function PbnstPrfmncSttn() {
|
||||
rawData.forEach((item) => {
|
||||
// 실적 테이블 데이터
|
||||
if (chartId) {
|
||||
if (item.prfList?.[0]?.ym.slice(0, 4) === year && item.prfList?.[0]?.pbnstRuseFcltId === chartId) {
|
||||
if (item.prfList.find((e) => e.ym.slice(0, 4) === year) && item.prfList?.[0]?.pbnstRuseFcltId === chartId) {
|
||||
prfTableData(item.prfList, year);
|
||||
}
|
||||
|
||||
item.prfList.filter((e) => e.ym.slice(0, 4) === year && e.pbnstRuseFcltId === chartId).forEach((element) => {
|
||||
// 누적
|
||||
wshwtr += element.wshwtr;
|
||||
@@ -435,7 +440,6 @@ export default function PbnstPrfmncSttn() {
|
||||
}
|
||||
}, [inLineData]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (outLineData?.chartData1) {
|
||||
const newChartConfig = {
|
||||
@@ -489,22 +493,28 @@ export default function PbnstPrfmncSttn() {
|
||||
sigunText: ""
|
||||
}
|
||||
tableHeadMaker(Number(searchYear), Number(searchYear));
|
||||
pbnstPrfmncSearch(returnType, "", searchYear, searchYear)
|
||||
getFlctsSttn();
|
||||
pbnstPrfmncSearch(1, returnType, "", searchYear, searchYear, fclts)
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setbdstTable(prfmncRes.map((e, idx) => {
|
||||
pbnstPrfmncSearch(pageNation, ref.current, pbnRuseNm, fromDate, toDate, pbnstPrfmncSttn.fclts);
|
||||
isResetPage(false)
|
||||
}, [fclts, pageNation]);
|
||||
|
||||
useEffect(() => {
|
||||
const tableData = prfmncRes.map((e, idx) => {
|
||||
|
||||
return ({
|
||||
...e,
|
||||
number: String(idx + 1)
|
||||
})
|
||||
}))
|
||||
})
|
||||
setbdstTable(tableData)
|
||||
|
||||
if (prfmncRes?.[0]?.pbnstRuseFcltId) setChartId(prfmncRes[0].pbnstRuseFcltId)
|
||||
}, [prfmncRes]);
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (pbnRuseNm.length > 1)
|
||||
pbnNmSearch("1", "23", ref.current, pbnRuseNm, searchYear, []);
|
||||
@@ -515,7 +525,6 @@ export default function PbnstPrfmncSttn() {
|
||||
setChartId(prfmncRes[index].pbnstRuseFcltId)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
@@ -533,6 +542,7 @@ export default function PbnstPrfmncSttn() {
|
||||
rightClassName="ml-auto mr-6 flex items-center space-x-1"
|
||||
leftClassName="flex gap-5 w-9/12 m-4"
|
||||
leftSelectClassName="w-1/6"
|
||||
buttonOrder={["query", "init", "excel"]}
|
||||
leftChildren={<div className="col-span-5">
|
||||
<div className="flex flex-row">
|
||||
{/* <div className="flex flex-row items-center"> */}
|
||||
@@ -548,7 +558,7 @@ export default function PbnstPrfmncSttn() {
|
||||
selectArray={yearOptions}
|
||||
value={fromDate}
|
||||
onSelectValue={(val: string | number) => setFromDate(String(val))} />
|
||||
<span> ~</span>
|
||||
<span> ~</span>
|
||||
<SelectBox
|
||||
// className="w-full h-full text-2xl mx-4"
|
||||
className="flex-none w-32 h-full text-2xl mr-4"
|
||||
@@ -557,18 +567,16 @@ export default function PbnstPrfmncSttn() {
|
||||
selectArray={yearOptions}
|
||||
value={toDate}
|
||||
onSelectValue={(val: string | number) => setToDate(String(val))} />
|
||||
<Label className="w-28 mt-2 text-xl">
|
||||
{"시설명"}
|
||||
</Label>
|
||||
<SearchInput
|
||||
className={" h-full text-2xl"}
|
||||
label={""}
|
||||
textValue={pbnRuseNm || ""}
|
||||
setText={setPbnRuseNm}
|
||||
/>
|
||||
</div>
|
||||
<SearchInputText
|
||||
label={"하수처리시설"}
|
||||
initValue={pbnRuseNm ?? ""}
|
||||
setValue={(searchNm?: string) => {
|
||||
setPbnRuseNm(searchNm || "");
|
||||
}}
|
||||
setRtnData={/*function (rtnData: any[]): void {setbdstTable(rtnData);}*/
|
||||
() => { }
|
||||
}
|
||||
searchList={pbnstSttn.pbnstSearchData || []}
|
||||
></SearchInputText>
|
||||
{/* <SelectBox
|
||||
className="h-full text-2xl"
|
||||
label="재이용시설명"
|
||||
@@ -579,7 +587,7 @@ export default function PbnstPrfmncSttn() {
|
||||
</div>
|
||||
</div>}
|
||||
queryClick={function (returnType: ReturnType): void {
|
||||
pbnstPrfmncSearch(returnType, pbnRuseNm ?? "", fromDate, toDate);
|
||||
pbnstPrfmncSearch(1, returnType, pbnRuseNm ?? "", fromDate, toDate, fclts);
|
||||
if (fromDate && toDate) {
|
||||
const fromNum = Number(fromDate);
|
||||
const toNum = Number(toDate);
|
||||
@@ -594,6 +602,7 @@ export default function PbnstPrfmncSttn() {
|
||||
}
|
||||
}
|
||||
}
|
||||
isResetPage(true)
|
||||
}}
|
||||
excelClick={excelClick}
|
||||
initClick={function (): void { }}
|
||||
@@ -608,13 +617,14 @@ export default function PbnstPrfmncSttn() {
|
||||
headName={undefined}
|
||||
tableData={bdstTable || []}
|
||||
headlist={pbnstPrfHeadList}
|
||||
pageSize={20}
|
||||
total={10000}
|
||||
pageSize={5}
|
||||
total={prfmncResCount}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
cellClick(index ?? undefined, headId);
|
||||
}}
|
||||
onPageChange={() => { }}
|
||||
onPageChange={setPageNation}
|
||||
index={0}
|
||||
resetPageNo={resetPage}
|
||||
/>
|
||||
|
||||
<hr />
|
||||
@@ -631,54 +641,62 @@ export default function PbnstPrfmncSttn() {
|
||||
|
||||
<div className="flex">
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={chartConfig} chartData={chartData} chartTitle={"장내·외 용수 총 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
{chartData.find((e) => e.val > 0) ?
|
||||
<MainChart chartConfig={chartConfig} chartData={chartData} chartTitle={"장내·외 용수 총 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
:
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 장내·외 용수 총 실적(m³) 데이터가 없습니다.
|
||||
</div>}
|
||||
</div>
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={dnInChartConfig} chartData={dnInUsage} chartTitle={"장내용수 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
{dnInUsage.find((e) => e.val > 0) ?
|
||||
<MainChart chartConfig={dnInChartConfig} chartData={dnInUsage} chartTitle={"장내용수 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
:
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 장내용수 실적(m³) 데이터가 없습니다.
|
||||
</div>}
|
||||
</div>
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={dnOutChartConfig} chartData={dnOutUsage} chartTitle={"장외용수 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
{dnOutUsage.find((e) => e.val > 0) ?
|
||||
<MainChart chartConfig={dnOutChartConfig} chartData={dnOutUsage} chartTitle={"장외용수 실적(m³)"} chartForm={CHART_FORM.DN} />
|
||||
:
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 장외용수 실적(m³) 데이터가 없습니다.
|
||||
</div>}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<h1 className="">장내·외 월별 하수재이용실적 현황</h1>
|
||||
<div className="flex">
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={barChartConfig} chartData={barData} chartTitle={"월별 장내·외 용수 총 실적(m³)"} chartForm={CHART_FORM.DOUBLEBAR} showLegend={true} />
|
||||
{barData.length > 0 ?
|
||||
<MainChart chartConfig={barChartConfig} chartData={barData} chartTitle={"월별 장내·외 용수 총 실적(m³)"} chartForm={CHART_FORM.DOUBLEBAR} showLegend={true} />
|
||||
:
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 월별 장내·외 용수 총 실적(m³) 데이터가 없습니다.
|
||||
</div>}
|
||||
</div>
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={lnInChartConfig} chartData={inLineData} chartTitle={"월별 장내 용수 실적(m³)"} chartForm={CHART_FORM.LINE} />
|
||||
{inLineData && Object.values(inLineData).every(arr => Array.isArray(arr) && arr.length === 0) ?
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 월별 장내 용수 실적(m³) 데이터가 없습니다.
|
||||
</div>
|
||||
:
|
||||
<MainChart chartConfig={lnInChartConfig} chartData={inLineData} chartTitle={"월별 장내 용수 실적(m³)"} chartForm={CHART_FORM.LINE} />
|
||||
}
|
||||
</div>
|
||||
<div className="w-1/3">
|
||||
<MainChart chartConfig={lnOutChartConfig} chartData={outLineData} chartTitle={"월별 장외 용수 총 실적(m³)"} chartForm={CHART_FORM.LINE} />
|
||||
</div>
|
||||
{outLineData && Object.values(outLineData).every(arr => Array.isArray(arr) && arr.length === 0) ?
|
||||
<div className="flex items-center justify-center text-2xl">
|
||||
조회된 월별 장외 용수 총 실적(m³) 데이터가 없습니다.
|
||||
</div>
|
||||
:
|
||||
<MainChart chartConfig={lnOutChartConfig} chartData={outLineData} chartTitle={"월별 장외 용수 총 실적(m³)"} chartForm={CHART_FORM.LINE} />
|
||||
}</div>
|
||||
</div>
|
||||
<h1 className="">하수재이용실적 현황 (단위: m³)</h1>
|
||||
{/* <ListDiv className="col-span-8 pr-6 "> */}
|
||||
{/* <ScrollArea className="h-[60vh]"> */}
|
||||
{/* <div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div> */}
|
||||
|
||||
{/* <UiTable
|
||||
headName={undefined}
|
||||
tableData={prfData || []}
|
||||
headlist={monthHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
onPageChange={()=>{}}>
|
||||
</UiTable> */}
|
||||
|
||||
<ListDiv className="col-span-8 pr-6 ">
|
||||
<ScrollArea className={prfData && prfData.length > 0 ? "h-[60vh]" : ""}>
|
||||
{/* <div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수재이용실적 현황 (단위: m³)"}
|
||||
</h3>
|
||||
</div> */}
|
||||
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(monthHeadList, [])}
|
||||
@@ -690,10 +708,7 @@ export default function PbnstPrfmncSttn() {
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
{/* </ScrollArea> */}
|
||||
</ListDiv>
|
||||
|
||||
{/* </ListDiv> */}
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -94,6 +94,12 @@ export const DmdCoReqSchema = z.object({
|
||||
demandMatching: DemandMatchingSchema.nullish(),
|
||||
demandCst: DemandCstSchema.nullish(),
|
||||
ruseUtztnFcltNm: z.string().nullish(),
|
||||
splyCndtList: z.array(
|
||||
z.object({
|
||||
ruseUtztnFcltNm: z.string(),
|
||||
ruseUtztnFcltCd: z.string(),
|
||||
})
|
||||
).nullish(),
|
||||
totalConstCost: z.number().nullish(),
|
||||
});
|
||||
|
||||
@@ -147,3 +153,10 @@ export type rateFeeType = {
|
||||
stdCost: number;
|
||||
rt: number;
|
||||
};
|
||||
|
||||
|
||||
// 공급 후보자 타입 정의
|
||||
export type SupplyCandidate = {
|
||||
ruseUtztnFcltNm: string;
|
||||
ruseUtztnFcltCd: string;
|
||||
};
|
||||
@@ -4,11 +4,13 @@ import { monthSttnHeadListExport, pbnstPrfmncSttnHeadListExport, pbnstYearHeadLi
|
||||
import type { FcPrfType, PrfType } from "../../prfmncReg/pbnstPrfmncReg/type";
|
||||
import type { pubHasuType, selectLabel } from "../../ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import type { ReturnType } from "@common/business_components";
|
||||
import type { WaterReuseFacility } from "../../ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
|
||||
type pbnstPrfmncSttnActions = {
|
||||
tableHeadMaker: (startYear: number, endYear: number) => void;
|
||||
pbnstPrfmncInit: (page: string, sggOrCity: string) => void;
|
||||
pbnstPrfmncSearch: (returnType: ReturnType, swtrmtFcltNm: string, fromDate: string, toDate: string) => void;
|
||||
// pbnstPrfmncInit: (page: string, sggOrCity: string) => void;
|
||||
pbnstPrfmncSearch: (page: number, returnType: ReturnType, fcltNm: string, fromDate: string, toDate: string, fclts: string[]) => void;
|
||||
getFlctsSttn: () => void;
|
||||
}
|
||||
|
||||
const pbnstPrfmncRes: PrfType[] = [];
|
||||
@@ -22,7 +24,9 @@ export type pbnstPrfmncSttnState = {
|
||||
isInit: boolean;
|
||||
rawData: any[];
|
||||
selectYearList: selectLabel[]
|
||||
monthSttnHeadList:TableUpperProps[];
|
||||
monthSttnHeadList: TableUpperProps[];
|
||||
fclts: string[];
|
||||
prfmncResCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,34 +40,75 @@ export const pbnstPrfmncSttnExport: pbnstPrfmncSttnState = {
|
||||
isInit: false,
|
||||
rawData: [],
|
||||
selectYearList: [],
|
||||
monthSttnHeadList:monthSttnHeadListExport
|
||||
monthSttnHeadList: monthSttnHeadListExport,
|
||||
fclts: [],
|
||||
prfmncResCount: 1,
|
||||
}
|
||||
}
|
||||
|
||||
const checkWrRegList = async () => {
|
||||
const wrRegList = await getFetch("wr", `/reuseFc/pubDetailList`);
|
||||
return wrRegList;
|
||||
};
|
||||
const hasuListFetch = async (page: string, sggOrCity: string) => {
|
||||
const checkWrRegListRes = await checkWrRegList();
|
||||
const rainRes = await postFectch(
|
||||
`/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity ? sggOrCity : "11"}/0/1/SW`,
|
||||
checkWrRegListRes?.fcltCds,
|
||||
fetchType.COMMON
|
||||
const hasuListFetch = async (
|
||||
page: number,
|
||||
returnType: ReturnType,
|
||||
searchNm: string | undefined,
|
||||
year: string,
|
||||
flcts: string[]
|
||||
) => {
|
||||
let url = `/prcsFclt/ruseInfo/`;
|
||||
|
||||
if (returnType.partValue === "A") {
|
||||
url += `${page}/5/${returnType.partValue}/${
|
||||
// returnType.sidoValue ? returnType.sidoValue : returnType.sigunValue
|
||||
returnType.sigunValue !== '0' ? returnType.sigunValue : returnType.sidoValue
|
||||
}/0/1/SW`
|
||||
} else if (returnType.partValue === "R") {
|
||||
url += `${page}/5/${returnType.partValue}/${returnType.regionValue
|
||||
? returnType.regionValue
|
||||
: returnType.unitWaterShedValue
|
||||
? returnType.unitWaterShedValue
|
||||
: returnType.middleRegionValue
|
||||
}/0/1/SW`
|
||||
} else if (returnType.partValue === 'G') {
|
||||
url += `${page}/5/${returnType.envPartValue}/${returnType.sigunValue !== '0' ? returnType.sigunValue : returnType.sidoValue}/0/1/SW`
|
||||
|
||||
} else {
|
||||
url += `1/2/A/0/0/1/SW`
|
||||
}
|
||||
|
||||
if (searchNm && searchNm?.length > 0) {
|
||||
url += "/" + searchNm
|
||||
}
|
||||
|
||||
const pbnList = await postFectch(url, flcts, fetchType.COMMON);
|
||||
const getRuseList = await postFectch(
|
||||
`/reuseFc/pubDetailList/${year}`,
|
||||
flcts,
|
||||
fetchType.WR
|
||||
);
|
||||
const data = checkWrRegListRes.fcPrfList.map((item: FcPrfType) => {
|
||||
const findData = rainRes.data.find(
|
||||
(fclt: pubHasuType) =>
|
||||
fclt.bscFctCd === item.pbnstRuseFcltId.substring(0, 11)
|
||||
);
|
||||
return {
|
||||
sido: findData?.sido,
|
||||
gugun: findData?.gugun,
|
||||
bscFctNm: findData?.bscFctNm,
|
||||
ruseUtztnFcltNm: item.ruseUtztnFcltNm,
|
||||
pbnstRuseFcltId: item.pbnstRuseFcltId,
|
||||
};
|
||||
});
|
||||
let count = 0;
|
||||
const checkWrRegListRes = getRuseList.data;
|
||||
const data: WaterReuseFacility[] = checkWrRegListRes.map(
|
||||
(item: FcPrfType) => {
|
||||
if (!item.prfList || item.prfList.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const findData = pbnList.data.find(
|
||||
(fclt: pubHasuType) =>
|
||||
fclt.bscFctCd === item.pbnstRuseFcltId.substring(0, 11)
|
||||
);
|
||||
if (findData) {
|
||||
count++;
|
||||
return {
|
||||
sido: findData?.sido || '-',
|
||||
gugun: findData?.gugun || '-',
|
||||
bscFctNm: findData?.bscFctNm || '-',
|
||||
ruseUtztnFcltNm: item?.ruseUtztnFcltNm || '-',
|
||||
pbnstRuseFcltId: item?.pbnstRuseFcltId || '-',
|
||||
bscFctCd: findData?.bscFctCd || '-',
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
).filter(Boolean);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -71,6 +116,15 @@ export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
getFlctsSttn: async () => {
|
||||
const fclts = await getFetch(fetchType.WR, '/reuseFc/pubFc')
|
||||
return set((state: pbnstPrfmncSttnState) => ({
|
||||
pbnstPrfmncSttn: {
|
||||
...state.pbnstPrfmncSttn,
|
||||
fclts: fclts
|
||||
},
|
||||
}));
|
||||
},
|
||||
tableHeadMaker: (startYear: number, endYear: number) => {
|
||||
let yearHeader: TableUpperProps[] = [...pbnstPrfmncSttnHeadListExport];
|
||||
const selectList = [] as unknown as selectLabel[]
|
||||
@@ -79,7 +133,7 @@ export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions
|
||||
if (yearHead) {
|
||||
yearHead.forEach((item: { id?: string; }) => {
|
||||
if (item.id) {
|
||||
if(item.id === "year") {item.id = ""; return;}
|
||||
if (item.id === "year") { item.id = ""; return; }
|
||||
item.id = i + item.id;
|
||||
}
|
||||
})
|
||||
@@ -100,117 +154,144 @@ export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions
|
||||
};
|
||||
});
|
||||
},
|
||||
pbnstPrfmncInit: async (page: string, sggOrCity: string) => {
|
||||
// pbnstPrfmncInit: async (page: string, sggOrCity: string) => {
|
||||
// try {
|
||||
// const prfmncRes = await hasuListFetch(page, sggOrCity);
|
||||
// return set((state: pbnstPrfmncSttnState) => ({
|
||||
// ...state,
|
||||
// pbnstPrfmncSttn: {
|
||||
// ...state.pbnstPrfmncSttn,
|
||||
// prfmncRes: prfmncRes,
|
||||
// isInit: true,
|
||||
// },
|
||||
// }));
|
||||
// } catch (e) {
|
||||
// console.log(e)
|
||||
// }
|
||||
// },
|
||||
pbnstPrfmncSearch: async (page: number, returnType: ReturnType, fcltNm: string, fromDate: string, toDate: string, fclts: string[]) => {
|
||||
try {
|
||||
const prfmncRes = await hasuListFetch(page, sggOrCity);
|
||||
const prfmncRes = await hasuListFetch(
|
||||
page,
|
||||
returnType,
|
||||
fcltNm,
|
||||
toDate,
|
||||
fclts);
|
||||
// const bscFctCdList = prfmncRes.map((item: any) => {
|
||||
// return item.bscFctCd;
|
||||
// })
|
||||
const bscFctCdList = prfmncRes
|
||||
.map((item: any) => item.bscFctCd)
|
||||
.filter((value, index, self) => self.indexOf(value) === index);
|
||||
// const bscFctCdList = [...new Set(prfmncRes.map((item: any) => item.bscFctCd))];
|
||||
|
||||
|
||||
const res = await postFectch(
|
||||
`/reuseFc/pubDetailList/${fromDate}/${toDate}`,
|
||||
bscFctCdList,
|
||||
`wr`,
|
||||
)
|
||||
let inUsageSum = 0;
|
||||
let outUsageSum = 0;
|
||||
let year = "";
|
||||
const yearsData = [] as any
|
||||
|
||||
res.data.forEach((item: any) => {
|
||||
if (item.prfList.length === 0) {
|
||||
const year: string = ""; // 연도 정보가 없으면 빈 문자열, 필요시 item에서 추출.
|
||||
const yearVal: { [key: string]: any } = { year: year, pbnstRuseFcltId: item.pbnstRuseFcltId ?? "", ruseUtztnFcltNm: item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[`${year}inUsage`] = 0;
|
||||
yearVal[`${year}outUsage`] = 0;
|
||||
yearVal[`${year}total`] = 0;
|
||||
yearsData.push(yearVal);
|
||||
}
|
||||
item.prfList.forEach((acc) => {
|
||||
year = acc.ym?.substring(0, 4) ?? "";
|
||||
inUsageSum =
|
||||
(acc.wshwtr ?? 0) + //조경용수
|
||||
(acc.coolUswtr ?? 0) + //냉각수
|
||||
(acc.cleanUswtr ?? 0) + //청소수
|
||||
(acc.drwtUswtr ?? 0) + //식수대
|
||||
(acc.dltnUswtr ?? 0) + //희석용수
|
||||
(acc.ithlRswtr ?? 0) + //중수도
|
||||
(acc.ithlEtcUswtr ?? 0) //기타
|
||||
outUsageSum =
|
||||
(acc.cleanToilUswtr ?? 0) + //청소화장실용수
|
||||
(acc.resn ?? 0) + //세척살수용도
|
||||
(acc.lndwtr ?? 0) + //조경용수
|
||||
(acc.hydUswtr ?? 0) + //친수용수
|
||||
(acc.ugwtChr ?? 0) + //지하수충전
|
||||
(acc.farmUswtr ?? 0) + //농업용수
|
||||
(acc.rvrKeepUswtr ?? 0) + //하천등유지용수
|
||||
(acc.indstUswtr ?? 0); //공업용수
|
||||
const yearData = yearsData.find(
|
||||
(yearItem) =>
|
||||
yearItem.year === year &&
|
||||
yearItem.pbnstRuseFcltId == acc.pbnstRuseFcltId
|
||||
);
|
||||
|
||||
if (yearData) {
|
||||
yearData[`${year}inUsage`] += inUsageSum;
|
||||
yearData[`${year}outUsage`] += outUsageSum;
|
||||
yearData[`${year}total`] += (inUsageSum + outUsageSum);
|
||||
} else {
|
||||
const yearVal: { [key: string]: any } = { year: year, pbnstRuseFcltId: acc.pbnstRuseFcltId, ruseUtztnFcltNm: item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[`${year}inUsage`] = inUsageSum;
|
||||
yearVal[`${year}outUsage`] = outUsageSum;
|
||||
yearVal[`${year}total`] = inUsageSum + outUsageSum;
|
||||
yearsData.push(yearVal);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 연도 필터링
|
||||
const from = Number(fromDate);
|
||||
const to = Number(toDate);
|
||||
|
||||
// 연도별 실적을 시설별로 병합
|
||||
const mergedMap: { [key: string]: any } = {};
|
||||
|
||||
yearsData.forEach((acc) => {
|
||||
const facilityId = acc.pbnstRuseFcltId;
|
||||
const year = acc.year;
|
||||
|
||||
// 연도 필터 범위 안에만 포함
|
||||
if (!year || Number(year) < from || Number(year) > to) return;
|
||||
|
||||
if (!mergedMap[facilityId]) {
|
||||
mergedMap[facilityId] = {
|
||||
pbnstRuseFcltId: facilityId,
|
||||
ruseUtztnFcltNm: acc.ruseUtztnFcltNm,
|
||||
};
|
||||
}
|
||||
|
||||
// 해당 연도 데이터 추가
|
||||
mergedMap[facilityId][`${year}inUsage`] = acc[`${year}inUsage`] ?? 0;
|
||||
mergedMap[facilityId][`${year}outUsage`] = acc[`${year}outUsage`] ?? 0;
|
||||
mergedMap[facilityId][`${year}total`] = acc[`${year}total`] ?? 0;
|
||||
});
|
||||
|
||||
// prfmncRes 정보 merge
|
||||
const resData = Object.values(mergedMap).map((item: any) => {
|
||||
const match = prfmncRes.find((res) => res.pbnstRuseFcltId === item.pbnstRuseFcltId);
|
||||
return match ? { ...item, ...match } : item;
|
||||
});
|
||||
|
||||
return set((state: pbnstPrfmncSttnState) => ({
|
||||
...state,
|
||||
pbnstPrfmncSttn: {
|
||||
...state.pbnstPrfmncSttn,
|
||||
prfmncRes: prfmncRes,
|
||||
isInit: true,
|
||||
// prfmncRes: prfmncRes,
|
||||
prfmncResCount: fclts.length - 5,
|
||||
isInit: false,
|
||||
prfmncRes: resData,
|
||||
rawData: res.data
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} catch (errorHasu) {
|
||||
console.log(errorHasu);
|
||||
}
|
||||
},
|
||||
pbnstPrfmncSearch: async (returnType: ReturnType, swtrmtFcltNm: string, fromDate: string, toDate: string) => {
|
||||
let searchUrl = "";
|
||||
if (returnType.sigunValue !== "0") {
|
||||
if (swtrmtFcltNm !== "") {
|
||||
searchUrl = `/prcsFclt/info/1/20/${returnType.partValue}/${returnType.sigunValue}/0/1/SW${'/' + swtrmtFcltNm}`;
|
||||
} else {
|
||||
searchUrl = `/prcsFclt/info/1/20/${returnType.partValue}/${returnType.sigunValue}/0/1/SW`;
|
||||
}
|
||||
} else {
|
||||
if (swtrmtFcltNm !== "") {
|
||||
searchUrl = `/prcsFclt/info/1/20/${returnType.partValue}/${returnType.sidoValue}/0/1/SW${'/' + swtrmtFcltNm}`;
|
||||
} else {
|
||||
searchUrl = `/prcsFclt/info/1/20/${returnType.partValue}/${returnType.sidoValue}/0/1/SW`;
|
||||
}
|
||||
}
|
||||
|
||||
const pbnstRes = await getFetch(
|
||||
fetchType.COMMON,
|
||||
searchUrl
|
||||
);
|
||||
|
||||
const bscFctCdList = pbnstRes.map((item: any) => {
|
||||
return item.bscFctCd;
|
||||
})
|
||||
const res = await postFectch(
|
||||
`/reuseFc/pubDetailList/${fromDate}/${toDate}`,
|
||||
bscFctCdList,
|
||||
`wr`,
|
||||
)
|
||||
let inUsageSum = 0;
|
||||
let outUsageSum = 0;
|
||||
let year = "";
|
||||
const yearsData = [] as any
|
||||
|
||||
res.data.forEach((item : any) => {
|
||||
if (item.prfList.length === 0) {
|
||||
const year: string = ""; // 연도 정보가 없으면 빈 문자열, 필요시 item에서 추출.
|
||||
const yearVal: { [key: string]: any } = { year: year, pbnstRuseFcltId: item.pbnstRuseFcltId ?? "", ruseUtztnFcltNm : item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[`${year}inUsage`] = 0;
|
||||
yearVal[`${year}outUsage`] = 0;
|
||||
yearVal[`${year}total`] = 0;
|
||||
yearsData.push(yearVal);
|
||||
}
|
||||
item.prfList.forEach((acc) => {
|
||||
year = acc.ym?.substring(0, 4) ?? "";
|
||||
inUsageSum =
|
||||
(acc.wshwtr ?? 0) + //조경용수
|
||||
(acc.coolUswtr ?? 0) + //냉각수
|
||||
(acc.cleanUswtr ?? 0) + //청소수
|
||||
(acc.drwtUswtr ?? 0) + //식수대
|
||||
(acc.dltnUswtr ?? 0) + //희석용수
|
||||
(acc.ithlRswtr ?? 0) + //중수도
|
||||
(acc.ithlEtcUswtr ?? 0) //기타
|
||||
outUsageSum =
|
||||
(acc.cleanToilUswtr ?? 0) + //청소화장실용수
|
||||
(acc.resn ?? 0)+ //세척살수용도
|
||||
(acc.lndwtr ?? 0) + //조경용수
|
||||
(acc.hydUswtr ?? 0) + //친수용수
|
||||
(acc.ugwtChr ?? 0) + //지하수충전
|
||||
(acc.farmUswtr ?? 0) + //농업용수
|
||||
(acc.rvrKeepUswtr ?? 0) + //하천등유지용수
|
||||
(acc.indstUswtr ?? 0); //공업용수
|
||||
const yearData = yearsData.find(
|
||||
(yearItem) =>
|
||||
yearItem.year === year &&
|
||||
yearItem.pbnstRuseFcltId == acc.pbnstRuseFcltId
|
||||
);
|
||||
|
||||
if (yearData) {
|
||||
yearData[`${year}inUsage`] += inUsageSum;
|
||||
yearData[`${year}outUsage`] += outUsageSum;
|
||||
yearData[`${year}total`] += (inUsageSum + outUsageSum);
|
||||
} else {
|
||||
const yearVal: { [key: string]: any } = { year: year, pbnstRuseFcltId: acc.pbnstRuseFcltId, ruseUtztnFcltNm : item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[`${year}inUsage`] = inUsageSum;
|
||||
yearVal[`${year}outUsage`] = outUsageSum;
|
||||
yearVal[`${year}total`] = inUsageSum + outUsageSum;
|
||||
yearsData.push(yearVal);
|
||||
}
|
||||
});
|
||||
});
|
||||
const resData: any[] = []
|
||||
pbnstRes.forEach((acc) => {
|
||||
const data = yearsData.find((item) => item.pbnstRuseFcltId.substring(0, 11) === acc.bscFctCd)
|
||||
if (data) {
|
||||
resData.push({ ...acc, ...data })
|
||||
}
|
||||
})
|
||||
return set((state: pbnstPrfmncSttnState) => ({
|
||||
...state,
|
||||
pbnstPrfmncSttn: {
|
||||
...state.pbnstPrfmncSttn,
|
||||
prfmncRes: resData,
|
||||
rawData: res.data
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
return {
|
||||
getFlcts: async () => {
|
||||
const fclts = await getFetch(fetchType.WR, '/reuseFc/pubFc')
|
||||
|
||||
return set((state: pbnstSttnState) => ({
|
||||
pbnstSttn: {
|
||||
...state.pbnstSttn,
|
||||
@@ -293,6 +294,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||
year,
|
||||
fclts
|
||||
);
|
||||
|
||||
set((state: pbnstSttnState) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
SERVER_API_CS_TUS_URL,
|
||||
SERVER_API_CS_URL,
|
||||
SERVER_API_FO_URL,
|
||||
SERVER_API_URL,
|
||||
SERVER_API_WR_URL,
|
||||
} from "@/src/shared/config";
|
||||
|
||||
//const DEV_PORT = "11080";
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
//export const CS_TUS_UPLOAD= "/attach-service/api/v1/tus/upload";
|
||||
|
||||
export const LOCAL_URL_WR = PROXY_HOST + `/api/v1`;
|
||||
export const DEV_URL_WR = SERVER_API_URL;
|
||||
export const DEV_URL_WR = SERVER_API_WR_URL;
|
||||
export const DEV_URL_FO = SERVER_API_FO_URL;
|
||||
export const LOCAL_URL = PROXY_HOST;
|
||||
export const CS_URL = SERVER_API_CS_URL;
|
||||
|
||||
@@ -156,6 +156,10 @@ export default function ConCostForm({
|
||||
toast.error("공사비 계산 진행 후 저장을 눌러주새요");
|
||||
return;
|
||||
}
|
||||
|
||||
const splycd = form.getValues("splyCndtList")
|
||||
const pk = splycd&&splycd[0]?.ruseUtztnFcltCd?splycd[0]?.ruseUtztnFcltCd:'11000SW001R1'
|
||||
|
||||
if (type === "mat") {
|
||||
if (value.demandCst) {
|
||||
const data: DedMatUpdateType = {
|
||||
@@ -178,8 +182,9 @@ export default function ConCostForm({
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
toast.dismiss(t.id);
|
||||
|
||||
coMatRvwUpdate(
|
||||
"11000SW001R1",
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
@@ -194,12 +199,15 @@ export default function ConCostForm({
|
||||
</span>
|
||||
));
|
||||
} else {
|
||||
coMatRvwUpdate("11000SW001R1", form.getValues("dmdInfoId"), data);
|
||||
|
||||
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
|
||||
}
|
||||
}
|
||||
} else if (type === "hist") {
|
||||
delete value.totalConstCost;
|
||||
delete value.ruseUtztnFcltNm;
|
||||
console.log("onSubmit data ", pk);
|
||||
|
||||
ruseRvwCalUpdate(value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,10 +48,10 @@ export default function CoDetailModal({
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ScrollArea className="h-[85vh]">
|
||||
<ScrollArea className="h-[85vh] mx-8">
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onFormSubmit)}>
|
||||
<div className="grid grid-cols-12 flex items-center card-header">
|
||||
<div className="grid grid-cols-12 items-center card-header">
|
||||
<h1 className="text-2xl font-medium text-label col-span-10">
|
||||
잠재수요처 상세정보
|
||||
</h1>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "WR";
|
||||
export const PORT = process.env.NEXT_PUBLIC_PORT || "3001";
|
||||
export const PROXY_HOST = process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
|
||||
export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL ||'http://con.mind-one.co.kr:11080/api/v1';
|
||||
export const SERVER_API_WR_URL = process.env.NEXT_PUBLIC_WR_SERVER_API_URL ||'http://con.mind-one.co.kr:11080/api/v1';
|
||||
export const SERVER_API_FO_URL = process.env.NEXT_PUBLIC_FO_SERVER_API_URL||' http://con.mind-one.co.kr:11082/api/v1';
|
||||
export const SERVER_API_CS_URL = process.env.NEXT_PUBLIC_CS_SERVER_API_URL||'http://dev.onasys.co.kr:8000';
|
||||
export const SERVER_API_CS_TUS_URL = process.env.NEXT_PUBLIC_CS_TUS_UPLOAD ||'/attach-service/api/v1/tus/upload'
|
||||
|
||||
@@ -83,7 +83,6 @@ export default function DoubleBarChart({chartConfig=undefined, chartData=[], cha
|
||||
.map(key => item[key])
|
||||
).flat());
|
||||
};
|
||||
console.log(chartData);
|
||||
const barMaxValue = getMaxValue(chartData, 'barVal');
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -13,6 +13,7 @@ import GisToolBar from './GisToolBar';
|
||||
import GisTree from './GisTree';
|
||||
import './lib/css/gis.common.css';
|
||||
import GisApp from './lib/gis.core';
|
||||
// import FacilityInfoPopup from './FacilityInfoPopup';
|
||||
|
||||
export const GisContext = createContext({ gisCore: null, gisMap: null, treeData: null, checkedLayerIds: null });
|
||||
export const useGisContext = () => useContext(GisContext);
|
||||
@@ -102,7 +103,6 @@ function Gis({
|
||||
onCheckedLayersChange,
|
||||
setData = () => {},
|
||||
}) {
|
||||
|
||||
const mapRef = useRef();
|
||||
const [mapObject, setMapObject] = useState({});
|
||||
const [tabVisible, setTabVisible] = useState(true);
|
||||
@@ -223,7 +223,6 @@ function Gis({
|
||||
|
||||
// 지도 생성 및 초기화
|
||||
useEffect(() => {
|
||||
|
||||
if (!mapRef.current) return;
|
||||
if (mapInstanceRef.current) return; // 이미 생성된 맵이 있다면 중단
|
||||
|
||||
@@ -330,6 +329,120 @@ function Gis({
|
||||
}
|
||||
}
|
||||
|
||||
// // 데이터 로드 및 팝업 생성 로직
|
||||
// useEffect(() => {
|
||||
// if (!mapInstanceRef.current) return; // 맵이 생성되지 않았으면 실행 안 함
|
||||
|
||||
// // 1. 팝업 데이터 가져오기 (feature.js의 getData와 유사)
|
||||
// const fetchPopupData = async () => {
|
||||
// // 실제 API 호출 로직으로 대체해야 합니다.
|
||||
// // 예시: const response = await yourApiService.getFcltyWtCnt();
|
||||
// // setFacilityInfoPopupData(response.data);
|
||||
|
||||
// // 임시 목업 데이터
|
||||
// const mockData = [
|
||||
// { ftrIdn: 1, ftrCde: 'SA206', bplcNm: '처리장A', fcltyUseYn: 'Y', x: 127.005, y: 37.282, aCnt: 10, cCnt: 5, eCnt: 3, mCnt: 8, iCnt: 2 },
|
||||
// { ftrIdn: 2, ftrCde: 'SA112', bplcNm: '처리장B', fcltyUseYn: 'N', x: 127.010, y: 37.285, aCnt: 8, cCnt: 4, eCnt: 2, mCnt: 6, iCnt: 1 }
|
||||
// ];
|
||||
// setFacilityInfoPopupData(mockData);
|
||||
// };
|
||||
|
||||
// fetchPopupData();
|
||||
|
||||
// }, [mapInstanceRef.current]); // 맵 인스턴스가 생성된 후 한 번만 실행
|
||||
|
||||
// // 데이터가 변경되면 오버레이를 생성/업데이트하는 로직
|
||||
// useEffect(() => {
|
||||
// const map = mapInstanceRef.current;
|
||||
// if (!map || facilityInfoPopupData.length === 0) return;
|
||||
|
||||
// // 기존 오버레이 정리
|
||||
// facilityOverlaysRef.current.forEach(overlay => map.removeOverlay(overlay));
|
||||
// facilityOverlaysRef.current = [];
|
||||
|
||||
// facilityInfoPopupData.forEach(data => {
|
||||
// const popupId = `${data.ftrIdn}_${data.ftrCde}`;
|
||||
|
||||
// // 팝업을 담을 div 엘리먼트 생성
|
||||
// const popupElement = document.createElement('div');
|
||||
// popupElement.id = popupId;
|
||||
|
||||
// // OpenLayers Overlay 생성
|
||||
// const position = olProj.transform([Number(data.x), Number(data.y)], GisApp.FROM_PROJ, GisApp.TO_PROJ);
|
||||
// const overlay = new Overlay({
|
||||
// element: popupElement,
|
||||
// position: position,
|
||||
// offset: [-75, -210], // 팝업 너비의 절반, 높이만큼 오프셋 조정
|
||||
// positioning: 'bottom-center',
|
||||
// className: 'facility-popup-overlay' // 필요시 공통 클래스 추가
|
||||
// });
|
||||
|
||||
// map.addOverlay(overlay);
|
||||
// facilityOverlaysRef.current.push(overlay);
|
||||
|
||||
// // React 컴포넌트를 popupElement에 렌더링
|
||||
// const root = createRoot(popupElement);
|
||||
// root.render(<FacilityInfoPopup data={data} />);
|
||||
// });
|
||||
|
||||
// // 초기 가시성 업데이트
|
||||
// updatePopupVisibility();
|
||||
|
||||
// }, [facilityInfoPopupData]); // 팝업 데이터가 변경될 때마다 실행
|
||||
|
||||
// // 레이어 가시성에 따라 팝업 가시성을 제어하는 함수
|
||||
// const updatePopupVisibility = useCallback(() => {
|
||||
// const map = mapInstanceRef.current;
|
||||
// if (!map) return;
|
||||
|
||||
// const visibleLayers = new Set();
|
||||
// map.getLayers().forEach(layer => {
|
||||
// if (layer.getVisible()) {
|
||||
// // feature.js의 로직처럼 typeName이나 ftrCde를 사용해 필터링
|
||||
// const typeName = layer.get('typeName');
|
||||
// if (typeName === 'VW_WTL_FCLTY_AS') { // 예시 레이어 이름
|
||||
// visibleLayers.add(layer.get('ftrCde'));
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// facilityOverlaysRef.current.forEach(overlay => {
|
||||
// const element = overlay.getElement();
|
||||
// const ftrCde = element.querySelector('table')?.classList[0]; // FacilityPopup의 클래스에서 ftrCde 가져오기
|
||||
|
||||
// if (visibleLayers.has(ftrCde)) {
|
||||
// element.style.display = '';
|
||||
// } else {
|
||||
// element.style.display = 'none';
|
||||
// }
|
||||
// });
|
||||
// }, []);
|
||||
|
||||
// GisTree에서 체크 상태가 변경될 때 이 함수를 호출하도록 연결해야 합니다.
|
||||
// 예시: GisTree 컴포넌트에 onCheck 콜백을 추가하고, 그 콜백에서 이 함수를 호출
|
||||
// useEffect(() => {
|
||||
// // 레이어 가시성이 변경될 때마다 팝업 가시성 업데이트
|
||||
// const map = mapInstanceRef.current;
|
||||
// if (!map) return;
|
||||
|
||||
// const handleLayerVisibilityChange = () => {
|
||||
// updatePopupVisibility();
|
||||
// };
|
||||
|
||||
// map.getLayers().on('change:length', handleLayerVisibilityChange);
|
||||
// map.getLayers().forEach(layer => {
|
||||
// layer.on('change:visible', handleLayerVisibilityChange);
|
||||
// });
|
||||
|
||||
// return () => {
|
||||
// // 클린업
|
||||
// map.getLayers().un('change:length', handleLayerVisibilityChange);
|
||||
// map.getLayers().forEach(layer => {
|
||||
// layer.un('change:visible', handleLayerVisibilityChange);
|
||||
// });
|
||||
// };
|
||||
// }, [updatePopupVisibility]);
|
||||
|
||||
// 체크된 레이어 정보를 처리하는 함수
|
||||
const handleCheckedLayersChange = useCallback((checkedIds, checkedNodesData) => {
|
||||
setTimeout(() => {
|
||||
@@ -358,6 +471,8 @@ function Gis({
|
||||
imageVisible={imgVisble}
|
||||
/>
|
||||
|
||||
{/* <GisContent onFeatureSelect={handleFeatureSelect} isSearch={isSearch} isSearchModalOpen={isSearchModalOpen} setIsSearchModalOpen={setIsSearchModalOpen} /> */}
|
||||
|
||||
{/* DetailView가 존재할 때만 렌더링 isSearchModalOpen이 true면 visible=false로 팝업 숨김 */}
|
||||
{isOpen && !isSearchModalOpen && (
|
||||
<DetailView
|
||||
@@ -375,6 +490,7 @@ function Gis({
|
||||
onFeatureSelect={handleFeatureSelect}
|
||||
/>
|
||||
)}
|
||||
{/* <GisLonLat /> */}
|
||||
<GisToolBar />
|
||||
<GisMapToggle />
|
||||
<GisSelect onFeatureSelect={handleFeatureSelect} />
|
||||
|
||||
@@ -142,7 +142,19 @@ GisOlLayer.prototype = {
|
||||
let returnLayer = this.makeLayer(option);
|
||||
|
||||
//레이어 소스 생성
|
||||
let source = this.getVectorSourceBbox(option);
|
||||
let source;
|
||||
|
||||
let lyrTyNm = option.lyrTyNm;
|
||||
if(lyrTyNm == 'tb_ms_flood_dngr_map'
|
||||
|| lyrTyNm == 'tb_ms_sbmrg_dngr_map'
|
||||
|| lyrTyNm == 'tb_ms_swage_mhl'
|
||||
|| lyrTyNm == 'tb_ms_swage_ppl'
|
||||
) {
|
||||
source = this.getVectorSourceBbox(option);
|
||||
}else {
|
||||
source = this.getVectorTileSource(option);
|
||||
}
|
||||
|
||||
returnLayer.setSource(source);
|
||||
//스타일 추가
|
||||
returnLayer.setStyle(this.gisStyle.getLayerStyleFunction(returnLayer, option));
|
||||
|
||||
@@ -24,6 +24,7 @@ type SearchBaseType = {
|
||||
rightClassName?: string;
|
||||
leftClassName?: string;
|
||||
leftSelectClassName?: string;
|
||||
buttonOrder?: ("query" | "init" | "excel")[];
|
||||
}
|
||||
export type ReturnType = {
|
||||
partValue: string;
|
||||
@@ -55,7 +56,8 @@ function SearchBaseForm ({
|
||||
isAdmin=false,
|
||||
rightClassName,
|
||||
leftClassName,
|
||||
leftSelectClassName
|
||||
leftSelectClassName,
|
||||
buttonOrder
|
||||
}: SearchBaseType) {
|
||||
const [partValue, setPartValue] = useState<string>("A");
|
||||
const [sidoValue, setSidoValue] = useState<string>("0");
|
||||
@@ -67,6 +69,30 @@ function SearchBaseForm ({
|
||||
const [middleRegionValue, setMiddleRegionValue] = useState<string>("0");
|
||||
const [envPartValue, setEnvPartValue] = useState<string>("0");
|
||||
const [resetTrigger, setResetTrigger] = useState(false);
|
||||
const renderButton = (type: "query" | "init" | "excel") => {
|
||||
switch (type) {
|
||||
case "query":
|
||||
return (
|
||||
<Button className={btnClass} onClick={queryVal} key="query">
|
||||
조회
|
||||
</Button>
|
||||
);
|
||||
case "init":
|
||||
return (
|
||||
<Button className={btnClass} onClick={initVal} key="init">
|
||||
초기화
|
||||
</Button>
|
||||
);
|
||||
case "excel":
|
||||
return (
|
||||
<Button className={btnClass} color="green" onClick={excelDownload} key="excel">
|
||||
{excelName ? excelName : "엑셀다운로드"}
|
||||
</Button>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const queryVal = () => {
|
||||
console.log("조회버튼 클릭");
|
||||
queryClick({
|
||||
@@ -145,16 +171,8 @@ function SearchBaseForm ({
|
||||
{leftChildren}
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight className={rightClassName}>
|
||||
<Button className={btnClass} color="green" onClick={excelDownload}>
|
||||
{excelName?excelName:"엑셀다운로드"}
|
||||
</Button>
|
||||
<div>
|
||||
<Button className={btnClass} onClick={initVal}>
|
||||
초기화
|
||||
</Button>
|
||||
<Button className={btnClass} onClick={queryVal}>
|
||||
조회
|
||||
</Button>
|
||||
{(buttonOrder ?? ["excel", "init", "query"]).map(renderButton)}
|
||||
</div>
|
||||
{rightChildren}
|
||||
</SearchFormRight>
|
||||
|
||||
@@ -81,6 +81,8 @@ export function UiTable({
|
||||
const handlePageChange = (page: number) => {
|
||||
setCur(page);
|
||||
onPageChange(page);
|
||||
if (index == 0)
|
||||
setIdx(0)
|
||||
};
|
||||
|
||||
const handleCellClick = (index: number, headId: string) => {
|
||||
@@ -90,6 +92,7 @@ export function UiTable({
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{headName ? (
|
||||
@@ -116,14 +119,13 @@ export function UiTable({
|
||||
head.id.length > 1 &&
|
||||
(boldArray.includes(index) ? (
|
||||
<TableCell
|
||||
className={`${head.align === "right" ? "text-right" : head.align === "center" ? "text-center" : "text-center"} ${
|
||||
cellClick && idx === index
|
||||
className={`${head.align === "right" ? "text-right" : head.align === "center" ? "text-center" : "text-center"} ${cellClick && idx === index
|
||||
? "cursor-pointer !font-[1000]"
|
||||
: cellClick
|
||||
? "cursor-pointer"
|
||||
: ""
|
||||
} sticky top-20 z-40 bg-secondary !font-bold`}
|
||||
style={{ top: `${headerHeight + index * 32-4}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}`}
|
||||
>
|
||||
@@ -131,39 +133,38 @@ export function UiTable({
|
||||
? String(el[head.id] ?? "")
|
||||
: String(el[head.id]).includes(".")
|
||||
? String(el[head.id])
|
||||
.split(".")
|
||||
.map((part, index) =>
|
||||
index === 0
|
||||
? part.replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)
|
||||
: part,
|
||||
)
|
||||
.join(".")
|
||||
.split(".")
|
||||
.map((part, index) =>
|
||||
index === 0
|
||||
? part.replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)
|
||||
: part,
|
||||
)
|
||||
.join(".")
|
||||
: String(el[head.id] ?? "").replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)}
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)}
|
||||
</TableCell>
|
||||
) : (
|
||||
<TableCell
|
||||
className={`${head.align === "right" ? "text-right" : head.align === "center" ? "text-center" : "text-center"} ${
|
||||
cellClick && idx === index
|
||||
className={`${head.align === "right" ? "text-right" : head.align === "center" ? "text-center" : "text-center"} ${cellClick && idx === index
|
||||
? "cursor-pointer !font-[1000]"
|
||||
: cellClick
|
||||
? "cursor-pointer"
|
||||
: ""
|
||||
} mt-[${boldArray.length * 40}px]`}
|
||||
} mt-[${boldArray.length * 40}px]`}
|
||||
onClick={() => handleCellClick(index, head.id)}
|
||||
key={`cell-${head.id}-${index}`}
|
||||
>
|
||||
{
|
||||
//체크박스 유형애서 readOnly가 필요한 경우를 위해서 ChkClass 를 사용해서 readOnly 처리함.
|
||||
typeof el[head.id] === "object" &&
|
||||
el[head.id] !== null &&
|
||||
"chk" in (el[head.id] as object) &&
|
||||
"readonly" in (el[head.id] as object) ? (
|
||||
el[head.id] !== null &&
|
||||
"chk" in (el[head.id] as object) &&
|
||||
"readonly" in (el[head.id] as object) ? (
|
||||
<Checkbox
|
||||
checked={
|
||||
(el[head.id] as ChkClass)?.chk === true
|
||||
@@ -199,9 +200,9 @@ export function UiTable({
|
||||
.map((part, index) =>
|
||||
index === 0
|
||||
? part.replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
",",
|
||||
)
|
||||
: part,
|
||||
)
|
||||
.join(".")
|
||||
|
||||
Reference in New Issue
Block a user