건설기준코드 검색 기능 추가
parent
52e6aed96e
commit
720033ece6
|
|
@ -16,6 +16,10 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
||||||
});
|
});
|
||||||
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
||||||
|
|
||||||
|
const [cat1SelectOption, setCat1SelectOption] = useState([])
|
||||||
|
const [cat2SelectOption, setCat2SelectOption] = useState([])
|
||||||
|
const [cat3SelectOption, setCat3SelectOption] = useState([])
|
||||||
|
|
||||||
function getSelectBoxOption(groupCd, handler){
|
function getSelectBoxOption(groupCd, handler){
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/standardCode/category-option?listCode='+groupCd,
|
'/standardCode/category-option?listCode='+groupCd,
|
||||||
|
|
@ -44,19 +48,39 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
||||||
}, [searchCondition]);
|
}, [searchCondition]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(searchCondition.tab){
|
setSearchCondition({...searchCondition, category1: '', category2: '', category3: ''})
|
||||||
getSelectBoxOption(searchCondition.tab, (resp)=>{
|
const groupCd = searchCondition.tab;
|
||||||
debugger
|
getSelectBoxOption(groupCd, (resp)=>{
|
||||||
|
const options = [];
|
||||||
|
resp.result.groupList.forEach(function (item, index){
|
||||||
|
options.push(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||||
|
})
|
||||||
|
setCat1SelectOption(options)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}, [searchCondition.tab]);
|
}, [searchCondition.tab]);
|
||||||
|
|
||||||
useEffect(() => {
|
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(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||||
|
})
|
||||||
|
setCat2SelectOption(options)
|
||||||
|
})
|
||||||
}, [searchCondition.category1]);
|
}, [searchCondition.category1]);
|
||||||
|
|
||||||
useEffect(() => {
|
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(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||||
|
})
|
||||||
|
setCat3SelectOption(options)
|
||||||
|
})
|
||||||
}, [searchCondition.category2]);
|
}, [searchCondition.category2]);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -78,23 +102,28 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
||||||
</li>
|
</li>
|
||||||
<li className="third_1 L">
|
<li className="third_1 L">
|
||||||
<label className="f_select" htmlFor="sel1">
|
<label className="f_select" htmlFor="sel1">
|
||||||
<select id="sel1" title="조건" value={searchCondition.category1}>
|
<select id="sel1" title="조건" value={searchCondition.category1}
|
||||||
|
onChange={(e)=>{setSearchCondition({...searchCondition, category1: e.target.value})}}>
|
||||||
<option value="">전체</option>
|
<option value="">전체</option>
|
||||||
|
{cat1SelectOption}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li className="third_1 L">
|
<li className="third_1 L">
|
||||||
<label className="f_select w_306" htmlFor="sel1">
|
<label className="f_select w_306" htmlFor="sel1">
|
||||||
<select id="sel2" title="조건" value={searchCondition.category2}>
|
<select id="sel2" title="조건" value={searchCondition.category2}
|
||||||
|
onChange={(e)=>{setSearchCondition({...searchCondition, category2: e.target.value})}}>
|
||||||
<option value="">전체</option>
|
<option value="">전체</option>
|
||||||
|
{cat2SelectOption}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li className="third_1 L">
|
<li className="third_1 L">
|
||||||
<label className="f_select w_306" htmlFor="sel1">
|
<label className="f_select w_306" htmlFor="sel1">
|
||||||
<select id="sel3" title="조건" value={searchCondition.category3} >
|
<select id="sel3" title="조건" value={searchCondition.category3}
|
||||||
|
onChange={(e)=>{setSearchCondition({...searchCondition, category3: e.target.value})}}>
|
||||||
<option value="">전체</option>
|
<option value="">전체</option>
|
||||||
|
{cat3SelectOption}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue