결함 수정

This commit is contained in:
jyha00
2025-07-21 17:50:47 +09:00
parent 91af5fd27c
commit b4140d6457
8 changed files with 71 additions and 68 deletions
@@ -166,8 +166,8 @@ export default function HtdflSttn() {
value={objSearch.sgg} // value props 추가
onSelectValue={getSgg}
/>
<div className="col-span-2 flex flex-row space-x-2">
<Label className="w-28 mt-2 text-xl text-gray-600">
<div className="col-span-2 flex flex-row space-x-2 ml-3 mt-2">
<Label className="w-28 mt-2 text-xl">
{"시설명"}
</Label>
<SearchInput
@@ -206,12 +206,12 @@ export default function RainSttn() {
value={objSearch.sgg} // value props 추가
onSelectValue={getSgg}
/>
<div className="col-span-2 flex flex-row space-x-2">
<Label className="w-28 mt-2 text-xl text-gray-600">
<div className="col-span-2 flex flex-row space-x-2 ml-3 mt-2">
<Label className="w-28 mt-2 text-xl">
{"시설명"}
</Label>
<SearchInput
className={"w-full h-full text-2xl"}
className={"w-full text-2xl"}
label={""}
textValue={fcltNm || ""}
setText={setFcltNm}
@@ -164,8 +164,8 @@ export default function RswtSttn() {
getSgg
}
/>
<div className="col-span-2 flex flex-row space-x-2">
<Label className="w-28 mt-2 text-xl text-gray-600">
<div className="col-span-2 flex flex-row space-x-2 ml-3 mt-2">
<Label className="w-28 mt-2 text-xl">
{"시설명"}
</Label>
<SearchInput
+11 -2
View File
@@ -271,7 +271,7 @@ export const InputTableBody = (
// 총합계 행이면 "구분"에서 colSpan=2로 병합
if (
data["구분"] === 0 &&
(data["구분"] === 0 || data["용수명"] === 0) &&
head.id === "구분"
) {
return (
@@ -286,11 +286,20 @@ export const InputTableBody = (
}
// 총합계(합계) 행이면 "용수명" 컬럼은 렌더링하지 않음
if (
data["구분"] === 0 &&
(data["구분"] === 0 || data["용수명"] === 0) &&
head.id === "용수명"
) {
return null;
}
// 총합계 행의 나머지 셀에도 색상 적용
if (data["구분"] === 0 || data["용수명"] === 0) {
return (
<TableCell key={head.id + headIndex} className="bg-[#d5e1eb] font-bold text-right">
{data[head.id as keyof any] ?? ""}
</TableCell>
);
}
// mergeCell 처리
if (head.mergeCell) {
const rowSpan = getRowSpan(chgRes, head.id, dataIndex);
@@ -2,15 +2,14 @@ import { useWrStore } from "@/app/store";
import { numSize, txtSize } from "@/app/store/common/code/basicCode";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { formH1Class } from "@/components/lib/class/comClass";
import { handleCommaNumberChange } from "@/components/lib/func/commom";
import {
DatePicker,
FormField,
FormUi,
DatePicker,
SelectBox,
type SelectDataType,
} from "@common/business_components";
import { Input } from "@common/components";
import { Input } from "@common/components";
import { useEffect, useState } from "react";
export default function BdstReg({ form, type }: { form: any; type?: string }) {
@@ -18,39 +17,39 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
return state;
});
const {userSiSggCd } =code
const { userSiSggCd } = code
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([])
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([])
// const [selectSgg, setSelectSgg] = useState<SelectDataType[] | undefined>();
// const [objSearch, setObjSearch] = useState<objSearchType>({
// sgg: "",
// city: "",
// });
useEffect(() =>{
if(userSiSggCd.length===2 && code.cityCd.length>0){
useEffect(() => {
if (userSiSggCd.length === 2 && code.cityCd.length > 0) {
const city = code.cityCd.filter((item) => item.val === userSiSggCd)
const sgg = code.sggCd.filter((item) => item.val.slice(0,2) === userSiSggCd )
sgg.unshift({text:'전체' , val:'0'})
const sgg = code.sggCd.filter((item) => item.val.slice(0, 2) === userSiSggCd)
sgg.unshift({ text: '전체', val: '0' })
setUserCityCd(city) // Fix: Ensure city is of type SelectDataType[]
setUserSggCd(sgg)
if (city[0]?.val) {
// 여기 중요
queueMicrotask(() => {
form.setValue("ctpvCd", Number(city[0]?.val), { shouldDirty: true, shouldTouch: true, shouldValidate: true });
});
// 여기 중요
queueMicrotask(() => {
form.setValue("ctpvCd", Number(city[0]?.val), { shouldDirty: true, shouldTouch: true, shouldValidate: true });
});
}
}else if(userSiSggCd.length===5 && code.cityCd.length>0 && code.sggCd.length>0) {
const city = code.cityCd.filter((item) => item.val === userSiSggCd.slice(0,2))
} else if (userSiSggCd.length === 5 && code.cityCd.length > 0 && code.sggCd.length > 0) {
const city = code.cityCd.filter((item) => item.val === userSiSggCd.slice(0, 2))
const sgg = code.sggCd.filter((item) => item.val === userSiSggCd)
setUserSggCd(sgg)
setUserCityCd(city)
form.setValue('ctpvCd',Number(city[0]?.val) )
form.setValue('sggCd',Number(sgg[0]?.val) )
form.setValue('ctpvCd', Number(city[0]?.val))
form.setValue('sggCd', Number(sgg[0]?.val))
}
},[form, userSiSggCd, code.cityCd, code.sggCd])
}, [form, userSiSggCd, code.cityCd, code.sggCd])
@@ -70,15 +69,13 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
useEffect(() =>{
console.log('form.formState ', form.watch())
},[form.formState])
useEffect(() => {
console.log('form.formState ', form.watch("archArea"))
}, [form.formState])
return (
<>
<h1 className={formH1Class}> { type !== "HTB"?"건축물 기본 정보": '시설 기본 정보'}</h1>
<h1 className={formH1Class}> {type !== "HTB" ? "건축물 기본 정보" : '시설 기본 정보'}</h1>
<div className="grid grid-cols-6 gap-2 mt-4">
<div className="col-span-3">
<FormField
@@ -127,16 +124,16 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
control={form.control}
name="bdstNm"
render={({ field }) => (
<FormUi label={ type !== "HTB"?"건축물명": '시설명'}>
<FormUi label={type !== "HTB" ? "건축물명" : '시설명'}>
<Input
className={selectClass}
placeholder= {type !== "HTB"?"건축물 명 입력하세요":'시설명 입력하세요' }
placeholder={type !== "HTB" ? "건축물 명 입력하세요" : '시설명 입력하세요'}
type="text"
onChange={(e) => {
field.onChange(e.target.value)
}}
value={field.value||''}
maxLength={txtSize}
onChange={(e) => {
field.onChange(e.target.value)
}}
value={field.value || ''}
maxLength={txtSize}
/>
</FormUi>
)}
@@ -147,16 +144,16 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
control={form.control}
name="daddr"
render={({ field }) => (
<FormUi label= { type !== "HTB"?"건축물 주소": '시설 주소'} >
<FormUi label={type !== "HTB" ? "건축물 주소" : '시설 주소'} >
<Input
className={selectClass}
placeholder="위치를 입력해주세요"
type="search"
onChange={(e) => {
field.onChange(e.target.value)
}}
value={field.value||''}
maxLength={50}
}}
value={field.value || ''}
maxLength={50}
/>
</FormUi>
)}
@@ -168,7 +165,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
control={form.control}
name="frstArchPrmsnDt"
render={({ field }) => (
<FormUi label= { type !== "HTB"?"최초건축허가일": '준공년도'} >
<FormUi label={type !== "HTB" ? "최초건축허가일" : '준공년도'} >
<DatePicker
mode={"single"}
field={{
@@ -221,9 +218,9 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
placeholder="면적을 입력하세요"
type="text"
onChange={(e) => {
handleCommaNumberChange(e, field.onChange);
field.onChange(e.target.value)
}}
value={field.value||''}
value={field.value || ''}
maxLength={numSize}
/>
</FormUi>
@@ -251,7 +248,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
/>
</div>
</div>
</>
</>
) : (
<></>
)}
@@ -254,8 +254,9 @@ export default function HtdflRegForm({
<h1 className={formH1Class}>온배수 시설 운영현황</h1>
</div>
<div className="grid grid-cols-10 gap-1 mt-4">
<div className="col-span-5">
{/* <div className="grid grid-cols-10 gap-1 mt-4"> */}
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.orgwtWtritSpt"
@@ -276,7 +277,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.orgwtOcrnProcs"
@@ -297,7 +298,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.wtritEntrcTp"
@@ -319,7 +320,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.emsnExitTp"
@@ -341,7 +342,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.amtgnr"
@@ -363,7 +364,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.prcsProcsYn"
@@ -382,7 +383,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.prcsFcltCpct"
@@ -404,7 +405,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.fmYn"
@@ -423,7 +424,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.utztnCpct"
@@ -445,7 +446,7 @@ export default function HtdflRegForm({
)}
/>
</div>
<div className="col-span-5">
<div className="col-span-6">
<FormField
control={form.control}
name="reuseBuilding.0.htdflObj.utztnUsg"
@@ -315,7 +315,7 @@ export default function RainRegForm({
const value = field.value;
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
return (
<div className="flex items-center gap-2">
// <div className="flex items-center gap-2">
<FormUi label="집수면 면적(m²)">
<Input
className={selectClass}
@@ -338,7 +338,7 @@ export default function RainRegForm({
maxLength={numSize}
/>
</FormUi>
</div>
// </div>
);
}}
/>
@@ -413,7 +413,7 @@ export default function RainRegForm({
// const isUnknown = value === null || value === "-"; // 또는 Number(value) === -1
return (
<div className="flex items-center gap-2">
// <div className="flex items-center gap-2">
<FormUi label="처리공정">
<Input
className={" h-full !text-xl col-span-4"}
@@ -426,7 +426,7 @@ export default function RainRegForm({
maxLength={txtSize}
/>
</FormUi>
</div>
// </div>
);
}}
/>
@@ -5,16 +5,12 @@ import type {
conCostFeeType,
ContCostMap,
} from "@/app/store/common/searchCode/type";
import { yearOptions } from "@/components/lib/func/commom";
import { SelectBox, UiTable } from "@common/business_components/ui";
import { UiTable } from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Label, } from "@common/components/ui";
import { useEffect, useState } from "react";
export function ConstCostFeeTable() {
const { coRvw, constCostRes } = useWrStore((state) => state);
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
const [constCostData, setConstCostData] = useState<ContCostMap[]>([]);