From 720033ece6d8fc8d4d42cf87bf1fee1686e7b5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 1 Feb 2024 11:30:25 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B1=B4=EC=84=A4=EA=B8=B0=EC=A4=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../list/StandardCodeSearchForm.jsx | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx index 8c85171..872f30a 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx @@ -16,6 +16,10 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){ }); const [subTabsVisible, setSubTabsVisible] = useState(false); + const [cat1SelectOption, setCat1SelectOption] = useState([]) + const [cat2SelectOption, setCat2SelectOption] = useState([]) + const [cat3SelectOption, setCat3SelectOption] = useState([]) + function getSelectBoxOption(groupCd, handler){ EgovNet.requestFetch( '/standardCode/category-option?listCode='+groupCd, @@ -44,19 +48,39 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){ }, [searchCondition]); useEffect(() => { - if(searchCondition.tab){ - getSelectBoxOption(searchCondition.tab, (resp)=>{ - debugger + setSearchCondition({...searchCondition, category1: '', category2: '', category3: ''}) + const groupCd = searchCondition.tab; + getSelectBoxOption(groupCd, (resp)=>{ + const options = []; + resp.result.groupList.forEach(function (item, index){ + options.push() }) - } + setCat1SelectOption(options) + }) }, [searchCondition.tab]); useEffect(() => { - + setSearchCondition({...searchCondition, category2: '', category3: ''}) + const groupCd = searchCondition.tab+searchCondition.category1; + getSelectBoxOption(groupCd, (resp)=>{ + const options = []; + resp.result.groupList.forEach(function (item, index){ + options.push() + }) + setCat2SelectOption(options) + }) }, [searchCondition.category1]); useEffect(() => { - + setSearchCondition({...searchCondition, category3: ''}) + const groupCd = searchCondition.tab+searchCondition.category1+searchCondition.category2; + getSelectBoxOption(groupCd, (resp)=>{ + const options = []; + resp.result.groupList.forEach(function (item, index){ + options.push() + }) + setCat3SelectOption(options) + }) }, [searchCondition.category2]); @@ -78,23 +102,28 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){