Compare commits

..
2 Commits
Author SHA1 Message Date
changwng e88cf0c6d0 Initial commit 2025-03-26 09:59:55 +09:00
changwng 882ed8d9eb 최초 커밋 2025-03-22 13:01:39 +09:00
127 changed files with 2095 additions and 9650 deletions
+1 -2
View File
@@ -14,8 +14,7 @@ dist
# misc
.DS_Store
apps/wr/.next/**/*
apps/fo/.next/**/*
# env
.env*
.qodo
+1 -3
View File
@@ -149,9 +149,7 @@ export default nextConfig;
### 6. globals.css(또는 전역 css) 수정
```css
@import "@common/assets/styles/base.css";
@import "@common/assets/styles/diveicon.css";
@import "@common/assets/styles/components.css";
@import "@common/assets/index.css";
@tailwind base;
@tailwind components;
@@ -1,2 +0,0 @@
import { MenuPage } from "@/pages/menu";
export default MenuPage;
+1
View File
@@ -0,0 +1 @@
NODE_OPTIONS='--inspect' npx next dev
-5
View File
@@ -11,11 +11,6 @@ const compat = new FlatCompat({
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
rules: {
"react-hooks/exhaustive-deps": "off",
},
},
];
export default eslintConfig;
+1 -3
View File
@@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "NODE_OPTIONS='--inspect' next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
@@ -13,7 +13,6 @@
"@common/components": "workspace:*",
"@frontend-opensource/use-react-hooks": "^1.1.4",
"@hookform/resolvers": "^4.1.3",
"@minoru/react-dnd-treeview": "^3.5.0",
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-slot": "^1.1.2",
"@tanstack/react-query": "^5.67.1",
@@ -24,7 +23,6 @@
"js-cookie": "^3.0.5",
"next": "15.1.7",
"react-chartjs-2": "^5.3.0",
"react-dnd": "^16.0.1",
"react-hook-form": "^7.54.2",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.24.2",
+19 -81
View File
@@ -1,87 +1,25 @@
.card {
position: relative;
margin: 0.6rem;
box-sizing: border-box;
min-height: 2rem;
border-radius: 0.5rem;
padding: 0.6rem;
font-size: 1.3rem;
color: #666;
}
@tailwind components;
.card_width10 {width:calc(10% - 12px);}
.card_width20 {width:calc(20% - 12px);}
.card_width25 {width:calc(25% - 12px);}
.card_width30 {width:calc(30% - 12px);}
.card_width33 {width:calc(33.333% - 12px);}
.card_width40 {width:calc(40% - 12px);}
.card_width45 {width:calc(45% - 12px);}
.card_width50 {width:calc(50% - 12px);}
.card_width60 {width:calc(60% - 12px);}
.card_width66 {width:calc(66.666% - 12px);}
.card_width70 {width:calc(70% - 12px);}
.card_width75 {width:calc(75% - 12px);}
.card_width80 {width:calc(80% - 12px);}
.card_width90 {width:calc(90% - 12px);}
.card_width100 {width:calc(100% - 12px);}
.card_nopadding {padding:0 !important;}
.card_nomargin {width:100%;margin:0 !important;padding:0 !important;}
.topline {border-top: 1px solid #ccc;}
.bottomline {border-bottom: 1px solid #e6eef3;background: #fff;}
.card-border {
border: 1px solid #dbe2e6;
background-color: rgba(255, 255, 255, 0.6);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.card-header {
margin-left: -0.6rem;
margin-right: -0.6rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e1e7eb;
padding: 1rem;
}
.card-footer {
margin-left: -0.6rem;
margin-right: -0.6rem;
margin-top: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border-top: 1px solid #e1e7eb;
padding-top: 1rem;
padding-bottom: 1rem;
}
/* 블랙 테마 */
[data-theme="black"] {
@layer components {
.card {
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
}
.card-border {
border-color: #3f4042;
background-color: rgba(255, 255, 255, 0.065);
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
}
.card-header {
border-bottom-color: #3f4042;
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
}
.card-footer {
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
}
[data-theme="black"] {
.card-border {
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
}
.card-header {
@apply border-b-[#3f4042];
}
}
}
+4 -1
View File
@@ -11,7 +11,10 @@ import { CodeApi } from "../api/code-service";
type CodeSelectProps = {
upCd: string;
} & React.ComponentPropsWithoutRef<typeof Select>;
value?: string;
defaultValue?: string;
onValueChange?: (value: string) => void;
};
function CodeSelect({ upCd, defaultValue, ...props }: CodeSelectProps) {
const { data: code } = useQuery({
-7
View File
@@ -1,7 +0,0 @@
export { SiteApi } from "./api/site-service";
export {
siteFormSchema,
type ISiteParams,
type ISite,
type SiteFormData,
} from "./model/site-interface";
@@ -14,7 +14,7 @@ function LoginPage() {
const formData = new FormData(e.target as HTMLFormElement);
const userId = formData.get("id") as string;
const password = formData.get("password") as string;
console.log(userId, password);
await LoginApi.login({ userId, password });
router.push("/site");
};
@@ -1,29 +0,0 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type { Menu, MenuService, TreeMenu } from "../model/menu-interface";
export class MenuApiService implements MenuService {
public async getTreeMenuList(siteId: string): Promise<Menu[]> {
const response = await client.get<Menu[]>(
`${ENDPOINT.CMS_SERVICE.MENUS}/${siteId}/tree`,
);
return response.data;
}
public async modifyTreeMenu(siteId: string, data: TreeMenu[]): Promise<void> {
const response = await client.put<void>(
`${ENDPOINT.CMS_SERVICE.MENUS}/${siteId}/tree`,
data,
);
return response.data;
}
public async modifyMenuName(menuCd: number, name: string): Promise<void> {
const response = await client.put<void>(
`${ENDPOINT.CMS_SERVICE.MENUS}/${menuCd}/${name}`,
);
return response.data;
}
}
export const MenuApi = new MenuApiService();
-1
View File
@@ -1 +0,0 @@
export { MenuPage } from "./ui/menu-page";
-98
View File
@@ -1,98 +0,0 @@
import type { DropOptions, NodeModel } from "@minoru/react-dnd-treeview";
import type { Menu, TreeMenu } from "../model/menu-interface";
export const generateTreeData = (data: Menu[]): NodeModel<Menu>[] => {
return data.reduce<NodeModel<Menu>[]>((acc, menu) => {
const node: NodeModel<Menu> = {
id: menu.menuCd ?? 0,
parent: menu.parentId ?? 0,
text: menu.menuKornNm,
droppable: true,
data: menu,
};
acc.push(node);
if (menu.children?.length) {
acc.push(...generateTreeData(menu.children));
}
return acc;
}, []);
};
export const generateNewTreeData = (
treeData: NodeModel<Menu>[],
options: DropOptions<Menu>,
): TreeMenu | null => {
const { dragSourceId, dragSource, dropTargetId, dropTarget } = options;
if (!dragSource?.data) return null;
const siblings = treeData.filter((node) => node.parent === dropTargetId);
const newSortSeq =
siblings.findIndex((sibling) => sibling.id === dragSourceId) + 1;
const childNodes = treeData.filter(
(node) => node.parent === dragSourceId && node.data,
);
const baseNode = (node: NodeModel<Menu>): TreeMenu => {
if (!node.data) return {};
return {
menuCd: node.data?.menuCd,
name: node.data?.menuKornNm,
icon: node.data?.iconNm,
};
};
const treeMenu: TreeMenu = {
...baseNode(dragSource),
parentId: dropTargetId === 0 ? null : (dropTargetId as number),
sortSeq: newSortSeq,
levelNo: (dropTarget?.data?.levelNo ?? 0) + 1,
};
const result: TreeMenu = {
...treeMenu,
children: childNodes.map((child) => ({
...baseNode(child),
parentId: child.data?.parentId === 0 ? null : (dropTargetId as number),
sortSeq: child.data?.sortSeq,
levelNo: (treeMenu?.levelNo ?? 0) + 1,
})),
};
return result;
};
export const handleSelectNode =
(callback: (node: NodeModel<Menu>) => void) => (node: NodeModel<Menu>) => {
callback(node);
};
export const handleDropNode =
(callback: (newTree: TreeMenu) => void) =>
(newTree: NodeModel<Menu>[], options: DropOptions<Menu>) => {
const newTreeData = generateNewTreeData(newTree, options);
if (!newTreeData) return;
callback(newTreeData);
};
export const handleNodeTextChange =
(treeData: NodeModel<Menu>[]) =>
(callback: (newTree: NodeModel<Menu>[]) => void) =>
(id: NodeModel["id"], value: string) => {
const newTree = treeData.map((node) => {
if (node.id === id) {
return {
...node,
text: value,
};
}
return node;
});
callback(newTree);
};
@@ -1,70 +0,0 @@
import { z } from "zod";
export const MENU_TYPE = {
EMPTY: "EMPTY",
CONTENTS: "CONTENTS",
BOARD: "BOARD",
INSIDE: "INSIDE",
OUTSIDE: "OUTSIDE",
BOTTOM: "BOTTOM",
} as const;
export type MenuType = (typeof MENU_TYPE)[keyof typeof MENU_TYPE];
export interface TreeMenu {
menuCd?: number;
name?: string;
sortSeq?: number;
parentId?: number | null;
levelNo?: number;
icon?: string;
children?: TreeMenu[];
}
export interface Menu extends Omit<TreeMenu, "name" | "icon" | "children"> {
menuKornNm: string;
menuEngNm: string;
iconNm: string;
children: Menu[];
urlPath: string;
menuLnkgTypeCd: string;
menuLnkgSn: number;
qrcd: string;
useYn: string;
otptYn: string;
requiredUrlPath: boolean;
}
export const menuFormSchema = z.object({
siteId: z.string(),
menuKornNm: z.string(),
menuSubKornNm: z.string().nullish(),
menuEngNm: z.string().nullish(),
menuSubEngNm: z.string().nullish(),
levelNo: z.number(),
urlPath: z.string().nullish(),
iconNm: z.string().nullish(),
menuLnkgTypeCd: z.enum([
MENU_TYPE.EMPTY,
MENU_TYPE.CONTENTS,
MENU_TYPE.BOARD,
MENU_TYPE.INSIDE,
MENU_TYPE.OUTSIDE,
MENU_TYPE.BOTTOM,
]),
menuLnkgSn: z.number().nullish(),
otptYn: z.enum(["Y", "N"]).default("Y").nullish(),
prntMenuCd: z.number().nullish(),
sortSeq: z.number(),
evlUseYn: z.enum(["Y", "N"]).nullish(),
qrcd: z.string().nullish(),
useYn: z.enum(["Y", "N"]).default("Y").nullish(),
});
export type MenuFormData = z.infer<typeof menuFormSchema>;
export interface MenuService {
getTreeMenuList: (siteId: string) => Promise<Menu[]>;
modifyTreeMenu: (siteId: string, data: TreeMenu[]) => Promise<void>;
modifyMenuName: (menuCd: number, name: string) => Promise<void>;
}
@@ -1,130 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import {
IconFinder,
Input,
Label,
RadioGroup,
RadioGroupItem,
TableCell,
TableHead,
TableRow,
} from "@common/components";
import {
FormItem,
FormControl,
FormField,
FormMessage,
} from "@/shared/ui/form";
import type { MenuFormData } from "../model/menu-interface";
export function BaseBottomMenuForm({
form,
}: {
form: UseFormReturn<MenuFormData>;
}) {
const handleIconClick = (icon: string) => {
form.setValue("iconNm", icon);
};
return (
<>
<TableRow>
<TableHead>메뉴 서브명</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="menuSubKornNm"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
value={field.value ?? ""}
className="!text-[1.3rem]"
placeholder="메뉴 서브명을 입력하십시오."
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴 아이콘</TableHead>
<TableCell className="border">
<div className="flex gap-2">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("iconNm")}
</div>
<IconFinder handleClick={handleIconClick} />
</div>
</TableCell>
</TableRow>
<TableRow>
<TableHead>출력 여부</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="otptYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
{...field}
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="otptY" />
<Label htmlFor="otptY">출력</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="otptN" />
<Label htmlFor="otptN">출력안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>사용 여부</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="useYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
{...field}
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="useY" />
<Label htmlFor="useY">사용</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="useN" />
<Label htmlFor="useN">사용안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
</>
);
}
@@ -1,130 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import {
Input,
Label,
RadioGroup,
RadioGroupItem,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
} from "@common/components";
import {
FormItem,
FormControl,
FormField,
FormMessage,
} from "@/shared/ui/form";
import { MENU_TYPE, type MenuFormData } from "../model/menu-interface";
interface BaseMenuFormProps {
form: UseFormReturn<MenuFormData>;
menuId?: number;
}
export function BaseMenuForm({ form, menuId }: BaseMenuFormProps) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<TableRow>
<TableHead>메뉴ID</TableHead>
<TableCell className="border">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{menuId}
</div>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴명</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="menuKornNm"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
className="!text-[1.3rem]"
placeholder="메뉴명을 입력하십시오."
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴 영문명</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="menuEngNm"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
value={field.value ?? ""}
className="!text-[1.3rem]"
placeholder="메뉴 영문명을 입력하십시오."
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴 유형</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="menuLnkgTypeCd"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
{Object.entries(MENU_TYPE).map(([key, value]) => (
<div
key={key}
className="flex items-center space-x-2"
>
<RadioGroupItem
value={value}
id={`menuType${key}`}
/>
<Label htmlFor={`menuType${key}`}>
{key === "EMPTY" && "빈메뉴"}
{key === "CONTENTS" && "콘텐츠"}
{key === "BOARD" && "게시판"}
{key === "INSIDE" && "내부링크"}
{key === "OUTSIDE" && "외부링크"}
{key === "BOTTOM" && "하단메뉴"}
</Label>
</div>
))}
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
</TableBody>
</Table>
);
}
@@ -1,144 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import {
Label,
RadioGroup,
RadioGroupItem,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
} from "@common/components";
import {
FormItem,
FormControl,
FormField,
FormMessage,
} from "@/shared/ui/form";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function BoardMenuForm({ form }: { form: UseFormReturn<MenuFormData> }) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<TableRow>
<TableHead>게시판</TableHead>
<TableCell className="border">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("menuLnkgSn")}
</div>
</TableCell>
</TableRow>
<TableRow>
<TableHead>연결 형태</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="evlUseYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="self" id="self" />
<Label htmlFor="self">현재창</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="blank" id="blank" />
<Label htmlFor="blank">새창</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴 평가 사용 여부</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="evlUseYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="evlUseY" />
<Label htmlFor="evlUseY">사용</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="evlUseN" />
<Label htmlFor="evlUseN">사용안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<BaseBottomMenuForm form={form} />
<TableRow>
<TableHead>QR코드</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="qrcd"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="qrcdY" />
<Label htmlFor="qrcdY">사용</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="qrcdN" />
<Label htmlFor="qrcdN">사용안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>담당자</TableHead>
<TableCell className="border">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("menuLnkgSn")}
</div>
</TableCell>
</TableRow>
</TableBody>
</Table>
);
}
@@ -1,22 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import { Table, TableBody } from "@common/components";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function BottomMenuForm({
form,
}: {
form: UseFormReturn<MenuFormData>;
}) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<BaseBottomMenuForm form={form} />
</TableBody>
</Table>
);
}
@@ -1,148 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import {
Label,
RadioGroup,
RadioGroupItem,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
} from "@common/components";
import {
FormItem,
FormControl,
FormField,
FormMessage,
} from "@/shared/ui/form";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function ContentMenuForm({
form,
}: {
form: UseFormReturn<MenuFormData>;
}) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<TableRow>
<TableHead>콘텐츠</TableHead>
<TableCell className="border">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("menuLnkgSn")}
</div>
</TableCell>
</TableRow>
<TableRow>
<TableHead>연결 형태</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="evlUseYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="self" id="self" />
<Label htmlFor="self">현재창</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="blank" id="blank" />
<Label htmlFor="blank">새창</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>메뉴 평가 사용 여부</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="evlUseYn"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="evlUseY" />
<Label htmlFor="evlUseY">사용</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="evlUseN" />
<Label htmlFor="evlUseN">사용안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<BaseBottomMenuForm form={form} />
<TableRow>
<TableHead>QR코드</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="qrcd"
render={({ field }) => (
<FormItem>
<FormControl>
<RadioGroup
value={field.value ?? ""}
onValueChange={field.onChange}
>
<div className="flex items-center space-x-4">
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="qrcdY" />
<Label htmlFor="qrcdY">사용</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="N" id="qrcdN" />
<Label htmlFor="qrcdN">사용안함</Label>
</div>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead>담당자</TableHead>
<TableCell className="border">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("menuLnkgSn")}
</div>
</TableCell>
</TableRow>
</TableBody>
</Table>
);
}
@@ -1,18 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import { Table, TableBody } from "@common/components";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function EmptyMenuForm({ form }: { form: UseFormReturn<MenuFormData> }) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<BaseBottomMenuForm form={form} />
</TableBody>
</Table>
);
}
@@ -1,22 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import { Table, TableBody } from "@common/components";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function InsideMenuForm({
form,
}: {
form: UseFormReturn<MenuFormData>;
}) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<BaseBottomMenuForm form={form} />
</TableBody>
</Table>
);
}
-111
View File
@@ -1,111 +0,0 @@
import { useState } from "react";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { type UseFormReturn } from "react-hook-form";
import { Button } from "@common/components";
import { Form } from "@/shared/ui/form";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { MENU_TYPE, type MenuFormData } from "../model/menu-interface";
import { BaseMenuForm } from "./base-menu-form";
import { EmptyMenuForm } from "./empty-menu-form";
import { ContentMenuForm } from "./content-menu-form";
import { BoardMenuForm } from "./board-menu-form";
import { InsideMenuForm } from "./inside-menu-form";
import { OutsideMenuForm } from "./outside-menu-form";
import { BottomMenuForm } from "./bottom-menu-form";
interface MenuFormProps {
form: UseFormReturn<MenuFormData>;
menuId?: number;
handleSave: (data: MenuFormData) => Promise<void>;
handleDelete?: () => Promise<void>;
}
export function MenuForm({
form,
menuId,
handleSave,
handleDelete,
}: MenuFormProps) {
const isModifyMode = !!menuId;
const { confirm } = useConfirm();
const [onConfirm, setOnConfirm] = useState(false);
const onSubmit = async (data: MenuFormData) => {
const confirmMessage = isModifyMode
? "수정하시겠습니까?"
: "저장하시겠습니까?";
setOnConfirm(true);
if (await confirm(confirmMessage)) {
setOnConfirm(false);
handleSave(data);
}
setOnConfirm(false);
};
const onDelete = async () => {
setOnConfirm(true);
if (await confirm("삭제하시겠습니까?")) {
setOnConfirm(false);
handleDelete?.();
}
setOnConfirm(false);
};
const menuType = form.watch("menuLnkgTypeCd");
return (
<>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<div className="card card-border">
<div className="card-header">
<h3 className="text-2xl font-medium text-label">
메뉴 등록/수정
</h3>
</div>
<div className="card">
<BaseMenuForm form={form} menuId={menuId} />
<div className="-mt-[0.1rem]">
{renderMenuTypeComponent(menuType, form)}
</div>
</div>
</div>
<div className="flex justify-center gap-4 pb-12 pt-10">
<Button size="lg" type="submit">
저장
</Button>
{isModifyMode && (
<Button size="lg" color="red" type="button" onClick={onDelete}>
삭제
</Button>
)}
</div>
</form>
</Form>
<ConfirmDialog open={onConfirm} />
</>
);
}
function renderMenuTypeComponent(
menuType: string,
form: UseFormReturn<MenuFormData>,
) {
switch (menuType) {
case MENU_TYPE.EMPTY:
return <EmptyMenuForm form={form} />;
case MENU_TYPE.CONTENTS:
return <ContentMenuForm form={form} />;
case MENU_TYPE.BOARD:
return <BoardMenuForm form={form} />;
case MENU_TYPE.INSIDE:
return <InsideMenuForm form={form} />;
case MENU_TYPE.OUTSIDE:
return <OutsideMenuForm form={form} />;
case MENU_TYPE.BOTTOM:
return <BottomMenuForm form={form} />;
default:
return null;
}
}
-116
View File
@@ -1,116 +0,0 @@
import { useState } from "react";
import { useMutation } from "@tanstack/react-query";
import type { NodeModel } from "@minoru/react-dnd-treeview";
import { cn } from "@common/components/lib";
import { Button, Input } from "@common/components/ui";
import type { Menu } from "../model/menu-interface";
import { MenuApi } from "../api/menu-service";
type MenuNodeProps = {
node: NodeModel<Menu>;
depth: number;
isOpen: boolean;
isSelected: boolean;
onToggle: (id: NodeModel["id"]) => void;
onSelect: (node: NodeModel<Menu>) => void;
};
function MenuNode({
node,
depth,
isOpen,
isSelected,
onToggle,
onSelect,
}: MenuNodeProps) {
const { id, text, data } = node;
const indent = depth * 10 + 5;
const { mutateAsync: modifyMenuName } = useMutation({
mutationFn: (nodeName: string) => {
const encodedName = encodeURIComponent(nodeName);
return MenuApi.modifyMenuName(id as number, encodedName);
},
});
const [editMode, setEditMode] = useState(false);
const [nodeName, setNodeName] = useState(text);
const handleToggle = () => onToggle(id);
const handleSelect = () => onSelect(node);
const handleSave = async () => {
await modifyMenuName(nodeName);
setEditMode(false);
};
return (
<div
style={{ paddingInlineStart: indent }}
className={cn(
"group flex cursor-pointer items-center justify-between gap-2 rounded-sm p-2 hover:bg-accent",
isSelected && "!bg-[rgba(32,148,250,0.2)]",
)}
onClick={handleSelect}
>
<div className="flex items-center">
{editMode ? (
<>
<Input
value={nodeName}
onChange={(e) => setNodeName(e.target.value)}
className="h-[2.5rem] !text-[1.3rem] text-foreground"
/>
</>
) : (
<>
{data?.children?.length && (
<i
className={cn(
"diveicon di-arrow-forward mr-2 text-base text-label",
isOpen && "rotate-90",
)}
onClick={handleToggle}
/>
)}
<span className="text-[1.4rem] font-medium text-label">{text}</span>
</>
)}
</div>
{editMode ? (
<div className="flex items-center gap-1">
<Button
variant="ghost"
size="icon"
className="size-8 !bg-transparent"
onClick={handleSave}
>
<i className="diveicon di-check text-2xl" />
</Button>
<Button
variant="ghost"
size="icon"
className="size-8 !bg-transparent"
onClick={() => {
setEditMode(false);
setNodeName(text);
}}
>
<i className="diveicon di-x" />
</Button>
</div>
) : (
<Button
variant="ghost"
size="icon"
className="invisible !bg-transparent group-hover:visible"
onClick={() => setEditMode(true)}
>
<i className="diveicon di-pencil" />
</Button>
)}
</div>
);
}
export { MenuNode };
-105
View File
@@ -1,105 +0,0 @@
"use client";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { useQuery } from "@tanstack/react-query";
import { zodResolver } from "@hookform/resolvers/zod";
import {
Button,
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@common/components/ui";
import { SiteApi } from "@/entities/site";
import { ENDPOINT } from "@/shared/config";
import { PageLayout } from "@/shared/ui/page-layout";
import { MenuApi } from "../api/menu-service";
import {
MENU_TYPE,
menuFormSchema,
type MenuFormData,
} from "../model/menu-interface";
import { MenuTree } from "./menu-tree";
import { MenuForm } from "./menu-form";
import { generateTreeData } from "../lib/utils";
function MenuPage() {
const [siteId, setSiteId] = useState("");
const { data: treeData } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.MENUS, siteId],
queryFn: () => MenuApi.getTreeMenuList(siteId),
select: (data) => generateTreeData(data),
enabled: !!siteId,
});
const { data: options } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SITES],
queryFn: () => SiteApi.getSiteList({}),
select: (data) =>
data.content.map((site) => ({
label: site.siteNm,
value: site.siteId,
})),
});
const form = useForm<MenuFormData>({
resolver: zodResolver(menuFormSchema),
defaultValues: {
menuLnkgTypeCd: MENU_TYPE.EMPTY,
},
});
const handleSave = async (data: MenuFormData) => {
console.log(data);
};
const handleDelete = async () => {};
return (
<PageLayout pageTitle="메뉴 관리">
<div className="card flex gap-2">
<div className="card card-border w-[24rem]">
<Select value={siteId} onValueChange={setSiteId}>
<SelectTrigger>
<SelectValue placeholder="선택하세요" />
</SelectTrigger>
<SelectContent>
{options?.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectContent>
</Select>
{treeData && (
<>
<div className="my-4 flex gap-2">
<Button size="sm" color="primary" className="flex-1">
메뉴 추가
</Button>
<Button size="sm" color="red" className="flex-1">
메뉴 삭제
</Button>
</div>
<div className="card card-border !mx-0">
<MenuTree treeData={treeData ?? []} siteId={siteId} />
</div>
</>
)}
</div>
<div className="card card-border flex-1">
<MenuForm
form={form}
handleSave={handleSave}
handleDelete={handleDelete}
/>
</div>
</div>
</PageLayout>
);
}
export { MenuPage };
-83
View File
@@ -1,83 +0,0 @@
"use client";
import { useState } from "react";
import { DndProvider } from "react-dnd";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import {
Tree,
MultiBackend,
getBackendOptions,
type NodeModel,
} from "@minoru/react-dnd-treeview";
import { ENDPOINT } from "@/shared/config";
import { MenuApi } from "../api/menu-service";
import type { Menu, TreeMenu } from "../model/menu-interface";
import { handleDropNode, handleSelectNode } from "../lib/utils";
import { MenuNode } from "./menu-node";
type MenuTreeProps = {
treeData: NodeModel<Menu>[];
siteId: string;
};
function MenuTree({ treeData, siteId }: MenuTreeProps) {
const queryClient = useQueryClient();
const { mutate: modifyTreeMenu } = useMutation({
mutationFn: (newTree: TreeMenu) =>
MenuApi.modifyTreeMenu(siteId, [newTree]),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: [ENDPOINT.CMS_SERVICE.MENUS],
});
},
});
const [selectedNode, setSelectedNode] = useState<NodeModel<Menu> | null>(
null,
);
return (
<DndProvider backend={MultiBackend} options={getBackendOptions()}>
<Tree
tree={treeData}
rootId={0}
render={(node: NodeModel<Menu>, { depth, isOpen, onToggle }) => (
<MenuNode
node={node}
depth={depth}
isOpen={isOpen}
isSelected={selectedNode?.id === node.id}
onToggle={onToggle}
onSelect={handleSelectNode(setSelectedNode)}
/>
)}
onDrop={handleDropNode(modifyTreeMenu)}
classes={{
root: "p-4",
container: "flex flex-col",
dropTarget: "!bg-[rgba(32,148,250,0.5)] rounded-sm",
placeholder: "relative",
}}
sort={false}
dropTargetOffset={5}
insertDroppableFirst={false}
canDrop={(_, { dragSource, dropTargetId }) => {
if (dragSource?.parent === dropTargetId) {
return true;
}
}}
placeholderRender={(_, { depth }) => {
return (
<div
className="absolute right-0 top-0 h-[0.2rem] bg-primary"
style={{ left: depth * 10 + 5 }}
/>
);
}}
/>
</DndProvider>
);
}
export { MenuTree };
@@ -1,22 +0,0 @@
import { type UseFormReturn } from "react-hook-form";
import { Table, TableBody } from "@common/components";
import type { MenuFormData } from "../model/menu-interface";
import { BaseBottomMenuForm } from "./base-bottom-menu-form";
export function OutsideMenuForm({
form,
}: {
form: UseFormReturn<MenuFormData>;
}) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<TableBody>
<BaseBottomMenuForm form={form} />
</TableBody>
</Table>
);
}
@@ -16,7 +16,6 @@ export interface ISite {
useYn: string;
regDt: string;
rgTrNm: string;
dmnAddr: string;
}
export interface ISiteDetail extends SiteFormData {
@@ -45,7 +44,6 @@ export const siteFormSchema = z.object({
bkmkIcon: z.string().max(100).nullable(),
useYn: z.string(),
siteSkn: z.string().max(10).nullable(),
dmnAddr: z.string().nullable(),
});
export type SiteFormData = z.infer<typeof siteFormSchema>;
@@ -1,6 +1,6 @@
import dayjs from "dayjs";
import { createColumnHelper } from "@tanstack/react-table";
import type { ISite } from "@/entities/site";
import type { ISite } from "./site-interface";
const columnHelper = createColumnHelper<ISite>();
@@ -17,8 +17,8 @@ const columns = [
id: "siteNm",
header: "사이트명",
}),
columnHelper.accessor("dmnAddr", {
id: "dmnAddr",
columnHelper.accessor("siteAddr", {
id: "siteAddr",
header: "대표 URL",
}),
columnHelper.accessor("bscSiteYn", {
+6 -5
View File
@@ -4,10 +4,11 @@ import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { useMutation } from "@tanstack/react-query";
import { zodResolver } from "@hookform/resolvers/zod";
import { SiteApi, siteFormSchema, type SiteFormData } from "@/entities/site";
import { useAlertStore } from "@/shared/lib/use-alert-store";
import { PageLayout } from "@/shared/ui/page-layout";
import { SiteApi } from "../api/site-service";
import { siteFormSchema, type SiteFormData } from "../model/site-interface";
import { SitePageLayout } from "./layout";
import { SiteForm } from "./site-form";
import { useAlertStore } from "@/shared/lib/use-alert-store";
function CreatePage() {
const router = useRouter();
@@ -38,9 +39,9 @@ function CreatePage() {
});
return (
<PageLayout pageTitle="사이트 관리">
<SitePageLayout>
<SiteForm form={form} handleSave={createSite} />
</PageLayout>
</SitePageLayout>
);
}
@@ -1,18 +1,12 @@
function PageLayout({
children,
pageTitle,
}: {
children: React.ReactNode;
pageTitle: string;
}) {
function SitePageLayout({ children }: { children: React.ReactNode }) {
return (
<div className="h-auto min-h-full bg-container">
<h2 className="px-[1.8rem] pt-[2rem] text-[2.4rem] font-semibold text-title">
{pageTitle}
사이트 관리
</h2>
{children}
</div>
);
}
export { PageLayout };
export { SitePageLayout };
+6 -6
View File
@@ -2,12 +2,13 @@
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { SiteApi, siteFormSchema, type SiteFormData } from "@/entities/site";
import { zodResolver } from "@hookform/resolvers/zod";
import { ENDPOINT } from "@/shared/config";
import { PageLayout } from "@/shared/ui/page-layout";
import { useAlertStore } from "@/shared/lib/use-alert-store";
import { SiteApi } from "../api/site-service";
import { siteFormSchema, type SiteFormData } from "../model/site-interface";
import { SitePageLayout } from "./layout";
import { SiteForm } from "./site-form";
function ModifyPage({ siteId }: { siteId: string }) {
@@ -16,7 +17,6 @@ function ModifyPage({ siteId }: { siteId: string }) {
const router = useRouter();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const { data: siteDetail } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SITES, siteId],
queryFn: () => SiteApi.siteDetail(siteId),
@@ -63,14 +63,14 @@ function ModifyPage({ siteId }: { siteId: string }) {
});
return (
<PageLayout pageTitle="사이트 관리">
<SitePageLayout>
<SiteForm
form={form}
siteId={siteId}
handleSave={modifySite}
handleDelete={deleteSite}
/>
</PageLayout>
</SitePageLayout>
);
}
+4 -8
View File
@@ -15,7 +15,6 @@ import {
TableRow,
} from "@common/components";
import { CodeSelect } from "@/entities/code";
import type { SiteFormData } from "@/entities/site";
import {
FormItem,
FormControl,
@@ -24,6 +23,7 @@ import {
FormMessage,
} from "@/shared/ui/form";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import type { SiteFormData } from "../model/site-interface";
import type { Domain } from "../model/domain-interface";
import { IPManagementDialog } from "./ip-management-dialog";
import { DomainManagementDialog } from "./domain-management-dialog";
@@ -43,12 +43,10 @@ function SiteForm({ form, siteId, handleSave, handleDelete }: SiteFormProps) {
const [onConfirm, setOnConfirm] = useState(false);
const [isIpManagementOpen, setIsIpManagementOpen] = useState(false);
const [isDomainManagementOpen, setIsDomainManagementOpen] = useState(false);
const [domainUrl, setDomainUrl] = useState("");
const handleSaveDomain = (rows: Domain[]) => {
form.setValue(
"dmnAddr",
rows.find((row) => row.rprsDmnYn === "Y")?.dmnAddr || "",
);
setDomainUrl(rows.find((row) => row.rprsDmnYn === "Y")?.dmnAddr || "");
};
const onSubmit = async (data: SiteFormData) => {
@@ -101,7 +99,6 @@ function SiteForm({ form, siteId, handleSave, handleDelete }: SiteFormProps) {
<FormControl>
<Input
{...field}
value={field.value ?? ""}
className="w-[12rem] !text-[1.3rem]"
disabled={isModifyMode}
/>
@@ -176,7 +173,6 @@ function SiteForm({ form, siteId, handleSave, handleDelete }: SiteFormProps) {
<FormControl>
<Input
{...field}
value={field.value ?? ""}
className="!text-[1.3rem]"
placeholder="사이트명을 입력하십시오."
/>
@@ -215,7 +211,7 @@ function SiteForm({ form, siteId, handleSave, handleDelete }: SiteFormProps) {
<TableCell className="border">
<div className="flex gap-2">
<div className="h-[3.2rem] w-[21.5rem] cursor-not-allowed rounded-md border border-input bg-form px-3 py-2 text-[1.3rem] opacity-50">
{form.watch("dmnAddr")}
{domainUrl}
</div>
<DomainManagementDialog
siteId={siteId}
+8 -6
View File
@@ -2,15 +2,16 @@
import "@common/assets/styles/grid.css";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
import { Button, DataTable, Input } from "@common/components";
import { SiteApi, type ISite, type ISiteParams } from "@/entities/site";
import { ENDPOINT } from "@/shared/config";
import { PageLayout } from "@/shared/ui/page-layout";
import { SiteApi } from "../api/site-service";
import { columns } from "../model/table-columns";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { type ISite, type ISiteParams } from "../model/site-interface";
import { SitePageLayout } from "./layout";
function SitePage() {
const router = useRouter();
@@ -41,10 +42,11 @@ function SitePage() {
useEffect(() => {
refetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<PageLayout pageTitle="사이트 관리">
<SitePageLayout>
<div className="card card-border !mt-6">
<div className="card card-border">
<form onSubmit={handleSubmit} className="flex items-center gap-2 p-2">
@@ -71,7 +73,7 @@ function SitePage() {
</div>
</div>
</div>
</PageLayout>
</SitePageLayout>
);
}
-1
View File
@@ -13,7 +13,6 @@ export const ENDPOINT = {
CODE: "/cms-service/api/v1/code/cache",
IPS: "/cms-service/api/v1/site-ips",
DOMAINS: "/cms-service/api/v1/site-dmns",
MENUS: "/cms-service/api/v1/menus",
},
};
-41
View File
@@ -1,41 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

-10
View File
@@ -1,10 +0,0 @@
@import "@common/assets/styles/base.css";
@import "@common/assets/styles/diveicon.css";
@tailwind base;
@tailwind utilities;
html,
body {
font-family: "Noto Sans KR", sans-serif;
font-size: 10px;
}
-25
View File
@@ -1,25 +0,0 @@
'use client'
import { BaseLayout } from "@common/components";
import "./globals.css";
import { StoreProvider } from "./store";
import { MainDiv } from "@common/business_components";
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>
<StoreProvider>
<BaseLayout>
<MainDiv>
{children}
</MainDiv>
</BaseLayout>
</StoreProvider>
</body>
</html>
);
}
-4
View File
@@ -1,4 +0,0 @@
export default function Loading() {
return <div>페이지 불러오는 중입니다...</div>;
}
-84
View File
@@ -1,84 +0,0 @@
"use client";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import {
Form,
FormField,
FormUi,
ScrollArea,
SelectBox,
} from "@common/business_components/ui";
import { Button } from "@common/components/ui";
import { CoRegForm } from "@/components/ui/form/matDmd/coRegForm/component";
import toast, { Toaster } from "react-hot-toast";
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
const formSchema = z.object({
ctpv: z.string(),
sgg: z.string(),
coNm: z.string().min(1).max(20),
bznmNo: z.string().min(1).min(9).max(12),
addr: z.string().min(1).min(6).max(20),
telNo: z.string().min(8).max(12),
});
export default function MyForm() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
coNm:'',
bznmNo:'',
addr:'',
telNo:'',
},
});
function onSubmit(values: z.infer<typeof formSchema>) {
try {
toast.dismiss();
ToastFormUi("수요신청 화면으로 이동하시겠습니까?", "수요처 등록 완료", "./dmdReg", "이동")
} catch (error) {
console.error("Form submission error", error);
toast.error("수요처 등록이 실패하였습니다.");
}
}
return (
<>
<div className="grid h-40 grid-cols-3 place-content-center">
<h1 className=" col-start-2 col-span-1 text-4xl underline">
수요처 정보입력
</h1>
</div>
<div className="grid grid-cols-5 gap-4 overflow-hidden">
<div className="col-span-1 "/>
<div className="col-span-3 ">
<div>
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8 max-w-3xl mx-auto"
>
<CoRegForm>{form}</CoRegForm>
<Button type="submit">수요처등록</Button>
</form>
</Form>
</div>
</div>
<div className="col-span-1 " >
<Toaster position="top-center" />
</div>
</div>
</>
);
}
-106
View File
@@ -1,106 +0,0 @@
"use client";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import { Form } from "@common/business_components/ui";
import { Button } from "@common/components/ui";
import { DmdRegForm } from "@/components/ui/form/matDmd/dmdRegform/component";
import toast, { Toaster } from "react-hot-toast";
import { useRouter } from "next/navigation";
const formSchema = z.object({
dmdSel: z.string().min(1),
dmdTmng: z.coerce.date(),
dmdWq: z.string().min(1).optional(),
useUsgCd: z.string(),
wntUntprc: z.string().min(1),
grssClfg: z.string().min(1),
tn: z.string().min(1).optional(),
combResdch: z.string().min(1).optional(),
tp: z.string().min(1).optional(),
trbt: z.string().min(1).optional(),
ph: z.string().min(1).optional(),
bod: z.string().min(1).optional(),
clIonQnt: z.string().min(1).optional(),
smll: z.string().min(1).optional(),
cdtnv: z.string().min(1).optional(),
crmty: z.string().min(1).optional(),
rmrk: z.string().min(1).optional(),
sply1: z.string().min(1).optional(),
sply2: z.string().min(1).optional(),
sply3: z.string().min(1).optional(),
password: z.string().min(1),
});
export default function MyForm() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
dmdSel:'',
dmdTmng: new Date(),
dmdWq: "",
useUsgCd: "",
wntUntprc: "",
grssClfg: "",
tn: "",
combResdch: "",
tp: "",
trbt: "",
ph: "",
bod: "",
clIonQnt: "",
smll: "",
cdtnv: "",
crmty: "",
rmrk: "",
sply1: "",
sply2: "",
sply3: "",
password: "",
},
});
const router = useRouter();
async function onSubmit(values: z.infer<typeof formSchema>) {
try {
toast.success("✅ 수요신청이 완료되었습니다.");
await new Promise((resolve) => setTimeout(resolve, 3000));
router.push("../../")
} catch (error) {
toast.error("수요신청을 다시입력해주시길 바랍니다.");
}
}
return (
<>
<div className="grid h-40 grid-cols-3 place-content-center">
<h1 className=" col-start-2 col-span-1 text-4xl underline">
수요 신청정보입력
</h1>
</div>
<div className="grid grid-cols-5 gap-4 overflow-hidden">
<div className="col-span-1 " />
<div className="col-span-3 max-h-[78vh] overflow-y-scroll ">
<div>
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8 max-w-3xl mx-auto"
>
<DmdRegForm> {form}</DmdRegForm>
<Button type="submit"> 수요신청</Button>
</form>
</Form>
</div>
</div>
<div className="col-span-1 ">
<Toaster position="top-center" />
</div>
</div>
</>
);
}
-82
View File
@@ -1,82 +0,0 @@
"use client";
import Link from "next/link";
import { Button } from "@common/components/ui";
export default function Home() {
return (
<>
<div className="flex flex-col gap-8 p-6">
{/* 시설 등록 */}
<div>
<h2 className="text-xl font-semibold mb-4">시설 등록</h2>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/fcltReg/pbnstReg">
하수재이용 시설 등록
</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/fcltReg/rainReg">
빗물재이용 시설 등록
</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/fcltReg/rswtReg">중수도시설 등록</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/fcltReg/htdflReg">온배수 등록</Link>
</Button>
</div>
</div>
</div>
{/* 지도점검 결과 */}
<div>
<h2 className="text-xl font-semibold mb-4">지도점검 결과</h2>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/prfmncReg/chkgdnReg">
지도점검 결과 등록
</Link>
</Button>
</div>
</div>
</div>
{/* 시설 현황 */}
<div>
<h2 className="text-xl font-semibold mb-4">시설 현황</h2>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/fcltSttn/pbnstSttn">
하수재이용시설현황
</Link>
</Button>
</div>
</div>
</div>
{/* 수요처 관리 */}
<div>
<h2 className="text-xl font-semibold mb-4">수요처 관리</h2>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-2">
<Button className="w-full">
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
</Button>
</div>
</div>
</div>
</div>
</>
);
}
@@ -1,153 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import {
ContentsDiv,
ScrollArea,
SearchDiv,
SearchFormLeft,
SearchFormRight,
SearchInput,
Title,
UiModal,
UiTable,
} from "@common/business_components";
import { Button } from "@common/components";
import { headMakeColSpan } from "../rainReg/page";
import ListDiv from "@common/business_components/ui/list_div";
import { useEffect, useState } from "react";
import { tableData } from "@/components/lib/func/commom";
import { HtdflRegForm } from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
export default function Home() {
const { code, htdfl, initHtdfl } = useWrStore((state) => state);
const nodeList = headMakeColSpan(htdfl.upHeadList);
const [searchTxt, setSearchTxt] = useState("");
const [htdflForm, setHtdflForm] = useState<customHtdflBdst>();
const [bdstTable, setbdstTable] = useState<customHtdflBdst[]>();
const [issNewReg,setIsNewReg] = useState<boolean>( false);
const [bdstChgProps, setBdstChgProps] = useState<{
isOpen: boolean;
chgBuilding: chgBuilding[];
}>({ isOpen: false, chgBuilding: [] });
const { htdflRes } = htdfl;
useEffect(() => {
if (!htdfl.isInit) {
initHtdfl(undefined);
}
}, [htdfl.isInit, initHtdfl]);
useEffect(() => {
if (code.sggCd.length > 0) {
setbdstTable(tableData(htdflRes, { code }));
}
}, [code, htdflRes]);
const cellClick: (val: number|undefined ,headId: string) => void = (
val
,headId) => {
if ((bdstTable ?? []).length > 0 && val !== undefined) {
{
setHtdflForm(htdflRes[val]);
}
}
if (headId === "bdstChgYn" && val !== undefined) {
if (
htdflRes[val]?.bdstInfoPk != null &&
htdflRes[val]?.chgBuilding?.length > 0
) {
bdstChgModal(htdflRes[val]?.chgBuilding);
}
}
};
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
};
return (
<>
<ContentsDiv>
<div className="grid grid-cols-2 gap-4 ">
<div className="col-span-2">
<Title title={"온배수시설 등록 "} />
<SearchDiv>
<SearchFormLeft>
<SearchInput
className="col-span-3 my-7"
label="건물명:"
textValue={searchTxt || ""}
setText={(e) => {
setSearchTxt(e);
}}
/>
</SearchFormLeft>
<SearchFormRight>
<Button className="mr-4 rounded-lg" onClick={()=>{initHtdfl(searchTxt||"")}}>조회</Button>
<Button
className="mr-4 rounded-lg"
onClick={() => setIsNewReg(!issNewReg)}
>
신규등록
</Button>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-4">
<ListDiv>
<UiTable
tableData={bdstTable || []}
headlist={htdfl.upHeadList}
pageSize={100}
total={10}
headName={"○건축물 목록"}
cellClick={(val,headId)=>{cellClick(val||undefined , headId)}}
>
{nodeList}
</UiTable>
</ListDiv>
</div>
<div className="col-span-2 max-h-full ovreflow-y-scroll">
<ListDiv>
<ScrollArea>
<HtdflRegForm
htdflForm={htdflForm ?? ({} as customHtdflBdst)}
isModal={false}
/>
</ScrollArea>
</ListDiv>
</div>
</div>
<UiModal
body={<BdstReg moType="HTB"></BdstReg>}
bodyClass="w-[90vw] max-w-none"
open={issNewReg}
onOpenChange={(open) => {
setIsNewReg(open);
}}
/>
<UiModal
bodyClass={""}
open={bdstChgProps.isOpen}
body={<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}
}
/>
</ContentsDiv>
</>
);
}
@@ -1,120 +0,0 @@
"use client";
import {
ScrollArea,
SearchDiv,
SelectBox,
UiTable,
} from "@common/business_components";
import { Button } from "@common/components";
import { useWrStore } from "../../../store";
import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/component";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@common/components";
import { PbnstMngForm} from "@/components/ui/form/fcltReg/pbnstReg/mngReg/component";
import { useEffect, useState } from "react";
import type { ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
export default function PublicReuseFaciltyInsert() {
const { pubFac , pubMng,mngMainValue} = useWrStore((state) => state);
const { pubFacHeadList, publicReuseFacilityData } = pubFac;
const { ruseFclt } = pubMng;
const [currentTab, setCurrentTab] = useState<string>('mng');
const [fcltMng, setFcltMng] = useState<ruseFcltType[]>();
const searchDiv = "하수재이용시설 ";
const selectBox = [
{ text: "서울하수처리시설", val: "1_hasu" },
{ text: "서울1하수처리시설", val: "2_hasu" },
{ text: "서울2하수처리시설", val: "3_hasu" },
];
const headName = () => {
return <h1 className="pl-3 text-xl">○공공 하수처리시설 등록</h1>;
};
const onSelectValue = (val: string) => {
console.log(val);
};
const cellClick = (val: number | undefined) => {
if (val === undefined) return;
let data;
if (publicReuseFacilityData[val]) {
data = ruseFclt.filter(
(item) => item.swtrmtFcltFk === publicReuseFacilityData[val]?.swtrmtFcltFk
);
setFcltMng(data);
}
};
const resetContents = () => {
setFcltMng([]); // 빈 배열로 설정하여 신규 모드로 전환
};
const handleTabChange = (value: string) => {
setCurrentTab(value);
};
return (
<>
<div className="grid grid-cols-2 gap-4 h-full">
<div className="col-span-4 ">
<h1 className="pl-3 text-xl"> 하수재이용시설 등록</h1>
<div className="m-8">
<SearchDiv>
<div className="w-4/5 grid grid-cols-12 gap-1 mx-4">
<SelectBox
className="col-span-4"
label={searchDiv}
selectArray={selectBox}
onSelectValue={onSelectValue}
selectClass={undefined}
/>
</div>
<div className="w-1/5 flex items-center justify-end">
<Button className="mr-16 rounded-lg">조회</Button>
</div>
</SearchDiv>
</div>
</div>
<div className="col-span-1 pl-11 max-h-full">
<UiTable
tableData={publicReuseFacilityData}
headlist={pubFacHeadList}
pageSize={100}
total={10}
headName={headName()}
children={undefined} cellClick={cellClick} />
</div>
<div className="col-span-1 pr-6 max-h-full overflow-y-scroll">
<Tabs defaultValue="mng" onValueChange={handleTabChange}>
<div className="flex justify-between items-center">
<TabsList>
<TabsTrigger value="mng">시설정보</TabsTrigger>
<TabsTrigger value="buse">차수별정보</TabsTrigger>
</TabsList>
<Button className="rounded-lg" onClick={resetContents}>
신규등록
</Button>
</div>
<TabsContent className="max-h-full" value="mng">
<ScrollArea>
<PbnstMngForm
data={fcltMng || []}
/>
</ScrollArea>
</TabsContent>
<TabsContent value="buse">
<ScrollArea>
<PbnstBuseForm />
</ScrollArea>
</TabsContent>
</Tabs>
</div>
</div>
</>
);
}
@@ -1,195 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import type {
chgBuilding,
customRainBdst,
TableUpperProps,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { tableData } from "@/components/lib/func/commom";
import { RainRegForm } from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
import {
ContentsDiv,
ScrollArea,
SearchDiv,
SearchFormLeft,
SearchFormRight,
SearchInput,
Title,
UiModal,
UiTable,
} from "@common/business_components";
import ListDiv from "@common/business_components/ui/list_div";
import { Button, TableHead, TableRow } from "@common/components";
import { useEffect, useState } from "react";
export const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
return (
<>
<TableRow>
{upHeadList.map((head: TableUpperProps) =>
!head.upSequnce ? (
<TableHead rowSpan={2} key={head.id}>
{head.title}
</TableHead>
) : head.upName === "upChangeRe" && head.upSequnce === 1 ? (
<TableHead key={head.id} rowSpan={1} colSpan={3}>
{"중축 개축 재축 "}
</TableHead>
) : null
)}
</TableRow>
<TableRow>
{upHeadList.map((head: TableUpperProps) =>
head.upName === "upChangeRe" ? (
<TableHead key={head.id}>{head.title}</TableHead>
) : null
)}
</TableRow>
</>
);
};
//-------------------------------------------------------------------------------------------------------
export default function Home() {
const { rain, code, init } = useWrStore((state) => {
return state;
});
const { rainRes } = rain;
const [rainForm, setRainForm] = useState<customRainBdst>();
const [issNewReg, setIsNewReg] = useState<boolean>(false);
const [bdstTable, setbdstTable] = useState<customRainBdst[]>();
const [searchTxt, setSearchTxt] = useState<string>();
const [bdstChgProps, setBdstChgProps] = useState<{
isOpen: boolean;
chgBuilding: chgBuilding[];
}>({ isOpen: false, chgBuilding: [] });
const nodeList = headMakeColSpan(rain.upHeadList);
useEffect(() => {
if (!rain.isInit) {
init(undefined);
}
}, [rain.isInit, init]);
useEffect(() => {
if (code.sggCd.length > 0) {
setbdstTable(tableData(rainRes, { code }));
}
}, [code, rainRes]);
const cellClick: (val: number | undefined, headId: string) => void = (
val,
headId
) => {
if (val !== undefined) {
setRainForm(rainRes[val]);
}
if (headId === "bdstChgYn" && val !== undefined) {
if (
rainRes[val]?.bdstInfoPk != null &&
rainRes[val]?.chgBuilding.length > 0
) {
bdstChgModal(rainRes[val].chgBuilding);
}
}
};
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
};
useEffect(() => {
console.log("rainForm", rainForm);
}, [rainForm]);
return (
<>
<ContentsDiv>
<div className="grid grid-cols-4 gap-4 ">
<div className="col-span-4">
<Title title={"빗물이용시설 등록"} />
<SearchDiv>
<SearchFormLeft>
<SearchInput
className="col-span-3 my-7"
label="건물명"
textValue={searchTxt || ""}
setText={(e) => {
setSearchTxt(e);
}}
/>
</SearchFormLeft>
<SearchFormRight>
<Button
className="mr-4 rounded-lg"
onClick={(e) => {
init(searchTxt || "");
}}
>
조회
</Button>
<Button
className="mr-4 rounded-lg"
onClick={() => setIsNewReg(!issNewReg)}
>
신규등록
</Button>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="h-screen grid grid-cols-6 gap-4 !overflow-y-scroll">
<div className="col-span-4 h-full min-h-0">
<ListDiv className="h-full min-h-0">
<ScrollArea className="h-[60vh]">
<UiTable
tableData={bdstTable || []}
headlist={rain.upHeadList}
pageSize={100}
total={10}
headName={"○건축물 목록"}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
>
{nodeList}
</UiTable>
</ScrollArea>
</ListDiv>
</div>
<div className="col-span-2 max-h-full overflow-y-scroll">
<ListDiv className="">
<RainRegForm
rainForm={rainForm ?? ({} as customRainBdst)}
isModal={false}
></RainRegForm>
</ListDiv>
</div>
</div>
<UiModal
body={<BdstReg moType="RNB"></BdstReg>}
bodyClass="w-[90vw] max-w-none"
open={issNewReg}
onOpenChange={(open) => {
setIsNewReg(open);
}}
/>
<UiModal
bodyClass={""}
open={bdstChgProps.isOpen}
body={
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}}
/>
</ContentsDiv>
</>
);
}
@@ -1,158 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
import {
ContentsDiv,
ScrollArea,
SearchDiv,
SearchFormLeft,
SearchFormRight,
SearchInput,
Title,
UiModal,
UiTable,
} from "@common/business_components";
import ListDiv from "@common/business_components/ui/list_div";
import { Button } from "@common/components";
import { headMakeColSpan } from "../rainReg/page";
import { useEffect, useState } from "react";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { tableData } from "@/components/lib/func/commom";
import { RswtrRegForm } from "@/components/ui/form/fcltReg/rswtrReg/RswtrRegForm";
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
export default function Home() {
const { code, rswt, initRswt } = useWrStore((state) => state);
const nodeList = headMakeColSpan(rswt.upHeadList);
const [rswtForm, setRswtForm] = useState<customRswtBdst>();
const [searchTxt, setSearchTxt] = useState<string>();
const [issNewReg, setIsNewReg] = useState<boolean>(false);
const [bdstTable, setbdstTable] = useState<customRswtBdst[]>();
const [bdstChgProps, setBdstChgProps] = useState<{
isOpen: boolean;
chgBuilding: chgBuilding[];
}>({ isOpen: false, chgBuilding: [] });
const { rswtRes } = rswt;
useEffect(() => {
if (!rswt.isInit) {
initRswt(undefined);
}
}, [rswt.isInit, initRswt]);
useEffect(() => {
if (code.sggCd.length > 0) {
setbdstTable(tableData(rswtRes, { code }));
}
}, [code, rswtRes]);
const cellClick: (val: number | undefined, headId: string) => void = (
val,
headId
) => {
if ((bdstTable ?? []).length > 0 && val !== undefined) {
{
setRswtForm(rswtRes[val]);
}
}
if (headId === "bdstChgYn" && val !== undefined) {
if (
rswtRes[val]?.bdstInfoPk != null &&
rswtRes[val]?.chgBuilding?.length > 0
) {
bdstChgModal(rswtRes[val].chgBuilding);
}
}
};
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
};
return (
<>
<ContentsDiv>
<div className="grid grid-cols-4 gap-4 ">
<div className="col-span-4">
<Title title={"중수도시설 등록 "} />
<SearchDiv>
<SearchFormLeft>
<SearchInput
className="col-span-3 my-7"
label="건물명:"
textValue={searchTxt || ""}
setText={(e) => {
setSearchTxt(e);
}}
/>
</SearchFormLeft>
<SearchFormRight>
<Button
className="mr-4 rounded-lg"
onClick={(e) => {
initRswt(searchTxt || "");
}}
>
조회
</Button>
<Button
className="mr-4 rounded-lg"
onClick={() => setIsNewReg(!issNewReg)}
>
신규등록
</Button>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-4">
<ListDiv>
<UiTable
tableData={bdstTable || []}
headlist={rswt.upHeadList}
pageSize={100}
total={10}
headName={"○건축물 목록"}
cellClick={cellClick}
>
{nodeList}
</UiTable>
</ListDiv>
</div>
<div className="col-span-2 max-h-full ovreflow-y-scroll">
<ListDiv>
<ScrollArea>
<RswtrRegForm
rswtForm={rswtForm ?? ({} as customRswtBdst)}
isModal={false}
/>
</ScrollArea>
</ListDiv>
</div>
</div>
<UiModal
body={<BdstReg moType="RST"></BdstReg>}
bodyClass="w-[90vw] max-w-none"
open={issNewReg}
onOpenChange={(open) => {
setIsNewReg(open);
}}
/>
<UiModal
bodyClass={""}
open={bdstChgProps.isOpen}
body={
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}}
/>
</ContentsDiv>
</>
);
}
@@ -1,128 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import {
ContentsDiv,
SearchDiv,
SearchFormLeft,
SearchFormRight,
SelectBox,
Title,
UiModal,
UiTable,
} from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Button } from "@common/components/ui";
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/page";
import HeadChModal from "@/components/ui/modal/headChModal/headChModal";
import { useState } from "react";
export default function PbnstSttn() {
const { code,pbnStt } = useWrStore((state) => state);
const [isChHead, setIsChHead] = useState(false);
const nodeList = headMakeprfmnc(pbnStt.pbnSttHeadList, pbnStt.pbnSttHeadNm);
return (
<>
<ContentsDiv>
<div className="grid grid-cols-4 gap-4 ">
<div className="col-span-4">
<Title title={"하수재이용 시설 현황"} />
<SearchDiv>
<SearchFormLeft>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"권역"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"단위유역"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"중권역"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"환경청"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"시도"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
<SelectBox
className={"col-span-2 w-full h-full text-2xl"}
label={"시군구"}
selectClass={""}
selectArray={code.yn}
onSelectValue={() => {}}
value={""}
/>
</SearchFormLeft>
<SearchFormRight>
<Button className="mr-4 rounded-lg" onClick={(e) => {}}>
조회
</Button>
<Button className="mr-4 rounded-lg" onClick={() => {}}>
다운로드
</Button>
<Button className="mr-4 rounded-lg" onClick={() => {
// setIsChHead(true)
}}>
조회항목설정
</Button>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-6">
<ListDiv>
<UiTable
headName={undefined}
tableData={[]}
headlist={pbnStt.pbnSttHeadList}
pageSize={0}
total={0}
cellClick={undefined}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
}}
>
{nodeList}
</UiTable>
</ListDiv>
</div>
</div>
<UiModal open ={isChHead} onOpenChange ={()=>{setIsChHead(!isChHead)}} bodyClass={""} body={<HeadChModal/>}/>
</ContentsDiv>
</>
);
}
@@ -1,163 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import {
fcltDiv,
type chHeadType,
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import {
ContentsDiv,
SearchDiv,
SearchFormLeft,
SearchFormRight,
SearchInput,
SelectBox,
Title,
UiModal,
UiTable,
} from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Button, Input } from "@common/components/ui";
import { useState } from "react";
import { TableRow, TableHead } from "@common/components";
import React from "react";
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import RainChkgdTable from "@/components/ui/table/rainChkgd/rainChkgdTable";
import RswtChkgdTable from "@/components/ui/table/rswtChkgd/rswtChkgdTable";
import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal";
import ChkgdExcel from "@/components/ui/modal/chkgdExcel/chkgdExcel";
export const headMakeprfmnc = (
upHeadList: TableUpperProps[],
makeHeadNm: chHeadType[]
) => {
return (
<>
<TableRow>
{upHeadList
.filter((data) => data.visible !=false)
.map((head: TableUpperProps) =>
!head.upSequnce ? (
<TableHead
className={ `border border-gray-600 px-2 py-1 `}
rowSpan={2} key={head.id}>
{head.title}
</TableHead>
) : head.upSequnce === 1 ? (
<TableHead
className={ `border border-gray-600 px-2 py-1 `}
key={head.id}
rowSpan={1}
colSpan={
makeHeadNm.find((ch) => ch.headNm === head.upName)?.length
}
>
{makeHeadNm.find((ch) => ch.headNm === head.upName)?.text}
</TableHead>
) : null
)}
</TableRow>
<TableRow>
{upHeadList
.filter((data) => data.visible !=false)
.map((head: TableUpperProps) =>
makeHeadNm.find((ch) => ch.headNm === head.upName) ? (
<TableHead
className={ `border border-gray-600 px-2 py-1 `}
key={head.id}>{head.title}</TableHead>
) : null
)}
</TableRow>
</>
);
};
//-----------------------
export default function Page() {
const [isDetail, setIsDetail] = useState(false);
const [isExcel, setIsExcel] = useState(false);
const [testObj, setTestObj] = useState({});
const [selFcltDiv, setSelFcltDiv] = useState("RST");
const cellClick = () => {
const ch = { bdstNm: "test", chckYmd: "2022-10-10" };
setTestObj(ch);
};
return (
<ContentsDiv>
<div className="grid grid-cols-4 gap-4 ">
<div className="col-span-4">
<Title title={"지도점검 결과 등록 "} />
<SearchDiv>
<SearchFormLeft>
<SearchInput
className="col-span-3 my-7"
label=" 지도점검년도"
textValue={""}
setText={(e) => {}}
/>
<SelectBox
className={"col-span-3 w-full h-full text-2xl"}
label={"시설구분"}
selectClass={""}
selectArray={fcltDiv}
onSelectValue={setSelFcltDiv}
value={selFcltDiv ?? fcltDiv[0]?.val}
/>
</SearchFormLeft>
<SearchFormRight>
<Button
className="mr-4 rounded-lg"
onClick={(e) => {
cellClick()
setIsDetail(!isDetail);
}}
>
조회
</Button>
<Button className="mr-4 rounded-lg" onClick={() => {}}>
삭제
</Button>
<Button className="mr-4 rounded-lg" onClick={() => {}}>
저장
</Button>
<Button className="mr-4 rounded-lg" onClick={() => {}}>
결과등록
</Button>
<Button className="mr-4 rounded-lg"
onClick={() => {
setIsExcel(!isDetail);
}}>
양식받기
</Button>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-6">
<ListDiv>
{selFcltDiv === "RNB" ? <RainChkgdTable /> : <RswtChkgdTable />}
</ListDiv>
</div>
</div>
<UiModal
open={isDetail}
onOpenChange={setIsDetail}
bodyClass={"w-[40vw] max-w-none"}
body={<ChkgdModal type={selFcltDiv} obj={testObj}></ChkgdModal>}
/>
<UiModal open={isExcel}
onOpenChange={setIsExcel}
bodyClass={"w-[40vw] max-w-none"}
body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>}
/>
</ContentsDiv>
);
}
-192
View File
@@ -1,192 +0,0 @@
import { getFectch } from "@/components/lib/api";
// Description: 공통코드
export type selectArray = {
text: string;
val: string | number;
};
export const yn :selectArray[]=[
{val:'Y', text:'Y'},
{val:'N', text:'N'},
]
//공통 건축물 용도
export const bdstUsgCd: selectArray[] = [
{ val: 1, text: "운동장" },
{ val: 2, text: "체육관" },
{ val: 3, text: "공공업무시설" },
{ val: 4, text: "공공기관의청사" },
{ val: 5, text: "아파트" },
{ val: 6, text: "연립주택" },
{ val: 7, text: "다세대주택" },
{ val: 8, text: "기숙사" },
{ val: 9, text: "초등학교" },
{ val: 10, text: "중학교" },
{ val: 11, text: "고등학교" },
{ val: 12, text: "전문대학" },
{ val: 13, text: "대학및대학교" },
{ val: 14, text: "골프장" },
{ val: 15, text: "대규모점포" },
{ val: 16, text: "기타" },
];
//빗물 집수면 종류 용도
export const rainFcltCd = [
{ val: "1", text: "지붕" },
{ val: "2", text: "건물옥상" },
{ val: "3", text: "골프장 연못" },
{ val: "4", text: "운동장 바닥" },
{ val: "5", text: "운동장 지붕" },
{ val: "6", text: "주차장" },
{ val: "7", text: "태양광패널" },
{ val: "8", text: "연못" },
{ val: "9", text: "기타" },
{ val: "10", text: "확인불가" },
];
// 중수도 필수 원수종류
export const rswtBdstType: selectArray[] = [
{ text: "숙박업", val: 17 },
{ text: "목욕장업", val: 18 },
{ text: "공장", val: 19 },
{ text: "발전시설", val: 20 },
{ text: "관광단지개발사업", val: 21 },
{ text: "도시개발사업", val: 22 },
{ text: "산업단지개발사업", val: 23 },
{ text: "택지개발사업", val: 24 },
{ text: "대규모점포(대형마트)", val: 25 },
{ text: "대규모점포(전문점)", val: 26 },
{ text: "대규모점포(백화점)", val: 27 },
{ text: "대규모점포(쇼핑센터)", val: 28 },
{ text: "대규모점포(복합쇼핑몰)", val: 29 },
{ text: "물류시설", val: 30 },
{ text: "운수시설(여객자동차터미널)", val: 31 },
{ text: "운수시설(철도시설)", val: 32 },
{ text: "운수시설(공항시설)", val: 33 },
{ text: "운수시설(항만시설)", val: 34 },
{ text: "업무시설(공공업무시설)", val: 35 },
{ text: "업무시설(금융업소)", val: 36 },
{ text: "업무시설(사무소)", val: 37 },
{ text: "업무시설(결혼상담소 등 소개업소)", val: 38 },
{ text: "업무시설(출판사)", val: 39 },
{ text: "업무시설(신문사)", val: 40 },
{ text: "업무시설(오피스텔)", val: 41 },
{ text: "교정시설", val: 42 },
{ text: "방송국", val: 43 },
{ text: "전신전화국", val: 44 },
{ text: "기타", val: 45 },
];
const orgwtKndCd = [
{ text: "오수(변기 오수 제외)", val: "1" },
{ text: "오수", val: "2" },
{ text: "폐수", val: "3" },
{ text: "오수 및 폐수", val: "4" },
{ text: "기타", val: "5" },
];
export const chBuCd = [
{ val: "증축", text: "증축" },
{ val: "개축", text: "개축" },
{ val: "재축", text: "재축" },
]
export type comCodeState = {
code: {
isInit: boolean;
chBuCd:selectArray[]
rainFcltCd: selectArray[];
bdstUsgCd: selectArray[];
cityCd: selectArray[];
sggCd: selectArray[];
orgwtKndCd:selectArray[];
yn:selectArray[];
};
};
export type comCodeType = comCodeState & comCodeActions;
export const getSggCd = async (set: any) => {
const sgg = await getFectch("common", "/addr/sgg");
const sggCd = sgg.map((item: any) => ({
val: Number(item.adstDstrCd),
text: item.gugun,
}));
set((state: comCodeState) => ({
code: {
...state.code,
sggCd: sggCd,
},
}));
};
export const getCityCd = async (set: any) => {
const city = await getFectch("common", "/addr/city");
const cityCd = city.map((item: any) => ({
val: Number(item.adstDstrCd),
text: item.sido,
}));
cityCd.unshift({val:0,text:'전체'})
set((state: comCodeState) => ({
code: {
...state.code,
cityCd: cityCd,
},
}));
};
export const comCodeStateExport: comCodeState = {
code: {
isInit: false,
rainFcltCd: rainFcltCd,
bdstUsgCd: bdstUsgCd,
chBuCd:chBuCd,
orgwtKndCd:orgwtKndCd,
cityCd: [],
sggCd: [],
yn:yn
},
};
export type comCodeActions = {
codeInit: () => void;
};
export const codeActionExport: (set: any) => comCodeActions = (set: any) => {
return {
codeInit: async () => {
const sgg = await getFectch("common", "/addr/sgg");
const sggCd = sgg.map((item: any) => ({
val: Number(item.adstDstrCd),
text: item.gugun,
}));
const city = await getFectch("common", "/addr/city");
const cityCd = city.map((item: any) => ({
val: Number(item.adstDstrCd),
text: item.sido,
}));
return set((state: comCodeState) => ({
code: {
...state.code,
sggCd: sggCd,
cityCd: cityCd,
},
}));
},
divCityCd: async(cd: number) => {
set((state: comCodeState) => ({
code: {
...state.code,
sggCd:state.code.sggCd.filter((item) => { return Number(item.val.toString().slice(0,2)) === cd }),
},
}));
},
};
};
-40
View File
@@ -1,40 +0,0 @@
import { type ReactNode, createContext, useContext, useRef } from 'react'
import { useStore } from 'zustand'
import { type WrStore, StoreZus } from './store'
export type StoreApi = ReturnType<typeof StoreZus>
export const StoreContext = createContext<StoreApi | undefined>(
undefined,
)
export interface StoreProviderProps {
children: ReactNode
}
export const StoreProvider = ({
children,
}: StoreProviderProps) => {
const storeRef = useRef<StoreApi>(null)
if (!storeRef.current) {
storeRef.current = StoreZus()
}
return (
<StoreContext.Provider value={storeRef.current}>
{children}
</StoreContext.Provider>
)
}
export const useWrStore = <T,>(
selector: (store: WrStore) => T,
): T => {
const storeContext = useContext(StoreContext)
if (!storeContext) {
throw new Error(`useStore must be used within StoreProvider`)
}
return useStore(storeContext, selector)
}
-55
View File
@@ -1,55 +0,0 @@
import type { selectArray } from "../ruseFcltMng/fcltReg/rainReg";
const selectSido = [
{ text: '서울', val: "1" },
{ text: "인천", val: "2" },
{ text: "부산", val: "3" },
];
const selectSgg = [
{ text: '종로구', val: "1" },
{ text: "성북구", val: "2" },
{ text: "강남구", val: "3" },
];
const selectUsg = [
{ text: '민간', val: "1" },
{ text: "공공", val: "2" },
];
const selectYN= [
{ text: 'Y', val: "1" },
{ text: 'N', val: "2" },
];
export type matDmdState ={ dmd:{
isInit: boolean;
selectSido:selectArray[];
selectSgg:selectArray[];
selectUsg:selectArray[];
selectYN:selectArray[];
}}
type matDmdActions = {
decrementList: () => void
}
export type matDmdType = matDmdState & matDmdActions;
export const matDmdStateExport:matDmdState= {dmd:{
isInit:false,
selectSido:selectSido,
selectSgg: selectSgg,
selectUsg: selectUsg,
selectYN:selectYN,
}}
export const matDmdActionsExport:(set:any)=>matDmdActions=(set: any) => {
return {
decrementList:()=>set(
(state:matDmdState) => {
return (
{rain:{
}})}
)
}
}
@@ -1,232 +0,0 @@
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import type { text } from "stream/consumers";
import { z } from "zod";
export const rainRegExcel =z.object({
bdstInfoPk:z.number().default(111111111),
chckYmd:z.date().default(new Date()),
file: z.instanceof(File).optional()
})
export const fcltDiv=[
{val:'RST', text:'중수도시설'},
{val:'RNB', text:'빗물이용시설'},
]
export type chHeadType={
headNm: string;
text: string;
length: number;
}
export const rainHeadNm:chHeadType[] = [
{headNm:"useQuilty", text:"이용수질(필요시)" , length: 4},
{headNm:"feeHist", text:"과태료 부과내역" , length: 3},
{headNm:"subWater", text:"연간보급수 이용량(m³)" , length: 13},
{headNm:"detailQulity", text:"분기" , length: 11}
]
export const rainChkgdnHeadList:TableUpperProps[] = [
{ id: "cityText", title: "시도" },
{ id: "sggText", title: "시군구" },
{ id: "bdstNm", title: "시설명" },
{ id: "operMngCd", title: "운영관리형태" },
{ id: "flowCheck", title: "유량측정방법" },
{ id: "yearFee", title: "연간운영비(원/년)" },
{ id: "rainDtnbaOpct", title: "빗물저류조용량(m³)" },
{ id: "checkDay", title: "점검일" },
{ id: "utztnUsg", title: "이용용도" },
{ id: "splyUswtrUtztnQnt", title: "연간보급수이용량(m³)" },
{ id: "rainUsg", title: "연간빗물이용량(m³)" },
{ id: "ph", title: "PH", upName: "useQuilty", upSequnce: 1 },
{ id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 2 },
{ id: "grssClfg", title: "총대장균군수", upName: "useQuilty", upSequnce: 3 },
{ id: "etc", title: "기타", upName: "useQuilty", upSequnce: 4 },
{ id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
{ id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
{ id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
];
export const supWaterHeadList:TableUpperProps[] = [
{ id: "utztnUsgTest", title: "이용용도" },
{ id: "total", title: "계" ,upName: "subWater", upSequnce: 1 , edit:true},
{ id: "sub1", title: "1월" , upName: "subWater", upSequnce: 2 , edit:true},
{ id: "sub2", title: "2월", upName: "subWater", upSequnce: 3 , edit:true},
{ id: "sub3", title: "3월", upName: "subWater", upSequnce: 4 , edit:true},
{ id: "sub4", title: "4월", upName: "subWater", upSequnce: 5 , edit:true},
{ id: "sub5", title: "5월", upName: "subWater", upSequnce: 6 , edit:true},
{ id: "sub6", title: "6월", upName: "subWater", upSequnce: 7 , edit:true},
{ id: "sub7", title: "7월", upName: "subWater", upSequnce: 8 , edit:true},
{ id: "sub8", title: "8월", upName: "subWater", upSequnce: 9 , edit:true},
{ id: "sub9", title: "9월", upName: "subWater", upSequnce: 10, edit:true },
{ id: "sub10", title: "10월", upName: "subWater", upSequnce: 11 , edit:true},
{ id: "sub11", title: "11월", upName: "subWater", upSequnce: 12 , edit:true},
{ id: "sub12", title: "12월", upName: "subWater", upSequnce: 13 , edit:true},
]
export const rswtDetailHeadList:TableUpperProps[] = [
{ id: "utztnUsgTest", title: "이용용도" },
{ id: "avre", title: "평균" ,upName: "detailQulity", upSequnce: 1 , edit:true},
{ id: "grssClfg", title: "총대장균군수" , upName: "detailQulity", upSequnce: 2 , edit:true},
{ id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3 , edit:true},
{ id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4 , edit:true},
{ id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5 , edit:true},
{ id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6 , edit:true},
{ id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7 , edit:true},
{ id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8 , edit:true},
{ id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 , edit:true},
{ id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10, edit:true },
{ id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11 , edit:true},
]
export const supWaterData =[{
utztnUsgTest:'test',
total:100,
sub1:10,
sub2:10,
sub3:10,
sub4:10,
sub5:10,
sub6:10,
sub7:10,
sub8:10,
sub9:10,
sub10:10,
sub11:10,
sub12:10,
},
{
utztnUsgTest:'test22',
total:10011,
sub1:101,
sub2:101,
sub3:101,
sub4:101,
sub5:101,
sub6:101,
sub7:101,
sub8:101,
sub9:101,
sub10:101,
sub11:101,
sub12:101,
}
]
type supWaterDataType ={
utztnUsgTest:string,
total:number,
sub1:number,
sub2:number,
sub3:number,
sub4:number,
sub5:number,
sub6:number,
sub7:number,
sub8:number,
sub9:number,
sub10:number,
sub11:number,
sub12:number,
}
// export const rainChkgdnHeadList:TableUpperProps[] = [
// { id: "cityText", title: "시도" },
// { id: "sggText", title: "시군구" },
// { id: "bdstNm", title: "시설명" },
// { id: "operMngCd", title: "운영관리형태" },
// { id: "flowCheck", title: "유량측정방법" },
// { id: "yearFee", title: "연간운영비(원/년)" },
// { id: "rainDtnbaOpct", title: "빗물저류조용량(m³)" },
// { id: "checkDay", title: "점검일" },
// { id: "utztnUsg", title: "이용용도" },
// { id: "sub1", title: "1월" , upName: "subWater", upSequnce: 1 },
// { id: "sub2", title: "2월", upName: "subWater", upSequnce: 2 },
// { id: "sub3", title: "3월", upName: "subWater", upSequnce: 3 },
// { id: "sub4", title: "4월", upName: "subWater", upSequnce: 4 },
// { id: "sub5", title: "5월", upName: "subWater", upSequnce: 5 },
// { id: "sub6", title: "6월", upName: "subWater", upSequnce: 6 },
// { id: "sub7", title: "7월", upName: "subWater", upSequnce: 7 },
// { id: "sub8", title: "8월", upName: "subWater", upSequnce: 8 },
// { id: "sub9", title: "9월", upName: "subWater", upSequnce: 9 },
// { id: "sub10", title: "10월", upName: "subWater", upSequnce: 10 },
// { id: "sub11", title: "11월", upName: "subWater", upSequnce: 11 },
// { id: "sub12", title: "12월", upName: "subWater", upSequnce: 12 },
// { id: "rain1", title: "1월", upName: "yearRainWater", upSequnce: 1 },
// { id: "rain2", title: "2월", upName: "yearRainWater", upSequnce: 2 },
// { id: "rain3", title: "3월", upName: "yearRainWater", upSequnce: 3 },
// { id: "rain4", title: "4월", upName: "yearRainWater", upSequnce: 4 },
// { id: "rain5", title: "5월", upName: "yearRainWater", upSequnce: 5 },
// { id: "rain6", title: "6월", upName: "yearRainWater", upSequnce: 6 },
// { id: "rain7", title: "7월", upName: "yearRainWater", upSequnce: 7 },
// { id: "rain8", title: "8월", upName: "yearRainWater", upSequnce: 8 },
// { id: "rain9", title: "9월", upName: "yearRainWater", upSequnce: 9 },
// { id: "rain10", title: "10월", upName: "yearRainWater", upSequnce: 10 },
// { id: "rain11", title: "11월", upName: "yearRainWater", upSequnce: 11 },
// { id: "rain12", title: "12월", upName: "yearRainWater", upSequnce: 12 },
// { id: "ph", title: "PH", upName: "useQuilty", upSequnce: 1 },
// { id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 2 },
// { id: "grssClfg", title: "총대장균군수", upName: "useQuilty", upSequnce: 3 },
// { id: "etc", title: "기타", upName: "useQuilty", upSequnce: 4 },
// { id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
// { id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
// { id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
// ];
export type rainChkgdnState = {
rainChkgdn: {
rainChkgdnHeadList:TableUpperProps[]
rainHeadNm:chHeadType[]
supWaterHeadList:TableUpperProps[]
supWaterData:supWaterDataType[]
rswtDetailHeadList:TableUpperProps[]
};
};
type rainChkgdnActions = {
rainChkgdnInit: (sggCd:string, searchTxt:string, flag:string) => void ;
};
export type rainChkgdnType = rainChkgdnState & rainChkgdnActions;
export const rainChkgdnStateExport: rainChkgdnState = {
rainChkgdn: {
rainChkgdnHeadList:rainChkgdnHeadList,
rainHeadNm:rainHeadNm,
supWaterHeadList:supWaterHeadList,
supWaterData:supWaterData,
rswtDetailHeadList:rswtDetailHeadList,
},
};
export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
set: any
) => {
return {
rainChkgdnInit: async(sggCd:string, searchTxt:string ,flg:string ) =>{
},
};
};
@@ -1,72 +0,0 @@
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import type { chHeadType } from "../rainChkgdn";
export const rswtHeadNm:chHeadType[] = [
{headNm:"useQuilty", text:"연간 평균 이용수질" , length: 10},
{headNm:"feeHist", text:"과태료 부과내역" , length: 3},
]
export const rswtChkgdnHeadList: TableUpperProps[] = [
{ id: "cityText", title: "시도" },
{ id: "sggText", title: "시군구" },
{ id: "bdstNm", title: "시설명" },
{ id: "operMngCd", title: "운영관리형태" },
{ id: "yearFee", title: "연간운영비(원/년)" },
{ id: "rainDtnbaOpct", title: "처리용량(m³)" },
{ id: "checkDay", title: "점검일" },
{id: "checkPoint", title: "채수지점"},
{ id: "utztnUsg", title: "이용용도" },
{ id: "splyUswtrUtztnQnt", title: "연간보급수이용량(m³)" },
{ id: "rswtUsg", title: "연간중수도이용량(m³)" },
{ id: "grssClfgUswtr", title: "총대장균군수", upName: "useQuilty", upSequnce: 1 },
{ id: "combResdch", title: "결합잔류염소", upName: "useQuilty", upSequnce: 2 },
{ id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 3 },
{ id: "bod", title: "BOD", upName: "useQuilty", upSequnce: 4 },
{ id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5 },
{ id: "crmty", title: "색도", upName: "useQuilty", upSequnce: 6 },
{ id: "tn", title: "T-N", upName: "useQuilty", upSequnce: 7 },
{ id: "tph", title: "T-P", upName: "useQuilty", upSequnce: 8 },
{ id: "ph", title: "PH", upName: "useQuilty", upSequnce: 9 },
{ id: "clIonQnt", title: "염화물", upName: "useQuilty", upSequnce: 10 },
{ id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
{ id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
{ id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
];
export type rswtChkgdnState = {
rswtChkgdn: {
rswtChkgdnHeadList: TableUpperProps[];
rswtHeadNm:chHeadType[];
};
};
type rswtChkgdnActions = {
rswtChkgdnInit: (sggCd: string, searchTxt: string, flag: string) => void;
};
export type rswtChkgdnType = rswtChkgdnState & rswtChkgdnActions;
export const rswtChkgdnStateExport: rswtChkgdnState = {
rswtChkgdn: {
rswtChkgdnHeadList: rswtChkgdnHeadList,
rswtHeadNm:rswtHeadNm
},
};
export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
set: any
) => {
return {
rswtChkgdnInit: async (sggCd: string, searchTxt: string, flg: string) => {
},
};
};
-121
View File
@@ -1,121 +0,0 @@
# Zustand store
## Zustand 등록방법
**-- index.tsx --**
### context 등록
기본적으로 createContext를 통해 react에 context를 생성해서 react에서 사용할 수 있도록 해야함.
``` js
//StoreZus는 내부적으로 사용하기 위한 store파일에서 따로 생성함.
export type StoreApi = ReturnType<typeof StoreZus>
//react에서 사용하기 위한 context 생성.
export const StoreContext = createContext<StoreApi | undefined>(
undefined,
)
```
### component로 작성
등록된 context를 component화 시키기 위한 작업
```js
//외부에서 호출시 <StoreProvider> 형태로 호출.
//app이나 home에서 전체적인 사용이 되도록 작성해야함.
export const StoreProvider = ({
children,
}: StoreProviderProps) => {
const storeRef = useRef<StoreApi>(null)
if (!storeRef.current) {
//StoreZus는 store.tsx를 봐야함.
storeRef.current = StoreZus()
}
return (
<StoreContext.Provider value={storeRef.current}>
{children}
</StoreContext.Provider>
)
}
```
### store 등록
react에서 사용하는 store에 현재 context 등록
```js
export const useWrStore = <T,>(
selector: (store: WrStore) => T,
): T => {
const storeContext = useContext(StoreContext)
if (!storeContext) {
throw new Error(`useStore must be used within StoreProvider`)
}
return useStore(storeContext, selector)
}
```
## Zustand 사용방법
**-- store.tsx, 폴더별 index.tsx --**
### 기본 store 생성
index.tsx의 context에 사용되는 StoreZus를 추가하여 사용됨.
외부에서 생성된 state, actions를 사용 가능한 구조
```js
import { createStore } from 'zustand/vanilla';
import { tableActionsExport, tableStateExport, type tableState, type tableType } from './publicReuseFaciltyInsert/index';//외부 파일 위치.
export type WrStore = tableType;//typescript이므로 사용되는 스크립트를 type1 & type2 형식으로 넣어야함.
//index.tsx에서 사용하는 store 생성.
export const StoreZus = (initState: tableState = tableStateExport) => {
return createStore<WrStore>()((set) => {
return {
//아래에서 사용하는 state & actions은 외부 폴더에서 가져다가 사용.
...initState,//외부에 있는 기본 초기값 state
...tableActionsExport(set)//외부에 있는 actions
}
})
}
```
### 외부 스토어 작성 방법
외부 스토어는 export를 어떻게 할건지만 정하면됨.
사용하는 store.tsx에서 import를 받기만 하면 사용가능.
#### 타입을 외부로 빼는 방법
```js
export type tableState = {
isInit: boolean;
upHeadList: TableUpperProps[];
publicReuseFacilityUper: PublicReuseFacility[];
}
type tableActions = {
decrementList: () => void
}
export type tableType = tableState & tableActions;
```
#### 초기값 state를 외부로 빼는 방법
```js
export const tableStateExport:tableState= {
isInit:false,
upHeadList: upHeadList,
publicReuseFacilityUper: publicReuseFacilityUper,
}
```
#### actions를 외부로 빼는 방법
```js
//tableActionsExport를 import 받아서 실행하여 return 된 값을 사용
export const tableActionsExport:(set:any)=>tableActions=
//set을 통해 react store에 등록
(set: any) => {
return {
//decrementList Object 형태로 전달
decrementList:
//set 함수를 실행해서 react store에 등록
()=>set(
// store에 등록되는 함수 구조를 가지고 있음.
(state:tableState) => {
//actions 실질적인 로직 작성하는 곳.
return (
{
upHeadList: state.upHeadList,
publicReuseFacilityUper:
state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1)
})}
)
}
}
```
@@ -1,98 +0,0 @@
import { getFectch } from "@/components/lib/api";
import type { bdstAll } from "../rainReg";
import type { TableProps } from "../pbnstReg";
type TableUpperProps = {
id: string;
title: string;
upName?: string;
upSequnce?: number;
};
const moUpHeadList: TableUpperProps[] = [
{ id: "cityText", title: "시도" },
{ id: "sggText", title: "시군구" },
{ id: "bdstNm", title: "시설명" },
{ id: "daddr", title: "위치" },
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
{ id: "archArea", title: "건축면적", },
{ id: "archChgYn", title: "여부", upName: "upChangeRe", upSequnce: 1 },
{ id: "archChgPrmsnDt", title: "허가일", upName: "upChangeRe", upSequnce: 2 },
{ id: "archChgArea", title: "면적", upName: "upChangeRe", upSequnce: 3 },
];
const bdstChgHeadList: TableProps[] = [
{ id: "bdstChgNm", title: "구분" },
{ id: "archChgPrmsnDt", title: "허가일" },
{ id: "archChgArea", title: "변경면적" },
];
const bdstBase: bdstAll[] = [];
export type bdstFulType = bdstState & bdstActions;
export type bdstState = {
bdst: {
bdstBase: any[];
moUpHeadList:TableUpperProps[]
bdstChgHeadList:TableProps[]
};
};
type bdstActions = {
findBdst: (sggCd:string, searchTxt:string, flag:string) => void ;
};
const findBdstInfo = async(sggCd:string, searchTxt:string ,flg:string)=>{
return await getFectch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' ))
}
export const bdstStateExport: bdstState = {
bdst: {
bdstBase: bdstBase, // Updated to match the array type
moUpHeadList:moUpHeadList,
bdstChgHeadList:bdstChgHeadList,
},
};
export const bdstActionsExport: (set: any) => bdstActions = (
set: any
) => {
return {
findBdst: async(sggCd:string, searchTxt:string ,flg:string ) =>{
try{
const bdst = await findBdstInfo(sggCd, searchTxt, flg);
const makeBdst = bdst.map((item:any) => {
return {
...item,
reuseBuilding:[]
};
})
return set((state:bdstState) =>({
...state,
bdst:{
...state.bdst,
bdstBase:makeBdst
}
}))
}catch(error1){
console.log("error ", error1)
}finally{
}
},
};
};
@@ -1,271 +0,0 @@
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
import { z } from "zod";
export const hdtflZod = z.object({
bdstInfoPk: z.number().nullish(),
ctpvCd: z.number().default(0),
sggCd: z.number().default(0),
daddr: z.string().default(" "),
bdstNm: z.string().default(" "),
frstArchPrmsnDt: z.date().default(() => new Date()),
archChgPrmsnDt: z.date().default(() => new Date()).nullish() ,
archArea: z.number().default(0),
archChgArea: z.number().nullish().default(0),
reuseBuilding: z
.array(
z.object({
bdstRuseFcltPk: z.number().nullish(),
bdstInfoFk: z.number().nullish(),
instlCmptnDt: z.coerce.date().default(() => new Date()),
instlCst: z.number().nullish().default(0),
operMngCd: z.string().nullish().default(""),
anlOperCst: z.number().default(0),
instlCstSprtYn: z.string().default(""),
instlCstSprtAmt: z.number().nullish().default(0),
grntchBdstCertYn: z.string().default(""),
grntchBdstCertYr: z
.string()
.nullish(),
grntchBdstCertNo: z.string().nullish().default(""),
grntchBdstCertGrd: z.string().nullish().default(""),
crgRdctYn: z.string().default(""),
crgRdctBss: z.string().nullish().default(""),
crgRdctAmt: z.number().nullish().default(0),
ruseFcltFlg: z.string().nullish().default(""),
bdstUsgCd: z.number().default(0),
lawTrgtYn: z.string().default(""),
// htdflObj 매핑
htdflObj: z
.object({
htdflFcltPk: z.number().nullish(),
bdstRuseFcltFk: z.number().nullish(),
etgtType: z.string().default(""),
fclCpct: z.number().default(0),
plwtYn: z.string().default(""),
orgwtWtritSpt: z.number().default(0),
orgwtOcrnProcs: z.string().default(""),
wtritEntrcTp: z.number().max(4, "온도는 100이상이 될 수 없습니다.")
.default(0),
amtgnr: z.number().default(0),
prcsProcsYn: z.string().default(""),
prcsFcltCpct: z.number().default(0),
fmYn: z.string().default(""),
utztnCpct: z.number().default(0),
utztnUsg: z.string().default(""),
grssClfg: z.number().default(0),
combResdch: z.number().default(0),
trbt: z.number().default(0),
bod: z.number().default(0),
smll: z.number().default(0),
crmty: z.number().default(0),
tn: z.number().default(0),
tph: z.number().default(0),
ph: z.number().default(0),
clIonQnt: z.number().default(0),
cdtnv: z.number().default(0),
emsnExitTp: z.number().default(0),
})
.default({}),
})
)
.default([]),
chgBuilding: z
.array(
z.object({
bdstInfoFk: z.number().nullish(),
archChgPrmsnDt: z.coerce.date() ,
archChgArea: z.string().default("-"),
bdstChgNm: z.string().default(""),
})
)
.default([]),
});
export type customHtdflBdst = Omit<bdstAll, 'reuseBuilding'> & {
reuseBuilding: htdflReuseBuilding[];
};
//export type customHtdflBdst = z.infer<typeof hdtflZod>;
// 타입을 조드로 만들어가 하는ㅓㄹ로 테트
export type htdflReuseBuilding = {
bdstRuseFcltPk: number | undefined;
bdstInfoFk: number | undefined;
instlCmptnDt: Date | undefined;
instlCst: number | undefined;
operMngCd: string;
anlOperCst: number | undefined;
instlCstSprtYn: string | undefined;
instlCstSprtAmt: number | undefined;
grntchBdstCertYn: string | undefined;
grntchBdstCertYr: string | undefined;
grntchBdstCertNo: string | undefined;
grntchBdstCertGrd: string | undefined;
crgRdctYn: string;
crgRdctBss: string | undefined;
crgRdctAmt: number | undefined;
ruseFcltFlg: string;
bdstUsgCd: number | undefined;
lawTrgtYn: string;
htdflObj: htdflObj;
};
export type htdflObj = {
htdflFcltPk: number;
bdstRuseFcltFk: number;
etgtType: string;
fclCpct: number | undefined;
plwtYn: string;
orgwtWtritSpt: number | undefined;
orgwtOcrnProcs: string;
wtritEntrcTp: number | undefined;
amtgnr: number | undefined;
prcsProcsYn: string;
prcsFcltCpct: number | undefined;
fmYn: string;
utztnCpct: number | undefined;
utztnUsg: string;
grssClfg: number | undefined;
combResdch: number | undefined;
trbt: number | undefined;
bod: number | undefined;
smll: number | undefined;
crmty: number | undefined;
tn: number | undefined;
tph: number | undefined;
ph: number | undefined;
clIonQnt: number | undefined;
cdtnv: number | undefined;
emsnExitTp: number | undefined;
};
export type htdflFacState = {
htdfl: {
isInit: boolean;
upHeadList: TableUpperProps[];
htdflRes: customHtdflBdst[];
};
};
type htdflFacSActions = {
initHtdfl: (txt: string | undefined) => void;
htdflUpdate:(data: customHtdflBdst) => void;
htdflReg:(data: customHtdflBdst) => void;
};
const htdflRes: customHtdflBdst[] = [];
export type htdflFacType = htdflFacState & htdflFacSActions;
export const htdflFacStateExport: htdflFacState = {
htdfl: {
isInit: false,
upHeadList: upHeadList,
htdflRes: htdflRes,
},
};
const initFetch = async (txt: string | undefined) => {
const htdflRes = await getFectch(
"wr",
`/drain/facilityList/1/20/0` + (txt ? `/${txt}` : "")
);
const chHtdflRes = htdflRes.map((item: customHtdflBdst) => {
return {
...item,
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
};
});
return chHtdflRes;
};
export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
set: any
) => {
return {
initHtdfl: async (txt: string | undefined) => {
try {
const htdflRes = await initFetch(txt);
set((state: htdflFacState) => {
return {
...state,
htdfl: {
...state.htdfl,
htdflRes: htdflRes,
isInit: false,
},
};
});
} catch (error) {
console.log(error);
}
},
htdflUpdate: async (data: customHtdflBdst) => {
try {
const res = await putFectch("/drain/facility", data);
if (res.ok) {
alert(" 수정이 완료되었습니다.");
}
const htdflRes = await initFetch(undefined);
set((state: htdflFacState) => ({
...state,
htdfl: {
...state.htdfl,
htdflRes: htdflRes,
isInit: false,
},
}));
} catch (errorUpdate) {
alert(
"업데이트 오류입니다. " +
(errorUpdate instanceof Error ? errorUpdate.message : "")
);
}
},
htdflReg: async (data: customHtdflBdst) => {
try {
const res = await postFectch("/drain/facility", data);
if (res.ok) {
if(data.chgBuilding.length > 0){
await res
.json()
.then((resData: any) => {
const chPK = resData?.data?.bdstInfoPk;
const makeCh = resData.data.chgBuilding.map(
(item: chgBuilding) => ({
...item,
bdstInfoFk: chPK,
})
);
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
return chch;
})
.then((chch: any) => {
if (chch.ok) {
alert("등록이 완료되었습니다.");
}
});
}else{
alert("등록이 완료되었습니다.");
}
}
const htdflRes = await initFetch(undefined);
set((state: htdflFacState) => ({
...state,
htdfl: {
...state.htdfl,
htdflRes: htdflRes,
isInit: false,
},
}));
} catch (errorReg) {
alert("등록 오류입니다.");
}
},
};
};
@@ -1,258 +0,0 @@
import type { TableUpperProps } from "../rainReg";
export type TableProps = {
id: string;
title: string;
};
export type selectLabel = {
text: string;
val: string;
};
export type publicReuseFacilityType = {
sido: string;
sigungo: string;
facilityName: string;
location: string;
locationgubun: string;
facilityCapacity: string;
yn?: string;
authoDay?: string;
area?: string;
reuse?: string;
register?: string;
swtrmtFcltFk: string;
};
export type fcltOperInfoType = {
mng: string;
subCo: string;
startDay: string;
endDay: string;
pbnstRuseFcltPk: string;
};
export type ruseFcltType = {
swtrmtFcltFk: string;
pbnstRuseFcltPk:string;
fcltNm:string;
fcltCpct: number;
swtrmtCpct: number;
ruseCpct:number;
splyExtraCpct:number;
};
const selectLabel: selectLabel[] = [{ text: "test", val: "1" }];
const pubFacHeadList: TableProps[] = [
{ id: "sido", title: "시도" },
{ id: "sigungo", title: "시군구" },
{ id: "facilityName", title: "시설명" },
{ id: "location", title: "위치" },
{ id: "locationgubun", title: "지역구분" },
{ id: "facilityCapacity", title: "시설용량" },
{ id: "yn", title: "재이용여부" },
{ id: "authoDay", title: "등록여부" },
];
const ruseFclt: ruseFcltType[] = [
{ swtrmtFcltFk: "a", fcltCpct: 1000000, swtrmtCpct: 1000000 ,pbnstRuseFcltPk:'aa',fcltNm:'하수1',ruseCpct: 1, splyExtraCpct: 2 },
{ swtrmtFcltFk: "a", fcltCpct: 1300000, swtrmtCpct: 1300000 ,pbnstRuseFcltPk:'ab',fcltNm:'하수2',ruseCpct: 3, splyExtraCpct: 4 },
{ swtrmtFcltFk: "b", fcltCpct: 2000000, swtrmtCpct: 2000000 ,pbnstRuseFcltPk:'bb',fcltNm:'재이용1',ruseCpct: 1, splyExtraCpct: 2 },
{ swtrmtFcltFk: "b", fcltCpct: 2300000, swtrmtCpct: 2300000 ,pbnstRuseFcltPk:'ba',fcltNm:'재이용2' ,ruseCpct: 3, splyExtraCpct: 4 },
];
const pubMngUpHeadList: TableUpperProps[] = [
{ id: "mng", title: "운영방식" },
{ id: "subCo", title: "대행업체" },
{ id: "startDay", title: "시작일", upName: "upChangeRe", upSequnce: 1 },
{ id: "endDay", title: "종료일", upName: "upChangeRe", upSequnce: 2 },
];
const date = new Date();
const fcltOperInfo: fcltOperInfoType[] = [
{
mng: "자체운영",
subCo: "-",
startDay: "2024-11-11",
endDay: "2024-11-20",
pbnstRuseFcltPk: "aa",
},
{
mng: "자체운영",
subCo: "한국수자원공사",
startDay: "2022-11-11",
endDay: "2024-09-13",
pbnstRuseFcltPk: "aa",
},
{
mng: "자체운영",
subCo: "스타벅스",
startDay: "2023-11-11",
endDay: "2024-02-19",
pbnstRuseFcltPk: "bb",
},
];
const publicReuseFacilityData: publicReuseFacilityType[] = [
{
sido: "서울",
sigungo: "강남구",
facilityName: "난지",
location: "경기도 고양시 덕양구 대차로 4가",
locationgubun: "500",
facilityCapacity: "800,000",
reuse: "Y",
register: "Y",
swtrmtFcltFk: "a",
},
{
sido: "서울",
sigungo: "강남구",
facilityName: "여의도 중앙",
location: "경기도 고양시 덕양구 대차로 4가",
locationgubun: "500",
facilityCapacity: "800,000",
reuse: "Y",
register: "Y",
swtrmtFcltFk: "b",
},
{
sido: "서울",
sigungo: "강남구",
facilityName: "너의 마음속",
location: "경기도 고양시 덕양구 대차로 4가",
locationgubun: "500",
facilityCapacity: "800,000",
yn: "Y",
authoDay: "2012",
area: "123",
swtrmtFcltFk: "c",
},
];
const erctUswtrCd: selectLabel[] = [
{ text: "처리장연계", val: "1_erct" },
{ text: "자체/연계", val: "2_erct" },
{ text: "자체처리", val: "3_erct" },
];
const cyclCd: selectLabel[] = [
{ text: "1차", val: "1_cyc" },
{ text: "2차", val: "2_cyc" },
];
const seCd: selectLabel[] = [
{ text: "신규", val: "1_Se" },
{ text: "진행", val: "2_Se" },
];
const buseCd: selectLabel[] = [
{ text: "재정", val: "1_bus" },
{ text: "만루", val: "2_bus" },
];
const rprcsCd: selectLabel[] = [
{ text: "물리적처리", val: "1_rprc" },
{ text: "생물학적처리", val: "2_rprc" },
];
const buseMet: selectLabel[] = [
{ text: "재정", val: "1_busemet" },
{ text: "민간투자", val: "2_busemet" },
{ text: "자체", val: "3_busemet" },
];
const rprcLoCd: selectLabel[] = [
{ text: "내부", val: "1_rprc" },
{ text: "외부", val: "2_rprc" },
];
export type pubFacState = {
pubFac: {
isInit: boolean;
pubFacHeadList: TableProps[];
pubMngUpHeadList: TableUpperProps[];
publicReuseFacilityData: publicReuseFacilityType[];
selectLabel: selectLabel[];
erctUswtrCd: selectLabel[];
cyclCd: selectLabel[];
seCd: selectLabel[];
buseCd: selectLabel[];
rprcsCd: selectLabel[];
buseMet: selectLabel[];
rprcLoCd: selectLabel[];
ruseFclt:ruseFcltType[];
};
pubMng:{
//isInit:boolean;
fcltOperInfo: fcltOperInfoType[];
ruseFclt:ruseFcltType[];
}
};
type pubFacActions = {
decrementList: () => void;
mngMainValue:(swtrmtFcltFk:string)=> void;
mngTableValue:(swtrmtFcltFk:string)=> void;
};
export type pubFacType = pubFacState & pubFacActions;
export const pubFacStateExport: pubFacState = {
pubFac: {
isInit: false,
pubFacHeadList: pubFacHeadList,
pubMngUpHeadList: pubMngUpHeadList,
publicReuseFacilityData: publicReuseFacilityData,
selectLabel: selectLabel,
erctUswtrCd: erctUswtrCd,
cyclCd: cyclCd,
seCd: seCd,
buseCd: buseCd,
rprcsCd: rprcsCd,
buseMet: buseMet,
rprcLoCd: rprcLoCd,
ruseFclt:ruseFclt,
},
pubMng:{
// isInit: false,
fcltOperInfo: fcltOperInfo,
ruseFclt:ruseFclt
}
};
export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => {
return {
decrementList: () =>
set((state: pubFacState) => {
return {
pubFac: {
pubFacheadList: state.pubFac.pubFacHeadList,
publicReuseFacilityUper: state.pubFac.publicReuseFacilityData.slice(
0,
state.pubFac.publicReuseFacilityData.length - 1
),
},
};
}),
mngMainValue:(swtrmtFcltFk:string)=>
set((state:pubFacState)=>{
return{
pubMng:{
...state.pubMng,
ruseFclt:state.pubMng.ruseFclt.filter((item)=>
item.swtrmtFcltFk===swtrmtFcltFk
)
}
}
}),
mngTableValue:(pbnstRuseFcltPk:string)=>
set((state:pubFacState)=>{
return{
pubMng:{
...state.pubMng,
fcltOperInfo:state.pubMng.fcltOperInfo.filter((item)=>item.pbnstRuseFcltPk===pbnstRuseFcltPk)
}
}
})
};
};
@@ -1,363 +0,0 @@
import type { selectArray } from "@/app/store/common/code";
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
export const rainZod = z.object({
bdstInfoPk: z.number().nullish(),
ctpvCd: z.number().default(0),
sggCd: z.number().default(0),
daddr: z.string().default(""),
bdstNm: z.string().default(""),
frstArchPrmsnDt: z.date().default(() => new Date()),
archChgPrmsnDt: z.coerce.date().nullish().default(null),
archArea: z.number().default(0),
archChgArea: z.number().default(0),
reuseBuilding: z.array(
z.object({
bdstRuseFcltPk: z.number().nullish(),
bdstInfoFk:z.number().nullish(),
instlCmptnDt: z.coerce.date().default(() => new Date()),
instlCst: z.number().default(0),
operMngCd: z.string().nullish().default(""),
anlOperCst: z.number().default(0),
instlCstSprtYn: z.string().default(""),
instlCstSprtAmt: z.number().default(0),
grntchBdstCertYn: z.string().default(""),
grntchBdstCertYr: z.string()
.max(4, "4자리 연도를 입력하세요")
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
.default(""),
grntchBdstCertNo: z.string().default(""),
grntchBdstCertGrd: z.string().default(""),
crgRdctYn: z.string().default("").nullish(),
crgRdctBss: z.string().default("").nullish(),
crgRdctAmt: z.number().default(0),
ruseFcltFlg: z.string().default(""),
bdstUsgCd: z.number().default(0),
lawTrgtYn: z.string().default(""),
rainyObj: z.object({
bdstReuseFcltFk: z.number().nullish(),
pntfColKnd: z.string().default(""),
pntfColArea: z.number().default(0),
dtfcltCpct: z.number().default(0),
filtrTrtmfctCpct: z.number().default(0),
filtrTrtmfctYn: z.string().default(""),
filtrTrtmfctPrs: z.string().default(""),
annRnwtQty: z.number().default(0),
oilqMeasMthd: z.string().default("").nullish()
}).default({})
})
).default([]),
chgBuilding: z.array(
z.object({
bdstInfoFk: z.number().nullish(),
archChgPrmsnDt: z.coerce.date(),
archChgArea: z.string().default("-"),
bdstChgNm: z.string().default(""),
})
).default([])
});
export type chgBuilding={
bdstInfoFk: number|null,
archChgPrmsnDt: Date,
archChgArea: string,
bdstChgNm: string
}
export type bdstAll = {
bdstInfoPk: number|null;
ctpvCd: number;
sggCd: number;
bdstNm: string;
daddr: string;
frstArchPrmsnDt: Date;
archArea: string;
archChgArea: number;
reuseBuilding: rainReuseBuilding[];
chgBuilding:chgBuilding[]
};
export type customRainBdst = Omit<bdstAll, 'reuseBuilding'> & {
reuseBuilding: rainReuseBuilding[];
};
export type rainReuseBuilding = {
lawTrgtYn: string|undefined;
bdstUsgCd: number|undefined;
bdstRuseFcltPk: number;
bdstInfoFk: number;
operMngCd: number;
anlOperCst: number;
instlCmptnDt: Date|undefined;
instlCst: number|undefined;
//archChgPrmsnDt: string;
instlCstSprtYn: string|undefined;
instlCstSprtAmt: number|undefined;
grntchBdstCertYn: string|undefined;
grntchBdstCertNo: string|undefined;
grntchBdstCertGrd: string|undefined;
grntchBdstCertYr: string|undefined;
rainyObj: rainyObj | null;
};
export type rainyObj = {
bdstReuseFcltFk: number;
pntfColKnd: string | undefined;
pntfColArea: number | undefined;
dtfcltCpct: number;
filtrTrtmfctCpct: number | undefined;
filtrTrtmfctYn: string | undefined;
filtrTrtmfctPrs: string | undefined;
annRnwtQty: number;
oilqMeasMthd: string | undefined;
};
export type TableUpperProps = {
id: string;
title: string;
upName?: string;
upSequnce?: number;
edit?:boolean;
visible?:boolean;
};
export const upHeadList: TableUpperProps[] = [
{ id: "cityText", title: "시도" },
{ id: "sggText", title: "시군구" },
{ id: "bdstNm", title: "시설명" },
{ id: "daddr", title: "위치" },
{ id: "bdsgUsgText", title: "건축물용도" },
// { id: "bdstUsgCd", title: "건축물용도" },
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
{ id: "archArea", title: "건축면적" },
{ id: "lawTrgtYn", title: "법적의무대상여부" },
{ id: "bdstChgYn", title: "건축물변경여부" },
// { id: "archChgPrmsnDt", title: "허가일", upName: "upChangeRe", upSequnce: 2 },
// { id: "archChgArea", title: "면적", upName: "upChangeRe", upSequnce: 3 },
];
const rainRes: customRainBdst[] = [];
const regRainForm:customRainBdst = {
ctpvCd: 0,
sggCd: 0,
bdstNm: "",
daddr: "",
frstArchPrmsnDt:new Date(),
archArea: "",
archChgArea: 0,
bdstInfoPk: 0,
reuseBuilding: [{
rainyObj: {
bdstReuseFcltFk: 0,
pntfColKnd: undefined,
pntfColArea: undefined,
dtfcltCpct: 0,
filtrTrtmfctCpct: undefined,
filtrTrtmfctYn: undefined,
filtrTrtmfctPrs: undefined,
annRnwtQty: 0,
oilqMeasMthd: undefined
},
lawTrgtYn: undefined,
bdstUsgCd: undefined,
bdstRuseFcltPk: 0,
bdstInfoFk: 0,
operMngCd: 0,
anlOperCst: 0,
instlCmptnDt: undefined,
instlCst: undefined,
// archChgPrmsnDt: "",
instlCstSprtYn: undefined,
instlCstSprtAmt: undefined,
grntchBdstCertYn: undefined,
grntchBdstCertNo: undefined,
grntchBdstCertGrd: undefined,
grntchBdstCertYr: undefined
}],
//추가됨
chgBuilding:[{
bdstInfoFk: 0,
archChgPrmsnDt: new Date(),
archChgArea: "-",
bdstChgNm: ""
}]
};
export const selectClass = "w-full h-full text-2xl";
const selectYN = [
{ text: "Y", val: "1" },
{ text: "N", val: "2" },
];
export type rainFacState = {
rain: {
isInit: boolean;
upHeadList: TableUpperProps[];
selectYN: selectArray[];
rainRes: customRainBdst[];
regRainForm:customRainBdst,
};
};
type rainFacSActions = {
init: (txt:string|undefined) => void;
rainSearTxt: (txt:string) => void;
rainReg: (data: customRainBdst) => void;
rainUpdate: (data: customRainBdst) => void;
};
export type rainFacType = rainFacState & rainFacSActions;
export const rainFacStateExport: rainFacState = {
rain: {
isInit: false,
rainRes: rainRes,
upHeadList: upHeadList,
selectYN: selectYN,
regRainForm:regRainForm,
},
};
const initFetch = async (txt:string|undefined) => {
const rainRes =await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
const chRainRes = rainRes.map((item: customRainBdst) => {
return {
...item,
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
} })
return chRainRes;
};
export const rainFacActionsExport: (set: any) => rainFacSActions = (
set: any
) => {
return {
init: async (txt:string|undefined) => {
try {
// 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로)
const rainRes = await initFetch(txt);
// 여기서 상태 업데이트
return set((state: rainFacState) => ({
...state,
rain: {
...state.rain,
rainRes: rainRes,
isInit: false,
},
}));
} catch (error) {
console.log("error", error);
} finally {
console.log("finally");
}
},
rainSearTxt: async(txt:string) =>{
try{
const rainRes = await getFectch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
set((state: rainFacState) => {
return {
rain: {
...state.rain,
rainRes: rainRes,
isInit: false,
},
};
})}
catch(erTxt){
console.log("error", erTxt)
}
},
rainReg: async (data: customRainBdst) => {
try {
const res = await postFectch("/reuseFc/rainyInfo", data);
if(res.ok){
if(data.chgBuilding.length > 0){
await res.json().then((resData: any) => {
const chPK = resData?.data?.bdstInfoPk
const makeCh= resData.data.chgBuilding.map((item: chgBuilding) =>
( {
...item,
bdstInfoFk: chPK,
})
);
const chch= postFectch("/reuseFc/chgBuilding", makeCh);
return chch;
}).then((chch: any) => {
if(chch.ok) {
alert("등록이 완료되었습니다.");
}
})
}else{
alert("등록이 완료되었습니다.");
}
}
const rainRes = await initFetch(undefined);
set((state: rainFacState) => ({
...state,
rain: {
...state.rain,
rainRes: rainRes,
isInit: false,
},
}));
} catch (e) {
console.log("e", e);
alert("등록 오류입니다.");
} finally {
}
},
rainUpdate: async (data: customRainBdst) => {
try {
console.log("data ", data)
const res = await putFectch("/reuseFc/rainyInfo", data);
console.log('rainUpdate', res);
if(res.ok){
alert(" 수정이 완료되었습니다.")
}
const rainRes = await initFetch(undefined);
set((state: rainFacState) => ({
...state,
rain: {
...state.rain,
rainRes: rainRes,
isInit: false,
},
}));
} catch (e) {
console.log("e", e);
alert("업데이트 오류입니다.");
} finally {
}
}
}}
@@ -1,235 +0,0 @@
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
import { rswtBdstType } from "@/app/store/common/code";
import { z } from "zod";
export const rswtZod = z.object({
bdstInfoPk: z.number().nullish(),
ctpvCd: z.number().default(0),
sggCd: z.number().default(0),
daddr: z.string().default(""),
bdstNm: z.string().default(""),
frstArchPrmsnDt: z.date().default(() => new Date()),
archChgPrmsnDt: z.coerce.date().nullish().default(null),
archArea: z.number().default(0),
archChgArea: z.number().default(0),
reuseBuilding: z.array(
z.object({
bdstRuseFcltPk: z.number().nullish(),
bdstInfoFk: z.number().nullish(),
instlCmptnDt: z.coerce.date().default(() => new Date()),
instlCst: z.number().default(0),
operMngCd: z.string().nullish().default(""),
anlOperCst: z.number().default(0),
instlCstSprtYn: z.string().default(""),
instlCstSprtAmt: z.number().default(0),
grntchBdstCertYn: z.string().default(""),
grntchBdstCertYr: z.string().max(4, "4자리 연도를 입력하세요")
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
.default(""),
grntchBdstCertNo: z.string().default(""),
grntchBdstCertGrd: z.string().default(""),
crgRdctYn: z.string().default(""),
crgRdctBss: z.string().default(""),
crgRdctAmt: z.number().default(0),
ruseFcltFlg: z.string().default(""),
bdstUsgCd: z.number().default(0),
lawTrgtYn: z.string().default(""),
rswtrObj: z.object({
bdstRuseFcltFk: z.number().nullish(),
wtrUsqty: z.number().default(0),
oblgTrgtWtrUsqty: z.number().default(0),
orgwtKndCd: z.string().default(""),
filtrTrtmfctProcs: z.string().default(""),
filtrTrtmfctUsgCd: z.string().default(""),
rswtrUsqty: z.number().default(0),
altUswtrUtztnYn: z.string().default(""),
altUswtrKndCd: z.string().default(""),
altUswtrUtztnQnt: z.number().default(0),
altUswtrIdntyMthdCd: z.string().default("")
}).default({})
})
).default([]),
chgBuilding: z
.array(
z.object({
bdstInfoFk: z.number().nullish(),
archChgPrmsnDt: z.coerce.date() ,
archChgArea: z.string().default("-"),
bdstChgNm: z.string().default(""),
})
)
.default([]),
});
export type customRswtBdst = Omit<bdstAll, 'reuseBuilding'> & {
reuseBuilding: rswtReuseBuilding[];
};
export type rswtReuseBuilding = {
bdstRuseFcltPk: number;
bdstInfoFk: number;
instlCmptnDt: Date | undefined;
instlCst: number | undefined;
operMngCd: number;
lawTrgtYn: string | undefined;
anlOperCst: number;
instlCstSprtYn: string | undefined;
instlCstSprtAmt: number | undefined;
bdstUsgCd: number | undefined;
grntchBdstCertYn: string | undefined;
grntchBdstCertNo: string | undefined;
grntchBdstCertGrd: string | undefined;
grntchBdstCertYr: string | undefined;
rswtrObj: rswtrObj | null;
};
export type rswtrObj = {
bdstRuseFcltFk: number | undefined;
wtrUsqty: number | undefined;
oblgTrgtWtrUsqty: number | undefined;
orgwtKndCd: string | undefined;
filtrTrtmfctProcs: string | undefined;
filtrTrtmfctUsgCd: string | undefined;
rswtrUsqty: number;
altUswtrUtztnYn: string;
altUswtrKndCd: string;
altUswtrUtztnQnt: number;
altUswtrIdntyMthdCd: string;
};
const rswtRes: customRswtBdst[] = [];
export type rswtFacState = {
rswt: {
isInit: boolean;
upHeadList: TableUpperProps[];
rswtRes: customRswtBdst[];
};
};
type rswtFacSActions = {
initRswt: (txt: string | undefined) => void;
rswtUpdate: (data: customRswtBdst) => void;
rswtReg: (data: customRswtBdst) => void;
};
export type rswtFacType = rswtFacState & rswtFacSActions;
export const rswtFacStateExport: rswtFacState = {
rswt: {
isInit: false,
upHeadList: upHeadList,
rswtRes: rswtRes,
},
};
const initFetch = async (txt: string | undefined) => {
const rswtRes =await getFectch(
"wr",
`/reuseFc/waterreuseFc/1/20/41` + (txt ? `/${txt}` : "")
);
const chRswtRes = rswtRes.map((item: customRswtBdst) => {
return {
...item,
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
} })
return chRswtRes;
};
export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
set: any
) => {
return {
initRswt: async (txt: string | undefined) => {
try {
const rswtRes = await initFetch(txt);
return set((state: rswtFacState) => ({
...state,
rswt: {
...state.rswt,
rswtRes: rswtRes,
isInit: false,
},
}));
} catch (error) {
console.log(error);
}
},
rswtUpdate: async (data: customRswtBdst) => {
try {
const res = await putFectch("/reuseFc/waterreuseFc", data);
if (res.ok) {
alert("등록이 완료되었습니다.");
}
const rswtRes = await initFetch(undefined);
set((state: rswtFacState) => ({
...state,
rain: {
...state.rswt,
rswtRes: rswtRes,
isInit: false,
},
}));
} catch (errorUpdate) {
alert("업데이트 오류입니다. " + (errorUpdate instanceof Error ? errorUpdate.message : ""));
} finally {
}
},
rswtReg: async (data: customRswtBdst) => {
try {
const res = await postFectch("/reuseFc/waterreuseFc", data);
if(res.ok){
if(data.chgBuilding.length > 0){
await res
.json()
.then((resData: any) => {
const chPK = resData?.data?.bdstInfoPk;
const makeCh = resData.data.chgBuilding.map(
(item: chgBuilding) => ({
...item,
bdstInfoFk: chPK,
})
);
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
return chch;
})
.then((chch: any) => {
if (chch.ok) {
alert("등록이 완료되었습니다.");
}
});
}else{
alert("등록이 완료되었습니다.");
}
}
const rainRes = await initFetch(undefined);
set((state: rswtFacState) => ({
...state,
rain: {
...state.rswt,
rswtRes: rswtRes,
isInit: false,
},
}));
} catch (e) {
console.log("e", e);
alert("등록 오류입니다.");
} finally {
}
},
};
};
@@ -1,82 +0,0 @@
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import type { TableUpperProps } from "../../fcltReg/rainReg";
import { z } from "zod";
export const pbnSttHeadNm:chHeadType[] = [
{headNm:"catchment", text:"유역" , length: 3},
{headNm:"adminDiv", text:"행정구역" , length: 2},
{headNm:"rusSup", text:"재이용수공급가능량" , length: 3},
{headNm:"yearResult", text:"연간실적정보(m³)" , length: 3},
{headNm:"mngInfo", text:"운영정보" , length: 4}
]
// id는 다확인해야함
export const pbnSttHeadList:TableUpperProps[] = [
{ id: "a", title: "권역" ,upName:"catchment" ,upSequnce:1,visible:false},
{ id: "aaa", title: "단위유역" ,upName:"catchment" ,upSequnce:2 ,visible:false},
{ id: "aaaa", title: "중권역" ,upName:"catchment" ,upSequnce:3,visible:false},
{ id: "operMngCd", title: "환경청" ,visible:false },
{ id: "cityText", title: "시도" ,upName:"adminDiv" ,upSequnce:1,visible:false},
{ id: "sggText", title: "시군구" ,upName:"adminDiv" ,upSequnce:2,visible:false},
{ id: "bdnstNm", title: "시설명" ,visible:false },
{ id: "locDiv", title: "지역구분" ,visible:false },
{ id: "phone" , title: "전화번호" ,visible:false },
{ id: "fcltQuantity", title: "시설용량(톤/일)" ,visible:false},
{ id: "rusNm", title: "재이용시설명" ,visible:false},
{ id: "fcltCpct", title: "시설용량(m³/일)", upName: "rusSup", upSequnce: 1 ,visible:false},
{ id: "trbt", title: "하수처리량(m³/일)", upName: "rusSup", upSequnce: 2 ,visible:false},
{ id: "ruseCpct", title: "재이용량(m³/일)", upName: "rusSup", upSequnce: 3 ,visible:false},
{ id: "total", title: "합계", upName: "yearResult", upSequnce: 1 ,visible:false},
{ id: "ithlWtr", title: "장내용수", upName: "yearResult", upSequnce: 2 ,visible:false},
{ id: "othlWtr", title: "장외용수", upName: "yearResult", upSequnce: 3 ,visible:false},
{ id: "mngMeth", title: "운영방식", upName: "mngInfo", upSequnce: 1 ,visible:false},
{ id: "rprtvBzenty", title: "대행업체", upName: "mngInfo", upSequnce: 2 ,visible:false},
{ id: "firstDay", title: "시작일", upName: "mngInfo", upSequnce: 3 ,visible:false },
{ id: "LastDay", title: "종료일", upName: "mngInfo", upSequnce: 4 ,visible:false},
];
export type pbnstSttnState = {
pbnStt: {
pbnSttHeadList:TableUpperProps[],
pbnSttHeadNm:chHeadType[]
};
};
type pbnSttActions = {
};
export type pbnSttType = pbnstSttnState & pbnSttActions;
export const pbnSttStateExport: pbnstSttnState = {
pbnStt: {
pbnSttHeadList:pbnSttHeadList,
pbnSttHeadNm:pbnSttHeadNm
},
};
export const pbnSttActionsExport: (set: any) => pbnSttActions = (
set: any
) => {
return {
pbnSttnInit: async(sggCd:string, searchTxt:string ,flg:string ) =>{
},
};
};
-92
View File
@@ -1,92 +0,0 @@
import { createStore } from "zustand/vanilla";
import {
pubFacActionsExport,
pubFacStateExport,
type pubFacState,
type pubFacType,
} from "./ruseFcltMng/fcltReg/pbnstReg";
import {
rainFacActionsExport,
rainFacStateExport,
type rainFacState,
type rainFacType,
} from "./ruseFcltMng/fcltReg/rainReg";
import {
rswtFacActionsExport,
rswtFacStateExport,
type rswtFacState,
type rswtFacType,
} from "./ruseFcltMng/fcltReg/rswtReg";
import {
matDmdActionsExport,
matDmdStateExport,
type matDmdState,
type matDmdType,
} from "./matDmd";
import {
htdflFacActionsExport,
htdflFacStateExport,
type htdflFacState,
type htdflFacType,
} from "./ruseFcltMng/fcltReg/htdflReg";
import { codeActionExport, comCodeStateExport, getCityCd, getSggCd, type comCodeState, type comCodeType } from "./common/code";
import { bdstActionsExport, bdstStateExport, type bdstFulType, type bdstState } from "./ruseFcltMng/fcltReg/bdstReg";
import { rainChkgdnActionsExport, rainChkgdnStateExport, type rainChkgdnState, type rainChkgdnType } from "./prfmncReg/chkgdnReg/rainChkgdn";
import { rswtChkgdnActionsExport, rswtChkgdnStateExport, type rswtChkgdnState, type rswtChkgdnType } from "./prfmncReg/chkgdnReg/rswrtChkgdn";
import { pbnSttActionsExport, pbnSttStateExport, type pbnstSttnState, type pbnSttType } from "./ruseFcltMng/fcltSttn/pbnstSttn";
export type WrStore = comCodeType&
pubFacType &
rainFacType &
rswtFacType &
matDmdType &
htdflFacType&
bdstFulType&
rainChkgdnType&
rswtChkgdnType&
pbnSttType
;
export const StoreZus = (
initState: comCodeState&
rainFacState &
pubFacState &
rswtFacState &
matDmdState &
htdflFacState &
bdstState &
rainChkgdnState&
rswtChkgdnState&
pbnstSttnState
= {
...comCodeStateExport,
...pubFacStateExport,
...rainFacStateExport,
...rswtFacStateExport,
...matDmdStateExport,
...htdflFacStateExport,
...bdstStateExport,
...rainChkgdnStateExport,
...rswtChkgdnStateExport,
...pbnSttStateExport
}
) => {
return createStore<WrStore>()((set) => {
getSggCd(set),
getCityCd(set)
return {
...initState,
...pubFacActionsExport(set),
...rainFacActionsExport(set),
...rswtFacActionsExport(set),
...matDmdActionsExport(set),
...htdflFacActionsExport(set),
...codeActionExport(set),
...bdstActionsExport(set),
...rainChkgdnActionsExport(set),
...rswtChkgdnActionsExport(set),
...pbnSttActionsExport(set)
};
});
};
//store 등록하는 부분
-21
View File
@@ -1,21 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
-66
View File
@@ -1,66 +0,0 @@
//8880
import { DEV_URL_FO, DEV_URL_WR } from "../config/";
export const getFectch = async( type:string , url: string) => {
const div = type === 'common' ? DEV_URL_FO : DEV_URL_WR
const response = await fetch( div+url , {
method: "GET",
headers: {
accept: "application/json",
},
});
if(!response.ok) {
throw new Error(`오류 발생: ${response.status}`);
}
const res = await response.json()
return res.data;
}
export const postFectch = async (url: string, params: any) => {
const response = await fetch(DEV_URL_WR+url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
});
if(!response.ok) {
throw new Error(`오류 발생: ${response.status}`);
}
return response;
}
export const putFectch = async (url: string, params: any) => {
const response = await fetch(DEV_URL_WR+url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
});
if(!response.ok) {
throw new Error(`오류 발생: ${response.status}`);
}
return response;
}
export const deleteFectch = async (url: string, params: any) => {
const response = await fetch(DEV_URL_WR+url, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
});
if(!response.ok) {
throw new Error(`오류 발생: ${response.status}`);
}
return response;
}
-16
View File
@@ -1,16 +0,0 @@
const LOCAL_PORT = "3000";
const DEV_PORT = "11080";
const DEV_PORT_FO = "11082"; // common
export const LOCAL_URL_WR = `http://localhost:${LOCAL_PORT}/api/v1`;
export const DEV_URL_WR = `http://con.mind-one.co.kr:${DEV_PORT}/api/v1`;
export const DEV_URL_FO = `http://con.mind-one.co.kr:${DEV_PORT_FO}/api/v1`;
-50
View File
@@ -1,50 +0,0 @@
import type { comCodeState, selectArray } from "@/app/store/common/code";
import type { bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
export const getCity = (val: string, sggCd: selectArray[]) => {
const data = sggCd
.filter((item) => String(item.val).substring(0, 2) === val)
.map((item) => ({
val: item.val,
text: item.text // 한국어 텍스트
}));
return data
};
// cd text 넣기
export const tableData = ( data: any,code:comCodeState)=>{
const chCode = code.code;
return data?.map((item: { sggCd: string; ctpvCd: string; reuseBuilding: { lawTrgtYn: any , bdstUsgCd:any}[]; }) => {
let returnData = {};
const sggText = chCode.sggCd.find(
(cd) => cd.val === item.sggCd
)?.text;
const cityText = chCode.cityCd.find(
(cd) => cd.val === item.ctpvCd
)?.text;
if (item?.reuseBuilding?.length >0) {
const bdsgUsgText = chCode.bdstUsgCd.find(
(cd) =>cd.val === item?.reuseBuilding[0]?.bdstUsgCd
)?.text
const lawTrgtYn = item?.reuseBuilding[0]?.lawTrgtYn
returnData= { ...item, sggText: sggText, cityText: cityText ,bdsgUsgText:bdsgUsgText ,lawTrgtYn:lawTrgtYn};
}else{
returnData= { ...item, sggText: sggText, cityText: cityText};
}
// console.log(" returnData ", returnData)
return returnData;
});
}
@@ -1,325 +0,0 @@
import { useWrStore } from "@/app/store";
import type { selectArray } from "@/app/store/common/code";
import { selectClass, type bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { getCity } from "@/components/lib/func/commom";
import type { objSearchType } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
import { FormField, FormUi, DatePicker, SelectBox } from "@common/business_components";
import { Button, Input } from "@common/components";
import { useEffect, useRef, useState } from "react";
import { useFieldArray } from "react-hook-form";
export default function BdstReg({ form }: { form: any }) {
const { code } = useWrStore((state) => {
return state;
});
const { fields, append, remove } = useFieldArray({
name: "chgBuilding",
control: form?.control, // Provide a fallback to avoid errors
});
const plusHist = () => {
append({
bdstNm: "",
daddr: "",
bdstUsgCd: "",
});
};
const removeLastItem = () => {
if (fields.length > 0) {
remove(fields.length - 1);
}
};
const [selectSgg, setSelectSgg] = useState<selectArray[] | undefined>()
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
const getSelCity = (val: string) => {
const data= getCity(val,code.sggCd)
setSelectSgg(data);
const sgg =form.getValues('sggCd')
setObjSearch({ city:val , sgg:''})
};
const getSgg = (val: string | number) => {
const sgg =form.getValues('sggCd')
setObjSearch({...objSearch,sgg: val!=''?String(val):sgg })
};
useEffect(()=>{
const city =form.getValues('ctpvCd')
const sgg =form.getValues('sggCd')
setObjSearch({city:city , sgg:sgg })
}, [selectSgg])
useEffect(() => {
const subscription = form.form?.watch((value: any) => {
console.log('vale', value)
});
return () => subscription?.unsubscribe();
}, [form.form]);
const safeDate = (value: any): Date | undefined => {
const date = new Date(value);
return isNaN(date.getTime()) ? undefined : date;
};
return (
<>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
건축물 시설 정보
</h1>
<div className="grid grid-cols-6 gap-2 mt-4">
<div className="col-span-3">
<FormField
control={form.control}
name="ctpvCd"
render={({ field }) => (
<FormUi label="시도">
<SelectBox
className="col-span-3 "
label={""}
selectClass={selectClass}
selectArray={code.cityCd}
onSelectValue={(val)=>{
getSelCity(String(val))
field.onChange(Number(val) );
}
}
value={field.value}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="sggCd"
render={({ field }) => (
<FormUi label="시군구">
<SelectBox
className="col-span-3"
label={""}
selectClass={selectClass}
selectArray={selectSgg? selectSgg:code.sggCd || []}
onSelectValue={(val) =>{
getSgg(val)
field.onChange(Number(val))
}}
value={field.value}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-6 gap-2 mt-4 ">
<div className="col-span-2">
<FormField
control={form.control}
name="bdstNm"
render={({ field }) => (
<FormUi label="건축물명">
<Input
className=""
placeholder="1,000,000"
type="text"
{...field}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="daddr"
render={({ field }) => (
<FormUi label="위치">
<Input
className=""
placeholder="1,000,000"
type="search"
{...field}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.bdstUsgCd"
render={({ field }) => (
<FormUi label="건축물용도">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.bdstUsgCd}
onSelectValue={(val) => {
field.onChange(Number(val));
}}
value={field.value}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="frstArchPrmsnDt"
render={({ field }) => (
<FormUi label="최초건축허가일">
<DatePicker
mode={"single"}
field={{
value: field.value|| new Date(),
onChange: (date: Date | undefined) =>
field.onChange(date),
}}
selectClass={selectClass}
></DatePicker>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="archArea"
render={({ field }) => (
<FormUi label="건축면적(m³)">
<Input
className=""
placeholder="1,000,000"
type="number"
{...field}
onChange={(e) => {
const value = e.target.value;
field.onChange(value === "" ? "" : Number(value));
}}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.lawTrgtYn"
render={({ field }) => (
<FormUi label="법정의무대상여부">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={(val) => {
field.onChange(val);
}}
value={field.value}
/>
</FormUi>
)}
/>
</div>
</div>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4">
중축, 개축, 재축
</h1>
<div className="flex justify-end gap-2">
<Button type="button" className="rounded-lg" onClick={plusHist}>
이력추가
</Button>
<Button
type="button"
className="rounded-lg bg-red-500 text-white"
onClick={removeLastItem}
>
삭제
</Button>
</div>
{fields.map((field, index) => (
<div key={field.id} className="grid grid-cols-6 gap-2 mt-4">
<div className="col-span-2">
<FormField
control={form.control}
name={`chgBuilding.${index}.bdstChgNm`}
render={({ field }) => (
<FormUi label="구분">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.chBuCd}
onSelectValue={(val) => {
field.onChange(val);
}}
value={field.value ?? code.chBuCd[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name={`chgBuilding.${index}.archChgPrmsnDt`}
render={({ field }) => (
<FormUi label="허가일">
<DatePicker
mode={"single"}
field={{
value: safeDate(field.value) || new Date(),
onChange: (date: Date | undefined) =>
field.onChange(date),
}}
selectClass={selectClass}
></DatePicker>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name={`chgBuilding.${index}.archChgArea`}
render={({ field }) => (
<FormUi label="면적">
<Input
className=""
placeholder="-"
type="text"
value={ field.value??"-"}
onChange={(e) => field.onChange((e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
))}
<div className="border-b border-gray-300 my-4"> </div>
</>
);
}
@@ -1,560 +0,0 @@
"use client";
import {
Form,
FormField,
FormUi,
SelectBox,
} from "@common/business_components/ui";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { useWrStore } from "@/app/store";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import {
hdtflZod,
type customHtdflBdst,
} from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
import { useEffect } from "react";
import BdstReg from "../bdstReg/bdstReg";
export function HtdflRegForm({
htdflForm,
isModal,
}: {
htdflForm: customHtdflBdst;
isModal: boolean;
}) {
const { code, htdflUpdate, htdflReg } = useWrStore((state) => state);
const defaultValues: z.infer<typeof hdtflZod> = hdtflZod.parse({});
const form = useForm<z.infer<typeof hdtflZod>>({
resolver: zodResolver(hdtflZod),
defaultValues: defaultValues,
});
function onSubmit(values: z.infer<typeof hdtflZod>) {
if (isModal) {
htdflReg(values);
} else {
htdflUpdate(values);
}
}
const onSelectValue = (val: string | number) => {
console.log(val);
};
function cleanHtdflData(raw: any): z.infer<typeof hdtflZod> {
return {
...raw,
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
archChgPrmsnDt: raw?.archChgPrmsnDt
? new Date(raw?.archChgPrmsnDt)
: null,
chgBuilding: (raw?.chgBuilding || []).map((item: any) => ({
...item,
archChgPrmsnDt:
item?.archChgPrmsnDt === null
? new Date()
: new Date(item?.archChgPrmsnDt),
bdstChgNm: item?.bdstChgNm ?? "", // null → ""
})),
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
...item,
instlCmptnDt: new Date(item?.instlCmptnDt),
htdflObj: {
...item?.htdflObj,
},
})),
};
}
useEffect(() => {
console.log("form errors:", form.formState.errors);
}, [form.formState.errors]);
useEffect(() => {
if (hdtflZod) form.reset(cleanHtdflData(htdflForm));
}, [htdflForm]);
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
{/* <div className="flex justify-between items-center mx-3"> */}
<div>
<div className="grid grid-cols-12">
<h1 className="pl-3 text-xl col-span-10">○온배수 시설 정보</h1>
<Button type="submit" className="mr-4 rounded-lg col-span-2">
저장
</Button>
</div>
</div>
{ isModal && htdflForm != undefined ? (
<BdstReg form={form} />
) : (
<></>
)}
{isModal ? (
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
○ 중수도 시설 정보{" "}
</h1>
) : (
<></>
)}
<div className="grid grid-cols-6 gap-2 mt-4 pl-6">
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.etgtType"
render={({ field }) => (
<FormUi label="발전유형(코드정비후 수정)">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.fclCpct" // 이름 이상함.
render={({ field }) => (
<FormUi label="설비용량">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? 0}
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.plwtYn"
render={({ field }) => (
<FormUi label="담수화 여부">
<SelectBox
className={""}
label={""}
selectClass={selectClass}
selectArray={code.yn}
onSelectValue={onSelectValue}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-4">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
온배수 시설 운영현황
</h1>
</div>
<div className="grid grid-cols-10 gap-1 mt-4">
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.orgwtWtritSpt"
render={({ field }) => (
<FormUi label="원수취수 지점(코드정비후 수정)">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? 0}
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.orgwtOcrnProcs"
render={({ field }) => (
<FormUi label="원수발생 공정">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.wtritEntrcTp"
render={({ field }) => (
<FormUi label="취수구 온도">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.amtgnr"
render={({ field }) => (
<FormUi label="발생량(m³/년)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.prcsProcsYn"
render={({ field }) => (
<FormUi label="처리공정">
<SelectBox
className={""}
label={""}
selectClass={selectClass}
selectArray={code.yn}
onSelectValue={onSelectValue}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.prcsFcltCpct"
render={({ field }) => (
<FormUi label="처리시설 용량(m³/년)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.fmYn"
render={({ field }) => (
<FormUi label="유량계유무">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={onSelectValue}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.utztnCpct"
render={({ field }) => (
<FormUi label="이용량(m³/년)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.utztnUsg"
render={({ field }) => (
<FormUi label="이용용도">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-2">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
요구수질
</h1>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.grssClfg"
render={({ field }) => (
<FormUi label="총대장균군">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.tn"
render={({ field }) => (
<FormUi label="총질소">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.combResdch"
render={({ field }) => (
<FormUi label="결합잔류염소">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6 ">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.tph"
render={({ field }) => (
<FormUi label="총인">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.trbt"
render={({ field }) => (
<FormUi label="탁도">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.ph"
render={({ field }) => (
<FormUi label="수소이온농도">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.bod"
render={({ field }) => (
<FormUi label="생물학적 산소요구량">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.clIonQnt"
render={({ field }) => (
<FormUi label="염화물">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.smll"
render={({ field }) => (
<FormUi label="냄새">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.cdtnv"
render={({ field }) => (
<FormUi label="전기전도도">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 pl-6">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.crmty"
render={({ field }) => (
<FormUi label="색도">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.emsnExitTp"
render={({ field }) => (
<FormUi label="배출구온도">
<Input
placeholder="10"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
</form>
</Form>
);
}
@@ -1,427 +0,0 @@
"use client";
import { SelectBox } from "@common/business_components";
import { DatePicker, FileUpload, FormUi, UiTable } from "@common/business_components/ui";
import { Form, FormField } from "@common/business_components/ui/form";
import { Button, Input, TableHead, TableRow } from "@common/components";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { useWrStore } from "@/app/store";
import { selectClass, type TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
const formSchema = z.object({
username: z.string().min(2).max(50),
facilityName: z.string().min(2).max(50),
});
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
return (<>
<TableRow>{
upHeadList.map((head: TableUpperProps) =>
(!head.upSequnce ? <TableHead rowSpan={2} key={head.id}>{head.title}</TableHead> :
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead key={head.id} rowSpan={1} colSpan={2}>{'운영대행기간'}</TableHead> : null))}
</TableRow>
<TableRow>
{upHeadList.map((head: TableUpperProps) =>
(head.upName === 'upChangeRe' ? <TableHead key={head.id}>{head.title}</TableHead> : null))}
</TableRow>
</>)
}
export function PbnstBuseForm() {
const { pubFac } = useWrStore((state) => state);
const { pubMngUpHeadList, erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac;
const nodeList = headMakeColSpan(pubMngUpHeadList);
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
username: "",
},
});
// 2. Define a submit handler.
function onSubmit(values: z.infer<typeof formSchema>) {
// Do something with the form values.
// ✅ This will be type-safe and validated.
console.log(values);
}
const onSelectValue=(val:string)=>{
console.log(val)
}
const [instlAprvDate, setInstlAprvDate] = useState(new Date())
const [bizCmcnDate, setBizCmcnDate] = useState(new Date())
const [files, setFiles] = useState(null);
return (
<div className="pl-3">
{/* 차수별 등록 현황 폼 */}
<div className="justify-between">
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8 mx-auto w-full mt-7">
<div className="flex justify-between items-center mx-3 mb-3">
<h1 className=" text-xl">
○ 차수별 하수처리수 재이용 시설 현황
</h1>
<div className="flex items-center gap-2 mx-3">
<h1 className=" text-xl">
등록차수
</h1>
<FormField
control={form.control}
name="name_1486273033"
render={({ field }) => (
<FormUi label=''>
<SelectBox label='' selectArray={cyclCd} className={""} selectClass={selectClass} onSelectValue={onSelectValue } {...field}></SelectBox>
</FormUi>
)}
/>
<Button className="rounded-lg">
신규등록
</Button>
</div>
</div>
<div>
<h1 className="pl-3 text-xl">♦︎하수처리수 재이용 시설 현황</h1>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
사업개요{" "}
</h1>
<h1 className="pl-4 text-xl my-0">1. 현황</h1>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-3">
<FormField
control={form.control}
name="name_8928357542"
render={({ field }) => (
<FormUi label="구분">
<SelectBox selectArray={seCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue} />
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="name_9484942814"
render={({ field }) => (
<FormUi label="사업방식">
<SelectBox selectArray={buseMet} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="name_2450741594"
render={({ field }) => (
<FormUi label="사업준공일">
<DatePicker
selectClass={'rounded-lg w-full'}
field={{
value: bizCmcnDate,
onChange: function (date: Date | undefined): void {
if (date) setBizCmcnDate(date);
}
}} mode="single" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="name_2450741594"
render={({ field }) => (
<FormUi label="설치승인인가일">
<DatePicker
selectClass={'rounded-lg w-full bg-white'} field={{
value: instlAprvDate,
onChange: (date: Date | undefined): void => {
if (date) setInstlAprvDate(date);
}
}} mode="single" {...field}/>
</FormUi>
)}
/>
</div>
</div>
<h1 className="pl-4 text-xl">2. 사업비</h1>
<div className="grid grid-cols-10 gap-4">
<div className="col-span-2">
<FormField
control={form.control}
name="name_7678668236"
render={({ field }) => (
<FormUi label="국고">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="name_7913744238"
render={({ field }) => (
<FormUi label="지방비">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="민간투자비">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="원인자부담금">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="기타">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="w-64">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="합계">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
재처리시설{" "}
</h1>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4">
<FormField
control={form.control}
name="name_7678668236"
render={({ field }) => (
<FormUi label="시설용량(m³/일)">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_7913744238"
render={({ field }) => (
<FormUi label="주처리공법">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="위치(주소)">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4 ">
<FormField
control={form.control}
name="name_5139286452"
render={({ field }) => (
<FormUi label="재처리방식">
<SelectBox selectArray={rprcsCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue }/>
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_7233630277"
render={({ field }) => (
<FormUi label="위치(처리장 내외)">
<SelectBox selectArray={rprcLoCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_0973765174"
render={({ field }) => (
<FormUi label="메인공급펌프 용량">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
농축수관리{" "}
</h1>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4">
<FormField
control={form.control}
name="name_7678668236"
render={({ field }) => (
<FormUi label="눙축수 발생량(m³/일)">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_7913744238"
render={({ field }) => (
<FormUi label="눙축수연계지점">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="시설용량(m³/일)">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4 ">
<FormField
control={form.control}
name="name_5139286452"
render={({ field }) => (
<FormUi label="눙축수처리방식">
<SelectBox selectArray={erctUswtrCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_7233630277"
render={({ field }) => (
<FormUi label="눙축수처리공법">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
폐수배출시설 정보
</h1>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4">
<FormField
control={form.control}
name="name_7678668236"
render={({ field }) => (
<FormUi label="폐수배출물신고 허가여부">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_7913744238"
render={({ field }) => (
<FormUi label="Tms설치여부">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="name_1368081408"
render={({ field }) => (
<FormUi label="공공하수도 유입제외 허가여부">
<Input placeholder="" type="" {...field} />
</FormUi>
)}
/>
</div>
</div>
<h1 className=" text-xl">
재이용 원수취수 현황
</h1>
</form>
</Form>
</div>
</div>
);
}
@@ -1,244 +0,0 @@
"use client";
import { SelectBox } from "@common/business_components";
import {
FileUpload,
FormUi,
UiTable,
} from "@common/business_components/ui";
import { Form, FormField } from "@common/business_components/ui/form";
import { Button, Input, TableHead, TableRow } from "@common/components";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { nullable, z } from "zod";
import { useWrStore } from "@/app/store";
import {
selectClass,
type TableUpperProps,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import type { fcltOperInfoType, ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
import { PbnstMngModal } from "@/components/ui/modal/pbnstMng/component";
const formSchema = z.object({
fcltNm: z.string().min(2).max(50),
psysScdg: z.string(),
designScdg: z.string(),
fcltCpct: z.number(),
swtrmtCpct: z.number(),
ruseCpct: z.number(),
splyExtraCpct: z.number(),
});
export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
const { pubFac, pubMng } = useWrStore((state) => state);
const { pubMngUpHeadList, isInit } = pubFac;
const { fcltOperInfo } = pubMng;
const [ruseOperData, setRuseOperData] = useState<fcltOperInfoType[]>();
const [files, setFiles] = useState(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
fcltNm: '',
psysScdg: '',
designScdg: '',
fcltCpct: 0,
swtrmtCpct: 0,
ruseCpct: 0,
splyExtraCpct: 0,
},
});
const selectOptions = data?.map((item) => ({text: item.fcltNm, val: item.pbnstRuseFcltPk})) || [{text:'없음', val:'1'}];
const onSelectValue = (val: string) => {
const selectedData = data?.find((item) => item.pbnstRuseFcltPk === val);
if (selectedData) {
form.reset(selectedData);
setRuseOperData(fcltOperInfo.filter((item) => item.pbnstRuseFcltPk === val));
}
};
useEffect(() => {
if (isInit) {
form.reset();
setRuseOperData([{}] as fcltOperInfoType[]);
}
}, [isInit]);
// 2. Define a submit handler.
function onSubmit(values: z.infer<typeof formSchema>) {
console.log(values);
}
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
return (
<>
<TableRow>
{upHeadList.map((head: TableUpperProps) =>
!head.upSequnce ? (
<TableHead rowSpan={2} key={head.id}>
{head.title}
</TableHead>
) : head.upName === "upChangeRe" && head.upSequnce === 1 ? (
<TableHead key={head.id} rowSpan={1} colSpan={2}>
{"운영대행기간"}
</TableHead>
) : null
)}
</TableRow>
<TableRow>
{upHeadList.map((head: TableUpperProps) =>
head.upName === "upChangeRe" ? (
<TableHead key={head.id}>{head.title}</TableHead>
) : null
)}
</TableRow>
</>
);
};
const nodeList = headMakeColSpan(pubMngUpHeadList);
return (
<div className="pl-3 pb-[10.3vh]">
<div>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<div className="flex justify-between items-center mx-3 mb-3">
<div className="col-span-2 flex items-top">
<h1 className="pl-3 pr-3 text-xl">○ 재이용 시설명</h1>
<FormField
control={form.control}
name="fcltNm"
render={({ field }) => (
<FormUi label="">
{data.length === 0 ? (
<Input placeholder="시설명을 입력하세요" {...field} />
) : (
<SelectBox
label=""
selectArray={selectOptions}
className={""}
selectClass={selectClass}
onSelectValue={onSelectValue}
{...field}
/>
)}
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4 my-4">
<div className="col-span-6">
<FormField
control={form.control}
name="psysScdg"
render={({}) => (
<FormUi label="계통도">
<FileUpload
files={files}
setFiles={setFiles}
fileTypes="PDF"
></FileUpload>
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="designScdg"
render={({}) => (
<FormUi label="평면도">
<FileUpload
files={files}
setFiles={setFiles}
fileTypes="PDF"
></FileUpload>
</FormUi>
)}
/>
</div>
</div>
<div className="flex justify-between items-center mx-3 mb-3 ">
<h1 className="pl-3 text-xl">○ 재이용시설 운영정보</h1>
<Button type="button" className="rounded-lg" onClick={() => setIsModalOpen(true)}>추가등록</Button>
{/* <PbnstMngModal /> */}
</div>
<div className="h-[200px] overflow-y-auto">
<UiTable
tableData={ruseOperData?ruseOperData:[]}
headlist={pubMngUpHeadList}
pageSize={100}
total={-1}
headName={""}
cellClick={() => {}}
>
{nodeList}
</UiTable>
</div>
<div>
<h1 className="pl-3 text-xl mb-3">○ 재이용수 공급 가능량</h1>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-3">
<FormField
control={form.control}
name="fcltCpct"
render={({ field }) => (
<FormUi label="시설용량(m³/일)">
<Input placeholder="" type="number" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="swtrmtCpct"
render={({ field }) => (
<FormUi label="하수처리량(m³/일)">
<Input placeholder="" type="number" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="ruseCpct"
render={({ field }) => (
<FormUi label="재이용량(m³/일)">
<Input placeholder="" type="number" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="splyExtraCpct"
render={({ field }) => (
<FormUi label="공급여유량(m³/일)">
<Input placeholder="" type="number" {...field} />
</FormUi>
)}
/>
</div>
</div>
</div>
</form>
</Form>
</div>
</div>
);
}
@@ -1,382 +0,0 @@
"use client";
import { useWrStore } from "@/app/store";
import {
rainZod,
selectClass,
type customRainBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { DatePicker, FormUi } from "@common/business_components";
import { Form, FormField, SelectBox } from "@common/business_components/ui";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useState } from "react";
import { useForm, type UseFormReturn } from "react-hook-form";
import { z } from "zod";
import BdstReg from "../bdstReg/bdstReg";
export function RainRegForm({
rainForm,
isModal,
}: {
rainForm: customRainBdst;
isModal: boolean;
}) {
const { code, rainReg, rainUpdate, rain } = useWrStore((state) => state);
const { rainFcltCd } = code;
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
const form = useForm<z.infer<typeof rainZod>>({
resolver: zodResolver(rainZod),
defaultValues: defaultValues,
});
function cleanRainData(raw: any): z.infer<typeof rainZod> {
return {
...raw,
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null,
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
...item,
instlCmptnDt: new Date(item?.instlCmptnDt),
operMngCd: item?.operMngCd ?? "", // null → ""
grntchBdstCertYr: typeof item?.grntchBdstCertYr === "string"
? item?.grntchBdstCertYr
: "", // null → ""
rainObj: {
...item?.rainObj
}
}))
};
}
// form 값이 변경될 때마다 로그 출력
useEffect(() => {
const subscription = form.watch((value) => {});
return () => subscription.unsubscribe();
}, [form]);
function onSubmit(values: z.infer<typeof rainZod>) {
if (isModal) {
// regRainForm.bdstInfoPk = null;
rainReg(values);
} else {
rainUpdate(values);
}
}
useEffect(() => {
console.log("form errors:", form.formState.errors);
}, [form.formState.errors]);
useEffect(() => {
if(rainZod)
form.reset( cleanRainData(rainForm))
}, [rainForm]);
return (
<div className="">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<div>
<div className="grid grid-cols-12">
<h1 className="pl-3 text-xl col-span-10">
{isModal ? "○건축물 운영정보" : "○ 빗물이용시설 정보"}
</h1>
<Button type="submit" className="mr-4 rounded-lg col-span-2">
저장
</Button>
</div>
</div>
{isModal && rainForm != undefined ? <BdstReg form={form} /> : <></>}
{isModal ? (
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
○ 빗물이용시설 정보{" "}
</h1>
) : (
<></>
)}
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
기본정보
</h1>
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.instlCmptnDt"
render={({ field }) => (
<FormUi label="설치완료일">
<DatePicker
mode="single"
field={{
value:
field.value && !isNaN(new Date(field.value).getTime())
? new Date(field.value)
: new Date(), // Provide a default Date value
onChange: (date) => field.onChange(date),
}}
selectClass={""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.instlCst"
render={({ field }) => (
<FormUi label="설치비">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => {
field.onChange(e.target.value === "" ? "" : Number(e.target.value));
}}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-4">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
빗물이용시설 정보
</h1>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 1. 집수면</h2>
</div>
<div className="grid grid-cols-10 gap-1 mt-4">
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.rainyObj.pntfColKnd"
render={({ field }) => (
<FormUi label="종류">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={rainFcltCd}
onSelectValue={field.onChange}
value={field.value ?? rainFcltCd[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5">
<FormField
control={form.control}
name="reuseBuilding.0.rainyObj.pntfColArea"
render={({ field }) => (
<FormUi label="면적(m³)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 2. 여과 등 처리시설</h2>
</div>
<div className="grid grid-cols-12 gap-2 mt-4">
<div className="col-span-4 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.rainyObj.filtrTrtmfctYn"
render={({ field }) => (
<FormUi label="유무">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={field.onChange}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="reuseBuilding.0.rainyObj.filtrTrtmfctCpct"
render={({ field }) => (
<FormUi label="용량(m³/일)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="reuseBuilding.0.rainyObj.filtrTrtmfctPrs"
render={({ field }) => (
<FormUi label="처리공정">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-2">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
인센티브 정보
</h1>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
</div>
<div className="grid grid-cols-10 gap-2 pl-6 mt-4">
<div className="col-span-5">
<FormField
control={form.control}
name="reuseBuilding.0.instlCstSprtYn"
render={({ field }) => (
<FormUi label="설치비 지원 여부">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={field.onChange}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5">
<FormField
control={form.control}
name="reuseBuilding.0.instlCstSprtAmt"
render={({ field }) => (
<FormUi label="지원금액(원)">
<Input
className=""
placeholder="1,000,000"
type=""
onChange={(e) => {
const value = e.target.value;
field.onChange(value === "" ? "" : Number(value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
</div>
<div className="grid grid-cols-6 gap-2 mt-4">
<div className="col-span-3 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertYn"
render={({ field }) => (
<FormUi label="인증여부">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={field.onChange}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertYr"
render={({ field }) => (
<FormUi label="인증년도">
<Input className="" placeholder="2024" type="" value={field.value ?? ""}
onChange={field.onChange} />
</FormUi>
)}
/>
</div>
<div className="col-span-3 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertNo"
render={({ field }) => (
<FormUi label="인증번호">
<Input
className=""
placeholder="ab1234678"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertGrd"
render={({ field }) => (
<FormUi label="인증등급">
<Input className="" placeholder="A" type="" value={field.value ?? ""}
onChange={field.onChange}/>
</FormUi>
)}
/>
</div>
</div>
</form>
</Form>
</div>
);
}
@@ -1,371 +0,0 @@
"use client";
import {
DatePicker,
Form,
FormField,
FormUi,
SelectBox,
} from "@common/business_components/ui";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useFieldArray, useForm } from "react-hook-form";
import { number, z } from "zod";
import { useWrStore } from "@/app/store";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import {
rswtZod,
type customRswtBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { useEffect } from "react";
import BdstReg from "../bdstReg/bdstReg";
export function RswtrRegForm({
rswtForm,
isModal,
}: {
rswtForm: customRswtBdst;
isModal: boolean;
}) {
const { rswt, code ,rswtUpdate,rswtReg} = useWrStore((state) => state);
const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
const form = useForm<z.infer<typeof rswtZod>>({
resolver: zodResolver(rswtZod),
defaultValues: defaultValues,
})
// 2. Define a submit handler.
async function onSubmit(values: z.infer<typeof rswtZod>) {
// Do something with the form values.
// ✅ This will be type-safe and validated.
console.log(values);
if (isModal) {
// regRainForm.bdstInfoPk = null;
await rswtReg(values);
} else {
rswtUpdate(values);
}
}
const onSelectValue = (val: string | number) => {
console.log(val);
};
function cleanRswtData(raw: any): z.infer<typeof rswtZod> {
return {
...raw,
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null,
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
...item,
instlCmptnDt: new Date(item?.instlCmptnDt),
operMngCd: item?.operMngCd ?? "", // null → ""
grntchBdstCertYr: typeof item?.grntchBdstCertYr === "string"
? item?.grntchBdstCertYr
: "", // null → ""
rswtrObj: {
...item?.rswtrObj
}
}))
};
}
useEffect(() => {
if(rswtZod)
console.log("rswtForm", rswtForm);
form.reset( cleanRswtData(rswtForm))
}, [rswtForm]);
return (
<div className="">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
{/* <div className="flex justify-between items-center mx-3"> */}
<div>
<div className="grid grid-cols-12">
<h1 className="pl-3 text-xl col-span-10">
○ 중수도 시설 정보
</h1>
<Button type="submit" className="mr-4 rounded-lg col-span-2">
저장
</Button>
</div>
</div>
{isModal && rswtForm != undefined ? (
<BdstReg form={form} />
) : (
<></>
)}
{isModal ? (
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
○ 중수도 시설 정보{" "}
</h1>
) : (
<></>
)}
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
기본정보
</h1>
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.instlCmptnDt"
render={({ field }) => (
<FormUi label="설치완료일">
<DatePicker
mode="single"
field={{
value:
field.value && !isNaN(new Date(field.value).getTime())
? new Date(field.value)
: new Date(), // Provide a default Date value
onChange: (date) => field.onChange(date),
}}
selectClass={""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.instlCst"
render={({ field }) => (
<FormUi label="설치비">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? ""}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.rswtrObj.wtrUsqty"
render={({ field }) => (
<FormUi label="물사용량(m³)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-2">
<FormField
control={form.control}
name="reuseBuilding.0.rswtrObj.oblgTrgtWtrUsqty"
render={({ field }) => (
<FormUi label="의무대상 물사용량(m³)">
<Input
className=""
placeholder="1,000,000"
type="text"
value={field.value ?? 0}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-4">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
중수도 시설 정보
</h1>
</div>
<div className="grid grid-cols-10 gap-1 mt-4">
<div className="col-span-5 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.rswtrObj.orgwtKndCd"
render={({ field }) => (
<FormUi label="원수 종류">
<SelectBox
className={""}
label={""}
selectClass={selectClass}
selectArray={code.orgwtKndCd}
onSelectValue={field.onChange}
value={field.value ?? code.orgwtKndCd[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-5">
<FormField
control={form.control}
name="reuseBuilding.0.rswtrObj.filtrTrtmfctProcs"
render={({ field }) => (
<FormUi label="주요처리공정">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
</div>
<div className=" my-2">
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
인센티브 정보
</h1>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
</div>
<div className="grid grid-cols-2 gap-2 mt-4">
<div className="col-span-1 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.instlCstSprtYn"
render={({ field }) => (
<FormUi label="설치비 지원여부">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={field.onChange}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-1">
<FormField
control={form.control}
name="reuseBuilding.0.instlCstSprtAmt"
render={({ field }) => (
<FormUi label="지원금액(원)">
<Input
className=""
placeholder="1,000,000"
type=""
value={field.value ?? ""}
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
/>
</FormUi>
)}
/>
</div>
</div>
<div>
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
</div>
<div className="grid grid-cols-6 gap-2 mt-4">
<div className="col-span-3 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertYn"
render={({ field }) => (
<FormUi label="인증여부">
<SelectBox
className={""}
selectClass={selectClass}
label={""}
selectArray={code.yn}
onSelectValue={field.onChange}
value={field.value ?? code.yn[0]?.val}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertYr"
render={({ field }) => (
<FormUi label="인증년도">
<Input
className=""
placeholder="2024"
type=""
{...field}
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 pl-6">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertNo"
render={({ field }) => (
<FormUi label="인증번호">
<Input
className=""
placeholder="ab1234678"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3">
<FormField
control={form.control}
name="reuseBuilding.0.grntchBdstCertGrd"
render={({ field }) => (
<FormUi label="인증등급">
<Input
className=""
placeholder="A"
type=""
value={field.value ?? ""}
onChange={field.onChange}
/>
</FormUi>
)}
/>
</div>
</div>
</form>
</Form>
</div>
);
}
@@ -1,91 +0,0 @@
import { useWrStore } from "@/app/store";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
import { Button, Input } from "@common/components";
import { useState } from "react";
export function CoRegForm(form:any){
const { dmd } = useWrStore((state) => state);
return(
<>
<FormField
control={form.control}
name="ctpv"
render={({ field }) => (
<FormUi label="시도">
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectSido} onSelectValue={field.onChange} className={""} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="sgg"
render={({ field }) => (
<FormUi label="시군구">
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectSgg} onSelectValue={field.onChange} className={""} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="coNm"
render={({ field }) => (
<FormUi label="회사명">
<Input placeholder="" type="text" {...field} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="bznmNo"
render={({ field }) => (
<FormUi label="사업자번호">
<Input
placeholder="a0123456789"
type="text"
{...field} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="addr"
render={({ field }) => (
<FormUi label="주소">
<Input
placeholder="성북로24길 16"
type="text"
{...field} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="telNo"
render={({ field }) => (
<FormUi label="전화번호">
<Input
placeholder="01033332222"
type="text"
{...field} />
</FormUi>
)}
/>
</>
)
}
@@ -1,316 +0,0 @@
import { useWrStore } from "@/app/store";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
import { Button, Input } from "@common/components";
import { useState } from "react";
export function DmdRegForm(form: any) {
const { dmd } = useWrStore((state) => state);
const [dmdDate, setDmdDate] = useState(new Date())
const onChangeDate = (val: Date|undefined) => {
if(val)setDmdDate(val)
}
return (
<>
<FormField
control={form.control}
name="dmdSel"
render={({ field }) => (
<FormUi label="수요처명">
<Input
placeholder="수요처명 검색"
type="text"
{...field} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="dmdTmng"
render={({ field }) => (
<FormItem className="flex flex-col">
<FormLabel>요구시기</FormLabel>
<DatePicker mode={"single"} field={{ value: dmdDate, onChange: onChangeDate }} />
</FormItem>
)}
/>
<FormField
control={form.control}
name="dmdWq"
render={({ field }) => (
<FormUi label="요구수질">
<Input
placeholder="55.22"
type="text"
{...field} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="useUsgCd"
render={({ field }) => (
<FormUi label="사용용도">
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectUsg} onSelectValue={field.onChange} className={""} />
</FormUi>
)}
/>
<FormField
control={form.control}
name="wntUntprc"
render={({ field }) => (
<FormUi label="희망단가">
<Input
placeholder="1000000000000000"
type="text"
{...field} />
</FormUi>
)}
/>
<div className="grid grid-cols-4">
<h1 className=" col-span-2 pl-5 text-2xl underline">
요구수질
</h1>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="grssClfg"
render={({ field }) => (
<FormUi label="총대장균군">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="tn"
render={({ field }) => (
<FormUi label="총질소">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="combResdch"
render={({ field }) => (
<FormUi label="결합잔류염소">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="tp"
render={({ field }) => (
<FormUi label="총인">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="trbt"
render={({ field }) => (
<FormUi label="탁도">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="ph"
render={({ field }) => (
<FormUi label="수소이온농도">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="bod"
render={({ field }) => (
<FormUi label="생물학적 산소요구량">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="clIonQnt"
render={({ field }) => (
<FormUi label="염화물">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="smll"
render={({ field }) => (
<FormUi label="냄새">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="cdtnv"
render={({ field }) => (
<FormUi label="전기전도도">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="crmty"
render={({ field }) => (
<FormUi label="색도">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-6">
<FormField
control={form.control}
name="rmrk"
render={({ field }) => (
<FormUi label="비고">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-4">
<h1 className=" col-span-1 pl-2 text-2xl underline">
공급후보지 선택
</h1>
<div className=" col-start-3 col-span-1 ">
<Button >
후보지 조회
</Button>
</div>
<div className=" col-start-4 col-span-1 ">
<Button >
유사사례조회
</Button>
</div>
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-4">
<FormField
control={form.control}
name="sply1"
render={({ field }) => (
<FormUi label="후보지_1">
<Input placeholder="후보지1" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="sply2"
render={({ field }) => (
<FormUi label="후보지_2">
<Input placeholder="후보지2" type="text" {...field} />
</FormUi>
)}
/>
</div>
<div className="col-span-4">
<FormField
control={form.control}
name="sply3"
render={({ field }) => (
<FormUi label="후보지_3">
<Input placeholder="후보지3" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
<div className="grid grid-cols-4">
<h1 className=" col-span-2 pl-2 text-2xl underline">
수요신청 비밀번호
</h1>
<div className="col-start-3 col-span-2">
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormUi label="">
<Input placeholder="10" type="text" {...field} />
</FormUi>
)}
/>
</div>
</div>
</>
);
}
@@ -1,36 +0,0 @@
import { useWrStore } from "@/app/store";
import { UiTable } from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { useEffect } from "react";
import type {
chgBuilding,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
export default function BdstChgModal({ chgBuilding }: { chgBuilding:chgBuilding[] }) {
const {bdst,rain} = useWrStore((state) => {
return state;
});
const { bdstChgHeadList } = bdst;
console.log("chgBuilding", chgBuilding);
return (
<>
<ListDiv>
<UiTable
headlist={bdstChgHeadList}
pageSize={-1}
total={0}
onPageChange={() => {}}
headName={"○건축물 변경 이력"}
tableData={chgBuilding}
children={undefined}
cellClick={undefined}
/>
</ListDiv>
</>
);
}
@@ -1,156 +0,0 @@
"use client";
import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/page";
import { useWrStore } from "@/app/store";
import {
selectClass,
type customRainBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { ScrollArea, SelectBox, UiTable } from "@common/business_components";
import { Button, Input, Label } from "@common/components";
import { useEffect, useState } from "react";
import { RainRegForm } from "../../form/fcltReg/rainReg/rainRegForm";
import { type selectArray } from "@/app/store/common/code";
import { getCity, tableData } from "@/components/lib/func/commom";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { HtdflRegForm } from "../../form/fcltReg/htdflReg/htdflRegForm";
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
import { RswtrRegForm } from "../../form/fcltReg/rswtrReg/RswtrRegForm";
export type objSearchType = {
sgg: string|number;
city: string|number;
};
//RNB(빗물), RST(중수도), HTB(온배수)
type MoType = 'RNB' | 'RST' | 'HTB'; // 여기에 'htdf' 추가
type BdstTypeMap = {
RNB: customRainBdst;
RST: customRswtBdst;
HTB: customRswtBdst; // 해야해// 아직 아노딤
};
interface BdstRegProps<T extends MoType> {
moType: T;
}
export function BdstReg<T extends MoType>({ moType }: BdstRegProps<T>) {
const { rain, code, bdst,findBdst } = useWrStore((state) => {
return state;
});
const [bdstTable, setbdstTable] = useState<BdstTypeMap[T][]>();
const [rainBdstForm, setRainBdstForm] = useState<BdstTypeMap[T]>({} as BdstTypeMap[T]);
const [searchTxt, setSearchTxt] = useState<string>()
const [selectSgg, setSelectSgg] = useState<selectArray[] | []>()
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
const getSelCity = (val: string | number) => {
const cityValue = String(val); // Ensure val is treated as a string
const data = getCity(cityValue, code.sggCd);
setSelectSgg(data);
setObjSearch({ city: cityValue, sgg: '' });
};
const getSgg = (val: string | number) => {
console.log(val);
setObjSearch({...objSearch,sgg: String(val)})
};
const searchBdst=(searchTxt: string | undefined)=>{
let data =objSearch.city;
if(objSearch.city==="" ){
data = String(code.cityCd[0]?.val)
}
if(objSearch.sgg !=="" ){
data = objSearch.sgg
}
//RNB(빗물), RST(중수도), HTB(온배수)
findBdst(String(data), searchTxt || "",moType )
}
useEffect(() => {
if (code.sggCd.length > 0) {
setbdstTable( tableData(bdst.bdstBase, { code }));
}
}, [ bdst]);
const tableClick: (val: number | undefined , headId:string) => void = (val ,headId) => {
if(val!==undefined && bdst?.bdstBase.length>0){
const data:BdstTypeMap[T] =bdst?.bdstBase[val]
if (data) {
setRainBdstForm(data);
}
}
}
useEffect(()=>{
setbdstTable([]) // 초기화 작업
},[])
const nodeList = headMakeColSpan(bdst.moUpHeadList);
return (
<>
<div className="grid grid-cols-12 gap-4 mt-4">
<SelectBox
className="col-span-3 "
label={"시도"}
selectClass={selectClass}
selectArray={code.cityCd || []}
onSelectValue={getSelCity}
>
{""}
</SelectBox>
<SelectBox
className="col-span-3"
label={"시군구"}
selectClass={selectClass}
selectArray={selectSgg || []}
onSelectValue={getSgg}
>
{" "}
</SelectBox>
<Label className="w-20 text-base text-gray-600 mt-4 text-right">건축물명</Label>
<Input className="w-full h-full text-2xl col-span-2 col-start-8" type="text" value={searchTxt || ''} onChange={(e) => setSearchTxt(e.target.value)}/>
<Button className="rounded-lg" onClick={()=>{searchBdst(searchTxt)}}>조회</Button>
</div>
<div className="border-t border-gray-300 my-4"></div>
<div className="h-auto">
<ScrollArea className="h-[20vh]">
<div>
<UiTable
tableData={bdstTable || []}
headlist={bdst.moUpHeadList}
pageSize={-10}
total={-1}
headName={undefined}
cellClick={(idx,headId)=> (tableClick(idx, headId||"" ))}
>
{nodeList}
</UiTable>
</div>
</ScrollArea>
<div className="border-t border-gray-300 my-4"></div>
<ScrollArea className="h-[60vh]">
<div>
{ moType === 'RNB'?
<RainRegForm rainForm={rainBdstForm as customRainBdst} isModal={true} />
:moType==='RST'
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={true}></RswtrRegForm>
:<HtdflRegForm htdflForm={rainBdstForm as customHtdflBdst} isModal={true}></HtdflRegForm>
}
</div>
</ScrollArea>
</div>
</>
);
}
@@ -1,92 +0,0 @@
import { rainRegExcel } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import {
DatePicker,
FileUpload,
Form,
FormField,
FormUi,
Title,
} from "@common/business_components/ui";
import { Button } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useForm } from "react-hook-form";
import type { z } from "zod";
export default function ChkgdExcel({ type }: { type: string }) {
const [files, setFiles] = useState(null);
const [dmdDate, setDmdDate] = useState(new Date());
const defaultValues: z.infer<typeof rainRegExcel> = rainRegExcel.parse({});
const form = useForm<z.infer<typeof rainRegExcel>>({
resolver: zodResolver(rainRegExcel),
defaultValues: defaultValues,
});
const onChangeDate = (val: Date | undefined) => {
if (val) setDmdDate(val);
};
return (
<>
<div>
<Form {...form}>
<div>
<Title
title={
type === "RNB"
? "빗물 이용시설"
: "중수도 이용시설" + "점검 결과등록"
}
></Title>
</div>
<div className="flex justify-between">
<h3 className="text-2xl font-bold text-gray-900">
{"○점검정보 입력"}
</h3>
<Button className="">저장</Button>
</div>
<div>
<FormField
control={form.control}
name="chckYmd"
render={({ field }) => (
<FormUi label="점검일자">
<DatePicker
mode="single"
field={{
value:
field.value && !isNaN(new Date(field.value).getTime())
? new Date(field.value)
: new Date(), // Provide a default Date value
onChange: (date) => field.onChange(date),
}}
selectClass={selectClass}
/>
</FormUi>
)}
/>
<FormField
control={form.control}
name="file"
render={({ field }) => (
<FormUi label="점검결과 파일">
<FileUpload
files={field.value}
setFiles={setFiles}
fileTypes="excel"
></FileUpload>
</FormUi>
)}
/>
</div>
</Form>
</div>
</>
);
}
@@ -1,153 +0,0 @@
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
import { useWrStore } from "@/app/store";
import { ScrollArea, Title, UiTable } from "@common/business_components/ui";
import { Button } from "@common/components/ui";
import { useEffect } from "react";
export default function ChkgdModal({type, obj}:{type:string , obj:any} ){
const { rainChkgdn} = useWrStore((state) => state);
const nodeList = headMakeprfmnc(rainChkgdn?.supWaterHeadList,rainChkgdn?.rainHeadNm ) ;
const rswtnodeList = headMakeprfmnc(rainChkgdn?.rswtDetailHeadList,rainChkgdn?.rainHeadNm ) ;
useEffect(() =>{
},[rainChkgdn])
const cellClick =(val:number|undefined, headId:string)=>{
if(val!=undefined)
console.log(rainChkgdn.supWaterData[val])
}
return(
<>
<div>
<div>
<Title title= {type==='RNB'?'빗물이용시설':'중수도 이용시설' + '지도점검 결과등록' }></Title>
</div>
<div className="flex justify-between">
<h3 className="text-2xl font-bold text-gray-900">{"○"+ obj.bdstNm + `(${obj.chckYmd})`}</h3>
<Button className="">저장</Button>
</div>
<ScrollArea className="h-[60vh]">
<UiTable
headName={"연간 보급수이용량"}
tableData={rainChkgdn.supWaterData||[]}
headlist={rainChkgdn?.supWaterHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{nodeList}
</UiTable>
<UiTable
headName={"연간 빗물이용량"}
tableData={rainChkgdn.supWaterData}
headlist={rainChkgdn?.supWaterHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{nodeList}
</UiTable>
{type !=='RNB'?
<div>
<UiTable
headName={"연간이용수질(1분기)"}
tableData={[]}
headlist={rainChkgdn?.rswtDetailHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{rswtnodeList}
</UiTable>
<UiTable
headName={"연간이용수질(2분기)"}
tableData={[]}
headlist={rainChkgdn?.rswtDetailHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{rswtnodeList}
</UiTable>
<UiTable
headName={"연간이용수질(3분기)"}
tableData={[]}
headlist={rainChkgdn?.rswtDetailHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{rswtnodeList}
</UiTable>
<UiTable
headName={"연간이용수질(4분기)"}
tableData={[]}
headlist={rainChkgdn?.rswtDetailHeadList}
pageSize={0}
total={0}
cellClick={(val, headId) => {
cellClick(val, headId);
}}
onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} }>
{rswtnodeList}
</UiTable>
</div>
:<></>}
</ScrollArea>
</div>
</>
)
}
@@ -1,95 +0,0 @@
import { useWrStore } from "@/app/store";
import { pbnSttHeadList } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn";
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui";
import { Button, Checkbox } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
export default function HeadChModal() {
const { pbnStt } = useWrStore((state) => state);
const items = pbnSttHeadList.map(item => ({id:item.id, label:item.title}));
const FormSchema = z.object({
items: z.array(z.string()).refine((value) => value.some((item) => item), {
message: "You have to select at least one item.",
}),
})
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
})
const onSubmit = (val : z.infer<typeof FormSchema>) =>{
console.log(val)
}
return (
<>
<div>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
<FormField
control={form.control}
name="items"
render={() => (
<FormItem>
<div className="mb-4">
<FormLabel className="text-base">Sidebar</FormLabel>
<FormDescription>
Select the items you want to display in the sidebar.
</FormDescription>
</div>
{items.map((item) => (
<FormField
key={item.id}
control={form.control}
name="items"
render={({ field }) => {
return (
<FormItem
key={item.id}
className="flex flex-row items-start space-x-3 space-y-0"
>
<FormControl>
<Checkbox
checked={field.value?.includes(item.id)}
onCheckedChange={(checked) => {
return checked
? field.onChange([...field.value, item.id])
: field.onChange(
field.value?.filter(
(value) => value !== item.id
)
);
}}
/>
</FormControl>
<FormLabel className="text-sm font-normal">
{item.label}
</FormLabel>
</FormItem>
);
}}
/>
))}
<FormMessage />
</FormItem>
)}
/>
<Button type="submit">Submit</Button>
</form>
</Form>
</div>
</>
);
}
@@ -1,28 +0,0 @@
'use client'
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
import { useWrStore } from "@/app/store";
import { UiTable } from "@common/business_components/ui";
export default function RainChkgdTable() {
const { code, rainChkgdn} = useWrStore((state) => state);
const nodeList = headMakeprfmnc(rainChkgdn?.rainChkgdnHeadList,rainChkgdn?.rainHeadNm ) ;
return(
<>
<UiTable
tableData={[]}
headlist={rainChkgdn.rainChkgdnHeadList}
pageSize={100}
total={10}
headName={"지도점검 결과등록"}
cellClick={()=>{} } >
{nodeList}
</UiTable>
</>
)
}
@@ -1,30 +0,0 @@
'use client'
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
import { useWrStore } from "@/app/store";
import { UiTable } from "@common/business_components/ui";
export default function RswtChkgdTable() {
const { rswtChkgdn} = useWrStore((state) => state);
const nodeList = headMakeprfmnc(rswtChkgdn?.rswtChkgdnHeadList , rswtChkgdn?.rswtHeadNm );
return(
<>
<UiTable
tableData={[]}
headlist={rswtChkgdn.rswtChkgdnHeadList}
pageSize={100}
total={10}
headName={"지도점검 결과등록"}
cellClick={() => { } } onPageChange={function (page: number): void {
throw new Error("Function not implemented.");
} } >
{nodeList}
</UiTable>
</>
)
}
@@ -1,55 +0,0 @@
import { Button } from "@common/components/ui";
import Link from "next/link";
import toast from "react-hot-toast";
export function ToastFormUi(body:string,title:string,url:string,buttonName:string){
//const router = useRouter();
return(
toast.custom((t) => (
<div
className={`${
t.visible ? 'animate-enter' : 'animate-leave'
} w-4/12 h-40 bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5`}
>
<div className="w-full flex-1 py-10">
<div className="flex items-start">
<div className="flex-shrink-0 pt-0.5">
</div>
<div className="ml-3 flex-1">
<p className="text-xl font-medium underline">
{title}
</p>
<p className="mt-1 text-2xl">
{body}
</p>
</div>
</div>
</div>
<div className="flex py-20">
<Button
size='sm'
onClick={() => toast.dismiss(t.id)}
>
<Link href={url}> {buttonName}</Link>
</Button>
</div>
<div className="flex pl-4 pr-4 py-20">
<Button
onClick={() => toast.dismiss(t.id)}
size='sm'
>
닫기
</Button>
</div>
</div>
))
)
}
-16
View File
@@ -1,16 +0,0 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];
export default eslintConfig;
-5
View File
@@ -1,5 +0,0 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
-41
View File
@@ -1,41 +0,0 @@
import type { NextConfig } from "next";
import webpack from "webpack";
const nextConfig: NextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
webpack: (config) => {
config.plugins.push(
new webpack.DefinePlugin({
"import.meta.env.VITE_PORT": JSON.stringify(
process.env.NEXT_PUBLIC_PORT
),
"import.meta.env.VITE_PROXY_HOST": JSON.stringify(
process.env.NEXT_PUBLIC_PROXY_HOST
),
"import.meta.env.VITE_SERVER_API_URL": JSON.stringify(
process.env.NEXT_PUBLIC_SERVER_API_URL
),
"import.meta.env.VITE_SITE_ID": JSON.stringify(process.env.SITE_ID),
"import.meta.env.VITE_CLAIM_NAME": JSON.stringify(
process.env.NEXT_PUBLIC_CLAIM_NAME
),
"import.meta.env.VITE_ACCESS_TOKEN": JSON.stringify(
process.env.NEXT_PUBLIC_ACCESS_TOKEN
),
"import.meta.env.VITE_REFRESH_TOKEN": JSON.stringify(
process.env.NEXT_PUBLIC_REFRESH_TOKEN
),
"import.meta.env.VITE_AUTH_USER_ID": JSON.stringify(
process.env.NEXT_PUBLIC_AUTH_USER_ID
),
"process.env.SITE_ID": JSON.stringify(process.env.NEXT_PUBLIC_SITE_ID),
})
);
return config;
},
};
export default nextConfig;
-36
View File
@@ -1,36 +0,0 @@
{
"name": "wr",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@common/business_components": "workspace:*",
"@common/components": "workspace:*",
"@common/assets": "workspace:*",
"@hookform/resolvers": "^4.1.3",
"@tanstack/react-table": "^8.21.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.474.0",
"next": "15.1.7",
"react-hook-form": "^7.54.2",
"react-hot-toast": "^2.5.2",
"tailwind-merge": "^3.0.1",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/webpack": "^5.28.5",
"eslint": "^9",
"eslint-config-next": "15.1.7",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
-8
View File
@@ -1,8 +0,0 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};
export default config;
-1
View File
@@ -1 +0,0 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 391 B

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 128 B

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>

Before

Width:  |  Height:  |  Size: 385 B

-21
View File
@@ -1,21 +0,0 @@
import type { Config } from "tailwindcss";
import tailwindcssAnimate from "tailwindcss-animate";
import presetConfig from "../../tailwind.config.preset";
export default {
presets: [presetConfig],
content: [
"./src/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"../../packages/common/components/src/ui/**/*.{js,ts,jsx,tsx,mdx}",
"../../packages/common/business_components/src/ui/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
boxShadow: {
blur: "0 0 10px -1px rgba(0, 0, 0, 0.06)",
},
},
},
plugins: [tailwindcssAnimate],
} satisfies Config;
-53
View File
@@ -1,53 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"],
"@common/components/*": ["../../packages/common/components/src/*"],
"@common/components": ["../../packages/common/components/src/index"],
"@common/business_components/*": [
"../../packages/common/business_components/src/*"
],
"@common/business_components": [
"../../packages/common/business_components/src/index"
],
"@common/network": ["../../packages/common/network"]
}
},
"include": [
".eslintrc.*",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.mts",
"**/*.js",
"**/*.cjs",
"**/*.mjs",
"**/*.jsx",
"**/*.json",
".next/types/**/*.ts"
],
"exclude": ["**/node_modules", "**/.*/*"]
}
@@ -1,87 +0,0 @@
.card {
position: relative;
margin: 0.6rem;
box-sizing: border-box;
min-height: 2rem;
border-radius: 0.5rem;
padding: 0.6rem;
font-size: 1.3rem;
color: #666;
}
.card_width10 {width:calc(10% - 12px);}
.card_width20 {width:calc(20% - 12px);}
.card_width25 {width:calc(25% - 12px);}
.card_width30 {width:calc(30% - 12px);}
.card_width33 {width:calc(33.333% - 12px);}
.card_width40 {width:calc(40% - 12px);}
.card_width45 {width:calc(45% - 12px);}
.card_width50 {width:calc(50% - 12px);}
.card_width60 {width:calc(60% - 12px);}
.card_width66 {width:calc(66.666% - 12px);}
.card_width70 {width:calc(70% - 12px);}
.card_width75 {width:calc(75% - 12px);}
.card_width80 {width:calc(80% - 12px);}
.card_width90 {width:calc(90% - 12px);}
.card_width100 {width:calc(100% - 12px);}
.card_nopadding {padding:0 !important;}
.card_nomargin {width:100%;margin:0 !important;padding:0 !important;}
.topline {border-top: 1px solid #ccc;}
.bottomline {border-bottom: 1px solid #e6eef3;background: #fff;}
.card-border {
border: 1px solid #dbe2e6;
background-color: rgba(255, 255, 255, 0.6);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.card-header {
margin-left: -0.6rem;
margin-right: -0.6rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e1e7eb;
padding: 1rem;
}
.card-footer {
margin-left: -0.6rem;
margin-right: -0.6rem;
margin-top: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border-top: 1px solid #e1e7eb;
padding-top: 1rem;
padding-bottom: 1rem;
}
/* 블랙 테마 */
[data-theme="black"] {
.card-border {
border-color: #3f4042;
background-color: rgba(255, 255, 255, 0.065);
}
.card-header {
border-bottom-color: #3f4042;
}
}
@@ -2,7 +2,6 @@ export const styles = {
base: require("./base.css"),
diveicon: require("./diveicon.css"),
grid: require("./grid.css"),
components: require("./components.css"),
} as const;
export type StyleType = keyof typeof styles;
-1
View File
@@ -6,7 +6,6 @@ export default defineConfig({
"src/styles/base.css",
"src/styles/diveicon.css",
"src/styles/grid.css",
"src/styles/components.css",
],
format: ["cjs", "esm"],
dts: true,
@@ -63,7 +63,7 @@
"eslint-plugin-react-refresh": "^0.4.16",
"eslint-plugin-storybook": "^0.11.2",
"globals": "^15.14.0",
"postcss": "^8.5.3",
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"prettier-plugin-tailwindcss": "^0.6.11",
"storybook": "^8.5.3",
@@ -1,10 +1,65 @@
@import "@common/assets/styles/base.css";
@import "@common/assets/styles/diveicon.css";
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: #ffffff;
--foreground: #0a0a0a;
--card: #ffffff;
--card-foreground: #0a0a0a;
--popover: #ffffff;
--popover-foreground: #0a0a0a;
--primary: #2094fa;
--primary-foreground: #fafafa;
--secondary: #f5f5f5;
--secondary-foreground: #0f1e33;
--muted: #f5f5f5;
--muted-foreground: #737373;
--accent: #f5f5f5;
--accent-foreground: #0f1e33;
--destructive: #ff4141;
--destructive-foreground: #fafafa;
--border: #e5e5e5;
--input: #e5e5e5;
--label: #666666;
--ring: #0a0a0a;
--chart-1: #d95b43;
--chart-2: #299392;
--chart-3: #263e4d;
--chart-4: #dfb938;
--chart-5: #f08634;
--radius: 1rem;
}
[data-mode="dark"] {
--background: #0a0a0a;
--foreground: #fafafa;
--card: #0a0a0a;
--card-foreground: #fafafa;
--popover: #0a0a0a;
--popover-foreground: #fafafa;
--primary: #2094fa;
--primary-foreground: #171717;
--secondary: #262626;
--secondary-foreground: #fafafa;
--muted: #262626;
--muted-foreground: #a2a2a2;
--accent: #262626;
--accent-foreground: #fafafa;
--destructive: #b22222;
--destructive-foreground: #fafafa;
--border: #262626;
--input: #262626;
--label: #f1f1f1;
--ring: #d4d4d4;
--chart-1: #3399ff;
--chart-2: #339966;
--chart-3: #ff9933;
--chart-4: #cc66ff;
--chart-5: #ff3399;
}
}
@layer base {
* {
@apply border-border;

Some files were not shown because too many files have changed in this diff Show More