Compare commits
6
Commits
ff83a6c7dd
...
d9c77bcc5b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9c77bcc5b | ||
|
|
24d7ed06fe | ||
|
|
7c03f04078 | ||
|
|
efa63f9c6a | ||
|
|
37c2901976 | ||
|
|
12f6f42b0e |
+13
-2
@@ -1,9 +1,20 @@
|
||||
import {PublicReuseFaciltyInsert }from './publicReuseFaciltyInsert/page';
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@common/components/ui';
|
||||
|
||||
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<PublicReuseFaciltyInsert />
|
||||
<>
|
||||
<div className='flex'>
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert"> 하수재이용 시설 등록</Link>
|
||||
</Button>
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="reuseFaciltyManage/reuseFacilityInsert/waterReuseFaciltyInsert"> 물재이용 시설 등록</Link>
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
+4
-5
@@ -3,10 +3,9 @@
|
||||
import {SearchDiv, SelectBox, UiTable } from '@common/business_components';
|
||||
import { Button, TableRow } from '@common/components';
|
||||
import { TableHead } from '@common/components';
|
||||
import Style from "../style/PublicReuseFaciltyInsert.module.css";
|
||||
import { useWrStore } from '../store';
|
||||
import type { TableUpperProps } from '../store/publicReuseFaciltyInsert';
|
||||
import { PublicReuseFaciltyFormInsert } from '../component/publicReuseInsertForm';
|
||||
import { useWrStore } from '../../../store';
|
||||
import type { TableUpperProps } from '../../../store/publicReuseFaciltyInsert';
|
||||
import { PublicReuseFaciltyFormInsert } from '../../../../components/ui/publicReuseInsertForm';
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +27,7 @@ import { PublicReuseFaciltyFormInsert } from '../component/publicReuseInsertFor
|
||||
|
||||
|
||||
|
||||
export function PublicReuseFaciltyInsert() {
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const { upHeadList, publicReuseFacilityUper} = useWrStore((state) => state);
|
||||
const nodeList= headMakeColSpan(upHeadList);
|
||||
const total = 100;
|
||||
@@ -0,0 +1,63 @@
|
||||
'use client'
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { TableUpperProps } from "@/app/store/publicReuseFaciltyInsert";
|
||||
import { SearchDiv, SelectBox, UiTable } from "@common/business_components";
|
||||
import { Button, TableHead, TableRow } from "@common/components";
|
||||
|
||||
|
||||
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 { upHeadList, publicReuseFacilityUper} = useWrStore((state) => state);
|
||||
const nodeList= headMakeColSpan(upHeadList);
|
||||
const total = 100;
|
||||
|
||||
|
||||
const searchDiv ='시군구'
|
||||
const selectBox = [{text:'한양', value:1}]
|
||||
const headName= ()=>{
|
||||
return(
|
||||
<h1 className="pl-3 text-xl">○공공 허수처리시설 등록</h1>
|
||||
)
|
||||
}
|
||||
|
||||
return(
|
||||
<>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
|
||||
<div className="colsapn-1">
|
||||
<UiTable publicReuseFacility={publicReuseFacilityUper} headlist={upHeadList} pageSize={100} total={total} headName={headName()}>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
<div className="colsapn-1 h-full">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { useWrStore } from "../store";
|
||||
import Style from "../style/PublicReuseFaciltyInsert.module.css";
|
||||
import { useWrStore } from "../../app/store/index";
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import { DatePicker } from "@common/components";
|
||||
|
||||
@@ -7,12 +7,8 @@ const styles = {
|
||||
marginLeft : '2rem',
|
||||
display : 'flex'
|
||||
} as React.CSSProperties,
|
||||
selectStyle : {
|
||||
marginLeft: '1rem',
|
||||
width:'8rem'
|
||||
} as React.CSSProperties,
|
||||
labelStyle : {
|
||||
margin:'0.8rem 0.8rem 0.8rem 0.8rem',
|
||||
margin:'0.8rem 0.8rem 0.8rem 1rem',
|
||||
fontSize: '10px',
|
||||
} as React.CSSProperties
|
||||
}
|
||||
@@ -22,14 +18,14 @@ interface SelectBox1 {
|
||||
val:string
|
||||
}
|
||||
|
||||
function SelectBox(props: {label : string, selectArray: SelectBox1[]}){
|
||||
const placeHolder = props.selectArray.length > 0 ? props.selectArray[0].text : "";
|
||||
function SelectBox(props: {label : string, selectArray: SelectBox1[], styleClassName : string, styleSelect : React.CSSProperties}){
|
||||
const placeHolder = props.selectArray?.[0]?.text ?? "";
|
||||
|
||||
return (
|
||||
<div style={styles.selectBoxDiv}>
|
||||
<div className={props.styleClassName+" flex"} >
|
||||
{props.label && <Label style={styles.labelStyle}>{props.label}</Label>}
|
||||
<Select style={styles.selectStyle}>
|
||||
<SelectTrigger style={styles.selectStyle} className="w-[180px]">
|
||||
<Select>
|
||||
<SelectTrigger style={props.styleSelect} className="">
|
||||
<SelectValue placeholder={placeHolder} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
|
||||
import { type TableUpperProps } from '../../../../../../apps/wr/app/store/publicReuseFaciltyInsert/index';
|
||||
import UiPageNations from "./uiPageNations";
|
||||
|
||||
|
||||
interface UiTableProps {
|
||||
headName: string;
|
||||
type UiTableProps = {
|
||||
headName: React.ReactNode|undefined;
|
||||
publicReuseFacility: { [key: string]: string | number | boolean }[];
|
||||
headlist: TableUpperProps[];
|
||||
headlist: UiHeadProps[];
|
||||
pageSize: number;
|
||||
total: number;
|
||||
children: React.ReactNode|undefined;
|
||||
}
|
||||
|
||||
type UiHeadProps={
|
||||
id:string;
|
||||
title:string;
|
||||
|
||||
}
|
||||
export function UiTable({ publicReuseFacility, headlist,pageSize , total, children,headName}: UiTableProps) {
|
||||
const cur = 1;
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>{headName}</p>
|
||||
{headName?headName:<></>}
|
||||
<Table>
|
||||
<TableHeader>
|
||||
{children? <>{children}</>:<TableRow>
|
||||
|
||||
Reference in New Issue
Block a user