[BO] 수정사항 반영

This commit is contained in:
kangsunlee
2025-07-15 17:40:06 +09:00
parent cbf4cb8a0a
commit 15f29bdf11
13 changed files with 64 additions and 57 deletions

View File

@@ -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);