물재이용 페이지별 오류 수정
This commit is contained in:
@@ -146,11 +146,6 @@ export default function Home() {
|
||||
중수도시설통계
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full" onClick={() => {router.push('/stats/matStat')}}>
|
||||
물재이용사례 관리
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,13 +5,15 @@ import { btnClass } from "@/app/store/common/code";
|
||||
import { initValInUsage, initValOutUsage, subTotalObj, totalObj, type FcPrfType, type PrfType } from "@/app/store/prfmncReg/pbnstPrfmncReg/type";
|
||||
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, SearchBaseForm, SelectBox, Title, UiTable, type ChartConfig, type ReturnType } from "@common/business_components";
|
||||
import { CHART_FORM, ContentsDiv, MainChart, ScrollArea, SearchBaseForm, SelectBox, Title, UiTable, type ChartConfig, type ReturnType } from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Label } from "@common/components/ui";
|
||||
import { Label, Table, TableBody, TableHeader } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/TableHead";
|
||||
|
||||
export default function PbnstPrfmncSttn() {
|
||||
const {
|
||||
@@ -88,11 +90,11 @@ export default function PbnstPrfmncSttn() {
|
||||
const prfTableData = (prfList: PrfType[], year: string) => {
|
||||
const inUsageData = structuredClone(initValInUsage).map(row => ({
|
||||
...row
|
||||
// 구분: "장내용수",
|
||||
// 구분: "장내용수",
|
||||
}));
|
||||
const outUsageData = structuredClone(initValOutUsage).map(row => ({
|
||||
...row
|
||||
// 구분: "장외용수",
|
||||
// 구분: "장외용수",
|
||||
}));
|
||||
const inSubtotal = { ...structuredClone(subTotalObj), 구분: "장내용수" };
|
||||
const outSubtotal = { ...structuredClone(subTotalObj), 구분: "장외용수" };
|
||||
@@ -505,7 +507,7 @@ export default function PbnstPrfmncSttn() {
|
||||
|
||||
useEffect(() => {
|
||||
if (pbnRuseNm.length > 1)
|
||||
pbnNmSearch("1", "23", ref.current, pbnRuseNm, searchYear,[]);
|
||||
pbnNmSearch("1", "23", ref.current, pbnRuseNm, searchYear, []);
|
||||
}, [pbnRuseNm]);
|
||||
|
||||
const cellClick = (index: number | undefined, headId: string) => {
|
||||
@@ -554,7 +556,7 @@ export default function PbnstPrfmncSttn() {
|
||||
setPbnRuseNm(searchNm || "");
|
||||
}}
|
||||
setRtnData={/*function (rtnData: any[]): void {setbdstTable(rtnData);}*/
|
||||
()=>{}
|
||||
() => { }
|
||||
}
|
||||
searchList={pbnstSttn.pbnstSearchData || []}
|
||||
></SearchInputText>
|
||||
@@ -643,15 +645,15 @@ export default function PbnstPrfmncSttn() {
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="">하수재이용실적 현황 (단위: m³)</h1>
|
||||
<ListDiv className="col-span-8 pr-6 ">
|
||||
{/* <ScrollArea className="h-[60vh]"> */}
|
||||
{/* <div className="card-header">
|
||||
{/* <ListDiv className="col-span-8 pr-6 "> */}
|
||||
{/* <ScrollArea className="h-[60vh]"> */}
|
||||
{/* <div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m3) 등록결과"}
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div> */}
|
||||
|
||||
<UiTable
|
||||
{/* <UiTable
|
||||
headName={undefined}
|
||||
tableData={prfData || []}
|
||||
headlist={monthHeadList}
|
||||
@@ -659,30 +661,31 @@ export default function PbnstPrfmncSttn() {
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
onPageChange={()=>{}}>
|
||||
</UiTable>
|
||||
</UiTable> */}
|
||||
|
||||
{/* <ListDiv className="col-span-8 pr-6 ">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<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">
|
||||
{"하수처리수재이용 실적(m3) 등록결과"}
|
||||
{"하수재이용실적 현황 (단위: m³)"}
|
||||
</h3>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(monthHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{InputTableBody(prfData ?? [], monthHeadList, setPrfData)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv> */}
|
||||
{/* </ScrollArea> */}
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(monthHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{/* {InputTableBody(prfData ?? [], monthHeadList, setPrfData)} */}
|
||||
{InputTableBody(prfData ?? [], monthHeadList, setPrfData, false)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
{/* </ScrollArea> */}
|
||||
</ListDiv>
|
||||
|
||||
{/* </ListDiv> */}
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -35,13 +35,12 @@ export const drgtStateExport: drgtState = {
|
||||
}
|
||||
}
|
||||
|
||||
const initFetch = async (fromDate: string, toDate: string, sido:string[]) => {
|
||||
console.log("sido",sido)
|
||||
const initFetch = async (fromDate: string, toDate: string, sido: string[]) => {
|
||||
const drgtData = await postFectch(
|
||||
`/il/getDataCount/${fromDate}/${toDate}`,
|
||||
sido,
|
||||
fetchType.WR
|
||||
);
|
||||
`/il/getDataCount/${fromDate}/${toDate}`,
|
||||
sido,
|
||||
fetchType.WR
|
||||
);
|
||||
|
||||
//주의, 관심, 정상 추출
|
||||
const statusData = Array.from(
|
||||
@@ -99,10 +98,10 @@ export const drgtActionsExport: (set: any) => drgtActions = (
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const formatted = `${year}${month}`;
|
||||
const fromDate = formatted;
|
||||
const toDate = formatted;
|
||||
|
||||
//FIXME: 페이지 처음 로딩될때 데이터 보려고 6월로 박아놓음 이거 fromDate로 고치기
|
||||
const drgtRes = await initFetch("202506", toDate, []);
|
||||
const drgtRes = await initFetch(fromDate, toDate, []);
|
||||
set((state: drgtState) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -235,7 +235,8 @@ const handleChange = (
|
||||
export const InputTableBody = (
|
||||
chgRes: any[] | [],
|
||||
headList: TableUpperProps[],
|
||||
setInputData: (data: any[]) => void
|
||||
setInputData: (data: any[]) => void,
|
||||
isEditable: boolean = true
|
||||
) => {
|
||||
// mergeCell 처리용
|
||||
const getRowSpan = (data: any[], key: string, rowIndex: number) => {
|
||||
@@ -301,7 +302,8 @@ export const InputTableBody = (
|
||||
);
|
||||
}
|
||||
// 기본 셀
|
||||
return head.edit === true && data.edit !== false ? (
|
||||
// return head.edit === true && data.edit !== false ? (
|
||||
return isEditable && head.edit === true && data.edit !== false ? (
|
||||
<TableCell key={head.id + headIndex} className={`w-36 ${bgClass}`}>
|
||||
<Input
|
||||
// className={`${head.id !== "utztnUsgCd" ? "text-right" : "text-center"} !text-xl h-10 w-full`}
|
||||
@@ -330,6 +332,13 @@ export const InputTableBody = (
|
||||
</TableRow>
|
||||
);
|
||||
})}
|
||||
{chgRes.length === 0 && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={headList.length} className="h-24 text-center text-gray-500">
|
||||
조회된 결과가 없습니다.
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { numSize } from "@/app/store/common/code/basicCode";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formH1Class } from "@/components/lib/class/comClass";
|
||||
import { safeDate } from "@/components/lib/func/commom";
|
||||
@@ -94,6 +95,7 @@ export default function BdstAdd({ form, readonly }: { form: any; readonly?: bool
|
||||
value={f.value ?? code.chBuCd[0]?.val}
|
||||
className={""}
|
||||
label={""}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -113,6 +115,7 @@ export default function BdstAdd({ form, readonly }: { form: any; readonly?: bool
|
||||
onChange: (date) => f.onChange(date),
|
||||
}}
|
||||
selectClass="w-full"
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -130,6 +133,8 @@ export default function BdstAdd({ form, readonly }: { form: any; readonly?: bool
|
||||
onChange={(e) => f.onChange(e.target.value)}
|
||||
value={f.value || ''}
|
||||
className={selectClass}
|
||||
readOnly={readonly}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { numSize, txtSize } from "@/app/store/common/code/basicCode";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formH1Class } from "@/components/lib/class/comClass";
|
||||
import { handleCommaNumberChange } from "@/components/lib/func/commom";
|
||||
import {
|
||||
FormField,
|
||||
FormUi,
|
||||
@@ -134,6 +136,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
field.onChange(e.target.value)
|
||||
}}
|
||||
value={field.value||''}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -153,6 +156,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
field.onChange(e.target.value)
|
||||
}}
|
||||
value={field.value||''}
|
||||
maxLength={50}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -217,9 +221,10 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
placeholder="면적을 입력하세요"
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value)
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={field.value||''}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -14,12 +14,12 @@ export default function DrgtDetailModal({
|
||||
data: customDrgt[];
|
||||
}) {
|
||||
|
||||
// const [isSggNm, setIsSggNm] = useState('')
|
||||
const [excelData, setExcelData] = useState<any[]>();
|
||||
// const [isSggNm, setIsSggNm] = useState('')
|
||||
const [excelData, setExcelData] = useState<any[]>();
|
||||
const excelClick = () => {
|
||||
downloadExcel({
|
||||
data: excelData ?? [],
|
||||
fileName: "우리동네가뭄 상세현황",
|
||||
fileName: `우리동네가뭄 상세현황 - ${data[0]?.sggNm}`,
|
||||
sheetNameArray: ["Sheet1"],
|
||||
headerRange: "A1:C1"
|
||||
})
|
||||
@@ -36,10 +36,10 @@ export default function DrgtDetailModal({
|
||||
}
|
||||
}) : [];
|
||||
setExcelData(exData)
|
||||
// if(data&&data[0].sggNm){
|
||||
////TODO: data.sggNm [0[인지 data.sggNm 인지 사용하는지 확인필요
|
||||
// setIsSggNm(data[0].sggNm)
|
||||
// }
|
||||
// if(data&&data[0].sggNm){
|
||||
////TODO: data.sggNm [0[인지 data.sggNm 인지 사용하는지 확인필요
|
||||
// setIsSggNm(data[0].sggNm)
|
||||
// }
|
||||
}, [data])
|
||||
|
||||
return (
|
||||
@@ -47,7 +47,7 @@ export default function DrgtDetailModal({
|
||||
<div className="grid grid-cols-4 gap-4 h-full">
|
||||
<div className="col-span-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Title title={`우리동네가뭄 상세내용 - ${data[0]&&data[0].sggNm ?data[0].sggNm:'' }`} />
|
||||
<Title title={`우리동네가뭄 상세내용 - ${data[0] && data[0].sggNm ? data[0].sggNm : ''}`} />
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
size={"sm"}
|
||||
@@ -65,15 +65,11 @@ export default function DrgtDetailModal({
|
||||
<ScrollArea className="h-[63vh]">
|
||||
<UiTable
|
||||
headName={undefined}
|
||||
tableData={data }
|
||||
tableData={data}
|
||||
headlist={drgtDetailHeadListExport}
|
||||
pageSize={10}
|
||||
total={10000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
console.log(' indx ' , index)
|
||||
console.log(' headId ' , headId)
|
||||
|
||||
}}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
onPageChange={() => { }}
|
||||
></UiTable>
|
||||
</ScrollArea>
|
||||
|
||||
@@ -326,7 +326,7 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m3) 등록결과"}
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div>
|
||||
<Table variant="secondary">
|
||||
|
||||
Reference in New Issue
Block a user