[BO] 수정사항 반영
This commit is contained in:
@@ -492,8 +492,9 @@ const setSelectBoxUiCode = ({
|
||||
codeList,
|
||||
parentSelector,
|
||||
childSelector,
|
||||
defaultOptionText = '전체',
|
||||
selectedParentCode = '',
|
||||
selectedChildCode = ''
|
||||
selectedChildCode = '',
|
||||
}) => {
|
||||
const $parent = $(parentSelector);
|
||||
const $child = $(childSelector);
|
||||
@@ -501,16 +502,20 @@ const setSelectBoxUiCode = ({
|
||||
if (!codeList?.nodes || !$parent.length || !$child.length) return;
|
||||
|
||||
const renderOptions = ($el, list, selected) => {
|
||||
$el.html('<option value="">전체</option>');
|
||||
$el.html(`<option value="">${defaultOptionText}</option>`);
|
||||
list.forEach(item => {
|
||||
const val = item.id.split('.').pop();
|
||||
const isSelected = item.id === selected ? 'selected' : '';
|
||||
$el.append(`<option value="${item.id}" ${isSelected}>${val}. ${item.codeText}</option>`);
|
||||
});
|
||||
|
||||
if (selected) {
|
||||
$el.val(selected);
|
||||
}
|
||||
};
|
||||
|
||||
const loadChildren = (parentId, selectedChild = '') => {
|
||||
$child.html('<option value="">전체</option>');
|
||||
$child.html(`<option value="">${defaultOptionText}</option>`);
|
||||
if (!parentId) return;
|
||||
|
||||
const parent = codeList.nodes.find(n => n.id === parentId);
|
||||
|
||||
Reference in New Issue
Block a user