빗물시설통계 데이터 작업 완료
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { btnClass } from "@/app/store/common/code";
|
||||
import { type customLdrmnt } from "@/app/store/matDmd/ldrmntCoSttn";
|
||||
import { ldrmntNodeListExport } from "@/app/store/matDmd/ldrmntCoSttn/headList";
|
||||
import { ldrmntHeadListExport, ldrmntNodeListExport } from "@/app/store/matDmd/ldrmntCoSttn/headList";
|
||||
import {
|
||||
excelDownload,
|
||||
getCity,
|
||||
@@ -202,7 +202,7 @@ export default function LdrmntCoSttn() {
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
headlist={ldrmntNodeListExport}
|
||||
headlist={ldrmntHeadListExport}
|
||||
pageSize={20}
|
||||
total={10000}
|
||||
cellClick={(index: number | undefined, headId: string) => { cellClick(index ?? undefined, headId) }}
|
||||
|
||||
@@ -114,7 +114,7 @@ export const ldrmntNodeListExport: CommonTableProps[] = [
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "mngInst",
|
||||
id: "mngInstNm",
|
||||
title: "관리기관",
|
||||
visible: true,
|
||||
row: 1,
|
||||
|
||||
@@ -27,7 +27,7 @@ export type ldrmntState = {
|
||||
|
||||
type ldrmntActions = {
|
||||
ldrmntRegData: (data: any[]) => void,
|
||||
ldrmntInit: (con:string) => void
|
||||
ldrmntInit: (con: string) => void
|
||||
ldrmntSearch: (sggCd: string, coNm: string) => void;
|
||||
ldrmntUpdate: (ldrmntRes: customLdrmnt) => void;
|
||||
ldrmntDelete: () => void;
|
||||
@@ -49,22 +49,24 @@ export const ldrmntActionsExport: (set: any) => ldrmntActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
ldrmntInit: async (con:string) => {
|
||||
ldrmntInit: async (con: string) => {
|
||||
try {
|
||||
console.log("con", con)
|
||||
const ldrmntRes = await getFetch(
|
||||
fetchType.WR,
|
||||
`/reuseFc/request/temp/1/20/${con}`
|
||||
);
|
||||
console.log("initres",)
|
||||
return set((state: ldrmntState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.ldrmnt,
|
||||
ldrmntRes: ldrmntRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
console.log("initres", ldrmntRes)
|
||||
set((state: ldrmntState) => {
|
||||
return {
|
||||
...state,
|
||||
ldrmnt: {
|
||||
...state.ldrmnt,
|
||||
ldrmntRes: ldrmntRes,
|
||||
isInit: false,
|
||||
},
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ export const rainStatActionsExport = (
|
||||
return {
|
||||
searchRainStatList : async (year:string) => {
|
||||
const res = await fetchRainStatList(year);
|
||||
<<<<<<< Updated upstream
|
||||
const rainStatList: never[] = [];
|
||||
/* const rainStatHeadList = data.map((item:RainStatProps) => ({
|
||||
...item,
|
||||
@@ -81,6 +82,49 @@ export const rainStatActionsExport = (
|
||||
way7:item.way7,
|
||||
yearMoney:item.yearMoney,
|
||||
})) */
|
||||
=======
|
||||
|
||||
let cityArr: any[] = [];
|
||||
res.forEach((item: RainStatProps) => {
|
||||
|
||||
let obj = cityArr.find((e) => {
|
||||
return e.ctpvCd == item.ctpvCd
|
||||
})
|
||||
|
||||
if (obj) {
|
||||
obj.instlCst += item.instlCst
|
||||
obj.dtfcltCpct += item.dtfcltCpct
|
||||
obj.wtrUsqty += item.wtrUsqty
|
||||
obj.anlOperCst += item.anlOperCst
|
||||
obj.tmp += 1
|
||||
} else {
|
||||
obj = {};
|
||||
obj.ctpvCd = item.ctpvCd
|
||||
obj.instlCst = item.instlCst
|
||||
obj.tmp = 1
|
||||
obj.dtfcltCpct = item.dtfcltCpct
|
||||
obj.wtrUsqty = item.wtrUsqty
|
||||
obj.anlOperCst = item.anlOperCst
|
||||
|
||||
cityArr.push(obj)
|
||||
}
|
||||
|
||||
if (item.guideStats && item.guideStats.length > 0) {
|
||||
item.guideStats.forEach((guide: GuideStatProps) => {
|
||||
rainStatHeadListExport.forEach((headItem: TableUpperProps) => {
|
||||
|
||||
if (headItem.title == guide.utztnUsgCd) {
|
||||
if (!obj[headItem.id] || typeof obj[headItem.id] !== "number") obj[headItem.id] = 0;
|
||||
if (typeof obj[headItem.id] === "number") {
|
||||
|
||||
obj[headItem.id] += guide.ruseFcltUtztnQnt;
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
>>>>>>> Stashed changes
|
||||
set((state: rainStatState) => ({
|
||||
rainStat: {
|
||||
...state.rainStat,
|
||||
|
||||
Reference in New Issue
Block a user