Merge commit '971c4a56151a43cb7599da3dd1301792076a731a' into iipbs/wr/dev

This commit is contained in:
truthwing
2025-03-10 18:33:11 +09:00
8 changed files with 96 additions and 91 deletions
+3 -1
View File
@@ -5,4 +5,6 @@
node_modules
# misc
.DS_Store
.DS_Store
apps/wr/.next/**/*
apps/fo/.next/**/*
@@ -1,7 +1,7 @@
'use client'
import { ScrollArea, SearchDiv, SelectBox, UiTable } from '@common/business_components';
import { Button, TableHead, TableRow } from '@common/components';
import { Button } from '@common/components';
import { PublicReuseFaciltyFormInsert } from '../../../../components/ui/publicReuseInsertForm';
import { useWrStore } from '../../../store';
@@ -11,43 +11,44 @@ import { useWrStore } from '../../../store';
const {pubFac} = useWrStore((state) => state);
const { pubFacHeadList, publicReuseFacilityData, selectLabel} = pubFac;
console.log(pubFacHeadList)
const searchDiv ='시군구'
const selectBox = [{text:'한양', value:1}]
const headName= ()=>{
return(
<h1 className="pl-3 text-xl">○공공 허수처리시설 등록</h1>
)
const searchDiv = '시군구'
const selectBox = [{ text: '한양', val: "1" }, { text: '서울', val: "2" }, { text: '부산', val: "3" }]
const headName = () => {
return (
<h1 className="pl-3 text-xl">○공공 허수처리시설 등록</h1>
)
}
return ( <>
<div className="grid grid-cols-2 gap-4 h-full">
<div className='col-span-2'>
<h1 className="pl-3 text-2xl" > 하수재이용시설 등록</h1>
<SearchDiv >
<div className='flex'>
<SelectBox label={searchDiv} selectArray={selectBox} />
<Button className ='mr-4' size='sm'>조회</Button>
<Button className ='mr-4' size='sm'>신규추가</Button>
const onSelectValue = (val: string) => {
console.log(val)
}
return (
<>
<div className="grid grid-cols-2 gap-4 h-full">
<div className='col-span-2'>
<h1 className="pl-3 text-2xl" > 하수재이용시설 등록</h1>
<div className="m-8">
<SearchDiv>
<div className='w-4/5 grid grid-cols-12 gap-1 mx-4'>
<SelectBox className='col-span-2' label={searchDiv} selectArray={selectBox} onSelectValue={onSelectValue} />
</div>
<div className='w-1/5 flex items-center justify-end'>
<Button className='mr-4 rounded-md'>조회</Button>
<Button className='mr-4 rounded-md'>신규추가</Button>
</div>
</SearchDiv>
{/* </div> */}
</div>
</div>
</SearchDiv>
</div>
<div className="col-span-1">
<UiTable tableData={publicReuseFacilityData} headlist={pubFacHeadList} pageSize={100} total={10} headName={headName()} children={undefined}>
</ UiTable>
<UiTable tableData={publicReuseFacilityData} headlist={pubFacHeadList} pageSize={100} total={10} headName={headName()} children={undefined}/>
</div>
<div className="col-span-1 max-h-full overflow-y-scroll">
<ScrollArea>
<PublicReuseFaciltyFormInsert></PublicReuseFaciltyFormInsert>
{/* <ScrollBar orientation="vertical"></ScrollBar> */}
<PublicReuseFaciltyFormInsert />
{/* <ScrollBar orientation="vertical"></ScrollBar> */}
</ScrollArea>
</div>
</div>
</>
)}
</div>
</>
)
}
+7 -5
View File
@@ -1,13 +1,15 @@
import { createStore } from 'zustand/vanilla';
import { pubFacActionsExport, pubFacStateExport, type pubFacState, type pubFacType } from './publicReuseFaciltyInsert/index';
import { buildingTableActionsExport, buildingtableStateExport, type buildingTableType } from './rainReuseFacilityInsert';
export type WrStore = pubFacType & buildingTableType;
export const StoreZus = (initState: pubFacState = pubFacStateExport) => {
import { pubFacActionsExport, pubFacStateExport, type pubFacState } from './publicReuseFaciltyInsert/index';
import { buildingTableActionsExport, buildingtableStateExport, type buildingTableState, type buildingTableType } from './rainReuseFacilityInsert';
export type WrStore = pubFacState & buildingTableType;
export const StoreZus = (initState: buildingTableState& pubFacState = {
...pubFacStateExport,
...buildingtableStateExport
}) => {
return createStore<WrStore>()((set) => {
return {
...initState,
...pubFacActionsExport(set),
...buildingtableStateExport,
...buildingTableActionsExport(set)
}
})
+10 -10
View File
@@ -1,15 +1,14 @@
"use client";
import { SelectBox } from "@common/business_components";
import { FileUpload, UiTable } from "@common/business_components/ui";
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui/form";
import { Button, FileSearch, Input } from "@common/components";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui/form";
import { Button, DatePicker, Input } 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/index";
import { SelectBox } from "@common/business_components";
import { DatePicker } from "@common/components";
const formSchema = z.object({
username: z.string().min(2).max(50),
@@ -17,13 +16,14 @@ const formSchema = z.object({
});
type typeOfForm = {
labelName: string;
type: string;
selectvlaue?: { text: string; val: string }[];
}
// type typeOfForm = {
// labelName: string;
// type: string;
// selectvlaue?: { text: string; val: string }[];
// }
export function PublicReuseFaciltyFormInsert() {
const { upHeadList, publicReuseFacilityUper } = useWrStore((state) => state);
const { pubFac } = useWrStore((state) => state);
const { upHeadList, publicReuseFacilityUper } = pubFac;
const total = 100;
const form = useForm<z.infer<typeof formSchema>>({
@@ -1,7 +1,7 @@
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
import * as React from "react"
import { cn } from "@/lib/utils"
import { cn } from "../../lib/utils"
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
@@ -1,9 +1,9 @@
function SearchDiv ({children}:{ children: React.ReactNode; }) {
return (
<div className="flex border border-black m-4 rounded-lg">
<div className="flex border border-black m-4 rounded-lg min-h-[80px]">
{children}
</div>
)
}
export { SearchDiv };
export { SearchDiv };
@@ -17,9 +17,9 @@ const SelectBox = React.forwardRef<
return (
<div className={className+" flex items-center"} ref={ref}>
{label && <Label className="m-4 text-lg w-1/4">{label}</Label>}
{label && <Label className="m-4 text-2xl w-1/4">{label}</Label>}
<Select onValueChange={onSelectValue}>
<SelectTrigger className="ml-8 w-3/4 text-lg">
<SelectTrigger className="ml-8 w-3/4 text-2xl">
<SelectValue placeholder={placeHolder} />
</SelectTrigger>
<SelectContent>
@@ -1,49 +1,49 @@
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
import UiPageNations from "./uiPageNations";
type UiTableProps = {
headName: React.ReactNode|undefined;
type UiTableProps = {
headName: React.ReactNode | undefined;
tableData: { [key: string]: string | number | boolean }[];
headlist: UiHeadProps[];
pageSize: number;
total: number;
children: React.ReactNode|undefined;
children: React.ReactNode | undefined;
}
type UiHeadProps={
id:string;
title:string;
type UiHeadProps = {
id: string;
title: string;
}
export function UiTable({ tableData, headlist,pageSize , total, children,headName}: UiTableProps) {
export function UiTable({ tableData, headlist, pageSize, total, children, headName }: UiTableProps) {
const cur = 1;
return (
<>
{headName?headName:<></>}
<Table>
<TableHeader>
{children? <>{children}</>:<TableRow>
{headlist?.map((head) => (
<TableHead key={head.id}>{head.title}</TableHead>
))}
</TableRow>}
</TableHeader>
<TableBody className='text-center'>
{tableData?.map((el: { [key: string]: string | number | boolean },index) => (
<TableRow key={index+"row"} >
{headlist.map((head) => (
<TableCell key={head.id+index}>{el[head.id]}</TableCell>
))}
</TableRow>
return (
<>
{headName ? headName : <></>}
<Table>
<TableHeader>
{children ? <>{children}</> : <TableRow>
{headlist?.map((head) => (
<TableHead key={head.id}>{head.title}</TableHead>
))}
</TableBody>
</Table>
{total <=0? <></>: <UiPageNations total={total} cur={cur} pageSize={pageSize} />}
</>
);
}
</TableRow>}
</TableHeader>
<TableBody className='text-center'>
{tableData?.map((el: { [key: string]: string | number | boolean }, index) => (
<TableRow key={index + "row"} >
{headlist.map((head) => (
<TableCell key={head.id + index}>{el[head.id]}</TableCell>
))}
</TableRow>
))}
</TableBody>
</Table>
{total <= 0 ? <></> : <UiPageNations total={total} cur={cur} pageSize={pageSize} />}
</>
);
}