지도점검결과 현황 검색조건 시설명 추가
This commit is contained in:
@@ -83,7 +83,7 @@ export default function Page() {
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
const cellClick = () => {
|
||||
if (searchYear)
|
||||
if (searchYear) {
|
||||
if (selFcltDiv === "RNB") {
|
||||
if (fcltNm) {
|
||||
rainChkNmSearch(
|
||||
@@ -99,8 +99,8 @@ export default function Page() {
|
||||
} else {
|
||||
if (fcltNm) {
|
||||
rswtChkNmSearch(
|
||||
rainPageNation,
|
||||
rainPageSize,
|
||||
rswtPageNation,
|
||||
rswtPageSize,
|
||||
searchYear,
|
||||
commonCd,
|
||||
fcltNm
|
||||
@@ -109,6 +109,7 @@ export default function Page() {
|
||||
rswtChkgdnInit(rswtPageNation, rswtPageSize, searchYear, commonCd);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const rainPageChange = (pageNo: number) => {
|
||||
if (pageNo > 0) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
SelectBox,
|
||||
Title,
|
||||
UiModal
|
||||
@@ -30,9 +31,9 @@ export default function Page() {
|
||||
rainChkSttn,
|
||||
rswtChkSttn,
|
||||
rainChkSttnInit,
|
||||
rainChkSttnSearch,
|
||||
rswtChkSttnSearch,
|
||||
rainChkSttnNmSearch,
|
||||
rswtChkSttnInit,
|
||||
rswtChkNmSttnSearch,
|
||||
isRainSttn,
|
||||
isRswtSttn,
|
||||
rswtChkPolInit,
|
||||
@@ -43,6 +44,7 @@ export default function Page() {
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RNB");
|
||||
const [rainPageNation, setRainPageNation] = useState(1);
|
||||
const [rswtPageNation, setRswtPageNation] = useState(1);
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
const [isModal, setIsModal] = useState({
|
||||
open: false,
|
||||
data: {},
|
||||
@@ -51,9 +53,29 @@ export default function Page() {
|
||||
const cellClick = () => {
|
||||
if (searchYear) {
|
||||
if (selFcltDiv === "RNB") {
|
||||
rainChkSttnSearch(rainPageNation, rainPageSize, searchYear, commonCd);
|
||||
if (fcltNm) {
|
||||
rainChkSttnNmSearch(
|
||||
rainPageNation,
|
||||
rainPageSize,
|
||||
searchYear,
|
||||
commonCd,
|
||||
fcltNm
|
||||
);
|
||||
} else {
|
||||
rainChkSttnInit(rainPageNation, rainPageSize, searchYear, commonCd);
|
||||
}
|
||||
} else {
|
||||
rswtChkSttnSearch(rswtPageNation, rswtPageSize, searchYear, commonCd);
|
||||
if (fcltNm) {
|
||||
rswtChkNmSttnSearch(
|
||||
rswtPageNation,
|
||||
rswtPageSize,
|
||||
searchYear,
|
||||
commonCd,
|
||||
fcltNm
|
||||
);
|
||||
} else {
|
||||
rswtChkSttnInit(rswtPageNation, rswtPageSize, searchYear, commonCd);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -151,6 +173,17 @@ export default function Page() {
|
||||
value={selFcltDiv ?? rainChkSttn.fcltDiv[0]?.val}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2 flex flex-row space-x-2">
|
||||
<Label className="w-28 mt-2 text-xl text-gray-600">
|
||||
{"시설명"}
|
||||
</Label>
|
||||
<SearchInput
|
||||
className={"w-full text-2xl"}
|
||||
label={""}
|
||||
textValue={fcltNm || ""}
|
||||
setText={setFcltNm}
|
||||
/>
|
||||
</div>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<div className="space-y">
|
||||
|
||||
@@ -217,12 +217,11 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
||||
"wr",
|
||||
`/reuseChk/reuseWater` +
|
||||
(pageNo ? `/${pageNo}` : "/1") +
|
||||
(cnt ? `/${cnt}` : "/20") +
|
||||
(cnt ? `/${cnt}` : "/5") +
|
||||
(year ? `/${year}` : `/${currentYear}`) +
|
||||
(sggCd ? `/${sggCd}` : "/0") +
|
||||
(txt ? `/${txt}` : "")
|
||||
);
|
||||
|
||||
return set((state: rswtChkgdnState) => ({
|
||||
...state,
|
||||
rswtChkgdn: {
|
||||
|
||||
@@ -36,9 +36,9 @@ export type rainChkSttnState = {
|
||||
|
||||
type rainChkSttnActions = {
|
||||
rainChkSttnInit: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
rainChkSttnSearch: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
isRainSttn: (isSttn: boolean) => void;
|
||||
getRainSttnExcel: (excelList: rainChkZodType[]) => void;
|
||||
rainChkSttnNmSearch: (pageNo: number, cnt: number, year: string, sggCd: string, txt: string) => void
|
||||
};
|
||||
|
||||
export type rainChkSttnType = rainChkSttnState & rainChkSttnActions;
|
||||
@@ -91,21 +91,37 @@ export const rainChkSttnActionsExport: (set: any) => rainChkSttnActions = (
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rainChkSttnSearch: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
rainChkSttnNmSearch: async (
|
||||
pageNo: number,
|
||||
cnt: number,
|
||||
year: string,
|
||||
sggCd: string,
|
||||
txt: string
|
||||
) => {
|
||||
try {
|
||||
const rainChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
const rainChkRes = await getCountFetch(
|
||||
"wr",
|
||||
`/reuseChk/rainy` +
|
||||
(pageNo ? `/${pageNo}` : "/1") +
|
||||
(cnt ? `/${cnt}` : "/5") +
|
||||
(year ? `/${year}` : `/${currentYear}`) +
|
||||
(sggCd ? `/${sggCd}` : "/0") +
|
||||
(txt ? `/${txt}` : "")
|
||||
);
|
||||
return set((state: rainChkSttnState) => ({
|
||||
...state,
|
||||
rainChkSttn: {
|
||||
...state.rainChkSttn,
|
||||
rainChkRes: rainChkRes
|
||||
rainChkRes: rainChkRes.data,
|
||||
rainChkCount: rainChkRes.count,
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}, isRainSttn: (isSttn: boolean) => {
|
||||
},
|
||||
isRainSttn: (isSttn: boolean) => {
|
||||
try {
|
||||
return set((state: rainChkSttnState) => ({
|
||||
...state,
|
||||
|
||||
@@ -28,7 +28,7 @@ type rswtChkSttnActions = {
|
||||
rswtChkSttnInit: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
isRswtSttn: (isSttn: boolean) => void;
|
||||
getRswtSttnExcel: (excelList: rswtChkZodType[]) => void;
|
||||
rswtChkSttnSearch: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
rswtChkNmSttnSearch: (pageNo: number, cnt: number, year: string, sggCd: string, txt: string) => void;
|
||||
};
|
||||
|
||||
export type rswtChkSttnType = rswtChkSttnState & rswtChkSttnActions;
|
||||
@@ -109,9 +109,24 @@ export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rswtChkSttnSearch: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
rswtChkNmSttnSearch: async (
|
||||
pageNo: number,
|
||||
cnt: number,
|
||||
year: string,
|
||||
sggCd: string,
|
||||
txt: string
|
||||
) => {
|
||||
try {
|
||||
const rswtChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
const rswtChkRes = await getCountFetch(
|
||||
"wr",
|
||||
`/reuseChk/reuseWater` +
|
||||
(pageNo ? `/${pageNo}` : "/1") +
|
||||
(cnt ? `/${cnt}` : "/20") +
|
||||
(year ? `/${year}` : `/${currentYear}`) +
|
||||
(sggCd ? `/${sggCd}` : "/0") +
|
||||
(txt ? `/${txt}` : "")
|
||||
);
|
||||
|
||||
return set((state: rswtChkSttnState) => ({
|
||||
...state,
|
||||
@@ -119,6 +134,7 @@ export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
||||
...state.rswtChkSttn,
|
||||
rswtChkRes: rswtChkRes.data,
|
||||
rswtChkCount: rswtChkRes.count,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user