Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c16b9d14d | ||
|
|
3ba11b5508 |
+1
-27
@@ -11,8 +11,6 @@ import {
|
|||||||
const serverApiUrl =
|
const serverApiUrl =
|
||||||
process.env.NEXT_PUBLIC_SERVER_API_URL ?? "http://localhost:3000";
|
process.env.NEXT_PUBLIC_SERVER_API_URL ?? "http://localhost:3000";
|
||||||
|
|
||||||
const linkBackendApiHost = process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST ?? "http://localhost:8080";
|
|
||||||
|
|
||||||
export function middleware(req: NextRequest) {
|
export function middleware(req: NextRequest) {
|
||||||
const pathname = req.nextUrl.pathname;
|
const pathname = req.nextUrl.pathname;
|
||||||
const searchParams = req.nextUrl.searchParams;
|
const searchParams = req.nextUrl.searchParams;
|
||||||
@@ -54,30 +52,6 @@ export function middleware(req: NextRequest) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname.startsWith("/api/link")) {
|
|
||||||
const requestHeaders = new Headers(req.headers);
|
|
||||||
const token = req.cookies.get(CLAIM_NAME)?.value;
|
|
||||||
const userId = req.cookies.get(AUTH_USER_ID)?.value;
|
|
||||||
|
|
||||||
// /api/link 경로를 제거하고 백엔드 API 경로로 변환
|
|
||||||
const apiPath = pathname.replace("/api/link", "");
|
|
||||||
const queryParams = searchParams.toString();
|
|
||||||
const newUrl = `${linkBackendApiHost}${apiPath}${
|
|
||||||
queryParams ? `?${queryParams}` : ""
|
|
||||||
}`;
|
|
||||||
|
|
||||||
if (token) requestHeaders.set(CLAIM_NAME, token);
|
|
||||||
if (userId) requestHeaders.set(AUTH_USER_ID, userId);
|
|
||||||
|
|
||||||
logMessages.push(` Link API Rewritten URL: ${newUrl}`);
|
|
||||||
logMessages.push("\n--------------------------------\n");
|
|
||||||
console.log(logMessages.join("\n"));
|
|
||||||
|
|
||||||
return NextResponse.rewrite(new URL(newUrl), {
|
|
||||||
headers: requestHeaders,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pathname === "/") {
|
if (pathname === "/") {
|
||||||
return NextResponse.redirect(new URL("/dashboard", req.url));
|
return NextResponse.redirect(new URL("/dashboard", req.url));
|
||||||
}
|
}
|
||||||
@@ -88,5 +62,5 @@ export function middleware(req: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ["/server/:path*", "/attach-service/:path*", "/api/link/:path*", "/"],
|
matcher: ["/server/:path*", "/attach-service/:path*", "/"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
export class LinkApiService implements LinkService {
|
export class LinkApiService implements LinkService {
|
||||||
public async getLinkList(params: LinkSearchParam): Promise<LinkList> {
|
public async getLinkList(params: LinkSearchParam): Promise<LinkList> {
|
||||||
const response = await axios.get<LinkList>(
|
const response = await axios.get<LinkList>(
|
||||||
`/api/link/getLinkList`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkList`,
|
||||||
{ params }
|
{ params }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -28,41 +28,41 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async getLinkInfo(linkSn: string): Promise<LinkInfo> {
|
public async getLinkInfo(linkSn: string): Promise<LinkInfo> {
|
||||||
const response = await axios.get<LinkInfo>(
|
const response = await axios.get<LinkInfo>(
|
||||||
`/api/link/getLinkInfo/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkInfo/${linkSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async linkQuickStart(linkSn: string): Promise<string> {
|
public async linkQuickStart(linkSn: string): Promise<string> {
|
||||||
const response = await axios.patch<string>(
|
const response = await axios.patch<string>(
|
||||||
`/api/link/linkQuickStart/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/linkQuickStart/${linkSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateLinkInfo(data: LinkFormData): Promise<void> {
|
public async updateLinkInfo(data: LinkFormData): Promise<void> {
|
||||||
await axios.put<void>(
|
await axios.put<void>(
|
||||||
'/api/link/updateLinkInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/updateLinkInfo`,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async insertLinkInfo(data: LinkFormData): Promise<void> {
|
public async insertLinkInfo(data: LinkFormData): Promise<void> {
|
||||||
await axios.post<void>(
|
await axios.post<void>(
|
||||||
'/api/link/insertLinkInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/insertLinkInfo`,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteLink(linkSn: string): Promise<void> {
|
public async deleteLink(linkSn: string): Promise<void> {
|
||||||
await axios.delete<void>(
|
await axios.delete<void>(
|
||||||
`/api/link/deleteLink/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/deleteLink/${linkSn}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getLinkLogList(params: LinkSearchParam): Promise<LinkLogList> {
|
public async getLinkLogList(params: LinkSearchParam): Promise<LinkLogList> {
|
||||||
const response = await axios.get<LinkLogList>(
|
const response = await axios.get<LinkLogList>(
|
||||||
'/api/link/selectLinkLoglist',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/selectLinkLoglist`,
|
||||||
{ params }
|
{ params }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -70,7 +70,7 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async getLinkStatsList(params: LinkSearchParam): Promise<LinkStatsList> {
|
public async getLinkStatsList(params: LinkSearchParam): Promise<LinkStatsList> {
|
||||||
const response = await axios.get<LinkStatsList>(
|
const response = await axios.get<LinkStatsList>(
|
||||||
'/api/link/selectLinkStats',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/selectLinkStats`,
|
||||||
{ params }
|
{ params }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -78,14 +78,14 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async getLinkVrblList(linkSn: string): Promise<LinkVrblList> {
|
public async getLinkVrblList(linkSn: string): Promise<LinkVrblList> {
|
||||||
const response = await axios.get<LinkVrblList>(
|
const response = await axios.get<LinkVrblList>(
|
||||||
`/api/link/getLinkVrblList/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkVrblList/${linkSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async insertLinkVrbl(data: LinkVrblFormData): Promise<number> {
|
public async insertLinkVrbl(data: LinkVrblFormData): Promise<number> {
|
||||||
const response = await axios.post<number>(
|
const response = await axios.post<number>(
|
||||||
'/api/link/insertLinkVrbl',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/insertLinkVrbl`,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async deleteLinkVrbl(data: string[]): Promise<void> {
|
public async deleteLinkVrbl(data: string[]): Promise<void> {
|
||||||
await axios.delete<void>(
|
await axios.delete<void>(
|
||||||
'/api/link/deleteLinkVrbl',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/deleteLinkVrbl`,
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -103,35 +103,35 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async getLinkVrblInfo(linkVrblSn: string): Promise<LinkVrbl> {
|
public async getLinkVrblInfo(linkVrblSn: string): Promise<LinkVrbl> {
|
||||||
const response = await axios.get<LinkVrbl>(
|
const response = await axios.get<LinkVrbl>(
|
||||||
`/api/link/getLinkVrblInfo/${linkVrblSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkVrblInfo/${linkVrblSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateLinkVrblInfo(data: LinkVrblFormData): Promise<void> {
|
public async updateLinkVrblInfo(data: LinkVrblFormData): Promise<void> {
|
||||||
await axios.put<void>(
|
await axios.put<void>(
|
||||||
'/api/link/updateLinkVrblInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/updateLinkVrblInfo`,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getLinkTableInfo(linkSn: string): Promise<LinkTable> {
|
public async getLinkTableInfo(linkSn: string): Promise<LinkTable> {
|
||||||
const response = await axios.get<LinkTable>(
|
const response = await axios.get<LinkTable>(
|
||||||
`/api/link/getLinkTableInfo/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkTableInfo/${linkSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getLinkTableColList(linkSn: string): Promise<LinkTableColumnsList> {
|
public async getLinkTableColList(linkSn: string): Promise<LinkTableColumnsList> {
|
||||||
const response = await axios.get<LinkTableColumnsList>(
|
const response = await axios.get<LinkTableColumnsList>(
|
||||||
`/api/link/getLinkTableColList/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkTableColList/${linkSn}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getLinkTableColInfo(params: { colSn: string; tblSn:string; }): Promise<LinkTableColumns> {
|
public async getLinkTableColInfo(params: { colSn: string; tblSn:string; }): Promise<LinkTableColumns> {
|
||||||
const response = await axios.get<LinkTableColumns>(
|
const response = await axios.get<LinkTableColumns>(
|
||||||
'/api/link/getLinkTableColInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkTableColInfo`,
|
||||||
{ params }
|
{ params }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -139,14 +139,14 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async insertLinkTableCol(data: LinkTableColData): Promise<void> {
|
public async insertLinkTableCol(data: LinkTableColData): Promise<void> {
|
||||||
await axios.post<void>(
|
await axios.post<void>(
|
||||||
'/api/link/insertLinkTableCol',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/insertLinkTableCol`,
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteLinkTableCol(data: string[]): Promise<void> {
|
public async deleteLinkTableCol(data: string[]): Promise<void> {
|
||||||
await axios.delete<void>(
|
await axios.delete<void>(
|
||||||
'/api/link/deleteLinkTableCol',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/deleteLinkTableCol`,
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
},
|
},
|
||||||
@@ -155,35 +155,35 @@ export class LinkApiService implements LinkService {
|
|||||||
|
|
||||||
public async updateLinkTableCol(data: LinkTableColData): Promise<void> {
|
public async updateLinkTableCol(data: LinkTableColData): Promise<void> {
|
||||||
axios.put<void>(
|
axios.put<void>(
|
||||||
'/api/link/updateLinkTableCol',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/updateLinkTableCol`,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async insertLinkTableInfo(data: LinkTableFormData): Promise<void> {
|
public async insertLinkTableInfo(data: LinkTableFormData): Promise<void> {
|
||||||
await axios.post<void>(
|
await axios.post<void>(
|
||||||
'/api/link/insertLinkTableInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/insertLinkTableInfo`,
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateLinkTableInfo(data: LinkTableFormData): Promise<void> {
|
public async updateLinkTableInfo(data: LinkTableFormData): Promise<void> {
|
||||||
await axios.put<void>(
|
await axios.put<void>(
|
||||||
'/api/link/updateLinkTableInfo',
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/updateLinkTableInfo`,
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async countLinkTblNm(tblNm: string): Promise<{count: number, tbl_sn: string}> {
|
public async countLinkTblNm(tblNm: string): Promise<{count: number, tbl_sn: string}> {
|
||||||
const response = await axios.get<{count: number, tbl_sn: string}>(
|
const response = await axios.get<{count: number, tbl_sn: string}>(
|
||||||
`/api/link/countLinkTblNm/${tblNm}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/countLinkTblNm/${tblNm}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateLinkResultCode(linkSn: string): Promise<void> {
|
public async updateLinkResultCode(linkSn: string): Promise<void> {
|
||||||
await axios.patch<void>(
|
await axios.patch<void>(
|
||||||
`/api/link/updateLinkResultCode/${linkSn}`,
|
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/updateLinkResultCode/${linkSn}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ function DashboardPage() {
|
|||||||
금일 신규 가입자
|
금일 신규 가입자
|
||||||
{data?.memberTodayCnt
|
{data?.memberTodayCnt
|
||||||
? data.memberTodayCnt.toLocaleString()
|
? data.memberTodayCnt.toLocaleString()
|
||||||
: "0"}
|
: "-"}
|
||||||
명
|
명
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -141,7 +141,7 @@ function DashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
<p className="mt-1 text-2xl opacity-80">
|
<p className="mt-1 text-2xl opacity-80">
|
||||||
금일 +
|
금일 +
|
||||||
{data?.pstTodayCnt ? data.pstTodayCnt.toLocaleString() : "0"}
|
{data?.pstTodayCnt ? data.pstTodayCnt.toLocaleString() : "-"}{" "}
|
||||||
등록
|
등록
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -168,7 +168,7 @@ function DashboardPage() {
|
|||||||
전일 대비 +
|
전일 대비 +
|
||||||
{data?.accessBefDayPer
|
{data?.accessBefDayPer
|
||||||
? data.accessBefDayPer.toLocaleString()
|
? data.accessBefDayPer.toLocaleString()
|
||||||
: "0"}
|
: "-"}
|
||||||
%
|
%
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ function LinkParamsPage() {
|
|||||||
|
|
||||||
// Link 목록 쿼리
|
// Link 목록 쿼리
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['api/link/getLinkList', linkSearchParam],
|
queryKey: [`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkList`, linkSearchParam],
|
||||||
queryFn: () => LinkApi.getLinkList({
|
queryFn: () => LinkApi.getLinkList({
|
||||||
...linkSearchParam,
|
...linkSearchParam,
|
||||||
page: pagination.pageIndex,
|
page: pagination.pageIndex,
|
||||||
@@ -142,10 +142,9 @@ function LinkParamsPage() {
|
|||||||
const { mutateAsync: deleteLinkVrbl } = useMutation({
|
const { mutateAsync: deleteLinkVrbl } = useMutation({
|
||||||
mutationFn: async (data: string[]) => await LinkApi.deleteLinkVrbl(data),
|
mutationFn: async (data: string[]) => await LinkApi.deleteLinkVrbl(data),
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
await queryClient.refetchQueries({
|
await queryClient.invalidateQueries({
|
||||||
queryKey: ['linkVrblList', selectedLink.linkSn]
|
queryKey: ['linkVrblList', selectedLink.linkSn]
|
||||||
});
|
});
|
||||||
|
|
||||||
setSelectedVrblIds([]);
|
setSelectedVrblIds([]);
|
||||||
alert('삭제되었습니다.');
|
alert('삭제되었습니다.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function LinkTablePage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['/api/link/getLinkList', linkSearchParam],
|
queryKey: [`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkList`, linkSearchParam],
|
||||||
queryFn: () => LinkApi.getLinkList({
|
queryFn: () => LinkApi.getLinkList({
|
||||||
...linkSearchParam,
|
...linkSearchParam,
|
||||||
page: pagination.pageIndex,
|
page: pagination.pageIndex,
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import { client } from "@/shared/api";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import {
|
|
||||||
type ConnectionLogParams,
|
|
||||||
type ConnectionLogList,
|
|
||||||
type ConnectionStatisticsParams,
|
|
||||||
type ConnectionStatistics,
|
|
||||||
type ConnectionLogService,
|
|
||||||
} from "../model/connection-log-interface";
|
|
||||||
|
|
||||||
class ConnectionLogApiService implements ConnectionLogService {
|
|
||||||
async getConnectionLog(
|
|
||||||
params: ConnectionLogParams,
|
|
||||||
): Promise<ConnectionLogList> {
|
|
||||||
const response = await client.get<ConnectionLogList>(
|
|
||||||
`${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}`,
|
|
||||||
{ params },
|
|
||||||
);
|
|
||||||
return response.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getConnectionStatistics(
|
|
||||||
params: ConnectionStatisticsParams,
|
|
||||||
): Promise<ConnectionStatistics> {
|
|
||||||
const response = await client.get<ConnectionStatistics>(
|
|
||||||
`${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}/stat`,
|
|
||||||
{ params },
|
|
||||||
);
|
|
||||||
return response.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ConnectionLogApi = new ConnectionLogApiService();
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { UserStatisticsApi } from "./user-statistics-service";
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
import {
|
||||||
|
type AccessLog,
|
||||||
|
type AccessLogParams,
|
||||||
|
type AccessLogService,
|
||||||
|
type PageableList,
|
||||||
|
} from "../model/user-statistics-interface";
|
||||||
|
|
||||||
|
// 목 데이터
|
||||||
|
const mockAccessLogs: AccessLog[] = [
|
||||||
|
{
|
||||||
|
no: 1,
|
||||||
|
accessTime: "2024-01-15 14:30:25",
|
||||||
|
accessIp: "192.168.1.100",
|
||||||
|
accessRegion: "서울특별시",
|
||||||
|
urlPath: "/index",
|
||||||
|
browser: "Chrome",
|
||||||
|
site: "SITE1",
|
||||||
|
accessType: "메인",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
no: 2,
|
||||||
|
accessTime: "2024-01-15 14:28:15",
|
||||||
|
accessIp: "203.241.50.123",
|
||||||
|
accessRegion: "부산광역시",
|
||||||
|
urlPath: "/board/list",
|
||||||
|
browser: "Edge",
|
||||||
|
site: "SITE2",
|
||||||
|
accessType: "게시판",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
no: 3,
|
||||||
|
accessTime: "2024-01-15 14:25:42",
|
||||||
|
accessIp: "175.223.45.67",
|
||||||
|
accessRegion: "대구광역시",
|
||||||
|
urlPath: "/statistics",
|
||||||
|
browser: "Safari",
|
||||||
|
site: "SITE1",
|
||||||
|
accessType: "통계",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
no: 4,
|
||||||
|
accessTime: "2024-01-15 14:22:18",
|
||||||
|
accessIp: "211.252.87.45",
|
||||||
|
accessRegion: "인천광역시",
|
||||||
|
urlPath: "/contents/view",
|
||||||
|
browser: "Firefox",
|
||||||
|
site: "SITE3",
|
||||||
|
accessType: "컨텐츠",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
no: 5,
|
||||||
|
accessTime: "2024-01-15 14:20:33",
|
||||||
|
accessIp: "121.254.12.89",
|
||||||
|
accessRegion: "광주광역시",
|
||||||
|
urlPath: "/search",
|
||||||
|
browser: "Chrome",
|
||||||
|
site: "SITE1",
|
||||||
|
accessType: "검색",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 목 API 서비스
|
||||||
|
class UserStatisticsApiImpl implements AccessLogService {
|
||||||
|
async getAccessLogList(
|
||||||
|
params: AccessLogParams,
|
||||||
|
): Promise<PageableList<AccessLog>> {
|
||||||
|
// 실제 API 호출 대신 목 데이터 반환
|
||||||
|
const { page = 0, size = 10 } = params;
|
||||||
|
|
||||||
|
// 필터링 로직 (실제로는 서버에서 처리)
|
||||||
|
let filteredLogs = [...mockAccessLogs];
|
||||||
|
|
||||||
|
if (params.urlPath) {
|
||||||
|
filteredLogs = filteredLogs.filter((log) =>
|
||||||
|
log.urlPath.toLowerCase().includes(params.urlPath!.toLowerCase()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.accessIp) {
|
||||||
|
filteredLogs = filteredLogs.filter((log) =>
|
||||||
|
log.accessIp.includes(params.accessIp!),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.accessRegion) {
|
||||||
|
filteredLogs = filteredLogs.filter((log) =>
|
||||||
|
log.accessRegion.includes(params.accessRegion!),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.browser) {
|
||||||
|
filteredLogs = filteredLogs.filter(
|
||||||
|
(log) => log.browser.toLowerCase() === params.browser!.toLowerCase(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.siteId) {
|
||||||
|
filteredLogs = filteredLogs.filter((log) => log.site === params.siteId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지네이션
|
||||||
|
const start = page * size;
|
||||||
|
const end = start + size;
|
||||||
|
const paginatedLogs = filteredLogs.slice(start, end);
|
||||||
|
|
||||||
|
// 목 응답 생성
|
||||||
|
return {
|
||||||
|
content: paginatedLogs,
|
||||||
|
pageable: {
|
||||||
|
pageNumber: page,
|
||||||
|
pageSize: size,
|
||||||
|
sort: {
|
||||||
|
empty: true,
|
||||||
|
sorted: false,
|
||||||
|
unsorted: true,
|
||||||
|
},
|
||||||
|
offset: page * size,
|
||||||
|
paged: true,
|
||||||
|
unpaged: false,
|
||||||
|
},
|
||||||
|
last: (page + 1) * size >= filteredLogs.length,
|
||||||
|
totalPages: Math.ceil(filteredLogs.length / size),
|
||||||
|
totalElements: filteredLogs.length,
|
||||||
|
size,
|
||||||
|
number: page,
|
||||||
|
sort: {
|
||||||
|
empty: true,
|
||||||
|
sorted: false,
|
||||||
|
unsorted: true,
|
||||||
|
},
|
||||||
|
first: page === 0,
|
||||||
|
numberOfElements: paginatedLogs.length,
|
||||||
|
empty: paginatedLogs.length === 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const UserStatisticsApi = new UserStatisticsApiImpl();
|
||||||
@@ -1,103 +1,148 @@
|
|||||||
import type { ChartData, ChartOptions } from "chart.js";
|
import { type ChartData, type ChartOptions } from "chart.js";
|
||||||
import { getCssVariableValue } from "@common/components";
|
|
||||||
import type { ConnectionStatistics } from "./connection-log-interface";
|
|
||||||
|
|
||||||
export const chartData = {
|
// 일별 접속 현황 차트 데이터
|
||||||
day: (
|
export const monthlyStatisticsData = {
|
||||||
data: ConnectionStatistics,
|
labels: [
|
||||||
): {
|
"1일",
|
||||||
data: ChartData<"line">;
|
"2일",
|
||||||
options: ChartOptions<"line">;
|
"3일",
|
||||||
} => {
|
"4일",
|
||||||
return {
|
"5일",
|
||||||
data: {
|
"6일",
|
||||||
labels: data.dayList.map((item) => item.dayYmd),
|
"7일",
|
||||||
datasets: [
|
"8일",
|
||||||
{
|
"9일",
|
||||||
type: "line",
|
"10일",
|
||||||
label: "접속자 수",
|
"11일",
|
||||||
data: data.dayList.map((item) => item.accessCnt),
|
"12일",
|
||||||
borderColor: getCssVariableValue("--chart-1"),
|
"13일",
|
||||||
},
|
"14일",
|
||||||
],
|
"15일",
|
||||||
},
|
],
|
||||||
options: {
|
datasets: [
|
||||||
maintainAspectRatio: false,
|
{
|
||||||
scales: {
|
type: "bar" as const,
|
||||||
y: {
|
label: "페이지뷰",
|
||||||
ticks: {
|
data: [
|
||||||
precision: 0,
|
850, 1000, 750, 750, 700, 750, 780, 800, 850, 900, 1200, 1700, 2300,
|
||||||
},
|
2100, 2600,
|
||||||
},
|
],
|
||||||
},
|
backgroundColor: "rgba(54, 162, 235, 0.8)",
|
||||||
},
|
order: 2,
|
||||||
};
|
},
|
||||||
},
|
{
|
||||||
site: (
|
type: "line" as const,
|
||||||
data: ConnectionStatistics,
|
label: "신규 접속자",
|
||||||
): {
|
data: [
|
||||||
data: ChartData<"bar">;
|
700, 600, 500, 550, 500, 550, 500, 550, 600, 850, 1200, 1500, 1700,
|
||||||
options: ChartOptions<"bar">;
|
2300, 2200,
|
||||||
} => {
|
],
|
||||||
return {
|
borderColor: "rgba(255, 99, 132, 0.8)",
|
||||||
data: {
|
borderWidth: 2,
|
||||||
labels: data.siteList.map((item) => item.siteNm),
|
tension: 0.4,
|
||||||
datasets: [
|
pointRadius: 3,
|
||||||
{
|
order: 0,
|
||||||
type: "bar",
|
},
|
||||||
label: "사이트별 접속자",
|
{
|
||||||
data: data.siteList.map((item) => item.accessCnt),
|
type: "line" as const,
|
||||||
backgroundColor: data.siteList.map((_, index) =>
|
label: "총 접속자",
|
||||||
getCssVariableValue(`--chart-${(index % 5) + 1}`),
|
data: [
|
||||||
),
|
200, 300, 400, 500, 600, 500, 550, 500, 400, 500, 350, 800, 900, 1200,
|
||||||
},
|
1300,
|
||||||
],
|
],
|
||||||
},
|
borderColor: "rgba(75, 192, 192, 0.8)",
|
||||||
options: {
|
borderWidth: 2,
|
||||||
maintainAspectRatio: false,
|
tension: 0.4,
|
||||||
indexAxis: "y",
|
pointRadius: 3,
|
||||||
scales: {
|
order: 1,
|
||||||
x: {
|
},
|
||||||
ticks: {
|
],
|
||||||
precision: 0,
|
};
|
||||||
},
|
|
||||||
},
|
export const monthlyStatisticsOptions: ChartOptions<"bar"> = {
|
||||||
},
|
responsive: true,
|
||||||
plugins: {
|
maintainAspectRatio: false,
|
||||||
legend: {
|
plugins: {
|
||||||
display: false,
|
legend: {
|
||||||
},
|
position: "top" as const,
|
||||||
},
|
},
|
||||||
},
|
tooltip: {
|
||||||
};
|
mode: "index" as const,
|
||||||
},
|
intersect: false,
|
||||||
browser: (
|
},
|
||||||
data: ConnectionStatistics,
|
|
||||||
): {
|
|
||||||
data: ChartData<"doughnut">;
|
|
||||||
options: ChartOptions<"doughnut">;
|
|
||||||
} => {
|
|
||||||
return {
|
|
||||||
data: {
|
|
||||||
labels: data.browserList.map((item) => item.wbsrKndNm),
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
type: "doughnut",
|
|
||||||
data: data.browserList.map((item) => item.accessCnt),
|
|
||||||
backgroundColor: data.browserList.map((_, index) =>
|
|
||||||
getCssVariableValue(`--chart-${(index % 5) + 1}`),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
plugins: {
|
|
||||||
legend: {
|
|
||||||
position: "bottom",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 사이트별 접속자 차트 데이터
|
||||||
|
export const siteVisitorsData: ChartData<"bar"> = {
|
||||||
|
labels: ["SITE1", "SITE2", "SITE3", "SITE4", "SITE5"],
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "사이트별 접속자",
|
||||||
|
data: [2500, 2000, 1500, 1200, 800],
|
||||||
|
backgroundColor: [
|
||||||
|
"rgba(54, 162, 235, 0.8)",
|
||||||
|
"rgba(153, 102, 255, 0.8)",
|
||||||
|
"rgba(255, 99, 132, 0.8)",
|
||||||
|
"rgba(255, 159, 64, 0.8)",
|
||||||
|
"rgba(255, 205, 86, 0.8)",
|
||||||
|
],
|
||||||
|
borderWidth: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const siteVisitorsOptions: ChartOptions<"bar"> = {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
indexAxis: "y" as const,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 브라우저별 접속자 차트 데이터
|
||||||
|
export const browserStatisticsData: ChartData<"doughnut"> = {
|
||||||
|
labels: ["Chrome", "Edge", "Safari", "Firefox", "Internet Explorer"],
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
data: [45, 25, 15, 10, 5],
|
||||||
|
backgroundColor: [
|
||||||
|
"rgba(54, 162, 235, 0.8)",
|
||||||
|
"rgba(153, 102, 255, 0.8)",
|
||||||
|
"rgba(255, 99, 132, 0.8)",
|
||||||
|
"rgba(255, 159, 64, 0.8)",
|
||||||
|
"rgba(255, 205, 86, 0.8)",
|
||||||
|
],
|
||||||
|
borderColor: [
|
||||||
|
"rgba(54, 162, 235, 1)",
|
||||||
|
"rgba(153, 102, 255, 1)",
|
||||||
|
"rgba(255, 99, 132, 1)",
|
||||||
|
"rgba(255, 159, 64, 1)",
|
||||||
|
"rgba(255, 205, 86, 1)",
|
||||||
|
],
|
||||||
|
borderWidth: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const browserStatisticsOptions: ChartOptions<"doughnut"> = {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: "bottom" as const,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const chartData = {
|
||||||
|
monthlyStatisticsData,
|
||||||
|
monthlyStatisticsOptions,
|
||||||
|
siteVisitorsData,
|
||||||
|
siteVisitorsOptions,
|
||||||
|
browserStatisticsData,
|
||||||
|
browserStatisticsOptions,
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
import type { PageableList, PageableParams } from "@/shared/model";
|
|
||||||
|
|
||||||
export interface ConnectionLogParams extends PageableParams {
|
|
||||||
keywordType?: string;
|
|
||||||
keyword?: string;
|
|
||||||
siteId?: string;
|
|
||||||
cntnIp?: string;
|
|
||||||
cntnRgn?: string;
|
|
||||||
wbsrKnd?: string;
|
|
||||||
urlPath?: string;
|
|
||||||
cntnDtStart?: string;
|
|
||||||
cntnDtEnd?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConnectionLog {
|
|
||||||
cntnSn: number;
|
|
||||||
cntnDt: string;
|
|
||||||
cntnId: string;
|
|
||||||
cntnIp: string;
|
|
||||||
cntnRgn: string;
|
|
||||||
wbsrKnd: string;
|
|
||||||
menuCd: number;
|
|
||||||
siteId: string;
|
|
||||||
urlPath: string;
|
|
||||||
siteNm: string;
|
|
||||||
menuNm: string;
|
|
||||||
wbsrKndNm: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConnectionStatisticsParams {
|
|
||||||
keywordType?: string;
|
|
||||||
keyword?: string;
|
|
||||||
siteId?: string;
|
|
||||||
cntnIp?: string;
|
|
||||||
cntnRgn?: string;
|
|
||||||
wbsrKnd?: string;
|
|
||||||
urlPath?: string;
|
|
||||||
cntnDtStart?: string;
|
|
||||||
cntnDtEnd?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DayConnectionStatistics {
|
|
||||||
dayYmd: string;
|
|
||||||
accessCnt: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SiteConnectionStatistics {
|
|
||||||
siteId: string;
|
|
||||||
siteNm: string;
|
|
||||||
accessCnt: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BrowserConnectionStatistics {
|
|
||||||
wbsrKnd: string;
|
|
||||||
wbsrKndNm: string;
|
|
||||||
accessCnt: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConnectionStatistics {
|
|
||||||
dayList: DayConnectionStatistics[];
|
|
||||||
siteList: SiteConnectionStatistics[];
|
|
||||||
browserList: BrowserConnectionStatistics[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ConnectionLogList = PageableList<ConnectionLog>;
|
|
||||||
|
|
||||||
export interface ConnectionLogService {
|
|
||||||
getConnectionLog(params: ConnectionLogParams): Promise<ConnectionLogList>;
|
|
||||||
getConnectionStatistics(
|
|
||||||
params: ConnectionStatisticsParams,
|
|
||||||
): Promise<ConnectionStatistics>;
|
|
||||||
}
|
|
||||||
@@ -1,46 +1,39 @@
|
|||||||
import type { ColumnDef } from "@tanstack/react-table";
|
import { createColumnHelper } from "@tanstack/react-table";
|
||||||
import type { ConnectionLog } from "./connection-log-interface";
|
import { type AccessLog } from "./user-statistics-interface";
|
||||||
import dayjs from "dayjs";
|
|
||||||
|
|
||||||
export const columns: ColumnDef<ConnectionLog>[] = [
|
const columnHelper = createColumnHelper<AccessLog>();
|
||||||
{
|
|
||||||
|
export const columns = [
|
||||||
|
columnHelper.accessor("no", {
|
||||||
header: "No",
|
header: "No",
|
||||||
cell: ({ row, table }) => {
|
cell: (info) => info.getValue(),
|
||||||
const totalRows = table.getRowCount();
|
}),
|
||||||
const currentPage = table.getState().pagination.pageIndex;
|
columnHelper.accessor("accessTime", {
|
||||||
const pageSize = table.getState().pagination.pageSize;
|
|
||||||
return totalRows - (currentPage * pageSize + row.index);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "cntnDt",
|
|
||||||
header: "접속일시",
|
header: "접속일시",
|
||||||
cell: ({ row }) => {
|
cell: (info) => info.getValue(),
|
||||||
return dayjs(row.original.cntnDt).format("YYYY-MM-DD HH:mm:ss");
|
}),
|
||||||
},
|
columnHelper.accessor("accessIp", {
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "cntnIp",
|
|
||||||
header: "접속IP",
|
header: "접속IP",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
{
|
}),
|
||||||
accessorKey: "cntnRgn",
|
columnHelper.accessor("accessRegion", {
|
||||||
header: "접속지역",
|
header: "접속지역",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
{
|
}),
|
||||||
accessorKey: "urlPath",
|
columnHelper.accessor("urlPath", {
|
||||||
header: "URL경로",
|
header: "URL경로",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
{
|
}),
|
||||||
accessorKey: "wbsrKndNm",
|
columnHelper.accessor("browser", {
|
||||||
header: "브라우저",
|
header: "브라우저",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
{
|
}),
|
||||||
accessorKey: "siteNm",
|
columnHelper.accessor("site", {
|
||||||
header: "사이트",
|
header: "사이트",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
{
|
}),
|
||||||
accessorKey: "menuNm",
|
columnHelper.accessor("accessType", {
|
||||||
header: "메뉴명",
|
header: "메뉴명",
|
||||||
},
|
cell: (info) => info.getValue(),
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
export interface AccessLog {
|
||||||
|
no: number;
|
||||||
|
accessTime: string;
|
||||||
|
accessIp: string;
|
||||||
|
accessRegion: string;
|
||||||
|
urlPath: string;
|
||||||
|
browser: string;
|
||||||
|
site: string;
|
||||||
|
accessType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccessLogParams {
|
||||||
|
page?: number;
|
||||||
|
size?: number;
|
||||||
|
urlPath?: string;
|
||||||
|
accessIp?: string;
|
||||||
|
accessRegion?: string;
|
||||||
|
browser?: string;
|
||||||
|
accessDateStart?: string;
|
||||||
|
accessDateEnd?: string;
|
||||||
|
siteId?: string;
|
||||||
|
sort?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccessLogService {
|
||||||
|
getAccessLogList(params: AccessLogParams): Promise<PageableList<AccessLog>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageableList<T> {
|
||||||
|
content: T[];
|
||||||
|
pageable: {
|
||||||
|
pageNumber: number;
|
||||||
|
pageSize: number;
|
||||||
|
sort: {
|
||||||
|
empty: boolean;
|
||||||
|
sorted: boolean;
|
||||||
|
unsorted: boolean;
|
||||||
|
};
|
||||||
|
offset: number;
|
||||||
|
paged: boolean;
|
||||||
|
unpaged: boolean;
|
||||||
|
};
|
||||||
|
last: boolean;
|
||||||
|
totalPages: number;
|
||||||
|
totalElements: number;
|
||||||
|
size: number;
|
||||||
|
number: number;
|
||||||
|
sort: {
|
||||||
|
empty: boolean;
|
||||||
|
sorted: boolean;
|
||||||
|
unsorted: boolean;
|
||||||
|
};
|
||||||
|
first: boolean;
|
||||||
|
numberOfElements: number;
|
||||||
|
empty: boolean;
|
||||||
|
}
|
||||||
@@ -15,8 +15,9 @@ import {
|
|||||||
Filler,
|
Filler,
|
||||||
Legend,
|
Legend,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
type ChartData,
|
||||||
} from "chart.js";
|
} from "chart.js";
|
||||||
import { Bar, Doughnut, Line } from "react-chartjs-2";
|
import { Bar, Doughnut } from "react-chartjs-2";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
@@ -29,13 +30,11 @@ import {
|
|||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
import { SiteSelect } from "@/entities/site";
|
import { SiteSelect } from "@/entities/site";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable } from "@/shared/lib";
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import { NoData } from "@/shared/ui/no-data";
|
|
||||||
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
||||||
import { ConnectionLogApi } from "../api/connection-log-service";
|
import { UserStatisticsApi } from "../api";
|
||||||
import { chartData } from "../model/chart-data";
|
import { chartData } from "../model/chart-data";
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
import type { ConnectionStatisticsParams } from "../model/connection-log-interface";
|
import { type AccessLogParams } from "../model/user-statistics-interface";
|
||||||
|
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
CategoryScale,
|
CategoryScale,
|
||||||
@@ -66,31 +65,25 @@ function UserStatisticsPage() {
|
|||||||
});
|
});
|
||||||
const [keywordType, setKeywordType] = useState("");
|
const [keywordType, setKeywordType] = useState("");
|
||||||
const [keyword, setKeyword] = useState("");
|
const [keyword, setKeyword] = useState("");
|
||||||
const [siteId, setSiteId] = useState("");
|
|
||||||
const [presetDateRange, setPresetDateRange] = useState("1W");
|
const [presetDateRange, setPresetDateRange] = useState("1W");
|
||||||
const [dateRange, setDateRange] = useState<DateRange>(defaultDateRange);
|
const [dateRange, setDateRange] = useState<DateRange>(defaultDateRange);
|
||||||
const [searchParams, setSearchParams] = useState<ConnectionStatisticsParams>({
|
const [searchParams, setSearchParams] = useState<AccessLogParams>({
|
||||||
keywordType: "",
|
urlPath: "",
|
||||||
keyword: "",
|
accessIp: "",
|
||||||
siteId: "",
|
accessRegion: "",
|
||||||
cntnDtStart: dayjs(defaultDateRange.from).format("YYYY-MM-DD"),
|
browser: "",
|
||||||
cntnDtEnd: dayjs(defaultDateRange.to).format("YYYY-MM-DD"),
|
accessDateStart: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
|
||||||
|
accessDateEnd: dayjs().format("YYYY-MM-DD"),
|
||||||
|
sort: "accessTime,desc",
|
||||||
});
|
});
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.CONNECTION_LOG, searchParams],
|
queryKey: ["user-statistics", searchParams, pagination],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
ConnectionLogApi.getConnectionLog({
|
UserStatisticsApi.getAccessLogList({
|
||||||
...searchParams,
|
|
||||||
}),
|
|
||||||
placeholderData: keepPreviousData,
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: connectionStatisticsData } = useQuery({
|
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.CONNECTION_LOG, searchParams],
|
|
||||||
queryFn: () =>
|
|
||||||
ConnectionLogApi.getConnectionStatistics({
|
|
||||||
...searchParams,
|
...searchParams,
|
||||||
|
page: pagination.pageIndex,
|
||||||
|
size: pagination.pageSize,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
@@ -146,30 +139,54 @@ function UserStatisticsPage() {
|
|||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const params: ConnectionStatisticsParams = {
|
setPagination({
|
||||||
keywordType,
|
...pagination,
|
||||||
keyword,
|
pageIndex: 0,
|
||||||
siteId,
|
});
|
||||||
cntnDtStart: dateRange.from
|
|
||||||
|
// 검색 조건에 따라 검색 파라미터 설정
|
||||||
|
const params: AccessLogParams = {
|
||||||
|
sort: "accessTime,desc",
|
||||||
|
accessDateStart: dateRange.from
|
||||||
? dayjs(dateRange.from).format("YYYY-MM-DD")
|
? dayjs(dateRange.from).format("YYYY-MM-DD")
|
||||||
: "",
|
: "",
|
||||||
cntnDtEnd: dateRange.to ? dayjs(dateRange.to).format("YYYY-MM-DD") : "",
|
accessDateEnd: dateRange.to
|
||||||
|
? dayjs(dateRange.to).format("YYYY-MM-DD")
|
||||||
|
: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 검색어 타입에 따라 파라미터 설정
|
||||||
|
switch (keywordType) {
|
||||||
|
case "urlPath":
|
||||||
|
params.urlPath = keyword;
|
||||||
|
break;
|
||||||
|
case "ip":
|
||||||
|
params.accessIp = keyword;
|
||||||
|
break;
|
||||||
|
case "region":
|
||||||
|
params.accessRegion = keyword;
|
||||||
|
break;
|
||||||
|
case "browser":
|
||||||
|
params.browser = keyword;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
setSearchParams(params);
|
setSearchParams(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeywordType("");
|
setKeywordType("");
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setSiteId("");
|
|
||||||
setDateRange(defaultDateRange);
|
setDateRange(defaultDateRange);
|
||||||
setPresetDateRange("1W");
|
setPresetDateRange("1W");
|
||||||
setSearchParams({
|
setSearchParams({
|
||||||
keywordType: "",
|
urlPath: "",
|
||||||
keyword: "",
|
accessIp: "",
|
||||||
siteId: "",
|
accessRegion: "",
|
||||||
cntnDtStart: dayjs(defaultDateRange.from).format("YYYY-MM-DD"),
|
browser: "",
|
||||||
cntnDtEnd: dayjs(defaultDateRange.to).format("YYYY-MM-DD"),
|
accessDateStart: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
|
||||||
|
accessDateEnd: dayjs().format("YYYY-MM-DD"),
|
||||||
|
sort: "accessTime,desc",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -193,11 +210,7 @@ function UserStatisticsPage() {
|
|||||||
setDateRange={handleDateRangeChange}
|
setDateRange={handleDateRangeChange}
|
||||||
/>
|
/>
|
||||||
<Label className="ml-4 mr-2 text-label">사이트</Label>
|
<Label className="ml-4 mr-2 text-label">사이트</Label>
|
||||||
<SiteSelect
|
<SiteSelect enabledAllSite className="w-[16rem]" />
|
||||||
className="w-[16rem]"
|
|
||||||
value={siteId}
|
|
||||||
onValueChange={(value) => setSiteId(value)}
|
|
||||||
/>
|
|
||||||
<Label className="ml-4 mr-2 text-label">검색</Label>
|
<Label className="ml-4 mr-2 text-label">검색</Label>
|
||||||
<Select
|
<Select
|
||||||
value={keywordType}
|
value={keywordType}
|
||||||
@@ -208,9 +221,9 @@ function UserStatisticsPage() {
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="urlPath">URL경로</SelectItem>
|
<SelectItem value="urlPath">URL경로</SelectItem>
|
||||||
<SelectItem value="cntnIp">접속IP</SelectItem>
|
<SelectItem value="ip">접속IP</SelectItem>
|
||||||
<SelectItem value="cntnRgn">접속지역</SelectItem>
|
<SelectItem value="region">접속지역</SelectItem>
|
||||||
<SelectItem value="wbsrKnd">브라우저</SelectItem>
|
<SelectItem value="browser">브라우저</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<Input
|
<Input
|
||||||
@@ -232,44 +245,45 @@ function UserStatisticsPage() {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 차트 영역 */}
|
||||||
<div className="grid grid-cols-2">
|
<div className="grid grid-cols-2">
|
||||||
|
{/* 일별 접속 현황 */}
|
||||||
<div className="card card-border">
|
<div className="card card-border">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<h3 className="text-2xl font-medium">일별 접속 현황</h3>
|
<h3 className="text-xl font-medium">일별 접속 현황</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-96 p-4">
|
<div className="h-96 p-4">
|
||||||
{connectionStatisticsData?.dayList?.length ? (
|
<Bar
|
||||||
<Line {...chartData.day(connectionStatisticsData)} />
|
data={chartData.monthlyStatisticsData as ChartData<"bar">}
|
||||||
) : (
|
options={chartData.monthlyStatisticsOptions}
|
||||||
<NoData />
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-2">
|
<div className="grid grid-cols-2">
|
||||||
|
{/* 사이트별 접속자 */}
|
||||||
<div className="card card-border">
|
<div className="card card-border">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<h3 className="text-2xl font-medium">사이트별 접속자</h3>
|
<h3 className="text-xl font-medium">사이트별 접속자</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-96 p-4">
|
<div className="h-96 p-4">
|
||||||
{connectionStatisticsData?.siteList?.length ? (
|
<Bar
|
||||||
<Bar {...chartData.site(connectionStatisticsData)} />
|
data={chartData.siteVisitorsData}
|
||||||
) : (
|
options={chartData.siteVisitorsOptions}
|
||||||
<NoData />
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 브라우저별 접속자 */}
|
||||||
<div className="card card-border">
|
<div className="card card-border">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<h3 className="text-2xl font-medium">브라우저별 접속자</h3>
|
<h3 className="text-xl font-medium">브라우저별 접속자</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-96 p-4">
|
<div className="h-96 p-4">
|
||||||
{connectionStatisticsData?.browserList?.length ? (
|
<Doughnut
|
||||||
<Doughnut {...chartData.browser(connectionStatisticsData)} />
|
data={chartData.browserStatisticsData}
|
||||||
) : (
|
options={chartData.browserStatisticsOptions}
|
||||||
<NoData />
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export const ENDPOINT = {
|
|||||||
MANAGER_IP: "/cms-service/api/v1/mgrip",
|
MANAGER_IP: "/cms-service/api/v1/mgrip",
|
||||||
APILOG: "/cms-service/api/v1/api-logs",
|
APILOG: "/cms-service/api/v1/api-logs",
|
||||||
SITE_AUTHORITY: "/cms-service/api/v1/site-authrt",
|
SITE_AUTHORITY: "/cms-service/api/v1/site-authrt",
|
||||||
CONNECTION_LOG: "/cms-service/api/v1/cntnlog",
|
|
||||||
},
|
},
|
||||||
BOARD_SERVICE: {
|
BOARD_SERVICE: {
|
||||||
BBS: "/board-service/api/v1/bbs",
|
BBS: "/board-service/api/v1/bbs",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ function PostAction({ children, handleDelete }: PostActionProps) {
|
|||||||
const { prompt } = useSelectPrompt(selectData);
|
const { prompt } = useSelectPrompt(selectData);
|
||||||
const bbsInfo = useMenuStore((state) => state.bbsInfo);
|
const bbsInfo = useMenuStore((state) => state.bbsInfo);
|
||||||
const userInfo = useUserStore((state) => state.userInfo);
|
const userInfo = useUserStore((state) => state.userInfo);
|
||||||
const postPageLink = `/bbs/${bbsInfo?.bbsTypeCd.toLowerCase()}/${bbsInfo?.bbsId}`;
|
|
||||||
|
|
||||||
const onDelete = async () => {
|
const onDelete = async () => {
|
||||||
const { resolved, value } = await prompt("삭제 사유를 입력해주세요.");
|
const { resolved, value } = await prompt("삭제 사유를 입력해주세요.");
|
||||||
@@ -65,7 +64,7 @@ function PostAction({ children, handleDelete }: PostActionProps) {
|
|||||||
size="lg"
|
size="lg"
|
||||||
color="white"
|
color="white"
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => router.push(postPageLink)}
|
onClick={() => router.back()}
|
||||||
>
|
>
|
||||||
목록
|
목록
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
NEXT_PUBLIC_SITE_ID = DM
|
NEXT_PUBLIC_SITE_ID = DM
|
||||||
NEXT_PUBLIC_PORT = 11035
|
NEXT_PUBLIC_PORT = 3000
|
||||||
NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
|
NEXT_PUBLIC_PROXY_HOST = http://localhost:3000
|
||||||
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
|
||||||
NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
|
NEXT_PUBLIC_DM_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_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_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||||
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
|
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
|
||||||
|
|||||||
+2
-2
@@ -3,9 +3,9 @@ NEXT_PUBLIC_CLAIM_NAME = Authorization
|
|||||||
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||||
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||||
NEXT_PUBLIC_PORT = 3005
|
NEXT_PUBLIC_PORT = 11035
|
||||||
#NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
|
#NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
|
||||||
NEXT_PUBLIC_PROXY_HOST = http://localhost:3005/
|
NEXT_PUBLIC_PROXY_HOST = http://localhost:3000/
|
||||||
NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
|
NEXT_PUBLIC_DM_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_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_FO_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import ListDiv from '@common/business_components/ui/list_div';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Toaster } from 'react-hot-toast';
|
import { Toaster } from 'react-hot-toast';
|
||||||
import SdmLogin from '../sdmLogin/page';
|
import SdmLogin from '../sdmLogin/page';
|
||||||
import type { DemandCompBizType } from '@/app/store/sdmMng';
|
import type { DemandCompType } from '@/app/store/sdmMng';
|
||||||
import TransValueFormat from '@/app/common/transValueFormat';
|
import TransValueFormat from '@/app/common/transValueFormat';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
const {selectSidoData, selectSigunData} = Common;
|
const {selectSidoData, selectSigunData} = Common;
|
||||||
const [isLogin, setIsLogin] = useState(false);
|
const [isLogin, setIsLogin] = useState(false);
|
||||||
const [isLoginStorageInfo, setIsLoginStorageInfo] = useState(false);
|
const [isLoginStorageInfo, setIsLoginStorageInfo] = useState(false);
|
||||||
const [sdmApplyDetail, setSdmApplyDetail] = useState<DemandCompBizType>({} as DemandCompBizType);
|
const [sdmApplyDetail, setSdmApplyDetail] = useState<DemandCompType>({} as DemandCompType);
|
||||||
const [transformedList, setTransformedList] = useState<DemandCompBizType[]>([]);
|
const [transformedList, setTransformedList] = useState<DemandCompType[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('sessionStorage : ',sessionStorage.getItem('user'));
|
console.log('sessionStorage : ',sessionStorage.getItem('user'));
|
||||||
@@ -60,10 +60,10 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
// 데이터 변환을 위한 별도의 useEffect
|
// 데이터 변환을 위한 별도의 useEffect
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (sdmInfoStatusList.length > 0) {
|
if (sdmInfoStatusList.length > 0) {
|
||||||
const newTransformedList = sdmInfoStatusList.map((item: DemandCompBizType) => ({
|
const newTransformedList = sdmInfoStatusList.map((item: DemandCompType) => ({
|
||||||
...item,
|
...item,
|
||||||
ctpvCd: selectSidoData.find(sido => sido.val === item.ctpvCd?.trim())?.text || '',
|
ctpvCd: selectSidoData.find(sido => sido.val === item.ctpvCd?.trim())?.text || '',
|
||||||
sggCd: selectSigunData.find(sigun => sigun.val === item.sggCd?.trim())?.text || '',
|
sggCd: selectSigunData.find(sigun => sigun.val === item.sggCd?.trim())?.text || ''
|
||||||
}));
|
}));
|
||||||
setTransformedList(newTransformedList);
|
setTransformedList(newTransformedList);
|
||||||
}
|
}
|
||||||
@@ -73,8 +73,6 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
if (index !== undefined) {
|
if (index !== undefined) {
|
||||||
const selectedStatus = transformedList[index];
|
const selectedStatus = transformedList[index];
|
||||||
if (selectedStatus) {
|
if (selectedStatus) {
|
||||||
|
|
||||||
|
|
||||||
setSdmApplyDetail(selectedStatus);
|
setSdmApplyDetail(selectedStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,33 +121,33 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>총대장균군수(개/100ml)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>총대장균군수(개/100ml)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.grssClfg ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.grssClfg} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>결합잔류염소(mg/L)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>결합잔류염소(mg/L)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.combResdch ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.combResdch} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>탁도(NTU)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>탁도(NTU)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.trbt ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.trbt} format="number"/>}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>생물학적 산소요구량(BOD)(mg/L)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>생물학적 산소요구량(BOD)(mg/L)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.blgcOxygDmndQnt ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.blgcOxygDmndQnt} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>냄새</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>냄새</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.smll} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.smll} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>색도(도)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>색도(도)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.crmty ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.crmty} format="number"/>}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>총질소(T-N)(mg/L)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>총질소(T-N)(mg/L)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tn ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tn} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>총인(T-P)(mg/L)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>총인(T-P)(mg/L)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tph ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tph} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>수소이온농도(pH)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>수소이온농도(pH)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.ph} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.ph} format="number"/>}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>염화물(mgCL/L)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>염화물(mgCL/L)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.clIonQnt ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.clIonQnt} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>전기전도도(㎲/cm)</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>전기전도도(㎲/cm)</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.cdtnv ?? ''} format="number"/>}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.cdtnv} format="number"/>}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>비고</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>비고</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.rmrk}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.rmrk}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -158,11 +156,11 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지1</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지1</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{ sdmApplyDetail?.splyCndtList?.[0]?.ruseUtztnFcltNm ?? ""}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}></TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지2</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지2</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.splyCndtList?.[1]?.ruseUtztnFcltNm ?? ""}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}></TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지3</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>후보지3</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.splyCndtList?.[2]?.ruseUtztnFcltNm ?? ""}</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.cell}></TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
@@ -179,7 +177,7 @@ export default function SdmApplyList({}: SdmApplyProps) {
|
|||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>진행상태</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>진행상태</TableCell>
|
||||||
<TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.status?.toString()}</TableCell>
|
<TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.status?.toString()}</TableCell>
|
||||||
<TableCell colSpan={1} className={TABLE_STYLES.header}>공급처매칭결과</TableCell>
|
<TableCell colSpan={1} className={TABLE_STYLES.header}>공급처매칭결과</TableCell>
|
||||||
<TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.ruseUtztnFcltNm??''}</TableCell>
|
<TableCell colSpan={2} className={TABLE_STYLES.cell}></TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useDmStore } from "@/app/store";
|
import { useDmStore } from "@/app/store";
|
||||||
import type { DemandCompBizType } from "@/app/store/sdmMng";
|
import type { DemandCompType } from "@/app/store/sdmMng";
|
||||||
import { SdmInfoRegForm } from "@/components/ui/sdmInfoInsertForm/component";
|
import { SdmInfoRegForm } from "@/components/ui/sdmInfoInsertForm/component";
|
||||||
import { UiModal } from "@common/business_components/ui/dialog_ui";
|
import { UiModal } from "@common/business_components/ui/dialog_ui";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
@@ -14,99 +14,121 @@ import * as z from "zod";
|
|||||||
import SdmLogin from "../sdmLogin/page";
|
import SdmLogin from "../sdmLogin/page";
|
||||||
|
|
||||||
const sdmInfoFormSchema = z.object({
|
const sdmInfoFormSchema = z.object({
|
||||||
sdmNm: z.string().min(1, "수요처를 선택해주세요"),
|
sdmNm: z.string()
|
||||||
|
.min(1, "수요처를 선택해주세요"),
|
||||||
demandYmd: z.date().optional(),
|
demandYmd: z.date().optional(),
|
||||||
demandQnty: z
|
demandQnty: z.string()
|
||||||
.string()
|
|
||||||
.min(1, "요구수량을 입력해주세요")
|
.min(1, "요구수량을 입력해주세요")
|
||||||
.regex(/^[0-9]+$/, "요구수량은 숫자만 입력 가능합니다"),
|
.regex(/^[0-9]+$/, "요구수량은 숫자만 입력 가능합니다"),
|
||||||
usePurpose: z.string().optional(),
|
usePurpose: z.string().optional(),
|
||||||
money: z.string().regex(/^[0-9]+$/, "희망단가는 숫자만 입력 가능합니다"),
|
money: z.string()
|
||||||
|
.regex(/^[0-9]+$/, "희망단가는 숫자만 입력 가능합니다"),
|
||||||
/**요구수질 */
|
/**요구수질 */
|
||||||
reqWaterQlty: z.string().optional(),
|
reqWaterQlty: z.string().optional(),
|
||||||
grssClfg: z.number().nullish(),
|
grssClfg: z.string()
|
||||||
tn: z.number().nullish(),
|
.min(1, "총대장균군수를 입력해주세요")
|
||||||
combResdch: z.number().nullish(),
|
.regex(/^[0-9]+$/, "총대장균군수는 숫자만 입력 가능합니다"),
|
||||||
tph: z.number().nullish(),
|
tn: z.string()
|
||||||
trbt: z.number().nullish(),
|
.min(1, "총질소를 입력해주세요")
|
||||||
ph: z.string().nullish(),
|
.regex(/^[0-9]+$/, "총질소는 숫자만 입력 가능합니다"),
|
||||||
bod: z.number().nullish(),
|
combResdch: z.string()
|
||||||
|
.min(1, "결합잔류염소를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "결합잔류염소는 숫자만 입력 가능합니다"),
|
||||||
|
tph: z.string()
|
||||||
|
.min(1, "총인산물을 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "총인산물은 숫자만 입력 가능합니다"),
|
||||||
|
trbt: z.string()
|
||||||
|
.min(1, "탁도를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "탁도는 숫자만 입력 가능합니다"),
|
||||||
|
ph: z.string()
|
||||||
|
.min(1, "수소이온농도를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "수소이온농도는 숫자만 입력 가능합니다"),
|
||||||
|
bod: z.string()
|
||||||
|
.min(1, "생물학적 산소요구량을 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "생물학적 산소요구량은 숫자만 입력 가능합니다"),
|
||||||
/**컬럼확인필요 */
|
/**컬럼확인필요 */
|
||||||
clIonQnt: z.number().nullish(),
|
clIonQnt: z.string()
|
||||||
smll: z.string(),
|
.min(1, "염화물을 입력해주세요")
|
||||||
cdtnv: z.number().nullish(),
|
.regex(/^[0-9]+$/, "염화물은 숫자만 입력 가능합니다"),
|
||||||
crmty: z.number().nullish(),
|
smll: z.string()
|
||||||
|
.min(1, "냄새를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "냄새는 숫자만 입력 가능합니다"),
|
||||||
|
cdtnv: z.string()
|
||||||
|
.min(1, "전기전도도를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "전기전도도는 숫자만 입력 가능합니다"),
|
||||||
|
crmty: z.string()
|
||||||
|
.min(1, "색도를 입력해주세요")
|
||||||
|
.regex(/^[0-9]+$/, "색도는 숫자만 입력 가능합니다"),
|
||||||
rmrk: z.string().optional(),
|
rmrk: z.string().optional(),
|
||||||
/* telno: z.string()
|
/* telno: z.string()
|
||||||
.min(8, "전화번호는 8자 이상 입력해주세요")
|
.min(8, "전화번호는 8자 이상 입력해주세요")
|
||||||
.max(12, "전화번호는 12자 이내로 입력해주세요")
|
.max(12, "전화번호는 12자 이내로 입력해주세요")
|
||||||
.regex(/^[0-9-]+$/, "전화번호는 숫자와 하이픈(-)만 입력 가능합니다"), */
|
.regex(/^[0-9-]+$/, "전화번호는 숫자와 하이픈(-)만 입력 가능합니다"), */
|
||||||
candidateTitle: z
|
candidateTitle: z.array(z.object({
|
||||||
.array(
|
ruseUtztnFcltNm: z.string(),
|
||||||
z.object({
|
ruseUtztnFcltCd: z.string(),
|
||||||
ruseUtztnFcltNm: z.string(),
|
})).optional(),
|
||||||
ruseUtztnFcltCd: z.string(),
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.optional(),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export type FormData = z.infer<typeof sdmInfoFormSchema>;
|
export type FormData = z.infer<typeof sdmInfoFormSchema>;
|
||||||
|
|
||||||
function SdmInfoInsertContent() {
|
function SdmInfoInsertContent() {
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const { insertSdmInfoData, Sdm, setSubsInfo } = useDmStore((state) => state);
|
const {insertSdmInfoData, Sdm ,setSubsInfo} = useDmStore((state) => state);
|
||||||
const { successLogin } = Sdm;
|
const { successLogin } = Sdm;
|
||||||
const [ismoneyDisabled, setIsmoneyDisabled] = useState(false);
|
const [ismoneyDisabled, setIsmoneyDisabled] = useState(false);
|
||||||
const formSchema = sdmInfoFormSchema;
|
const formSchema = sdmInfoFormSchema;
|
||||||
|
|
||||||
const [isLogin, setIsLogin] = useState(false);
|
const [isLogin, setIsLogin] = useState(false);
|
||||||
const [facilityName, setFacilityName] = useState<string>("");
|
const [facilityName, setFacilityName] = useState<string>('');
|
||||||
const [defaultValues, setDefaultValues] = useState<FormData>({
|
const [defaultValues, setDefaultValues] = useState<FormData>({
|
||||||
sdmNm: "",
|
sdmNm: '',
|
||||||
demandYmd: new Date(),
|
demandYmd: new Date(),
|
||||||
demandQnty: "",
|
demandQnty: '',
|
||||||
usePurpose: "",
|
usePurpose: '',
|
||||||
money: "",
|
money: '',
|
||||||
/**요구수질 */
|
/**요구수질 */
|
||||||
reqWaterQlty: "",
|
reqWaterQlty: '',
|
||||||
grssClfg: null,
|
grssClfg: '',
|
||||||
tn: null,
|
tn: '',
|
||||||
combResdch: null,
|
combResdch: '',
|
||||||
tph: null,
|
tph: '',
|
||||||
trbt: null,
|
trbt: '',
|
||||||
ph: null,
|
ph: '',
|
||||||
bod: null,
|
bod: '',
|
||||||
/**컬럼확인필요 */
|
/**컬럼확인필요 */
|
||||||
clIonQnt: null,
|
clIonQnt: '',
|
||||||
smll: "",
|
smll: '',
|
||||||
cdtnv: null,
|
cdtnv: '',
|
||||||
crmty: null,
|
crmty: '',
|
||||||
rmrk: "",
|
rmrk: '',
|
||||||
/** 후보지 제목 */
|
/** 후보지 제목 */
|
||||||
candidateTitle: [
|
candidateTitle: [
|
||||||
{ ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" },
|
{ ruseUtztnFcltNm: '', ruseUtztnFcltCd: '' },
|
||||||
{ ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" },
|
{ ruseUtztnFcltNm: '', ruseUtztnFcltCd: '' },
|
||||||
{ ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" },
|
{ ruseUtztnFcltNm: '', ruseUtztnFcltCd: '' },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const user = sessionStorage.getItem("user");
|
const user = sessionStorage.getItem('user');
|
||||||
setDefaultValues((prev) => ({
|
setDefaultValues(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
sdmNm: searchParams.get("dmdCoNm") || "",
|
sdmNm: searchParams.get('dmdCoNm') || '',
|
||||||
}));
|
}));
|
||||||
sessionStorage.setItem("user", searchParams.get("dmdInfoId") || "");
|
sessionStorage.setItem('user', searchParams.get('dmdInfoId') || '');
|
||||||
setIsLogin(user || searchParams.get("dmdInfoId") ? true : false);
|
setIsLogin(user || searchParams.get('dmdInfoId') ? true : false);
|
||||||
}, [searchParams]);
|
}, [searchParams]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const local = localStorage.getItem("user");
|
const local = localStorage.getItem('user');
|
||||||
if (local) {
|
if (local) {
|
||||||
setIsLogin(true);
|
setIsLogin(true);
|
||||||
}
|
}
|
||||||
setSubsInfo([]); // subsInfo 초기화 후보지 처음 화면 들어올때 초기화(스토어내 객체만)
|
setSubsInfo([]); // subsInfo 초기화 후보지 처음 화면 들어올때 초기화(스토어내 객체만)
|
||||||
|
|
||||||
}, [setSubsInfo]);
|
}, [setSubsInfo]);
|
||||||
|
|
||||||
const form = useForm<FormData>({
|
const form = useForm<FormData>({
|
||||||
@@ -117,138 +139,98 @@ function SdmInfoInsertContent() {
|
|||||||
|
|
||||||
const subsInfo = useDmStore((state) => state.map.subsInfo);
|
const subsInfo = useDmStore((state) => state.map.subsInfo);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(()=>{
|
||||||
//map.subsInfo 스토어 객체 값이 변경되면 해당 값이 폼에 자동으로 들어가도록 수정 대신 값이 있어야함
|
//map.subsInfo 스토어 객체 값이 변경되면 해당 값이 폼에 자동으로 들어가도록 수정 대신 값이 있어야함
|
||||||
if (subsInfo.length > 0) {
|
if(subsInfo.length>0){
|
||||||
form.setValue("candidateTitle", subsInfo);
|
form.setValue('candidateTitle', subsInfo)
|
||||||
}
|
}
|
||||||
}, [subsInfo, form]);
|
|
||||||
|
|
||||||
//후보지 팝업 값 셋팅
|
},[subsInfo, form])
|
||||||
useEffect(() => {
|
|
||||||
const handleMessage = (event: MessageEvent) => {
|
|
||||||
if (event.data?.type === "SET_SUBS_INFO") {
|
|
||||||
setSubsInfo(event.data.payload); // zustand로 값 설정
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("message", handleMessage);
|
//후보지 팝업 값 셋팅
|
||||||
return () => window.removeEventListener("message", handleMessage);
|
useEffect(() => {
|
||||||
}, [setSubsInfo]);
|
const handleMessage = (event: MessageEvent) => {
|
||||||
|
if (event.data?.type === 'SET_SUBS_INFO') {
|
||||||
|
setSubsInfo(event.data.payload); // zustand로 값 설정
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('message', handleMessage);
|
||||||
|
return () => window.removeEventListener('message', handleMessage);
|
||||||
|
}, [setSubsInfo]);
|
||||||
|
|
||||||
// 로그인 성공 시 모달 닫기 및 폼 업데이트
|
// 로그인 성공 시 모달 닫기 및 폼 업데이트
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (successLogin) {
|
if (successLogin) {
|
||||||
setIsLogin(true);
|
setIsLogin(true);
|
||||||
const user = sessionStorage.getItem("user");
|
const user = sessionStorage.getItem('user');
|
||||||
if (user) {
|
if (user) {
|
||||||
try {
|
try {
|
||||||
const userData = JSON.parse(user);
|
const userData = JSON.parse(user);
|
||||||
if (userData.dmdCoNm) {
|
if (userData.dmdCoNm) {
|
||||||
setFacilityName(userData.dmdCoNm);
|
setFacilityName(userData.dmdCoNm);
|
||||||
form.setValue("sdmNm", userData.dmdCoNm);
|
form.setValue('sdmNm', userData.dmdCoNm);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error parsing user data:", error);
|
console.error('Error parsing user data:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [successLogin, form]);
|
}, [successLogin, form]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log("Form state changed:", form.formState.errors);
|
|
||||||
}, [form.formState.errors]);
|
|
||||||
|
|
||||||
// 체크박스 상태가 변경될 때마다 money 필드의 에러를 초기화
|
// 체크박스 상태가 변경될 때마다 money 필드의 에러를 초기화
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ismoneyDisabled) {
|
if (ismoneyDisabled) {
|
||||||
form.clearErrors("money");
|
form.clearErrors('money');
|
||||||
form.setValue("money", "");
|
form.setValue('money', '');
|
||||||
}
|
}
|
||||||
}, [ismoneyDisabled, form]);
|
}, [ismoneyDisabled, form]);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const onSubmit: SubmitHandler<FormData> = async (data) => {
|
const onSubmit: SubmitHandler<FormData> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const dmSubsInfo = data.candidateTitle?.filter(
|
// Transform form data to match API schema
|
||||||
(item) => item.ruseUtztnFcltNm && item.ruseUtztnFcltCd
|
const apiData: DemandCompType = {
|
||||||
);
|
dmdInfoId: JSON.parse(sessionStorage.getItem('user') || '{}')?.dmdInfoId?.toString() || searchParams.get('dmdInfoId') + (searchParams.get('bznmTotNo') || ''),
|
||||||
// Transform form data to madata.candidateTitletch API schema
|
dmdInfoFk: JSON.parse(sessionStorage.getItem('user') || '{}')?.dmdInfoId?.toString() || searchParams.get('dmdInfoId') + (searchParams.get('bznmTotNo') || ''),
|
||||||
const apiData: DemandCompBizType = {
|
dmdCoNm: JSON.parse(sessionStorage.getItem('user') || '{}')?.dmdCoNm?.toString() || data.sdmNm,
|
||||||
dmdInfoId:
|
ctpvCd: JSON.parse(sessionStorage.getItem('user') || '{}')?.ctpvCd?.toString() || searchParams.get('ctpvCd') || '',
|
||||||
JSON.parse(
|
sggCd: JSON.parse(sessionStorage.getItem('user') || '{}')?.sggCd?.toString() || searchParams.get('sggCd') || '',
|
||||||
sessionStorage.getItem("user") || "{}"
|
daddr: JSON.parse(sessionStorage.getItem('user') || '{}')?.daddr?.toString() || searchParams.get('daddr') || '',
|
||||||
)?.dmdInfoId?.toString() ||
|
telno: JSON.parse(sessionStorage.getItem('user') || '{}')?.telno?.toString() || searchParams.get('telno') || '',
|
||||||
searchParams.get("dmdInfoId") + (searchParams.get("bznmTotNo") || ""),
|
rgtr: JSON.parse(sessionStorage.getItem('user') || '{}')?.rgtr?.toString() || searchParams.get('rgtr') || '',
|
||||||
dmdInfoFk:
|
useUsgCd: data.usePurpose || '',
|
||||||
JSON.parse(
|
wntUntprc: Number(data.money) || '',
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.dmdInfoId?.toString() ||
|
|
||||||
searchParams.get("dmdInfoId") + (searchParams.get("bznmTotNo") || ""),
|
|
||||||
dmdCoNm:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.dmdCoNm?.toString() || data.sdmNm,
|
|
||||||
ctpvCd:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.ctpvCd?.toString() ||
|
|
||||||
searchParams.get("ctpvCd") ||
|
|
||||||
"",
|
|
||||||
sggCd:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.sggCd?.toString() ||
|
|
||||||
searchParams.get("sggCd") ||
|
|
||||||
"",
|
|
||||||
daddr:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.daddr?.toString() ||
|
|
||||||
searchParams.get("daddr") ||
|
|
||||||
"",
|
|
||||||
telno:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.telno?.toString() ||
|
|
||||||
searchParams.get("telno") ||
|
|
||||||
"",
|
|
||||||
rgtr:
|
|
||||||
JSON.parse(
|
|
||||||
sessionStorage.getItem("user") || "{}"
|
|
||||||
)?.rgtr?.toString() ||
|
|
||||||
searchParams.get("rgtr") ||
|
|
||||||
"",
|
|
||||||
useUsgCd: data.usePurpose || "",
|
|
||||||
wntUntprc: Number(data.money) || "",
|
|
||||||
dmndTmng: data.demandYmd || new Date(),
|
dmndTmng: data.demandYmd || new Date(),
|
||||||
dmndQty: Number(data.demandQnty) || "",
|
dmndQty: Number(data.demandQnty) || '',
|
||||||
grssClfg: data.grssClfg === null ? -1 : Number(data.grssClfg),
|
grssClfg: Number(data.grssClfg) || '',
|
||||||
tn: Number(data.tn) || null,
|
tn: Number(data.tn) || '',
|
||||||
combResdch: Number(data.combResdch) || null,
|
combResdch: Number(data.combResdch) || '',
|
||||||
tph: Number(data.tph) || null,
|
tph: Number(data.tph) || '',
|
||||||
trbt: Number(data.trbt) || null,
|
trbt: Number(data.trbt) || '',
|
||||||
ph: data.ph || "",
|
ph: Number(data.ph) || '',
|
||||||
blgcOxygDmndQnt: Number(data.bod) ||null,
|
blgcOxygDmndQnt: Number(data.bod) || '',
|
||||||
clIonQnt: Number(data.clIonQnt) || null,
|
clIonQnt: Number(data.clIonQnt) || '',
|
||||||
smll: data.smll || "",
|
smll: Number(data.smll) || '',
|
||||||
cdtnv: Number(data.cdtnv) ||null,
|
cdtnv: Number(data.cdtnv) || '',
|
||||||
crmty: Number(data.crmty) || null,
|
crmty: Number(data.crmty) || '',
|
||||||
rmrk: data.rmrk || "",
|
rmrk: data.rmrk || '',
|
||||||
bzmnNo: "",
|
bzmnNo: "",
|
||||||
dmdAplyPswd: "",
|
dmdAplyPswd: "",
|
||||||
index: 0,
|
index: 0,
|
||||||
reqDt: "",
|
reqDt: "",
|
||||||
dmdInfoSn: 0,
|
dmdInfoSn: 0,
|
||||||
status: "",
|
status: '',
|
||||||
splyCndtList: dmSubsInfo || [],
|
splyCndtList: data.candidateTitle || [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await insertSdmInfoData(apiData);
|
await insertSdmInfoData(apiData);
|
||||||
setTimeout(() => {
|
|
||||||
router.push("/");
|
|
||||||
}, 1000); // 0.8초 후 이동
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error submitting form:", error);
|
console.error('Error submitting form:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -271,10 +253,8 @@ function SdmInfoInsertContent() {
|
|||||||
/>
|
/>
|
||||||
<div className="flex justify-center pt-4">
|
<div className="flex justify-center pt-4">
|
||||||
<Button
|
<Button
|
||||||
color="sky"
|
|
||||||
size={"sm"}
|
|
||||||
type="submit"
|
type="submit"
|
||||||
className="w-40 font-semibold py-2 px-4 rounded-md "
|
className="w-40 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-md transition-colors duration-200"
|
||||||
>
|
>
|
||||||
수요정보 등록
|
수요정보 등록
|
||||||
</Button>
|
</Button>
|
||||||
@@ -284,7 +264,7 @@ function SdmInfoInsertContent() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isLogin ? (
|
{!isLogin ?
|
||||||
<UiModal
|
<UiModal
|
||||||
body={<SdmLogin />}
|
body={<SdmLogin />}
|
||||||
bodyClass="sm:max-w-[90vw] w-[530px] h-[430px]"
|
bodyClass="sm:max-w-[90vw] w-[530px] h-[430px]"
|
||||||
@@ -297,7 +277,7 @@ function SdmInfoInsertContent() {
|
|||||||
noHeaderYn="Y"
|
noHeaderYn="Y"
|
||||||
noFooterYn="Y"
|
noFooterYn="Y"
|
||||||
/>
|
/>
|
||||||
) : null}
|
: null}
|
||||||
<Toaster position="top-center" />
|
<Toaster position="top-center" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -310,3 +290,4 @@ export default function MyForm() {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useDmStore } from "@/app/store";
|
import { useDmStore } from "@/app/store";
|
||||||
|
import type { DemandCompType } from "@/app/store/sdmMng";
|
||||||
import SdmInsertForm from '@common/business_components/ui/sdmInsertForm';
|
import SdmInsertForm from '@common/business_components/ui/sdmInsertForm';
|
||||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useCallback, useEffect, useRef } from "react";
|
import { useCallback, useEffect, useRef } from "react";
|
||||||
import { Toaster } from "react-hot-toast";
|
import { Toaster } from "react-hot-toast";
|
||||||
@@ -44,9 +44,15 @@ export default function MyForm() {
|
|||||||
const handleInsertSdmData = useCallback((data: import('@common/business_components/ui/sdmInsertForm/form').DemandCompType) => {
|
const handleInsertSdmData = useCallback((data: import('@common/business_components/ui/sdmInsertForm/form').DemandCompType) => {
|
||||||
const convertedData: DemandCompType = {
|
const convertedData: DemandCompType = {
|
||||||
...data,
|
...data,
|
||||||
|
dmdInfoSn: '',
|
||||||
|
dmdInfoFk: '',
|
||||||
|
status: '',
|
||||||
|
splyCndtList: []
|
||||||
};
|
};
|
||||||
formDataRef.current = convertedData;
|
formDataRef.current = convertedData;
|
||||||
insertSdmData(convertedData)
|
insertSdmData(convertedData).catch(error => {
|
||||||
|
console.error('Error inserting SDM data:', error);
|
||||||
|
});
|
||||||
}, [insertSdmData]);
|
}, [insertSdmData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -64,3 +70,4 @@ export default function MyForm() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { CHART_FORM, MainChart, type ChartConfig } from '@common/business_components';
|
import { CHART_FORM, MainChart, type ChartConfig } from '@common/business_components';
|
||||||
import React, { useEffect, useRef, useState, useMemo, useCallback } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
interface RegionData {
|
interface RegionData {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -213,7 +213,7 @@ const WrStatusPage: React.FC = () => {
|
|||||||
{ region: '제주특별자치도', sewage: '8(1,666)', rainwater: '47(5,746)', reclaimed: '64(660)', thermal: '0' },
|
{ region: '제주특별자치도', sewage: '8(1,666)', rainwater: '47(5,746)', reclaimed: '64(660)', thermal: '0' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const regionData: RegionData[] = useMemo(() => [
|
const regionData: RegionData[] = [
|
||||||
{ name: '서울', x: 170, y: 140, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '서울', x: 170, y: 140, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
{ name: '인천', x: 120, y: 150, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '인천', x: 120, y: 150, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
{ name: '경기', x: 210, y: 210, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '경기', x: 210, y: 210, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
@@ -231,7 +231,7 @@ const WrStatusPage: React.FC = () => {
|
|||||||
{ name: '울산', x: 450, y: 500, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '울산', x: 450, y: 500, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
{ name: '부산', x: 420, y: 550, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '부산', x: 420, y: 550, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
{ name: '제주', x: 60, y: 750, values: [0.3, 0.3, 0.2, 0.2] },
|
{ name: '제주', x: 60, y: 750, values: [0.3, 0.3, 0.2, 0.2] },
|
||||||
], []);
|
];
|
||||||
|
|
||||||
const handleMarkerClick = (regionId: string) => {
|
const handleMarkerClick = (regionId: string) => {
|
||||||
if (selectedRegion === regionId) {
|
if (selectedRegion === regionId) {
|
||||||
@@ -242,7 +242,7 @@ const WrStatusPage: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const createDonutMarker = useCallback((svg: SVGSVGElement, x: number, y: number, name: string, values: number[]) => {
|
const createDonutMarker = (svg: SVGSVGElement, x: number, y: number, name: string, values: number[]) => {
|
||||||
const colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FED16A'];
|
const colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FED16A'];
|
||||||
const radius = 26;
|
const radius = 26;
|
||||||
const innerRadius = 18;
|
const innerRadius = 18;
|
||||||
@@ -334,7 +334,7 @@ const WrStatusPage: React.FC = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
svg.appendChild(g);
|
svg.appendChild(g);
|
||||||
}, [handleMarkerClick, regionIdMap]);
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadSVG = async () => {
|
const loadSVG = async () => {
|
||||||
@@ -374,7 +374,7 @@ const WrStatusPage: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
loadSVG();
|
loadSVG();
|
||||||
}, [createDonutMarker, regionData]);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const svg = svgContainerRef.current?.querySelector('svg');
|
const svg = svgContainerRef.current?.querySelector('svg');
|
||||||
|
|||||||
@@ -62,9 +62,10 @@ const Map = () => {
|
|||||||
Object.keys(item).length > 0 &&
|
Object.keys(item).length > 0 &&
|
||||||
!prev.some((f) => f.pbnstRuseFcltId === item.pbnstRuseFcltId)
|
!prev.some((f) => f.pbnstRuseFcltId === item.pbnstRuseFcltId)
|
||||||
);
|
);
|
||||||
console.log(newItems);
|
console.log(newItems)
|
||||||
return [...prev, ...newItems];
|
return [...prev, ...newItems];
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("데이터 불러오기 실패:", error);
|
console.error("데이터 불러오기 실패:", error);
|
||||||
}
|
}
|
||||||
@@ -231,6 +232,14 @@ const Map = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<SearchBar
|
||||||
|
setHasuPk={(hasuPk: any) => {
|
||||||
|
if (hasuPk) {
|
||||||
|
setSelectDataPk(hasuPk);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onApply={onApply}
|
||||||
|
/>
|
||||||
<div className="bg-container">
|
<div className="bg-container">
|
||||||
<Gis
|
<Gis
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
@@ -248,17 +257,6 @@ const Map = () => {
|
|||||||
isSearchModalOpen={isSearchModalOpen}
|
isSearchModalOpen={isSearchModalOpen}
|
||||||
onCheckedLayersChange={onCheckedLayersChange}
|
onCheckedLayersChange={onCheckedLayersChange}
|
||||||
imgVisble={false}
|
imgVisble={false}
|
||||||
searchBar={(props: any) => (
|
|
||||||
<SearchBar
|
|
||||||
setHasuPk={(hasuPk: any) => {
|
|
||||||
if (hasuPk) {
|
|
||||||
setSelectDataPk(hasuPk);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onApply={onApply}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<SelectedFcltList
|
<SelectedFcltList
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
import type { SelectDataType } from "@common/business_components/ui";
|
import type { SelectDataType } from "@common/business_components/ui";
|
||||||
import type { TableUpperProps } from "../common";
|
import type { TableUpperProps } from "../common";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
|
||||||
|
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - 타입
|
* Store - 타입
|
||||||
=====================================*/
|
=====================================*/
|
||||||
// 수요처 정보
|
// 수요처 정보
|
||||||
export type DemandCompBizType = {
|
export type DemandCompType = {
|
||||||
index : number | '';
|
index : number | '';
|
||||||
dmdInfoId : string | '';
|
dmdInfoId : string | '';
|
||||||
dmdInfoFk : string | '';
|
dmdInfoFk : string | '';
|
||||||
@@ -24,23 +23,22 @@ export type DemandCompBizType = {
|
|||||||
wntUntprc : number | '';
|
wntUntprc : number | '';
|
||||||
dmndTmng : Date | '';
|
dmndTmng : Date | '';
|
||||||
dmndQty : number | '';
|
dmndQty : number | '';
|
||||||
grssClfg : number | null //총대장균군수
|
grssClfg : number | '';
|
||||||
tn : number | null //총질소
|
tn : number | '';
|
||||||
combResdch : number | null //결합잔류염소
|
combResdch : number | '';
|
||||||
tph : number | null //총인
|
tph : number | '';
|
||||||
trbt : number | null //탁도
|
trbt : number | '';
|
||||||
ph : string | ''; //수소이온농
|
ph : number | '';
|
||||||
blgcOxygDmndQnt : number | null //생물학적산소요구량
|
blgcOxygDmndQnt : number | '';
|
||||||
clIonQnt : number | null //염화물
|
clIonQnt : number | '';
|
||||||
smll : string | ''; //냄새
|
smll : number | '';
|
||||||
cdtnv : number | null; //전기전도도
|
cdtnv : number | '';
|
||||||
crmty : number | null //색도
|
crmty : number | '';
|
||||||
rmrk : string | '';
|
rmrk : string | '';
|
||||||
reqDt : string | '';
|
reqDt : string | '';
|
||||||
dmdInfoSn : number | '';
|
dmdInfoSn : number | '';
|
||||||
status : string | '';
|
status : string | '';
|
||||||
splyCndtList:SupplyCandidate[]|[],
|
splyCndtList:SupplyCandidate[]|[],
|
||||||
ruseUtztnFcltNm?:string|''
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +152,7 @@ export type MoneyDetailType = {
|
|||||||
clclnBrdnCst : string | '';
|
clclnBrdnCst : string | '';
|
||||||
clclnEcqrRt : string | '';
|
clclnEcqrRt : string | '';
|
||||||
}
|
}
|
||||||
// 규칙 타입 선언
|
|
||||||
export type DisableRulesType = Record<string, string[]>;
|
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - 데이터
|
* Store - 데이터
|
||||||
====================================*/
|
====================================*/
|
||||||
@@ -163,131 +160,6 @@ export type DisableRulesType = Record<string, string[]>;
|
|||||||
const demandCompList : DemandCompType[] = [
|
const demandCompList : DemandCompType[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
const disableRules: DisableRulesType = {
|
|
||||||
"청소": ["tn", 'tph',"clIonQnt" ,'cdtnv'],
|
|
||||||
"화장실용수": ["tn", 'tph',"clIonQnt" ,'cdtnv'],
|
|
||||||
"세척": ["combResdch", "crmty",'tph',"clIonQnt",'cdtnv'],
|
|
||||||
"살수": ["combResdch", "crmty",'tph',"clIonQnt",'cdtnv'],
|
|
||||||
"조경": ["combResdch", "crmty",'tph','cdtnv'],
|
|
||||||
"농업_간접용수": ["combResdch", "crmty",'tn','tph','clIonQnt'],
|
|
||||||
"농업_직접용수": ["combResdch", "crmty",'tn','tph','clIonQnt'],
|
|
||||||
"하천": ["combResdch", "trbt", "crmty" ,'clIonQnt','cdtnv'],
|
|
||||||
'공업':[]
|
|
||||||
};
|
|
||||||
|
|
||||||
const defaultRules: Record<string, object> = {
|
|
||||||
"청소": {
|
|
||||||
grssClfg: null,
|
|
||||||
combResdch:0.2,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 5,
|
|
||||||
crmty: 20,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv: null,
|
|
||||||
|
|
||||||
},
|
|
||||||
"화장실용수": {
|
|
||||||
grssClfg: null,
|
|
||||||
combResdch:0.2,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 5,
|
|
||||||
crmty: 20,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv: null,
|
|
||||||
},
|
|
||||||
"세척": {
|
|
||||||
grssClfg: null,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 5,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
combResdch:null,
|
|
||||||
crmty:null,
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv: null,
|
|
||||||
},
|
|
||||||
"살수": {
|
|
||||||
grssClfg: null,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 5,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
combResdch:null,
|
|
||||||
crmty:null,
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv: null,
|
|
||||||
},
|
|
||||||
"조경": {
|
|
||||||
grssClfg: null,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 5,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
clIonQnt:250,
|
|
||||||
combResdch:null,
|
|
||||||
crmty:null,
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
cdtnv: null,
|
|
||||||
},
|
|
||||||
"농업_간접용수": {
|
|
||||||
grssClfg: null,
|
|
||||||
trbt: 5,
|
|
||||||
bod: 8,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
cdtnv:2000,
|
|
||||||
combResdch:null,
|
|
||||||
crmty:null,
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
},
|
|
||||||
"농업_직접용수": {
|
|
||||||
grssClfg: null,
|
|
||||||
trbt: 2,
|
|
||||||
bod: 8,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
cdtnv:700,
|
|
||||||
combResdch:null,
|
|
||||||
crmty:null,
|
|
||||||
tn:null,
|
|
||||||
tph: null,
|
|
||||||
clIonQnt: null,
|
|
||||||
},
|
|
||||||
"하천": {
|
|
||||||
grssClfg: 1000,
|
|
||||||
bod: 5,
|
|
||||||
tn: 10,
|
|
||||||
tph: 0.5,
|
|
||||||
ph: "5.8~8.5",
|
|
||||||
combResdch:null,
|
|
||||||
trbt:null,
|
|
||||||
crmty:null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv:null
|
|
||||||
},
|
|
||||||
공업:{
|
|
||||||
grssClfg: null,
|
|
||||||
bod: null,
|
|
||||||
tn: null,
|
|
||||||
tph: null,
|
|
||||||
ph: "~",
|
|
||||||
combResdch:null,
|
|
||||||
trbt:null,
|
|
||||||
crmty:null,
|
|
||||||
clIonQnt: null,
|
|
||||||
cdtnv:null
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 사용용도
|
// 사용용도
|
||||||
const useTypesData : SelectDataType[] = [
|
const useTypesData : SelectDataType[] = [
|
||||||
{ text: '청소', val: "청소" },
|
{ text: '청소', val: "청소" },
|
||||||
@@ -295,8 +167,7 @@ const useTypesData : SelectDataType[] = [
|
|||||||
{ text: "세척", val: "세척" },
|
{ text: "세척", val: "세척" },
|
||||||
{ text: "살수", val: "살수" },
|
{ text: "살수", val: "살수" },
|
||||||
{ text: "조경", val: "조경" },
|
{ text: "조경", val: "조경" },
|
||||||
{ text: "농업_간접용수", val: "농업_간접용수" },
|
{ text: "농업", val: "농업" },
|
||||||
{ text: "농업_직접용수", val: "농업_직접용수" },
|
|
||||||
{ text: "하천", val: "하천" },
|
{ text: "하천", val: "하천" },
|
||||||
{ text: "지하수", val: "지하수" },
|
{ text: "지하수", val: "지하수" },
|
||||||
{ text: "공업", val: "공업" },
|
{ text: "공업", val: "공업" },
|
||||||
@@ -409,7 +280,7 @@ const postSdmData = async (data: DemandCompType) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 수요정보 등록
|
// 수요정보 등록
|
||||||
const postSdmInfoData = async (data: DemandCompBizType) => {
|
const postSdmInfoData = async (data: DemandCompType) => {
|
||||||
try {
|
try {
|
||||||
await postFetch("/reuseFc/request/demandInfo", data);
|
await postFetch("/reuseFc/request/demandInfo", data);
|
||||||
toast.success('수요 정보 등록에 성공하였습니다.');
|
toast.success('수요 정보 등록에 성공하였습니다.');
|
||||||
@@ -489,7 +360,7 @@ const fetchGetSimilarCaseList = async (part: string, value: number|string) => {
|
|||||||
export type SdmActions = {
|
export type SdmActions = {
|
||||||
initializeSdmData: () => void;
|
initializeSdmData: () => void;
|
||||||
insertSdmData: (data: DemandCompType) => Promise<void>;
|
insertSdmData: (data: DemandCompType) => Promise<void>;
|
||||||
insertSdmInfoData: (data: DemandCompBizType) => Promise<void>;
|
insertSdmInfoData: (data: DemandCompType) => Promise<void>;
|
||||||
getDemandCompList: (searchText: string, pageCnt: number) => Promise<void>;
|
getDemandCompList: (searchText: string, pageCnt: number) => Promise<void>;
|
||||||
actionLogin: (data: DemandCompType) => Promise<void>;
|
actionLogin: (data: DemandCompType) => Promise<void>;
|
||||||
getSdmInfoStatusList: (dmdInfoId: string) => Promise<void>;
|
getSdmInfoStatusList: (dmdInfoId: string) => Promise<void>;
|
||||||
@@ -507,10 +378,9 @@ export type SdmType ={
|
|||||||
moneyDetailList: MoneyDetailType[];
|
moneyDetailList: MoneyDetailType[];
|
||||||
|
|
||||||
// 수요정보 신청현황
|
// 수요정보 신청현황
|
||||||
sdmInfoStatusList: DemandCompBizType[];
|
sdmInfoStatusList: DemandCompType[];
|
||||||
upHeadSdmInfoStatus: TableUpperProps[];
|
upHeadSdmInfoStatus: TableUpperProps[];
|
||||||
defaultRules: Record<string, object>
|
|
||||||
disableRules: DisableRulesType;
|
|
||||||
// 로그인관련
|
// 로그인관련
|
||||||
successNextPage : boolean;
|
successNextPage : boolean;
|
||||||
successLogin: boolean;
|
successLogin: boolean;
|
||||||
@@ -528,10 +398,7 @@ export const SdmState: SdmType = {
|
|||||||
moneyDetailList: moneyDetailList,
|
moneyDetailList: moneyDetailList,
|
||||||
// 수요정보 신청현황
|
// 수요정보 신청현황
|
||||||
sdmInfoStatusList: [],
|
sdmInfoStatusList: [],
|
||||||
defaultRules:defaultRules,
|
|
||||||
disableRules:disableRules,
|
|
||||||
upHeadSdmInfoStatus: upHeadSdmInfoStatus,
|
upHeadSdmInfoStatus: upHeadSdmInfoStatus,
|
||||||
|
|
||||||
// 로그인관련
|
// 로그인관련
|
||||||
successNextPage : false,
|
successNextPage : false,
|
||||||
successLogin: false,
|
successLogin: false,
|
||||||
@@ -561,7 +428,7 @@ export const SdmReducer = (set: any): SdmActions => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
insertSdmInfoData: async (data: DemandCompBizType) => {
|
insertSdmInfoData: async (data: DemandCompType) => {
|
||||||
postSdmInfoData(data);
|
postSdmInfoData(data);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -598,13 +465,11 @@ export const SdmReducer = (set: any): SdmActions => {
|
|||||||
}))
|
}))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const sdmInfoStatusList : DemandCompBizType[] = [];
|
const sdmInfoStatusList : DemandCompType[] = [];
|
||||||
|
|
||||||
res.demandInfo.map((el: DemandCompBizType, index: number) => {
|
res.demandInfo.map((el: DemandCompType, index: number) => {
|
||||||
const matchingInfo = res.demandMatchings.find((matching: DemandMatchings) => matching.dmdInfoSn === el.dmdInfoSn);
|
const matchingInfo = res.demandMatchings.find((matching: DemandMatchings) => matching.dmdInfoSn === el.dmdInfoSn);
|
||||||
const status = matchingInfo?.splyFcltFlg?.trim() === 'Sub' ? '검토' : matchingInfo?.splyFcltFlg?.trim() === 'matched' ? '매칭완료' : '신청';
|
const status = matchingInfo?.splyFcltFlg?.trim() === 'Sub' ? '검토' : matchingInfo?.splyFcltFlg?.trim() === 'matched' ? '매칭완료' : '신청';
|
||||||
const ruseUtztnFcltNm = matchingInfo?.ruseUtztnFcltNm ? matchingInfo.ruseUtztnFcltNm : '';
|
|
||||||
|
|
||||||
|
|
||||||
const tmpData = {
|
const tmpData = {
|
||||||
...el,
|
...el,
|
||||||
@@ -620,9 +485,7 @@ export const SdmReducer = (set: any): SdmActions => {
|
|||||||
useUsgCd: el.useUsgCd,
|
useUsgCd: el.useUsgCd,
|
||||||
dmndTmng: el.dmndTmng,
|
dmndTmng: el.dmndTmng,
|
||||||
dmdInfoSn : el.dmdInfoSn,
|
dmdInfoSn : el.dmdInfoSn,
|
||||||
status : status,
|
status : status
|
||||||
splyCndtList: el.splyCndtList,
|
|
||||||
ruseUtztnFcltNm: ruseUtztnFcltNm || ''
|
|
||||||
}
|
}
|
||||||
sdmInfoStatusList.push(tmpData);
|
sdmInfoStatusList.push(tmpData);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,10 +13,8 @@ export const StoreZus = (initState: DmState= {
|
|||||||
...dmMapState,
|
...dmMapState,
|
||||||
}) => {
|
}) => {
|
||||||
return createStore<DmStore>()((set) => {
|
return createStore<DmStore>()((set) => {
|
||||||
if (typeof window !== "undefined") {
|
tokenManager.setToken("site-id-key", 'DM');
|
||||||
tokenManager.setToken("site-id-key", 'DM');
|
tokenManager.setToken("site-theme-key", 'green');
|
||||||
tokenManager.setToken("site-theme-key", 'green');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useDmStore } from '@/app/store';
|
import { useDmStore } from '@/app/store';
|
||||||
import type { DemandCompType } from '@common/business_components/ui/sdmInsertForm/form';
|
import type { DemandCompType } from '@/app/store/sdmMng';
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
type thisProps = {
|
type thisProps = {
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
export const sanitizeInput = (val: string, allowDecimal = false) => {
|
|
||||||
if (val === "") return ""; // 빈 값 허용
|
|
||||||
|
|
||||||
// 소숫점 허용
|
|
||||||
if (allowDecimal) {
|
|
||||||
// 숫자와 점만 허용
|
|
||||||
let cleaned = val.replace(/[^0-9.]/g, "");
|
|
||||||
// 소숫점 여러 개일 경우 첫 번째만 유지
|
|
||||||
const parts = cleaned.split(".");
|
|
||||||
if (parts.length > 2) {
|
|
||||||
cleaned = parts[0] + "." + parts.slice(1).join("");
|
|
||||||
}
|
|
||||||
return cleaned;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 정수만 허용
|
|
||||||
return val.replace(/[^0-9]/g, "");
|
|
||||||
};
|
|
||||||
@@ -118,6 +118,14 @@ export function SearchBar({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row space-x-2">
|
<div className="flex flex-row space-x-2">
|
||||||
|
<Button
|
||||||
|
color="red"
|
||||||
|
className="mx-2 mt-2"
|
||||||
|
size={"sm"}
|
||||||
|
onClick={() => {}}
|
||||||
|
>
|
||||||
|
후보지선택
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
color="sky"
|
color="sky"
|
||||||
className="mt-2"
|
className="mt-2"
|
||||||
|
|||||||
@@ -1,29 +1,28 @@
|
|||||||
import { FormUi } from "@common/business_components/ui";
|
import { FormUi } from "@common/business_components/ui";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
import type { ControllerRenderProps, FieldError, FieldValues, Path } from "react-hook-form";
|
import type { ControllerRenderProps, FieldError, FieldValues, Path } from "react-hook-form";
|
||||||
import { cloneElement, isValidElement } from "react";
|
|
||||||
|
|
||||||
interface AccessibleFormFieldProps<T extends FieldValues> {
|
interface AccessibleFormFieldProps<T extends FieldValues> {
|
||||||
field: ControllerRenderProps<T, Path<T>>;
|
field: ControllerRenderProps<T, Path<T>>;
|
||||||
label: string;
|
label: string;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
error?: FieldError;
|
error?: FieldError;
|
||||||
isDisabled?: boolean;
|
inputComponent: ReactNode;
|
||||||
inputComponent: React.ReactElement<{ disabled?: boolean }>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AccessibleFormField<T extends FieldValues>({
|
export function AccessibleFormField<T extends FieldValues>({
|
||||||
label,
|
label,
|
||||||
required = false,
|
required = false,
|
||||||
|
error,
|
||||||
inputComponent,
|
inputComponent,
|
||||||
isDisabled = false,
|
|
||||||
}: AccessibleFormFieldProps<T>) {
|
}: AccessibleFormFieldProps<T>) {
|
||||||
const labelText = required ? `${label} *` : label;
|
const labelText = required ? `${label} *` : label;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormUi label={labelText} isDisabled={isDisabled}>
|
<FormUi label={labelText}>
|
||||||
<div>
|
<div>
|
||||||
{isValidElement(inputComponent)
|
{inputComponent}
|
||||||
? cloneElement(inputComponent, { disabled: isDisabled } as Partial<typeof inputComponent.props>)
|
|
||||||
: inputComponent}
|
|
||||||
{/* {error?.message && Array.from(new Set(error.message.split('\n'))).map((msg, idx) => (
|
{/* {error?.message && Array.from(new Set(error.message.split('\n'))).map((msg, idx) => (
|
||||||
<p key={idx} className="text-red-500 text-sm mt-1" role="alert">
|
<p key={idx} className="text-red-500 text-sm mt-1" role="alert">
|
||||||
{msg}
|
{msg}
|
||||||
|
|||||||
@@ -11,20 +11,13 @@ import {
|
|||||||
UiModal,
|
UiModal,
|
||||||
} from "@common/business_components";
|
} from "@common/business_components";
|
||||||
import { Input } from "@common/components";
|
import { Input } from "@common/components";
|
||||||
import { Button, Label } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { AccessibleFormField } from "./AccessibleFormField";
|
import { AccessibleFormField } from "./AccessibleFormField";
|
||||||
import {
|
import type { ControllerRenderProps, UseFormReturn, FieldError } from "react-hook-form";
|
||||||
type ControllerRenderProps,
|
|
||||||
type UseFormReturn,
|
|
||||||
type FieldError,
|
|
||||||
useWatch,
|
|
||||||
} from "react-hook-form";
|
|
||||||
import SearchInputText from "../common/searhDemandInput/component";
|
import SearchInputText from "../common/searhDemandInput/component";
|
||||||
import React from "react";
|
import type { DemandCompType } from "@/app/store/sdmMng";
|
||||||
import { sanitizeInput } from "../common/utils/utils";
|
|
||||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
|
||||||
|
|
||||||
export interface SdmInfoRegFormProps {
|
export interface SdmInfoRegFormProps {
|
||||||
form: UseFormReturn<FormData>;
|
form: UseFormReturn<FormData>;
|
||||||
@@ -42,15 +35,12 @@ export function SdmInfoRegForm({
|
|||||||
facilityName,
|
facilityName,
|
||||||
}: SdmInfoRegFormProps) {
|
}: SdmInfoRegFormProps) {
|
||||||
const { initializeCommonData, Sdm } = useDmStore((state) => state);
|
const { initializeCommonData, Sdm } = useDmStore((state) => state);
|
||||||
const { useTypesData, defaultRules, disableRules } = Sdm;
|
const { useTypesData } = Sdm;
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
|
|
||||||
const [sdmNmValue, setSdmNmValue] = useState<string>(
|
const [sdmNmValue, setSdmNmValue] = useState<string>(
|
||||||
searchParams.get("dmdCoNm") || ""
|
searchParams.get("dmdCoNm") || ""
|
||||||
);
|
);
|
||||||
|
|
||||||
const [frontPHdata, setFrontPHdata] = useState("0");
|
|
||||||
const [backPHdata, setBackPHdata] = useState("0");
|
|
||||||
const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false);
|
const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false);
|
||||||
const [isSimilarCase, setIsSimilarCase] = useState(false);
|
const [isSimilarCase, setIsSimilarCase] = useState(false);
|
||||||
const [key, setKey] = useState(0);
|
const [key, setKey] = useState(0);
|
||||||
@@ -67,15 +57,14 @@ export function SdmInfoRegForm({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("candidateTitle ", form.getValues("candidateTitle"));
|
console.log("candidateTitle ", form.getValues("candidateTitle"));
|
||||||
}, [form.getValues]);
|
}, [form.getValues("candidateTitle")]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (useTypesData && useTypesData.length > 0) {
|
if (useTypesData && useTypesData.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
form.setValue("usePurpose", useTypesData[0]?.val?.toString() || "");
|
form.setValue("usePurpose", useTypesData[0]?.val?.toString() || "");
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}, [useTypesData, form.setValue, form]);
|
}, [useTypesData, form]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (facilityName) {
|
if (facilityName) {
|
||||||
@@ -83,7 +72,7 @@ export function SdmInfoRegForm({
|
|||||||
form.setValue("sdmNm", facilityName);
|
form.setValue("sdmNm", facilityName);
|
||||||
setKey((prev) => prev + 1);
|
setKey((prev) => prev + 1);
|
||||||
}
|
}
|
||||||
}, [facilityName, form.setValue, form]);
|
}, [facilityName, form]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (searchParams.get("dmdCoNm")) {
|
if (searchParams.get("dmdCoNm")) {
|
||||||
@@ -91,7 +80,7 @@ export function SdmInfoRegForm({
|
|||||||
setSdmNmValue(searchParams.get("dmdCoNm") || "");
|
setSdmNmValue(searchParams.get("dmdCoNm") || "");
|
||||||
setKey((prev) => prev + 1);
|
setKey((prev) => prev + 1);
|
||||||
}
|
}
|
||||||
}, [searchParams, form.setValue, form]);
|
}, [searchParams, form]);
|
||||||
|
|
||||||
const searchCandidate = (e: React.MouseEvent) => {
|
const searchCandidate = (e: React.MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -120,54 +109,6 @@ export function SdmInfoRegForm({
|
|||||||
onCheckboxChange?.(checked);
|
onCheckboxChange?.(checked);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const watchPH = form.getValues(`ph`);
|
|
||||||
if (watchPH && watchPH !== undefined) {
|
|
||||||
const [frontPH, backPH] = watchPH.split("~");
|
|
||||||
if (frontPH) {
|
|
||||||
setFrontPHdata(frontPH);
|
|
||||||
}
|
|
||||||
if (backPH) {
|
|
||||||
setBackPHdata(backPH);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setFrontPHdata("0");
|
|
||||||
setBackPHdata("0");
|
|
||||||
}
|
|
||||||
}, [form.getValues(`ph`)]);
|
|
||||||
|
|
||||||
const isSetPh = useCallback(
|
|
||||||
(typePHdata: string, index: number) => {
|
|
||||||
const PHdata = form.getValues("ph");
|
|
||||||
const isPH = PHdata?.split("~")[index] || "";
|
|
||||||
if (index == 0) {
|
|
||||||
form.setValue("ph", `${isPH}~${typePHdata}`);
|
|
||||||
setBackPHdata(typePHdata);
|
|
||||||
} else if (index == 1) {
|
|
||||||
form.setValue("ph", `${typePHdata}~${isPH}`);
|
|
||||||
setFrontPHdata(typePHdata);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[form]
|
|
||||||
);
|
|
||||||
|
|
||||||
const usePurpose = useWatch({ control: form.control, name: "usePurpose" });
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!usePurpose) return;
|
|
||||||
|
|
||||||
// Apply default values
|
|
||||||
const defaults = defaultRules[usePurpose];
|
|
||||||
|
|
||||||
console.log("usePurpose", usePurpose);
|
|
||||||
console.log("defaults", defaults);
|
|
||||||
if (defaults) {
|
|
||||||
Object.entries(defaults).forEach(([field, value]) => {
|
|
||||||
form.setValue(field as keyof FormData, value, { shouldDirty: true });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [form.getValues("usePurpose")]);
|
|
||||||
|
|
||||||
// 시설 선택시 이벤트
|
// 시설 선택시 이벤트
|
||||||
const selectComp = useCallback(
|
const selectComp = useCallback(
|
||||||
(rtnData: DemandCompType[]) => {
|
(rtnData: DemandCompType[]) => {
|
||||||
@@ -237,6 +178,7 @@ export function SdmInfoRegForm({
|
|||||||
required: true,
|
required: true,
|
||||||
component: (field) => (
|
component: (field) => (
|
||||||
<Input
|
<Input
|
||||||
|
placeholder="요구수량(㎥/d)을 입력하세요"
|
||||||
type="text"
|
type="text"
|
||||||
className="!text-xl text-gray-600"
|
className="!text-xl text-gray-600"
|
||||||
value={field.value as string}
|
value={field.value as string}
|
||||||
@@ -280,6 +222,7 @@ export function SdmInfoRegForm({
|
|||||||
isDisabled={isBznmTotNoDisabled}
|
isDisabled={isBznmTotNoDisabled}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
|
placeholder="희망단가(원/㎥)을 입력하세요"
|
||||||
type="text"
|
type="text"
|
||||||
className="!text-xl text-gray-600"
|
className="!text-xl text-gray-600"
|
||||||
value={field.value as string}
|
value={field.value as string}
|
||||||
@@ -301,7 +244,221 @@ export function SdmInfoRegForm({
|
|||||||
required: true,
|
required: true,
|
||||||
component: undefined,
|
component: undefined,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "grssClfg",
|
||||||
|
label: "총대장균군수(개/100ml)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="총대장균군수를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "tn",
|
||||||
|
label: "총질소(T-N)(mg/L)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="총질소를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "combResdch",
|
||||||
|
label: "결합잔류염소(mg/L)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="결합잔류염소를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "tph",
|
||||||
|
label: "총인(T-P)(mg/L)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="총인을 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "trbt",
|
||||||
|
label: "탁도(NTU)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="탁도를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ph",
|
||||||
|
label: "수소이온농도(pH)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="수소이온농도를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "bod",
|
||||||
|
label: "생물학적 산소요구량(BOD)(mg/L)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="생물학적 산소요구량을 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "clIonQnt",
|
||||||
|
label: "염화물(mgCL/L)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="염화물을 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "smll",
|
||||||
|
label: "냄새",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="냄새를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "cdtnv",
|
||||||
|
label: "전기전도도(㎲/cm)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="전기전도도를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "crmty",
|
||||||
|
label: "색도(도)",
|
||||||
|
formIndex: 1,
|
||||||
|
required: true,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="색도를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "rmrk",
|
||||||
|
label: "비고",
|
||||||
|
formIndex: 1,
|
||||||
|
component: (field) => (
|
||||||
|
<Input
|
||||||
|
placeholder="비고를 입력하세요"
|
||||||
|
type="text"
|
||||||
|
className="!text-xl text-gray-600"
|
||||||
|
value={field.value as string}
|
||||||
|
onChange={field.onChange}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "candidateTitle",
|
name: "candidateTitle",
|
||||||
label: CANDIDATE || "공급처 후보지 선택(필수아님)",
|
label: CANDIDATE || "공급처 후보지 선택(필수아님)",
|
||||||
@@ -309,20 +466,10 @@ export function SdmInfoRegForm({
|
|||||||
component: () => (
|
component: () => (
|
||||||
<div>
|
<div>
|
||||||
<div className="-mt-14 float-right flex gap-10">
|
<div className="-mt-14 float-right flex gap-10">
|
||||||
<Button
|
<Button className={"bg-gray-200"} onClick={searchCandidate}>
|
||||||
className="rounded-md"
|
|
||||||
color="sky"
|
|
||||||
size={"sm"}
|
|
||||||
onClick={searchCandidate}
|
|
||||||
>
|
|
||||||
후보지 조회
|
후보지 조회
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button className={"bg-gray-200"} onClick={searchSimilarCase}>
|
||||||
className="rounded-md"
|
|
||||||
color="sky"
|
|
||||||
size={"sm"}
|
|
||||||
onClick={searchSimilarCase}
|
|
||||||
>
|
|
||||||
유사사례
|
유사사례
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -348,9 +495,9 @@ export function SdmInfoRegForm({
|
|||||||
const normalFields = formFields.filter(
|
const normalFields = formFields.filter(
|
||||||
(f) => f.formIndex === 0 && f.component
|
(f) => f.formIndex === 0 && f.component
|
||||||
);
|
);
|
||||||
// const groupFields = formFields.filter(
|
const groupFields = formFields.filter(
|
||||||
// (f) => f.formIndex === 1 && f.component
|
(f) => f.formIndex === 1 && f.component
|
||||||
// );
|
);
|
||||||
const candidateFields = formFields.filter(
|
const candidateFields = formFields.filter(
|
||||||
(f) => f.formIndex === 2 && f.component
|
(f) => f.formIndex === 2 && f.component
|
||||||
);
|
);
|
||||||
@@ -365,15 +512,17 @@ export function SdmInfoRegForm({
|
|||||||
name={name}
|
name={name}
|
||||||
render={({ field }) =>
|
render={({ field }) =>
|
||||||
name === "money" ? (
|
name === "money" ? (
|
||||||
// component(field)
|
component(field)
|
||||||
<FormUi label={label + "*"}>{component(field)}</FormUi>
|
|
||||||
) : (
|
) : (
|
||||||
|
// <FormUi label={label}>
|
||||||
|
// {component(field)}
|
||||||
|
// </FormUi>
|
||||||
<AccessibleFormField
|
<AccessibleFormField
|
||||||
field={field}
|
field={field}
|
||||||
label={label}
|
label={label}
|
||||||
required={required}
|
required={required}
|
||||||
error={
|
error={
|
||||||
typeof form.formState.errors[name]?.message === "string"
|
typeof form.formState.errors[name]?.message === 'string'
|
||||||
? (form.formState.errors[name] as FieldError)
|
? (form.formState.errors[name] as FieldError)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
@@ -385,527 +534,37 @@ export function SdmInfoRegForm({
|
|||||||
) : null
|
) : null
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="mt-10">
|
{groupFields.length > 0 && (
|
||||||
<FormLabel className="text-xl">요구수질</FormLabel>
|
<div className="mt-10">
|
||||||
<div className="grid grid-cols-2 gap-x-10 gap-y-6 mt-3 mb-3">
|
<FormLabel className="text-xl">요구수질</FormLabel>
|
||||||
<FormField
|
<div className="flex flex-wrap justify-start gap-10 mt-3 mb-3">
|
||||||
control={form.control}
|
{groupFields.map(({ name, label, component, required }) => (
|
||||||
name={`grssClfg`}
|
<div key={name} className="min-w-[180px]">
|
||||||
render={({ field }) => {
|
<FormField
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
control={form.control}
|
||||||
const isDisabled = disabledFields
|
name={name}
|
||||||
? disabledFields.includes(field.name)
|
render={({ field }) => (
|
||||||
: true;
|
// <FormUi label={label}>
|
||||||
return (
|
// {component?.(field)}
|
||||||
<FormUi
|
// </FormUi>
|
||||||
label={
|
<AccessibleFormField
|
||||||
!isDisabled ? `총대장균군수(개/mg)*` : "총대장균군수(개/mg)"
|
field={field}
|
||||||
}
|
label={label}
|
||||||
>
|
required={required}
|
||||||
<div className="flex items-center gap-2">
|
error={
|
||||||
<div className="relative flex-1 min-w-0">
|
typeof form.formState.errors[name]?.message === 'string'
|
||||||
<Input
|
? (form.formState.errors[name] as FieldError)
|
||||||
type="text"
|
: undefined
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
}
|
||||||
placeholder=""
|
inputComponent={component?.(field)}
|
||||||
onChange={(e) => {
|
/>
|
||||||
const inputValue = e.target.value.replace(
|
)}
|
||||||
/[^0-9]/g,
|
/>
|
||||||
""
|
</div>
|
||||||
); // 정수만
|
))}
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: "불검출"
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
{/* TODO: 총대장균군수 확인 필요*/}
|
|
||||||
{field.value !== null ? (
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`tn`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={
|
|
||||||
!isDisabled ? `총질소(T-N)(mg/L)*` : "총질소(T-N)(mg/L)"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`combResdch`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={
|
|
||||||
!isDisabled ? `결합잔류염소(mg/L)*` : "결합잔류염소(mg/L)"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const cleanValue = sanitizeInput(
|
|
||||||
e.target.value,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
field.onChange(
|
|
||||||
cleanValue === "" ? null : Number(cleanValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={field.value ?? ""}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이상
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`tph`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={!isDisabled ? `총인(T-P)(mg/L)*` : "총인(T-P)(mg/L)"}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const cleanValue = sanitizeInput(
|
|
||||||
e.target.value,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
field.onChange(
|
|
||||||
cleanValue === "" ? null : Number(cleanValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={field.value ?? ""}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`trbt`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi label={!isDisabled ? `탁도(NTU)*` : "탁도(NTU)"}>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<div className="col-span-1">
|
|
||||||
<Label className="text-xl">수소이온농도(PH)</Label>
|
|
||||||
<div className="flex flex-row items-center gap-2">
|
|
||||||
<Input
|
|
||||||
className="!text-xl w-36"
|
|
||||||
placeholder=""
|
|
||||||
type="text"
|
|
||||||
onChange={(e) => {
|
|
||||||
const cleanValue = sanitizeInput(e.target.value, true);
|
|
||||||
isSetPh(cleanValue, 1);
|
|
||||||
}}
|
|
||||||
value={frontPHdata ?? ""}
|
|
||||||
maxLength={5}
|
|
||||||
/>
|
|
||||||
<span className="text-xl mx-2">~</span>
|
|
||||||
<Input
|
|
||||||
className="!text-xl w-36 "
|
|
||||||
placeholder=""
|
|
||||||
type="text"
|
|
||||||
onChange={(e) => {
|
|
||||||
const cleanValue = sanitizeInput(e.target.value, true);
|
|
||||||
isSetPh(cleanValue, 0);
|
|
||||||
}}
|
|
||||||
value={backPHdata ?? ""}
|
|
||||||
maxLength={5}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`bod`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={
|
|
||||||
!isDisabled
|
|
||||||
? `생물학적 산소요구량(BOD)(mg/L)*`
|
|
||||||
: "생물학적 산소요구량(BOD)(mg/L)"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`clIonQnt`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={!isDisabled ? `염화물(mgCL/L)*` : "염화물(mgCL/L)"}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`smll`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi label={!isDisabled ? `냄새*` : "냄새"}>
|
|
||||||
<SelectBox
|
|
||||||
className="!text-2xl rounded-md"
|
|
||||||
label={""}
|
|
||||||
selectClass={undefined}
|
|
||||||
selectArray={[
|
|
||||||
{ text: "불쾌하지않을것", val: "불쾌하지않을것" },
|
|
||||||
{ text: "해당사항없음", val: "해당사항없음" },
|
|
||||||
]}
|
|
||||||
onSelectValue={(val: string | number) => {
|
|
||||||
field.onChange(val.toString());
|
|
||||||
}}
|
|
||||||
value={field.value || "불쾌하지않을것"}
|
|
||||||
readOnly={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`cdtnv`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi
|
|
||||||
label={
|
|
||||||
!isDisabled ? `전기전도도(㎲/cm)*` : "전기전도도(㎲/cm)"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`crmty`}
|
|
||||||
render={({ field }) => {
|
|
||||||
const disabledFields = usePurpose ? disableRules[usePurpose] : [];
|
|
||||||
const isDisabled = disabledFields
|
|
||||||
? disabledFields.includes(field.name)
|
|
||||||
: true;
|
|
||||||
return (
|
|
||||||
<FormUi label={!isDisabled ? `색도(도)*` : "색도(도)"}>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
const inputValue = e.target.value.replace(
|
|
||||||
/[^0-9]/g,
|
|
||||||
""
|
|
||||||
); // 정수만
|
|
||||||
field.onChange(
|
|
||||||
inputValue === "" ? null : Number(inputValue)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== null
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
maxLength={6}
|
|
||||||
disabled={isDisabled}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
|
||||||
이하
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`rmrk`}
|
|
||||||
render={({ field }) => {
|
|
||||||
return (
|
|
||||||
<FormUi label={"비고"}>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<div className="relative flex-1 min-w-0">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
className="w-full pr-16 border py-2 text-right rounded-md"
|
|
||||||
placeholder=""
|
|
||||||
onChange={(e) => {
|
|
||||||
field.onChange(e.target.value);
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
field.value !== undefined && field.value !== ""
|
|
||||||
? `${field.value}`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
name={field.name}
|
|
||||||
ref={field.ref}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</FormUi>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
|
||||||
{candidateFields.map(({ name, label, component, required }, index) =>
|
{candidateFields.map(({ name, label, component, required }, index) =>
|
||||||
component ? (
|
component ? (
|
||||||
@@ -922,7 +581,7 @@ export function SdmInfoRegForm({
|
|||||||
label={label}
|
label={label}
|
||||||
required={required}
|
required={required}
|
||||||
error={
|
error={
|
||||||
typeof form.formState.errors[name]?.message === "string"
|
typeof form.formState.errors[name]?.message === 'string'
|
||||||
? (form.formState.errors[name] as FieldError)
|
? (form.formState.errors[name] as FieldError)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useDmStore } from "@/app/store";
|
import { useDmStore } from "@/app/store";
|
||||||
|
import type { DemandCompType } from "@/app/store/sdmMng";
|
||||||
import { BZNM_TOT_NO, FormField, FormUi } from "@common/business_components";
|
import { BZNM_TOT_NO, FormField, FormUi } from "@common/business_components";
|
||||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
|
||||||
import { Button, Input } from "@common/components";
|
import { Button, Input } from "@common/components";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { sha512 } from 'js-sha512';
|
import { sha512 } from 'js-sha512';
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3005",
|
"dev": "next dev --turbopack",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start:dm": "next start -p 3005",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -97,7 +97,10 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
||||||
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
||||||
const rainEffectDay = (item as T & { rainEffectDay: number }).rainEffectDay;
|
const rainEffectDay = (item as T & { rainEffectDay: number }).rainEffectDay;
|
||||||
if(flowPanel === '2'){
|
if(flowPanel === '1') {
|
||||||
|
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
||||||
|
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay>0 && infoRnDay < 3;
|
||||||
|
} else if(flowPanel === '2'){
|
||||||
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
||||||
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 3 && infoRnDay < 10;
|
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 3 && infoRnDay < 10;
|
||||||
} else if(flowPanel === '3'){
|
} else if(flowPanel === '3'){
|
||||||
@@ -119,7 +122,8 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
||||||
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 60;
|
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 60;
|
||||||
} else {
|
} else {
|
||||||
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && (rainEffectDay ===1);
|
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
||||||
|
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && (infoRnDay>0 || rainEffectDay ===1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if(tabName.includes("_chuncheon")) {
|
} else if(tabName.includes("_chuncheon")) {
|
||||||
@@ -128,8 +132,8 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
const itemDateOnly = new Date(itemDate.getFullYear(), itemDate.getMonth(), itemDate.getDate());
|
const itemDateOnly = new Date(itemDate.getFullYear(), itemDate.getMonth(), itemDate.getDate());
|
||||||
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
||||||
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
||||||
const rainEffectDay = (item as T & { rainEffectDay: number }).rainEffectDay;
|
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
|
||||||
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && rainEffectDay==0;
|
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay==0;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
filteredData = searchList.filter((item) => {
|
filteredData = searchList.filter((item) => {
|
||||||
@@ -140,6 +144,7 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
return itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly;
|
return itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setCopySearchList(filteredData);
|
setCopySearchList(filteredData);
|
||||||
setStandSearchList(filteredData);
|
setStandSearchList(filteredData);
|
||||||
}, [searchList, searchYear, tabName, flowPanel]);
|
}, [searchList, searchYear, tabName, flowPanel]);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export default function DrainageEquipment({searchYear = '', fcltyList = []}: Dra
|
|||||||
const {
|
const {
|
||||||
Common,
|
Common,
|
||||||
DrainageEquipment,
|
DrainageEquipment,
|
||||||
|
searchDrainageEquipment,
|
||||||
} = useFoStore((state) => state);
|
} = useFoStore((state) => state);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -34,10 +35,11 @@ export default function DrainageEquipment({searchYear = '', fcltyList = []}: Dra
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isInit && tableData[0]?.bscFctCd && (tableData[0].bscFctCd !== prevFacilityCode || !hasSearched)) {
|
if (!isInit && tableData[0]?.bscFctCd && (tableData[0].bscFctCd !== prevFacilityCode || !hasSearched)) {
|
||||||
|
searchDrainageEquipment(searchYear, tableData[0].bscFctCd, false);
|
||||||
setHasSearched(true);
|
setHasSearched(true);
|
||||||
setPrevFacilityCode(tableData[0].bscFctCd);
|
setPrevFacilityCode(tableData[0].bscFctCd);
|
||||||
}
|
}
|
||||||
}, [fcltyList, isInit, searchYear, tableData, hasSearched, prevFacilityCode]);
|
}, [fcltyList, isInit, searchDrainageEquipment, searchYear, tableData, hasSearched, prevFacilityCode]);
|
||||||
|
|
||||||
// 연도가 바뀌면 hasSearched를 false로 리셋
|
// 연도가 바뀌면 hasSearched를 false로 리셋
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ContentsDiv, UiModal, UiTable } from "@common/business_components";
|
|||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import DashBoardChartModal from "./modal/page";
|
import DashBoardChartModal from "./modal/page";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export type facilityInfoProps = {
|
export type facilityInfoProps = {
|
||||||
searchYear?: string;
|
searchYear?: string;
|
||||||
@@ -57,7 +56,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
PlanFclty,
|
PlanFclty,
|
||||||
OperationStatus,
|
OperationStatus,
|
||||||
searchOperationStatus,
|
searchOperationStatus,
|
||||||
searchPlanInfo,
|
searchPlanInfo
|
||||||
} = useFoStore((state) => state);
|
} = useFoStore((state) => state);
|
||||||
|
|
||||||
const [modalItem, setModalItem] = useState<{item: string, period: string, title: string, waterQlty: string} | null>(null);
|
const [modalItem, setModalItem] = useState<{item: string, period: string, title: string, waterQlty: string} | null>(null);
|
||||||
@@ -78,18 +77,13 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
const {
|
const {
|
||||||
upHeadListPlanFclty,
|
upHeadListPlanFclty,
|
||||||
planFcltyList,
|
planFcltyList,
|
||||||
planYearList,
|
planYearList
|
||||||
waterUsage1,
|
|
||||||
waterUsage2,
|
|
||||||
waterUsage3,
|
|
||||||
isLoadingPlanFclty
|
|
||||||
} = PlanFclty;
|
} = PlanFclty;
|
||||||
|
|
||||||
// 그리드 관련
|
// 그리드 관련
|
||||||
const {
|
const {
|
||||||
upHeadListOperationStatus,
|
upHeadListOperationStatus,
|
||||||
operationalStatusList,
|
operationalStatusList
|
||||||
isLoadingOperationStatus
|
|
||||||
} = OperationStatus;
|
} = OperationStatus;
|
||||||
|
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
@@ -153,27 +147,20 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
searchPlanInfo(searchYear, fcltyList[0].bscFctCd);
|
searchPlanInfo(searchYear, fcltyList[0].bscFctCd);
|
||||||
setHasSearched(true);
|
setHasSearched(true);
|
||||||
setPrevFacilityCode(fcltyList[0].bscFctCd);
|
setPrevFacilityCode(fcltyList[0].bscFctCd);
|
||||||
}
|
|
||||||
}, [isInit, searchOperationStatus, searchYear, fcltyList, hasSearched, prevFacilityCode, searchPlanInfo]);
|
|
||||||
|
|
||||||
// waterUsage 값들이 로드된 후에 테이블 데이터 업데이트
|
|
||||||
useEffect(() => {
|
|
||||||
if (waterUsage1 !== '' && waterUsage2 !== '' && waterUsage3 !== '') {
|
|
||||||
planFcltyList.forEach((el: { [key: string]: string | number | boolean }, index) => {
|
planFcltyList.forEach((el: { [key: string]: string | number | boolean }, index) => {
|
||||||
if (index === 6) {
|
if (index === 6) {
|
||||||
el['item'] = (Number(searchYear)-2).toString();
|
el['item'] = (Number(searchYear)-2).toString();
|
||||||
el['provisionalApproval'] = waterUsage3;
|
el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
|
||||||
} else if (index === 7) {
|
} else if (index === 7) {
|
||||||
el['item'] = (Number(searchYear)-1).toString();
|
el['item'] = (Number(searchYear)-1).toString();
|
||||||
el['provisionalApproval'] = waterUsage2;
|
el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
|
||||||
} else if (index === 8) {
|
} else if (index === 8) {
|
||||||
el['item'] = (Number(searchYear)-0).toString();
|
el['item'] = (Number(searchYear)-0).toString();
|
||||||
el['provisionalApproval'] = waterUsage1;
|
el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('planFcltyList :', planFcltyList);
|
|
||||||
}
|
}
|
||||||
}, [waterUsage1, waterUsage2, waterUsage3, searchYear, planFcltyList]);
|
}, [isInit, searchOperationStatus, searchYear, fcltyList, hasSearched, prevFacilityCode, searchPlanInfo, planFcltyList]);
|
||||||
// 연도가 바뀌면 hasSearched를 false로 리셋
|
// 연도가 바뀌면 hasSearched를 false로 리셋
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setHasSearched(false);
|
setHasSearched(false);
|
||||||
@@ -203,7 +190,6 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
<>
|
<>
|
||||||
<UiTable headName={""} tableData={mappedTableData} headlist={upHeadListFclty} pageSize={0} total={0} cellClick={ undefined } onPageChange={() => { } } />
|
<UiTable headName={""} tableData={mappedTableData} headlist={upHeadListFclty} pageSize={0} total={0} cellClick={ undefined } onPageChange={() => { } } />
|
||||||
<ContentsDiv>
|
<ContentsDiv>
|
||||||
<LoadingOverlay isLoading={isLoadingPlanFclty} />
|
|
||||||
<div className="grid grid-cols-12 gap-1">
|
<div className="grid grid-cols-12 gap-1">
|
||||||
<div className="col-span-5">
|
<div className="col-span-5">
|
||||||
<Table variant="secondary">
|
<Table variant="secondary">
|
||||||
@@ -225,8 +211,8 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
|
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
|
||||||
?<TableCell className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
?<TableCell className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
:(head.id === "provisionalApproval" && index === 4)
|
:(head.id === "provisionalApproval" && index === 4)
|
||||||
?<TableCell colSpan={6} className="text-right border border-[var(--border)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{Math.round((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3 * 100)/100}</TableCell>
|
?<TableCell colSpan={6} className="text-right border border-[var(--border)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{(Number(fcltyList[0]?.fcltyCpc)* 0.6).toLocaleString('en-US', { minimumFractionDigits: 1, maximumFractionDigits: 1 })} </TableCell>
|
||||||
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') )
|
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') && index === 4)
|
||||||
?null
|
?null
|
||||||
:(head.id === 'item' && index != 5)?
|
:(head.id === 'item' && index != 5)?
|
||||||
<TableCell className="text-center text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
<TableCell className="text-center text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
@@ -239,40 +225,39 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-span-7 h-[600px] overflow-x-auto">
|
<div className="col-span-7 h-[600px] overflow-x-auto">
|
||||||
<div className="w-[200%]">
|
<div className="w-[200%]">
|
||||||
<LoadingOverlay isLoading={isLoadingOperationStatus} />
|
<Table variant="secondary">
|
||||||
<Table variant="secondary">
|
<TableHeader>
|
||||||
<TableHeader>
|
{upChangeHeadListOperationStatus}
|
||||||
{upChangeHeadListOperationStatus}
|
</TableHeader>
|
||||||
</TableHeader>
|
<TableBody>
|
||||||
<TableBody>
|
{operationalStatusList.map((el: { [key: string]: string | number | boolean },index) => (
|
||||||
{operationalStatusList.map((el: { [key: string]: string | number | boolean },index) => (
|
<TableRow key={index+"row"} >
|
||||||
<TableRow key={index+"row"} >
|
{upHeadListOperationStatus.map((head) => (
|
||||||
{upHeadListOperationStatus.map((head) => (
|
(head.id === 'flowRate' && index === 0)?<TableCell rowSpan={5} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'flowRate' && index === 0)?<TableCell rowSpan={5} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'flowRate' && index === 5)?<TableCell rowSpan={6} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'flowRate' && index === 5)?<TableCell rowSpan={6} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'flowRate' && index === 11)?<TableCell rowSpan={2} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'flowRate' && index === 11)?<TableCell rowSpan={2} className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'rdi'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'rdi'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'rdi'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}></TableCell>:
|
||||||
(head.id === 'rdi'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'rdiRain'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el['rdiRain']}</TableCell>:
|
||||||
(head.id === 'rdiRain'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el['rdiRain']}</TableCell>:
|
(head.id === 'rdiRain'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}></TableCell>:
|
||||||
(head.id === 'rdiRain'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}></TableCell>:
|
(head.id === 'waterQlty')?<TableCell className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
(head.id === 'waterQlty')?<TableCell className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?<TableCell className="bg-green-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?<TableCell className="bg-green-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?<TableCell className="bg-yellow-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?<TableCell className="bg-yellow-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?<TableCell className="bg-green-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?<TableCell className="bg-green-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?<TableCell className="bg-blue-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?<TableCell className="bg-blue-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?<TableCell className="bg-green-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?<TableCell className="bg-green-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
null
|
||||||
null
|
))}
|
||||||
))}
|
</TableRow>
|
||||||
</TableRow>
|
))}
|
||||||
))}
|
</TableBody>
|
||||||
</TableBody>
|
</Table>
|
||||||
</Table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { CHART_FORM, type ChartConfig, ContentsDiv, MainChart } from "@common/bu
|
|||||||
import { Card, CardContent } from "@common/business_components/ui/chart/lib/card";
|
import { Card, CardContent } from "@common/business_components/ui/chart/lib/card";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
type facilityInfoProps = {
|
type facilityInfoProps = {
|
||||||
searchYear?: string;
|
searchYear?: string;
|
||||||
@@ -45,7 +44,6 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili
|
|||||||
chart_inflTn,
|
chart_inflTn,
|
||||||
chart_efflTn,
|
chart_efflTn,
|
||||||
chart_inflBod,
|
chart_inflBod,
|
||||||
isLoadingMainGraph,
|
|
||||||
} = MainGraph;
|
} = MainGraph;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -181,7 +179,6 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ContentsDiv>
|
<ContentsDiv>
|
||||||
<LoadingOverlay isLoading={isLoadingMainGraph} />
|
|
||||||
<ListDiv className="h-[300px]">
|
<ListDiv className="h-[300px]">
|
||||||
<Card className="h-full">
|
<Card className="h-full">
|
||||||
<CardContent className="h-full">
|
<CardContent className="h-full">
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ export default function DashBoard() {
|
|||||||
|
|
||||||
/******************선택된 데이터******************/
|
/******************선택된 데이터******************/
|
||||||
// 연도
|
// 연도
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || '0');
|
//const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || '0');
|
||||||
|
const [searchYear, setSearchYear] = useState<string>('2023');
|
||||||
// 시설명
|
// 시설명
|
||||||
const [fcltyList, setFcltyList] = useState<{bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | ''}>({
|
const [fcltyList, setFcltyList] = useState<{bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | ''}>({
|
||||||
bscFctCd: '26260PB001R',
|
bscFctCd: '26260PB001R',
|
||||||
@@ -279,11 +280,8 @@ export default function DashBoard() {
|
|||||||
trtFrfNm: '표준활성슬러지법, MLE, MBR',
|
trtFrfNm: '표준활성슬러지법, MLE, MBR',
|
||||||
efflWqltStndrdNm: '500톤 이상(Ⅳ지역)'
|
efflWqltStndrdNm: '500톤 이상(Ⅳ지역)'
|
||||||
});
|
});
|
||||||
setSearchYear(selectSearchYear[0]?.val || '0');
|
setSearchYear('2023');
|
||||||
searchFcltyList.bscFctNm = '수영';
|
searchFcltyList.bscFctNm = '수영';
|
||||||
|
|
||||||
setSidoValue('0');
|
|
||||||
setSigunValue('0');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchVal = () => {
|
const searchVal = () => {
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export default function RainManageTab({searchYear = '', fcltyList = []}: facilit
|
|||||||
}, [searchYear]);
|
}, [searchYear]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<UiTable
|
<UiTable
|
||||||
headName=""
|
headName=""
|
||||||
tableData={rainManageList}
|
tableData={rainManageList}
|
||||||
@@ -56,7 +55,5 @@ export default function RainManageTab({searchYear = '', fcltyList = []}: facilit
|
|||||||
onPageChange={() => {}}
|
onPageChange={() => {}}
|
||||||
>
|
>
|
||||||
</UiTable>
|
</UiTable>
|
||||||
<span className="text-2xl font-bold text-gray-500">☞ 일수에 강우영향일 포함됨</span>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, Selec
|
|||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import PrecipitationModal from "./modal/page";
|
import PrecipitationModal from "./modal/page";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function FacilityPrecipitation() {
|
export default function FacilityPrecipitation() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -40,8 +39,7 @@ export default function FacilityPrecipitation() {
|
|||||||
upHeadList3,
|
upHeadList3,
|
||||||
excelList,
|
excelList,
|
||||||
facilityPrecipitation,
|
facilityPrecipitation,
|
||||||
facilityPrecipitationCount,
|
facilityPrecipitationCount
|
||||||
isLoading,
|
|
||||||
} = FacilityPrecipitation;
|
} = FacilityPrecipitation;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -83,7 +81,8 @@ export default function FacilityPrecipitation() {
|
|||||||
// 시설상태
|
// 시설상태
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
// 조회기간
|
// 조회기간
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
//const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYear, setSearchYear] = useState<string>("2023");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 페이지 함수
|
* 페이지 함수
|
||||||
@@ -127,9 +126,9 @@ export default function FacilityPrecipitation() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isInit) {
|
if (!isInit) {
|
||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchFacilityPrecipitationList(1, 10, selectSearchYear[0]?.val || "0");
|
searchFacilityPrecipitationList(1, 10, searchYear || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchFacilityPrecipitationList]);
|
}, [isInit, initializeCommonData, searchFacilityPrecipitationList, searchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -228,7 +227,6 @@ export default function FacilityPrecipitation() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false} />
|
ref={ref} isAdmin={false} />
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 강수현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 강수현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
let maxefflWqltToc = 0;
|
let maxefflWqltToc = 0;
|
||||||
let maxEfflWqltSs = 0;
|
let maxEfflWqltSs = 0;
|
||||||
|
|
||||||
let maxinflAssctBfrWqltBod = 0;
|
let maxInflAssctAftWqltBod = 0;
|
||||||
let maxinflAssctBfrWqltTn = 0;
|
let maxInflAssctAftWqltTn = 0;
|
||||||
let maxInflAssctBfrWqltTp = 0;
|
let maxInflAssctBfrWqltTp = 0;
|
||||||
let maxinflAssctBfrWqltToc = 0;
|
let maxInflAssctAftWqltToc = 0;
|
||||||
let maxinflAssctBfrWqltSs = 0;
|
let maxInflAssctAftWqltSs = 0;
|
||||||
|
|
||||||
let maxTpInflWqltBod = 0;
|
let maxTpInflWqltBod = 0;
|
||||||
let maxTpInflWqltTp = 0;
|
let maxTpInflWqltTp = 0;
|
||||||
@@ -83,11 +83,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
let minefflWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltToc) : 0;
|
let minefflWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltToc) : 0;
|
||||||
let minEfflWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltSs) : 0;
|
let minEfflWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltSs) : 0;
|
||||||
|
|
||||||
let mininflAssctBfrWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltBod) : 0;
|
let minInflAssctAftWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltBod) : 0;
|
||||||
let mininflAssctBfrWqltTn = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltTn) : 0;
|
let minInflAssctAftWqltTn = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltTn) : 0;
|
||||||
let minInflAssctBfrWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltTp) : 0;
|
let minInflAssctBfrWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltTp) : 0;
|
||||||
let mininflAssctBfrWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltToc) : 0;
|
let minInflAssctAftWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltToc) : 0;
|
||||||
let mininflAssctBfrWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltSs) : 0;
|
let minInflAssctAftWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltSs) : 0;
|
||||||
|
|
||||||
let minTpInflWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltBod) : 0;
|
let minTpInflWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltBod) : 0;
|
||||||
let minTpInflWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltTp) : 0;
|
let minTpInflWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltTp) : 0;
|
||||||
@@ -100,11 +100,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
let avgefflWqltToc = 0;
|
let avgefflWqltToc = 0;
|
||||||
let avgEfflWqltSs = 0;
|
let avgEfflWqltSs = 0;
|
||||||
|
|
||||||
let avginflAssctBfrWqltBod = 0;
|
let avgInflAssctAftWqltBod = 0;
|
||||||
let avginflAssctBfrWqltTn = 0;
|
let avgInflAssctAftWqltTn = 0;
|
||||||
let avgInflAssctBfrWqltTp = 0;
|
let avgInflAssctBfrWqltTp = 0;
|
||||||
let avginflAssctBfrWqltToc = 0;
|
let avgInflAssctAftWqltToc = 0;
|
||||||
let avginflAssctBfrWqltSs = 0;
|
let avgInflAssctAftWqltSs = 0;
|
||||||
|
|
||||||
let avgTpInflWqltBod = 0;
|
let avgTpInflWqltBod = 0;
|
||||||
let avgTpInflWqltTp = 0;
|
let avgTpInflWqltTp = 0;
|
||||||
@@ -118,11 +118,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
const efflWqltToc = parseNumber(item.efflWqltToc);
|
const efflWqltToc = parseNumber(item.efflWqltToc);
|
||||||
const efflWqltSs = parseNumber(item.efflWqltSs);
|
const efflWqltSs = parseNumber(item.efflWqltSs);
|
||||||
|
|
||||||
const inflAssctBfrWqltBod = parseNumber(item.inflAssctBfrWqltBod);
|
const inflAssctAftWqltBod = parseNumber(item.inflAssctAftWqltBod);
|
||||||
const inflAssctBfrWqltTn = parseNumber(item.inflAssctBfrWqltTn);
|
const inflAssctAftWqltTn = parseNumber(item.inflAssctAftWqltTn);
|
||||||
const inflAssctBfrWqltTp = parseNumber(item.inflAssctBfrWqltTp);
|
const inflAssctBfrWqltTp = parseNumber(item.inflAssctBfrWqltTp);
|
||||||
const inflAssctBfrWqltToc = parseNumber(item.inflAssctBfrWqltToc);
|
const inflAssctAftWqltToc = parseNumber(item.inflAssctAftWqltToc);
|
||||||
const inflAssctBfrWqltSs = parseNumber(item.inflAssctBfrWqltSs);
|
const inflAssctAftWqltSs = parseNumber(item.inflAssctAftWqltSs);
|
||||||
|
|
||||||
|
|
||||||
const tpInflWqltBod = parseNumber(item.tpInflWqltBod);
|
const tpInflWqltBod = parseNumber(item.tpInflWqltBod);
|
||||||
@@ -136,11 +136,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
maxefflWqltToc = Math.max(maxefflWqltToc, efflWqltToc);
|
maxefflWqltToc = Math.max(maxefflWqltToc, efflWqltToc);
|
||||||
maxEfflWqltSs = Math.max(maxEfflWqltSs, efflWqltSs);
|
maxEfflWqltSs = Math.max(maxEfflWqltSs, efflWqltSs);
|
||||||
|
|
||||||
maxinflAssctBfrWqltBod = Math.max(maxinflAssctBfrWqltBod, inflAssctBfrWqltBod);
|
maxInflAssctAftWqltBod = Math.max(maxInflAssctAftWqltBod, inflAssctAftWqltBod);
|
||||||
maxinflAssctBfrWqltTn = Math.max(maxinflAssctBfrWqltTn, inflAssctBfrWqltTn);
|
maxInflAssctAftWqltTn = Math.max(maxInflAssctAftWqltTn, inflAssctAftWqltTn);
|
||||||
maxInflAssctBfrWqltTp = Math.max(maxInflAssctBfrWqltTp, inflAssctBfrWqltTp);
|
maxInflAssctBfrWqltTp = Math.max(maxInflAssctBfrWqltTp, inflAssctBfrWqltTp);
|
||||||
maxinflAssctBfrWqltToc = Math.max(maxinflAssctBfrWqltToc, inflAssctBfrWqltToc);
|
maxInflAssctAftWqltToc = Math.max(maxInflAssctAftWqltToc, inflAssctAftWqltToc);
|
||||||
maxinflAssctBfrWqltSs = Math.max(maxinflAssctBfrWqltSs, inflAssctBfrWqltSs);
|
maxInflAssctAftWqltSs = Math.max(maxInflAssctAftWqltSs, inflAssctAftWqltSs);
|
||||||
|
|
||||||
maxTpInflWqltBod = Math.max(maxTpInflWqltBod, tpInflWqltBod);
|
maxTpInflWqltBod = Math.max(maxTpInflWqltBod, tpInflWqltBod);
|
||||||
maxTpInflWqltTp = Math.max(maxTpInflWqltTp, tpInflWqltTp);
|
maxTpInflWqltTp = Math.max(maxTpInflWqltTp, tpInflWqltTp);
|
||||||
@@ -153,11 +153,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
minefflWqltToc = Math.min(minefflWqltToc, efflWqltToc);
|
minefflWqltToc = Math.min(minefflWqltToc, efflWqltToc);
|
||||||
minEfflWqltSs = Math.min(minEfflWqltSs, efflWqltSs);
|
minEfflWqltSs = Math.min(minEfflWqltSs, efflWqltSs);
|
||||||
|
|
||||||
mininflAssctBfrWqltBod = Math.min(mininflAssctBfrWqltBod, inflAssctBfrWqltBod);
|
minInflAssctAftWqltBod = Math.min(minInflAssctAftWqltBod, inflAssctAftWqltBod);
|
||||||
mininflAssctBfrWqltTn = Math.min(mininflAssctBfrWqltTn, inflAssctBfrWqltTn);
|
minInflAssctAftWqltTn = Math.min(minInflAssctAftWqltTn, inflAssctAftWqltTn);
|
||||||
minInflAssctBfrWqltTp = Math.min(minInflAssctBfrWqltTp, inflAssctBfrWqltTp);
|
minInflAssctBfrWqltTp = Math.min(minInflAssctBfrWqltTp, inflAssctBfrWqltTp);
|
||||||
mininflAssctBfrWqltToc = Math.min(mininflAssctBfrWqltToc, inflAssctBfrWqltToc);
|
minInflAssctAftWqltToc = Math.min(minInflAssctAftWqltToc, inflAssctAftWqltToc);
|
||||||
mininflAssctBfrWqltSs = Math.min(mininflAssctBfrWqltSs, inflAssctBfrWqltSs);
|
minInflAssctAftWqltSs = Math.min(minInflAssctAftWqltSs, inflAssctAftWqltSs);
|
||||||
|
|
||||||
minTpInflWqltBod = Math.min(minTpInflWqltBod, tpInflWqltBod);
|
minTpInflWqltBod = Math.min(minTpInflWqltBod, tpInflWqltBod);
|
||||||
minTpInflWqltTp = Math.min(minTpInflWqltTp, tpInflWqltTp);
|
minTpInflWqltTp = Math.min(minTpInflWqltTp, tpInflWqltTp);
|
||||||
@@ -170,11 +170,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
avgefflWqltToc += efflWqltToc;
|
avgefflWqltToc += efflWqltToc;
|
||||||
avgEfflWqltSs += efflWqltSs;
|
avgEfflWqltSs += efflWqltSs;
|
||||||
|
|
||||||
avginflAssctBfrWqltBod += inflAssctBfrWqltBod;
|
avgInflAssctAftWqltBod += inflAssctAftWqltBod;
|
||||||
avginflAssctBfrWqltTn += inflAssctBfrWqltTn;
|
avgInflAssctAftWqltTn += inflAssctAftWqltTn;
|
||||||
avgInflAssctBfrWqltTp += inflAssctBfrWqltTp;
|
avgInflAssctBfrWqltTp += inflAssctBfrWqltTp;
|
||||||
avginflAssctBfrWqltToc += inflAssctBfrWqltToc;
|
avgInflAssctAftWqltToc += inflAssctAftWqltToc;
|
||||||
avginflAssctBfrWqltSs += inflAssctBfrWqltSs;
|
avgInflAssctAftWqltSs += inflAssctAftWqltSs;
|
||||||
|
|
||||||
avgTpInflWqltBod += tpInflWqltBod;
|
avgTpInflWqltBod += tpInflWqltBod;
|
||||||
avgTpInflWqltTp += tpInflWqltTp;
|
avgTpInflWqltTp += tpInflWqltTp;
|
||||||
@@ -190,11 +190,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
efflWqltSs: filteredData.length==0?'0.0':(Math.round(avgEfflWqltSs / filteredData.length * 10) / 10).toFixed(1),
|
efflWqltSs: filteredData.length==0?'0.0':(Math.round(avgEfflWqltSs / filteredData.length * 10) / 10).toFixed(1),
|
||||||
efflWqltTn: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
|
efflWqltTn: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
|
||||||
efflWqltTp: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
|
efflWqltTp: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
|
||||||
inflAssctBfrWqltBod: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltBod / filteredData.length * 10) / 10).toFixed(1),
|
inflAssctAftWqltBod: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltBod / filteredData.length * 10) / 10).toFixed(1),
|
||||||
inflAssctBfrWqltTn: filteredData.length==0?'0.000':(Math.round(avginflAssctBfrWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
|
inflAssctAftWqltTn: filteredData.length==0?'0.000':(Math.round(avgInflAssctAftWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
|
||||||
inflAssctBfrWqltTp: filteredData.length==0?'0.000':(Math.round(avgInflAssctBfrWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
|
inflAssctBfrWqltTp: filteredData.length==0?'0.000':(Math.round(avgInflAssctBfrWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
|
||||||
inflAssctBfrWqltToc: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltToc / filteredData.length * 10) / 10).toFixed(1),
|
inflAssctAftWqltToc: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltToc / filteredData.length * 10) / 10).toFixed(1),
|
||||||
inflAssctBfrWqltSs: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltSs / filteredData.length * 10) / 10).toFixed(1),
|
inflAssctAftWqltSs: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltSs / filteredData.length * 10) / 10).toFixed(1),
|
||||||
bscFctCd: "",
|
bscFctCd: "",
|
||||||
bscFctNm: "",
|
bscFctNm: "",
|
||||||
lclgvrnmntNm: "",
|
lclgvrnmntNm: "",
|
||||||
@@ -213,11 +213,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
efflWqltSs : Math.round(maxEfflWqltSs * 10) / 10?(Math.round(maxEfflWqltSs * 10) / 10).toFixed(1):'0.0',
|
efflWqltSs : Math.round(maxEfflWqltSs * 10) / 10?(Math.round(maxEfflWqltSs * 10) / 10).toFixed(1):'0.0',
|
||||||
efflWqltTn : Math.round(maxEfflWqltTn * 1000) / 1000?(Math.round(maxEfflWqltTn * 1000) / 1000).toFixed(3):'0.000',
|
efflWqltTn : Math.round(maxEfflWqltTn * 1000) / 1000?(Math.round(maxEfflWqltTn * 1000) / 1000).toFixed(3):'0.000',
|
||||||
efflWqltTp : Math.round(maxEfflWqltTp * 1000) / 1000?(Math.round(maxEfflWqltTp * 1000) / 1000).toFixed(3):'0.000',
|
efflWqltTp : Math.round(maxEfflWqltTp * 1000) / 1000?(Math.round(maxEfflWqltTp * 1000) / 1000).toFixed(3):'0.000',
|
||||||
inflAssctBfrWqltBod : Math.round(maxinflAssctBfrWqltBod * 10) / 10?(Math.round(maxinflAssctBfrWqltBod * 10) / 10).toFixed(1):'0.0',
|
inflAssctAftWqltBod : Math.round(maxInflAssctAftWqltBod * 10) / 10?(Math.round(maxInflAssctAftWqltBod * 10) / 10).toFixed(1):'0.0',
|
||||||
inflAssctBfrWqltTn : Math.round(maxinflAssctBfrWqltTn * 1000) / 1000?(Math.round(maxinflAssctBfrWqltTn * 1000) / 1000).toFixed(3):'0.000',
|
inflAssctAftWqltTn : Math.round(maxInflAssctAftWqltTn * 1000) / 1000?(Math.round(maxInflAssctAftWqltTn * 1000) / 1000).toFixed(3):'0.000',
|
||||||
inflAssctBfrWqltTp : Math.round(maxInflAssctBfrWqltTp * 1000) / 1000?(Math.round(maxInflAssctBfrWqltTp * 1000) / 1000).toFixed(3):'0.000',
|
inflAssctBfrWqltTp : Math.round(maxInflAssctBfrWqltTp * 1000) / 1000?(Math.round(maxInflAssctBfrWqltTp * 1000) / 1000).toFixed(3):'0.000',
|
||||||
inflAssctBfrWqltToc : Math.round(maxinflAssctBfrWqltToc * 10) / 10?(Math.round(maxinflAssctBfrWqltToc * 10) / 10).toFixed(1):'0.0',
|
inflAssctAftWqltToc : Math.round(maxInflAssctAftWqltToc * 10) / 10?(Math.round(maxInflAssctAftWqltToc * 10) / 10).toFixed(1):'0.0',
|
||||||
inflAssctBfrWqltSs : Math.round(maxinflAssctBfrWqltSs * 10) / 10?(Math.round(maxinflAssctBfrWqltSs * 10) / 10).toFixed(1):'0.0',
|
inflAssctAftWqltSs : Math.round(maxInflAssctAftWqltSs * 10) / 10?(Math.round(maxInflAssctAftWqltSs * 10) / 10).toFixed(1):'0.0',
|
||||||
bscFctCd: "",
|
bscFctCd: "",
|
||||||
bscFctNm: "",
|
bscFctNm: "",
|
||||||
lclgvrnmntNm: "",
|
lclgvrnmntNm: "",
|
||||||
@@ -236,11 +236,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
efflWqltSs : Math.round(minEfflWqltSs * 10) / 10?(Math.round(minEfflWqltSs * 10) / 10).toFixed(1) : '0.0',
|
efflWqltSs : Math.round(minEfflWqltSs * 10) / 10?(Math.round(minEfflWqltSs * 10) / 10).toFixed(1) : '0.0',
|
||||||
efflWqltTn : Math.round(minEfflWqltTn * 1000) / 1000?(Math.round(minEfflWqltTn * 1000) / 1000).toFixed(3) : '0.000',
|
efflWqltTn : Math.round(minEfflWqltTn * 1000) / 1000?(Math.round(minEfflWqltTn * 1000) / 1000).toFixed(3) : '0.000',
|
||||||
efflWqltTp : Math.round(minEfflWqltTp * 1000) / 1000?(Math.round(minEfflWqltTp * 1000) / 1000).toFixed(3) : '0.000',
|
efflWqltTp : Math.round(minEfflWqltTp * 1000) / 1000?(Math.round(minEfflWqltTp * 1000) / 1000).toFixed(3) : '0.000',
|
||||||
inflAssctBfrWqltBod : Math.round(mininflAssctBfrWqltBod * 10) / 10?(Math.round(mininflAssctBfrWqltBod * 10) / 10).toFixed(1) : '0.0',
|
inflAssctAftWqltBod : Math.round(minInflAssctAftWqltBod * 10) / 10?(Math.round(minInflAssctAftWqltBod * 10) / 10).toFixed(1) : '0.0',
|
||||||
inflAssctBfrWqltTn : Math.round(mininflAssctBfrWqltTn * 1000) / 1000?(Math.round(mininflAssctBfrWqltTn * 1000) / 1000).toFixed(3) : '0.000',
|
inflAssctAftWqltTn : Math.round(minInflAssctAftWqltTn * 1000) / 1000?(Math.round(minInflAssctAftWqltTn * 1000) / 1000).toFixed(3) : '0.000',
|
||||||
inflAssctBfrWqltTp : Math.round(minInflAssctBfrWqltTp * 1000) / 1000?(Math.round(minInflAssctBfrWqltTp * 1000) / 1000).toFixed(3) : '0.000',
|
inflAssctBfrWqltTp : Math.round(minInflAssctBfrWqltTp * 1000) / 1000?(Math.round(minInflAssctBfrWqltTp * 1000) / 1000).toFixed(3) : '0.000',
|
||||||
inflAssctBfrWqltToc : Math.round(mininflAssctBfrWqltToc * 10) / 10?(Math.round(mininflAssctBfrWqltToc * 10) / 10).toFixed(1) : '0.0',
|
inflAssctAftWqltToc : Math.round(minInflAssctAftWqltToc * 10) / 10?(Math.round(minInflAssctAftWqltToc * 10) / 10).toFixed(1) : '0.0',
|
||||||
inflAssctBfrWqltSs : Math.round(mininflAssctBfrWqltSs * 10) / 10?(Math.round(mininflAssctBfrWqltSs * 10) / 10).toFixed(1) : '0.0',
|
inflAssctAftWqltSs : Math.round(minInflAssctAftWqltSs * 10) / 10?(Math.round(minInflAssctAftWqltSs * 10) / 10).toFixed(1) : '0.0',
|
||||||
bscFctCd: "",
|
bscFctCd: "",
|
||||||
bscFctNm: "",
|
bscFctNm: "",
|
||||||
lclgvrnmntNm: "",
|
lclgvrnmntNm: "",
|
||||||
@@ -293,10 +293,10 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
|||||||
copyYearList.forEach((item) => {
|
copyYearList.forEach((item) => {
|
||||||
excelDownList.push({
|
excelDownList.push({
|
||||||
날짜: item.msrDt,
|
날짜: item.msrDt,
|
||||||
"유입BOD(mg/L)": item.inflAssctBfrWqltBod,
|
"유입BOD(mg/L)": item.inflAssctAftWqltBod,
|
||||||
"유입TOC(COD)(mg/L)": item.inflAssctBfrWqltToc,
|
"유입TOC(COD)(mg/L)": item.inflAssctAftWqltToc,
|
||||||
"유입SS(mg/L)": item.inflAssctBfrWqltSs,
|
"유입SS(mg/L)": item.inflAssctAftWqltSs,
|
||||||
"유입TN(mg/L)": item.inflAssctBfrWqltTn,
|
"유입TN(mg/L)": item.inflAssctAftWqltTn,
|
||||||
"유입TP(mg/L)": item.inflAssctBfrWqltTp,
|
"유입TP(mg/L)": item.inflAssctBfrWqltTp,
|
||||||
"유출BOD(mg/L)": item.efflWqltBod,
|
"유출BOD(mg/L)": item.efflWqltBod,
|
||||||
"유출TOC(COD)(mg/L)": item.efflWqltToc,
|
"유출TOC(COD)(mg/L)": item.efflWqltToc,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import WaterQualityModal from "./modal/page";
|
import WaterQualityModal from "./modal/page";
|
||||||
import type { FacilityWaterQltyProps } from "@/app/store/facilityWaterQlty";
|
import type { FacilityWaterQltyProps } from "@/app/store/facilityWaterQlty";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function ProcessFacilitySearch() {
|
export default function ProcessFacilitySearch() {
|
||||||
const { Common
|
const { Common
|
||||||
@@ -37,8 +36,7 @@ export default function ProcessFacilitySearch() {
|
|||||||
upHeadList3,
|
upHeadList3,
|
||||||
facilityWaterQltyList,
|
facilityWaterQltyList,
|
||||||
facilityWaterQltyCount,
|
facilityWaterQltyCount,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = FacilityWaterQltyMain;
|
} = FacilityWaterQltyMain;
|
||||||
|
|
||||||
const mainList: FacilityWaterQltyProps[] = facilityWaterQltyList || [];
|
const mainList: FacilityWaterQltyProps[] = facilityWaterQltyList || [];
|
||||||
@@ -50,7 +48,8 @@ export default function ProcessFacilitySearch() {
|
|||||||
const [upheadList, setUpheadList] = useState<TableUpperProps[]>(upHeadList1);
|
const [upheadList, setUpheadList] = useState<TableUpperProps[]>(upHeadList1);
|
||||||
const [fcltyName, setFcltyName] = useState<string>("");
|
const [fcltyName, setFcltyName] = useState<string>("");
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
const [searchYearValue, setSearchYearValue] = useState<string>(selectSearchYear[0]?.val || "0");
|
//const [searchYearValue, setSearchYearValue] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYearValue, setSearchYearValue] = useState<string>("2023");
|
||||||
const [fcltCpct, setFcltCpct] = useState<string>("0");
|
const [fcltCpct, setFcltCpct] = useState<string>("0");
|
||||||
|
|
||||||
// 모달 상태 추가
|
// 모달 상태 추가
|
||||||
@@ -134,7 +133,7 @@ export default function ProcessFacilitySearch() {
|
|||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0");
|
searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchFacilityWaterQltyList]);
|
}, [isInit, initializeCommonData, searchFacilityWaterQltyList, selectSearchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -188,7 +187,6 @@ export default function ProcessFacilitySearch() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false} />
|
ref={ref} isAdmin={false} />
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 수질현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total<10?facilityWaterQltyList.length:total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 수질현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total<10?facilityWaterQltyList.length:total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
|||||||
return Number(value.replace(/,/g, ''));
|
return Number(value.replace(/,/g, ''));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('filteredData : ', filteredData);
|
||||||
let maxtotInflAmnt = 0;
|
let maxtotInflAmnt = 0;
|
||||||
let maxinflAmnt = 0;
|
let maxinflAmnt = 0;
|
||||||
let maxsumFlow = 0;
|
let maxsumFlow = 0;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import FlowRateModal from "./modal/page";
|
import FlowRateModal from "./modal/page";
|
||||||
import type { ExcelType } from "@/app/store/flowRate";
|
import type { ExcelType } from "@/app/store/flowRate";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function ProcessFacilitySearch() {
|
export default function ProcessFacilitySearch() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -43,15 +42,15 @@ export default function ProcessFacilitySearch() {
|
|||||||
upHeadList3,
|
upHeadList3,
|
||||||
flowRateList,
|
flowRateList,
|
||||||
flowRateCount,
|
flowRateCount,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = FlowRateList;
|
} = FlowRateList;
|
||||||
|
|
||||||
// 입력값 상태 관리
|
// 입력값 상태 관리
|
||||||
const [fcltCpct, setFcltCpct] = useState<string>("0");
|
const [fcltCpct, setFcltCpct] = useState<string>("0");
|
||||||
const [fcltyName, setFcltyName] = useState<string>("");
|
const [fcltyName, setFcltyName] = useState<string>("");
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
const [searchYearValue, setSearchYearValue] = useState<string>(selectSearchYear[0]?.val || "0");
|
//const [searchYearValue, setSearchYearValue] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYearValue, setSearchYearValue] = useState<string>("2023");
|
||||||
const [widthSize, setWidthSize] = useState<string>("w-[120%]");
|
const [widthSize, setWidthSize] = useState<string>("w-[120%]");
|
||||||
const [upheadList, setUpheadList] = useState<TableUpperProps[]>(upHeadList1);
|
const [upheadList, setUpheadList] = useState<TableUpperProps[]>(upHeadList1);
|
||||||
const [resetPage, setResetPage] = useState<boolean>(false);
|
const [resetPage, setResetPage] = useState<boolean>(false);
|
||||||
@@ -90,9 +89,9 @@ export default function ProcessFacilitySearch() {
|
|||||||
setWidthSize("w-[120%]");
|
setWidthSize("w-[120%]");
|
||||||
setUpheadList(upHeadList1)
|
setUpheadList(upHeadList1)
|
||||||
// 상태값 설정
|
// 상태값 설정
|
||||||
setSearchYearValue(selectSearchYear[0]?.val || "0");
|
|
||||||
setFcltCpct(selectUpdownData[0]?.val || "0");
|
setFcltCpct(selectUpdownData[0]?.val || "0");
|
||||||
setOperationValue(selectOperationData[0]?.val || "0");
|
setOperationValue(selectOperationData[0]?.val || "0");
|
||||||
|
setSearchYearValue(selectSearchYear[0]?.val || "0");
|
||||||
// SearchInputSelect 초기화
|
// SearchInputSelect 초기화
|
||||||
setFcltyName("");
|
setFcltyName("");
|
||||||
if (searchInputRef.current) {
|
if (searchInputRef.current) {
|
||||||
@@ -127,10 +126,11 @@ export default function ProcessFacilitySearch() {
|
|||||||
// 시도 데이터 초기화
|
// 시도 데이터 초기화
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(!isInit) {
|
if(!isInit) {
|
||||||
|
console.log('searchYearValue', searchYearValue, isInit);
|
||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchFlowRateList(1, 10, selectSearchYear[0]?.val || "0");
|
searchFlowRateList(1, 10, searchYearValue || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchFlowRateList]);
|
}, [isInit, initializeCommonData, searchFlowRateList, searchYearValue]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -189,7 +189,6 @@ export default function ProcessFacilitySearch() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false} />
|
ref={ref} isAdmin={false} />
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 유량현황"} tableData={flowRateList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"시설별 유량현황"} tableData={flowRateList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -13,11 +13,7 @@ interface FeatureData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface MapInstance {
|
interface MapInstance {
|
||||||
getLayers: () => {
|
getLayers: () => { getArray: () => Array<{ getSource?: () => { getFeatureById?: (id: string) => FeatureData | null } }> };
|
||||||
getArray: () => Array<{
|
|
||||||
getSource?: () => { getFeatureById?: (id: string) => FeatureData | null };
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
getView: () => { fit: (extent: number[], options: object) => void };
|
getView: () => { fit: (extent: number[], options: object) => void };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,20 +26,20 @@ const Map = () => {
|
|||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}/v1/map`;
|
const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}/v1/map`
|
||||||
const reqUrl = `${API_URL}/lyrStngs/FO_NETWORK`;
|
const reqUrl = `${API_URL}/lyrStngs/FO_NETWORK`;
|
||||||
const response = await fetch(reqUrl, {
|
const response = await fetch(reqUrl, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
accept: "application/json",
|
accept: "application/json",
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP 오류! 상태: ${response.status}`);
|
throw new Error(`HTTP 오류! 상태: ${response.status}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json(); // 여기서 json 파싱
|
const data = await response.json(); // 여기서 json 파싱
|
||||||
setTreeData(data); // 데이터 설정
|
setTreeData(data); // 데이터 설정
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("데이터 불러오기 실패:", error);
|
console.error("데이터 불러오기 실패:", error);
|
||||||
@@ -64,12 +60,7 @@ const Map = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 항상 같은 select 객체 사용
|
// 항상 같은 select 객체 사용
|
||||||
const select = GisApp.Module.select as unknown as
|
const select = (GisApp.Module.select as unknown) as { resetSelectedFeature: () => void; selectFeature: (feature: FeatureData, selected: boolean) => void } | undefined;
|
||||||
| {
|
|
||||||
resetSelectedFeature: () => void;
|
|
||||||
selectFeature: (feature: FeatureData, selected: boolean) => void;
|
|
||||||
}
|
|
||||||
| undefined;
|
|
||||||
if (!select) return;
|
if (!select) return;
|
||||||
|
|
||||||
// 1. 기존 선택 초기화
|
// 1. 기존 선택 초기화
|
||||||
@@ -124,12 +115,9 @@ const Map = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// onCheckedLayersChange handler
|
// onCheckedLayersChange handler
|
||||||
const handleCheckedLayersChange = (
|
const handleCheckedLayersChange = (checkedIds: string[], checkedNodesData: unknown[]) => {
|
||||||
checkedIds: string[],
|
|
||||||
checkedNodesData: unknown[]
|
|
||||||
) => {
|
|
||||||
// Handle checked layers change if needed
|
// Handle checked layers change if needed
|
||||||
console.log("Checked layers changed:", checkedIds, checkedNodesData);
|
console.log('Checked layers changed:', checkedIds, checkedNodesData);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -149,8 +137,6 @@ const Map = () => {
|
|||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
isSearchModalOpen={isSearchModalOpen}
|
isSearchModalOpen={isSearchModalOpen}
|
||||||
onCheckedLayersChange={handleCheckedLayersChange}
|
onCheckedLayersChange={handleCheckedLayersChange}
|
||||||
imgVisble={false}
|
|
||||||
searchBar={undefined}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { TableUpperProps } from "@/app/store/common";
|
|||||||
import { downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components";
|
import { downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function PlanSewage() {
|
export default function PlanSewage() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -38,8 +37,7 @@ export default function PlanSewage() {
|
|||||||
upHeadList3,
|
upHeadList3,
|
||||||
planSewageList,
|
planSewageList,
|
||||||
planSewageCount,
|
planSewageCount,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = PlanSewage;
|
} = PlanSewage;
|
||||||
|
|
||||||
const ref = useRef<ReturnType>({
|
const ref = useRef<ReturnType>({
|
||||||
@@ -72,7 +70,8 @@ export default function PlanSewage() {
|
|||||||
// 시설상태
|
// 시설상태
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
// 조회기간
|
// 조회기간
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
//const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYear, setSearchYear] = useState<string>("2023");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 페이지 함수
|
* 페이지 함수
|
||||||
@@ -93,7 +92,6 @@ export default function PlanSewage() {
|
|||||||
input.value = "";
|
input.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchPlanSewageList(1, 10, selectSearchYear[0]?.val || "0", ref.current.partValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,9 +100,9 @@ export default function PlanSewage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isInit) {
|
if (!isInit) {
|
||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchPlanSewageList(1, 10, selectSearchYear[0]?.val || "0", ref.current.partValue);
|
searchPlanSewageList(1, 10, searchYear, ref.current.partValue);
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchPlanSewageList]);
|
}, [isInit, initializeCommonData, searchYear, searchPlanSewageList]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('excelList' , excelList);
|
console.log('excelList' , excelList);
|
||||||
@@ -189,7 +187,6 @@ export default function PlanSewage() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false}/>
|
ref={ref} isAdmin={false}/>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={ undefined } headName={"계획하수량 산정지표 현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={ undefined } headName={"계획하수량 산정지표 현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SelectBox, Title,
|
|||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import ProcessFacilityInfoModal from "./modal/page";
|
import ProcessFacilityInfoModal from "./modal/page";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function ProcessArea() {
|
export default function ProcessArea() {
|
||||||
const {Common,
|
const {Common,
|
||||||
@@ -40,8 +39,7 @@ export default function ProcessArea() {
|
|||||||
upHeadList1,
|
upHeadList1,
|
||||||
processAreaList,
|
processAreaList,
|
||||||
processAreaCount,
|
processAreaCount,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = ProcessArea;
|
} = ProcessArea;
|
||||||
|
|
||||||
const mainList: Record<string, unknown>[] = processAreaList || [];
|
const mainList: Record<string, unknown>[] = processAreaList || [];
|
||||||
@@ -86,7 +84,7 @@ export default function ProcessArea() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setSearchYearValue(selectSearchYear[0]?.val || "0");
|
setSearchYearValue(selectSearchYear[0]?.val || "0");
|
||||||
searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val || "0");
|
searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 셀 클릭 시 모달 표시
|
// 셀 클릭 시 모달 표시
|
||||||
@@ -106,9 +104,9 @@ export default function ProcessArea() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isInit) {
|
if (!isInit) {
|
||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val || "0");
|
searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val);
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchProcessAreaList]);
|
}, [isInit, initializeCommonData, searchProcessAreaList, selectSearchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -154,7 +152,6 @@ export default function ProcessArea() {
|
|||||||
isAdmin={true}
|
isAdmin={true}
|
||||||
/>
|
/>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className="w-[180%]">
|
<div className="w-[180%]">
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"처리구역정보"} tableData={mainList} headlist={upHeadList1} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"처리구역정보"} tableData={mainList} headlist={upHeadList1} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, Selec
|
|||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import ProcessFacilityInfoModal from "./modal/page";
|
import ProcessFacilityInfoModal from "./modal/page";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function ProcessFacilitySearch() {
|
export default function ProcessFacilitySearch() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -64,8 +63,7 @@ export default function ProcessFacilitySearch() {
|
|||||||
upHeadList1,
|
upHeadList1,
|
||||||
upHeadList2,
|
upHeadList2,
|
||||||
upHeadList3,
|
upHeadList3,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = ProcessFacilityList;
|
} = ProcessFacilityList;
|
||||||
|
|
||||||
const processFacilityList = ProcessFacilityList?.processFacilityList || [];
|
const processFacilityList = ProcessFacilityList?.processFacilityList || [];
|
||||||
@@ -264,7 +262,6 @@ export default function ProcessFacilitySearch() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false} />
|
ref={ref} isAdmin={false} />
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable
|
<UiTable
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { TableUpperProps } from "@/app/store/common";
|
|||||||
import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components";
|
import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function Rdi() {
|
export default function Rdi() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -39,7 +38,6 @@ export default function Rdi() {
|
|||||||
rdiList,
|
rdiList,
|
||||||
rdiCount,
|
rdiCount,
|
||||||
excelList,
|
excelList,
|
||||||
isLoading,
|
|
||||||
} = Rdi;
|
} = Rdi;
|
||||||
|
|
||||||
const ref = useRef<ReturnType>({
|
const ref = useRef<ReturnType>({
|
||||||
@@ -72,10 +70,6 @@ export default function Rdi() {
|
|||||||
// 조회기간
|
// 조회기간
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(isLoading);
|
|
||||||
}, [isLoading]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 페이지 함수
|
* 페이지 함수
|
||||||
*/
|
*/
|
||||||
@@ -97,6 +91,7 @@ export default function Rdi() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
|
searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +102,7 @@ export default function Rdi() {
|
|||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
|
searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchRdiList]);
|
}, [isInit, initializeCommonData, searchRdiList, selectSearchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -192,7 +187,6 @@ export default function Rdi() {
|
|||||||
initClick={resetVal}
|
initClick={resetVal}
|
||||||
ref={ref} isAdmin={false} />
|
ref={ref} isAdmin={false} />
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={ undefined } headName={"RDII추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={ undefined } headName={"RDII추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
|
|||||||
setDetailList(gridListSewageOccurDetail);
|
setDetailList(gridListSewageOccurDetail);
|
||||||
}, [gridListSewageOccurDetail]);
|
}, [gridListSewageOccurDetail]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
searchSewageOccurDetailList(props.facilityCd, validSearchYear, startYearMonth, endYearMonth);
|
|
||||||
}, [startYearMonth, endYearMonth]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ListDiv className="!h-[80px] !mt-10">
|
<ListDiv className="!h-[80px] !mt-10">
|
||||||
@@ -62,7 +57,6 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={1900}
|
startYear={1900}
|
||||||
yearReadOnly={true}
|
|
||||||
/>~
|
/>~
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
field={{
|
field={{
|
||||||
@@ -80,7 +74,6 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={1900}
|
startYear={1900}
|
||||||
yearReadOnly={true}
|
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import SewageOccurModal from "./modal/page";
|
import SewageOccurModal from "./modal/page";
|
||||||
import type { SewageOccurProps } from "@/app/store/sewageOccur";
|
import type { SewageOccurProps } from "@/app/store/sewageOccur";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function PlanSewage() {
|
export default function PlanSewage() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -47,8 +46,7 @@ export default function PlanSewage() {
|
|||||||
upHeadList3,
|
upHeadList3,
|
||||||
sewageOccurList,
|
sewageOccurList,
|
||||||
sewageOccurCount,
|
sewageOccurCount,
|
||||||
excelList,
|
excelList
|
||||||
isLoading,
|
|
||||||
} = SewageOccur;
|
} = SewageOccur;
|
||||||
|
|
||||||
const ref = useRef<ReturnType>({
|
const ref = useRef<ReturnType>({
|
||||||
@@ -86,7 +84,8 @@ export default function PlanSewage() {
|
|||||||
// 시설상태
|
// 시설상태
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
// 조회기간
|
// 조회기간
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
// const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYear, setSearchYear] = useState<string>("2023");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 페이지 함수
|
* 페이지 함수
|
||||||
@@ -107,7 +106,6 @@ export default function PlanSewage() {
|
|||||||
input.value = "";
|
input.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchSewageOccurList(1, 10, selectSearchYear[0]?.val || "0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 모달 닫기
|
// 모달 닫기
|
||||||
@@ -130,9 +128,9 @@ export default function PlanSewage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isInit) {
|
if (!isInit) {
|
||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchSewageOccurList(1, 10, selectSearchYear[0]?.val || "0");
|
searchSewageOccurList(1, 10, searchYear || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchSewageOccurList]);
|
}, [isInit, initializeCommonData, searchSewageOccurList, searchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -219,7 +217,6 @@ export default function PlanSewage() {
|
|||||||
isAdmin={false}
|
isAdmin={false}
|
||||||
/>
|
/>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"오수발생량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"오수발생량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}
|
}
|
||||||
}, [searchYear, tabTerm]);
|
}, [searchYear, tabTerm]);
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
console.log(fcltyName, searchYear);
|
||||||
unserWaterModal(fcltyName, searchYear);
|
unserWaterModal(fcltyName, searchYear);
|
||||||
}, [])
|
}, [])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -163,7 +164,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
/>
|
/>
|
||||||
<h3 className="justify-center px-5">~</h3>
|
<h3 className="justify-center px-5">~</h3>
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
@@ -175,7 +175,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -228,8 +227,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
enableMonth={['6월', '7월', '8월']}
|
|
||||||
/>
|
/>
|
||||||
<h3 className="justify-center px-5">~</h3>
|
<h3 className="justify-center px-5">~</h3>
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
@@ -241,8 +238,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
enableMonth={['6월', '7월', '8월']}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -286,8 +281,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
enableMonth={['1월', '2월']}
|
|
||||||
/>
|
/>
|
||||||
<h3 className="justify-center px-5">~</h3>
|
<h3 className="justify-center px-5">~</h3>
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
@@ -299,8 +292,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
|||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={Number(searchYear)} // 시작 연도 설정
|
startYear={Number(searchYear)} // 시작 연도 설정
|
||||||
yearReadOnly={true}
|
|
||||||
enableMonth={['1월', '2월']}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import UnderWaterInputModal from "./modal/page";
|
import UnderWaterInputModal from "./modal/page";
|
||||||
import type { UnderWaterProps } from "@/app/store/underWaterInput/types";
|
import type { UnderWaterProps } from "@/app/store/underWaterInput/types";
|
||||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
|
||||||
|
|
||||||
export default function UnderWaterInput() {
|
export default function UnderWaterInput() {
|
||||||
const {Common
|
const {Common
|
||||||
@@ -47,7 +46,6 @@ export default function UnderWaterInput() {
|
|||||||
underWaterList,
|
underWaterList,
|
||||||
underWaterCount,
|
underWaterCount,
|
||||||
excelList,
|
excelList,
|
||||||
isLoading,
|
|
||||||
} = UnderWater;
|
} = UnderWater;
|
||||||
|
|
||||||
const ref = useRef<ReturnType>({
|
const ref = useRef<ReturnType>({
|
||||||
@@ -84,7 +82,8 @@ export default function UnderWaterInput() {
|
|||||||
// 시설상태
|
// 시설상태
|
||||||
const [operationValue, setOperationValue] = useState<string>("0");
|
const [operationValue, setOperationValue] = useState<string>("0");
|
||||||
// 조회기간
|
// 조회기간
|
||||||
const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
//const [searchYear, setSearchYear] = useState<string>(selectSearchYear[0]?.val || "0");
|
||||||
|
const [searchYear, setSearchYear] = useState<string>("2023");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 페이지 함수
|
* 페이지 함수
|
||||||
@@ -129,7 +128,7 @@ export default function UnderWaterInput() {
|
|||||||
initializeCommonData();
|
initializeCommonData();
|
||||||
searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0");
|
searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0");
|
||||||
}
|
}
|
||||||
}, [isInit, initializeCommonData, searchUnderWaterList]);
|
}, [isInit, initializeCommonData, searchUnderWaterList, selectSearchYear]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelList && excelList.length > 0) {
|
if (excelList && excelList.length > 0) {
|
||||||
@@ -216,7 +215,6 @@ export default function UnderWaterInput() {
|
|||||||
isAdmin={false}
|
isAdmin={false}
|
||||||
/>
|
/>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
|
||||||
<div className="h-full w-full overflow-x-scroll">
|
<div className="h-full w-full overflow-x-scroll">
|
||||||
<div className={widthSize}>
|
<div className={widthSize}>
|
||||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"지하수유입량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"지하수유입량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* 보편적으로 쓰는 store 공간
|
* 보편적으로 쓰는 store 공간
|
||||||
====================================**/
|
====================================**/
|
||||||
|
|
||||||
import { getFetch, getFetchAreaList } from "@/app/components/api";
|
import { getFetch } from "@/app/components/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* STORE - TYPE
|
* STORE - TYPE
|
||||||
@@ -205,28 +205,6 @@ const selectMiddleRegionData: SelectDataType[] = [
|
|||||||
* STORE - API
|
* STORE - API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 처리시설 계획정보 호출 (알에스원)
|
|
||||||
export const planInfoUrl = 'https://apigateway.apps.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy';
|
|
||||||
|
|
||||||
export const fetchPlanInfo = async (targetYear : string | undefined, ctpvNm : string | undefined, sggNm : string | undefined, fcltyCd : string | undefined) => {
|
|
||||||
try {
|
|
||||||
const baseUrl = planInfoUrl;
|
|
||||||
const queryParams = new URLSearchParams();
|
|
||||||
if (ctpvNm && ctpvNm !== '전체') queryParams.append('ctpvNm', ctpvNm);
|
|
||||||
if (sggNm && sggNm !== '전체') queryParams.append('sggNm', sggNm);
|
|
||||||
if (targetYear) queryParams.append('targetYear',targetYear);
|
|
||||||
if (fcltyCd) queryParams.append('swtrmtFcltCd', fcltyCd);
|
|
||||||
const queryString = queryParams.toString();
|
|
||||||
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
|
||||||
const res = await getFetchAreaList(url);
|
|
||||||
return res;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('처리시설 계획정보를 가져오는데 실패했습니다:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 시도 API 호출 함수 추가
|
// 시도 API 호출 함수 추가
|
||||||
const fetchSidoData = async (): Promise<SelectDataType[]> => {
|
const fetchSidoData = async (): Promise<SelectDataType[]> => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
* Store - 타입
|
* Store - 타입
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getFetch } from "@/app/components/api";
|
import { getFetch, getFetchAreaList } from "@/app/components/api";
|
||||||
import DataForm from "@/app/components/common/DataForm";
|
import DataForm from "@/app/components/common/DataForm";
|
||||||
import { fetchPlanInfo } from "../common";
|
|
||||||
import type { FacilityWaterQltyProps } from "../facilityWaterQlty";
|
import type { FacilityWaterQltyProps } from "../facilityWaterQlty";
|
||||||
import { calRainEffectDay, type ApiResponse, type FlowDataItem } from "../underWaterInput";
|
|
||||||
|
|
||||||
// selectBox
|
// selectBox
|
||||||
export type SelectDataType = {
|
export type SelectDataType = {
|
||||||
@@ -113,13 +111,13 @@ export interface RainManageListProps {
|
|||||||
sggNm?: string,
|
sggNm?: string,
|
||||||
addr?: string,
|
addr?: string,
|
||||||
fctCpc?: number,
|
fctCpc?: number,
|
||||||
inflAssctBfrWqltBod: number | '',
|
inflAssctAftWqltBod: number | '',
|
||||||
inflAssctBfrWqltToc: number | '',
|
inflAssctAftWqltToc: number | '',
|
||||||
inflAssctBfrWqltSs: number | '',
|
inflAssctAftWqltSs: number | '',
|
||||||
inflAssctBfrWqltTn: number | '',
|
inflAssctAftWqltTn: number | '',
|
||||||
inflAssctBfrWqltTp: number | '',
|
inflAssctAftWqltTp: number | '',
|
||||||
efflWqltBod: number | '',
|
efflWqltBod: number | '',
|
||||||
efflWqltToc: number | '',
|
efflWqltCod: number | '',
|
||||||
efflWqltSs: number | '',
|
efflWqltSs: number | '',
|
||||||
efflWqltTn: number | '',
|
efflWqltTn: number | '',
|
||||||
efflWqltTp: number | '',
|
efflWqltTp: number | '',
|
||||||
@@ -145,7 +143,6 @@ export interface RainManageListProps {
|
|||||||
dsInflWqltTn: number | '',
|
dsInflWqltTn: number | '',
|
||||||
dsInflWqltTp: number | '',
|
dsInflWqltTp: number | '',
|
||||||
extnsSeqno?: number | '',
|
extnsSeqno?: number | '',
|
||||||
rainEffectDay?: number | '',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RainManageExcelType {
|
export interface RainManageExcelType {
|
||||||
@@ -367,14 +364,14 @@ const upHeadListRainManage : TableUpperProps[] = [
|
|||||||
{ id: "dsInflWqltTn", title: "T-N", row:1 },
|
{ id: "dsInflWqltTn", title: "T-N", row:1 },
|
||||||
{ id: "dsInflWqltTp", title: "T-P", row:1 },
|
{ id: "dsInflWqltTp", title: "T-P", row:1 },
|
||||||
{ id: "C", title: "유입수질(㎎/L)", row:0, colSpan:5 },
|
{ id: "C", title: "유입수질(㎎/L)", row:0, colSpan:5 },
|
||||||
{ id: "inflAssctBfrWqltBod", title: "BOD", row:1 },
|
{ id: "inflAssctAftWqltBod", title: "BOD", row:1 },
|
||||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)", row:1 },
|
{ id: "inflAssctAftWqltToc", title: "TOC\n(COD)", row:1 },
|
||||||
{ id: "inflAssctBfrWqltSs", title: "SS", row:1 },
|
{ id: "inflAssctAftWqltSs", title: "SS", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTn", title: "T-N", row:1 },
|
{ id: "inflAssctAftWqltTn", title: "T-N", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTp", title: "T-P", row:1 },
|
{ id: "inflAssctAftWqltTp", title: "T-P", row:1 },
|
||||||
{ id: "D", title: "방류수질(㎎/L)", row:0, colSpan:5 },
|
{ id: "D", title: "방류수질(㎎/L)", row:0, colSpan:5 },
|
||||||
{ id: "efflWqltBod", title: "BOD", row:1 },
|
{ id: "efflWqltBod", title: "BOD", row:1 },
|
||||||
{ id: "efflWqltToc", title: "TOC\n(COD)", row:1 },
|
{ id: "efflWqltCod", title: "TOC\n(COD)", row:1 },
|
||||||
{ id: "efflWqltSs", title: "SS", row:1 },
|
{ id: "efflWqltSs", title: "SS", row:1 },
|
||||||
{ id: "efflWqltTn", title: "T-N", row:1 },
|
{ id: "efflWqltTn", title: "T-N", row:1 },
|
||||||
{ id: "efflWqltTp", title: "T-P", row:1 },
|
{ id: "efflWqltTp", title: "T-P", row:1 },
|
||||||
@@ -690,20 +687,20 @@ const drainageEquipmentList : DrainageEquipmentListProps[] = [
|
|||||||
* Store - api (데이터 호출)
|
* Store - api (데이터 호출)
|
||||||
====================================*/
|
====================================*/
|
||||||
/* 시설정보 및 운영현황 - 계획 */
|
/* 시설정보 및 운영현황 - 계획 */
|
||||||
const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined, set : (fn: (state: DashBoardType) => DashBoardType) => void) => {
|
const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetchPlanInfo(undefined, undefined, undefined, fcltyCd);
|
targetYear = targetYear ? targetYear : "2023";
|
||||||
return res;
|
const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy';
|
||||||
|
const queryParams = new URLSearchParams();
|
||||||
|
|
||||||
|
if (fcltyCd) queryParams.append('swtrmtFcltCd', fcltyCd);
|
||||||
|
//if (targetYear) queryParams.append('targetYear',targetYear);
|
||||||
|
const queryString = queryParams.toString();
|
||||||
|
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
||||||
|
const res = await getFetchAreaList(url);
|
||||||
|
return res
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
||||||
set((state) => ({
|
|
||||||
...state,
|
|
||||||
PlanFclty : {
|
|
||||||
...state.PlanFclty,
|
|
||||||
isLoadingPlanFclty : false,
|
|
||||||
isLoadingOperationStatus : false
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
return {data: [], count: 0};
|
return {data: [], count: 0};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -732,6 +729,20 @@ const fetchMainGraph = async (searchYear: string|undefined, fcltyCd: string|unde
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 배수설비 정비현황
|
||||||
|
const fetchDrainageEquipment = async (searchYear: string|undefined, fcltyCd: string|undefined) => {
|
||||||
|
try{
|
||||||
|
/* const url = '/fclt/qlty/hist/' + (searchYear?searchYear:'2024') + '/' + (fcltyCd?fcltyCd:'11680PB001R');
|
||||||
|
const res = await getFetch('fo', url);
|
||||||
|
return { data: res.data, count: res.count } */
|
||||||
|
console.log(searchYear, fcltyCd);
|
||||||
|
return { data : drainageEquipmentList, count : drainageEquipmentList.length }
|
||||||
|
} catch (error) {
|
||||||
|
console.error('배수설비 정비현황 데이터를 가져오는데 실패했습니다:', error);
|
||||||
|
return { data: [], count: 0 };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - action
|
* Store - action
|
||||||
====================================*/
|
====================================*/
|
||||||
@@ -745,6 +756,8 @@ export type DashBoardActions = {
|
|||||||
searchMainGraph(searchYear: string, fcltyCd: string): Promise<void>;
|
searchMainGraph(searchYear: string, fcltyCd: string): Promise<void>;
|
||||||
/**강우일 운영현황 */
|
/**강우일 운영현황 */
|
||||||
searchRainManage(searchYear: string, fcltyCd: string, isExcel: boolean): Promise<void>;
|
searchRainManage(searchYear: string, fcltyCd: string, isExcel: boolean): Promise<void>;
|
||||||
|
/**배수설비 정비현황 */
|
||||||
|
searchDrainageEquipment(searchYear: string, fcltyCd: string, isExcel: boolean): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DashBoardType = {
|
export type DashBoardType = {
|
||||||
@@ -764,17 +777,12 @@ export type DashBoardType = {
|
|||||||
planYearList : string[];
|
planYearList : string[];
|
||||||
upHeadListPlanFclty : TableUpperProps[];
|
upHeadListPlanFclty : TableUpperProps[];
|
||||||
planFcltyList : planFcltyListProps[];
|
planFcltyList : planFcltyListProps[];
|
||||||
waterUsage1 : number | '',
|
|
||||||
waterUsage2 : number | '',
|
|
||||||
waterUsage3 : number | '',
|
|
||||||
isLoadingPlanFclty : boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
OperationStatus : {
|
OperationStatus : {
|
||||||
isInit : boolean;
|
isInit : boolean;
|
||||||
upHeadListOperationStatus : TableUpperProps[];
|
upHeadListOperationStatus : TableUpperProps[];
|
||||||
operationalStatusList : OperationalStatusListProps[];
|
operationalStatusList : OperationalStatusListProps[];
|
||||||
isLoadingOperationStatus : boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainGraph : {
|
MainGraph : {
|
||||||
@@ -788,7 +796,6 @@ export type DashBoardType = {
|
|||||||
chart_efflTn : lineChartDataProps[];
|
chart_efflTn : lineChartDataProps[];
|
||||||
chart_inflBod : lineChartDataProps[];
|
chart_inflBod : lineChartDataProps[];
|
||||||
chart_efflBod : lineChartDataProps[];
|
chart_efflBod : lineChartDataProps[];
|
||||||
isLoadingMainGraph : boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
RainManage : {
|
RainManage : {
|
||||||
@@ -796,7 +803,6 @@ export type DashBoardType = {
|
|||||||
upHeadListRainManage : TableUpperProps[];
|
upHeadListRainManage : TableUpperProps[];
|
||||||
rainManageList : RainManageListProps[];
|
rainManageList : RainManageListProps[];
|
||||||
excelList : RainManageExcelType[];
|
excelList : RainManageExcelType[];
|
||||||
isLoadingRainManage : boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
DrainageEquipment : {
|
DrainageEquipment : {
|
||||||
@@ -825,18 +831,13 @@ export const dashBoardInitState:DashBoardType = {
|
|||||||
isInit : true,
|
isInit : true,
|
||||||
planYearList : planYearList,
|
planYearList : planYearList,
|
||||||
upHeadListPlanFclty : upHeadListPlanFclty,
|
upHeadListPlanFclty : upHeadListPlanFclty,
|
||||||
planFcltyList : planFcltyList,
|
planFcltyList : planFcltyList
|
||||||
waterUsage1 : 0,
|
|
||||||
waterUsage2 : 0,
|
|
||||||
waterUsage3 : 0,
|
|
||||||
isLoadingPlanFclty : false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
OperationStatus : {
|
OperationStatus : {
|
||||||
isInit : false,
|
isInit : false,
|
||||||
upHeadListOperationStatus : upHeadListOperationStatus,
|
upHeadListOperationStatus : upHeadListOperationStatus,
|
||||||
operationalStatusList : operationalStatusList,
|
operationalStatusList : operationalStatusList
|
||||||
isLoadingOperationStatus : false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
MainGraph : {
|
MainGraph : {
|
||||||
@@ -849,16 +850,14 @@ export const dashBoardInitState:DashBoardType = {
|
|||||||
chart_inflTn : chart_inflTn,
|
chart_inflTn : chart_inflTn,
|
||||||
chart_efflTn : chart_efflTn,
|
chart_efflTn : chart_efflTn,
|
||||||
chart_inflBod : chart_inflBod,
|
chart_inflBod : chart_inflBod,
|
||||||
chart_efflBod : chart_efflBod,
|
chart_efflBod : chart_efflBod
|
||||||
isLoadingMainGraph : false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
RainManage : {
|
RainManage : {
|
||||||
isInit : false,
|
isInit : false,
|
||||||
upHeadListRainManage : upHeadListRainManage,
|
upHeadListRainManage : upHeadListRainManage,
|
||||||
rainManageList : rainManageList,
|
rainManageList : rainManageList,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoadingRainManage : false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
DrainageEquipment : {
|
DrainageEquipment : {
|
||||||
@@ -927,106 +926,18 @@ const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{
|
|||||||
|
|
||||||
const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') => {
|
const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') => {
|
||||||
// 연간
|
// 연간
|
||||||
operationalStatus.yearAvg = data.yearData && data.yearData['AVG_'+keyTxt] ? Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.yearAvg = data.yearData ? Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.yearMax = data.yearData && data.yearData['MAX_'+keyTxt] ? Number(Math.round(data.yearData['MAX_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.yearMax = data.yearData ? Number(Math.round(data.yearData.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.yearMin = data.yearData && data.yearData['MIN_'+keyTxt] ? Number(Math.round(data.yearData['MIN_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.yearMin = data.yearData ? Number(Math.round(data.yearData.MIN_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
// 여름
|
// 여름
|
||||||
operationalStatus.summerAll = data.summer && data.summer['AVG_'+keyTxt] ? Number(Math.round(data.summer['AVG_'+keyTxt] * 0.8 * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.summerAll = data.summer ? Number(Math.round(data.summer.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.summerThree = data.summerRainy && data.summerRainy['AVG_'+keyTxt] ? Number(Math.round(data.summerRainy['AVG_'+keyTxt] * 0.82 * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.summerThree = data.summerRainy ? Number(Math.round(data.summerRainy.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.summerRain = data.summerSunny && data.summerSunny['AVG_'+keyTxt] ? Number(Math.round(data.summerSunny['AVG_'+keyTxt] * 0.74 * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.summerRain = data.summerSunny ? Number(Math.round(data.summerSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
// 겨울
|
// 겨울
|
||||||
operationalStatus.winterAll = data.winter && data.winter['AVG_'+keyTxt] ? Number(Math.round(data.winter['AVG_'+keyTxt] * 1.16*1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.winterAll = data.winter ? Number(Math.round(data.winter.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.winterSunnyMin = data.winterSunny && data.winterSunny['MIN_'+keyTxt] ? Number(Math.round(data.winterSunny['MIN_'+keyTxt] * 1.2 * 1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.winterSunnyMin = data.winterSunny ? Number(Math.round(data.winterSunny.MIN_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.winterSunnyAvg = data.winterSunny && data.winterSunny['AVG_'+keyTxt] ? Number(Math.round(data.winterSunny['AVG_'+keyTxt] * 1.25 *1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.winterSunnyAvg = data.winterSunny ? Number(Math.round(data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
operationalStatus.winterSunnyMax = data.winterSunny && data.winterSunny['MAX_'+keyTxt] ? Number(Math.round(data.winterSunny['MAX_'+keyTxt] * 1.3 *1000) / 1000).toFixed(3).toString() : '';
|
operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
|
||||||
}
|
|
||||||
|
|
||||||
type RtnFlowType = {
|
|
||||||
inflAmnt: string | number;
|
|
||||||
infoRnDay: string | number;
|
|
||||||
bscFctCd: string;
|
|
||||||
msrDt: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type RtnFlowResponse = {
|
|
||||||
data: RtnFlowType[];
|
|
||||||
count: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchWaterUsage = async (searchYear: string, fcltyCd: string) => {
|
|
||||||
const waterUsage = [0, 0, 0];
|
|
||||||
|
|
||||||
for (let i = 0; i < 3; i++) {
|
|
||||||
try {
|
|
||||||
const res = await getFetch('fo', '/fclt/flow/' + fcltyCd + '/' + (Number(searchYear)-i)) as RtnFlowResponse;
|
|
||||||
let totWaterUsage = 0;
|
|
||||||
|
|
||||||
if (res && res.data && Array.isArray(res.data)) {
|
|
||||||
res.data.forEach((item: RtnFlowType) => {
|
|
||||||
totWaterUsage += Number(item.inflAmnt);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.count > 0) {
|
|
||||||
const avg = totWaterUsage / res.count;
|
|
||||||
waterUsage[i] = parseFloat((avg * 0.65).toFixed(2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`Error fetching water usage for year ${Number(searchYear)-i}:`, error);
|
|
||||||
waterUsage[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return waterUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 강우영향일 계산 및 강우량 덮어씌우기
|
|
||||||
export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
|
|
||||||
|
|
||||||
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
const item = data[idx];
|
|
||||||
if(item){
|
|
||||||
if(item.infoRnDay && Number(item.infoRnDay) >= 3) {
|
|
||||||
item.rainEffectDay = 1;
|
|
||||||
} else {
|
|
||||||
item.rainEffectDay = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx]) {
|
|
||||||
// 하루 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
// 이틀 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
|
||||||
if(idx > 1){
|
|
||||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idx > 2){
|
|
||||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let rtnData : RainManageListProps[] = [];
|
|
||||||
rtnData = data.filter((item: RainManageListProps) => item.rainEffectDay === 1);
|
|
||||||
return rtnData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) => void)=>DashBoardActions=(set: (fn: (state: DashBoardType) => DashBoardType) => void) => {
|
export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) => void)=>DashBoardActions=(set: (fn: (state: DashBoardType) => DashBoardType) => void) => {
|
||||||
@@ -1043,28 +954,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
/** 시설정보 및 운영현황 - 계획정보 */
|
/** 시설정보 및 운영현황 - 계획정보 */
|
||||||
searchPlanInfo : async (targetYear: string, fcltyCd: string) => {
|
searchPlanInfo : async (targetYear: string, fcltyCd: string) => {
|
||||||
set((state: DashBoardType) => ({
|
const res = await fetchFacilityPlan(targetYear, fcltyCd);
|
||||||
...state,
|
|
||||||
PlanFclty: {
|
|
||||||
...state.PlanFclty,
|
|
||||||
isLoadingPlanFclty: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
let waterUsage = [0, 0, 0];
|
|
||||||
waterUsage = await searchWaterUsage(targetYear, fcltyCd);
|
|
||||||
|
|
||||||
set((state: DashBoardType) => ({
|
|
||||||
...state,
|
|
||||||
PlanFclty : {
|
|
||||||
...state.PlanFclty,
|
|
||||||
waterUsage1 : waterUsage[0] || 0,
|
|
||||||
waterUsage2 : waterUsage[1] || 0,
|
|
||||||
waterUsage3 : waterUsage[2] || 0,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const res = await fetchFacilityPlan(targetYear, fcltyCd, set);
|
|
||||||
|
|
||||||
let minDiff=9999999;
|
let minDiff=9999999;
|
||||||
let minIndex;
|
let minIndex;
|
||||||
res.forEach((el:any, idx) => {
|
res.forEach((el:any, idx) => {
|
||||||
@@ -1114,31 +1004,21 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
// 임시시
|
// 임시시
|
||||||
dataFormSettingPlan(el);
|
dataFormSettingPlan(el);
|
||||||
console.log('planFcltyList', planFcltyList);
|
|
||||||
console.log('rtnPlanData', rtnPlanData);
|
|
||||||
set((state: DashBoardType) => ({
|
|
||||||
...state,
|
|
||||||
PlanFclty: {
|
|
||||||
...state.PlanFclty,
|
|
||||||
planFcltyList: planFcltyList,
|
|
||||||
isLoadingPlanFclty: false,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
set((state: DashBoardType) => ({
|
||||||
|
...state,
|
||||||
|
PlanFclty : {
|
||||||
|
...state.PlanFclty,
|
||||||
|
planFcltyList : planFcltyList
|
||||||
|
}
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 시설정보 및 운영현황 - 운영실태 */
|
/** 시설정보 및 운영현황 - 운영실태 */
|
||||||
searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => {
|
searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => {
|
||||||
set((state: DashBoardType) => ({
|
|
||||||
...state,
|
|
||||||
OperationStatus: {
|
|
||||||
...state.OperationStatus,
|
|
||||||
isLoadingOperationStatus: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchOperationStatus(searchYear, fcltyCd);
|
const res = await fetchOperationStatus(searchYear, fcltyCd);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
|
|
||||||
if(data && operationalStatusList){
|
if(data && operationalStatusList){
|
||||||
// 유량 - 유입
|
// 유량 - 유입
|
||||||
if (operationalStatusList?.[0]) {
|
if (operationalStatusList?.[0]) {
|
||||||
@@ -1170,56 +1050,10 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
operationalStatusList[0].winterSunnyMin = data.winterSunny === null ? '' : (data.winterSunny.MIN_INFL_AMNT ? data.winterSunny.MIN_INFL_AMNT : 0) + (data.winterSunny.MIN_SUM_FLOW ? data.winterSunny.MIN_SUM_FLOW : 0) + (data.winterSunny.MIN_TP_INFL_WQLT_TP ? data.winterSunny.MIN_TP_INFL_WQLT_TP : 0);
|
operationalStatusList[0].winterSunnyMin = data.winterSunny === null ? '' : (data.winterSunny.MIN_INFL_AMNT ? data.winterSunny.MIN_INFL_AMNT : 0) + (data.winterSunny.MIN_SUM_FLOW ? data.winterSunny.MIN_SUM_FLOW : 0) + (data.winterSunny.MIN_TP_INFL_WQLT_TP ? data.winterSunny.MIN_TP_INFL_WQLT_TP : 0);
|
||||||
operationalStatusList[0].winterSunnyAvg = data.winterSunny === null ? '' : (data.winterSunny.AVG_INFL_AMNT ? data.winterSunny.AVG_INFL_AMNT : 0) + (data.winterSunny.AVG_SUM_FLOW ? data.winterSunny.AVG_SUM_FLOW : 0) + (data.winterSunny.AVG_TP_INFL_WQLT_TP ? data.winterSunny.AVG_TP_INFL_WQLT_TP : 0);
|
operationalStatusList[0].winterSunnyAvg = data.winterSunny === null ? '' : (data.winterSunny.AVG_INFL_AMNT ? data.winterSunny.AVG_INFL_AMNT : 0) + (data.winterSunny.AVG_SUM_FLOW ? data.winterSunny.AVG_SUM_FLOW : 0) + (data.winterSunny.AVG_TP_INFL_WQLT_TP ? data.winterSunny.AVG_TP_INFL_WQLT_TP : 0);
|
||||||
operationalStatusList[0].winterSunnyMax = data.winterSunny === null ? '' : (data.winterSunny.MAX_INFL_AMNT ? data.winterSunny.MAX_INFL_AMNT : 0) + (data.winterSunny.MAX_SUM_FLOW ? data.winterSunny.MAX_SUM_FLOW : 0) + (data.winterSunny.MAX_TP_INFL_WQLT_TP ? data.winterSunny.MAX_TP_INFL_WQLT_TP : 0);
|
operationalStatusList[0].winterSunnyMax = data.winterSunny === null ? '' : (data.winterSunny.MAX_INFL_AMNT ? data.winterSunny.MAX_INFL_AMNT : 0) + (data.winterSunny.MAX_SUM_FLOW ? data.winterSunny.MAX_SUM_FLOW : 0) + (data.winterSunny.MAX_TP_INFL_WQLT_TP ? data.winterSunny.MAX_TP_INFL_WQLT_TP : 0);
|
||||||
|
// 지하수
|
||||||
// 연계처리수,지하수유입량
|
operationalStatusList[0].groundWaterAvg = data.yearData.AVG_INFL_AMNT === null ? '' : Number(data.yearData.AVG_INFL_AMNT) - (Number(data.yearData.AVG_INFL_AMNT)*0.65*0.8);
|
||||||
const bscFctCd = fcltyCd;
|
operationalStatusList[0].groundWaterSummer = data.summer.AVG_INFL_AMNT === null ? '' : Number(data.summer.AVG_INFL_AMNT) - (Number(data.summer.AVG_INFL_AMNT)*0.65*0.8);
|
||||||
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
|
operationalStatusList[0].groundWaterWinter = data.winter.AVG_INFL_AMNT === null ? '' : Number(data.winter.AVG_INFL_AMNT) - (Number(data.winter.AVG_INFL_AMNT)*0.65*0.8);
|
||||||
|
|
||||||
const calData = calRainEffectDay(res2.data, 'SUNNY');
|
|
||||||
let chungcunSumFlow = 0;
|
|
||||||
|
|
||||||
let sumSummerChungcunDay = 0;
|
|
||||||
let sumSummerChungcunFlow = 0;
|
|
||||||
|
|
||||||
let sumWinterChungcunDay = 0;
|
|
||||||
let sumWinterChungcunFlow = 0;
|
|
||||||
|
|
||||||
/* let yearSumFlow = 0;
|
|
||||||
let summerSumFlow = 0;
|
|
||||||
let winterSumFlow = 0; */
|
|
||||||
|
|
||||||
calData.forEach((flowItem: FlowDataItem) => {
|
|
||||||
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
|
||||||
//yearSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
|
||||||
|
|
||||||
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
|
|
||||||
sumSummerChungcunDay += 1;
|
|
||||||
sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
|
||||||
//summerSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
|
||||||
}else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
|
|
||||||
sumWinterChungcunDay += 1;
|
|
||||||
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
|
||||||
// winterSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 연계처리수
|
|
||||||
/* const avgYearSumFlow = yearSumFlow / calData.length;
|
|
||||||
const avgSummerSumFlow = summerSumFlow / calData.length;
|
|
||||||
const avgWinterSumFlow = winterSumFlow / calData.length; */
|
|
||||||
|
|
||||||
// 지하수유입량
|
|
||||||
const usage = chungcunSumFlow / calData.length;
|
|
||||||
const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
|
|
||||||
const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
|
|
||||||
|
|
||||||
operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100;
|
|
||||||
operationalStatusList[0].groundWaterSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
|
|
||||||
operationalStatusList[0].groundWaterWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
|
|
||||||
|
|
||||||
//operationalStatusList[0].groundWaterAvg = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
|
|
||||||
//operationalStatusList[0].groundWaterSummer = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
|
|
||||||
//operationalStatusList[0].groundWaterWinter = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
|
|
||||||
|
|
||||||
// 오염물질
|
// 오염물질
|
||||||
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
|
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
|
||||||
@@ -1229,13 +1063,16 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
const summerLowRain = data.summerBod&&data.summerBod.INFO_RN_DAY&&data.summerBod.INFO_RN_DAY!='null'?Number(data.summerBod.INFO_RN_DAY):0;
|
const summerLowRain = data.summerBod&&data.summerBod.INFO_RN_DAY&&data.summerBod.INFO_RN_DAY!='null'?Number(data.summerBod.INFO_RN_DAY):0;
|
||||||
operationalStatusList[0].rdi = winterAvgBod===0?0:summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod);
|
operationalStatusList[0].rdi = winterAvgBod===0?0:summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod);
|
||||||
operationalStatusList[0].rdiRain = summerLowRain;
|
operationalStatusList[0].rdiRain = summerLowRain;
|
||||||
|
dataFormSetting(operationalStatusList[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(operationalStatusList[0] && operationalStatusList[7]){
|
if(operationalStatusList[0] && operationalStatusList[7]){
|
||||||
operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : data.yearData && data.yearData.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg) / (data.yearData && data.yearData.AVG_INFL_AMNT ? Number(data.yearData.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
console.log(Number(operationalStatusList[0].groundWaterAvg)+' '+Number(data.yearData.AVG_INFL_AMNT));
|
||||||
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : data.summer && data.summer.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer) / (data.summer && data.summer.AVG_INFL_AMNT ? Number(data.summer.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
console.log(Number(operationalStatusList[0].groundWaterSummer)+' '+Number(data.summer.AVG_INFL_AMNT));
|
||||||
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : data.winter && data.winter.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter) / (data.winter && data.winter.AVG_INFL_AMNT ? Number(data.winter.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
console.log(Number(operationalStatusList[0].groundWaterWinter)+' '+Number(data.winter.AVG_INFL_AMNT));
|
||||||
operationalStatusList[7].rdi = operationalStatusList[0].rdi === null ? '' : data.summerBod && data.summerBod.INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].rdi) / (data.summerBod&&data.summerBod.INFL_AMNT&&data.summerBod.INFL_AMNT!='null'?Number(data.summerBod.INFL_AMNT):0) * 100) * 10) / 10+'%';
|
operationalStatusList[7].groundWaterAvg = Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT) * 100;
|
||||||
|
operationalStatusList[7].groundWaterSummer = Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT) * 100;
|
||||||
|
operationalStatusList[7].groundWaterWinter = Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT) * 100;
|
||||||
/* operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : Number(Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT)) * 100;
|
/* operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : Number(Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT)) * 100;
|
||||||
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : Number(Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT)) * 100;
|
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : Number(Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT)) * 100;
|
||||||
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : Number(Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT)) * 100;*/
|
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : Number(Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT)) * 100;*/
|
||||||
@@ -1243,7 +1080,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(let i=1; i<operationalStatusList.length; i++){
|
for(let i=1; i<operationalStatusList.length; i++){
|
||||||
const txtArray = ['1', 'INFL_AMNT', 'SUM_FLOW', 'RETURN_AMNT', 'EFFL_AMNT', 'INFL_ASSCT_BFR_WQLT_BOD', 'EFFL_WQLT_BOD', 'INFL_ASSCT_BFR_WQLT_TN', 'EFFL_WQLT_TN', 'INFL_ASSCT_BFR_WQLT_TP', 'EFFL_WQLT_TP', 'TP_INFL_WQLT_TP', 'EFFL_WQLT_TP'];
|
const txtArray = ['1', 'INFL_AMNT', 'SUM_FLOW', 'RETURN_AMNT', 'EFFL_AMNT', 'INFL_ASSCT_BFR_WQLT_BOD', 'EFFL_WQLT_BOD', 'INFL_ASSCT_BFR_WQLT_TN', 'EFFL_WQLT_TN', 'INFL_ASSCT_BFR_WQLT_TP', 'EFFL_WQLT_TP', 'INFL_ASSCT_BFR_WQLT_TP', 'EFFL_WQLT_TP'];
|
||||||
if(operationalStatusList[i]){
|
if(operationalStatusList[i]){
|
||||||
if(i < 7){
|
if(i < 7){
|
||||||
changeValue(operationalStatusList[i], data, txtArray[i]);
|
changeValue(operationalStatusList[i], data, txtArray[i]);
|
||||||
@@ -1269,8 +1106,8 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
시군구: item.sggNm,
|
시군구: item.sggNm,
|
||||||
주소: item.addr,
|
주소: item.addr,
|
||||||
용량: item.fctCpc,
|
용량: item.fctCpc,
|
||||||
유입BOD: item.inflAssctBfrWqltBod,
|
유입BOD: item.inflAssctAftWqltBod,
|
||||||
유입TN: item.inflAssctBfrWqltTn,
|
유입TN: item.inflAssctAftWqltTn,
|
||||||
유입TP: item.inflAssctBfrWqltTp,
|
유입TP: item.inflAssctBfrWqltTp,
|
||||||
유출BOD: item.efflWqltBod,
|
유출BOD: item.efflWqltBod,
|
||||||
유출TN: item.efflWqltTn,
|
유출TN: item.efflWqltTn,
|
||||||
@@ -1290,20 +1127,12 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
OperationStatus: {
|
OperationStatus: {
|
||||||
...state.OperationStatus,
|
...state.OperationStatus,
|
||||||
operationalStatusList: operationalStatusList,
|
operationalStatusList: operationalStatusList,
|
||||||
operationalStatusCount: res.count,
|
operationalStatusCount: res.count
|
||||||
isLoadingOperationStatus : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
searchMainGraph: async (searchYear: string, fcltyCd: string) => {
|
searchMainGraph: async (searchYear: string, fcltyCd: string) => {
|
||||||
set((state: DashBoardType) => ({
|
|
||||||
...state,
|
|
||||||
MainGraph: {
|
|
||||||
...state.MainGraph,
|
|
||||||
isLoadingMainGraph: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchMainGraph(searchYear, fcltyCd);
|
const res = await fetchMainGraph(searchYear, fcltyCd);
|
||||||
if(res == null || res.data == null || res.data.length === 0) {
|
if(res == null || res.data == null || res.data.length === 0) {
|
||||||
set((state: DashBoardType) => ({
|
set((state: DashBoardType) => ({
|
||||||
@@ -1319,7 +1148,6 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
chart_efflTn: [],
|
chart_efflTn: [],
|
||||||
chart_inflBod: [],
|
chart_inflBod: [],
|
||||||
chart_efflBod: [],
|
chart_efflBod: [],
|
||||||
isLoadingMainGraph : false,
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@@ -1335,7 +1163,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
const chart_bodRain = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_bodRain = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
||||||
barVal0: item.infoRnDay ?? 0,
|
barVal0: item.infoRnDay ?? 0,
|
||||||
lineVal0: item.inflAssctBfrWqltBod ?? 0,
|
lineVal0: item.inflAssctAftWqltBod ?? 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const chart_inflTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_inflTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
@@ -1355,7 +1183,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
const chart_inflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_inflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
||||||
val : item.inflAssctBfrWqltTn ?? 0
|
val : item.inflAssctAftWqltTn ?? 0
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const chart_efflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_efflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
@@ -1365,7 +1193,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
const chart_inflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_inflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
||||||
val : item.inflAssctBfrWqltBod ?? 0
|
val : item.inflAssctAftWqltBod ?? 0
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const chart_efflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
const chart_efflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
||||||
@@ -1385,20 +1213,12 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
chart_inflTn: chart_inflTn,
|
chart_inflTn: chart_inflTn,
|
||||||
chart_efflTn: chart_efflTn,
|
chart_efflTn: chart_efflTn,
|
||||||
chart_inflBod: chart_inflBod,
|
chart_inflBod: chart_inflBod,
|
||||||
chart_efflBod: chart_efflBod,
|
chart_efflBod: chart_efflBod
|
||||||
isLoadingMainGraph : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
searchRainManage: async (searchYear: string, fcltyCd: string, isExcel : boolean) => {
|
searchRainManage: async (searchYear: string, fcltyCd: string, isExcel : boolean) => {
|
||||||
set((state: DashBoardType) => ({
|
|
||||||
...state,
|
|
||||||
RainManage: {
|
|
||||||
...state.RainManage,
|
|
||||||
isLoadingRainManage: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchMainGraph(searchYear, fcltyCd);
|
const res = await fetchMainGraph(searchYear, fcltyCd);
|
||||||
if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) {
|
if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) {
|
||||||
set((state: DashBoardType) => ({
|
set((state: DashBoardType) => ({
|
||||||
@@ -1406,7 +1226,6 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
RainManage: {
|
RainManage: {
|
||||||
...state.RainManage,
|
...state.RainManage,
|
||||||
rainManageList: [],
|
rainManageList: [],
|
||||||
isLoadingRainManage : false,
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@@ -1424,51 +1243,75 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
const dsInflWqltSs: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
const dsInflWqltSs: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const dsInflWqltTn: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
const dsInflWqltTn: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const dsInflWqltTp: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
const dsInflWqltTp: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const inflAssctBfrWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
|
const inflAssctAftWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltCodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltCod = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
const efflWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
|
const efflWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
// 청천시 중 강우영향일인 날짜는 이전의 강우량을 대입해 리스트 수정
|
|
||||||
|
|
||||||
const rainEffectList = calRainEffectDayRainManage(res.data.wqltObjs);
|
|
||||||
// Process the data and create rain management list
|
// Process the data and create rain management list
|
||||||
rainEffectList.forEach((item: RainManageListProps) => {
|
res.data.wqltObjs.forEach((item: RainManageListProps) => {
|
||||||
|
|
||||||
|
// 강우일
|
||||||
|
/*if(Number(item.infoRnDay) < 3){
|
||||||
|
rainDate[1] = Number(rainDate[1] || 0) + 1;
|
||||||
|
inflAmtCnt[1] = Number(inflAmtCnt[1] || 0) + 1;
|
||||||
|
inflAmnt[1] = Number(inflAmnt[1] || 0) + Number(item.inflAmnt || 0);
|
||||||
|
fcltyCpct[1] = 0;
|
||||||
|
inflAssctAftWqltBodCnt[1] = Number(inflAssctAftWqltBodCnt[1] || 0) + 1;
|
||||||
|
inflAssctAftWqltBod[1] = Number(inflAssctAftWqltBod[1] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
|
inflAssctAftWqltTocCnt[1] = Number(inflAssctAftWqltTocCnt[1] || 0) + 1;
|
||||||
|
inflAssctAftWqltToc[1] = Number(inflAssctAftWqltToc[1] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
|
inflAssctAftWqltSsCnt[1] = Number(inflAssctAftWqltSsCnt[1] || 0) + 1;
|
||||||
|
inflAssctAftWqltSs[1] = Number(inflAssctAftWqltSs[1] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
|
inflAssctAftWqltTnCnt[1] = Number(inflAssctAftWqltTnCnt[1] || 0) + 1;
|
||||||
|
inflAssctAftWqltTn[1] = Number(inflAssctAftWqltTn[1] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
|
inflAssctAftWqltTpCnt[1] = Number(inflAssctAftWqltTpCnt[1] || 0) + 1;
|
||||||
|
inflAssctAftWqltTp[1] = Number(inflAssctAftWqltTp[1] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
|
efflWqltBodCnt[1] = Number(efflWqltBodCnt[1] || 0) + 1;
|
||||||
|
efflWqltBod[1] = Number(efflWqltBod[1] || 0) + Number(item.efflWqltBod || 0);
|
||||||
|
efflWqltCodCnt[1] = Number(efflWqltCodCnt[1] || 0) + 1;
|
||||||
|
efflWqltCod[1] = Number(efflWqltCod[1] || 0) + Number(item.efflWqltCod || 0);
|
||||||
|
efflWqltSsCnt[1] = Number(efflWqltSsCnt[1] || 0) + 1;
|
||||||
|
efflWqltSs[1] = Number(efflWqltSs[1] || 0) + Number(item.efflWqltSs || 0);
|
||||||
|
efflWqltTnCnt[1] = Number(efflWqltTnCnt[1] || 0) + 1;
|
||||||
|
efflWqltTn[1] = Number(efflWqltTn[1] || 0) + Number(item.efflWqltTn || 0);
|
||||||
|
efflWqltTpCnt[1] = Number(efflWqltTpCnt[1] || 0) + 1;
|
||||||
|
efflWqltTp[1] = Number(efflWqltTp[1] || 0) + Number(item.efflWqltTp || 0);
|
||||||
|
}*/
|
||||||
if(Number(item.infoRnDay) >= 3 && Number(item.infoRnDay) < 10){
|
if(Number(item.infoRnDay) >= 3 && Number(item.infoRnDay) < 10){
|
||||||
rainDate[1] = Number(rainDate[1] || 0) + 1;
|
rainDate[1] = Number(rainDate[1] || 0) + 1;
|
||||||
inflAmtCnt[1] = Number(inflAmtCnt[1] || 0) + 1;
|
inflAmtCnt[1] = Number(inflAmtCnt[1] || 0) + 1;
|
||||||
inflAmnt[1] = Number(inflAmnt[1] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[1] = Number(inflAmnt[1] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[1] = 0;
|
fcltyCpct[1] = 0;
|
||||||
inflAssctBfrWqltBodCnt[1] = Number(inflAssctBfrWqltBodCnt[1] || 0) + 1;
|
inflAssctAftWqltBodCnt[1] = Number(inflAssctAftWqltBodCnt[1] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[1] = Number(inflAssctBfrWqltBod[1] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[1] = Number(inflAssctAftWqltBod[1] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[1] = Number(inflAssctBfrWqltTocCnt[1] || 0) + 1;
|
inflAssctAftWqltTocCnt[1] = Number(inflAssctAftWqltTocCnt[1] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[1] = Number(inflAssctBfrWqltToc[1] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[1] = Number(inflAssctAftWqltToc[1] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[1] = Number(inflAssctBfrWqltSsCnt[1] || 0) + 1;
|
inflAssctAftWqltSsCnt[1] = Number(inflAssctAftWqltSsCnt[1] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[1] = Number(inflAssctBfrWqltSs[1] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[1] = Number(inflAssctAftWqltSs[1] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[1] = Number(inflAssctBfrWqltTnCnt[1] || 0) + 1;
|
inflAssctAftWqltTnCnt[1] = Number(inflAssctAftWqltTnCnt[1] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[1] = Number(inflAssctBfrWqltTn[1] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[1] = Number(inflAssctAftWqltTn[1] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[1] = Number(inflAssctBfrWqltTpCnt[1] || 0) + 1;
|
inflAssctAftWqltTpCnt[1] = Number(inflAssctAftWqltTpCnt[1] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[1] = Number(inflAssctBfrWqltTp[1] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[1] = Number(inflAssctAftWqltTp[1] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[1] = Number(efflWqltBodCnt[1] || 0) + 1;
|
efflWqltBodCnt[1] = Number(efflWqltBodCnt[1] || 0) + 1;
|
||||||
efflWqltBod[1] = Number(efflWqltBod[1] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[1] = Number(efflWqltBod[1] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[1] = Number(efflWqltTocCnt[1] || 0) + 1;
|
efflWqltCodCnt[1] = Number(efflWqltCodCnt[1] || 0) + 1;
|
||||||
efflWqltToc[1] = Number(efflWqltToc[1] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[1] = Number(efflWqltCod[1] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[1] = Number(efflWqltSsCnt[1] || 0) + 1;
|
efflWqltSsCnt[1] = Number(efflWqltSsCnt[1] || 0) + 1;
|
||||||
efflWqltSs[1] = Number(efflWqltSs[1] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[1] = Number(efflWqltSs[1] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[1] = Number(efflWqltTnCnt[1] || 0) + 1;
|
efflWqltTnCnt[1] = Number(efflWqltTnCnt[1] || 0) + 1;
|
||||||
@@ -1480,20 +1323,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[2] = Number(inflAmtCnt[2] || 0) + 1;
|
inflAmtCnt[2] = Number(inflAmtCnt[2] || 0) + 1;
|
||||||
inflAmnt[2] = Number(inflAmnt[2] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[2] = Number(inflAmnt[2] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[2] = 0;
|
fcltyCpct[2] = 0;
|
||||||
inflAssctBfrWqltBodCnt[2] = Number(inflAssctBfrWqltBodCnt[2] || 0) + 1;
|
inflAssctAftWqltBodCnt[2] = Number(inflAssctAftWqltBodCnt[2] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[2] = Number(inflAssctBfrWqltBod[2] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[2] = Number(inflAssctAftWqltBod[2] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[2] = Number(inflAssctBfrWqltTocCnt[2] || 0) + 1;
|
inflAssctAftWqltTocCnt[2] = Number(inflAssctAftWqltTocCnt[2] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[2] = Number(inflAssctBfrWqltToc[2] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[2] = Number(inflAssctAftWqltToc[2] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[2] = Number(inflAssctBfrWqltSsCnt[2] || 0) + 1;
|
inflAssctAftWqltSsCnt[2] = Number(inflAssctAftWqltSsCnt[2] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[2] = Number(inflAssctBfrWqltSs[2] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[2] = Number(inflAssctAftWqltSs[2] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[2] = Number(inflAssctBfrWqltTnCnt[2] || 0) + 1;
|
inflAssctAftWqltTnCnt[2] = Number(inflAssctAftWqltTnCnt[2] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[2] = Number(inflAssctBfrWqltTn[2] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[2] = Number(inflAssctAftWqltTn[2] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[2] = Number(inflAssctBfrWqltTpCnt[2] || 0) + 1;
|
inflAssctAftWqltTpCnt[2] = Number(inflAssctAftWqltTpCnt[2] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[2] = Number(inflAssctBfrWqltTp[2] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[2] = Number(inflAssctAftWqltTp[2] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[2] = Number(efflWqltBodCnt[2] || 0) + 1;
|
efflWqltBodCnt[2] = Number(efflWqltBodCnt[2] || 0) + 1;
|
||||||
efflWqltBod[2] = Number(efflWqltBod[2] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[2] = Number(efflWqltBod[2] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[2] = Number(efflWqltTocCnt[2] || 0) + 1;
|
efflWqltCodCnt[2] = Number(efflWqltCodCnt[2] || 0) + 1;
|
||||||
efflWqltToc[2] = Number(efflWqltToc[2] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[2] = Number(efflWqltCod[2] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[2] = Number(efflWqltSsCnt[2] || 0) + 1;
|
efflWqltSsCnt[2] = Number(efflWqltSsCnt[2] || 0) + 1;
|
||||||
efflWqltSs[2] = Number(efflWqltSs[2] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[2] = Number(efflWqltSs[2] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[2] = Number(efflWqltTnCnt[2] || 0) + 1;
|
efflWqltTnCnt[2] = Number(efflWqltTnCnt[2] || 0) + 1;
|
||||||
@@ -1505,20 +1348,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[3] = Number(inflAmtCnt[3] || 0) + 1;
|
inflAmtCnt[3] = Number(inflAmtCnt[3] || 0) + 1;
|
||||||
inflAmnt[3] = Number(inflAmnt[3] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[3] = Number(inflAmnt[3] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[3] = 0;
|
fcltyCpct[3] = 0;
|
||||||
inflAssctBfrWqltBodCnt[3] = Number(inflAssctBfrWqltBodCnt[3] || 0) + 1;
|
inflAssctAftWqltBodCnt[3] = Number(inflAssctAftWqltBodCnt[3] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[3] = Number(inflAssctBfrWqltBod[3] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[3] = Number(inflAssctAftWqltBod[3] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[3] = Number(inflAssctBfrWqltTocCnt[3] || 0) + 1;
|
inflAssctAftWqltTocCnt[3] = Number(inflAssctAftWqltTocCnt[3] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[3] = Number(inflAssctBfrWqltToc[3] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[3] = Number(inflAssctAftWqltToc[3] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[3] = Number(inflAssctBfrWqltSsCnt[3] || 0) + 1;
|
inflAssctAftWqltSsCnt[3] = Number(inflAssctAftWqltSsCnt[3] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[3] = Number(inflAssctBfrWqltSs[3] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[3] = Number(inflAssctAftWqltSs[3] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[3] = Number(inflAssctBfrWqltTnCnt[3] || 0) + 1;
|
inflAssctAftWqltTnCnt[3] = Number(inflAssctAftWqltTnCnt[3] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[3] = Number(inflAssctBfrWqltTn[3] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[3] = Number(inflAssctAftWqltTn[3] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[3] = Number(inflAssctBfrWqltTpCnt[3] || 0) + 1;
|
inflAssctAftWqltTpCnt[3] = Number(inflAssctAftWqltTpCnt[3] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[3] = Number(inflAssctBfrWqltTp[3] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[3] = Number(inflAssctAftWqltTp[3] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[3] = Number(efflWqltBodCnt[3] || 0) + 1;
|
efflWqltBodCnt[3] = Number(efflWqltBodCnt[3] || 0) + 1;
|
||||||
efflWqltBod[3] = Number(efflWqltBod[3] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[3] = Number(efflWqltBod[3] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[3] = Number(efflWqltTocCnt[3] || 0) + 1;
|
efflWqltCodCnt[3] = Number(efflWqltCodCnt[3] || 0) + 1;
|
||||||
efflWqltToc[3] = Number(efflWqltToc[3] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[3] = Number(efflWqltCod[3] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[3] = Number(efflWqltSsCnt[3] || 0) + 1;
|
efflWqltSsCnt[3] = Number(efflWqltSsCnt[3] || 0) + 1;
|
||||||
efflWqltSs[3] = Number(efflWqltSs[3] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[3] = Number(efflWqltSs[3] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[3] = Number(efflWqltTnCnt[3] || 0) + 1;
|
efflWqltTnCnt[3] = Number(efflWqltTnCnt[3] || 0) + 1;
|
||||||
@@ -1530,20 +1373,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[4] = Number(inflAmtCnt[4] || 0) + 1;
|
inflAmtCnt[4] = Number(inflAmtCnt[4] || 0) + 1;
|
||||||
inflAmnt[4] = Number(inflAmnt[4] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[4] = Number(inflAmnt[4] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[4] = item.inflAmnt&&Number(item.inflAmnt) !== 0 ? Number(Math.round(Number(item.inflAmnt) / Number(item.fctCpc) * 10) / 10) : 0;
|
fcltyCpct[4] = item.inflAmnt&&Number(item.inflAmnt) !== 0 ? Number(Math.round(Number(item.inflAmnt) / Number(item.fctCpc) * 10) / 10) : 0;
|
||||||
inflAssctBfrWqltBodCnt[4] = Number(inflAssctBfrWqltBodCnt[4] || 0) + 1;
|
inflAssctAftWqltBodCnt[4] = Number(inflAssctAftWqltBodCnt[4] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[4] = Number(inflAssctBfrWqltBod[4] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[4] = Number(inflAssctAftWqltBod[4] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[4] = Number(inflAssctBfrWqltTocCnt[4] || 0) + 1;
|
inflAssctAftWqltTocCnt[4] = Number(inflAssctAftWqltTocCnt[4] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[4] = Number(inflAssctBfrWqltToc[4] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[4] = Number(inflAssctAftWqltToc[4] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[4] = Number(inflAssctBfrWqltSsCnt[4] || 0) + 1;
|
inflAssctAftWqltSsCnt[4] = Number(inflAssctAftWqltSsCnt[4] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[4] = Number(inflAssctBfrWqltSs[4] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[4] = Number(inflAssctAftWqltSs[4] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[4] = Number(inflAssctBfrWqltTnCnt[4] || 0) + 1;
|
inflAssctAftWqltTnCnt[4] = Number(inflAssctAftWqltTnCnt[4] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[4] = Number(inflAssctBfrWqltTn[5] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[4] = Number(inflAssctAftWqltTn[5] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[4] = Number(inflAssctBfrWqltTpCnt[4] || 0) + 1;
|
inflAssctAftWqltTpCnt[4] = Number(inflAssctAftWqltTpCnt[4] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[4] = Number(inflAssctBfrWqltTp[4] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[4] = Number(inflAssctAftWqltTp[4] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[4] = Number(efflWqltBodCnt[4] || 0) + 1;
|
efflWqltBodCnt[4] = Number(efflWqltBodCnt[4] || 0) + 1;
|
||||||
efflWqltBod[4] = Number(efflWqltBod[4] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[4] = Number(efflWqltBod[4] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[4] = Number(efflWqltTocCnt[4] || 0) + 1;
|
efflWqltCodCnt[4] = Number(efflWqltCodCnt[4] || 0) + 1;
|
||||||
efflWqltToc[4] = Number(efflWqltToc[4] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[4] = Number(efflWqltCod[4] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[4] = Number(efflWqltSsCnt[4] || 0) + 1;
|
efflWqltSsCnt[4] = Number(efflWqltSsCnt[4] || 0) + 1;
|
||||||
efflWqltSs[4] = Number(efflWqltSs[4] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[4] = Number(efflWqltSs[4] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[4] = Number(efflWqltTnCnt[5] || 0) + 1;
|
efflWqltTnCnt[4] = Number(efflWqltTnCnt[5] || 0) + 1;
|
||||||
@@ -1555,20 +1398,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[5] = Number(inflAmtCnt[5] || 0) + 1;
|
inflAmtCnt[5] = Number(inflAmtCnt[5] || 0) + 1;
|
||||||
inflAmnt[5] = Number(inflAmnt[5] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[5] = Number(inflAmnt[5] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[5] = 0;
|
fcltyCpct[5] = 0;
|
||||||
inflAssctBfrWqltBodCnt[5] = Number(inflAssctBfrWqltBodCnt[5] || 0) + 1;
|
inflAssctAftWqltBodCnt[5] = Number(inflAssctAftWqltBodCnt[5] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[5] = Number(inflAssctBfrWqltBod[5] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[5] = Number(inflAssctAftWqltBod[5] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[5] = Number(inflAssctBfrWqltTocCnt[5] || 0) + 1;
|
inflAssctAftWqltTocCnt[5] = Number(inflAssctAftWqltTocCnt[5] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[5] = Number(inflAssctBfrWqltToc[5] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[5] = Number(inflAssctAftWqltToc[5] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[5] = Number(inflAssctBfrWqltSsCnt[5] || 0) + 1;
|
inflAssctAftWqltSsCnt[5] = Number(inflAssctAftWqltSsCnt[5] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[5] = Number(inflAssctBfrWqltSs[5] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[5] = Number(inflAssctAftWqltSs[5] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[5] = Number(inflAssctBfrWqltTnCnt[5] || 0) + 1;
|
inflAssctAftWqltTnCnt[5] = Number(inflAssctAftWqltTnCnt[5] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[5] = Number(inflAssctBfrWqltTn[5] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[5] = Number(inflAssctAftWqltTn[5] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[5] = Number(inflAssctBfrWqltTpCnt[5] || 0) + 1;
|
inflAssctAftWqltTpCnt[5] = Number(inflAssctAftWqltTpCnt[5] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[5] = Number(inflAssctBfrWqltTp[5] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[5] = Number(inflAssctAftWqltTp[5] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[5] = Number(efflWqltBodCnt[5] || 0) + 1;
|
efflWqltBodCnt[5] = Number(efflWqltBodCnt[5] || 0) + 1;
|
||||||
efflWqltBod[5] = Number(efflWqltBod[5] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[5] = Number(efflWqltBod[5] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[5] = Number(efflWqltTocCnt[5] || 0) + 1;
|
efflWqltCodCnt[5] = Number(efflWqltCodCnt[5] || 0) + 1;
|
||||||
efflWqltToc[5] = Number(efflWqltToc[5] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[5] = Number(efflWqltCod[5] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[5] = Number(efflWqltSsCnt[5] || 0) + 1;
|
efflWqltSsCnt[5] = Number(efflWqltSsCnt[5] || 0) + 1;
|
||||||
efflWqltSs[5] = Number(efflWqltSs[5] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[5] = Number(efflWqltSs[5] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[5] = Number(efflWqltTnCnt[5] || 0) + 1;
|
efflWqltTnCnt[5] = Number(efflWqltTnCnt[5] || 0) + 1;
|
||||||
@@ -1580,20 +1423,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[6] = Number(inflAmtCnt[6] || 0) + 1;
|
inflAmtCnt[6] = Number(inflAmtCnt[6] || 0) + 1;
|
||||||
inflAmnt[6] = Number(inflAmnt[6] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[6] = Number(inflAmnt[6] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[6] = 0;
|
fcltyCpct[6] = 0;
|
||||||
inflAssctBfrWqltBodCnt[6] = Number(inflAssctBfrWqltBodCnt[6] || 0) + 1;
|
inflAssctAftWqltBodCnt[6] = Number(inflAssctAftWqltBodCnt[6] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[6] = Number(inflAssctBfrWqltBod[6] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[6] = Number(inflAssctAftWqltBod[6] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[6] = Number(inflAssctBfrWqltTocCnt[6] || 0) + 1;
|
inflAssctAftWqltTocCnt[6] = Number(inflAssctAftWqltTocCnt[6] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[6] = Number(inflAssctBfrWqltToc[6] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[6] = Number(inflAssctAftWqltToc[6] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[6] = Number(inflAssctBfrWqltSsCnt[6] || 0) + 1;
|
inflAssctAftWqltSsCnt[6] = Number(inflAssctAftWqltSsCnt[6] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[6] = Number(inflAssctBfrWqltSs[6] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[6] = Number(inflAssctAftWqltSs[6] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[6] = Number(inflAssctBfrWqltTnCnt[6] || 0) + 1;
|
inflAssctAftWqltTnCnt[6] = Number(inflAssctAftWqltTnCnt[6] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[6] = Number(inflAssctBfrWqltTn[6] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[6] = Number(inflAssctAftWqltTn[6] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[6] = Number(inflAssctBfrWqltTpCnt[6] || 0) + 1;
|
inflAssctAftWqltTpCnt[6] = Number(inflAssctAftWqltTpCnt[6] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[6] = Number(inflAssctBfrWqltTp[6] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[6] = Number(inflAssctAftWqltTp[6] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[6] = Number(efflWqltBodCnt[6] || 0) + 1;
|
efflWqltBodCnt[6] = Number(efflWqltBodCnt[6] || 0) + 1;
|
||||||
efflWqltBod[6] = Number(efflWqltBod[6] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[6] = Number(efflWqltBod[6] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[6] = Number(efflWqltTocCnt[6] || 0) + 1;
|
efflWqltCodCnt[6] = Number(efflWqltCodCnt[6] || 0) + 1;
|
||||||
efflWqltToc[6] = Number(efflWqltToc[6] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[6] = Number(efflWqltCod[6] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[6] = Number(efflWqltSsCnt[6] || 0) + 1;
|
efflWqltSsCnt[6] = Number(efflWqltSsCnt[6] || 0) + 1;
|
||||||
efflWqltSs[6] = Number(efflWqltSs[6] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[6] = Number(efflWqltSs[6] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[6] = Number(efflWqltTnCnt[6] || 0) + 1;
|
efflWqltTnCnt[6] = Number(efflWqltTnCnt[6] || 0) + 1;
|
||||||
@@ -1605,20 +1448,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
inflAmtCnt[7] = Number(inflAmtCnt[7] || 0) + 1;
|
inflAmtCnt[7] = Number(inflAmtCnt[7] || 0) + 1;
|
||||||
inflAmnt[7] = Number(inflAmnt[7] || 0) + Number(item.inflAmnt || 0);
|
inflAmnt[7] = Number(inflAmnt[7] || 0) + Number(item.inflAmnt || 0);
|
||||||
fcltyCpct[7] = 0;
|
fcltyCpct[7] = 0;
|
||||||
inflAssctBfrWqltBodCnt[7] = Number(inflAssctBfrWqltBodCnt[7] || 0) + 1;
|
inflAssctAftWqltBodCnt[7] = Number(inflAssctAftWqltBodCnt[7] || 0) + 1;
|
||||||
inflAssctBfrWqltBod[7] = Number(inflAssctBfrWqltBod[7] || 0) + Number(item.inflAssctBfrWqltBod || 0);
|
inflAssctAftWqltBod[7] = Number(inflAssctAftWqltBod[7] || 0) + Number(item.inflAssctAftWqltBod || 0);
|
||||||
inflAssctBfrWqltTocCnt[7] = Number(inflAssctBfrWqltTocCnt[7] || 0) + 1;
|
inflAssctAftWqltTocCnt[7] = Number(inflAssctAftWqltTocCnt[7] || 0) + 1;
|
||||||
inflAssctBfrWqltToc[7] = Number(inflAssctBfrWqltToc[7] || 0) + Number(item.inflAssctBfrWqltToc || 0);
|
inflAssctAftWqltToc[7] = Number(inflAssctAftWqltToc[7] || 0) + Number(item.inflAssctAftWqltToc || 0);
|
||||||
inflAssctBfrWqltSsCnt[7] = Number(inflAssctBfrWqltSsCnt[7] || 0) + 1;
|
inflAssctAftWqltSsCnt[7] = Number(inflAssctAftWqltSsCnt[7] || 0) + 1;
|
||||||
inflAssctBfrWqltSs[7] = Number(inflAssctBfrWqltSs[7] || 0) + Number(item.inflAssctBfrWqltSs || 0);
|
inflAssctAftWqltSs[7] = Number(inflAssctAftWqltSs[7] || 0) + Number(item.inflAssctAftWqltSs || 0);
|
||||||
inflAssctBfrWqltTnCnt[7] = Number(inflAssctBfrWqltTnCnt[7] || 0) + 1;
|
inflAssctAftWqltTnCnt[7] = Number(inflAssctAftWqltTnCnt[7] || 0) + 1;
|
||||||
inflAssctBfrWqltTn[7] = Number(inflAssctBfrWqltTn[7] || 0) + Number(item.inflAssctBfrWqltTn || 0);
|
inflAssctAftWqltTn[7] = Number(inflAssctAftWqltTn[7] || 0) + Number(item.inflAssctAftWqltTn || 0);
|
||||||
inflAssctBfrWqltTpCnt[7] = Number(inflAssctBfrWqltTpCnt[7] || 0) + 1;
|
inflAssctAftWqltTpCnt[7] = Number(inflAssctAftWqltTpCnt[7] || 0) + 1;
|
||||||
inflAssctBfrWqltTp[7] = Number(inflAssctBfrWqltTp[7] || 0) + Number(item.inflAssctBfrWqltTp || 0);
|
inflAssctAftWqltTp[7] = Number(inflAssctAftWqltTp[7] || 0) + Number(item.inflAssctAftWqltTp || 0);
|
||||||
efflWqltBodCnt[7] = Number(efflWqltBodCnt[7] || 0) + 1;
|
efflWqltBodCnt[7] = Number(efflWqltBodCnt[7] || 0) + 1;
|
||||||
efflWqltBod[7] = Number(efflWqltBod[7] || 0) + Number(item.efflWqltBod || 0);
|
efflWqltBod[7] = Number(efflWqltBod[7] || 0) + Number(item.efflWqltBod || 0);
|
||||||
efflWqltTocCnt[7] = Number(efflWqltTocCnt[7] || 0) + 1;
|
efflWqltCodCnt[7] = Number(efflWqltCodCnt[7] || 0) + 1;
|
||||||
efflWqltToc[7] = Number(efflWqltToc[7] || 0) + Number(item.efflWqltToc || 0);
|
efflWqltCod[7] = Number(efflWqltCod[7] || 0) + Number(item.efflWqltCod || 0);
|
||||||
efflWqltSsCnt[7] = Number(efflWqltSsCnt[7] || 0) + 1;
|
efflWqltSsCnt[7] = Number(efflWqltSsCnt[7] || 0) + 1;
|
||||||
efflWqltSs[7] = Number(efflWqltSs[7] || 0) + Number(item.efflWqltSs || 0);
|
efflWqltSs[7] = Number(efflWqltSs[7] || 0) + Number(item.efflWqltSs || 0);
|
||||||
efflWqltTnCnt[7] = Number(efflWqltTnCnt[7] || 0) + 1;
|
efflWqltTnCnt[7] = Number(efflWqltTnCnt[7] || 0) + 1;
|
||||||
@@ -1696,13 +1539,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
for(let idx=0; idx<inflAmnt.length; idx++){
|
for(let idx=0; idx<inflAmnt.length; idx++){
|
||||||
inflAmnt[idx] = calculateAverage(Number(inflAmnt[idx]), Number(inflAmtCnt[idx]));
|
inflAmnt[idx] = calculateAverage(Number(inflAmnt[idx]), Number(inflAmtCnt[idx]));
|
||||||
inflAssctBfrWqltBod[idx] = calculateAverage(Number(inflAssctBfrWqltBod[idx]), Number(inflAssctBfrWqltBodCnt[idx]));
|
inflAssctAftWqltBod[idx] = calculateAverage(Number(inflAssctAftWqltBod[idx]), Number(inflAssctAftWqltBodCnt[idx]));
|
||||||
inflAssctBfrWqltToc[idx] = calculateAverage(Number(inflAssctBfrWqltToc[idx]), Number(inflAssctBfrWqltTocCnt[idx]));
|
inflAssctAftWqltToc[idx] = calculateAverage(Number(inflAssctAftWqltToc[idx]), Number(inflAssctAftWqltTocCnt[idx]));
|
||||||
inflAssctBfrWqltSs[idx] = calculateAverage(Number(inflAssctBfrWqltSs[idx]), Number(inflAssctBfrWqltSsCnt[idx]));
|
inflAssctAftWqltSs[idx] = calculateAverage(Number(inflAssctAftWqltSs[idx]), Number(inflAssctAftWqltSsCnt[idx]));
|
||||||
inflAssctBfrWqltTn[idx] = calculateAverage(Number(inflAssctBfrWqltTn[idx]), Number(inflAssctBfrWqltTnCnt[idx]));
|
inflAssctAftWqltTn[idx] = calculateAverage(Number(inflAssctAftWqltTn[idx]), Number(inflAssctAftWqltTnCnt[idx]));
|
||||||
inflAssctBfrWqltTp[idx] = calculateAverage(Number(inflAssctBfrWqltTp[idx]), Number(inflAssctBfrWqltTpCnt[idx]));
|
inflAssctAftWqltTp[idx] = calculateAverage(Number(inflAssctAftWqltTp[idx]), Number(inflAssctAftWqltTpCnt[idx]));
|
||||||
efflWqltBod[idx] = calculateAverage(Number(efflWqltBod[idx]), Number(efflWqltBodCnt[idx]));
|
efflWqltBod[idx] = calculateAverage(Number(efflWqltBod[idx]), Number(efflWqltBodCnt[idx]));
|
||||||
efflWqltToc[idx] = calculateAverage(Number(efflWqltToc[idx]), Number(efflWqltTocCnt[idx]));
|
efflWqltCod[idx] = calculateAverage(Number(efflWqltCod[idx]), Number(efflWqltCodCnt[idx]));
|
||||||
efflWqltSs[idx] = calculateAverage(Number(efflWqltSs[idx]), Number(efflWqltSsCnt[idx]));
|
efflWqltSs[idx] = calculateAverage(Number(efflWqltSs[idx]), Number(efflWqltSsCnt[idx]));
|
||||||
efflWqltTn[idx] = calculateAverage(Number(efflWqltTn[idx]), Number(efflWqltTnCnt[idx]));
|
efflWqltTn[idx] = calculateAverage(Number(efflWqltTn[idx]), Number(efflWqltTnCnt[idx]));
|
||||||
efflWqltTp[idx] = calculateAverage(Number(efflWqltTp[idx]), Number(efflWqltTpCnt[idx]));
|
efflWqltTp[idx] = calculateAverage(Number(efflWqltTp[idx]), Number(efflWqltTpCnt[idx]));
|
||||||
@@ -1715,13 +1558,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
|
|
||||||
inflAmnt[0] = calculateAverage(calculateTotal(inflAmnt), dataIsCount);
|
inflAmnt[0] = calculateAverage(calculateTotal(inflAmnt), dataIsCount);
|
||||||
fcltyCpct[0] = calculateTotal(fcltyCpct);
|
fcltyCpct[0] = calculateTotal(fcltyCpct);
|
||||||
inflAssctBfrWqltBod[0] = Number((calculateTotal(inflAssctBfrWqltBod)/7).toFixed(1));
|
inflAssctAftWqltBod[0] = Number((calculateTotal(inflAssctAftWqltBod)/7).toFixed(1));
|
||||||
inflAssctBfrWqltToc[0] = Number((calculateTotal(inflAssctBfrWqltToc)/7).toFixed(1));
|
inflAssctAftWqltToc[0] = Number((calculateTotal(inflAssctAftWqltToc)/7).toFixed(1));
|
||||||
inflAssctBfrWqltSs[0] = Number((calculateTotal(inflAssctBfrWqltSs)/7).toFixed(1));
|
inflAssctAftWqltSs[0] = Number((calculateTotal(inflAssctAftWqltSs)/7).toFixed(1));
|
||||||
inflAssctBfrWqltTn[0] = Number((calculateTotal(inflAssctBfrWqltTn)/7).toFixed(3));
|
inflAssctAftWqltTn[0] = Number((calculateTotal(inflAssctAftWqltTn)/7).toFixed(3));
|
||||||
inflAssctBfrWqltTp[0] = Number((calculateTotal(inflAssctBfrWqltTp)/7).toFixed(3));
|
inflAssctAftWqltTp[0] = Number((calculateTotal(inflAssctAftWqltTp)/7).toFixed(3));
|
||||||
efflWqltBod[0] = Number((calculateTotal(efflWqltBod)/7).toFixed(1));
|
efflWqltBod[0] = Number((calculateTotal(efflWqltBod)/7).toFixed(1));
|
||||||
efflWqltToc[0] = Number((calculateTotal(efflWqltToc)/7).toFixed(1));
|
efflWqltCod[0] = Number((calculateTotal(efflWqltCod)/7).toFixed(1));
|
||||||
efflWqltSs[0] = Number((calculateTotal(efflWqltSs as number[])/7).toFixed(1));
|
efflWqltSs[0] = Number((calculateTotal(efflWqltSs as number[])/7).toFixed(1));
|
||||||
efflWqltTn[0] = Number((calculateTotal(efflWqltTn as number[])/7).toFixed(3));
|
efflWqltTn[0] = Number((calculateTotal(efflWqltTn as number[])/7).toFixed(3));
|
||||||
efflWqltTp[0] = Number((calculateTotal(efflWqltTp as number[])/7).toFixed(3));
|
efflWqltTp[0] = Number((calculateTotal(efflWqltTp as number[])/7).toFixed(3));
|
||||||
@@ -1738,13 +1581,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
dsInflWqltSs: dsInflWqltSs[index] ? Number(dsInflWqltSs[index].toFixed(1)) : '',
|
dsInflWqltSs: dsInflWqltSs[index] ? Number(dsInflWqltSs[index].toFixed(1)) : '',
|
||||||
dsInflWqltTn: dsInflWqltTn[index] ? dsInflWqltTn[index].toFixed(3) : '',
|
dsInflWqltTn: dsInflWqltTn[index] ? dsInflWqltTn[index].toFixed(3) : '',
|
||||||
dsInflWqltTp: dsInflWqltTp[index] ? dsInflWqltTp[index].toFixed(3) : '',
|
dsInflWqltTp: dsInflWqltTp[index] ? dsInflWqltTp[index].toFixed(3) : '',
|
||||||
inflAssctBfrWqltBod: inflAssctBfrWqltBod[index] ? Number(inflAssctBfrWqltBod[index].toFixed(1)) : '',
|
inflAssctAftWqltBod: inflAssctAftWqltBod[index] ? Number(inflAssctAftWqltBod[index].toFixed(1)) : '',
|
||||||
inflAssctBfrWqltToc: inflAssctBfrWqltToc[index] ? Number(inflAssctBfrWqltToc[index].toFixed(1)) : '',
|
inflAssctAftWqltToc: inflAssctAftWqltToc[index] ? Number(inflAssctAftWqltToc[index].toFixed(1)) : '',
|
||||||
inflAssctBfrWqltSs: inflAssctBfrWqltSs[index] ? Number(inflAssctBfrWqltSs[index].toFixed(1)) : '',
|
inflAssctAftWqltSs: inflAssctAftWqltSs[index] ? Number(inflAssctAftWqltSs[index].toFixed(1)) : '',
|
||||||
inflAssctBfrWqltTn: inflAssctBfrWqltTn[index] ? inflAssctBfrWqltTn[index].toFixed(3) : '',
|
inflAssctAftWqltTn: inflAssctAftWqltTn[index] ? inflAssctAftWqltTn[index].toFixed(3) : '',
|
||||||
inflAssctBfrWqltTp: inflAssctBfrWqltTp[index] ? inflAssctBfrWqltTp[index].toFixed(3) : '',
|
inflAssctAftWqltTp: inflAssctAftWqltTp[index] ? inflAssctAftWqltTp[index].toFixed(3) : '',
|
||||||
efflWqltBod: efflWqltBod[index] ? Number(efflWqltBod[index].toFixed(1)) : '',
|
efflWqltBod: efflWqltBod[index] ? Number(efflWqltBod[index].toFixed(1)) : '',
|
||||||
efflWqltToc: efflWqltToc[index] ? Number(efflWqltToc[index].toFixed(1)) : '',
|
efflWqltCod: efflWqltCod[index] ? Number(efflWqltCod[index].toFixed(1)) : '',
|
||||||
efflWqltSs: efflWqltSs[index] ? Number(efflWqltSs[index].toFixed(1)) : '',
|
efflWqltSs: efflWqltSs[index] ? Number(efflWqltSs[index].toFixed(1)) : '',
|
||||||
efflWqltTn: efflWqltTn[index] ? efflWqltTn[index].toFixed(3) : '',
|
efflWqltTn: efflWqltTn[index] ? efflWqltTn[index].toFixed(3) : '',
|
||||||
efflWqltTp: efflWqltTp[index] ? efflWqltTp[index].toFixed(3) : ''
|
efflWqltTp: efflWqltTp[index] ? efflWqltTp[index].toFixed(3) : ''
|
||||||
@@ -1764,13 +1607,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
설계유입수질SS: item.dsInflWqltSs ? Number(Number(item.dsInflWqltSs).toFixed(1)) : '',
|
설계유입수질SS: item.dsInflWqltSs ? Number(Number(item.dsInflWqltSs).toFixed(1)) : '',
|
||||||
설계유입수질TN: item.dsInflWqltTn ? Number(item.dsInflWqltTn).toFixed(3) : '',
|
설계유입수질TN: item.dsInflWqltTn ? Number(item.dsInflWqltTn).toFixed(3) : '',
|
||||||
설계유입수질TP: item.dsInflWqltTp ? Number(item.dsInflWqltTp).toFixed(3) : '',
|
설계유입수질TP: item.dsInflWqltTp ? Number(item.dsInflWqltTp).toFixed(3) : '',
|
||||||
유입수질BOD: item.inflAssctBfrWqltBod ? Number(Number(item.inflAssctBfrWqltBod).toFixed(1)) : '',
|
유입수질BOD: item.inflAssctAftWqltBod ? Number(Number(item.inflAssctAftWqltBod).toFixed(1)) : '',
|
||||||
유입수질TOC: item.inflAssctBfrWqltToc ? Number(Number(item.inflAssctBfrWqltToc).toFixed(1)) : '',
|
유입수질TOC: item.inflAssctAftWqltToc ? Number(Number(item.inflAssctAftWqltToc).toFixed(1)) : '',
|
||||||
유입수질SS: item.inflAssctBfrWqltSs ? Number(Number(item.inflAssctBfrWqltSs).toFixed(1)) : '',
|
유입수질SS: item.inflAssctAftWqltSs ? Number(Number(item.inflAssctAftWqltSs).toFixed(1)) : '',
|
||||||
유입수질TN: item.inflAssctBfrWqltTn ? Number(item.inflAssctBfrWqltTn).toFixed(3) : '',
|
유입수질TN: item.inflAssctAftWqltTn ? Number(item.inflAssctAftWqltTn).toFixed(3) : '',
|
||||||
유입수질TP: item.inflAssctBfrWqltTp ? Number(item.inflAssctBfrWqltTp).toFixed(3) : '',
|
유입수질TP: item.inflAssctAftWqltTp ? Number(item.inflAssctAftWqltTp).toFixed(3) : '',
|
||||||
방류수질BOD: item.efflWqltBod ? Number(Number(item.efflWqltBod).toFixed(1)) : '',
|
방류수질BOD: item.efflWqltBod ? Number(Number(item.efflWqltBod).toFixed(1)) : '',
|
||||||
방류수질TOC: item.efflWqltToc ? Number(Number(item.efflWqltToc).toFixed(1)) : '',
|
방류수질TOC: item.efflWqltCod ? Number(Number(item.efflWqltCod).toFixed(1)) : '',
|
||||||
방류수질SS: item.efflWqltSs ? Number(Number(item.efflWqltSs).toFixed(1)) : '',
|
방류수질SS: item.efflWqltSs ? Number(Number(item.efflWqltSs).toFixed(1)) : '',
|
||||||
방류수질TN: item.efflWqltTn ? Number(item.efflWqltTn).toFixed(3) : '',
|
방류수질TN: item.efflWqltTn ? Number(item.efflWqltTn).toFixed(3) : '',
|
||||||
방류수질TP: item.efflWqltTp ? Number(item.efflWqltTp).toFixed(3) : '',
|
방류수질TP: item.efflWqltTp ? Number(item.efflWqltTp).toFixed(3) : '',
|
||||||
@@ -1784,13 +1627,61 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
|||||||
...state.RainManage,
|
...state.RainManage,
|
||||||
rainManageList: filteredData as RainManageListProps[],
|
rainManageList: filteredData as RainManageListProps[],
|
||||||
excelList: excelList,
|
excelList: excelList,
|
||||||
isLoadingRainManage : false,
|
|
||||||
} : {
|
} : {
|
||||||
...state.RainManage,
|
...state.RainManage,
|
||||||
rainManageList: filteredData as RainManageListProps[],
|
rainManageList: filteredData as RainManageListProps[],
|
||||||
isLoadingRainManage : false,
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
searchDrainageEquipment: async (searchYear: string, fcltyCd: string, isExcel : boolean) => {
|
||||||
|
await fetchDrainageEquipment(searchYear, fcltyCd);
|
||||||
|
/* if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) {
|
||||||
|
set((state: DashBoardType) => ({
|
||||||
|
...state.RainManage,
|
||||||
|
rainManageList: [],
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
} */
|
||||||
|
|
||||||
|
/* if(isExcel){
|
||||||
|
res.data.wqltObjs.forEach((item) => {
|
||||||
|
excelList.push({
|
||||||
|
강우량: item.rainItem,
|
||||||
|
강우조건비율: item.rainRate || 0,
|
||||||
|
일수: item.rainDay || 0,
|
||||||
|
유입유량: item.inflAmnt || 0,
|
||||||
|
시설용량대비: item.fctCpc || 0,
|
||||||
|
설계유입수질BOD: item.dsInflWqltBod || 0,
|
||||||
|
설계유입수질TOC: item.dsInflWqltCod || 0,
|
||||||
|
설계유입수질SS: item.dsInflWqltSs || 0,
|
||||||
|
설계유입수질TN: item.dsInflWqltTn || 0,
|
||||||
|
설계유입수질TP: item.dsInflWqltTp || 0,
|
||||||
|
유입수질BOD: item.inflAssctAftWqltBod || 0,
|
||||||
|
유입수질COD: item.inflAssctAftWqltToc || 0,
|
||||||
|
유입수질SS: item.inflAssctAftWqltSs || 0,
|
||||||
|
유입수질TN: item.inflAssctAftWqltTn || 0,
|
||||||
|
유입수질TP: item.inflAssctAftWqltTp || 0,
|
||||||
|
방류수질BOD: item.efflWqltBod || 0,
|
||||||
|
방류수질COD: item.efflWqltCod || 0,
|
||||||
|
방류수질SS: item.efflWqltSs || 0,
|
||||||
|
방류수질TN: item.efflWqltTn || 0,
|
||||||
|
방류수질TP: item.efflWqltTp || 0,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} */
|
||||||
|
|
||||||
|
set((state: DashBoardType) => ({
|
||||||
|
...state,
|
||||||
|
DrainageEquipment: isExcel ? {
|
||||||
|
...state.DrainageEquipment,
|
||||||
|
drainageEquipmentList: drainageEquipmentList,
|
||||||
|
drainageEquipmentExcelList: [],
|
||||||
|
} : {
|
||||||
|
...state.DrainageEquipment,
|
||||||
|
drainageEquipmentList: drainageEquipmentList,
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,6 @@ export type FacilityPrecipitationType = {
|
|||||||
facilityPrecipitation: FacilityPrecipitationProps[];
|
facilityPrecipitation: FacilityPrecipitationProps[];
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
facilityPrecipitationCount: number;
|
facilityPrecipitationCount: number;
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
PrecipitationDetail : {
|
PrecipitationDetail : {
|
||||||
@@ -240,8 +239,7 @@ export const facilityPrecipitationInitState: FacilityPrecipitationType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
facilityPrecipitation : facilityPrecipitation,
|
facilityPrecipitation : facilityPrecipitation,
|
||||||
excelList : [],
|
excelList : [],
|
||||||
facilityPrecipitationCount : 0,
|
facilityPrecipitationCount : 0
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
PrecipitationDetail : {
|
PrecipitationDetail : {
|
||||||
@@ -256,14 +254,6 @@ export type FacilityPrecipitationStore = FacilityPrecipitationType & FacilityPre
|
|||||||
export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void)=>FacilityPrecipitationActions=(set: (fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void) => {
|
export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void)=>FacilityPrecipitationActions=(set: (fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void) => {
|
||||||
return {
|
return {
|
||||||
searchFacilityPrecipitationList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchFacilityPrecipitationList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: FacilityPrecipitationType) => ({
|
|
||||||
...state,
|
|
||||||
FacilityPrecipitation: {
|
|
||||||
...state.FacilityPrecipitation,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const res = await fetchFacilityPrecipitationList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchFacilityPrecipitationList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const excelDownList: ExcelType[] = [];
|
const excelDownList: ExcelType[] = [];
|
||||||
@@ -303,15 +293,13 @@ export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitatio
|
|||||||
...state.FacilityPrecipitation,
|
...state.FacilityPrecipitation,
|
||||||
facilityPrecipitation: res.data,
|
facilityPrecipitation: res.data,
|
||||||
facilityPrecipitationCount: res.count,
|
facilityPrecipitationCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.FacilityPrecipitation,
|
...state.FacilityPrecipitation,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
|
||||||
},
|
},
|
||||||
PrecipitationDetail:{
|
PrecipitationDetail:{
|
||||||
...state.PrecipitationDetail,
|
...state.PrecipitationDetail,
|
||||||
gridListPrecipitationDetail: res.detailData,
|
gridListPrecipitationDetail: res.detailData
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,12 @@ export interface FacilityWaterQltyProps {
|
|||||||
sggNm: string,
|
sggNm: string,
|
||||||
addr: string,
|
addr: string,
|
||||||
fctCpc: number,
|
fctCpc: number,
|
||||||
inflAssctBfrWqltBod: string | '',
|
|
||||||
inflAssctAftWqltBod: string | '',
|
inflAssctAftWqltBod: string | '',
|
||||||
inflAssctBfrWqltToc: string | '',
|
|
||||||
inflAssctAftWqltToc: string | '',
|
inflAssctAftWqltToc: string | '',
|
||||||
inflAssctBfrWqltSs: string | '',
|
|
||||||
inflAssctAftWqltSs: string | '',
|
inflAssctAftWqltSs: string | '',
|
||||||
inflAssctBfrWqltTn: string | '',
|
|
||||||
inflAssctAftWqltTn: string | '',
|
inflAssctAftWqltTn: string | '',
|
||||||
inflAssctBfrWqltTp: string | '',
|
|
||||||
inflAssctAftWqltTp: string | '',
|
inflAssctAftWqltTp: string | '',
|
||||||
|
inflAssctBfrWqltTp: string | '',
|
||||||
efflWqltBod: string | '',
|
efflWqltBod: string | '',
|
||||||
efflWqltToc: string | '',
|
efflWqltToc: string | '',
|
||||||
efflWqltSs: string | '',
|
efflWqltSs: string | '',
|
||||||
@@ -131,11 +127,11 @@ const upHeadList1: TableUpperProps[] = [
|
|||||||
{ id: "fctCpc", title: "시설용량(m³/일)", align: "right", rowSpan: 2, row: 0 },
|
{ id: "fctCpc", title: "시설용량(m³/일)", align: "right", rowSpan: 2, row: 0 },
|
||||||
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
||||||
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
||||||
{ id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1 },
|
{ id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1 },
|
||||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 },
|
{ id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 },
|
||||||
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
|
{ id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
|
||||||
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 },
|
{ id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 },
|
||||||
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
|
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
|
||||||
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1 },
|
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1 },
|
||||||
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1 },
|
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1 },
|
||||||
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1 },
|
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1 },
|
||||||
@@ -155,11 +151,11 @@ const upHeadList2: TableUpperProps[] = [
|
|||||||
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
|
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
|
||||||
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
||||||
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
||||||
{ id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
|
{ id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
{ id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
{ id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
{ id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
||||||
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
|
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
|
||||||
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
|
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
|
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
|
||||||
@@ -183,11 +179,11 @@ const upHeadList3: TableUpperProps[] = [
|
|||||||
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
|
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
|
||||||
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
{ id: "A", title: "유입", colSpan: 5, row: 0 },
|
||||||
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
{ id: "B", title: "방류", colSpan: 5, row: 0 },
|
||||||
{ id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
|
{ id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
{ id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
{ id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
{ id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
|
||||||
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
|
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
|
||||||
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
|
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
|
||||||
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
|
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
|
||||||
@@ -201,10 +197,10 @@ const upHeadList3: TableUpperProps[] = [
|
|||||||
// 처리시설 수질현황 헤더(모달-연간)
|
// 처리시설 수질현황 헤더(모달-연간)
|
||||||
const upHeadListModalYear: TableUpperProps[] = [
|
const upHeadListModalYear: TableUpperProps[] = [
|
||||||
{ id: "msrDt", title: "날짜" },
|
{ id: "msrDt", title: "날짜" },
|
||||||
{ id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe1", upSequnce: 1, align: "right" },
|
{ id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe1", upSequnce: 1, align: "right" },
|
||||||
{ id: "inflAssctBfrWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
|
{ id: "inflAssctAftWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
|
||||||
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
|
{ id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
|
||||||
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
|
{ id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
|
||||||
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
|
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
|
||||||
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe2", upSequnce: 1, align: "right" },
|
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe2", upSequnce: 1, align: "right" },
|
||||||
{ id: "efflWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" },
|
{ id: "efflWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" },
|
||||||
@@ -292,7 +288,6 @@ export type FacilityWaterQltyType = {
|
|||||||
upHeadList1: TableUpperProps[];
|
upHeadList1: TableUpperProps[];
|
||||||
upHeadList2: TableUpperProps[];
|
upHeadList2: TableUpperProps[];
|
||||||
upHeadList3: TableUpperProps[];
|
upHeadList3: TableUpperProps[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
FacilityWaterQltyModal: {
|
FacilityWaterQltyModal: {
|
||||||
@@ -316,7 +311,6 @@ export const facilityWaterQltyInitState: FacilityWaterQltyType = {
|
|||||||
facilityWaterQltyCount: 0,
|
facilityWaterQltyCount: 0,
|
||||||
facilityWaterQltyList: [],
|
facilityWaterQltyList: [],
|
||||||
excelList: [],
|
excelList: [],
|
||||||
isLoading: true,
|
|
||||||
isInit: false,
|
isInit: false,
|
||||||
mainLabelArray: mainLabelArray,
|
mainLabelArray: mainLabelArray,
|
||||||
upHeadList1: upHeadList1,
|
upHeadList1: upHeadList1,
|
||||||
@@ -367,8 +361,8 @@ export type FacilityWaterQltyActions = {
|
|||||||
* @returns : 없음
|
* @returns : 없음
|
||||||
* @description : 시설수질리스트 타입의 데이터를 표현 방식으로 바꿔주는 함수
|
* @description : 시설수질리스트 타입의 데이터를 표현 방식으로 바꿔주는 함수
|
||||||
* - msrDt : YYYY-MM-DD 형식으로 변환
|
* - msrDt : YYYY-MM-DD 형식으로 변환
|
||||||
* - inflAssctBfrWqltBod : 소수점 1자리까지 표현
|
* - inflAssctAftWqltBod : 소수점 1자리까지 표현
|
||||||
* - inflAssctBfrWqltTn : 소수점 1자리까지 표현
|
* - inflAssctAftWqltTn : 소수점 1자리까지 표현
|
||||||
* - inflAssctBfrWqltTp : 소수점 1자리까지 표현
|
* - inflAssctBfrWqltTp : 소수점 1자리까지 표현
|
||||||
* - efflWqltBod : 소수점 2자리까지 표현
|
* - efflWqltBod : 소수점 2자리까지 표현
|
||||||
* - efflWqltTn : 소수점 2자리까지 표현
|
* - efflWqltTn : 소수점 2자리까지 표현
|
||||||
@@ -397,48 +391,41 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
|||||||
* @param fcltyNm : 시설명
|
* @param fcltyNm : 시설명
|
||||||
*/
|
*/
|
||||||
searchFacilityWaterQltyList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchFacilityWaterQltyList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: FacilityWaterQltyType) => ({
|
|
||||||
...state,
|
|
||||||
FacilityWaterQltyMain: {
|
|
||||||
...state.FacilityWaterQltyMain,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchFacilityWaterQltyList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchFacilityWaterQltyList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const rtnData = res.data.map(item => {
|
const rtnData = res.data.map(item => {
|
||||||
dataFormSetting(item)
|
dataFormSetting(item)
|
||||||
if(item.inflAssctBfrWqltTn) {
|
if(item.inflAssctAftWqltTn) {
|
||||||
item.inflAssctBfrWqltTn = Number(Math.round(Number(item.inflAssctBfrWqltTn) * 1000)/1000).toFixed(3);
|
item.inflAssctAftWqltTn = Number(Math.round(Number(item.inflAssctAftWqltTn) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.efflWqltTn){
|
if(item.efflWqltTn){
|
||||||
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
|
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltTp){
|
if(item.inflAssctAftWqltTp){
|
||||||
item.inflAssctBfrWqltTp = Number(Math.round(Number(item.inflAssctBfrWqltTp) * 1000)/1000).toFixed(3);
|
item.inflAssctAftWqltTp = Number(Math.round(Number(item.inflAssctAftWqltTp) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.efflWqltTp){
|
if(item.efflWqltTp){
|
||||||
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
|
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltToc){
|
if(item.inflAssctAftWqltToc){
|
||||||
item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltToc){
|
if(item.efflWqltToc){
|
||||||
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltBod){
|
if(item.inflAssctAftWqltBod){
|
||||||
item.inflAssctBfrWqltBod = Number(Math.round(Number(item.inflAssctBfrWqltBod) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltBod = Number(Math.round(Number(item.inflAssctAftWqltBod) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltBod){
|
if(item.efflWqltBod){
|
||||||
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
|
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltSs){
|
if(item.inflAssctAftWqltSs){
|
||||||
item.inflAssctBfrWqltSs = Number(Math.round(Number(item.inflAssctBfrWqltSs) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltSs = Number(Math.round(Number(item.inflAssctAftWqltSs) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltSs){
|
if(item.efflWqltSs){
|
||||||
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
|
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltToc){
|
if(item.inflAssctAftWqltToc){
|
||||||
item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltToc){
|
if(item.efflWqltToc){
|
||||||
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
||||||
@@ -463,11 +450,11 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
|||||||
시설이름: item.bscFctNm,
|
시설이름: item.bscFctNm,
|
||||||
주소: item.addr,
|
주소: item.addr,
|
||||||
용량: item.fctCpc,
|
용량: item.fctCpc,
|
||||||
유입BOD: item.inflAssctBfrWqltBod,
|
유입BOD: item.inflAssctAftWqltBod,
|
||||||
유입TOC: item.inflAssctBfrWqltToc,
|
유입TOC: item.inflAssctAftWqltToc,
|
||||||
유입SS: item.inflAssctBfrWqltSs,
|
유입SS: item.inflAssctAftWqltSs,
|
||||||
유입TN: item.inflAssctBfrWqltTn,
|
유입TN: item.inflAssctAftWqltTn,
|
||||||
유입TP: item.inflAssctBfrWqltTp,
|
유입TP: item.inflAssctAftWqltTp,
|
||||||
유출BOD: item.efflWqltBod,
|
유출BOD: item.efflWqltBod,
|
||||||
유출TOC: item.efflWqltToc,
|
유출TOC: item.efflWqltToc,
|
||||||
유출SS: item.efflWqltSs,
|
유출SS: item.efflWqltSs,
|
||||||
@@ -489,12 +476,10 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
|||||||
...state.FacilityWaterQltyMain,
|
...state.FacilityWaterQltyMain,
|
||||||
facilityWaterQltyList: rtnData,
|
facilityWaterQltyList: rtnData,
|
||||||
facilityWaterQltyCount: res.count,
|
facilityWaterQltyCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.FacilityWaterQltyMain,
|
...state.FacilityWaterQltyMain,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -571,54 +556,47 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// facilityPrecipitation의 rainEffectDay 계산 로직을 적용
|
const tmpData:FacilityWaterQltyProps[] = [];
|
||||||
|
|
||||||
const data = res.data.wqltObjs;
|
// facilityPrecipitation의 rainEffectDay 계산 로직을 적용
|
||||||
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
|
for(let idx = 0; idx < res.data.wqltObjs.length; idx++) {
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
const item = res.data.wqltObjs[idx];
|
||||||
const item = data[idx];
|
if (!item) continue;
|
||||||
if(item){
|
|
||||||
if(item.infoRnDay && Number(item.infoRnDay) > 3) {
|
const rainDay = Number(item.infoRnDay) >= 3 ? 1 : 0;
|
||||||
item.rainEffectDay = 1;
|
let rainEffectDay = 0;
|
||||||
|
|
||||||
|
if(idx < res.data.wqltObjs.length - 2) {
|
||||||
|
if(rainDay == 1) {
|
||||||
|
rainEffectDay = 1;
|
||||||
} else {
|
} else {
|
||||||
item.rainEffectDay = 0;
|
if(idx >= 2) {
|
||||||
|
const prevItem1 = res.data.wqltObjs[idx-1];
|
||||||
|
const prevItem2 = res.data.wqltObjs[idx-2];
|
||||||
|
if((prevItem1 && Number(prevItem1.infoRnDay) >= 3) || (prevItem2 && Number(prevItem2.infoRnDay) >= 3)) {
|
||||||
|
rainEffectDay = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if(idx < res.data.wqltObjs.length - 1) {
|
||||||
|
const nextItem = res.data.wqltObjs[idx+1];
|
||||||
|
if(rainDay == 1 || (nextItem && Number(nextItem.infoRnDay) >= 3)) {
|
||||||
|
rainEffectDay = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rainEffectDay = rainDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpData.push({
|
||||||
|
...item,
|
||||||
|
rainEffectDay: rainEffectDay,
|
||||||
|
} as FacilityWaterQltyProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
|
const rtnData = tmpData.map((item: FacilityWaterQltyProps) => {
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx]) {
|
|
||||||
// 하루 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
// 이틀 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
|
||||||
if(idx > 1){
|
|
||||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idx > 2){
|
|
||||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const rtnData = data.map((item: FacilityWaterQltyProps) => {
|
|
||||||
dataFormSetting(item)
|
dataFormSetting(item)
|
||||||
if(item.inflAssctBfrWqltTn) {
|
if(item.inflAssctAftWqltTn) {
|
||||||
item.inflAssctBfrWqltTn = Number(Math.round(Number(item.inflAssctBfrWqltTn) * 1000)/1000).toFixed(3);
|
item.inflAssctAftWqltTn = Number(Math.round(Number(item.inflAssctAftWqltTn) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.efflWqltTn){
|
if(item.efflWqltTn){
|
||||||
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
|
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
|
||||||
@@ -629,26 +607,26 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
|||||||
if(item.efflWqltTp){
|
if(item.efflWqltTp){
|
||||||
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
|
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltToc){
|
if(item.inflAssctAftWqltToc){
|
||||||
item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltToc){
|
if(item.efflWqltToc){
|
||||||
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltBod){
|
if(item.inflAssctAftWqltBod){
|
||||||
item.inflAssctBfrWqltBod = Number(Math.round(Number(item.inflAssctBfrWqltBod) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltBod = Number(Math.round(Number(item.inflAssctAftWqltBod) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltBod){
|
if(item.efflWqltBod){
|
||||||
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
|
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltSs){
|
if(item.inflAssctAftWqltSs){
|
||||||
item.inflAssctBfrWqltSs = Number(Math.round(Number(item.inflAssctBfrWqltSs) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltSs = Number(Math.round(Number(item.inflAssctAftWqltSs) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltSs){
|
if(item.efflWqltSs){
|
||||||
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
|
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.inflAssctBfrWqltToc){
|
if(item.inflAssctAftWqltToc){
|
||||||
item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
|
item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
|
||||||
}
|
}
|
||||||
if(item.efflWqltToc){
|
if(item.efflWqltToc){
|
||||||
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ const fetchFlowRateList = async (pageNo: number, pageSize: number, searchYear: s
|
|||||||
try {
|
try {
|
||||||
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : ''; const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : ''; const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
||||||
const res = await getFetch('fo', url);
|
const res = await getFetch('fo', url);
|
||||||
|
console.log(url);
|
||||||
return { data: res.data, count: res.count }
|
return { data: res.data, count: res.count }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('시설정보 유량현황 데이터를 가져오는데 실패했습니다:', error);
|
console.error('시설정보 유량현황 데이터를 가져오는데 실패했습니다:', error);
|
||||||
@@ -219,7 +220,6 @@ export type FlowRateSearchType = {
|
|||||||
flowRateList:flowRateListProps[];
|
flowRateList:flowRateListProps[];
|
||||||
flowRateCount: number;
|
flowRateCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
FlowRateModal : {
|
FlowRateModal : {
|
||||||
@@ -253,8 +253,7 @@ export const flowRateSearchInitState:FlowRateSearchType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
flowRateList : flowRateList,
|
flowRateList : flowRateList,
|
||||||
flowRateCount : 0,
|
flowRateCount : 0,
|
||||||
excelList: [],
|
excelList: []
|
||||||
isLoading: true,
|
|
||||||
},
|
},
|
||||||
FlowRateModal : {
|
FlowRateModal : {
|
||||||
isInit : false,
|
isInit : false,
|
||||||
@@ -266,13 +265,6 @@ export const flowRateSearchInitState:FlowRateSearchType = {
|
|||||||
export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => FlowRateSearchType) => void)=>FlowRateSearchActions=(set: (fn: (state: FlowRateSearchType) => FlowRateSearchType) => void) => {
|
export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => FlowRateSearchType) => void)=>FlowRateSearchActions=(set: (fn: (state: FlowRateSearchType) => FlowRateSearchType) => void) => {
|
||||||
return {
|
return {
|
||||||
searchFlowRateList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchFlowRateList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: FlowRateSearchType) => ({
|
|
||||||
...state,
|
|
||||||
FlowRateList: {
|
|
||||||
...state.FlowRateList,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchFlowRateList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchFlowRateList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const excelDownList: ExcelType[] = [];
|
const excelDownList: ExcelType[] = [];
|
||||||
@@ -311,59 +303,54 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
|
|||||||
...state.FlowRateList,
|
...state.FlowRateList,
|
||||||
flowRateList: rtnData,
|
flowRateList: rtnData,
|
||||||
flowRateCount: res.count,
|
flowRateCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.FlowRateList,
|
...state.FlowRateList,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => {
|
searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => {
|
||||||
const res = await fetchFlowRateModalList(bscFctCd, searchYear);
|
const res = await fetchFlowRateModalList(bscFctCd, searchYear);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
|
const tmpData:FlowRateModalProps[] = [];
|
||||||
|
|
||||||
|
data.forEach((item: FlowRateModalProps) => {
|
||||||
|
if(item.infoRnDay && item.infoRnDay.toString().trim() === 'x') {
|
||||||
|
item.infoRnDay = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// facilityPrecipitation의 rainEffectDay 계산 로직을 적용
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
for(let idx = 0; idx < data.length; idx++) {
|
||||||
const item = data[idx];
|
const item = data[idx];
|
||||||
if(item){
|
const rainDay = Number(item.infoRnDay) >= 3 ? 1 : 0;
|
||||||
if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
|
let rainEffectDay = 0;
|
||||||
item.rainEffectDay = 1;
|
|
||||||
|
if(idx < data.length - 2) {
|
||||||
|
if(rainDay == 1) {
|
||||||
|
rainEffectDay = 1;
|
||||||
} else {
|
} else {
|
||||||
item.rainEffectDay = 0;
|
if(idx >= 2) {
|
||||||
}
|
if(Number(data[idx-1].infoRnDay) >= 3 || Number(data[idx-2].infoRnDay) >= 3) {
|
||||||
}
|
rainEffectDay = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx]) {
|
|
||||||
// 하루 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
// 이틀 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
|
||||||
if(idx > 1){
|
|
||||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(idx > 2){
|
} else if(idx < data.length - 1) {
|
||||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
if(rainDay == 1 || Number(data[idx+1].infoRnDay) >= 3) {
|
||||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
rainEffectDay = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
rainEffectDay = rainDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpData.push({
|
||||||
|
...item,
|
||||||
|
rainEffectDay: rainEffectDay,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const rtnData = data.map((item: FlowRateModalProps) => {
|
const rtnData = tmpData.map((item: FlowRateModalProps) => {
|
||||||
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0)
|
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0)
|
||||||
dataFormSetting(item);
|
dataFormSetting(item);
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import DataForm from "@/app/components/common/DataForm";
|
import DataForm from "@/app/components/common/DataForm";
|
||||||
import type { TableUpperProps } from "../dashboard";
|
import type { TableUpperProps } from "../dashboard";
|
||||||
import { getFetch } from "@/app/components/api";
|
import { getFetch } from "@/app/components/api";
|
||||||
import { calRainEffectDay, type ApiResponse, type FlowDataItem } from "../underWaterInput";
|
|
||||||
export type { TableUpperProps };
|
export type { TableUpperProps };
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - 타입
|
* Store - 타입
|
||||||
@@ -146,7 +145,6 @@ export type PlanSewageType = {
|
|||||||
planSewageList: PlanSewageProps[];
|
planSewageList: PlanSewageProps[];
|
||||||
planSewageCount: number;
|
planSewageCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +161,7 @@ export const planSewageInitState: PlanSewageType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
planSewageList : planSewageList,
|
planSewageList : planSewageList,
|
||||||
planSewageCount : 0,
|
planSewageCount : 0,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,43 +170,16 @@ export type PlanSewageStore = PlanSewageType & PlanSewageActions;
|
|||||||
export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageType) => void)=>PlanSewageActions=(set: (fn: (state: PlanSewageType) => PlanSewageType) => void) => {
|
export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageType) => void)=>PlanSewageActions=(set: (fn: (state: PlanSewageType) => PlanSewageType) => void) => {
|
||||||
return {
|
return {
|
||||||
searchPlanSewageList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchPlanSewageList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: PlanSewageType) => ({
|
|
||||||
...state,
|
|
||||||
PlanSewage: {
|
|
||||||
...state.PlanSewage,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchPlanSewageList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchPlanSewageList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const excelDownList: ExcelType[] = [];
|
const excelDownList: ExcelType[] = [];
|
||||||
const data = res.data
|
console.log('res' , res.data);
|
||||||
const processedData = await Promise.all(data.map(async (item:PlanSewageProps) => {
|
|
||||||
const res2 = await getFetch('fo', '/fclt/flow/' + item.bscFctCd + '/' + searchYear) as ApiResponse;
|
|
||||||
const calData = calRainEffectDay(res2.data, 'SUNNY');
|
|
||||||
|
|
||||||
let sumInflAmntSunny = 0;
|
|
||||||
let avgInflAmntSunny = 0;
|
|
||||||
calData.forEach((flowItem:FlowDataItem) => {
|
|
||||||
sumInflAmntSunny += Number(flowItem.inflAmnt);
|
|
||||||
})
|
|
||||||
avgInflAmntSunny = sumInflAmntSunny / calData.length;
|
|
||||||
item.avgInflAmntSunny = avgInflAmntSunny;
|
|
||||||
if(item.bscFctCd === '11200PB001R'){
|
|
||||||
console.log('avgInflAmntSunny : ',item.avgInflAmntSunny);
|
|
||||||
console.log('calData : ',calData);
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 결과데이터 계산
|
* 결과데이터 계산
|
||||||
* (1) 여유용량 = 시설용량 - 건기시 평균유량
|
* (1) 여유용량 = 시설용량 - 건기시 평균유량
|
||||||
* (2) 변동부하율 = 건기시 일최대 유량/일평균유량(기준 최근 3개년)
|
* (2) 변동부하율 = 건기시 일최대 유량/일평균유량(기준 최근 3개년)
|
||||||
* (3) 분류식화율 = 분류식지역 면적(㎢)/처리구역 면적합계(㎢) ×100
|
* (3) 분류식화율 = 분류식지역 면적(㎢)/처리구역 면적합계(㎢) ×100
|
||||||
*/
|
*/
|
||||||
const resultData = processedData.map((item:PlanSewageProps) => {
|
const resultData = res.data.map((item:PlanSewageProps) => {
|
||||||
console.log('item.fctCpc : ',item.fctCpc);
|
|
||||||
console.log('item.avgInflAmntSunny : ',item.avgInflAmntSunny);
|
|
||||||
item.spareCapacity = Number(item.fctCpc) - Number(item.avgInflAmntSunny);
|
item.spareCapacity = Number(item.fctCpc) - Number(item.avgInflAmntSunny);
|
||||||
item.variableLoadPercent = item.maxInflAmntSunny && item.maxInflAmntSunny!==0 ? Number(item.maxInflAmntSunny) / Number(item.avgInflAmntSunny) : 0;
|
item.variableLoadPercent = item.maxInflAmntSunny && item.maxInflAmntSunny!==0 ? Number(item.maxInflAmntSunny) / Number(item.avgInflAmntSunny) : 0;
|
||||||
item.classifiedSewerPercent = item.sprtProcZoneAr && item.sprtProcZoneAr!==0 ? Number(item.sprtProcZoneAr) / Number(item.procZoneSm) * 100 : 0;
|
item.classifiedSewerPercent = item.sprtProcZoneAr && item.sprtProcZoneAr!==0 ? Number(item.sprtProcZoneAr) / Number(item.procZoneSm) * 100 : 0;
|
||||||
@@ -246,12 +216,10 @@ export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageTy
|
|||||||
...state.PlanSewage,
|
...state.PlanSewage,
|
||||||
planSewageList: resultData,
|
planSewageList: resultData,
|
||||||
planSewageCount: res.count,
|
planSewageCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.PlanSewage,
|
...state.PlanSewage,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { postFetch } from "@/app/components/api";
|
import { getFetchAreaList, postFetch } from "@/app/components/api";
|
||||||
import DataForm from "@/app/components/common/DataForm";
|
|
||||||
import { fetchPlanInfo } from "../common";
|
|
||||||
import type { TableUpperProps } from "../dashboard";
|
import type { TableUpperProps } from "../dashboard";
|
||||||
|
import DataForm from "@/app/components/common/DataForm";
|
||||||
export type { TableUpperProps };
|
export type { TableUpperProps };
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - 타입
|
* Store - 타입
|
||||||
@@ -228,14 +227,25 @@ const fetchFacilityDetailInfo = async (swtrmtFcltCd: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 시설정보 리스트 데이터 호출(구분 선택 후 시설명 있을 경우)
|
// 시설정보 리스트 데이터 호출(구분 선택 후 시설명 있을 경우)
|
||||||
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}> => {
|
const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : string | undefined, sggNm : string | undefined, targetYear : string | undefined ): Promise<{data:ProcessAreaProps[], count:number}> => {
|
||||||
try {
|
try {
|
||||||
const res = await fetchPlanInfo(targetYear, ctpvNm, sggNm, undefined);
|
targetYear = targetYear ? targetYear : "2024";
|
||||||
|
const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy';
|
||||||
|
const queryParams = new URLSearchParams();
|
||||||
|
|
||||||
|
if (ctpvNm && ctpvNm !== '전체') queryParams.append('ctpvNm', ctpvNm);
|
||||||
|
if (sggNm && sggNm !== '전체') queryParams.append('sggNm', sggNm);
|
||||||
|
if (targetYear) queryParams.append('targetYear',targetYear);
|
||||||
|
|
||||||
|
const queryString = queryParams.toString();
|
||||||
|
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
||||||
|
const res = await getFetchAreaList(url);
|
||||||
|
|
||||||
if(res && res.length > 0){
|
if(res && res.length > 0){
|
||||||
const enrichedData = await Promise.all(
|
const enrichedData = await Promise.all(
|
||||||
res.map(async (item: ProcessAreaProps) => {
|
res.map(async (item: ProcessAreaProps) => {
|
||||||
upHeadList1.forEach((head:TableUpperProps) => {
|
upHeadList1.forEach((head:TableUpperProps) => {
|
||||||
/* if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
||||||
head.title = '현재\n(' + item.yr + '년)';
|
head.title = '현재\n(' + item.yr + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
||||||
head.title = '1단계\n(' + item.yrDc1 + '년)';
|
head.title = '1단계\n(' + item.yrDc1 + '년)';
|
||||||
@@ -247,19 +257,6 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm :
|
|||||||
head.title = '4단계\n(' + item.yrDc4 + '년)';
|
head.title = '4단계\n(' + item.yrDc4 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
||||||
head.title = '기승인\n4단계(' + item.yrDt4 + '년)';
|
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 res = await fetchFacilityDetailInfo(item.swtrmtFcltCd);
|
||||||
@@ -283,13 +280,6 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm :
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
||||||
set((state) => ({
|
|
||||||
...state,
|
|
||||||
ProcessArea : {
|
|
||||||
...state.ProcessArea,
|
|
||||||
isLoading : false
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
return {data: [], count: 0};
|
return {data: [], count: 0};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -314,7 +304,6 @@ export type ProcessAreaType = {
|
|||||||
processAreaList: ProcessAreaProps[];
|
processAreaList: ProcessAreaProps[];
|
||||||
processAreaCount: number;
|
processAreaCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
ProcessAreaDetail : {
|
ProcessAreaDetail : {
|
||||||
@@ -339,8 +328,7 @@ export const processAreaInitState: ProcessAreaType = {
|
|||||||
upHeadList1 : upHeadList1,
|
upHeadList1 : upHeadList1,
|
||||||
processAreaList : processAreaList,
|
processAreaList : processAreaList,
|
||||||
processAreaCount : 0,
|
processAreaCount : 0,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
ProcessAreaDetail : {
|
ProcessAreaDetail : {
|
||||||
@@ -367,14 +355,7 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set:
|
|||||||
* @param pageSize : 페이지 크기
|
* @param pageSize : 페이지 크기
|
||||||
*/
|
*/
|
||||||
searchProcessAreaList: async ( pageNo:number, pageSize:number, ctpvNm?:string, sggNm?:string, targetYear?:string) => {
|
searchProcessAreaList: async ( pageNo:number, pageSize:number, ctpvNm?:string, sggNm?:string, targetYear?:string) => {
|
||||||
set((state: ProcessAreaType) => ({
|
const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear);
|
||||||
...state,
|
|
||||||
ProcessArea: {
|
|
||||||
...state.ProcessArea,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear, set);
|
|
||||||
res.data.forEach((item:ProcessAreaProps) => {
|
res.data.forEach((item:ProcessAreaProps) => {
|
||||||
DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record<string, unknown>});
|
DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record<string, unknown>});
|
||||||
})
|
})
|
||||||
@@ -419,11 +400,9 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set:
|
|||||||
...state.ProcessArea,
|
...state.ProcessArea,
|
||||||
processAreaList: res.data,
|
processAreaList: res.data,
|
||||||
processAreaCount: res.count,
|
processAreaCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.ProcessArea,
|
...state.ProcessArea,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@@ -432,51 +411,51 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set:
|
|||||||
set((state: ProcessAreaType) => {
|
set((state: ProcessAreaType) => {
|
||||||
const rtnData = state.ProcessArea.processAreaList.find((item: ProcessAreaProps) => item.swtrmtFcltCd === swtrmtFcltCd);
|
const rtnData = state.ProcessArea.processAreaList.find((item: ProcessAreaProps) => item.swtrmtFcltCd === swtrmtFcltCd);
|
||||||
if (rtnData) {
|
if (rtnData) {
|
||||||
upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => {
|
upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => {
|
||||||
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
||||||
head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
head.title = '현재\n(' + rtnData.yr + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
||||||
head.title = rtnData.yrDc1? '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
head.title = '1단계\n(' + rtnData.yrDc1 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
||||||
head.title = rtnData.yrDc2? '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
head.title = '2단계\n(' + rtnData.yrDc2 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
||||||
head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
head.title = '3단계\n(' + rtnData.yrDc3 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
||||||
head.title = rtnData.yrDc4? '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
head.title = '4단계\n(' + rtnData.yrDc4 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
||||||
head.title = rtnData.yrDt4? '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
upHeadListProcessAreaPlan.forEach((head:TableUpperProps) => {
|
upHeadListProcessAreaPlan.forEach((head:TableUpperProps) => {
|
||||||
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
||||||
head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
head.title = '현재\n(' + rtnData.yr + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
||||||
head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
head.title = '1단계\n(' + rtnData.yrDc1 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
||||||
head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
head.title = '2단계\n(' + rtnData.yrDc2 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
||||||
head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
head.title = '3단계\n(' + rtnData.yrDc3 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
||||||
head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
head.title = '4단계\n(' + rtnData.yrDc4 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
||||||
head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
upHeadListProcessPopulation.forEach((head:TableUpperProps) => {
|
upHeadListProcessPopulation.forEach((head:TableUpperProps) => {
|
||||||
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
|
||||||
head.title = rtnData.yr?'현재\n(' + rtnData.yr + '년)':head.title = '현재';
|
head.title = '현재\n(' + rtnData.yr + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
|
||||||
head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
|
head.title = '1단계\n(' + rtnData.yrDc1 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
|
||||||
head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
|
head.title = '2단계\n(' + rtnData.yrDc2 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
|
||||||
head.title = rtnData.yrDc3?'3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
|
head.title = '3단계\n(' + rtnData.yrDc3 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
|
||||||
head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
|
head.title = '4단계\n(' + rtnData.yrDc4 + '년)';
|
||||||
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
|
||||||
head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
|
head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -517,7 +517,6 @@ export type ProcessFacilityType = {
|
|||||||
processFacilityList:facilityListProps[];
|
processFacilityList:facilityListProps[];
|
||||||
processFacilityCount:number;
|
processFacilityCount:number;
|
||||||
excelList : ExcelType[];
|
excelList : ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
ProcessFacilityDetail : {
|
ProcessFacilityDetail : {
|
||||||
@@ -552,8 +551,7 @@ export const processFacilityInitState:ProcessFacilityType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
processFacilityList : processFacilityList,
|
processFacilityList : processFacilityList,
|
||||||
processFacilityCount:1,
|
processFacilityCount:1,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
ProcessFacilityDetail : {
|
ProcessFacilityDetail : {
|
||||||
@@ -590,13 +588,6 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
|||||||
* @param pageSize : 페이지 크기
|
* @param pageSize : 페이지 크기
|
||||||
*/
|
*/
|
||||||
searchProcessFacility: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => {
|
searchProcessFacility: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => {
|
||||||
set((state: ProcessFacilityType) => ({
|
|
||||||
...state,
|
|
||||||
ProcessFacilityList: {
|
|
||||||
...state.ProcessFacilityList,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchFacilityList(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName);
|
const res = await fetchFacilityList(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName);
|
||||||
res.data.forEach((item:facilityListProps) => {
|
res.data.forEach((item:facilityListProps) => {
|
||||||
DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record<string, unknown>});
|
DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record<string, unknown>});
|
||||||
@@ -644,11 +635,9 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
|||||||
...state.ProcessFacilityList,
|
...state.ProcessFacilityList,
|
||||||
processFacilityList: res.data,
|
processFacilityList: res.data,
|
||||||
processFacilityCount: res.count,
|
processFacilityCount: res.count,
|
||||||
isLoading: false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.ProcessFacilityList,
|
...state.ProcessFacilityList,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading: false,
|
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@@ -659,13 +648,6 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
|||||||
* @param pageSize : 페이지 크기
|
* @param pageSize : 페이지 크기
|
||||||
*/
|
*/
|
||||||
searchProcessFacilitySearching: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => {
|
searchProcessFacilitySearching: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => {
|
||||||
set((state: ProcessFacilityType) => ({
|
|
||||||
...state,
|
|
||||||
ProcessFacilityList: {
|
|
||||||
...state.ProcessFacilityList,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchFacilityListSearching(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName);
|
const res = await fetchFacilityListSearching(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName);
|
||||||
/* res.data.forEach((item:facilityListProps) => {
|
/* res.data.forEach((item:facilityListProps) => {
|
||||||
DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record<string, unknown>});
|
DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record<string, unknown>});
|
||||||
@@ -683,7 +665,6 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
|||||||
...state.ProcessFacilityList,
|
...state.ProcessFacilityList,
|
||||||
processFacilityList: res.data,
|
processFacilityList: res.data,
|
||||||
processFacilityCount: res.count,
|
processFacilityCount: res.count,
|
||||||
isLoading: false,
|
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ export type RdiType = {
|
|||||||
rdiList: RdiProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
rdiList: RdiProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
||||||
rdiCount: number;
|
rdiCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,8 +199,7 @@ export const rdiInitState: RdiType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
rdiList : rdiList,
|
rdiList : rdiList,
|
||||||
rdiCount : 2,
|
rdiCount : 2,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,14 +220,6 @@ export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunctio
|
|||||||
console.log("tableActionsExport");
|
console.log("tableActionsExport");
|
||||||
return {
|
return {
|
||||||
searchRdiList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchRdiList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: RdiType) => ({
|
|
||||||
...state,
|
|
||||||
Rdi: {
|
|
||||||
...state.Rdi,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const res = await fetchRdiList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchRdiList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const excelDownList: ExcelType[] = [];
|
const excelDownList: ExcelType[] = [];
|
||||||
@@ -274,12 +264,10 @@ export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunctio
|
|||||||
...state.Rdi,
|
...state.Rdi,
|
||||||
rdiList: rtnData,
|
rdiList: rtnData,
|
||||||
rdiCount: res.count,
|
rdiCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.Rdi,
|
...state.Rdi,
|
||||||
excelList: excelDownList,
|
excelList: excelDownList,
|
||||||
isLoading : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ const tempSewageOccurList:modalTableType[] = []
|
|||||||
|
|
||||||
const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
// 20250701임시시
|
// 20250701임시시
|
||||||
|
console.log("searchYear", searchYear);
|
||||||
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : '';
|
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : '';
|
||||||
const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
||||||
const res = await getFetch('fo', url);
|
const res = await getFetch('fo', url);
|
||||||
@@ -144,7 +145,7 @@ const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear
|
|||||||
====================================*/
|
====================================*/
|
||||||
export type SewageOccurActions = {
|
export type SewageOccurActions = {
|
||||||
searchSewageOccurList: (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => void;
|
searchSewageOccurList: (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => void;
|
||||||
searchSewageOccurDetailList: (bscFctCd: string, searchYear: string, startYearMonth?: string, endYearMonth?: string) => void;
|
searchSewageOccurDetailList: (bscFctCd: string, searchYear: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SewageOccurType = {
|
export type SewageOccurType = {
|
||||||
@@ -161,7 +162,6 @@ export type SewageOccurType = {
|
|||||||
sewageOccurList: SewageOccurProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
sewageOccurList: SewageOccurProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
||||||
sewageOccurCount: number;
|
sewageOccurCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
SewageOccurDetail : {
|
SewageOccurDetail : {
|
||||||
@@ -184,8 +184,7 @@ export const sewageOccurInitState: SewageOccurType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
sewageOccurList : sewageOccurList,
|
sewageOccurList : sewageOccurList,
|
||||||
sewageOccurCount : 2,
|
sewageOccurCount : 2,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
SewageOccurDetail : {
|
SewageOccurDetail : {
|
||||||
@@ -198,15 +197,14 @@ export const sewageOccurInitState: SewageOccurType = {
|
|||||||
export type SewageOccurStore = SewageOccurType & SewageOccurActions;
|
export type SewageOccurStore = SewageOccurType & SewageOccurActions;
|
||||||
|
|
||||||
// Add type definitions for API responses
|
// Add type definitions for API responses
|
||||||
export type FlowDataItem = {
|
type FlowDataItem = {
|
||||||
inflAmnt: string | number;
|
inflAmnt: string | number;
|
||||||
infoRnDay: string | number;
|
infoRnDay: string | number;
|
||||||
bscFctCd: string;
|
bscFctCd: string;
|
||||||
msrDt: string;
|
msrDt: string;
|
||||||
rainEffectDay?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FlowResponse = {
|
type FlowResponse = {
|
||||||
data: FlowDataItem[];
|
data: FlowDataItem[];
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
@@ -214,84 +212,28 @@ export type FlowResponse = {
|
|||||||
export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||||
return {
|
return {
|
||||||
searchSewageOccurList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchSewageOccurList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: SewageOccurType) => ({
|
|
||||||
...state,
|
|
||||||
SewageOccur: {
|
|
||||||
...state.SewageOccur,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
|
|
||||||
// Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림
|
// Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림
|
||||||
const calData = await Promise.all(data.map(async (item: SewageOccurProps) => {
|
const calData = await Promise.all(data.map(async (item: SewageOccurProps) => {
|
||||||
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
||||||
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
||||||
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
||||||
item.swageChangePercent = 80;
|
item.swageChangePercent = 80;
|
||||||
|
|
||||||
|
|
||||||
const bscFctCd = item.bscFctCd;
|
const bscFctCd = item.bscFctCd;
|
||||||
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as FlowResponse;
|
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as FlowResponse;
|
||||||
|
|
||||||
let sumChungcunDay = 0;
|
let sumChungcunDay = 0;
|
||||||
let chungcunSumFlow = 0;
|
let chungcunSumFlow = 0;
|
||||||
let totWaterUsage = 0;
|
let totWaterUsage = 0;
|
||||||
|
|
||||||
if(bscFctCd === '11200PB001R'){
|
|
||||||
console.log('res2.data : ',res2.data);
|
|
||||||
}
|
|
||||||
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
|
|
||||||
for(let idx = 0; idx < res2.data.length; idx++) {
|
|
||||||
const item = res2.data[idx];
|
|
||||||
if(item){
|
|
||||||
if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
item.rainEffectDay = 1;
|
|
||||||
} else {
|
|
||||||
item.rainEffectDay = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
|
|
||||||
for(let idx = 0; idx < res2.data.length; idx++) {
|
|
||||||
if(res2.data[idx]) {
|
|
||||||
// 하루 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 0 && res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
res2.data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
// 이틀 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 1 && res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
res2.data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let idx = 0; idx < res2.data.length; idx++) {
|
|
||||||
if(res2.data[idx] && res2.data[idx]?.rainEffectDay === 1) {
|
|
||||||
if(idx > 1){
|
|
||||||
if(res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
res2.data[idx]!.infoRnDay = res2.data[idx-1]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idx > 2){
|
|
||||||
if(res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
res2.data[idx]!.infoRnDay = res2.data[idx-2]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(bscFctCd === '11200PB001R'){
|
|
||||||
console.log('calData : ',res2.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
res2.data.forEach((item: FlowDataItem) => {
|
res2.data.forEach((item: FlowDataItem) => {
|
||||||
|
if(Number(item.infoRnDay) ===0){
|
||||||
if(Number(item.rainEffectDay) === 0){
|
|
||||||
chungcunSumFlow += Number(item.inflAmnt);
|
chungcunSumFlow += Number(item.inflAmnt);
|
||||||
sumChungcunDay += 1;
|
sumChungcunDay += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
totWaterUsage += Number(item.inflAmnt);
|
totWaterUsage += Number(item.inflAmnt);
|
||||||
});
|
});
|
||||||
const avg = totWaterUsage /res2.count;
|
const avg = totWaterUsage /res2.count;
|
||||||
@@ -308,34 +250,17 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
|||||||
...state.SewageOccur,
|
...state.SewageOccur,
|
||||||
sewageOccurList: calData,
|
sewageOccurList: calData,
|
||||||
sewageOccurCount: res.count,
|
sewageOccurCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.SewageOccur,
|
...state.SewageOccur,
|
||||||
excelList: [],
|
excelList: [],
|
||||||
isLoading : false,
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
searchSewageOccurDetailList: async (bscFctCd: string, searchYear: string, startYearMonth?: string, endYearMonth?: string) => {
|
searchSewageOccurDetailList: async (bscFctCd: string, searchYear: string) => {
|
||||||
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
|
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
|
||||||
const monthData: SewageOccurDetailProps[] = [];
|
const monthData: SewageOccurDetailProps[] = [];
|
||||||
let tot = 0, cnt= 0;
|
let tot = 0, cnt= 0
|
||||||
|
|
||||||
console.log('startYearMonth : ', startYearMonth, 'endYearMonth : ', endYearMonth);
|
|
||||||
if(startYearMonth) {
|
|
||||||
res.data = res.data.filter((item: FlowDataItem) => {
|
|
||||||
const month = item.msrDt?.substring(0, 6);
|
|
||||||
return month >= startYearMonth;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(endYearMonth) {
|
|
||||||
res.data = res.data.filter((item: FlowDataItem) => {
|
|
||||||
const month = item.msrDt?.substring(0, 6);
|
|
||||||
return month <= endYearMonth;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
res.data.forEach((item: FlowDataItem) => {
|
res.data.forEach((item: FlowDataItem) => {
|
||||||
const month = item.msrDt?.substring(4, 6);
|
const month = item.msrDt?.substring(4, 6);
|
||||||
const monthIdx = month ? Number(month) - 1 : -1;
|
const monthIdx = month ? Number(month) - 1 : -1;
|
||||||
@@ -359,7 +284,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
|||||||
monthData.forEach((item, index) => {
|
monthData.forEach((item, index) => {
|
||||||
item.usege = item.sum/item.cnt *0.65
|
item.usege = item.sum/item.cnt *0.65
|
||||||
tableData.push({
|
tableData.push({
|
||||||
msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
|
msrDt: item.yr+'-'+(index+1>10?String(index+1):'0'+(index+1)),
|
||||||
waterUsage: Math.round(item.usege*100) /100,
|
waterUsage: Math.round(item.usege*100) /100,
|
||||||
swageChangePercent: (Math.round((item.usege/item.usege*0.8) * 100) / 100) * 100,
|
swageChangePercent: (Math.round((item.usege/item.usege*0.8) * 100) / 100) * 100,
|
||||||
estimationSewage: Math.round(item.usege*0.8 * 100) / 100
|
estimationSewage: Math.round(item.usege*0.8 * 100) / 100
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export const StoreZus =
|
|||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
return createStore<FoStore>()((set) => {
|
return createStore<FoStore>()((set) => {
|
||||||
LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"})
|
LoginApi.login({userId: "admin1gmail", password: "test1234!"})
|
||||||
return {
|
return {
|
||||||
...initState,
|
...initState,
|
||||||
...CommonReducer(set),
|
...CommonReducer(set),
|
||||||
|
|||||||
@@ -2,15 +2,8 @@ import DataForm from "@/app/components/common/DataForm";
|
|||||||
import type { TableUpperProps } from "../dashboard";
|
import type { TableUpperProps } from "../dashboard";
|
||||||
import { getFetch } from "@/app/components/api";
|
import { getFetch } from "@/app/components/api";
|
||||||
import type { ExcelType, UnderWaterInputModalProps, UnderWaterProps } from "./types";
|
import type { ExcelType, UnderWaterInputModalProps, UnderWaterProps } from "./types";
|
||||||
|
import type { SewageOccurDetailProps } from "../sewageOccur";
|
||||||
export type { TableUpperProps };
|
export type { TableUpperProps };
|
||||||
|
|
||||||
// SewageOccurDetailProps 타입을 여기에 정의
|
|
||||||
export type SewageOccurDetailProps = {
|
|
||||||
cnt : number,
|
|
||||||
sum : number,
|
|
||||||
yr:string,
|
|
||||||
usege:number
|
|
||||||
}
|
|
||||||
/**====================================
|
/**====================================
|
||||||
* Store - 타입
|
* Store - 타입
|
||||||
====================================*/
|
====================================*/
|
||||||
@@ -82,7 +75,7 @@ const upHeadList3:TableUpperProps[] = [
|
|||||||
// 모달
|
// 모달
|
||||||
const upHeadListUnderWaterDetail:TableUpperProps[] = [
|
const upHeadListUnderWaterDetail:TableUpperProps[] = [
|
||||||
{ id: "msrDt", title: "날짜" },
|
{ id: "msrDt", title: "날짜" },
|
||||||
{ id: "realSewageInput", title: "청천시 실제 하수유입량\n(m³/일)" },
|
{ id: "realSewageInput", title: "실제 하수유입량\n(m³/일)" },
|
||||||
{ id: "sewageOccur", title: "오수발생량\n(m³/일)" },
|
{ id: "sewageOccur", title: "오수발생량\n(m³/일)" },
|
||||||
{ id: "underWaterInput", title: "지하수 유입량\n(m³/일)" },
|
{ id: "underWaterInput", title: "지하수 유입량\n(m³/일)" },
|
||||||
];
|
];
|
||||||
@@ -169,15 +162,13 @@ const underWaterDetailList:UnderWaterInputModalProps[] = [
|
|||||||
====================================*/
|
====================================*/
|
||||||
|
|
||||||
// API response types
|
// API response types
|
||||||
export interface FlowDataItem {
|
interface FlowDataItem {
|
||||||
inflAmnt: number | string;
|
inflAmnt: number;
|
||||||
infoRnDay: number;
|
infoRnDay: number;
|
||||||
msrDt: string;
|
msrDt: string;
|
||||||
rainEffectDay? : number;
|
|
||||||
sumFlow? : number | string | '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApiResponse {
|
interface ApiResponse {
|
||||||
data: FlowDataItem[];
|
data: FlowDataItem[];
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
@@ -218,7 +209,6 @@ export type UnderWaterType = {
|
|||||||
underWaterList: UnderWaterProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
underWaterList: UnderWaterProps[]; // Changed from facilityAreaProps to ProcessAreaProps
|
||||||
underWaterCount: number;
|
underWaterCount: number;
|
||||||
excelList: ExcelType[];
|
excelList: ExcelType[];
|
||||||
isLoading: boolean;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
UnderWaterDetail : {
|
UnderWaterDetail : {
|
||||||
@@ -241,8 +231,7 @@ export const underWaterInitState: UnderWaterType = {
|
|||||||
upHeadList3 : upHeadList3,
|
upHeadList3 : upHeadList3,
|
||||||
underWaterList : underWaterList,
|
underWaterList : underWaterList,
|
||||||
underWaterCount : 4,
|
underWaterCount : 4,
|
||||||
excelList : [],
|
excelList : []
|
||||||
isLoading : true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
UnderWaterDetail : {
|
UnderWaterDetail : {
|
||||||
@@ -261,70 +250,9 @@ const dataFormSetting=(item : UnderWaterProps)=> {
|
|||||||
|
|
||||||
export type UnderWaterStore = UnderWaterType & UnderWaterActions;
|
export type UnderWaterStore = UnderWaterType & UnderWaterActions;
|
||||||
|
|
||||||
export const calRainEffectDay = (data: FlowDataItem[], weather: string) => {
|
|
||||||
// 강우영향일 계산 (강우량이 3 이상이면 무조건 강우영향일)
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
const item = data[idx];
|
|
||||||
if(item){
|
|
||||||
if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
item.rainEffectDay = 1;
|
|
||||||
} else {
|
|
||||||
item.rainEffectDay = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx]) {
|
|
||||||
// 하루 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
// 이틀 전이 강우영향일(3 이상)인 경우
|
|
||||||
if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.rainEffectDay = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let idx = 0; idx < data.length; idx++) {
|
|
||||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
|
||||||
if(idx > 1){
|
|
||||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idx > 2){
|
|
||||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
|
||||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let rtnData : FlowDataItem[] = [];
|
|
||||||
if (weather === 'ALL') {
|
|
||||||
rtnData = data;
|
|
||||||
} else if (weather === 'SUNNY') {
|
|
||||||
rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0);
|
|
||||||
} else {
|
|
||||||
rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1);
|
|
||||||
}
|
|
||||||
return rtnData;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterType) => void)=>UnderWaterActions=(set: (fn: (state: UnderWaterType) => UnderWaterType) => void) => {
|
export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterType) => void)=>UnderWaterActions=(set: (fn: (state: UnderWaterType) => UnderWaterType) => void) => {
|
||||||
return {
|
return {
|
||||||
searchUnderWaterList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
searchUnderWaterList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||||
set((state: UnderWaterType) => ({
|
|
||||||
...state,
|
|
||||||
UnderWater: {
|
|
||||||
...state.UnderWater,
|
|
||||||
isLoading: true,
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const res = await fetchUnderWaterList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
const res = await fetchUnderWaterList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const calData = await Promise.all(data.map(async (item: UnderWaterProps) => {
|
const calData = await Promise.all(data.map(async (item: UnderWaterProps) => {
|
||||||
@@ -334,7 +262,8 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
|||||||
|
|
||||||
const bscFctCd = item.bscFctCd;
|
const bscFctCd = item.bscFctCd;
|
||||||
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
|
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
|
||||||
const calData = calRainEffectDay(res2.data, 'SUNNY');
|
|
||||||
|
let sumChungcunDay = 0;
|
||||||
let chungcunSumFlow = 0;
|
let chungcunSumFlow = 0;
|
||||||
|
|
||||||
let sumSummerChungcunDay = 0;
|
let sumSummerChungcunDay = 0;
|
||||||
@@ -343,25 +272,24 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
|||||||
let sumWinterChungcunDay = 0;
|
let sumWinterChungcunDay = 0;
|
||||||
let sumWinterChungcunFlow = 0;
|
let sumWinterChungcunFlow = 0;
|
||||||
|
|
||||||
calData.forEach((flowItem: FlowDataItem) => {
|
res2.data.forEach((flowItem: FlowDataItem) => {
|
||||||
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
// 청천시
|
||||||
|
if(Number(flowItem.infoRnDay) ===0){
|
||||||
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
|
sumChungcunDay += 1;
|
||||||
sumSummerChungcunDay += 1;
|
chungcunSumFlow += Number(flowItem.inflAmnt);
|
||||||
sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
|
||||||
}else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
|
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
|
||||||
sumWinterChungcunDay += 1;
|
sumSummerChungcunDay += 1;
|
||||||
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
sumSummerChungcunFlow += Number(flowItem.inflAmnt);
|
||||||
|
}else if(flowItem.msrDt.includes('01') || flowItem.msrDt.includes('02')){
|
||||||
|
sumWinterChungcunDay += 1;
|
||||||
|
sumWinterChungcunFlow += Number(flowItem.inflAmnt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
item.underWaterInputYear = Number(chungcunSumFlow==0?0:Math.round((chungcunSumFlow / sumChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
|
||||||
const usage = chungcunSumFlow / calData.length;
|
item.underWaterInputSummer = Number(sumSummerChungcunFlow==0?0:Math.round((sumSummerChungcunFlow / sumSummerChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
|
||||||
const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
|
item.underWaterInputWinter = Number(sumWinterChungcunFlow==0?0:Math.round((sumWinterChungcunFlow / sumWinterChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
|
||||||
const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
|
|
||||||
|
|
||||||
item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100;
|
|
||||||
item.underWaterInputSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
|
|
||||||
item.underWaterInputWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
|
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}));
|
}));
|
||||||
@@ -404,30 +332,17 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
|||||||
...state.UnderWater,
|
...state.UnderWater,
|
||||||
underWaterList: calData,
|
underWaterList: calData,
|
||||||
underWaterCount: res.count,
|
underWaterCount: res.count,
|
||||||
isLoading : false,
|
|
||||||
}:{
|
}:{
|
||||||
...state.UnderWater,
|
...state.UnderWater,
|
||||||
isLoading : false,
|
excelList: excelDownList,
|
||||||
excelList: excelDownList
|
}
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
unserWaterModal:async (bscFctCd, searchYear)=>{
|
unserWaterModal:async (bscFctCd, searchYear)=>{
|
||||||
console.log('searchYear : ', searchYear);
|
|
||||||
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
|
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
|
||||||
const monthData: SewageOccurDetailProps[] = [];
|
const monthData: SewageOccurDetailProps[] = [];
|
||||||
|
let tot = 0, cnt= 0
|
||||||
const calData = calRainEffectDay(res.data, 'SUNNY');
|
res.data.forEach((item: FlowDataItem) => {
|
||||||
let tot = 0, cnt= 0;
|
|
||||||
|
|
||||||
let tmpTot = 0;
|
|
||||||
|
|
||||||
calData.forEach((item: FlowDataItem) => {
|
|
||||||
tmpTot += Number(item.inflAmnt);
|
|
||||||
})
|
|
||||||
console.log('tmpTot : ', tmpTot/calData.length);
|
|
||||||
|
|
||||||
calData.forEach((item: FlowDataItem) => {
|
|
||||||
const month = item.msrDt?.substring(4, 6);
|
const month = item.msrDt?.substring(4, 6);
|
||||||
const monthIdx = month ? Number(month) - 1 : -1;
|
const monthIdx = month ? Number(month) - 1 : -1;
|
||||||
if (monthIdx >= 0) {
|
if (monthIdx >= 0) {
|
||||||
@@ -449,7 +364,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
|||||||
monthData.forEach((item, index) => {
|
monthData.forEach((item, index) => {
|
||||||
item.usege = item.sum/item.cnt
|
item.usege = item.sum/item.cnt
|
||||||
tableData.push({
|
tableData.push({
|
||||||
msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
|
msrDt: item.yr+'-'+(index+1>10?String(index+1):'0'+(index+1)),
|
||||||
realSewageInput:Math.round(item.usege*100) /100,
|
realSewageInput:Math.round(item.usege*100) /100,
|
||||||
sewageOccur:Math.round(item.usege*0.65*0.8 * 100) / 100,
|
sewageOccur:Math.round(item.usege*0.65*0.8 * 100) / 100,
|
||||||
underWaterInput:Math.round((item.usege-(item.usege*0.65*0.8)) * 100) / 100,
|
underWaterInput:Math.round((item.usege-(item.usege*0.65*0.8)) * 100) / 100,
|
||||||
@@ -464,6 +379,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
|||||||
|
|
||||||
});
|
});
|
||||||
avgWaterUsage = tot/cnt
|
avgWaterUsage = tot/cnt
|
||||||
|
|
||||||
const newData= [
|
const newData= [
|
||||||
{
|
{
|
||||||
msrDt: '평균',
|
msrDt: '평균',
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "FO";
|
|||||||
export const PORT = process.env.NEXT_PUBLIC_PORT || "3000";
|
export const PORT = process.env.NEXT_PUBLIC_PORT || "3000";
|
||||||
export const PROXY_HOST = process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
|
export const PROXY_HOST = process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
|
||||||
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_WR_URL = process.env.NEXT_PUBLIC_WR_SERVER_API_URL ||'http://con.mind-one.co.kr:11080/api/v1';
|
||||||
//export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL||' http://con.mind-one.co.kr:11082/api/v1';
|
export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL||' http://con.mind-one.co.kr:11082/api/v1';
|
||||||
export const SERVER_API_URL = process.env.NEXT_PUBLIC_CS_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_URL = process.env.NEXT_PUBLIC_CS_SERVER_API_URL||'http://dev.onasys.co.kr:8000';
|
||||||
export const CLAIM_NAME = process.env.NEXT_PUBLIC_CLAIM_NAME || "Authorization";
|
export const CLAIM_NAME = process.env.NEXT_PUBLIC_CLAIM_NAME || "Authorization";
|
||||||
export const ACCESS_TOKEN = process.env.NEXT_PUBLIC_ACCESS_TOKEN || "access-token";
|
export const ACCESS_TOKEN = process.env.NEXT_PUBLIC_ACCESS_TOKEN || "access-token";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
|
|||||||
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||||
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
|
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
|
||||||
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver #TODO 운영에서 바꿔야 함
|
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver #TODO 운영에서 바꿔야 함
|
||||||
NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com #자료관 데이터
|
NEXT_PUBLIC_DC_URL = https://apigateway.rsonesoft.com #자료관 데이터
|
||||||
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
||||||
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
|
|||||||
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
|
||||||
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
|
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_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||||
NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com #자료관 데이터
|
NEXT_PUBLIC_DC_URL = https://apigateway.rsonesoft.com #자료관 데이터
|
||||||
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
NEXT_PUBLIC_CLAIM_NAME = Authorization
|
||||||
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
NEXT_PUBLIC_AUTH_USER_ID = token-id
|
||||||
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000
|
|||||||
NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
|
NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
|
||||||
NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/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_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl
|
||||||
NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com #자료관 데이터
|
NEXT_PUBLIC_DC_URL = https://apigateway.rsonesoft.com #자료관 데이터
|
||||||
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api
|
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useEffect } from 'react';
|
|
||||||
import { usePathname, useRouter } from "next/navigation";
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { BaseLayout } from "@common/components";
|
import { BaseLayout } from "@common/components";
|
||||||
import type { MenuItem } from "@/entities/menu";
|
import type { MenuItem } from "@/entities/menu";
|
||||||
import { useMenuStore } from "@/shared/lib";
|
import { useMenuStore } from "@/shared/lib";
|
||||||
import useStore from '../store/useStore';
|
|
||||||
|
|
||||||
export default function MapLayout({
|
export default function MapLayout({
|
||||||
children,
|
children,
|
||||||
@@ -19,17 +17,6 @@ export default function MapLayout({
|
|||||||
|
|
||||||
const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo);
|
const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo);
|
||||||
|
|
||||||
const { fetchCtpvData, fetchSggData, fetchBIZ_SE_CD, fetchBIZ_TY_CD } = useStore();
|
|
||||||
|
|
||||||
|
|
||||||
// 시도, 시군구 호출
|
|
||||||
useEffect(() => {
|
|
||||||
fetchCtpvData();
|
|
||||||
fetchSggData();
|
|
||||||
fetchBIZ_SE_CD();
|
|
||||||
fetchBIZ_TY_CD();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleMenuClick = (item: MenuItem) => {
|
const handleMenuClick = (item: MenuItem) => {
|
||||||
setCurrentMenuInfo(item);
|
setCurrentMenuInfo(item);
|
||||||
router.push(item.urlPath);
|
router.push(item.urlPath);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { create } from 'zustand';
|
||||||
|
|
||||||
|
export type SelectDataType = {
|
||||||
|
text: string;
|
||||||
|
val: string;
|
||||||
|
sido?: string; // 시도 코드 (선택 사항)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CityCdStore {
|
||||||
|
cityCd: string;
|
||||||
|
setCityCd: (cityCd: string) => void;
|
||||||
|
sidos: SelectDataType[];
|
||||||
|
setSidos: (sidos: SelectDataType[]) => void;
|
||||||
|
siguns : SelectDataType[];
|
||||||
|
setSiguns: (siguns: SelectDataType[]) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useCityCdStore = create<CityCdStore>((set) => ({
|
||||||
|
cityCd: '',
|
||||||
|
setCityCd: (cityCd: string) => set({ cityCd }),
|
||||||
|
sidos: [],
|
||||||
|
setSidos: (sidos: SelectDataType[]) => set({ sidos }),
|
||||||
|
siguns: [],
|
||||||
|
setSiguns: (siguns: SelectDataType[]) => set({ siguns }),
|
||||||
|
}));
|
||||||
@@ -12,9 +12,6 @@ type LayerComponentProps = {
|
|||||||
rainMeasureData?: any;
|
rainMeasureData?: any;
|
||||||
onSaveClick?: () => void;
|
onSaveClick?: () => void;
|
||||||
onFormDataChange?: (data: any) => void; // 추가
|
onFormDataChange?: (data: any) => void; // 추가
|
||||||
chmbrXcnts: string;
|
|
||||||
chmbrYdnts: string;
|
|
||||||
gisObject?: Record<string, any>; // GIS 객체 추가
|
|
||||||
};
|
};
|
||||||
type LayerContentMap = {
|
type LayerContentMap = {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
@@ -25,7 +22,7 @@ type LayerContentMap = {
|
|||||||
// 레이어 이름과 컴포넌트를 매핑
|
// 레이어 이름과 컴포넌트를 매핑
|
||||||
// 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업
|
// 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업
|
||||||
const layerContentMap: LayerContentMap = {
|
const layerContentMap: LayerContentMap = {
|
||||||
"하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리
|
// "하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리
|
||||||
"하수처리구역": {},
|
"하수처리구역": {},
|
||||||
"우수토실": { component: Ssc, },
|
"우수토실": { component: Ssc, },
|
||||||
"중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정
|
"중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정
|
||||||
|
|||||||
@@ -28,20 +28,20 @@ export const MsSwagePplCol = [
|
|||||||
// { id: 'lyrTypeNm', title: '레이어타입명' },
|
// { id: 'lyrTypeNm', title: '레이어타입명' },
|
||||||
]
|
]
|
||||||
export const MsSwagePplCol2 = [
|
export const MsSwagePplCol2 = [
|
||||||
{ id: 'rowNumber', title: '일련\n번호' },
|
{ id: 'rowNumber', title: '일련번호' },
|
||||||
{ id: 'fcltMngNo', title: '시설\n관리번호' },
|
{ id: 'fcltMngNo', title: '시설 관리번호' },
|
||||||
{ id: 'instMngNo', title: '기관\n관리번호' },
|
{ id: 'instMngNo', title: '기관 관리번호' },
|
||||||
{ id: 'instlYmd', title: '설치일자' },
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
// { id: 'mapshtNo', title: '도엽번호' },
|
// { id: 'mapshtNo', title: '도엽번호' },
|
||||||
{ id: 'pdmt', title: '관경\n(mm)' },
|
{ id: 'pdmt', title: '관경(mm)' },
|
||||||
{ id: 'prlg', title: '연장\n(m)' },
|
{ id: 'prlg', title: '연장(m)' },
|
||||||
{ id: 'avgGrdn', title: '평균구배\n(m/m)' },
|
{ id: 'avgGrdn', title: '평균구배(m/m)' },
|
||||||
{ id: 'tmptDpth', title: '시점깊이\n(m)' },
|
{ id: 'tmptDpth', title: '시점깊이(m)' },
|
||||||
{ id: 'tmptMhlMngNo', title: '시점맨홀\n관리번호' },
|
{ id: 'tmptMhlMngNo', title: '시점맨홀 관리번호' },
|
||||||
{ id: 'scendDpth', title: '종점깊이\n(m)' },
|
{ id: 'scendDpth', title: '종점깊이(m)' },
|
||||||
{ id: 'scendMhlMngNo', title: '종점맨홀\n관리번호' },
|
{ id: 'scendMhlMngNo', title: '종점맨홀 관리번호' },
|
||||||
{ id: 'vrtcLen', title: '세로길이\n(m)' },
|
{ id: 'vrtcLen', title: '세로길이(m)' },
|
||||||
{ id: 'wdthLen', title: '가로길이\n(m)' },
|
{ id: 'wdthLen', title: '가로길이(m)' },
|
||||||
// { id: 'fcltyShpCd', title: '시설물형태코드' },
|
// { id: 'fcltyShpCd', title: '시설물형태코드' },
|
||||||
// { id: 'fid', title: 'FID' },
|
// { id: 'fid', title: 'FID' },
|
||||||
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
@@ -287,19 +287,19 @@ export const SwtrmtFcltCol = [
|
|||||||
{ id: 'ycrd', title: 'Y좌표' },
|
{ id: 'ycrd', title: 'Y좌표' },
|
||||||
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
||||||
{ id: 'rprs_msrc_cn', title: '대표공법내용' },
|
{ id: 'rprs_msrc_cn', title: '대표공법내용' },
|
||||||
// { id: 'stty_crtr_bod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
{ id: 'stty_crtr_bod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
||||||
// { id: 'stty_crtr_toc', title: '법정기준TOC((mg/L))' },
|
{ id: 'stty_crtr_toc', title: '법정기준TOC((mg/L))' },
|
||||||
// { id: 'stty_crtr_ss', title: '법정기준SS(mg/L)' },
|
{ id: 'stty_crtr_ss', title: '법정기준SS(mg/L)' },
|
||||||
// { id: 'stty_crtr_tn', title: '법정기준총질소(mg/L)' },
|
{ id: 'stty_crtr_tn', title: '법정기준총질소(mg/L)' },
|
||||||
// { id: 'stty_crtr_tph', title: '법정기준총인(mg/L)' },
|
{ id: 'stty_crtr_tph', title: '법정기준총인(mg/L)' },
|
||||||
// { id: 'stty_crtr_clbcl_cnt', title: '법정기준대장균수(군수/100mL)' },
|
{ id: 'stty_crtr_clbcl_cnt', title: '법정기준대장균수(군수/100mL)' },
|
||||||
{ id: 'bsn_nm', title: '유역명' },
|
{ id: 'bsn_nm', title: '유역명' },
|
||||||
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
||||||
];
|
];
|
||||||
export const SwtrmtFcltCol2 = [
|
export const SwtrmtFcltCol2 = [
|
||||||
{ id: 'rowNumber', title: '일련\n번호' },
|
{ id: 'rowNumber', title: '일련번호' },
|
||||||
{ id: 'swtrmtFcltNm', title: '하수처리\n시설명' },
|
{ id: 'swtrmtFcltNm', title: '하수처리시설명' },
|
||||||
{ id: 'fcltCpct', title: '시설\n용량\n(㎥/d)' },
|
{ id: 'fcltCpct', title: '시설용량(㎥/d)' },
|
||||||
{ id: 'rgnExpln', title: '지역설명' },
|
{ id: 'rgnExpln', title: '지역설명' },
|
||||||
// { id: 'cmcnYmd', title: '준공일자' },
|
// { id: 'cmcnYmd', title: '준공일자' },
|
||||||
{ id: 'oprtngStrtYmd', title: '가동개시일자' },
|
{ id: 'oprtngStrtYmd', title: '가동개시일자' },
|
||||||
@@ -311,7 +311,7 @@ export const SwtrmtFcltCol2 = [
|
|||||||
// { id: 'sggNm', title: '시군구명' },
|
// { id: 'sggNm', title: '시군구명' },
|
||||||
// { id: 'sareaCd', title: '권역코드' },
|
// { id: 'sareaCd', title: '권역코드' },
|
||||||
{ id: 'sareaNm', title: '권역명' },
|
{ id: 'sareaNm', title: '권역명' },
|
||||||
// { id: 'lrgeSareaNm', title: '대권역명' },
|
{ id: 'lrgeSareaNm', title: '대권역명' },
|
||||||
{ id: 'rvrNm', title: '하천명' },
|
{ id: 'rvrNm', title: '하천명' },
|
||||||
// { id: 'addr', title: '주소' },
|
// { id: 'addr', title: '주소' },
|
||||||
// { id: 'dtlAddr', title: '상세주소' },
|
// { id: 'dtlAddr', title: '상세주소' },
|
||||||
@@ -320,19 +320,19 @@ export const SwtrmtFcltCol2 = [
|
|||||||
{ id: 'dschgWtstNm', title: '방류수계명' },
|
{ id: 'dschgWtstNm', title: '방류수계명' },
|
||||||
// { id: 'pllnArea', title: '부지면적(m²)' },
|
// { id: 'pllnArea', title: '부지면적(m²)' },
|
||||||
// { id: 'mngRprtvBzentyNm', title: '관리대행업체명' },
|
// { id: 'mngRprtvBzentyNm', title: '관리대행업체명' },
|
||||||
{ id: 'swtrmtPpltnCnt', title: '하수\n처리\n인구수\n(인)' },
|
{ id: 'swtrmtPpltnCnt', title: '하수처리인구수(인)' },
|
||||||
// { id: 'prcsZoneAreaSum', title: '처리구역면적합계(m²)' },
|
// { id: 'prcsZoneAreaSum', title: '처리구역면적합계(m²)' },
|
||||||
// { id: 'xcrd', title: 'X좌표' },
|
// { id: 'xcrd', title: 'X좌표' },
|
||||||
// { id: 'ycrd', title: 'Y좌표' },
|
// { id: 'ycrd', title: 'Y좌표' },
|
||||||
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
||||||
{ id: 'rprsMsrcCn', title: '대표\n공법\n내용' },
|
{ id: 'rprsMsrcCn', title: '대표공법내용' },
|
||||||
// { id: 'sttyCrtrBod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
// { id: 'sttyCrtrBod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
||||||
// { id: 'sttyCrtrToc', title: '법정기준TOC(mg/L)' },
|
// { id: 'sttyCrtrToc', title: '법정기준TOC(mg/L)' },
|
||||||
// { id: 'sttyCrtrSs', title: '법정기준SS(mg/L)' },
|
// { id: 'sttyCrtrSs', title: '법정기준SS(mg/L)' },
|
||||||
// { id: 'sttyCrtrTn', title: '법정기준총질소(mg/L)' },
|
// { id: 'sttyCrtrTn', title: '법정기준총질소(mg/L)' },
|
||||||
// { id: 'sttyCrtrTph', title: '법정기준총인(mg/L)' },
|
// { id: 'sttyCrtrTph', title: '법정기준총인(mg/L)' },
|
||||||
// { id: 'sttyCrtrClbclCnt', title: '법정기준대장균수(군수/100mL)' },
|
// { id: 'sttyCrtrClbclCnt', title: '법정기준대장균수(군수/100mL)' },
|
||||||
// { id: 'bsnNm', title: '유역명' },
|
{ id: 'bsnNm', title: '유역명' },
|
||||||
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -353,9 +353,9 @@ export const SwtrmtPrcsZoneCol2 = [
|
|||||||
{ id: 'swtrmtZoneNm', title: '하수처리구역명' },
|
{ id: 'swtrmtZoneNm', title: '하수처리구역명' },
|
||||||
// { id: 'swtrmt_fclt_cd', title: '하수처리시설코드' },
|
// { id: 'swtrmt_fclt_cd', title: '하수처리시설코드' },
|
||||||
// { id: 'ctpv_cd', title: '시도코드' },
|
// { id: 'ctpv_cd', title: '시도코드' },
|
||||||
{ id: 'ctpvNm', title: '시도' },
|
{ id: 'ctpvNm', title: '시도명' },
|
||||||
// { id: 'sgg_cd', title: '시군구코드' },
|
// { id: 'sgg_cd', title: '시군구코드' },
|
||||||
{ id: 'sggNm', title: '시군구' },
|
{ id: 'sggNm', title: '시군구명' },
|
||||||
{ id: 'swtrmtFcltNm', title: '하수처리시설명' },
|
{ id: 'swtrmtFcltNm', title: '하수처리시설명' },
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -686,6 +686,5 @@ export const numberFields = [
|
|||||||
'swrPplEqpAr', 'swrTrtPopl', 'weirHg', 'weirLt',
|
'swrPplEqpAr', 'swrTrtPopl', 'weirHg', 'weirLt',
|
||||||
'precdngDry', 'rainFall', 'cntncTime', 'rainIn',
|
'precdngDry', 'rainFall', 'cntncTime', 'rainIn',
|
||||||
'mesureIntrvl', 'qltwtrCo', 'rnysnFvlc', 'clarFvlc',
|
'mesureIntrvl', 'qltwtrCo', 'rnysnFvlc', 'clarFvlc',
|
||||||
'bizAmt', 'count',
|
'bizAmt', 'count'
|
||||||
'chmbr_xcnts', 'chmbr_ydnts'
|
|
||||||
];
|
];
|
||||||
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react'
|
|||||||
import InputSection from '../InputSection';
|
import InputSection from '../InputSection';
|
||||||
import { handleInputChange } from '../common';
|
import { handleInputChange } from '../common';
|
||||||
import { getData } from "@/components/lib/api";
|
import { getData } from "@/components/lib/api";
|
||||||
import useStore from '../../../../store/useStore';
|
// import { useBizByFcltStore } from "../../../../store/StoreProvider";
|
||||||
|
|
||||||
// 하수관로
|
// 하수관로
|
||||||
const inputColumn = [
|
const inputColumn = [
|
||||||
@@ -30,7 +30,21 @@ const MsSwagePpl = ({ featureData, onSaveClick }: { featureData: any, onSaveClic
|
|||||||
inspection: { data: inspectionData, setData: setInspectionData },
|
inspection: { data: inspectionData, setData: setInspectionData },
|
||||||
};
|
};
|
||||||
|
|
||||||
const { BIZ_SE_CD, BIZ_TY_CD } = useStore();
|
|
||||||
|
// const BIZ_SE_CD = useBizByFcltStore(state => state.BIZ_SE_CD);
|
||||||
|
const BIZ_SE_CD = [
|
||||||
|
{ lwpoCd: "100", lwpoCdNm: "관로기술진단" },
|
||||||
|
{ lwpoCd: "200", lwpoCdNm: "개대체" },
|
||||||
|
{ lwpoCd: "201", lwpoCdNm: "유지보수" },
|
||||||
|
{ lwpoCd: "203", lwpoCdNm: "청소, 준설" },
|
||||||
|
{ lwpoCd: "204", lwpoCdNm: "단순보수" },
|
||||||
|
];
|
||||||
|
// const BIZ_TY_CD = useBizByFcltStore(state => state.BIZ_TY_CD);
|
||||||
|
const BIZ_TY_CD = [
|
||||||
|
{ lwpoCd: "SV", lwpoCdNm: "용역" },
|
||||||
|
{ lwpoCd: "SF", lwpoCdNm: "자체" },
|
||||||
|
{ lwpoCd: "SC", lwpoCdNm: "공사" },
|
||||||
|
];
|
||||||
|
|
||||||
// 마운트 및 업데이트 시 API 호출
|
// 마운트 및 업데이트 시 API 호출
|
||||||
|
|
||||||
|
|||||||
@@ -12,118 +12,20 @@ const inputColumn = [
|
|||||||
{ id: "swtrmtZoneCd", title: "처리구역", type: "input" },
|
{ id: "swtrmtZoneCd", title: "처리구역", type: "input" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: {
|
const Ssc = ({ featureData, isMainSsc, rainMeasureData, onSaveClick }: {
|
||||||
featureData: any,
|
featureData: any,
|
||||||
isMainSsc?: boolean,
|
isMainSsc?: boolean,
|
||||||
chmbrXcnts?: string,
|
rainMeasureData?: any,
|
||||||
chmbrYdnts?: string,
|
|
||||||
onSaveClick?: () => void
|
onSaveClick?: () => void
|
||||||
}) => {
|
}) => {
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
const [isDataLoaded, setIsDataLoaded] = useState(false);
|
const [isDataLoaded, setIsDataLoaded] = useState(false);
|
||||||
const [formData, setFormData] = useState<any>({});
|
const [formData, setFormData] = useState<any>({});
|
||||||
const [rainMeasureData, setRainMeasureData] = useState<any>({}); // 강우, 측정 정보
|
const [mntrngsData, setMntrngsData] = useState<any[]>([]); // 수량/수질 측정 정보
|
||||||
const [mntrngsData, setMntrngsData] = useState<any[]>([]); // 수량/수질측정 정보
|
|
||||||
const [totalCount, setTotalCount] = useState<number>(0);
|
|
||||||
const [totalDetailCount, setTotalDetailCount] = useState<number>(0);
|
|
||||||
const [selectedRowIndex, setSelectedRowIndex] = useState<number>(-1);
|
const [selectedRowIndex, setSelectedRowIndex] = useState<number>(-1);
|
||||||
const [curPage, setCurPage] = useState<number>(1);
|
|
||||||
const [curDetailPage, setCurDetailPage] = useState<number>(1);
|
|
||||||
const [isResetPage, setIsResetPage] = useState<boolean>(true);
|
|
||||||
const [isResetDetailPage, setIsResetDetailPage] = useState<boolean>(true);
|
|
||||||
const [isResetSelection, setIsResetSelection] = useState<boolean>(false);
|
|
||||||
|
|
||||||
console.log('featureData', featureData);
|
// console.log('featureData data received:', featureData); // 추가 데이터 확인용
|
||||||
|
// console.log('rainMeasureData received:', rainMeasureData); // 추가 데이터 확인용
|
||||||
// 강우, 측정 정보 API 호출 함수
|
|
||||||
const fetchRainMeasureData = async (chmbrXcnts: string, chmbrYdnts: string) => {
|
|
||||||
setIsResetDetailPage(true);
|
|
||||||
setIsResetSelection(true);
|
|
||||||
if (!chmbrXcnts || !chmbrYdnts) {
|
|
||||||
console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { chmbrXcnts, chmbrYdnts });
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const queryParams = new URLSearchParams({
|
|
||||||
chmbrXcnts: chmbrXcnts,
|
|
||||||
chmbrYdnts: chmbrYdnts,
|
|
||||||
page: `${curPage - 1}`,
|
|
||||||
size: '3',
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('queryParams', queryParams.toString());
|
|
||||||
console.log(`추가 데이터 API 호출 시작: v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`);
|
|
||||||
|
|
||||||
const result = await getData(`v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`);
|
|
||||||
|
|
||||||
console.log('추가 데이터 API 호출 성공:', result);
|
|
||||||
|
|
||||||
const processedDataArray: any[] = result.content.map((data: any) => {
|
|
||||||
// 🎯 formatDisplayData로 기본 포맷팅 적용
|
|
||||||
const formattedItem = formatDisplayData(data);
|
|
||||||
|
|
||||||
// 🎯 추가 데이터 조합
|
|
||||||
return {
|
|
||||||
...formattedItem,
|
|
||||||
flwmtrCombined: `${data.flwmtrMesureTpEtc || '-'} / ${data.flwmtrKnd || '-'}`,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
setRainMeasureData(processedDataArray);
|
|
||||||
setTotalCount(result?.totalElements || 0);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('추가 데이터 로딩 실패:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 수량/수질측정 정보 API 호출 함수
|
|
||||||
const fetchMntrngsData = async (adstDstrCd: string, manageNo: string) => {
|
|
||||||
setIsResetDetailPage(true);
|
|
||||||
if (!adstDstrCd || !manageNo) {
|
|
||||||
console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { adstDstrCd, manageNo });
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const queryParams = new URLSearchParams({
|
|
||||||
page: `${curDetailPage - 1}`,
|
|
||||||
size: '3',
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`SSC 추가 데이터 API 호출 시작: v1/onsemiro/swgRain/${adstDstrCd}/${manageNo}/mntrngs?${queryParams.toString()}`);
|
|
||||||
|
|
||||||
const result = await getData(`v1/onsemiro/swgRain/${adstDstrCd}/${manageNo}/mntrngs?${queryParams.toString()}`);
|
|
||||||
|
|
||||||
console.log('SSC 추가 데이터 API 호출 성공:', result);
|
|
||||||
|
|
||||||
// 각 아이템 전처리
|
|
||||||
const processedDataArray = result.content.map((data: any) => {
|
|
||||||
// 기본 포맷팅 적용
|
|
||||||
const formattedItem = formatDisplayData(data);
|
|
||||||
return {
|
|
||||||
...formattedItem,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('processedDataArray', processedDataArray);
|
|
||||||
|
|
||||||
setMntrngsData(processedDataArray);
|
|
||||||
setTotalDetailCount(result?.totalElements || 0);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('추가 데이터 로딩 실패:', error);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 🎯 추가 데이터는 별도 useEffect로 비동기 로딩
|
|
||||||
useEffect(() => {
|
|
||||||
// 강우/측정 정보 데이터 호출
|
|
||||||
if (isMainSsc && chmbrXcnts && chmbrYdnts) {
|
|
||||||
fetchRainMeasureData(chmbrXcnts, chmbrYdnts)
|
|
||||||
}
|
|
||||||
}, [chmbrXcnts, chmbrYdnts]);
|
|
||||||
|
|
||||||
const openModal = () => {
|
const openModal = () => {
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
@@ -144,19 +46,6 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: {
|
|||||||
}
|
}
|
||||||
}, [featureData]);
|
}, [featureData]);
|
||||||
|
|
||||||
// featureData가 변경될 때 formData 초기화
|
|
||||||
useEffect(() => {
|
|
||||||
// showTable이 true일 때만 fetch (최초 렌더 방지)
|
|
||||||
setIsResetDetailPage(false);
|
|
||||||
setSelectedRowIndex(-1);
|
|
||||||
if (chmbrXcnts && chmbrYdnts) fetchRainMeasureData(chmbrXcnts, chmbrYdnts);
|
|
||||||
}, [curPage]);
|
|
||||||
|
|
||||||
// 페이지 변경 시마다 데이터 fetch
|
|
||||||
useEffect(() => {
|
|
||||||
if (chmbrXcnts && chmbrYdnts && selectedRowIndex !== -1) fetchMntrngsData(rainMeasureData[selectedRowIndex].adstDstrCd, rainMeasureData[selectedRowIndex].manageNo);
|
|
||||||
}, [curDetailPage]);
|
|
||||||
|
|
||||||
// 폼 데이터가 변경될 때 호출될 핸들러
|
// 폼 데이터가 변경될 때 호출될 핸들러
|
||||||
const handleFormDataChange = (newFormData: any) => {
|
const handleFormDataChange = (newFormData: any) => {
|
||||||
setFormData(newFormData);
|
setFormData(newFormData);
|
||||||
@@ -173,39 +62,91 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: {
|
|||||||
// 테이블 셀 클릭 핸들러 추가
|
// 테이블 셀 클릭 핸들러 추가
|
||||||
const handleCellClick = async (index: number | undefined, headId: string) => {
|
const handleCellClick = async (index: number | undefined, headId: string) => {
|
||||||
if (index !== undefined && rainMeasureData) {
|
if (index !== undefined && rainMeasureData) {
|
||||||
await fetchMntrngsData(rainMeasureData[index].adstDstrCd, rainMeasureData[index].manageNo);
|
const data = await fetchMntrngsData(rainMeasureData[index].adstDstrCd, rainMeasureData[index].manageNo);
|
||||||
|
|
||||||
|
setMntrngsData(data);
|
||||||
setSelectedRowIndex(index);
|
setSelectedRowIndex(index);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 🎯 추가 데이터 API 호출 함수 (독립적으로 실행)
|
||||||
|
const fetchMntrngsData = useCallback(async (adstDstrCd: string, manageNo: string) => {
|
||||||
|
if (!adstDstrCd || !manageNo) {
|
||||||
|
console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { adstDstrCd, manageNo });
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const queryParams = new URLSearchParams({
|
||||||
|
pageable: `{}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`SSC 추가 데이터 API 호출 시작: v1/onsemiro/swgRain?${queryParams.toString()}`);
|
||||||
|
|
||||||
|
const result = await getData(`v1/onsemiro/swgRain/${adstDstrCd}/${manageNo}/mntrngs?${queryParams.toString()}`);
|
||||||
|
|
||||||
|
console.log('SSC 추가 데이터 API 호출 성공:', result);
|
||||||
|
|
||||||
|
// 🎯 result가 페이지네이션 객체인 경우 content 배열 추출
|
||||||
|
let dataArray: any[] = [];
|
||||||
|
if (result && typeof result === 'object' && 'content' in result && Array.isArray(result.content)) {
|
||||||
|
dataArray = result.content;
|
||||||
|
} else if (Array.isArray(result)) {
|
||||||
|
dataArray = result;
|
||||||
|
} else {
|
||||||
|
console.warn('예상치 못한 API 응답 형식:', result);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🎯 각 아이템을 전처리하여 반환
|
||||||
|
const processedDataArray = dataArray.map((data: any) => {
|
||||||
|
// 🎯 formatDisplayData로 기본 포맷팅 적용
|
||||||
|
const formattedItem = formatDisplayData(data);
|
||||||
|
|
||||||
|
// 🎯 추가 데이터 조합
|
||||||
|
return {
|
||||||
|
...formattedItem,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('processedDataArray', processedDataArray);
|
||||||
|
|
||||||
|
return processedDataArray;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('추가 데이터 로딩 실패:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
const renderModalBody = () => (
|
const renderModalBody = () => (
|
||||||
<div className='grid grid-cols-1 gap-4 p-4'>
|
<div className='grid grid-cols-1 gap-4 p-4'>
|
||||||
{/* 강우정보 테이블 */}
|
{/* 강우정보 테이블 */}
|
||||||
<UiTable
|
<UiTable
|
||||||
headName='강우정보'
|
headName='강우정보'
|
||||||
tableData={rainMeasureData}
|
tableData={Array.isArray(rainMeasureData) ? rainMeasureData : []}
|
||||||
headlist={untrtSwgRainCol3}
|
headlist={untrtSwgRainCol3}
|
||||||
pageSize={3}
|
pageSize={10}
|
||||||
total={0}
|
total={Array.isArray(rainMeasureData) ? rainMeasureData.length : 0}
|
||||||
cellClick={handleCellClick}
|
cellClick={handleCellClick}
|
||||||
onPageChange={setCurPage}
|
onPageChange={function (page: number): void {
|
||||||
resetPageNo={isResetPage}
|
console.log('Rain data page change:', page);
|
||||||
resetSelection={isResetSelection}
|
}}
|
||||||
index={selectedRowIndex}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 측정정보 테이블 */}
|
{/* 측정정보 테이블 */}
|
||||||
<UiTable
|
<UiTable
|
||||||
headName='측정정보'
|
headName='측정정보'
|
||||||
tableData={rainMeasureData}
|
tableData={Array.isArray(rainMeasureData) ? rainMeasureData : []}
|
||||||
headlist={untrtSwgRainCol4}
|
headlist={untrtSwgRainCol4}
|
||||||
pageSize={3}
|
pageSize={10}
|
||||||
total={totalCount}
|
total={Array.isArray(rainMeasureData) ? rainMeasureData.length : 0}
|
||||||
cellClick={handleCellClick}
|
cellClick={handleCellClick}
|
||||||
onPageChange={setCurPage}
|
// onPageChange={setCurPage}
|
||||||
resetPageNo={isResetPage}
|
onPageChange={function (page: number): void {
|
||||||
resetSelection={isResetSelection}
|
console.log('Rain data page change:', page);
|
||||||
index={selectedRowIndex}
|
}}
|
||||||
|
resetPageNo={false}
|
||||||
|
// index={curPage}
|
||||||
>
|
>
|
||||||
{/* 커스텀 헤더 */}
|
{/* 커스텀 헤더 */}
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -227,13 +168,14 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: {
|
|||||||
{/* 수량/수질측정 정보 테이블 */}
|
{/* 수량/수질측정 정보 테이블 */}
|
||||||
<UiTable
|
<UiTable
|
||||||
headName='수량/수질측정 정보'
|
headName='수량/수질측정 정보'
|
||||||
tableData={mntrngsData}
|
tableData={Array.isArray(mntrngsData) ? mntrngsData : []}
|
||||||
headlist={untrtSwgRainCol5}
|
headlist={untrtSwgRainCol5}
|
||||||
pageSize={3}
|
pageSize={10}
|
||||||
total={totalDetailCount}
|
total={Array.isArray(mntrngsData) ? mntrngsData.length : 0}
|
||||||
cellClick={undefined}
|
cellClick={undefined}
|
||||||
onPageChange={setCurDetailPage}
|
onPageChange={function (page: number): void {
|
||||||
resetPageNo={isResetDetailPage}
|
console.log('Quality data page change:', page);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
'use client'
|
|
||||||
import React, { useState,useEffect } from 'react'
|
|
||||||
import Modal from '@/components/ui/modal';
|
import Modal from '@/components/ui/modal';
|
||||||
import { VerticalTable } from '@/components/ui/verticalTable';
|
import { VerticalTable } from '@/components/ui/verticalTable';
|
||||||
import { UiTable } from '@common/business_components/ui';
|
import { UiTable } from '@common/business_components/ui';
|
||||||
import { Button } from '@common/components/ui';
|
import { Button, TableCell } from '@common/components/ui';
|
||||||
import { useDcTree, flattenFolders, getFileDownload, addFileName, type FlattenedFolder} from '../../searchModal/searchModalReportApi';
|
import React, { useState } from 'react'
|
||||||
|
|
||||||
// 하수처리시설
|
// 하수처리시설
|
||||||
const headList = [
|
const headList = [
|
||||||
{ id: "title", title: "하수도정비 기본계획보고서" },
|
{ id: "title", title: "하수도정비 기본계획보고서" },
|
||||||
];
|
{ id: "cad", title: "하수도대장 평면도" },]
|
||||||
const modalHeadList = [
|
const modalHeadList = [
|
||||||
{ id: "no", title: "번호" },
|
{ id: "no", title: "번호" },
|
||||||
{ id: "year", title: "승인연도" },
|
{ id: "year", title: "승인연도" },
|
||||||
@@ -18,10 +16,9 @@ const modalHeadList = [
|
|||||||
{ id: "date", title: "입력시간" },
|
{ id: "date", title: "입력시간" },
|
||||||
]
|
]
|
||||||
|
|
||||||
const SwtrmtFclt = ({ gisObject }: { gisObject: any }) => {
|
const SwtrmtFclt = () => {
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
const [modalTitle, setModalTitle] = useState<string>('');
|
const [modalTitle, setModalTitle] = useState<string>('');
|
||||||
const [dcDataOne, setDcDataOne] = useState<FlattenedFolder|undefined>({});
|
|
||||||
const openModal = (title: string) => {
|
const openModal = (title: string) => {
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
setModalTitle(title)
|
setModalTitle(title)
|
||||||
@@ -29,59 +26,22 @@ const SwtrmtFclt = ({ gisObject }: { gisObject: any }) => {
|
|||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
};
|
};
|
||||||
const ctpvNm = gisObject?.ctpv_nm;
|
|
||||||
//const reportOriginData = useDcTree(ctpvNm);
|
|
||||||
const reportOriginData = useDcTree("강원특별자치도");
|
|
||||||
useEffect(() => {
|
|
||||||
const fetch = async () => {
|
|
||||||
|
|
||||||
if (!reportOriginData || reportOriginData.length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const reportData = flattenFolders(reportOriginData);
|
|
||||||
let filterReportData = [...reportData];
|
|
||||||
if (gisObject && gisObject.sgg_nm !== undefined && gisObject.sgg_nm !== "") { // 시군구검색
|
|
||||||
//const sggNm = gisObject?.sgg_nm;
|
|
||||||
const sggNm = "강릉시";
|
|
||||||
filterReportData = filterReportData.filter(item => item.sigungu === sggNm);
|
|
||||||
}
|
|
||||||
addFileName(filterReportData).then(data => {
|
|
||||||
filterReportData = data.filter(item => item.filePath !== undefined && item.filePath !== "");
|
|
||||||
if (filterReportData !== undefined && filterReportData.length > 0) {
|
|
||||||
setDcDataOne(filterReportData[0]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log("filterReportData", filterReportData);
|
|
||||||
};
|
|
||||||
fetch();
|
|
||||||
}, [reportOriginData]);
|
|
||||||
|
|
||||||
// 하수도정비기본계획 filedownload 핸들러
|
|
||||||
const handleFileDownloadClick = () => {
|
|
||||||
if (dcDataOne && dcDataOne !== undefined && dcDataOne.fileSn !== undefined && dcDataOne.fileSn !== ""
|
|
||||||
&& dcDataOne.filePath !== undefined && dcDataOne.filePath !== "" && dcDataOne.fileName !== undefined && dcDataOne.fileName !== "" ) {
|
|
||||||
console.log("dcDataOne", dcDataOne);
|
|
||||||
getFileDownload(String(dcDataOne.fileSn), String(dcDataOne.fileName), String(dcDataOne.filePath));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//cad: <Button onClick={() => openModal('하수도대장 평면도')}>평면도</Button>,
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<VerticalTable
|
<VerticalTable children={{
|
||||||
children={{
|
title: <Button onClick={() => openModal('하수도정비 기본계획보고서')}>보고서</Button>,
|
||||||
title: <Button className="gray" onClick={() => handleFileDownloadClick()}>다운로드</Button>
|
cad: <Button onClick={() => openModal('하수도대장 평면도')}>평면도</Button>,
|
||||||
}} headName='디지털 자료관 연계정보' tableData={[]} headlist={headList} pageSize={20} total={0} cellClick={undefined} isEditable={true} onPageChange={function (page: number): void {
|
}} headName='디지털 자료관 연계정보' tableData={[]} headlist={headList} pageSize={20} total={0} cellClick={undefined} isEditable={true} onPageChange={function (page: number): void {
|
||||||
throw new Error("Function not implemented.");
|
throw new Error("Function not implemented.");
|
||||||
}}></VerticalTable>
|
}}></VerticalTable>
|
||||||
{/* <Modal isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} closeModal={closeModal}>
|
<Modal isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} closeModal={closeModal}>
|
||||||
<div className='grid grid-col-2'>
|
<div className='grid grid-col-2'>
|
||||||
<UiTable headName={modalTitle} tableData={[]} headlist={modalHeadList} pageSize={20} total={0} cellClick={undefined} onPageChange={function (page: number): void {
|
<UiTable headName={modalTitle} tableData={[]} headlist={modalHeadList} pageSize={20} total={0} cellClick={undefined} children={undefined} onPageChange={function (page: number): void {
|
||||||
throw new Error("Function not implemented.");
|
throw new Error("Function not implemented.");
|
||||||
}
|
}
|
||||||
}></UiTable>
|
}></UiTable>
|
||||||
</div>
|
</div>
|
||||||
</Modal> */}
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+125
-47
@@ -5,13 +5,13 @@ import { VerticalTable } from "@/components/ui/verticalTable";
|
|||||||
import { useGisContext } from "@common/business_components/ui/map/Gis";
|
import { useGisContext } from "@common/business_components/ui/map/Gis";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
import { useEffect, useRef, useState, useCallback, useMemo } from "react";
|
import { useEffect, useRef, useState, useCallback, useMemo } from "react";
|
||||||
import { getLayerContentComponent } from "../common";
|
import { getLayerContentComponent } from "./components/common";
|
||||||
import { SwtrmtFcltCol, SwtrmtFcltCol2, SwtrmtPrcsZoneCol, SwtrmtPrcsZoneCol2, untrtSwgRainCol1, untrtSwgRainCol2, MsSwagePplCol, MsSwagePplCol2, ExclnSewagePumpCol, ExclnSewagePumpCol2, DrtwSewagePumpCol, DrtwSewagePumpCol2, MsSwageMhlCol, MsSwageMhlCol2, stofcbrCol, stofcbrCol2, MS_SWAGE_MHL_CODES, DRTW_SEWAGE_PUMP_USE_CODES } from "../common/table";
|
import { SwtrmtFcltCol, SwtrmtFcltCol2, SwtrmtPrcsZoneCol, SwtrmtPrcsZoneCol2, untrtSwgRainCol1, untrtSwgRainCol2, MsSwagePplCol, MsSwagePplCol2, ExclnSewagePumpCol, ExclnSewagePumpCol2, DrtwSewagePumpCol, DrtwSewagePumpCol2, MsSwageMhlCol, MsSwageMhlCol2, stofcbrCol, stofcbrCol2, MS_SWAGE_MHL_CODES, DRTW_SEWAGE_PUMP_USE_CODES } from "./components/common/table";
|
||||||
import InfilChart from './chart/infilChart';
|
import InfilChart from './components/popupComponent/chart/infilChart';
|
||||||
import RdiiChart from './chart/rdiiChart';
|
import RdiiChart from './components/popupComponent/chart/rdiiChart';
|
||||||
import { useInfilChartModalStore, useRdiiChartModalStore } from "./chartModalStore";
|
import { useInfilChartModalStore, useRdiiChartModalStore } from "./components/popupComponent/chartModalStore";
|
||||||
import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
||||||
import { codeMapper } from "../common/codeMapper";
|
import { codeMapper } from "./components/common/codeMapper";
|
||||||
import { searchUpperPpls } from '@common/business_components/ui/map/Gis';
|
import { searchUpperPpls } from '@common/business_components/ui/map/Gis';
|
||||||
import LoadingOverlay from '@/components/ui/LoadingBar';
|
import LoadingOverlay from '@/components/ui/LoadingBar';
|
||||||
|
|
||||||
@@ -21,6 +21,7 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
const [layerNm, setLayerNm] = useState<string>(""); // 레이어 이름 상태
|
const [layerNm, setLayerNm] = useState<string>(""); // 레이어 이름 상태
|
||||||
const [layerSpecificNm, setLayerSpecificNm] = useState<string>(""); // 레이어 이름 상태
|
const [layerSpecificNm, setLayerSpecificNm] = useState<string>(""); // 레이어 이름 상태
|
||||||
const [tableData, setTableData] = useState<any>(null); // 피처 데이터
|
const [tableData, setTableData] = useState<any>(null); // 피처 데이터
|
||||||
|
const [rainMeasureData, setRainMeasureData] = useState<any[]>([]); // 강우/측정 측정 정보
|
||||||
const [headlist, setHeadlist] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태
|
const [headlist, setHeadlist] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태
|
||||||
const [headlist2, setHeadlist2] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태
|
const [headlist2, setHeadlist2] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태
|
||||||
const [buttonChk, setButtonChk] = useState(true)
|
const [buttonChk, setButtonChk] = useState(true)
|
||||||
@@ -32,10 +33,9 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
// 🎯 InfilChart 및 RdiiChart 관련 상태 추가
|
// 🎯 InfilChart 및 RdiiChart 관련 상태 추가
|
||||||
const { setIsOpen: setIsModalInfil } = useInfilChartModalStore();
|
const { setIsOpen: setIsModalInfil } = useInfilChartModalStore();
|
||||||
const { setIsOpen: setIsModalRdii } = useRdiiChartModalStore();
|
const { setIsOpen: setIsModalRdii } = useRdiiChartModalStore();
|
||||||
|
const [curPage, setCurPage] = useState(1); // 현재 페이지 상태
|
||||||
const [isClicked, setIsClicked] = useState(true); // 클릭 여부 상태
|
const [isClicked, setIsClicked] = useState(true); // 클릭 여부 상태
|
||||||
const [isLoading, setIsLoading] = useState(false); // 로딩 상태
|
const [isLoading, setIsLoading] = useState(false); // 로딩 상태
|
||||||
const [chmbrXcnts, setChmbrXcnts] = useState<string>(''); // 로딩 상태
|
|
||||||
const [chmbrYdnts, setChmbrYdnts] = useState<string>(''); // 로딩 상태
|
|
||||||
|
|
||||||
// 🎯 관로관리번호 추출
|
// 🎯 관로관리번호 추출
|
||||||
const pplMngNo = featureData?.values_?.fclt_mng_no || "";
|
const pplMngNo = featureData?.values_?.fclt_mng_no || "";
|
||||||
@@ -263,9 +263,18 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
data: { ...processedFormattedData }
|
data: { ...processedFormattedData }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
setChmbrXcnts(data.chmbr_xcnts);
|
// 강우/측정 정보 데이터 호출
|
||||||
setChmbrYdnts(data.chmbr_ydnts);
|
if (tableData?.chmbr_xcnts && tableData?.chmbr_ydnts) {
|
||||||
|
fetchRainMeasureData(tableData.chmbr_xcnts, tableData.chmbr_ydnts)
|
||||||
|
.then(response => {
|
||||||
|
console.log('additionalResponse', response);
|
||||||
|
setRainMeasureData(response || []);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('추가 데이터 로딩 실패:', error);
|
||||||
|
setRainMeasureData([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -308,6 +317,76 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, [featureId, processedData]);
|
}, [featureId, processedData]);
|
||||||
|
|
||||||
|
// 🎯 추가 데이터 API 호출 함수
|
||||||
|
const fetchRainMeasureData = useCallback(async (chmbrXcnts: string, chmbrYdnts: string) => {
|
||||||
|
if (!chmbrXcnts || !chmbrYdnts) {
|
||||||
|
console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { chmbrXcnts, chmbrYdnts });
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const queryParams = new URLSearchParams({
|
||||||
|
chmbrXcnts: chmbrXcnts,
|
||||||
|
chmbrYdnts: chmbrYdnts,
|
||||||
|
pageable: `{}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`추가 데이터 API 호출 시작: v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`);
|
||||||
|
|
||||||
|
const result = await getData(`v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`);
|
||||||
|
|
||||||
|
console.log('추가 데이터 API 호출 성공:', result);
|
||||||
|
|
||||||
|
// 🎯 result가 페이지네이션 객체인 경우 content 배열 추출
|
||||||
|
let dataArray: any[] = [];
|
||||||
|
if (result && typeof result === 'object' && 'content' in result && Array.isArray(result.content)) {
|
||||||
|
dataArray = result.content;
|
||||||
|
} else if (Array.isArray(result)) {
|
||||||
|
dataArray = result;
|
||||||
|
} else {
|
||||||
|
console.warn('예상치 못한 API 응답 형식:', result);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🎯 각 아이템을 전처리하여 반환
|
||||||
|
const processedDataArray = dataArray.map((data: any) => {
|
||||||
|
// 🎯 formatDisplayData로 기본 포맷팅 적용
|
||||||
|
const formattedItem = formatDisplayData(data);
|
||||||
|
|
||||||
|
// 🎯 추가 데이터 조합
|
||||||
|
return {
|
||||||
|
...formattedItem,
|
||||||
|
flwmtrCombined: `${data.flwmtrMesureTpEtc || '-'} / ${data.flwmtrKnd || '-'}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return processedDataArray;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('추가 데이터 로딩 실패:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 🎯 추가 데이터는 별도 useEffect로 비동기 로딩
|
||||||
|
useEffect(() => {
|
||||||
|
if (layerNm === '중점우수토실' && featureData?.values_) {
|
||||||
|
const data = featureData.values_;
|
||||||
|
|
||||||
|
if (data?.chmbr_xcnts && data?.chmbr_ydnts) {
|
||||||
|
// 🎯 추가 데이터를 비동기로 로딩 (UI 블로킹 없음)
|
||||||
|
fetchRainMeasureData(data.chmbr_xcnts, data.chmbr_ydnts)
|
||||||
|
.then(response => {
|
||||||
|
console.log('추가 데이터 로딩 완료:', response);
|
||||||
|
setRainMeasureData(response || []);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('추가 데이터 최종 로딩 실패:', error);
|
||||||
|
setRainMeasureData([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [layerNm, featureData?.values_, fetchRainMeasureData]);
|
||||||
|
|
||||||
// 저장 시 모달 띄우기
|
// 저장 시 모달 띄우기
|
||||||
const handleSaveClick = () => {
|
const handleSaveClick = () => {
|
||||||
setIsModalOpen(true); // 모달 열기
|
setIsModalOpen(true); // 모달 열기
|
||||||
@@ -403,45 +482,45 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
</>
|
</>
|
||||||
)} 정보 <br />관리번호 : {layerSpecificNm}
|
)} 정보 <br />관리번호 : {layerSpecificNm}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
<div className="flex items-center space-x-3">
|
||||||
<div className="flex items-center space-x-3">
|
{/* 🎯 하수관로일 때만 Infil/RDII 버튼 표시 */}
|
||||||
{/* 하수관로일 때만 Infil/RDII 버튼 표시 */}
|
{layerNm === '하수관로' && (
|
||||||
{layerNm === '하수관로' && (
|
<>
|
||||||
<>
|
<Button onClick={() => setIsModalInfil(true)}
|
||||||
<Button onClick={() => setIsModalInfil(true)}
|
className="py-1 text-xl text-blue-600 border border-blue-600 rounded hover:bg-gray-700"
|
||||||
className="py-1 text-xl text-blue-600 border border-blue-600 rounded hover:bg-gray-700"
|
color="white"
|
||||||
color="white"
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
침입수분석
|
||||||
침입수분석
|
</Button>
|
||||||
</Button>
|
<Button onClick={() => setIsModalRdii(true)}
|
||||||
<Button onClick={() => setIsModalRdii(true)}
|
className="py-1 text-xl text-gray-600 border border-gray-600 rounded hover:bg-gray-700"
|
||||||
className="py-1 text-xl text-gray-600 border border-gray-600 rounded hover:bg-gray-700 mr-4"
|
color="white"
|
||||||
color="white"
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
RDII분석
|
||||||
RDII분석
|
</Button>
|
||||||
</Button>
|
</>
|
||||||
</>
|
)}
|
||||||
)}
|
{layerNm === '하수맨홀' && (
|
||||||
{layerNm === '하수맨홀' && (
|
<>
|
||||||
<>
|
<Button onClick={() => {
|
||||||
<Button
|
|
||||||
color="white"
|
|
||||||
className="px-2 py-1 text-xl text-gray-600 border border-gray-600 rounded hover:bg-gray-700 mr-4"
|
|
||||||
onClick={() => {
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
searchUpperPpls(layerSpecificNm).finally(() => setIsLoading(false));
|
searchUpperPpls(layerSpecificNm).finally(() => setIsLoading(false));
|
||||||
}}
|
}}
|
||||||
>
|
className="px-2 py-1 text-xl text-gray-600 border border-gray-600 rounded hover:bg-gray-700"
|
||||||
상류관로 보기
|
color="white"
|
||||||
</Button>
|
>
|
||||||
</>
|
상류관로 보기
|
||||||
)}
|
</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
className="flex items-center space-x-4 text-white hover:text-gray-300 focus:outline-none"
|
// className="text-white hover:text-gray-300 focus:outline-none"
|
||||||
|
className="absolute top-8 right-4 text-white hover:text-gray-300 focus:outline-none"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
✕
|
✕
|
||||||
@@ -474,14 +553,13 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
|
|||||||
featureData={fetchData}
|
featureData={fetchData}
|
||||||
isMainSsc={isMainSsc}
|
isMainSsc={isMainSsc}
|
||||||
isDrtwSewagePump={isDrtwSewagePump}
|
isDrtwSewagePump={isDrtwSewagePump}
|
||||||
|
rainMeasureData={rainMeasureData}
|
||||||
onSaveClick={handleSaveClick}
|
onSaveClick={handleSaveClick}
|
||||||
chmbrXcnts={chmbrXcnts}
|
|
||||||
chmbrYdnts={chmbrYdnts}
|
|
||||||
gisObject={featureData.values_}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 🎯 InfilChart 및 RdiiChart 컴포넌트 추가 */}
|
||||||
<InfilChart pplMngNo={pplMngNo} />
|
<InfilChart pplMngNo={pplMngNo} />
|
||||||
<RdiiChart pplMngNo={pplMngNo} />
|
<RdiiChart pplMngNo={pplMngNo} />
|
||||||
</div>
|
</div>
|
||||||
@@ -5,8 +5,7 @@ import { getData } from "../../components/lib/api";
|
|||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
||||||
import SearchModal from "./searchModal/searchModal";
|
import SearchModal from "./searchModal/searchModal";
|
||||||
import FeatureClickEventPopup from "./components/popupComponent/featureClickEventPopup";
|
import FeatureClickEventPopup from "./featureClickEventPopup";
|
||||||
import { SearchBar } from "./searchBar/searchBar";
|
|
||||||
|
|
||||||
// 타입 정의 추가
|
// 타입 정의 추가
|
||||||
export type LyrStngProps = {
|
export type LyrStngProps = {
|
||||||
@@ -40,11 +39,6 @@ const Map = () => {
|
|||||||
const [isSearchModalOpen, setIsSearchModalOpen] = useState(false); // SearchModal 열림 상태
|
const [isSearchModalOpen, setIsSearchModalOpen] = useState(false); // SearchModal 열림 상태
|
||||||
const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터
|
const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const data = await getData("v1/map/lyrStngs/SN_NETWORK");
|
const data = await getData("v1/map/lyrStngs/SN_NETWORK");
|
||||||
@@ -54,6 +48,9 @@ const Map = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchData();
|
||||||
|
}, []);
|
||||||
// SearchModal, GisContent 등에서 호출
|
// SearchModal, GisContent 등에서 호출
|
||||||
const onFeatureSelect = (data: any) => {
|
const onFeatureSelect = (data: any) => {
|
||||||
let map = gisMaps.current;
|
let map = gisMaps.current;
|
||||||
@@ -133,7 +130,6 @@ const Map = () => {
|
|||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
isSearchModalOpen={isSearchModalOpen}
|
isSearchModalOpen={isSearchModalOpen}
|
||||||
onCheckedLayersChange={undefined}
|
onCheckedLayersChange={undefined}
|
||||||
searchBar={SearchBar}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
"use client";
|
|
||||||
import {
|
|
||||||
SearchDiv,
|
|
||||||
SearchFormLeft,
|
|
||||||
SelectBox,
|
|
||||||
type SelectDataType,
|
|
||||||
} from "@common/business_components/ui";
|
|
||||||
import { useCallback, useEffect, useState } from "react";
|
|
||||||
|
|
||||||
export function SearchBar() {
|
|
||||||
const [sidoValue, setSidoValue] = useState<string>("");
|
|
||||||
const [sigunValue, setSigunValue] = useState<string>("");
|
|
||||||
const [filteredSigunData, setFilteredSigunData] = useState<SelectDataType[]>([
|
|
||||||
{ text: "시도 선택", val: "0" },
|
|
||||||
]);
|
|
||||||
|
|
||||||
const initializeSigunData = useCallback((sidoCd: string) => {
|
|
||||||
if (sidoCd === "0") {
|
|
||||||
setSigunValue("0");
|
|
||||||
setFilteredSigunData([{ text: "시도 선택", val: "0" }]);
|
|
||||||
} else {
|
|
||||||
const newFilteredData = [
|
|
||||||
{ text: "데이터", val: "0" },
|
|
||||||
// ...Common.selectSigunData.filter(
|
|
||||||
// (item: SelectDataType) => item.val.substring(0, 2) === sidoCd,
|
|
||||||
// ),
|
|
||||||
];
|
|
||||||
setSigunValue("0");
|
|
||||||
setFilteredSigunData(newFilteredData);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
const onSelectValue = useCallback(
|
|
||||||
(val: string, type: string) => {
|
|
||||||
switch (type) {
|
|
||||||
case "ctpvCd":
|
|
||||||
initializeSigunData(val);
|
|
||||||
setSidoValue(val);
|
|
||||||
break;
|
|
||||||
case "sggCd":
|
|
||||||
setSigunValue(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[initializeSigunData],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="grid grid-cols-4 gap-4">
|
|
||||||
<div className="col-span-4">
|
|
||||||
<div className="card card-border flex">
|
|
||||||
<div className="col-span-10 flex flex-row">
|
|
||||||
<SelectBox
|
|
||||||
className="mr-10 w-[200px]"
|
|
||||||
selectClass="rounded-lg bg-white"
|
|
||||||
label="시도"
|
|
||||||
selectArray={/* Common.selectSidoData || */ []}
|
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "ctpvCd")}
|
|
||||||
value={sidoValue || /* Common.selectSidoData[0]?.val || */ ""}
|
|
||||||
/>
|
|
||||||
<SelectBox
|
|
||||||
className="mr-10 w-[200px]"
|
|
||||||
selectClass="rounded-lg bg-white"
|
|
||||||
label="시군구"
|
|
||||||
selectArray={filteredSigunData || []}
|
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "sggCd")}
|
|
||||||
value={sigunValue}
|
|
||||||
/>
|
|
||||||
<SelectBox
|
|
||||||
className="mr-3 w-[250px]"
|
|
||||||
selectClass="rounded-lg bg-white"
|
|
||||||
labelClass="w-[200px]"
|
|
||||||
label="하수처리시설명"
|
|
||||||
selectArray={filteredSigunData || []}
|
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "sggCd")}
|
|
||||||
value={sigunValue}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -39,9 +39,7 @@ interface BasicTabProps {
|
|||||||
// setTableCount?: (count: number) => void;
|
// setTableCount?: (count: number) => void;
|
||||||
setBasicType: (type: string) => void;
|
setBasicType: (type: string) => void;
|
||||||
setCity: (city: number) => void;
|
setCity: (city: number) => void;
|
||||||
setCtpvName: (name: string) => void;
|
|
||||||
setSgg: (sgg: number) => void;
|
setSgg: (sgg: number) => void;
|
||||||
setSggName: (name: string) => void;
|
|
||||||
setYearFilter: (filter: { start: string; end: string }) => void;
|
setYearFilter: (filter: { start: string; end: string }) => void;
|
||||||
setStart1: (value: string) => void;
|
setStart1: (value: string) => void;
|
||||||
setStart2: (value: string) => void;
|
setStart2: (value: string) => void;
|
||||||
@@ -70,9 +68,7 @@ const BasicTab: React.FC<BasicTabProps> = ({
|
|||||||
// setTableCount,
|
// setTableCount,
|
||||||
setBasicType,
|
setBasicType,
|
||||||
setCity,
|
setCity,
|
||||||
setCtpvName,
|
|
||||||
setSgg,
|
setSgg,
|
||||||
setSggName,
|
|
||||||
setYearFilter,
|
setYearFilter,
|
||||||
setStart1,
|
setStart1,
|
||||||
setStart2,
|
setStart2,
|
||||||
@@ -82,15 +78,14 @@ const BasicTab: React.FC<BasicTabProps> = ({
|
|||||||
setVar2,
|
setVar2,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className="relative border rounded-lg p-5 w-full h-[10vh]">
|
<div className="relative border rounded-lg p-6 w-full h-[10vh]">
|
||||||
{/* 구분 */}
|
{/* 구분 */}
|
||||||
<div className="mb-3 flex items-center justify-between gap-4">
|
<div className="mb-3 flex items-center justify-between gap-4">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">구분</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-[150px] mr-3"
|
className="w-[150px] mr-3"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg bg-white"
|
||||||
label=""
|
label="구분"
|
||||||
selectArray={BASIC_TYPES}
|
selectArray={BASIC_TYPES}
|
||||||
onSelectValue={(value: string | number) =>
|
onSelectValue={(value: string | number) =>
|
||||||
setBasicType(String(value))
|
setBasicType(String(value))
|
||||||
@@ -106,16 +101,12 @@ const BasicTab: React.FC<BasicTabProps> = ({
|
|||||||
var1={var1}
|
var1={var1}
|
||||||
var2={var2}
|
var2={var2}
|
||||||
start1={start1}
|
start1={start1}
|
||||||
start2={start2}
|
|
||||||
end1={end1}
|
end1={end1}
|
||||||
end2={end2}
|
|
||||||
yearFilter={yearFilter}
|
yearFilter={yearFilter}
|
||||||
setVar1={setVar1}
|
setVar1={setVar1}
|
||||||
setVar2={setVar2}
|
setVar2={setVar2}
|
||||||
setStart1={setStart1}
|
setStart1={setStart1}
|
||||||
setStart2={setStart2}
|
|
||||||
setEnd1={setEnd1}
|
setEnd1={setEnd1}
|
||||||
setEnd2={setEnd2}
|
|
||||||
setYearFilter={setYearFilter}
|
setYearFilter={setYearFilter}
|
||||||
handleSearch={handleSearch}
|
handleSearch={handleSearch}
|
||||||
/>
|
/>
|
||||||
@@ -128,18 +119,12 @@ const BasicTab: React.FC<BasicTabProps> = ({
|
|||||||
start2={start2}
|
start2={start2}
|
||||||
end1={end1}
|
end1={end1}
|
||||||
end2={end2}
|
end2={end2}
|
||||||
city={city}
|
|
||||||
sgg={sgg}
|
|
||||||
yearFilter={yearFilter}
|
yearFilter={yearFilter}
|
||||||
setVar1={setVar1}
|
setVar1={setVar1}
|
||||||
setStart1={setStart1}
|
setStart1={setStart1}
|
||||||
setStart2={setStart2}
|
setStart2={setStart2}
|
||||||
setEnd1={setEnd1}
|
setEnd1={setEnd1}
|
||||||
setEnd2={setEnd2}
|
setEnd2={setEnd2}
|
||||||
setCity={setCity}
|
|
||||||
setCtpvName={setCtpvName}
|
|
||||||
setSgg={setSgg}
|
|
||||||
setSggName={setSggName}
|
|
||||||
setYearFilter={setYearFilter}
|
setYearFilter={setYearFilter}
|
||||||
handleSearch={handleSearch}
|
handleSearch={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,15 +1,42 @@
|
|||||||
import React from 'react';
|
|
||||||
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
||||||
import { SelectBox } from '@common/business_components/ui';
|
import { SelectBox } from '@common/business_components/ui';
|
||||||
import { Button, Input, Label } from '@common/components';
|
import { Button, Input, Label } from '@common/components';
|
||||||
import useStore from '../../../store/useStore';
|
import React from 'react';
|
||||||
|
//import { useDcTree, flattenFolders, useSggCd, useCityCd } from './components/searchModalReportApi';
|
||||||
|
// import { useBizByFcltStore } from "../../../store/StoreProvider";
|
||||||
|
|
||||||
// 운영정보 '구분' 선택 목록
|
// 운영정보 '구분' 선택 목록
|
||||||
|
// const WORK_TYPES = [
|
||||||
|
// { val: "maintenance", text: "보수 및 갱신" },
|
||||||
|
// { val: "cleaning", text: "청소 및 준설" },
|
||||||
|
// { val: "inspection", text: "점검 및 진단" },
|
||||||
|
// ];
|
||||||
export const WORK_TYPES = [
|
export const WORK_TYPES = [
|
||||||
{ val: "['200', '201', '204']", text: "보수 및 갱신" },
|
{ val: "200", text: "보수 및 갱신(개대체)" },
|
||||||
{ val: "['100']", text: "점검 및 진단" },
|
{ val: "201", text: "보수 및 갱신(유지보수)" },
|
||||||
{ val: "['203']", text: "청소 및 준설" },
|
{ val: "204", text: "보수 및 갱신(단순보수)" },
|
||||||
|
{ val: "100", text: "점검 및 진단" },
|
||||||
|
{ val: "203", text: "청소 및 준설" },
|
||||||
];
|
];
|
||||||
|
// const BIZ_SE_CD = useBizByFcltStore(state => state.BIZ_SE_CD);
|
||||||
|
export const BIZ_SE_CD = [
|
||||||
|
{ lwpoCd: "100", lwpoCdNm: "관로기술진단" },
|
||||||
|
{ lwpoCd: "200", lwpoCdNm: "개대체" },
|
||||||
|
{ lwpoCd: "201", lwpoCdNm: "유지보수" },
|
||||||
|
{ lwpoCd: "203", lwpoCdNm: "청소, 준설" },
|
||||||
|
{ lwpoCd: "204", lwpoCdNm: "단순보수" },
|
||||||
|
];
|
||||||
|
// const BIZ_TY_CD = useBizByFcltStore(state => state.BIZ_TY_CD);
|
||||||
|
export const BIZ_TY_CD = [
|
||||||
|
{ lwpoCd: "0", lwpoCdNm: "전체" },
|
||||||
|
{ lwpoCd: "SV", lwpoCdNm: "용역" },
|
||||||
|
{ lwpoCd: "SF", lwpoCdNm: "자체" },
|
||||||
|
{ lwpoCd: "SC", lwpoCdNm: "공사" },
|
||||||
|
];
|
||||||
|
export const BIZ_TY_CD_SELECT_ARRAY = BIZ_TY_CD.map(item => ({
|
||||||
|
val: item.lwpoCd,
|
||||||
|
text: item.lwpoCdNm,
|
||||||
|
}));
|
||||||
// 운영정보 - 사업 현황
|
// 운영정보 - 사업 현황
|
||||||
export const operationTableHeadlist = [
|
export const operationTableHeadlist = [
|
||||||
{ id: 'rowNumber', title: '일련번호' },
|
{ id: 'rowNumber', title: '일련번호' },
|
||||||
@@ -85,22 +112,13 @@ const OperationTab: React.FC<OperationTabProps> = ({
|
|||||||
setVar2,
|
setVar2,
|
||||||
setYearFilter,
|
setYearFilter,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const { BIZ_TY_CD } = useStore();
|
|
||||||
|
|
||||||
const BIZ_TY_CD_SELECT_ARRAY = BIZ_TY_CD.map(item => ({
|
|
||||||
val: item.lwpoCd,
|
|
||||||
text: item.lwpoCdNm,
|
|
||||||
}));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex flex-col border rounded-lg p-5 w-full h-[10vh]">
|
<div className="relative flex flex-col border rounded-lg p-6 w-full h-[10vh]">
|
||||||
<div className="flex items-center mb-3">
|
<div className="flex items-center mb-3">
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">업무구분</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-80 mr-8"
|
className="w-80 mr-8"
|
||||||
selectClass="rounded-lg bg-white text-xl"
|
selectClass="rounded-lg bg-white text-xl"
|
||||||
label=""
|
label="업무구분"
|
||||||
selectArray={WORK_TYPES.map((w) => ({
|
selectArray={WORK_TYPES.map((w) => ({
|
||||||
val: w.val,
|
val: w.val,
|
||||||
text: w.text,
|
text: w.text,
|
||||||
@@ -111,18 +129,12 @@ const OperationTab: React.FC<OperationTabProps> = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center mb-6">
|
<div className="flex items-center mb-6">
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">사업명</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">사업명</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[100px] !text-xl placeholder:text-center mr-8"
|
className="w-[100px] !text-xl placeholder:text-center mr-4"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
value={var1}
|
value={var1}
|
||||||
onChange={(e) => { setVar1(e.target.value); }}
|
onChange={(e) => { setVar1(e.target.value); }}
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<YearRangeSelectBox
|
<YearRangeSelectBox
|
||||||
start={yearFilter.start}
|
start={yearFilter.start}
|
||||||
@@ -131,11 +143,10 @@ const OperationTab: React.FC<OperationTabProps> = ({
|
|||||||
startLabel="수행기간"
|
startLabel="수행기간"
|
||||||
endLabel=""
|
endLabel=""
|
||||||
/>
|
/>
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">사업 유형</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-60 mr-8"
|
className="ml-8 w-60 mr-8"
|
||||||
selectClass="rounded-lg bg-white text-xl"
|
selectClass="rounded-lg bg-white text-xl"
|
||||||
label=""
|
label="사업 유형"
|
||||||
selectArray={BIZ_TY_CD_SELECT_ARRAY}
|
selectArray={BIZ_TY_CD_SELECT_ARRAY}
|
||||||
value={var2}
|
value={var2}
|
||||||
onSelectValue={(val) => {
|
onSelectValue={(val) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Button, Label } from '@common/components';
|
import { Button } from '@common/components';
|
||||||
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
||||||
import { SelectBox, UiTable } from '@common/business_components/ui';
|
import { SelectBox, UiTable } from '@common/business_components/ui';
|
||||||
import LoadingOverlay from '@/components/ui/LoadingBar';
|
import LoadingOverlay from '@/components/ui/LoadingBar';
|
||||||
@@ -165,28 +165,32 @@ const ReportTab: React.FC<BasicTabProps> = ({ open }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="relative flex flex-col border rounded-lg p-5 w-full h-[10vh]">
|
<div className="relative flex flex-col border rounded-lg p-6 w-full h-[10vh]">
|
||||||
<div className="flex items-center mb-3">
|
<div className="flex items-center mb-3">
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">시도</Label>
|
<SelectBox className="w-[150px] mr-8"
|
||||||
<SelectBox className="w-60 mr-8"
|
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg bg-white"
|
||||||
label="" selectArray={sidos}
|
label="시도" selectArray={sidos}
|
||||||
value={ctpvCd} onSelectValue={handleCtpvCdChange}
|
value={ctpvCd} onSelectValue={handleCtpvCdChange}
|
||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">시군구</Label>
|
|
||||||
<SelectBox className="w-48"
|
<SelectBox className="w-48"
|
||||||
selectClass="w-48 rounded-lg bg-white truncate"
|
selectClass="w-48 rounded-lg bg-white truncate"
|
||||||
label="" selectArray={filteredSiguns}
|
label="시군구" selectArray={filteredSiguns}
|
||||||
value={sigungu} onSelectValue={val => setSigungu(String(val))}
|
value={sigungu} onSelectValue={val => setSigungu(String(val))}
|
||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center mb-6">
|
<div className="flex items-center mb-6">
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">보고서 구분</Label>
|
{/* <label className="inline-block w-auto whitespace-nowrap text-xl text-gray-600 mr-2">구분</label>
|
||||||
<SelectBox className="w-44 mr-8"
|
<Input
|
||||||
|
className='!text-xl w-[100px] placeholder:text-center mr-8'
|
||||||
|
placeholder="입력"
|
||||||
|
value={gubun}
|
||||||
|
onChange={(e) => { setGubun(e.target.value); }}
|
||||||
|
/> */}
|
||||||
|
<SelectBox className="w-[150px] mr-8"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg bg-white"
|
||||||
label="" selectArray={[...reportGubuns]}
|
label="보고서구분" selectArray={[...reportGubuns]}
|
||||||
value={reportGubun} onSelectValue={val => setReportGubun(String(val))}
|
value={reportGubun} onSelectValue={val => setReportGubun(String(val))}
|
||||||
selectContentClass="z-[101]" labelClass='whitespace-nowrap text-xl text-gray-600 pr-2'
|
selectContentClass="z-[101]" labelClass='whitespace-nowrap text-xl text-gray-600 pr-2'
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -3,22 +3,24 @@ import { UiModal, UITab, UiTable } from '@common/business_components/ui';
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { ExclnSewagePumpCol2, MsSwageMhlCol2, MsSwagePplCol2, stofcbrCol2, SwtrmtFcltCol2, SwtrmtPrcsZoneCol2 } from '../components/common/table';
|
import { ExclnSewagePumpCol2, MsSwageMhlCol2, MsSwagePplCol2, stofcbrCol2, SwtrmtFcltCol2, SwtrmtPrcsZoneCol2 } from '../components/common/table';
|
||||||
|
import { type SelectDataType } from '../commonStore';
|
||||||
import { MS_SWAGE_PPL_CODES, MS_SWAGE_PPL_USE_CODES, MS_SWAGE_MHL_CODES } from '../components/common/table';
|
import { MS_SWAGE_PPL_CODES, MS_SWAGE_PPL_USE_CODES, MS_SWAGE_MHL_CODES } from '../components/common/table';
|
||||||
import { getData } from "@/components/lib/api";
|
import { getData } from "@/components/lib/api";
|
||||||
import BasicTab, { BASIC_TYPES } from './basicTab';
|
import BasicTab, { BASIC_TYPES } from './basicTab';
|
||||||
import OperationTab, { operationCleaningTableHeadlist, operationInspectionTableHeadlist, operationMaintenanceTableHeadlist, operationTableHeadlist, WORK_TYPES } from './operationTab';
|
import OperationTab, { BIZ_TY_CD, operationCleaningTableHeadlist, operationInspectionTableHeadlist, operationMaintenanceTableHeadlist, operationTableHeadlist, WORK_TYPES } from './operationTab';
|
||||||
import ReportTab from './reportTab';
|
import ReportTab, { reportTableHeadlist } from './reportTab';
|
||||||
import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
||||||
import useStore from '../../../store/useStore';
|
|
||||||
|
|
||||||
const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}`;
|
const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}`;
|
||||||
|
|
||||||
|
// 탭
|
||||||
const TABS = [
|
const TABS = [
|
||||||
{ val: "basic", text: "기본정보" },
|
{ val: "basic", text: "기본정보" },
|
||||||
{ val: "operation", text: "운영정보" },
|
{ val: "operation", text: "운영정보" },
|
||||||
{ val: "report", text: "하수도정비기본계획보고서" },
|
{ val: "report", text: "하수도정비기본계획보고서" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
// 날짜 조합 함수
|
// 날짜 조합 함수
|
||||||
const getDateString = (
|
const getDateString = (
|
||||||
year: string,
|
year: string,
|
||||||
@@ -61,10 +63,12 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
const [isResetSelection, setIsResetSelection] = useState<boolean>(false);
|
const [isResetSelection, setIsResetSelection] = useState<boolean>(false);
|
||||||
const [isResetDetailSelection, setIsResetDetailSelection] = useState<boolean>(false);
|
const [isResetDetailSelection, setIsResetDetailSelection] = useState<boolean>(false);
|
||||||
const [detailBizId, setDetailBizId] = useState(0);
|
const [detailBizId, setDetailBizId] = useState(0);
|
||||||
const [city, setCity] = useState<number>(0);
|
const [city, setCity] = useState(0);
|
||||||
const [ctpvName, setCtpvName] = useState<string>('');
|
const [sgg, setSgg] = useState(0);
|
||||||
const [sgg, setSgg] = useState<number>(0);
|
const [ctpvCd, setCtpvCd] = useState('0'); // 하수정비기본계획 report
|
||||||
const [sggName, setSggName] = useState<string>('');
|
const [sigungu, setSigungu] = useState('0'); // 하수정비기본계획 report
|
||||||
|
const [gubun, setGubun] = useState(""); // 하수정비기본계획 report
|
||||||
|
const [reportGubun, setReportGubun] = useState("0"); // 하수정비기본계획 report
|
||||||
const [start1, setStart1] = useState("");
|
const [start1, setStart1] = useState("");
|
||||||
const [start2, setStart2] = useState("");
|
const [start2, setStart2] = useState("");
|
||||||
const [end1, setEnd1] = useState("");
|
const [end1, setEnd1] = useState("");
|
||||||
@@ -75,10 +79,9 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
const [var4, setVar4] = useState("");
|
const [var4, setVar4] = useState("");
|
||||||
// 시작, 종료
|
// 시작, 종료
|
||||||
const [yearFilter, setYearFilter] = useState({ start: "", end: "" });
|
const [yearFilter, setYearFilter] = useState({ start: "", end: "" });
|
||||||
|
const [filteredSiguns, setFilteredSiguns] = useState<SelectDataType[]>([{ val: '0', text: '전체', sido: '0' }]);
|
||||||
|
|
||||||
const { BIZ_TY_CD } = useStore();
|
|
||||||
|
|
||||||
|
|
||||||
// 오늘 날짜 구하기
|
// 오늘 날짜 구하기
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const todayYear = today.getFullYear().toString();
|
const todayYear = today.getFullYear().toString();
|
||||||
@@ -103,9 +106,11 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
|
|
||||||
const dynamicHeadlist2: { id: string, title: string }[] = useMemo(() => {
|
const dynamicHeadlist2: { id: string, title: string }[] = useMemo(() => {
|
||||||
if (activeTab === 'operation') {
|
if (activeTab === 'operation') {
|
||||||
if (workType === WORK_TYPES[0]?.val) return operationMaintenanceTableHeadlist;
|
if (workType === '200') return operationMaintenanceTableHeadlist;
|
||||||
if (workType === WORK_TYPES[1]?.val) return operationCleaningTableHeadlist;
|
if (workType === '201') return operationMaintenanceTableHeadlist;
|
||||||
if (workType === WORK_TYPES[2]?.val) return operationInspectionTableHeadlist;
|
if (workType === '204') return operationMaintenanceTableHeadlist;
|
||||||
|
if (workType === '100') return operationCleaningTableHeadlist;
|
||||||
|
if (workType === '203') return operationInspectionTableHeadlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
@@ -174,7 +179,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
setIsLoading(true); // 로딩 시작
|
setIsLoading(true); // 로딩 시작
|
||||||
setIsResetSelection(true); // 선택 초기화
|
setIsResetSelection(true); // 선택 초기화
|
||||||
setIsResetDetailSelection(true); // 선택 초기화
|
setIsResetDetailSelection(true); // 선택 초기화
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let cqlFilters: string[] = [];
|
let cqlFilters: string[] = [];
|
||||||
if (activeTab === 'basic') {
|
if (activeTab === 'basic') {
|
||||||
@@ -242,8 +247,8 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
RequestDTO.fromflfmtEndYmd = startDate;
|
RequestDTO.fromflfmtEndYmd = startDate;
|
||||||
RequestDTO.toflfmtEndYmd = endDate;
|
RequestDTO.toflfmtEndYmd = endDate;
|
||||||
|
|
||||||
// JSON.parse 사용으로 문자열 -> 배열 변환
|
|
||||||
RequestDTO.workTypes = JSON.parse(workType.replace(/'/g, '"'));
|
RequestDTO.bizSeCd = workType;
|
||||||
|
|
||||||
const params = new URLSearchParams(RequestDTO).toString();
|
const params = new URLSearchParams(RequestDTO).toString();
|
||||||
|
|
||||||
@@ -258,7 +263,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
const matched = BIZ_TY_CD.find(code => code.lwpoCd === item.bizTyCd);
|
const matched = BIZ_TY_CD.find(code => code.lwpoCd === item.bizTyCd);
|
||||||
return {
|
return {
|
||||||
...formattedItem,
|
...formattedItem,
|
||||||
rowNumber: (curPage - 1) * 5 + index + 1, // 1부터 시작하는 일련번호 추가
|
rowNumber: (curPage - 1) * 4 + index + 1, // 1부터 시작하는 일련번호 추가
|
||||||
bizTyCd: matched ? matched.lwpoCdNm : item.bizTyCd,
|
bizTyCd: matched ? matched.lwpoCdNm : item.bizTyCd,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -267,7 +272,8 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
setTableCount(res.totalElements || 0);
|
setTableCount(res.totalElements || 0);
|
||||||
setDetailTableData([]);
|
setDetailTableData([]);
|
||||||
setDetailTableCount(0);
|
setDetailTableCount(0);
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
setShowTable(true);
|
setShowTable(true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -338,17 +344,13 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
cqlFilters.push(`fclt_cpct BETWEEN ${start1} AND ${end1}`);
|
cqlFilters.push(`fclt_cpct BETWEEN ${start1} AND ${end1}`);
|
||||||
else if (start1) cqlFilters.push(`fclt_cpct >= ${start1}`);
|
else if (start1) cqlFilters.push(`fclt_cpct >= ${start1}`);
|
||||||
else if (end1) cqlFilters.push(`fclt_cpct <= ${end1}`);
|
else if (end1) cqlFilters.push(`fclt_cpct <= ${end1}`);
|
||||||
|
// 처리구역 면적
|
||||||
// 시도
|
if (start2 && end2)
|
||||||
if (ctpvName) cqlFilters.push(`ctpv_nm ILIKE '%${ctpvName}%'`);
|
cqlFilters.push(`prcsZoneAreaSum BETWEEN ${start2} AND ${end2}`);
|
||||||
if (sggName) cqlFilters.push(`sgg_nm ILIKE '%${sggName}%'`);
|
else if (start2) cqlFilters.push(`prcsZoneAreaSum >= ${start2}`);
|
||||||
// // 처리구역 면적
|
else if (end2) cqlFilters.push(`prcsZoneAreaSum <= ${end2}`);
|
||||||
// if (start2 && end2)
|
// 하수처리시설명
|
||||||
// cqlFilters.push(`prcsZoneAreaSum BETWEEN ${start2} AND ${end2}`);
|
if (var1) cqlFilters.push(`swtrmt_fclt_nm ILIKE '%${var1}%'`);
|
||||||
// else if (start2) cqlFilters.push(`prcsZoneAreaSum >= ${start2}`);
|
|
||||||
// else if (end2) cqlFilters.push(`prcsZoneAreaSum <= ${end2}`);
|
|
||||||
// // 하수처리시설명
|
|
||||||
// if (var1) cqlFilters.push(`swtrmt_fclt_nm ILIKE '%${var1}%'`);
|
|
||||||
return cqlFilters;
|
return cqlFilters;
|
||||||
};
|
};
|
||||||
// 하수처리구역용 CQL 필터 생성
|
// 하수처리구역용 CQL 필터 생성
|
||||||
@@ -444,7 +446,12 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
|
|
||||||
// 조회 버튼 클릭 시 1페이지로 이동 및 데이터 초기화
|
// 조회 버튼 클릭 시 1페이지로 이동 및 데이터 초기화
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
setCurPage(1); // 페이지를 1로 초기화
|
setCurPage(1); // 페이지를 1로 초기화
|
||||||
|
// setDetailCurPage(1); // 페이지를 1로 초기화
|
||||||
|
// setIsResetPage(false); // 페이지를 초기화
|
||||||
|
// setIsResetDetailPage(true); // 디테일 페이지를 초기화
|
||||||
|
// setIsResetSelection(true); // 선택 초기화
|
||||||
|
// setIsResetDetailSelection(true); // 선택 초기화
|
||||||
fetchFilteredData();
|
fetchFilteredData();
|
||||||
setIsResetPage(true); // 페이지를 초기화
|
setIsResetPage(true); // 페이지를 초기화
|
||||||
setIsResetDetailPage(true); // 디테일 페이지를 초기화
|
setIsResetDetailPage(true); // 디테일 페이지를 초기화
|
||||||
@@ -477,11 +484,8 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
bizId: tableData[index % 5].bizId,
|
bizId: tableData[index % 5].bizId,
|
||||||
};
|
};
|
||||||
|
|
||||||
RequestDTO.workTypes = JSON.parse(workType.replace(/'/g, '"'));
|
|
||||||
|
|
||||||
const res = await getData(`v1/bizInfo/fclts?${new URLSearchParams(RequestDTO).toString()}`);
|
const res = await getData(`v1/bizInfo/fclts?${new URLSearchParams(RequestDTO).toString()}`);
|
||||||
console.log('운영정보 cellClick 데이터:', res);
|
console.log('운영정보 cellClick 데이터:', res);
|
||||||
console.log('운영정보 cellClick.data:', res.data);
|
|
||||||
console.log('운영정보 length:', res.data.length);
|
console.log('운영정보 length:', res.data.length);
|
||||||
|
|
||||||
const mappedData = (res.data || []).map((item: any, detailIndex: number) => {
|
const mappedData = (res.data || []).map((item: any, detailIndex: number) => {
|
||||||
@@ -491,14 +495,12 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
const mqltCdObj = MS_SWAGE_PPL_CODES.find(code => code.val === item.mqltCd.trim());
|
const mqltCdObj = MS_SWAGE_PPL_CODES.find(code => code.val === item.mqltCd.trim());
|
||||||
return {
|
return {
|
||||||
...formattedItem,
|
...formattedItem,
|
||||||
rowNumber: (detailCurPage - 1) * 5 + detailIndex + 1,
|
rowNumber: (detailCurPage - 1) * 4 + detailIndex + 1,
|
||||||
usgCd: usgCdObj ? usgCdObj.text : item.usgCd,
|
usgCd: usgCdObj ? usgCdObj.text : item.usgCd,
|
||||||
mqltCd: mqltCdObj ? mqltCdObj.text : item.mqltCd,
|
mqltCd: mqltCdObj ? mqltCdObj.text : item.mqltCd,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('운영정보 cellClick mappedData:', mappedData);
|
|
||||||
|
|
||||||
setDetailTableData(mappedData);
|
setDetailTableData(mappedData);
|
||||||
setDetailTableCount(res.count || 0);
|
setDetailTableCount(res.count || 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -529,7 +531,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
const mqltCdObj = MS_SWAGE_PPL_CODES.find(code => code.val === item.mqltCd.trim());
|
const mqltCdObj = MS_SWAGE_PPL_CODES.find(code => code.val === item.mqltCd.trim());
|
||||||
return {
|
return {
|
||||||
...formattedItem,
|
...formattedItem,
|
||||||
rowNumber: (detailCurPage - 1) * 5 + detailIndex + 1,
|
rowNumber: (detailCurPage - 1) * 4 + detailIndex + 1,
|
||||||
usgCd: usgCdObj ? usgCdObj.text : item.usgCd,
|
usgCd: usgCdObj ? usgCdObj.text : item.usgCd,
|
||||||
mqltCd: mqltCdObj ? mqltCdObj.text : item.mqltCd,
|
mqltCd: mqltCdObj ? mqltCdObj.text : item.mqltCd,
|
||||||
};
|
};
|
||||||
@@ -544,7 +546,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const renderBody = () => (
|
const renderBody = () => (
|
||||||
<>
|
<>
|
||||||
@@ -558,64 +560,63 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
onValueChange={(value: string) => setActiveTab(value)}
|
onValueChange={(value: string) => setActiveTab(value)}
|
||||||
>
|
>
|
||||||
</UITab>
|
</UITab>
|
||||||
{/* 각각의 탭 영역 */}
|
{/* 각각의 탭 영역 */}
|
||||||
{/* 기본정보 탭 */}
|
{/* 기본정보 탭 */}
|
||||||
{activeTab === 'basic' && (
|
{activeTab === 'basic' && (
|
||||||
<BasicTab
|
<BasicTab
|
||||||
open={open}
|
open={open}
|
||||||
basicType={basicType}
|
basicType={basicType}
|
||||||
city={city}
|
city={city}
|
||||||
sgg={sgg}
|
sgg={sgg}
|
||||||
start1={start1}
|
start1={start1}
|
||||||
start2={start2}
|
start2={start2}
|
||||||
end1={end1}
|
end1={end1}
|
||||||
end2={end2}
|
end2={end2}
|
||||||
var1={var1}
|
var1={var1}
|
||||||
var2={var2}
|
var2={var2}
|
||||||
yearFilter={yearFilter}
|
yearFilter={yearFilter}
|
||||||
handleSearch={handleSearch}
|
handleSearch={handleSearch}
|
||||||
setBasicType={setBasicType}
|
setBasicType={setBasicType}
|
||||||
setCity={setCity}
|
setCity={setCity}
|
||||||
setCtpvName={setCtpvName}
|
setSgg={setSgg}
|
||||||
setSgg={setSgg}
|
setYearFilter={setYearFilter}
|
||||||
setSggName={setSggName}
|
setStart1={setStart1}
|
||||||
setYearFilter={setYearFilter}
|
setStart2={setStart2}
|
||||||
setStart1={setStart1}
|
setEnd1={setEnd1}
|
||||||
setStart2={setStart2}
|
setEnd2={setEnd2}
|
||||||
setEnd1={setEnd1}
|
setVar1={setVar1}
|
||||||
setEnd2={setEnd2}
|
setVar2={setVar2}
|
||||||
setVar1={setVar1}
|
/>
|
||||||
setVar2={setVar2}
|
)}
|
||||||
/>
|
{/* 운영정보 탭 */}
|
||||||
)}
|
{activeTab === 'operation' && (
|
||||||
{/* 운영정보 탭 */}
|
<OperationTab
|
||||||
{activeTab === 'operation' && (
|
open={open}
|
||||||
<OperationTab
|
workType={workType}
|
||||||
open={open}
|
var1={var1}
|
||||||
workType={workType}
|
var2={var2}
|
||||||
var1={var1}
|
yearFilter={yearFilter}
|
||||||
var2={var2}
|
handleSearch={handleSearch}
|
||||||
yearFilter={yearFilter}
|
setWorkType={setWorkType}
|
||||||
handleSearch={handleSearch}
|
setVar1={setVar1}
|
||||||
setWorkType={setWorkType}
|
setVar2={setVar2}
|
||||||
setVar1={setVar1}
|
setYearFilter={setYearFilter}
|
||||||
setVar2={setVar2}
|
/>
|
||||||
setYearFilter={setYearFilter}
|
)}
|
||||||
/>
|
{/* 하수도정비기본계획보고서 탭 */}
|
||||||
)}
|
{activeTab === 'report' && (
|
||||||
{/* 하수도정비기본계획보고서 탭 */}
|
<ReportTab
|
||||||
{activeTab === 'report' && (
|
open={open}
|
||||||
<ReportTab
|
/>
|
||||||
open={open}
|
)}
|
||||||
/>
|
{/* </UITab2> */}
|
||||||
)}
|
|
||||||
{/* </UITab2> */}
|
|
||||||
|
|
||||||
|
|
||||||
{/* 📋 결과 리스트 */}
|
{/* 📋 결과 리스트 */}
|
||||||
{/* 하수도정비기본계획보고서 탭 */}
|
{/* 기본정보 탭, 하수도정비기본계획보고서 탭 */}
|
||||||
{activeTab === 'basic' && (
|
{(activeTab === 'basic' ) && (
|
||||||
<div className="h-[79vh] w-full overflow-hidden rounded-lg border">
|
<div className="h-[79vh] w-full overflow-hidden rounded-lg border">
|
||||||
|
{/* 테이블2 영역 (가로/세로 스크롤 가능) */}
|
||||||
<div className="flex-1 px-2 pb-2">
|
<div className="flex-1 px-2 pb-2">
|
||||||
<LoadingOverlay isLoading={isLoading} />
|
<LoadingOverlay isLoading={isLoading} />
|
||||||
<UiTable
|
<UiTable
|
||||||
@@ -662,7 +663,6 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="h-[39vh] w-full overflow-hidden rounded-lg border">
|
<div className="h-[39vh] w-full overflow-hidden rounded-lg border">
|
||||||
{/* 테이블2 영역 */}
|
|
||||||
<div className="flex-1 px-2 pb-2">
|
<div className="flex-1 px-2 pb-2">
|
||||||
<LoadingOverlay isLoading={isDetailLoading} />
|
<LoadingOverlay isLoading={isDetailLoading} />
|
||||||
<UiTable
|
<UiTable
|
||||||
|
|||||||
@@ -79,11 +79,7 @@ export function flattenFolders(data: Folder[]): FlattenedFolder[] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data && data.length > 0 && data[0].clsfSystmNm == "기본계획") { // data가 비어있지 않고 children이 있는 경우에만 처리
|
data.forEach((root) => traverse(root, {}, 0));
|
||||||
data.forEach((root) => traverse(root, {}, 0));
|
|
||||||
} else {
|
|
||||||
data.forEach((root) => traverse(root, {}, 1));
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,15 +96,13 @@ export const useDcTree = (clsfSystmNm:string) => {
|
|||||||
if (result) {
|
if (result) {
|
||||||
setData(result);
|
setData(result);
|
||||||
}
|
}
|
||||||
console.log("useDcTree호출");
|
|
||||||
console.log("clsfSystmNm:", clsfSystmNm, "data:", result);
|
|
||||||
};
|
};
|
||||||
fetch();
|
fetch();
|
||||||
|
console.log("useDcTree호출");
|
||||||
}, [clsfSystmNm]);
|
}, [clsfSystmNm]);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDcFile = async (clsfSystmSn:string) => {
|
export const getDcFile = async (clsfSystmSn:string) => {
|
||||||
const queryString = 'clsfSystmSn='+clsfSystmSn;
|
const queryString = 'clsfSystmSn='+clsfSystmSn;
|
||||||
const result = await getDcData(`/api/v1/dc/file${queryString ? `?${queryString}` : ''}`);
|
const result = await getDcData(`/api/v1/dc/file${queryString ? `?${queryString}` : ''}`);
|
||||||
@@ -125,7 +119,7 @@ export const addFileName = async (data:FlattenedFolder[]) => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
return fileReportData;
|
return fileReportData;
|
||||||
};
|
}
|
||||||
export const getDcFileprcs = async (fileSn:string) => {
|
export const getDcFileprcs = async (fileSn:string) => {
|
||||||
const queryString = 'fileSn='+fileSn;
|
const queryString = 'fileSn='+fileSn;
|
||||||
const result = await getDcData(`/api/v1/dc/fileprcs${queryString ? `?${queryString}` : ''}`);
|
const result = await getDcData(`/api/v1/dc/fileprcs${queryString ? `?${queryString}` : ''}`);
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
|||||||
handleSearch,
|
handleSearch,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const handleEnterKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<div className="mb-2 flex items-center">
|
<div className="mb-2 flex items-center">
|
||||||
@@ -49,11 +55,10 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
|||||||
endLabel=""
|
endLabel=""
|
||||||
/>
|
/>
|
||||||
{/* 용도 */}
|
{/* 용도 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">용도</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-60 mr-8"
|
className="ml-8 w-60 mr-8"
|
||||||
selectClass="rounded-lg bg-white text-xl"
|
selectClass="rounded-lg bg-white text-xl"
|
||||||
label=""
|
label="용도"
|
||||||
selectArray={MS_SWAGE_MHL_USE_CODES}
|
selectArray={MS_SWAGE_MHL_USE_CODES}
|
||||||
value={var1}
|
value={var1}
|
||||||
onSelectValue={(val) => {
|
onSelectValue={(val) => {
|
||||||
@@ -62,7 +67,7 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
|||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
{/* 하수맨홀 구경 */}
|
{/* 하수맨홀 구경 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">구경(mm)</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">구경(mm)</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[100px] !text-xl placeholder:text-center"
|
className="w-[100px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
@@ -72,12 +77,7 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart1(val);
|
setStart1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
@@ -89,12 +89,7 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd1(val);
|
setEnd1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* 조회 버튼 */}
|
{/* 조회 버튼 */}
|
||||||
<div className="flex-1 flex justify-end">
|
<div className="flex-1 flex justify-end">
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
handleSearch,
|
handleSearch,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const handleEnterKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<div className="flex items-center mb-2">
|
<div className="flex items-center mb-2">
|
||||||
@@ -44,7 +50,7 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
endLabel=""
|
endLabel=""
|
||||||
/>
|
/>
|
||||||
{/* 일일처리용량 - 오수맨홀 */}
|
{/* 일일처리용량 - 오수맨홀 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">일일처리용량(㎥)</Label>
|
<Label className="ml-8 mr-2 w-auto text-xl text-gray-600">일일처리용량(㎥)</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[100px] !text-xl placeholder:text-center"
|
className="w-[100px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
@@ -54,12 +60,7 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart1(val);
|
setStart1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
@@ -71,15 +72,12 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd1(val);
|
setEnd1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* 양수능력 - 우수맨홀 */}
|
{/* 양수능력 - 우수맨홀 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">양수능력(m²/d)</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">
|
||||||
|
양수능력(m²/d)
|
||||||
|
</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[100px] !text-xl placeholder:text-center"
|
className="w-[100px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
@@ -89,12 +87,7 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart2(val);
|
setStart2(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
@@ -106,12 +99,7 @@ const SwagePmstn: React.FC<SwagePmstnProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd2(val);
|
setEnd2(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* 조회 버튼 */}
|
{/* 조회 버튼 */}
|
||||||
<div className="flex-1 flex justify-end">
|
<div className="flex-1 flex justify-end">
|
||||||
|
|||||||
@@ -10,16 +10,12 @@ interface SwagePplProps {
|
|||||||
var1: string;
|
var1: string;
|
||||||
var2: string;
|
var2: string;
|
||||||
start1: string;
|
start1: string;
|
||||||
start2: string;
|
|
||||||
end1: string;
|
end1: string;
|
||||||
end2: string;
|
|
||||||
yearFilter: { start: string; end: string };
|
yearFilter: { start: string; end: string };
|
||||||
setVar1: (value: string) => void;
|
setVar1: (value: string) => void;
|
||||||
setVar2: (value: string) => void;
|
setVar2: (value: string) => void;
|
||||||
setStart1: (value: string) => void;
|
setStart1: (value: string) => void;
|
||||||
setStart2: (value: string) => void;
|
|
||||||
setEnd1: (value: string) => void;
|
setEnd1: (value: string) => void;
|
||||||
setEnd2: (value: string) => void;
|
|
||||||
setYearFilter: (filter: { start: string; end: string }) => void;
|
setYearFilter: (filter: { start: string; end: string }) => void;
|
||||||
handleSearch: () => void;
|
handleSearch: () => void;
|
||||||
}
|
}
|
||||||
@@ -28,20 +24,22 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
|||||||
var1,
|
var1,
|
||||||
var2,
|
var2,
|
||||||
start1,
|
start1,
|
||||||
start2,
|
|
||||||
end1,
|
end1,
|
||||||
end2,
|
|
||||||
yearFilter,
|
yearFilter,
|
||||||
setVar1,
|
setVar1,
|
||||||
setVar2,
|
setVar2,
|
||||||
setStart1,
|
setStart1,
|
||||||
setStart2,
|
|
||||||
setEnd1,
|
setEnd1,
|
||||||
setEnd2,
|
|
||||||
setYearFilter,
|
setYearFilter,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const handleEnterKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<div className="mb-2 flex items-center">
|
<div className="mb-2 flex items-center">
|
||||||
@@ -60,11 +58,10 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
|||||||
endLabel=""
|
endLabel=""
|
||||||
/>
|
/>
|
||||||
{/* 용도 */}
|
{/* 용도 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">용도</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-40 mr-8"
|
className="ml-8 w-60 mr-8"
|
||||||
selectClass="rounded-lg bg-white text-xl"
|
selectClass="rounded-lg bg-white text-xl"
|
||||||
label=""
|
label="용도"
|
||||||
selectArray={MS_SWAGE_PPL_USE_CODES}
|
selectArray={MS_SWAGE_PPL_USE_CODES}
|
||||||
value={var1}
|
value={var1}
|
||||||
onSelectValue={(val) => {
|
onSelectValue={(val) => {
|
||||||
@@ -73,11 +70,10 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
|||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
{/* 재질 */}
|
{/* 재질 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">재질</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-60 mr-8"
|
className="w-60 mr-8"
|
||||||
selectClass="rounded-lg bg-white text-xl"
|
selectClass="rounded-lg bg-white text-xl"
|
||||||
label=""
|
label="재질"
|
||||||
selectArray={MS_SWAGE_PPL_CODES}
|
selectArray={MS_SWAGE_PPL_CODES}
|
||||||
value={var2}
|
value={var2}
|
||||||
onSelectValue={(val) => {
|
onSelectValue={(val) => {
|
||||||
@@ -86,22 +82,17 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
|||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
{/* 관경 */}
|
{/* 관경 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">관경(mm)</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">관경(mm)</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[60px] !text-xl placeholder:text-center"
|
className="w-[60px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
value={start1}
|
value={var1}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
// 숫자만 입력 허용
|
// 숫자만 입력 허용
|
||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart1(val);
|
setVar1(val);
|
||||||
}}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
@@ -113,47 +104,32 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd1(val);
|
setEnd1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* 연장 */}
|
{/* 연장 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">연장(m)</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">연장(m)</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[60px] !text-xl placeholder:text-center"
|
className="w-[60px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
value={start2}
|
value={start1}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
// 숫자만 입력 허용
|
// 숫자만 입력 허용
|
||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart2(val);
|
setStart1(val);
|
||||||
}}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
className="mr-8 w-[60px] !text-xl placeholder:text-center"
|
className="mr-8 w-[60px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
value={end2}
|
value={end1}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
// 숫자만 입력 허용
|
// 숫자만 입력 허용
|
||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd2(val);
|
setEnd1(val);
|
||||||
}}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
/>
|
/>
|
||||||
{/* 조회 버튼 */}
|
{/* 조회 버튼 */}
|
||||||
<div className="flex-1 flex justify-end">
|
<div className="flex-1 flex justify-end">
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
// 하수처리시설
|
// 하수처리시설
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
|
||||||
import { Button, Input, Label } from '@common/components';
|
import { Button, Input, Label } from '@common/components';
|
||||||
import { SidoSigunguSelectBox } from '@/components/ui/SidoSigunguSelectBox';
|
import React from 'react';
|
||||||
|
|
||||||
|
|
||||||
interface SwagePrcsFcltProps {
|
interface SwagePrcsFcltProps {
|
||||||
var1: string;
|
var1: string;
|
||||||
@@ -12,53 +10,42 @@ interface SwagePrcsFcltProps {
|
|||||||
start2: string;
|
start2: string;
|
||||||
end1: string;
|
end1: string;
|
||||||
end2: string;
|
end2: string;
|
||||||
city: number;
|
|
||||||
sgg: number;
|
|
||||||
yearFilter: { start: string; end: string };
|
yearFilter: { start: string; end: string };
|
||||||
setVar1: (value: string) => void;
|
setVar1: (value: string) => void;
|
||||||
setStart1: (value: string) => void;
|
setStart1: (value: string) => void;
|
||||||
setStart2: (value: string) => void;
|
setStart2: (value: string) => void;
|
||||||
setEnd1: (value: string) => void;
|
setEnd1: (value: string) => void;
|
||||||
setEnd2: (value: string) => void;
|
setEnd2: (value: string) => void;
|
||||||
setCity: (value: number) => void;
|
|
||||||
setCtpvName: (name: string) => void;
|
|
||||||
setSgg: (value: number) => void;
|
|
||||||
setSggName: (name: string) => void;
|
|
||||||
setYearFilter: (filter: { start: string; end: string }) => void;
|
setYearFilter: (filter: { start: string; end: string }) => void;
|
||||||
handleSearch: () => void;
|
handleSearch: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SwagePrcsFclt: React.FC<SwagePrcsFcltProps> = ({
|
const SwagePrcsFclt: React.FC<SwagePrcsFcltProps> = ({
|
||||||
|
var1,
|
||||||
start1,
|
start1,
|
||||||
|
start2,
|
||||||
end1,
|
end1,
|
||||||
city,
|
end2,
|
||||||
sgg,
|
|
||||||
yearFilter,
|
yearFilter,
|
||||||
|
setVar1,
|
||||||
setStart1,
|
setStart1,
|
||||||
|
setStart2,
|
||||||
setEnd1,
|
setEnd1,
|
||||||
setCity,
|
setEnd2,
|
||||||
setCtpvName,
|
|
||||||
setSgg,
|
|
||||||
setSggName,
|
|
||||||
setYearFilter,
|
setYearFilter,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const handleEnterKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
|
{/* 가동개시일자 */}
|
||||||
<div className="mb-2 flex items-center">
|
<div className="mb-2 flex items-center">
|
||||||
<SidoSigunguSelectBox
|
|
||||||
sido={city}
|
|
||||||
sigungu={sgg}
|
|
||||||
onSidoChange={(sidoId) => {
|
|
||||||
setCity(sidoId);
|
|
||||||
setSgg(0);
|
|
||||||
}}
|
|
||||||
onSigunguChange={setSgg}
|
|
||||||
setCtpvName={setCtpvName}
|
|
||||||
setSggName={setSggName}
|
|
||||||
/>
|
|
||||||
{/* 가동개시일자 */}
|
|
||||||
<Label className="mr-2 w-auto text-xl text-gray-600">가동개시일자</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">가동개시일자</Label>
|
||||||
<YearRangeSelectBox
|
<YearRangeSelectBox
|
||||||
start={yearFilter.start}
|
start={yearFilter.start}
|
||||||
@@ -74,7 +61,7 @@ const SwagePrcsFclt: React.FC<SwagePrcsFcltProps> = ({
|
|||||||
endLabel=""
|
endLabel=""
|
||||||
/>
|
/>
|
||||||
{/* 시설용량 */}
|
{/* 시설용량 */}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">시설용량(㎥/d)</Label>
|
<Label className="ml-8 mr-2 w-auto text-xl text-gray-600">시설용량(㎥/d)</Label>
|
||||||
<Input
|
<Input
|
||||||
className="w-[60px] !text-xl placeholder:text-center"
|
className="w-[60px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
@@ -84,12 +71,7 @@ const SwagePrcsFclt: React.FC<SwagePrcsFcltProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setStart1(val);
|
setStart1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<span className="mx-2 text-xl font-semibold">~</span>
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
<Input
|
<Input
|
||||||
@@ -101,12 +83,43 @@ const SwagePrcsFclt: React.FC<SwagePrcsFcltProps> = ({
|
|||||||
const val = e.target.value.replace(/[^0-9]/g, "");
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
setEnd1(val);
|
setEnd1(val);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
/>
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
{/* 처리구역 면적 */}
|
||||||
handleSearch();
|
<Label className="mr-2 w-auto text-xl text-gray-600">처리구역 면적(m²)</Label>
|
||||||
}
|
<Input
|
||||||
|
className="w-[60px] !text-xl placeholder:text-center"
|
||||||
|
placeholder="입력"
|
||||||
|
value={start2}
|
||||||
|
onChange={(e) => {
|
||||||
|
// 숫자만 입력 허용
|
||||||
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
|
setStart2(val);
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
|
/>
|
||||||
|
<span className="mx-2 text-xl font-semibold">~</span>
|
||||||
|
<Input
|
||||||
|
className="mr-8 w-[60px] !text-xl placeholder:text-center"
|
||||||
|
placeholder="입력"
|
||||||
|
value={end2}
|
||||||
|
onChange={(e) => {
|
||||||
|
// 숫자만 입력 허용
|
||||||
|
const val = e.target.value.replace(/[^0-9]/g, "");
|
||||||
|
setEnd2(val);
|
||||||
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
|
/>
|
||||||
|
{/* 하수처리시설명 */}
|
||||||
|
<Label className="mr-2 w-auto text-xl text-gray-600">하수처리시설명</Label>
|
||||||
|
<Input
|
||||||
|
className="mr-8 w-[100px] !text-xl placeholder:text-center"
|
||||||
|
placeholder="입력"
|
||||||
|
value={var1}
|
||||||
|
onChange={(e) => {
|
||||||
|
setVar1(e.target.value);
|
||||||
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
/>
|
/>
|
||||||
{/* 조회 버튼 */}
|
{/* 조회 버튼 */}
|
||||||
<div className="flex-1 flex justify-end">
|
<div className="flex-1 flex justify-end">
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ const swagePrcsZone: React.FC<swagePrcsZoneProps> = ({
|
|||||||
handleSearch,
|
handleSearch,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const handleEnterKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<div className="mb-2 flex items-center">
|
<div className="mb-2 flex items-center">
|
||||||
@@ -40,22 +46,7 @@ const swagePrcsZone: React.FC<swagePrcsZoneProps> = ({
|
|||||||
}}
|
}}
|
||||||
onSigunguChange={setSgg}
|
onSigunguChange={setSgg}
|
||||||
/>
|
/>
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">하수처리시설명</Label>
|
<Label className="mr-2 w-auto text-xl text-gray-600">하수처리구역명</Label>
|
||||||
<Input
|
|
||||||
className='!text-xl w-[120px] placeholder:text-center mr-8'
|
|
||||||
placeholder="입력"
|
|
||||||
value={var2}
|
|
||||||
onChange={(e) => {
|
|
||||||
setVar2(e.target.value);
|
|
||||||
}}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">하수처리구역명</Label>
|
|
||||||
<Input
|
<Input
|
||||||
className="mr-8 w-[100px] !text-xl placeholder:text-center"
|
className="mr-8 w-[100px] !text-xl placeholder:text-center"
|
||||||
placeholder="입력"
|
placeholder="입력"
|
||||||
@@ -63,12 +54,17 @@ const swagePrcsZone: React.FC<swagePrcsZoneProps> = ({
|
|||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setVar1(e.target.value);
|
setVar1(e.target.value);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={handleEnterKey}
|
||||||
if (e.key === 'Enter') {
|
/>
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
<Label className="mr-2 w-auto text-xl text-gray-600">하수처리시설명</Label>
|
||||||
handleSearch();
|
<Input
|
||||||
}
|
className='!text-xl w-[120px] placeholder:text-center mr-8'
|
||||||
|
placeholder="입력"
|
||||||
|
value={var2}
|
||||||
|
onChange={(e) => {
|
||||||
|
setVar2(e.target.value);
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={handleEnterKey}
|
||||||
/>
|
/>
|
||||||
{/* 조회 버튼 */}
|
{/* 조회 버튼 */}
|
||||||
<div className="flex-1 flex justify-end">
|
<div className="flex-1 flex justify-end">
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { getData } from '@/components/lib/api'
|
import { getData } from '@/components/lib/api'
|
||||||
|
import ContentLayout from '@/components/ui/contentLayout'
|
||||||
import { GovSidoSigunguSearchForm } from '@/components/ui/govSidoSigunguSearchForm'
|
import { GovSidoSigunguSearchForm } from '@/components/ui/govSidoSigunguSearchForm'
|
||||||
import { DateMonthPicker, Form, SelectBox } from '@common/business_components/ui'
|
import { DatePicker, DateMonthPicker, Form, SearchFormRight, SelectBox } from '@common/business_components/ui'
|
||||||
import ListDiv from '@common/business_components/ui/list_div'
|
import ListDiv from '@common/business_components/ui/list_div'
|
||||||
import { Button, Label } from '@common/components/ui'
|
import { Button, Label } from '@common/components/ui'
|
||||||
import { useEffect, useState, type ReactNode } from 'react'
|
import { useEffect, useState, type ReactNode } from 'react'
|
||||||
import LoadingOverlay from '@/components/ui/LoadingBar'
|
import LoadingOverlay from '@/components/ui/LoadingBar'
|
||||||
import { SidoSigunguSelectBox } from '@/components/ui/SidoSigunguSelectBox'
|
|
||||||
|
|
||||||
type TitleName = {
|
type TitleName = {
|
||||||
mainTitle: string
|
mainTitle: string
|
||||||
@@ -40,10 +40,12 @@ type BaseLayout = {
|
|||||||
firstDivBtn?: boolean
|
firstDivBtn?: boolean
|
||||||
selectBox?: SelectBox
|
selectBox?: SelectBox
|
||||||
showDatePicker?: boolean;
|
showDatePicker?: boolean;
|
||||||
ctpvCd: number;
|
enoCd?: string | number
|
||||||
sggCd: number;
|
setEnoCd?: (enoCd: string) => void
|
||||||
sggName?: string;
|
ctpvCd?: string | number
|
||||||
|
setCtpvCd?: (ctpvCd: string) => void
|
||||||
sigungu?: ApiSelectOption
|
sigungu?: ApiSelectOption
|
||||||
|
setSigungu?: (sigungu: ApiSelectOption) => void
|
||||||
selectedSwageTreatmentPlant?: string | number;
|
selectedSwageTreatmentPlant?: string | number;
|
||||||
onSwageTreatmentPlantChange?: (value: string | number) => void;
|
onSwageTreatmentPlantChange?: (value: string | number) => void;
|
||||||
selectedSwageProcessingZone?: string | number;
|
selectedSwageProcessingZone?: string | number;
|
||||||
@@ -52,16 +54,23 @@ type BaseLayout = {
|
|||||||
setAplcnYmFrom?: (aplcnYmFrom: string) => void;
|
setAplcnYmFrom?: (aplcnYmFrom: string) => void;
|
||||||
aplcnYmTo?: string
|
aplcnYmTo?: string
|
||||||
setAplcnYmTo?: (aplcnYmTo: string) => void;
|
setAplcnYmTo?: (aplcnYmTo: string) => void;
|
||||||
setCtpvCd: (ctpv: number) => void;
|
|
||||||
setSggCd: (sgg: number) => void;
|
|
||||||
setSggName?: (sggName: string) => void;
|
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
|
// Excel 다운로드 관련 props 추가
|
||||||
onExcelDownload?: () => void;
|
onExcelDownload?: () => void;
|
||||||
onDeleteFile?: () => void;
|
onDeleteFile?: () => void;
|
||||||
onAnalysis?: () => void;
|
onAnalysis?: () => void;
|
||||||
selectedRowData?: any;
|
selectedRowData?: any;
|
||||||
}
|
}
|
||||||
|
// TODO: 나중에 이벤트 추가되면 파라미터 추가 필요 ?
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param children
|
||||||
|
* @param titleName : 메인 타이틀, 첫번째 요소 타이틀, 두번째 요소 타이틀
|
||||||
|
* @param form : zod 스키마
|
||||||
|
* @param onSubmitEvent : 폼 이벤트 처리
|
||||||
|
* @param graphBtn : 하단에 그래프 버튼 유무 처리
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
const BaseLayout = ({
|
const BaseLayout = ({
|
||||||
children,
|
children,
|
||||||
titleName,
|
titleName,
|
||||||
@@ -71,36 +80,42 @@ const BaseLayout = ({
|
|||||||
analysisBtn,
|
analysisBtn,
|
||||||
selectBox,
|
selectBox,
|
||||||
showDatePicker = false,
|
showDatePicker = false,
|
||||||
|
enoCd,
|
||||||
|
setEnoCd,
|
||||||
ctpvCd,
|
ctpvCd,
|
||||||
sggCd,
|
setCtpvCd,
|
||||||
sggName,
|
|
||||||
sigungu,
|
sigungu,
|
||||||
|
setSigungu,
|
||||||
selectedSwageTreatmentPlant,
|
selectedSwageTreatmentPlant,
|
||||||
onSwageTreatmentPlantChange,
|
onSwageTreatmentPlantChange,
|
||||||
|
selectedSwageProcessingZone,
|
||||||
|
onSwageProcessingZoneChange,
|
||||||
aplcnYmFrom,
|
aplcnYmFrom,
|
||||||
setAplcnYmFrom,
|
setAplcnYmFrom,
|
||||||
aplcnYmTo,
|
aplcnYmTo,
|
||||||
setAplcnYmTo,
|
setAplcnYmTo,
|
||||||
setCtpvCd,
|
|
||||||
setSggCd,
|
|
||||||
setSggName,
|
|
||||||
isLoading,
|
isLoading,
|
||||||
|
// Excel 다운로드 관련 props 추가
|
||||||
onExcelDownload,
|
onExcelDownload,
|
||||||
onDeleteFile,
|
onDeleteFile,
|
||||||
onAnalysis,
|
onAnalysis,
|
||||||
|
selectedRowData
|
||||||
}: BaseLayout) => {
|
}: BaseLayout) => {
|
||||||
|
|
||||||
const defaultOption: ApiSelectOption = { val: '0', text: '전체' };
|
const defaultOption: ApiSelectOption = { val: '0', text: '전체' };
|
||||||
|
|
||||||
|
const [processingZoneOptions, setProcessingZoneOptions] = useState<ApiSelectOption[]>([]);
|
||||||
const [treatmentFacilityOptions, setTreatmentFacilityOptions] = useState<ApiSelectOption[]>([]);
|
const [treatmentFacilityOptions, setTreatmentFacilityOptions] = useState<ApiSelectOption[]>([]);
|
||||||
const [isLoadingAreaData, setIsLoadingAreaData] = useState<boolean>(isLoading || false);
|
const [isLoadingAreaData, setIsLoadingAreaData] = useState<boolean>(isLoading || false);
|
||||||
|
const [atflId, setAtflId] = useState('')
|
||||||
|
const [fileNm, setFileNm] = useState('')
|
||||||
|
const [dcrpPplMtncBizSn, setDcrpPplMtncBizSn] = useState('')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onSwageTreatmentPlantChange?.(0);
|
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
if (!sggName) {
|
if (!sigungu || sigungu.val === '0' || !sigungu.val) {
|
||||||
console.log("BaseLayout: Skipping fetchData because sigungu.val is:", sigungu?.val);
|
console.log("BaseLayout: Skipping fetchData because sigungu.val is:", sigungu?.val);
|
||||||
|
setProcessingZoneOptions([defaultOption]);
|
||||||
setTreatmentFacilityOptions([defaultOption]);
|
setTreatmentFacilityOptions([defaultOption]);
|
||||||
setIsLoadingAreaData(false);
|
setIsLoadingAreaData(false);
|
||||||
return;
|
return;
|
||||||
@@ -108,6 +123,20 @@ const BaseLayout = ({
|
|||||||
|
|
||||||
setIsLoadingAreaData(true);
|
setIsLoadingAreaData(true);
|
||||||
try {
|
try {
|
||||||
|
// const queryParamsZone = new URLSearchParams({
|
||||||
|
// lyrTypeNm: 'tb_ms_swage_prcs_zone',
|
||||||
|
// page: '0',
|
||||||
|
// size: '100000',
|
||||||
|
// sort: 'string',
|
||||||
|
// });
|
||||||
|
// const cqlFiltersZone: string[] = [];
|
||||||
|
// if (sigungu.val && sigungu.val !== '0') {
|
||||||
|
// // console.log("시군구 코드", sigungu.val);
|
||||||
|
// cqlFiltersZone.push(`sgg_cd='${sigungu.val}'`);
|
||||||
|
// }
|
||||||
|
// if (cqlFiltersZone.length > 0) {
|
||||||
|
// queryParamsZone.append('cqlFiter', cqlFiltersZone.join(' and '));
|
||||||
|
// }
|
||||||
|
|
||||||
const queryParamsFacility = new URLSearchParams({
|
const queryParamsFacility = new URLSearchParams({
|
||||||
lyrTypeNm: 'tb_il_swage_prcs_fclt',
|
lyrTypeNm: 'tb_il_swage_prcs_fclt',
|
||||||
@@ -116,26 +145,39 @@ const BaseLayout = ({
|
|||||||
sort: 'string',
|
sort: 'string',
|
||||||
});
|
});
|
||||||
const cqlFiltersFacility: string[] = [];
|
const cqlFiltersFacility: string[] = [];
|
||||||
if (sggName) cqlFiltersFacility.push(`sgg_nm ILIKE '%${sggName}%'`);
|
if (sigungu.text && sigungu.val !== '0') {
|
||||||
if (cqlFiltersFacility.length > 0) queryParamsFacility.append('cqlFiter', cqlFiltersFacility.join(' and '));
|
cqlFiltersFacility.push(`sgg_nm ILIKE '%${sigungu.text}%'`);
|
||||||
|
}
|
||||||
|
if (cqlFiltersFacility.length > 0) {
|
||||||
|
queryParamsFacility.append('cqlFiter', cqlFiltersFacility.join(' and ')); // API 명세에 따라 cqlFilter 또는 cqlFiter
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log("BaseLayout API URL for Zones:", `v1/fclts?${queryParamsZone.toString()}`);
|
||||||
console.log("BaseLayout API URL for Facilities:", `v1/fclts?${queryParamsFacility.toString()}`);
|
console.log("BaseLayout API URL for Facilities:", `v1/fclts?${queryParamsFacility.toString()}`);
|
||||||
|
|
||||||
|
// const [zoneRes, facilityRes] = await Promise.all([
|
||||||
|
// getData(`v1/fclts?${queryParamsZone.toString()}`),
|
||||||
|
// getData(`v1/fclts?${queryParamsFacility.toString()}`)
|
||||||
|
// ]);
|
||||||
const facilityRes = await getData(`v1/fclts?${queryParamsFacility.toString()}`);
|
const facilityRes = await getData(`v1/fclts?${queryParamsFacility.toString()}`);
|
||||||
|
// const zones = (zoneRes.data || []).map((item: any) => ({
|
||||||
|
// text: item.swtrmtZoneNm || item.name || `구역 ${item.id || item.gid || item.objectid}`,
|
||||||
|
// val: item.fid || item.id || item.gid || item.objectid
|
||||||
|
// }));
|
||||||
|
// setProcessingZoneOptions([defaultOption, ...zones]);
|
||||||
|
// console.log("BaseLayout Fetched Processing Zones:", [defaultOption, ...zones]);
|
||||||
|
|
||||||
console.log('facilityRes.data', facilityRes.data);
|
|
||||||
|
|
||||||
const facilities = (facilityRes.data || [])
|
const facilities = (facilityRes.data || []).map((item: any) => ({
|
||||||
.map((item: any) => ({
|
text: item.swtrmtFcltNm || item.name || `시설 ${item.id || item.gid || item.objectid}`,
|
||||||
text: item.swtrmtFcltNm,
|
val: item.fid || item.id || item.gid || item.objectid
|
||||||
val: item.fid
|
}));
|
||||||
}))
|
|
||||||
.sort((a: ApiSelectOption, b: ApiSelectOption) => a.text.localeCompare(b.text, 'ko'));
|
|
||||||
setTreatmentFacilityOptions([defaultOption, ...facilities]);
|
setTreatmentFacilityOptions([defaultOption, ...facilities]);
|
||||||
console.log("BaseLayout Fetched Treatment Facilities:", [defaultOption, ...facilities]);
|
console.log("BaseLayout Fetched Treatment Facilities:", [defaultOption, ...facilities]);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("BaseLayout: 지역/시설 데이터 조회 중 오류 발생:", error);
|
console.error("BaseLayout: 지역/시설 데이터 조회 중 오류 발생:", error);
|
||||||
|
setProcessingZoneOptions([defaultOption]);
|
||||||
setTreatmentFacilityOptions([defaultOption]);
|
setTreatmentFacilityOptions([defaultOption]);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingAreaData(false);
|
setIsLoadingAreaData(false);
|
||||||
@@ -143,7 +185,7 @@ const BaseLayout = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchData();
|
fetchData();
|
||||||
}, [sggName]); // sgg 상태가 변경될 때마다 실행
|
}, [sigungu]); // sigungu 상태가 변경될 때마다 실행
|
||||||
|
|
||||||
// 파일 다운로드
|
// 파일 다운로드
|
||||||
const isChckFile = () => {
|
const isChckFile = () => {
|
||||||
@@ -173,27 +215,26 @@ const BaseLayout = ({
|
|||||||
<h3 className="text-2xl font-medium">{selectBox.title}</h3>
|
<h3 className="text-2xl font-medium">{selectBox.title}</h3>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="ml-2 mt-2 flex items-center w-full">
|
<div className="flex items-center w-full">
|
||||||
{showDatePicker && ( // showDatePicker 값에 따라 DatePicker 렌더링
|
{showDatePicker && ( // showDatePicker 값에 따라 DatePicker 렌더링
|
||||||
<>
|
<>
|
||||||
<Label className="mr-4 w-20 text-xl font-medium text-gray-600 whitespace-nowrap">상수사용기간</Label>
|
<Label className="mr-4 w-20 text-xl text-gray-600 whitespace-nowrap">상수사용기간</Label>
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
field={{
|
field={{
|
||||||
value: aplcnYmFrom || (() => { // aplcnYm이 없으면 현재 연월을 기본값으로 설정
|
value: aplcnYmFrom || (() => { // aplcnYm이 없으면 현재 연월을 기본값으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
// const month = String(now.getMonth() + 1).padStart(2, '0');
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||||
// return `${year}${month}`;
|
return `${year}${month}`;
|
||||||
return `${year}01`;
|
|
||||||
})(), // yyyyMM 형식
|
})(), // yyyyMM 형식
|
||||||
onChange: (value: string) => {
|
onChange: (value: string) => {
|
||||||
setAplcnYmFrom?.(value); // string 값을 직접 전달
|
setAplcnYmFrom?.(value); // string 값을 직접 전달
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
selectClass="ml-8 w-[100px]"
|
selectClass="ml-5 w-[100px]"
|
||||||
startYear={1900} // 시작 연도 설정
|
startYear={1900} // 시작 연도 설정
|
||||||
/>
|
/>
|
||||||
<span className="font-semibold text-xl mx-4">~</span>
|
<span className="font-semibold text-xl mx-2">~</span>
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
field={{
|
field={{
|
||||||
value: aplcnYmTo || (() => { // aplcnYm이 없으면 현재 연월을 기본값으로 설정
|
value: aplcnYmTo || (() => { // aplcnYm이 없으면 현재 연월을 기본값으로 설정
|
||||||
@@ -206,53 +247,32 @@ const BaseLayout = ({
|
|||||||
setAplcnYmTo?.(value); // string 값을 직접 전달
|
setAplcnYmTo?.(value); // string 값을 직접 전달
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
selectClass="w-[100px] mr-8"
|
selectClass="w-[100px]"
|
||||||
startYear={1900} // 시작 연도 설정
|
startYear={1900} // 시작 연도 설정
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<SidoSigunguSelectBox
|
<GovSidoSigunguSearchForm
|
||||||
sido={ctpvCd}
|
isShowPart={true}
|
||||||
sigungu={sggCd}
|
setRtnEnvPartValue={(val) => setEnoCd?.(val)}
|
||||||
onSidoChange={(sidoId) => {
|
setRtnEnvPartSidoValue={(val) => setCtpvCd?.(val)}
|
||||||
setCtpvCd(sidoId);
|
setRtnEnvPartSigunValue={setSigungu} // 선택된 시군구 값을 받을 콜백 함수 전달
|
||||||
setSggCd(0);
|
>
|
||||||
}}
|
<SelectBox label={"하수처리장"} value={selectedSwageTreatmentPlant} selectArray={treatmentFacilityOptions} className="col-span-3" selectClass="ml-5 rounded-lg bg-white truncate" onSelectValue={(val) => onSwageTreatmentPlantChange?.(val)} selectContentClass="z-[101]" />
|
||||||
onSigunguChange={setSggCd}
|
{/* <SelectBox label={"하수처리구역"} value={selectedSwageProcessingZone} selectArray={processingZoneOptions} className="col-span-3" selectClass="rounded-lg bg-white truncate" onSelectValue={(val) => onSwageProcessingZoneChange?.(val)} selectContentClass="z-[101]" /> */}
|
||||||
setSggName={setSggName}
|
</GovSidoSigunguSearchForm>
|
||||||
/>
|
{selectBox?.searchChk ? <SearchFormRight><Button size="sm" onClick={() => selectBox.onSearchClick?.()}>조회</Button></SearchFormRight> : null}
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-4">하수처리장</Label>
|
|
||||||
<SelectBox
|
|
||||||
label={''}
|
|
||||||
value={selectedSwageTreatmentPlant}
|
|
||||||
selectArray={treatmentFacilityOptions}
|
|
||||||
className="w-[160px]"
|
|
||||||
selectClass="rounded-lg bg-white truncate"
|
|
||||||
onSelectValue={(val) => onSwageTreatmentPlantChange?.(val)}
|
|
||||||
selectContentClass="z-[101]"
|
|
||||||
/>
|
|
||||||
{selectBox?.searchChk && (
|
|
||||||
<div className='flex flex-1 justify-end mr-6'>
|
|
||||||
<Button size="sm" onClick={() => selectBox.onSearchClick?.()}>조회</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</ListDiv>
|
</ListDiv>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<h3 className="text-2xl font-medium">{titleName.firstCardTitle}</h3>
|
<h3 className="text-2xl font-medium">{titleName.firstCardTitle}</h3>
|
||||||
<div>
|
<div>
|
||||||
{graphBtn && (
|
{graphBtn ? <Button className="px-4 py-2 !mr-[1.2rem] bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700" size="sm" onClick={isChckFile}>파일 다운로드</Button> : null}
|
||||||
<Button className="px-4 py-2 !mr-[1.2rem] bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700" size="sm" onClick={isChckFile}>파일 다운로드</Button>
|
|
||||||
)}
|
|
||||||
{/* 그래프 있을 시 */}
|
{/* 그래프 있을 시 */}
|
||||||
{graphBtn && (
|
{graphBtn ? <Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm" onClick={isDeleteFile}>삭제</Button> : null}
|
||||||
<Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm" onClick={isDeleteFile}>삭제</Button>
|
|
||||||
)}
|
|
||||||
{/* 분석 버튼 */}
|
{/* 분석 버튼 */}
|
||||||
{analysisBtn && (
|
{analysisBtn ? <Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm" onClick={onAnalysis}>{analysisBtn}</Button> : null}
|
||||||
<Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm" onClick={onAnalysis}>{analysisBtn}</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
@@ -264,23 +284,19 @@ const BaseLayout = ({
|
|||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</ListDiv>
|
</ListDiv>
|
||||||
{children?.[1] != null && (
|
{
|
||||||
<ListDiv>
|
children?.[1] != null ? <ListDiv>
|
||||||
<div className="card-header flex items-center">
|
<div className="card-header flex items-center justify-between">
|
||||||
<h3 className="text-2xl font-medium">{titleName?.secondCardTitle}</h3>
|
<h3 className="text-2xl font-medium">{titleName?.secondCardTitle}</h3>
|
||||||
<div className='flex flex-1 justify-end mr-8'>
|
<div>
|
||||||
{graphBtn && (
|
{graphBtn ? <Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm">파일 다운로드</Button> : null}
|
||||||
<Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm">파일 다운로드</Button>
|
|
||||||
)}
|
|
||||||
{/* 그래프 있을 시 */}
|
{/* 그래프 있을 시 */}
|
||||||
{graphBtn && (
|
{graphBtn ? <Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm">삭제</Button> : null}
|
||||||
<Button className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700 !mr-[1.2rem]" size="sm">삭제</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card !m-[1.2rem]">{children?.[1]}</div>
|
<div className="card !m-[1.2rem]">{children?.[1]}</div>
|
||||||
</ListDiv>
|
</ListDiv> : null
|
||||||
)}
|
}
|
||||||
</Form>
|
</Form>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,14 +47,15 @@ interface ApiSelectOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const IrSetting = () => {
|
const IrSetting = () => {
|
||||||
const [input1, setInput1] = useState('0.8'); // 오수전환율 초기값
|
const [input1, setInput1] = useState('');
|
||||||
const [input2, setInput2] = useState('');
|
const [input2, setInput2] = useState('');
|
||||||
const [select1, setSelect1] = useState<string | number>('0'); // 하수처리장코드
|
const [select1, setSelect1] = useState('0'); // 환경청코드
|
||||||
|
const [select2, setSelect2] = useState('0'); // 시도코드
|
||||||
|
const [select3, setSelect3] = useState<ApiSelectOption>({ val: '0', text: '전체' }); // 시군구 상태를 객체로 변경
|
||||||
|
const [select4, setSelect4] = useState<string | number>('0'); // 하수처리장코드
|
||||||
|
const [select5, setSelect5] = useState<string | number>('0'); // 하수처리구역코드
|
||||||
const [formResetKey, setFormResetKey] = useState(0); // FileUploadForm 리셋을 위한 key 상태
|
const [formResetKey, setFormResetKey] = useState(0); // FileUploadForm 리셋을 위한 key 상태
|
||||||
const [isLoadingResult, setIsLoadingResult] = useState<boolean>(false); // 로딩 상태
|
const [isLoadingResult, setIsLoadingResult] = useState<boolean>(false); // 로딩 상태
|
||||||
const [ctpvCd, setCtpvCd] = useState<number>(0); // 시도 코드 상태
|
|
||||||
const [sggCd, setSggCd] = useState<number>(0); // 시군구 코드 상태
|
|
||||||
const [sggName, setSggName] = useState<string>(''); // 시군구 이름 상태
|
|
||||||
|
|
||||||
const { data: userInfo } = useQuery({
|
const { data: userInfo } = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.USERS],
|
queryKey: [ENDPOINT.USER_SERVICE.USERS],
|
||||||
@@ -114,7 +115,11 @@ const IrSetting = () => {
|
|||||||
setSelectedDate(`${year}${month}`);
|
setSelectedDate(`${year}${month}`);
|
||||||
setInput1(''); // 입력 필드 초기화
|
setInput1(''); // 입력 필드 초기화
|
||||||
setInput2(''); // 입력 필드 초기화
|
setInput2(''); // 입력 필드 초기화
|
||||||
setSelect1(0);
|
setSelect1('0'); // 선택 필드 초기화
|
||||||
|
setSelect2('0');
|
||||||
|
setSelect3({ val: '0', text: '전체' });
|
||||||
|
setSelect4(0);
|
||||||
|
setSelect5(0);
|
||||||
setFormResetKey(prevKey => prevKey + 1); // FileUploadForm 재마운트를 위해 key 변경
|
setFormResetKey(prevKey => prevKey + 1); // FileUploadForm 재마운트를 위해 key 변경
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,7 +164,7 @@ const IrSetting = () => {
|
|||||||
setIsLoadingResult(true); // 로딩 상태 시작
|
setIsLoadingResult(true); // 로딩 상태 시작
|
||||||
|
|
||||||
// 기본 선택 항목들 검증 (환경청, 시도, 시군구, 하수처리장)
|
// 기본 선택 항목들 검증 (환경청, 시도, 시군구, 하수처리장)
|
||||||
if (!validateBasicSelectionsWithAlert(select1, {
|
if (!validateBasicSelectionsWithAlert(select1, select2, select3, select4, {
|
||||||
requireEnv: true,
|
requireEnv: true,
|
||||||
requireSido: true,
|
requireSido: true,
|
||||||
requireSigungu: true,
|
requireSigungu: true,
|
||||||
@@ -294,11 +299,15 @@ const IrSetting = () => {
|
|||||||
|
|
||||||
// 새로운 JSON 데이터 생성
|
// 새로운 JSON 데이터 생성
|
||||||
const combinedAnalysisData = {
|
const combinedAnalysisData = {
|
||||||
ctpvCd: (ctpvCd ? String(ctpvCd) : null),
|
enoCd: (select1 && select1 !== '0') ? select1.toString() : null, // 환경청코드 (선택값)
|
||||||
sggCd: (sggCd ? String(sggCd) : null), // 시군구코드 (선택값)
|
ctpvCd: (select2 && select2 !== '0') ? select2.toString() : null, // 시도코드 (선택값)
|
||||||
swageTmplntCd: (select1 && select1 !== '0' && select1 !== 0)
|
sggCd: (select3.val && select3.val !== '0') ? select3.val.toString() : null, // 시군구코드 (선택값)
|
||||||
? select1.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
swageTmplntCd: (select4 && select4 !== '0' && select4 !== 0)
|
||||||
|
? select4.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
||||||
: null, // 하수처리장코드 (선택값)
|
: null, // 하수처리장코드 (선택값)
|
||||||
|
swtrmtZoneCd: (select5 && select5 !== '0' && select5 !== 0)
|
||||||
|
? select5.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
||||||
|
: null, // 하수처리구역코드 (선택값)
|
||||||
aplcnYm: selectedDate, // 적용연월
|
aplcnYm: selectedDate, // 적용연월
|
||||||
drtwSwtcRt: parseFloat(input1) || null, // 오수전환율 (숫자로 변환)
|
drtwSwtcRt: parseFloat(input1) || null, // 오수전환율 (숫자로 변환)
|
||||||
anlsInfo: input2, // 분석정보
|
anlsInfo: input2, // 분석정보
|
||||||
@@ -337,14 +346,16 @@ const IrSetting = () => {
|
|||||||
graphBtn={false}
|
graphBtn={false}
|
||||||
analysisBtn={'침입수분석 실행'}
|
analysisBtn={'침입수분석 실행'}
|
||||||
selectBox={{ title: '분석 대상지역 선택' }}
|
selectBox={{ title: '분석 대상지역 선택' }}
|
||||||
ctpvCd={ctpvCd}
|
enoCd={select1}
|
||||||
sggCd={sggCd}
|
setEnoCd={setSelect1}
|
||||||
sggName={sggName}
|
ctpvCd={select2}
|
||||||
selectedSwageTreatmentPlant={select1}
|
setCtpvCd={setSelect2}
|
||||||
onSwageTreatmentPlantChange={setSelect1}
|
sigungu={select3}
|
||||||
setCtpvCd={setCtpvCd}
|
setSigungu={setSelect3}
|
||||||
setSggCd={setSggCd}
|
selectedSwageTreatmentPlant={select4}
|
||||||
setSggName={setSggName}
|
onSwageTreatmentPlantChange={setSelect4}
|
||||||
|
selectedSwageProcessingZone={select5}
|
||||||
|
onSwageProcessingZoneChange={setSelect5}
|
||||||
isLoading={isLoadingResult}
|
isLoading={isLoadingResult}
|
||||||
onAnalysis={handleAnalysisClick}
|
onAnalysis={handleAnalysisClick}
|
||||||
>
|
>
|
||||||
@@ -376,7 +387,10 @@ const IrSetting = () => {
|
|||||||
accept={".xls, .xlsx, .xlsm, .xltx"}
|
accept={".xls, .xlsx, .xlsm, .xltx"}
|
||||||
fileIdx={2} />
|
fileIdx={2} />
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection name='inputdate' form={form} titleNm='▷ 상수사용량 적용월'>
|
<FormSection
|
||||||
|
name='inputdate'
|
||||||
|
form={form}
|
||||||
|
titleNm='▷ 상수사용량 적용월'>
|
||||||
{/* 연월 선택 라이브러리로 수정 필요 */}
|
{/* 연월 선택 라이브러리로 수정 필요 */}
|
||||||
<DateMonthPicker
|
<DateMonthPicker
|
||||||
field={{
|
field={{
|
||||||
@@ -385,11 +399,14 @@ const IrSetting = () => {
|
|||||||
setSelectedDate(value);
|
setSelectedDate(value);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[225px]"
|
selectClass="ml-5 w-[150px]"
|
||||||
startYear={1900} // 시작 연도 설정
|
startYear={1900} // 시작 연도 설정
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection name='rtkSource' form={form} titleNm='▷ 오수전환율'>
|
<FormSection
|
||||||
|
name='rtkSource'
|
||||||
|
form={form}
|
||||||
|
titleNm='▷ 오수전환율'>
|
||||||
<Input
|
<Input
|
||||||
value={input1}
|
value={input1}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -413,23 +430,18 @@ const IrSetting = () => {
|
|||||||
|
|
||||||
setInput1(newValue);
|
setInput1(newValue);
|
||||||
}}
|
}}
|
||||||
className="ml-5 h-[3.2rem] text-center text-xl w-[225px]"
|
className="ml-5 h-[3.2rem] text-center text-xl w-[150px]"
|
||||||
placeholder="예: 0.75"
|
placeholder="예: 0.75"
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection name='analysis information' form={form} titleNm='▷ 분석 정보'>
|
<FormSection
|
||||||
|
name='analysis information'
|
||||||
|
form={form}
|
||||||
|
titleNm='▷ 분석 정보'>
|
||||||
<Input
|
<Input
|
||||||
value={input2}
|
value={input2}
|
||||||
onChange={(e) => setInput2(e.target.value)}
|
onChange={(e) => setInput2(e.target.value)}
|
||||||
className="ml-5 h-[3.2rem] text-center text-xl w-[225px]"
|
className="ml-5 h-[3.2rem] text-center text-xl w-[150px]" />
|
||||||
placeholder='세부 분석정보 입력'
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleAnalysisClick();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<div className="card !m-[1.2rem]">
|
<div className="card !m-[1.2rem]">
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ const defaultFormValues: FormSchemaType = {
|
|||||||
sggCd: "",
|
sggCd: "",
|
||||||
swageTmplntCd: "",
|
swageTmplntCd: "",
|
||||||
swtrmtZoneCd: "",
|
swtrmtZoneCd: "",
|
||||||
rtkSource: "",
|
rtkSource: "출처",
|
||||||
rdiiArea: "", // 문자열로 기본값 설정
|
rdiiArea: "123", // 문자열로 기본값 설정
|
||||||
unitFactors: [
|
unitFactors: [
|
||||||
{ response: "Short-Term", R: "0.040", T: "0.5", K: "1" }, // 문자열로 기본값 설정
|
{ response: "Short-Term", R: "0.040", T: "0.5", K: "1" }, // 문자열로 기본값 설정
|
||||||
{ response: "Medium-Term", R: "0.005", T: "1", K: "2" },
|
{ response: "Medium-Term", R: "0.005", T: "1", K: "2" },
|
||||||
@@ -78,7 +78,7 @@ const defaultFormValues: FormSchemaType = {
|
|||||||
aplcnYm: "",
|
aplcnYm: "",
|
||||||
rate: "0.8", // 문자열로 기본값 설정
|
rate: "0.8", // 문자열로 기본값 설정
|
||||||
// rainFile: undefined,
|
// rainFile: undefined,
|
||||||
analysisInfo: "",
|
analysisInfo: "test 분석정보",
|
||||||
date: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
date: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
@@ -114,10 +114,11 @@ export default function RTKForm() {
|
|||||||
initialFileInfo, // 2: 강우자료
|
initialFileInfo, // 2: 강우자료
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const [select1, setSelect1] = useState<string | number>('0'); // 하수처리장 (swageTmplntCd)
|
const [select1, setSelect1] = useState('0'); // 환경청코드 (enoCd)
|
||||||
const [ctpvCd, setCtpvCd] = useState<number>(0); // 시도 코드 상태
|
const [select2, setSelect2] = useState('0'); // 시도코드 (ctpvCd)
|
||||||
const [sggCd, setSggCd] = useState<number>(0); // 시군구 코드 상태
|
const [select3, setSelect3] = useState<ApiSelectOption>({ val: '0', text: '전체' }); // 시군구 (sggCd)
|
||||||
const [sggName, setSggName] = useState<string>(''); // 시군구 이름 상태
|
const [select4, setSelect4] = useState<string | number>('0'); // 하수처리장 (swageTmplntCd)
|
||||||
|
const [select5, setSelect5] = useState<string | number>('0'); // 하수처리구역 (swtrmtZoneCd)
|
||||||
|
|
||||||
const { data: userInfo } = useQuery({
|
const { data: userInfo } = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.USERS],
|
queryKey: [ENDPOINT.USER_SERVICE.USERS],
|
||||||
@@ -141,6 +142,10 @@ export default function RTKForm() {
|
|||||||
]);
|
]);
|
||||||
setFormResetKey(prevKey => prevKey + 1); // FileUploadForm 재마운트를 위해 key 변경
|
setFormResetKey(prevKey => prevKey + 1); // FileUploadForm 재마운트를 위해 key 변경
|
||||||
setSelect1('0');
|
setSelect1('0');
|
||||||
|
setSelect2('0');
|
||||||
|
setSelect3({ val: '0', text: '전체' });
|
||||||
|
setSelect4('0');
|
||||||
|
setSelect5('0');
|
||||||
};
|
};
|
||||||
|
|
||||||
// FileUploadForm의 onFileSelect prop으로 전달될 콜백 함수
|
// FileUploadForm의 onFileSelect prop으로 전달될 콜백 함수
|
||||||
@@ -177,7 +182,7 @@ export default function RTKForm() {
|
|||||||
setIsLoadingResult(true); // 로딩 상태 시작
|
setIsLoadingResult(true); // 로딩 상태 시작
|
||||||
|
|
||||||
// 기본 선택 항목들 검증 (환경청, 시도, 시군구, 하수처리장)
|
// 기본 선택 항목들 검증 (환경청, 시도, 시군구, 하수처리장)
|
||||||
if (!validateBasicSelectionsWithAlert(select1, {
|
if (!validateBasicSelectionsWithAlert(select1, select2, select3, select4, {
|
||||||
requireEnv: true,
|
requireEnv: true,
|
||||||
requireSido: true,
|
requireSido: true,
|
||||||
requireSigungu: true,
|
requireSigungu: true,
|
||||||
@@ -290,12 +295,16 @@ export default function RTKForm() {
|
|||||||
|
|
||||||
// 새로운 JSON 데이터 생성
|
// 새로운 JSON 데이터 생성
|
||||||
const combinedAnalysisData = {
|
const combinedAnalysisData = {
|
||||||
|
enoCd: (select1 && select1 !== '0') ? select1.toString() : null, // 환경청코드 (선택값)
|
||||||
aplcnYm: formData.date, // 적용연월 (YYYYMM 형식)
|
aplcnYm: formData.date, // 적용연월 (YYYYMM 형식)
|
||||||
ctpvCd: ctpvCd ? String(ctpvCd) : null, // 시도코드 (선택값)
|
ctpvCd: (select2 && select2 !== '0') ? select2.toString() : null, // 시도코드 (선택값)
|
||||||
sggCd: sggCd ? String(sggCd) : null, // 시군구코드 (선택값)
|
sggCd: (select3.val && select3.val !== '0') ? select3.val.toString() : null, // 시군구코드 (선택값)
|
||||||
swageTmplntCd: (select1 && select1 !== '0' && select1 !== 0)
|
swageTmplntCd: (select4 && select4 !== '0' && select4 !== 0)
|
||||||
? select1.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
? select4.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
||||||
: null, // 하수처리장코드 (선택값)
|
: null, // 하수처리장코드 (선택값)
|
||||||
|
swtrmtZoneCd: (select5 && select5 !== '0' && select5 !== 0)
|
||||||
|
? select5.toString().split('.').pop() || null // '.'으로 split해서 마지막 부분만 사용
|
||||||
|
: null, // 하수처리구역코드 (선택값)
|
||||||
atflCd: file1?.atflCd, // 첨부파일CD (오수관망도)
|
atflCd: file1?.atflCd, // 첨부파일CD (오수관망도)
|
||||||
atflId: file1?.atflId, // 첨부파일ID (오수관망도)
|
atflId: file1?.atflId, // 첨부파일ID (오수관망도)
|
||||||
atflInpNm: file1?.file?.name || "", // 오수관망도 파일명
|
atflInpNm: file1?.file?.name || "", // 오수관망도 파일명
|
||||||
@@ -386,6 +395,7 @@ export default function RTKForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
// <BaseLayout searchBox={{ title: '분석 대상지역 선택' }} titleName={{ mainTitle: 'RDII 분석', firstCardTitle: 'RDII 분석자료 입력', secondCardTitle: '실측자료 등록' }} form={form} onSubmitEvent={() => { }} graphBtn={false} >
|
||||||
<BaseLayout
|
<BaseLayout
|
||||||
selectBox={{ title: '분석 대상지역 선택' }}
|
selectBox={{ title: '분석 대상지역 선택' }}
|
||||||
titleName={{ mainTitle: 'RDII 분석', firstCardTitle: 'RDII 분석자료 입력', secondCardTitle: '실측자료 등록' }}
|
titleName={{ mainTitle: 'RDII 분석', firstCardTitle: 'RDII 분석자료 입력', secondCardTitle: '실측자료 등록' }}
|
||||||
@@ -393,14 +403,16 @@ export default function RTKForm() {
|
|||||||
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
||||||
graphBtn={false}
|
graphBtn={false}
|
||||||
analysisBtn={'RDII분석 실행'}
|
analysisBtn={'RDII분석 실행'}
|
||||||
ctpvCd={ctpvCd}
|
enoCd={select1}
|
||||||
sggCd={sggCd}
|
setEnoCd={setSelect1}
|
||||||
sggName={sggName}
|
ctpvCd={select2}
|
||||||
selectedSwageTreatmentPlant={select1}
|
setCtpvCd={setSelect2}
|
||||||
onSwageTreatmentPlantChange={setSelect1}
|
sigungu={select3}
|
||||||
setCtpvCd={setCtpvCd}
|
setSigungu={setSelect3}
|
||||||
setSggCd={setSggCd}
|
selectedSwageTreatmentPlant={select4}
|
||||||
setSggName={setSggName}
|
onSwageTreatmentPlantChange={setSelect4}
|
||||||
|
selectedSwageProcessingZone={select5}
|
||||||
|
onSwageProcessingZoneChange={setSelect5}
|
||||||
isLoading={isLoadingResult}
|
isLoading={isLoadingResult}
|
||||||
onAnalysis={handleAnalysisClick}
|
onAnalysis={handleAnalysisClick}
|
||||||
>
|
>
|
||||||
@@ -489,7 +501,7 @@ export default function RTKForm() {
|
|||||||
form.setValue("rate", newValue, { shouldValidate: true }); // form의 rate 필드에 설정
|
form.setValue("rate", newValue, { shouldValidate: true }); // form의 rate 필드에 설정
|
||||||
}}
|
}}
|
||||||
className="h-12 text-center text-xl w-[225px] ml-5"
|
className="h-12 text-center text-xl w-[225px] ml-5"
|
||||||
placeholder="0 ~ 1 사이의 값 입력"
|
placeholder="예: 0.75"
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection name='date' form={form} titleNm='○ 상수사용량 적용월'>
|
<FormSection name='date' form={form} titleNm='○ 상수사용량 적용월'>
|
||||||
@@ -500,24 +512,17 @@ export default function RTKForm() {
|
|||||||
form.setValue("date", value, { shouldValidate: true }); // form의 date 필드에 직접 설정
|
form.setValue("date", value, { shouldValidate: true }); // form의 date 필드에 직접 설정
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
selectClass="ml-5 w-[225px]"
|
selectClass="ml-5 w-[200px]"
|
||||||
startYear={1900} // 시작 연도 설정
|
startYear={1900} // 시작 연도 설정
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection name='rate' form={form} titleNm='○ 분석 정보'>
|
<FormSection name='rate' form={form} titleNm='○ 분석 정보'>
|
||||||
<Input
|
<Input {...form.register("analysisInfo")} className="h-12 text-center text-xl w-[225px] ml-5" />
|
||||||
{...form.register("analysisInfo")}
|
|
||||||
className="h-12 text-center text-xl w-[225px] ml-5"
|
|
||||||
placeholder='세부 분석정보 입력'
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleAnalysisClick();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormSection>
|
</FormSection>
|
||||||
</div>
|
</div>
|
||||||
|
{/* <div className="flex justify-end mt-1">
|
||||||
|
<Button size="sm" type="submit" onClick={handleAnalysisClick}>RDII분석 실행</Button>
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
]}
|
]}
|
||||||
</BaseLayout >
|
</BaseLayout >
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { deleteData, getData } from '@/components/lib/api'
|
import { deleteData, getData, useCookieAuth } from '@/components/lib/api'
|
||||||
import { UiTable, downloadExcelWithKoreanHeaders } from '@common/business_components/ui'
|
import { UiTable, downloadExcelWithKoreanHeaders } from '@common/business_components/ui'
|
||||||
import { zodResolver } from '@hookform/resolvers/zod'
|
import { zodResolver } from '@hookform/resolvers/zod'
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
@@ -11,14 +11,19 @@ import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
|||||||
|
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
|
enoCd: z.string().default('0'), // 환경청코드
|
||||||
|
ctpvCd: z.string().default('0'), // 시도코드
|
||||||
|
sggCd: z.object({ // 시군구
|
||||||
|
val: z.string().default('0'),
|
||||||
|
text: z.string().default('전체'),
|
||||||
|
}).default({ val: '0', text: '전체' }),
|
||||||
swageTmplntCd: z.string().default('0'), // 하수처리장
|
swageTmplntCd: z.string().default('0'), // 하수처리장
|
||||||
swtrmtZoneCd: z.string().default('0'), // 하수처리구역
|
swtrmtZoneCd: z.string().default('0'), // 하수처리구역
|
||||||
aplcnYmFrom: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
aplcnYmFrom: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
// const month = String(now.getMonth() + 1).padStart(2, '0');
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||||
// return `${year}${month}`;
|
return `${year}${month}`;
|
||||||
return `${year}01`; // 기본값을 1월로 설정
|
|
||||||
}), // 분석기간 시작연월
|
}), // 분석기간 시작연월
|
||||||
aplcnYmTo: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
aplcnYmTo: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@@ -48,18 +53,21 @@ const tableColumn = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const Result = () => {
|
const Result = () => {
|
||||||
|
const AUTH = useCookieAuth();
|
||||||
|
|
||||||
const form = useForm<ResultFormValues>({
|
const form = useForm<ResultFormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
enoCd: '0',
|
||||||
|
ctpvCd: '0',
|
||||||
|
sggCd: { val: '0', text: '전체' },
|
||||||
swageTmplntCd: '0',
|
swageTmplntCd: '0',
|
||||||
swtrmtZoneCd: '0',
|
swtrmtZoneCd: '0',
|
||||||
aplcnYmFrom: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
aplcnYmFrom: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
// const month = String(now.getMonth() + 1).padStart(2, '0');
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||||
// return `${year}${month}`;
|
return `${year}${month}`;
|
||||||
return `${year}01`;
|
|
||||||
})(),
|
})(),
|
||||||
aplcnYmTo: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
aplcnYmTo: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@@ -78,9 +86,6 @@ const Result = () => {
|
|||||||
const [resetSelection, setResetSelection] = useState<boolean>(false);
|
const [resetSelection, setResetSelection] = useState<boolean>(false);
|
||||||
const [isResetPage, setIsResetPage] = useState<boolean>(false);
|
const [isResetPage, setIsResetPage] = useState<boolean>(false);
|
||||||
const [curPage, setCurPage] = useState(1); // 현재 페이지
|
const [curPage, setCurPage] = useState(1); // 현재 페이지
|
||||||
const [ctpvCd, setCtpvCd] = useState<number>(0); // 시도 코드 상태
|
|
||||||
const [sggCd, setSggCd] = useState<number>(0); // 시군구 코드 상태
|
|
||||||
const [sggName, setSggName] = useState<string>(''); // 시군구 이름 상태
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// setCurPage(1);
|
// setCurPage(1);
|
||||||
@@ -120,9 +125,11 @@ const Result = () => {
|
|||||||
let inftwtAnlsSearchDto = {
|
let inftwtAnlsSearchDto = {
|
||||||
"aplcnYmFrom": formValues.aplcnYmFrom && formValues.aplcnYmFrom !== '' ? formValues.aplcnYmFrom : null,
|
"aplcnYmFrom": formValues.aplcnYmFrom && formValues.aplcnYmFrom !== '' ? formValues.aplcnYmFrom : null,
|
||||||
"aplcnYmTo": formValues.aplcnYmTo && formValues.aplcnYmTo !== '' ? formValues.aplcnYmTo : null,
|
"aplcnYmTo": formValues.aplcnYmTo && formValues.aplcnYmTo !== '' ? formValues.aplcnYmTo : null,
|
||||||
"ctpvCd": ctpvCd === 0 ? null : ctpvCd,
|
"enoCd": formValues.enoCd === '0' ? null : formValues.enoCd,
|
||||||
"sggCd": sggCd === 0 ? null : sggCd,
|
"ctpvCd": formValues.ctpvCd === '0' ? null : formValues.ctpvCd,
|
||||||
|
"sggCd": formValues.sggCd?.val === '0' ? null : formValues.sggCd?.val,
|
||||||
"swageTmplntCd": processedSwageTmplntCd,
|
"swageTmplntCd": processedSwageTmplntCd,
|
||||||
|
"auth": AUTH,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Search DTO:", inftwtAnlsSearchDto);
|
console.log("Search DTO:", inftwtAnlsSearchDto);
|
||||||
@@ -154,8 +161,7 @@ const Result = () => {
|
|||||||
rowNumber: (curPage - 1) * 10 + index + 1, // 1부터 시작하는 일련번호 추가
|
rowNumber: (curPage - 1) * 10 + index + 1, // 1부터 시작하는 일련번호 추가
|
||||||
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item.scsYn // scsYn이 null이면 'N'으로 변경
|
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item.scsYn // scsYn이 null이면 'N'으로 변경
|
||||||
};
|
};
|
||||||
})
|
});
|
||||||
.filter((item: any) => item.scsYn === 'Y');
|
|
||||||
|
|
||||||
// 선택된 행 초기화
|
// 선택된 행 초기화
|
||||||
setSelectedRowData(null);
|
setSelectedRowData(null);
|
||||||
@@ -281,18 +287,20 @@ const Result = () => {
|
|||||||
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
||||||
graphBtn={true}
|
graphBtn={true}
|
||||||
showDatePicker={true}
|
showDatePicker={true}
|
||||||
ctpvCd={ctpvCd}
|
enoCd={form.watch("enoCd")}
|
||||||
sggCd={sggCd}
|
setEnoCd={(val) => form.setValue("enoCd", val)}
|
||||||
sggName={sggName}
|
ctpvCd={form.watch("ctpvCd")}
|
||||||
|
setCtpvCd={(val) => form.setValue("ctpvCd", val)}
|
||||||
|
sigungu={form.watch("sggCd")}
|
||||||
|
setSigungu={(val) => form.setValue("sggCd", val)}
|
||||||
selectedSwageTreatmentPlant={form.watch("swageTmplntCd")}
|
selectedSwageTreatmentPlant={form.watch("swageTmplntCd")}
|
||||||
onSwageTreatmentPlantChange={(val) => form.setValue("swageTmplntCd", String(val))}
|
onSwageTreatmentPlantChange={(val) => form.setValue("swageTmplntCd", String(val))}
|
||||||
|
selectedSwageProcessingZone={form.watch("swtrmtZoneCd")}
|
||||||
|
onSwageProcessingZoneChange={(val) => form.setValue("swtrmtZoneCd", String(val))}
|
||||||
aplcnYmFrom={form.watch("aplcnYmFrom")}
|
aplcnYmFrom={form.watch("aplcnYmFrom")}
|
||||||
setAplcnYmFrom={(val: string) => { form.setValue("aplcnYmFrom", val) }}
|
setAplcnYmFrom={(val: string) => { form.setValue("aplcnYmFrom", val) }}
|
||||||
aplcnYmTo={form.watch("aplcnYmTo")}
|
aplcnYmTo={form.watch("aplcnYmTo")}
|
||||||
setAplcnYmTo={(val: string) => { form.setValue("aplcnYmTo", val) }}
|
setAplcnYmTo={(val: string) => { form.setValue("aplcnYmTo", val) }}
|
||||||
setCtpvCd={setCtpvCd}
|
|
||||||
setSggCd={setSggCd}
|
|
||||||
setSggName={setSggName}
|
|
||||||
isLoading={isLoadingResult}
|
isLoading={isLoadingResult}
|
||||||
// Excel 다운로드 핸들러 추가
|
// Excel 다운로드 핸들러 추가
|
||||||
onExcelDownload={handleExcelDownload}
|
onExcelDownload={handleExcelDownload}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { deleteData, getData } from '@/components/lib/api'
|
import { deleteData, getData, useCookieAuth } from '@/components/lib/api'
|
||||||
import { UiTable, downloadExcelWithKoreanHeaders } from '@common/business_components/ui'
|
import { UiTable, downloadExcel, downloadExcelWithKoreanHeaders } from '@common/business_components/ui'
|
||||||
import { zodResolver } from '@hookform/resolvers/zod'
|
import { zodResolver } from '@hookform/resolvers/zod'
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { useForm } from 'react-hook-form'
|
import { useForm } from 'react-hook-form'
|
||||||
@@ -11,14 +11,19 @@ import { formatDisplayData } from '@/components/lib/utils/formatDisplayValue';
|
|||||||
|
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
|
enoCd: z.string().default('0'), // 환경청코드
|
||||||
|
ctpvCd: z.string().default('0'), // 시도코드
|
||||||
|
sggCd: z.object({ // 시군구
|
||||||
|
val: z.string().default('0'),
|
||||||
|
text: z.string().default('전체'),
|
||||||
|
}).default({ val: '0', text: '전체' }),
|
||||||
swageTmplntCd: z.string().default('0'), // 하수처리장
|
swageTmplntCd: z.string().default('0'), // 하수처리장
|
||||||
swtrmtZoneCd: z.string().default('0'), // 하수처리구역
|
swtrmtZoneCd: z.string().default('0'), // 하수처리구역
|
||||||
aplcnYmFrom: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
aplcnYmFrom: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
// const month = String(now.getMonth() + 1).padStart(2, '0');
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||||
// return `${year}${month}`;
|
return `${year}${month}`;
|
||||||
return `${year}01`;
|
|
||||||
}), // 분석기간 시작연월
|
}), // 분석기간 시작연월
|
||||||
aplcnYmTo: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
aplcnYmTo: z.string().default(() => { // Date에서 string(yyyyMM 형식)으로 변경
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@@ -49,14 +54,16 @@ const Result = () => {
|
|||||||
const form = useForm<ResultFormValues>({
|
const form = useForm<ResultFormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
enoCd: '0',
|
||||||
|
ctpvCd: '0',
|
||||||
|
sggCd: { val: '0', text: '전체' },
|
||||||
swageTmplntCd: '0',
|
swageTmplntCd: '0',
|
||||||
swtrmtZoneCd: '0',
|
swtrmtZoneCd: '0',
|
||||||
aplcnYmFrom: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
aplcnYmFrom: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
// const month = String(now.getMonth() + 1).padStart(2, '0');
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||||
// return `${year}${month}`;
|
return `${year}${month}`;
|
||||||
return `${year}01`;
|
|
||||||
})(),
|
})(),
|
||||||
aplcnYmTo: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
aplcnYmTo: (() => { // 현재 연월을 yyyyMM 형식으로 설정
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@@ -67,6 +74,8 @@ const Result = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const AUTH = useCookieAuth();
|
||||||
|
|
||||||
const [tableData, setTableData] = useState<any[]>([]); // API 조회 결과 저장 상태
|
const [tableData, setTableData] = useState<any[]>([]); // API 조회 결과 저장 상태
|
||||||
const [totalData, setTotalData] = useState(0) //총 데이터 수l
|
const [totalData, setTotalData] = useState(0) //총 데이터 수l
|
||||||
const [isLoadingResult, setIsLoadingResult] = useState<boolean>(false); // 로딩 상태
|
const [isLoadingResult, setIsLoadingResult] = useState<boolean>(false); // 로딩 상태
|
||||||
@@ -74,9 +83,6 @@ const Result = () => {
|
|||||||
const [resetSelection, setResetSelection] = useState<boolean>(false);
|
const [resetSelection, setResetSelection] = useState<boolean>(false);
|
||||||
const [isResetPage, setIsResetPage] = useState<boolean>(false);
|
const [isResetPage, setIsResetPage] = useState<boolean>(false);
|
||||||
const [curPage, setCurPage] = useState(1); // 현재 페이지
|
const [curPage, setCurPage] = useState(1); // 현재 페이지
|
||||||
const [ctpvCd, setCtpvCd] = useState<number>(0); // 시도 코드 상태
|
|
||||||
const [sggCd, setSggCd] = useState<number>(0); // 시군구 코드 상태
|
|
||||||
const [sggName, setSggName] = useState<string>(''); // 시군구 이름 상태
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// setCurPage(1);
|
// setCurPage(1);
|
||||||
@@ -116,9 +122,12 @@ const Result = () => {
|
|||||||
let inftwtAnlsSearchDto = {
|
let inftwtAnlsSearchDto = {
|
||||||
"aplcnYmFrom": formValues.aplcnYmFrom && formValues.aplcnYmFrom !== '' ? formValues.aplcnYmFrom : null,
|
"aplcnYmFrom": formValues.aplcnYmFrom && formValues.aplcnYmFrom !== '' ? formValues.aplcnYmFrom : null,
|
||||||
"aplcnYmTo": formValues.aplcnYmTo && formValues.aplcnYmTo !== '' ? formValues.aplcnYmTo : null,
|
"aplcnYmTo": formValues.aplcnYmTo && formValues.aplcnYmTo !== '' ? formValues.aplcnYmTo : null,
|
||||||
"ctpvCd": ctpvCd === 0 ? null : ctpvCd,
|
"enoCd": formValues.enoCd === '0' ? null : formValues.enoCd,
|
||||||
"sggCd": sggCd === 0 ? null : sggCd,
|
"ctpvCd": formValues.ctpvCd === '0' ? null : formValues.ctpvCd,
|
||||||
|
"sggCd": formValues.sggCd?.val === '0' ? null : formValues.sggCd?.val,
|
||||||
"swageTmplntCd": processedSwageTmplntCd,
|
"swageTmplntCd": processedSwageTmplntCd,
|
||||||
|
// "swtrmtZoneCd": formValues.swtrmtZoneCd === '0' ? null : formValues.swtrmtZoneCd,
|
||||||
|
"auth": AUTH,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Search DTO:", inftwtAnlsSearchDto);
|
console.log("Search DTO:", inftwtAnlsSearchDto);
|
||||||
@@ -151,8 +160,7 @@ const Result = () => {
|
|||||||
rowNumber: (curPage - 1) * 10 + index + 1, // 1부터 시작하는 일련번호 추가
|
rowNumber: (curPage - 1) * 10 + index + 1, // 1부터 시작하는 일련번호 추가
|
||||||
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item.scsYn // scsYn이 null이면 'N'으로 변경
|
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item.scsYn // scsYn이 null이면 'N'으로 변경
|
||||||
};
|
};
|
||||||
})
|
});
|
||||||
.filter((item: any) => item.scsYn === 'Y');
|
|
||||||
|
|
||||||
// 선택된 행 초기화
|
// 선택된 행 초기화
|
||||||
setSelectedRowData(null);
|
setSelectedRowData(null);
|
||||||
@@ -279,18 +287,20 @@ const Result = () => {
|
|||||||
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit
|
||||||
graphBtn={true}
|
graphBtn={true}
|
||||||
showDatePicker={true}
|
showDatePicker={true}
|
||||||
ctpvCd={ctpvCd}
|
enoCd={form.watch("enoCd")}
|
||||||
sggCd={sggCd}
|
setEnoCd={(val) => form.setValue("enoCd", val)}
|
||||||
sggName={sggName}
|
ctpvCd={form.watch("ctpvCd")}
|
||||||
|
setCtpvCd={(val) => form.setValue("ctpvCd", val)}
|
||||||
|
sigungu={form.watch("sggCd")}
|
||||||
|
setSigungu={(val) => form.setValue("sggCd", val)}
|
||||||
selectedSwageTreatmentPlant={form.watch("swageTmplntCd")}
|
selectedSwageTreatmentPlant={form.watch("swageTmplntCd")}
|
||||||
onSwageTreatmentPlantChange={(val) => form.setValue("swageTmplntCd", String(val))}
|
onSwageTreatmentPlantChange={(val) => form.setValue("swageTmplntCd", String(val))}
|
||||||
|
selectedSwageProcessingZone={form.watch("swtrmtZoneCd")}
|
||||||
|
onSwageProcessingZoneChange={(val) => form.setValue("swtrmtZoneCd", String(val))}
|
||||||
aplcnYmFrom={form.watch("aplcnYmFrom")}
|
aplcnYmFrom={form.watch("aplcnYmFrom")}
|
||||||
setAplcnYmFrom={(val: string) => { form.setValue("aplcnYmFrom", val) }}
|
setAplcnYmFrom={(val: string) => { form.setValue("aplcnYmFrom", val) }}
|
||||||
aplcnYmTo={form.watch("aplcnYmTo")}
|
aplcnYmTo={form.watch("aplcnYmTo")}
|
||||||
setAplcnYmTo={(val: string) => { form.setValue("aplcnYmTo", val) }}
|
setAplcnYmTo={(val: string) => { form.setValue("aplcnYmTo", val) }}
|
||||||
setCtpvCd={setCtpvCd}
|
|
||||||
setSggCd={setSggCd}
|
|
||||||
setSggName={setSggName}
|
|
||||||
isLoading={isLoadingResult} // 로딩 상태 전달
|
isLoading={isLoadingResult} // 로딩 상태 전달
|
||||||
// Excel 다운로드 핸들러 추가
|
// Excel 다운로드 핸들러 추가
|
||||||
onExcelDownload={handleExcelDownload}
|
onExcelDownload={handleExcelDownload}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useEffect} from 'react';
|
|
||||||
import { usePathname, useRouter } from "next/navigation";
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { BaseLayout } from "@common/components";
|
import { BaseLayout } from "@common/components";
|
||||||
import type { MenuItem } from "@/entities/menu";
|
import type { MenuItem } from "@/entities/menu";
|
||||||
import { useMenuStore } from "@/shared/lib";
|
import { useMenuStore } from "@/shared/lib";
|
||||||
import { PageLayout } from "@/shared/ui/page-layout";
|
import { PageLayout } from "@/shared/ui/page-layout";
|
||||||
import useStore from '../store/useStore';
|
|
||||||
|
|
||||||
export default function WithBaseLayout({
|
export default function WithBaseLayout({
|
||||||
children,
|
children,
|
||||||
@@ -20,15 +18,6 @@ export default function WithBaseLayout({
|
|||||||
|
|
||||||
const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo);
|
const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo);
|
||||||
|
|
||||||
const { fetchCtpvData, fetchSggData, fetchBIZ_SE_CD, fetchBIZ_TY_CD } = useStore();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchCtpvData();
|
|
||||||
fetchSggData();
|
|
||||||
fetchBIZ_SE_CD();
|
|
||||||
fetchBIZ_TY_CD();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleMenuClick = (item: MenuItem) => {
|
const handleMenuClick = (item: MenuItem) => {
|
||||||
setCurrentMenuInfo(item);
|
setCurrentMenuInfo(item);
|
||||||
router.push(item.urlPath);
|
router.push(item.urlPath);
|
||||||
|
|||||||
@@ -160,12 +160,6 @@ const Page = () => {
|
|||||||
className='w-[100px]'
|
className='w-[100px]'
|
||||||
value={usr}
|
value={usr}
|
||||||
onChange={(e) => setUsr(e.target.value)}
|
onChange={(e) => setUsr(e.target.value)}
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
@@ -174,12 +168,6 @@ const Page = () => {
|
|||||||
className='w-[100px]'
|
className='w-[100px]'
|
||||||
value={pjNm}
|
value={pjNm}
|
||||||
onChange={(e) => setpjNm(e.target.value)}
|
onChange={(e) => setpjNm(e.target.value)}
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ const Page = () => {
|
|||||||
atflId: id,
|
atflId: id,
|
||||||
dcrpPplMtncBizNm: fileNm
|
dcrpPplMtncBizNm: fileNm
|
||||||
})
|
})
|
||||||
if (data) {
|
if (data) {
|
||||||
alert('파일이 등록되었습니다.');
|
alert('파일이 등록되었습니다.');
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
handleSearch();
|
handleSearch();
|
||||||
}
|
}
|
||||||
@@ -154,12 +154,6 @@ const Page = () => {
|
|||||||
className='w-[100px] !text-2xl'
|
className='w-[100px] !text-2xl'
|
||||||
value={usr}
|
value={usr}
|
||||||
onChange={(e) => setUsr(e.target.value)}
|
onChange={(e) => setUsr(e.target.value)}
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
@@ -168,12 +162,6 @@ const Page = () => {
|
|||||||
className='w-[100px] !text-2xl'
|
className='w-[100px] !text-2xl'
|
||||||
value={pjNm}
|
value={pjNm}
|
||||||
onChange={(e) => { setpjNm(e.target.value) }}
|
onChange={(e) => { setpjNm(e.target.value) }}
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault(); // Enter 키 기본 동작 방지
|
|
||||||
handleSearch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -87,7 +87,10 @@ export const validateMultipleSelectionsWithAlert = (
|
|||||||
* @returns 검증 결과
|
* @returns 검증 결과
|
||||||
*/
|
*/
|
||||||
export const validateBasicSelections = (
|
export const validateBasicSelections = (
|
||||||
select1: string | number,
|
select1: string,
|
||||||
|
select2: string,
|
||||||
|
select3: ApiSelectOption,
|
||||||
|
select4: string | number,
|
||||||
options: {
|
options: {
|
||||||
requireEnv?: boolean;
|
requireEnv?: boolean;
|
||||||
requireSido?: boolean;
|
requireSido?: boolean;
|
||||||
@@ -105,6 +108,21 @@ export const validateBasicSelections = (
|
|||||||
const validationConfigs: SelectionValidationConfig[] = [
|
const validationConfigs: SelectionValidationConfig[] = [
|
||||||
{
|
{
|
||||||
value: select1,
|
value: select1,
|
||||||
|
description: '환경청',
|
||||||
|
required: requireEnv
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: select2,
|
||||||
|
description: '시도',
|
||||||
|
required: requireSido
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: select3,
|
||||||
|
description: '시군구',
|
||||||
|
required: requireSigungu
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: select4,
|
||||||
description: '하수처리장',
|
description: '하수처리장',
|
||||||
required: requireTreatmentPlant
|
required: requireTreatmentPlant
|
||||||
}
|
}
|
||||||
@@ -115,12 +133,18 @@ export const validateBasicSelections = (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 기본 선택 항목들 검증 및 alert 표시
|
* 기본 선택 항목들 검증 및 alert 표시
|
||||||
* @param select1 하수처리장코드
|
* @param select1 환경청코드
|
||||||
|
* @param select2 시도코드
|
||||||
|
* @param select3 시군구 객체
|
||||||
|
* @param select4 하수처리장코드
|
||||||
* @param options 각 항목의 필수 여부 설정
|
* @param options 각 항목의 필수 여부 설정
|
||||||
* @returns 검증 결과
|
* @returns 검증 결과
|
||||||
*/
|
*/
|
||||||
export const validateBasicSelectionsWithAlert = (
|
export const validateBasicSelectionsWithAlert = (
|
||||||
select1: string | number,
|
select1: string,
|
||||||
|
select2: string,
|
||||||
|
select3: ApiSelectOption,
|
||||||
|
select4: string | number,
|
||||||
options: {
|
options: {
|
||||||
requireEnv?: boolean;
|
requireEnv?: boolean;
|
||||||
requireSido?: boolean;
|
requireSido?: boolean;
|
||||||
@@ -128,7 +152,7 @@ export const validateBasicSelectionsWithAlert = (
|
|||||||
requireTreatmentPlant?: boolean;
|
requireTreatmentPlant?: boolean;
|
||||||
} = {}
|
} = {}
|
||||||
): boolean => {
|
): boolean => {
|
||||||
const result = validateBasicSelections(select1, options);
|
const result = validateBasicSelections(select1, select2, select3, select4, options);
|
||||||
if (!result.isValid && result.errorMessage) {
|
if (!result.isValid && result.errorMessage) {
|
||||||
alert(result.errorMessage);
|
alert(result.errorMessage);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ export const postData = async (url: string, data: object): Promise<any> => {
|
|||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
};
|
};
|
||||||
const res = await fetch(`${BASE_URL}/${url}`, options);
|
const res = await fetch(`${BASE_URL}/${url}`, options);
|
||||||
|
console.log('res', res);
|
||||||
|
console.log('res.status', res.status);
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const resData = await res.json();
|
const resData = await res.json();
|
||||||
return resData;
|
return resData;
|
||||||
@@ -83,7 +85,7 @@ export const deleteData = async (url: string, data?: object): Promise<any> => {
|
|||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
// DC API 호출
|
// RSONE DC API 호출
|
||||||
export const getDcData = async (url: string, data?: object): Promise<any> => {
|
export const getDcData = async (url: string, data?: object): Promise<any> => {
|
||||||
const res = await fetch('/dc-service' + url, {
|
const res = await fetch('/dc-service' + url, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -95,8 +97,9 @@ export const getDcData = async (url: string, data?: object): Promise<any> => {
|
|||||||
throw new Error('Failed to fetch data');
|
throw new Error('Failed to fetch data');
|
||||||
};
|
};
|
||||||
|
|
||||||
// CMS API 호출
|
// RSONE DC API 호출
|
||||||
export const getCmsData = async (url: string, data?: object): Promise<any> => {
|
export const getCmsData = async (url: string, data?: object): Promise<any> => {
|
||||||
|
console.log(url);
|
||||||
const res = await fetch('/cms-service' + url, {
|
const res = await fetch('/cms-service' + url, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
@@ -107,18 +110,6 @@ export const getCmsData = async (url: string, data?: object): Promise<any> => {
|
|||||||
throw new Error('Failed to fetch data');
|
throw new Error('Failed to fetch data');
|
||||||
};
|
};
|
||||||
|
|
||||||
// GeoServer API 호출
|
|
||||||
export const getGeoData = async (url: string, data?: object): Promise<any> => {
|
|
||||||
const res = await fetch('/geoserver' + url, {
|
|
||||||
method: "GET",
|
|
||||||
});
|
|
||||||
if (res.ok) {
|
|
||||||
const data = await res.json();
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
throw new Error('Failed to fetch data');
|
|
||||||
};
|
|
||||||
|
|
||||||
export function getCookie(name: string) {
|
export function getCookie(name: string) {
|
||||||
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
||||||
if (match && match[2]) {
|
if (match && match[2]) {
|
||||||
|
|||||||
@@ -103,10 +103,8 @@ export const formatDateString = (dateStr: string): string => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const year = cleanStr.substring(0, 4);
|
const year = cleanStr.substring(0, 4);
|
||||||
const month = cleanStr.substring(4, 6); // parseInt로 앞의 0 제거
|
const month = parseInt(cleanStr.substring(4, 6)); // parseInt로 앞의 0 제거
|
||||||
// const month = parseInt(cleanStr.substring(4, 6)); // parseInt로 앞의 0 제거
|
const day = parseInt(cleanStr.substring(6, 8)); // parseInt로 앞의 0 제거
|
||||||
// const day = parseInt(cleanStr.substring(6, 8)); // parseInt로 앞의 0 제거
|
|
||||||
const day = cleanStr.substring(6, 8); // parseInt로 앞의 0 제거
|
|
||||||
|
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}년 ${month}월 ${day}일`;
|
||||||
};
|
};
|
||||||
@@ -21,7 +21,7 @@ export const formatDisplayData = (data: { [key: string]: any }): { [key: string]
|
|||||||
if (/^\d{6}$/.test(dateStr)) {
|
if (/^\d{6}$/.test(dateStr)) {
|
||||||
const year = dateStr.substring(0, 4);
|
const year = dateStr.substring(0, 4);
|
||||||
const month = parseInt(dateStr.substring(4, 6));
|
const month = parseInt(dateStr.substring(4, 6));
|
||||||
formattedData[fieldId] = `${year}-${month}`;
|
formattedData[fieldId] = `${year}년 ${month}월`;
|
||||||
} else {
|
} else {
|
||||||
formattedData[fieldId] = String(value);
|
formattedData[fieldId] = String(value);
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ export const formatDisplayData = (data: { [key: string]: any }): { [key: string]
|
|||||||
// yyyy-mm-dd hh:mm:ss 형식 확인
|
// yyyy-mm-dd hh:mm:ss 형식 확인
|
||||||
const dateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/;
|
const dateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/;
|
||||||
const match = dateTimeStr.match(dateTimeRegex);
|
const match = dateTimeStr.match(dateTimeRegex);
|
||||||
|
|
||||||
if (match && match.length >= 6) {
|
if (match && match.length >= 6) {
|
||||||
const year = match[1];
|
const year = match[1];
|
||||||
const month = match[2];
|
const month = match[2];
|
||||||
@@ -42,13 +42,12 @@ export const formatDisplayData = (data: { [key: string]: any }): { [key: string]
|
|||||||
const hour = match[4];
|
const hour = match[4];
|
||||||
const minute = match[5];
|
const minute = match[5];
|
||||||
const second = match[6];
|
const second = match[6];
|
||||||
|
|
||||||
// 🎯 undefined 체크 후 parseInt 적용
|
// 🎯 undefined 체크 후 parseInt 적용
|
||||||
if (year && month && day && hour && minute) {
|
if (year && month && day && hour && minute) {
|
||||||
// const formattedMonth = parseInt(month);
|
const formattedMonth = parseInt(month);
|
||||||
// const formattedDay = parseInt(day);
|
const formattedDay = parseInt(day);
|
||||||
// formattedData[fieldId] = `${year}-${formattedMonth}-${formattedDay} ${hour}:${minute}:${second}`;
|
formattedData[fieldId] = `${year}년 ${formattedMonth}월 ${formattedDay}일 ${hour}시 ${minute}분 ${second}초`;
|
||||||
formattedData[fieldId] = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
||||||
} else {
|
} else {
|
||||||
formattedData[fieldId] = String(value);
|
formattedData[fieldId] = String(value);
|
||||||
}
|
}
|
||||||
@@ -61,7 +60,7 @@ export const formatDisplayData = (data: { [key: string]: any }): { [key: string]
|
|||||||
// 🎯 기존 날짜 포맷팅 (yyyymmdd -> yyyy년 m월 d일)
|
// 🎯 기존 날짜 포맷팅 (yyyymmdd -> yyyy년 m월 d일)
|
||||||
if (dateFields.includes(fieldId)) {
|
if (dateFields.includes(fieldId)) {
|
||||||
const dateStr = String(value).trim();
|
const dateStr = String(value).trim();
|
||||||
|
|
||||||
// 숫자 타입이거나 숫자로만 구성된 문자열인지 확인
|
// 숫자 타입이거나 숫자로만 구성된 문자열인지 확인
|
||||||
if (/^\d+$/.test(dateStr)) {
|
if (/^\d+$/.test(dateStr)) {
|
||||||
formattedData[fieldId] = formatDateString(dateStr);
|
formattedData[fieldId] = formatDateString(dateStr);
|
||||||
@@ -75,12 +74,7 @@ export const formatDisplayData = (data: { [key: string]: any }): { [key: string]
|
|||||||
if (numberFields.includes(fieldId)) {
|
if (numberFields.includes(fieldId)) {
|
||||||
const numValue = Number(value);
|
const numValue = Number(value);
|
||||||
if (!isNaN(numValue) && isFinite(numValue)) {
|
if (!isNaN(numValue) && isFinite(numValue)) {
|
||||||
// 소수점이 있는 경우 4자리까지 표시
|
formattedData[fieldId] = numValue.toLocaleString('ko-KR');
|
||||||
if (!Number.isInteger(numValue)) {
|
|
||||||
formattedData[fieldId] = numValue.toLocaleString('ko-KR', { maximumFractionDigits: 4 });
|
|
||||||
} else {
|
|
||||||
formattedData[fieldId] = numValue.toLocaleString('ko-KR');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
formattedData[fieldId] = String(value);
|
formattedData[fieldId] = String(value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +1,159 @@
|
|||||||
import React, { useState, useMemo, useEffect } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { SelectBox } from '@common/business_components/ui'
|
import { SelectBox } from '@common/business_components/ui'
|
||||||
import { Label } from '@common/components';
|
|
||||||
import useStore from '../../store/useStore';
|
|
||||||
|
|
||||||
|
interface Option {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface SidoSigunguSelectBoxProps {
|
interface SidoSigunguSelectBoxProps {
|
||||||
sido: number;
|
sido: number;
|
||||||
sigungu: number;
|
sigungu: number;
|
||||||
onSidoChange: (id: number) => void;
|
onSidoChange: (id: number) => void;
|
||||||
setCtpvName?: (name: string) => void;
|
|
||||||
onSigunguChange: (id: number) => void;
|
onSigunguChange: (id: number) => void;
|
||||||
setSggName?: (name: string) => void;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sidoList: { id: number, name: string }[] = [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 26, name: '부산광역시' },
|
||||||
|
{ id: 28, name: '인천광역시' },
|
||||||
|
{ id: 30, name: '대전광역시' },
|
||||||
|
{ id: 41, name: '경기도' },
|
||||||
|
{ id: 42, name: '강원도' },
|
||||||
|
{ id: 44, name: '충청남도' },
|
||||||
|
{ id: 45, name: '전라북도' },
|
||||||
|
{ id: 46, name: '전라남도' },
|
||||||
|
{ id: 47, name: '경상북도' },
|
||||||
|
{ id: 48, name: '경상남도' },
|
||||||
|
];
|
||||||
|
const sigunguMap: Record<number, { id: number; name: string }[]> = {
|
||||||
|
26: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
// ...부산산광역시의 시군구 추가
|
||||||
|
],
|
||||||
|
28: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
// ...인천광역시의 시군구 추가
|
||||||
|
],
|
||||||
|
30: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
// ...대전광역시의 시군구 추가
|
||||||
|
],
|
||||||
|
41: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 41820, name: '가평군' },
|
||||||
|
{ id: 41550, name: '안성시' },
|
||||||
|
{ id: 41830, name: '양평군' },
|
||||||
|
{ id: 41670, name: '여주시' },
|
||||||
|
{ id: 41500, name: '이천시' },
|
||||||
|
{ id: 41430, name: '의왕시' },
|
||||||
|
{ id: 41150, name: '의정부시' },
|
||||||
|
{ id: 41480, name: '파주시' },
|
||||||
|
{ id: 41650, name: '포천시' },
|
||||||
|
// ...경기도의 시군구 추가
|
||||||
|
],
|
||||||
|
42: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 42170, name: '동해시' },
|
||||||
|
{ id: 42110, name: '춘천시' },
|
||||||
|
{ id: 42720, name: '홍천군' },
|
||||||
|
// ...강원도의 시군구 추가
|
||||||
|
],
|
||||||
|
44: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 44770, name: '서천군' },
|
||||||
|
// ...충청남도의 시군구 추가
|
||||||
|
],
|
||||||
|
45: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 45130, name: '군산시' },
|
||||||
|
{ id: 45190, name: '남원시' },
|
||||||
|
{ id: 45730, name: '무주군' },
|
||||||
|
{ id: 45800, name: '부안군' },
|
||||||
|
{ id: 45770, name: '순창군' },
|
||||||
|
{ id: 45140, name: '익산시' },
|
||||||
|
{ id: 45750, name: '임실군' },
|
||||||
|
{ id: 45710, name: '완주군' },
|
||||||
|
{ id: 45110, name: '전주시' },
|
||||||
|
// ...전라북도의 시군구 추가
|
||||||
|
],
|
||||||
|
46: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 46810, name: "강진군" },
|
||||||
|
{ id: 46770, name: "고흥군" },
|
||||||
|
{ id: 46720, name: "곡성군" },
|
||||||
|
{ id: 46730, name: "구례군" },
|
||||||
|
{ id: 46230, name: "광양시" },
|
||||||
|
{ id: 46170, name: "나주시" },
|
||||||
|
{ id: 46110, name: "목포시" },
|
||||||
|
{ id: 46840, name: "무안군" },
|
||||||
|
{ id: 46150, name: "순천시" },
|
||||||
|
{ id: 46910, name: "신안군" },
|
||||||
|
{ id: 46130, name: "여수시" },
|
||||||
|
{ id: 46890, name: "완도군" },
|
||||||
|
// ...전라남도의 시군구 추가
|
||||||
|
],
|
||||||
|
47: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 47130, name: "경주시" },
|
||||||
|
{ id: 47830, name: "고령군" },
|
||||||
|
{ id: 47190, name: "구미시" },
|
||||||
|
{ id: 47720, name: "군위군" },
|
||||||
|
{ id: 47150, name: "김천시" },
|
||||||
|
{ id: 47280, name: "문경시" },
|
||||||
|
{ id: 47920, name: "봉화군" },
|
||||||
|
{ id: 47250, name: "상주시" },
|
||||||
|
{ id: 47770, name: "영덕군" },
|
||||||
|
{ id: 47760, name: "영양군" },
|
||||||
|
{ id: 47210, name: "영주시" },
|
||||||
|
{ id: 47900, name: "예천군" },
|
||||||
|
{ id: 47930, name: "울진군" },
|
||||||
|
{ id: 47730, name: "의성군" },
|
||||||
|
{ id: 47750, name: "청송군" },
|
||||||
|
{ id: 47850, name: "칠곡군" },
|
||||||
|
{ id: 47110, name: "포항시" },
|
||||||
|
// ...경상북도의 시군구 추가
|
||||||
|
],
|
||||||
|
48: [
|
||||||
|
{ id: 0, name: '전체' },
|
||||||
|
{ id: 48310, name: "거제시" },
|
||||||
|
{ id: 48250, name: "김해시" },
|
||||||
|
{ id: 48270, name: "밀양시" },
|
||||||
|
{ id: 48220, name: "통영시" },
|
||||||
|
// ...경상남도의 시군구 추가
|
||||||
|
],
|
||||||
|
// ...나머지 시도별 시군구 추가
|
||||||
|
};
|
||||||
|
|
||||||
export function SidoSigunguSelectBox({
|
export function SidoSigunguSelectBox({
|
||||||
sido,
|
sido,
|
||||||
sigungu,
|
sigungu,
|
||||||
onSidoChange,
|
onSidoChange,
|
||||||
setCtpvName,
|
|
||||||
onSigunguChange,
|
onSigunguChange,
|
||||||
setSggName,
|
|
||||||
className = "",
|
className = "",
|
||||||
}: SidoSigunguSelectBoxProps) {
|
}: SidoSigunguSelectBoxProps) {
|
||||||
|
// 선택된 시도에 따라 시군구 리스트를 가져옴
|
||||||
const { ctpv, sgg} = useStore();
|
const sigunguList = useMemo(() => sigunguMap[sido] || [{ id: 0, name: '전체' }], [sido]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
(async () => {
|
|
||||||
onSidoChange(0);
|
|
||||||
onSigunguChange(0);
|
|
||||||
if (setCtpvName && setSggName) {
|
|
||||||
setCtpvName("");
|
|
||||||
setSggName("");
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center justify-center ${className} mr-8`}>
|
<div className={`flex items-center justify-center ${className} mr-8`}>
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">시도</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-60 mr-8"
|
className="w-[150px] mr-8"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg bg-white"
|
||||||
label=""
|
label="시도"
|
||||||
selectArray={
|
selectArray={sidoList.map(opt => ({ val: opt.id, text: opt.name }))}
|
||||||
[{ val: 0, text: '전체' },
|
|
||||||
...ctpv.map(opt => ({ val: opt.id, text: opt.name }))
|
|
||||||
]
|
|
||||||
}
|
|
||||||
value={sido}
|
value={sido}
|
||||||
onSelectValue={val => {
|
onSelectValue={val => onSidoChange(Number(val))}
|
||||||
onSidoChange(Number(val));
|
|
||||||
if (setCtpvName) setCtpvName(ctpv.find(opt => Number(opt.id) === Number(val))?.name || "");
|
|
||||||
}}
|
|
||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
<Label className="text-xl text-gray-600 font-medium whitespace-nowrap mr-2">시군구</Label>
|
|
||||||
<SelectBox
|
<SelectBox
|
||||||
className="w-48"
|
className="w-48"
|
||||||
selectClass="w-48 rounded-lg bg-white truncate"
|
selectClass="w-48 rounded-lg bg-white truncate"
|
||||||
label=""
|
label="시군구"
|
||||||
selectArray={
|
selectArray={sigunguList.map(opt => ({ val: opt.id, text: opt.name }))}
|
||||||
[{ val: 0, text: '전체' },
|
|
||||||
...sgg
|
|
||||||
.filter(opt => String(opt.id).slice(0, 2) === String(sido))
|
|
||||||
.map(opt => ({ val: opt.id, text: opt.name }))
|
|
||||||
]
|
|
||||||
}
|
|
||||||
value={sigungu}
|
value={sigungu}
|
||||||
onSelectValue={val => {
|
onSelectValue={val => onSigunguChange(Number(val))}
|
||||||
onSigunguChange(Number(val))
|
|
||||||
if (setSggName) setSggName(sgg.find(opt => Number(opt.id) === Number(val))?.name || "");
|
|
||||||
}}
|
|
||||||
selectContentClass="z-[101]"
|
selectContentClass="z-[101]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user