Merge remote-tracking branch 'origin/iipbs/fo/dev'
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { BaseLayout } from "@common/components";
|
||||
import type { MenuItem } from "./store/common";
|
||||
import { useFoStore } from "./store";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
|
||||
export default function Base({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const { getMenuAuth } = useFoStore((state) => state);
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
|
||||
const handleClick = (id: MenuItem) => {
|
||||
getMenuAuth(id.menuCd);
|
||||
router.push(id.urlPath);
|
||||
};
|
||||
|
||||
return (
|
||||
<BaseLayout currentPath={pathname ?? ""} handleMenuClick={handleClick}>
|
||||
{children}
|
||||
</BaseLayout>
|
||||
);
|
||||
}
|
||||
+12
-27
@@ -1,29 +1,14 @@
|
||||
"use client"
|
||||
import "./globals.css";
|
||||
import { StoreProvider } from "./store";
|
||||
import { LoginApi } from "@/src/entities/auth";
|
||||
import { useEffect } from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { App } from "@/src/app";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
export const metadata: Metadata = {
|
||||
title: "디지털 하수관로",
|
||||
description: "디지털 하수관로 시스템입니다",
|
||||
keywords: ["하수관로"],
|
||||
openGraph: {
|
||||
title: "디지털 하수관로",
|
||||
description: "디지털 하수관로 시스템입니다"
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치
|
||||
void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" })
|
||||
.catch((e) => {
|
||||
console.error("Auto login failed:", e);
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<StoreProvider>
|
||||
{children}
|
||||
</StoreProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
export default App;
|
||||
|
||||
+25
-41
@@ -1,44 +1,28 @@
|
||||
"use client"
|
||||
"use client";
|
||||
import { LoginApi } from "@/src/entities/auth";
|
||||
import { useEffect } from "react";
|
||||
import { AUTH_USER_ID } from "@/src/shared/config";
|
||||
import { getCookie } from "@/src/shared/lib/cookie";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Button } from "@common/components/ui";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="grid grid-cols-12 gap-2">
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/processFacility"}><Button>처리시설 시설정보</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/flowRate"}><Button>시설별 유량현황</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/dashboard"}><Button>대시보드</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/processArea"}><Button>처리구역정보</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/facilityPrecipitation"}><Button>시설별 강수현황</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/facilityWaterQlty"}><Button>시설별 수질현황</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/planSewage"}><Button>계획하수량 산정지표 현황</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/sewageOccur"}><Button>오수발생량 추정</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/underWaterInput"}><Button>지하수 유입량 추정</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/rdi"}><Button>RDII 조회</Button></Link>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Link href={"./pages/map"}><Button>지도보기</Button></Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const router = useRouter();
|
||||
const checkToken = getCookie(AUTH_USER_ID);
|
||||
|
||||
useEffect(() => {
|
||||
if (!checkToken) {
|
||||
async function doLogin() {
|
||||
try {
|
||||
await LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" });
|
||||
router.push("/pages/dashboard");
|
||||
} catch (err) {
|
||||
console.error("로그인 실패", err);
|
||||
}
|
||||
}
|
||||
doLogin();
|
||||
} else {
|
||||
router.push("/pages/dashboard");
|
||||
}
|
||||
}, []);
|
||||
}
|
||||
@@ -1,13 +1,30 @@
|
||||
"use client"
|
||||
|
||||
import Base from "@/app/base";
|
||||
import { BaseLayout } from "@common/components";
|
||||
import type { MenuItem } from "@/app/store/common";
|
||||
import { useFoStore } from "@/app/store";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const { getMenuAuth } = useFoStore((state) => state);
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
|
||||
const handleClick = (id: MenuItem) => {
|
||||
getMenuAuth(id.menuCd);
|
||||
router.push(id.urlPath);
|
||||
};
|
||||
|
||||
return (
|
||||
<Base>{children}</Base>
|
||||
<BaseLayout
|
||||
currentPath={pathname ?? ""}
|
||||
handleMenuClick={handleClick}
|
||||
>
|
||||
{children}
|
||||
</BaseLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,13 +210,13 @@ export default function ProcessFacilitySearch() {
|
||||
const cellClick = (index: number) => {
|
||||
const facility = processFacilityList[index];
|
||||
if (facility) {
|
||||
const fctCpc = String(facility.fctCpc).replace(/,/g, "").trim();
|
||||
const fctCpc = Number(String(facility.fctCpc).replace(/,/g, "").trim());
|
||||
setModalFcltyNm(facility.bscFctNm);
|
||||
setModalFcltyCd(facility.bscFctCd);
|
||||
setModalSido(facility.sido);
|
||||
setModalGugun(facility.gugun);
|
||||
setModalAddr(facility.daddr);
|
||||
setModalFctCpc(Number(fctCpc));
|
||||
setModalFctCpc(fctCpc);
|
||||
setModalTrtFrfNm(facility.trtFrfNm);
|
||||
setModalRnDt(facility.rnDt);
|
||||
setModalCmplDt(facility.cmplDt);
|
||||
|
||||
Reference in New Issue
Block a user