[FO] 일계수 수입/지출의 종류 selectbox 에서 input 으로 변경
This commit is contained in:
@@ -54,42 +54,14 @@
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="select-group">
|
||||
<div class="select-label">
|
||||
<p class="label-txt">
|
||||
지출의 종류
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="categorySelf" class="label-txt">
|
||||
지출의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div id="categoryCode" class="component-select bottom-sheet" data-props-default="지출 종류를 선택해 주세요" data-props-type="bottomSheet">
|
||||
<input type="hidden1" name="categoryCode" th:value="${detail.categoryCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
<div class="select-options">
|
||||
<div class="select-header">
|
||||
<p>지출의 종류</p>
|
||||
<button type="button" class="select-close">
|
||||
<span class="hide-txt">닫기</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option"
|
||||
th:each="uiCode : ${recordExpense}"
|
||||
th:data-value="${uiCode.id}"
|
||||
th:text="${uiCode.codeText}"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input input-invalid" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="지출의 종류를 입력해 주세요">
|
||||
</div>
|
||||
<ul class="input-info">
|
||||
<li>지출 종류를 입력해 주세요.</li>
|
||||
</ul>
|
||||
<div class="input-field">
|
||||
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="지출의 종류를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${expenseList}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.categoryLabel}]] [[${item.categorySelf}]]</p>
|
||||
<p class="item-name">[[${item.categorySelf}]]</p>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="delete" th:onclick="formControl.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="formControl.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
@@ -150,8 +150,8 @@
|
||||
remove: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
reset: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||
},
|
||||
month: [[${reqVO.searchMonth}]],
|
||||
groupNo: [[${reqVO.groupNo}]],
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
@@ -209,6 +209,17 @@
|
||||
// });
|
||||
},
|
||||
_bindModelUI() {
|
||||
etUI.initUI();
|
||||
|
||||
const $select2 = document.querySelector('#unitCode');
|
||||
const selectboxInstance2 = new etUI.components.SelectBox();
|
||||
selectboxInstance2.core.init($select2, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="unitCode"]').val(dataValue)
|
||||
}
|
||||
});
|
||||
|
||||
let $formWrap = $(bind.form.selector).find('form');
|
||||
$formWrap.on('keyup', 'input[name="price"]', function() {
|
||||
// TODO : UI disabled
|
||||
@@ -239,47 +250,9 @@
|
||||
function(rstHtml, status) {
|
||||
$('.modal01').find('.modal-content').html(rstHtml);
|
||||
|
||||
// TODO
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
||||
|
||||
/*
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'), {
|
||||
onChange: function() {
|
||||
console.log('sssssssssss')
|
||||
},
|
||||
selectItemCallback: function() {
|
||||
// TODO : console.log ?
|
||||
console.log(1111)
|
||||
}
|
||||
});
|
||||
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'), {
|
||||
onChange: function() {
|
||||
console.log('sssssssssss')
|
||||
},
|
||||
selectItemCallback: function() {
|
||||
console.log(3333)
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
/*document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
||||
console.log(e.detail);
|
||||
console.log(e.detail.value);
|
||||
});
|
||||
|
||||
const selectbox2 = document.querySelector('.component-select');
|
||||
selectbox2.addEventListener('select:onChange', (e) => {
|
||||
console.log(e.detail);
|
||||
console.log(e.detail.value);
|
||||
});
|
||||
*/
|
||||
|
||||
//document.queerySelector('#unitSelect')
|
||||
|
||||
const modal01 = document.querySelector(".modal01").ui;
|
||||
modal01.open();
|
||||
|
||||
formControl._bindModelUI();
|
||||
},
|
||||
function(code, rstData) {
|
||||
@@ -290,12 +263,6 @@
|
||||
);
|
||||
},
|
||||
createVaild() {
|
||||
const f = document.reqModalForm;
|
||||
|
||||
// TODO : setter
|
||||
f.categoryCode.value = document.querySelector('#categoryCode').value !== undefined ? document.querySelector('#categoryCode').value : '';
|
||||
f.unitCode.value = document.querySelector('#unitCode').value !== undefined ? document.querySelector('#unitCode').value : '';
|
||||
|
||||
formControl.create();
|
||||
},
|
||||
create() {
|
||||
|
||||
@@ -84,42 +84,14 @@
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="select-group">
|
||||
<div class="select-label">
|
||||
<p class="label-txt">
|
||||
수입의 종류
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="categorySelf" class="label-txt">
|
||||
수입의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div id="categoryCode" class="component-select bottom-sheet" data-props-default="수입 종류를 선택해 주세요" data-props-type="bottomSheet">
|
||||
<input type="hidden1" name="categoryCode" th:value="${detail.categoryCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
<div class="select-options">
|
||||
<div class="select-header">
|
||||
<p>수입의 종류</p>
|
||||
<button type="button" class="select-close">
|
||||
<span class="hide-txt">닫기</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option"
|
||||
th:each="uiCode : ${recordIncome}"
|
||||
th:data-value="${uiCode.id}"
|
||||
th:text="${uiCode.codeText}"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input input-invalid" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="수입의 종류를 입력해 주세요">
|
||||
</div>
|
||||
<ul class="input-info">
|
||||
<li>수입 종류를 입력해 주세요.</li>
|
||||
</ul>
|
||||
<div class="input-field">
|
||||
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="수입의 종류를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${incomeList}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.categoryLabel}]] [[${item.categorySelf}]]</p>
|
||||
<p class="item-name">[[${item.categorySelf}]]</p>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="delete" th:onclick="formControl.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="formControl.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
@@ -153,8 +153,8 @@
|
||||
remove: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
reset: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||
},
|
||||
month: [[${reqVO.searchMonth}]],
|
||||
groupNo: [[${reqVO.groupNo}]],
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
@@ -209,7 +209,27 @@
|
||||
// });
|
||||
},
|
||||
_bindModelUI() {
|
||||
let $formWrap = $(bind.form.selector).find('form');
|
||||
etUI.initUI();
|
||||
|
||||
const $select1 = document.querySelector('#cropCode');
|
||||
const selectboxInstance1 = new etUI.components.SelectBox();
|
||||
selectboxInstance1.core.init($select1, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="cropCode"]').val(dataValue)
|
||||
}
|
||||
});
|
||||
|
||||
const $select2 = document.querySelector('#unitCode');
|
||||
const selectboxInstance2 = new etUI.components.SelectBox();
|
||||
selectboxInstance2.core.init($select2, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="unitCode"]').val(dataValue)
|
||||
}
|
||||
});
|
||||
|
||||
const $formWrap = $(bind.form.selector).find('form');
|
||||
$formWrap.on('keyup', 'input[name="price"]', function() {
|
||||
// TODO : UI disabled
|
||||
if ($(this).val() === '') {
|
||||
@@ -239,48 +259,9 @@
|
||||
function(rstHtml, status) {
|
||||
$('.modal01').find('.modal-content').html(rstHtml);
|
||||
|
||||
// TODO
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#cropCode'));
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
||||
|
||||
/*
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'), {
|
||||
onChange: function() {
|
||||
console.log('sssssssssss')
|
||||
},
|
||||
selectItemCallback: function() {
|
||||
// TODO : console.log ?
|
||||
console.log(1111)
|
||||
}
|
||||
});
|
||||
|
||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'), {
|
||||
onChange: function() {
|
||||
console.log('sssssssssss')
|
||||
},
|
||||
selectItemCallback: function() {
|
||||
console.log(3333)
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
/*document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
||||
console.log(e.detail);
|
||||
console.log(e.detail.value);
|
||||
});
|
||||
|
||||
const selectbox2 = document.querySelector('.component-select');
|
||||
selectbox2.addEventListener('select:onChange', (e) => {
|
||||
console.log(e.detail);
|
||||
console.log(e.detail.value);
|
||||
});
|
||||
*/
|
||||
|
||||
//document.queerySelector('#unitSelect')
|
||||
|
||||
const modal01 = document.querySelector(".modal01").ui;
|
||||
modal01.open();
|
||||
|
||||
formControl._bindModelUI();
|
||||
},
|
||||
function(code, rstData) {
|
||||
@@ -291,13 +272,6 @@
|
||||
);
|
||||
},
|
||||
createVaild() {
|
||||
const f = document.reqModalForm;
|
||||
|
||||
// TODO : setter
|
||||
f.categoryCode.value = document.querySelector('#categoryCode').value !== undefined ? document.querySelector('#categoryCode').value : '';
|
||||
f.cropCode.value = document.querySelector('#cropCode').value !== undefined ? document.querySelector('#cropCode').value : '';
|
||||
f.unitCode.value = document.querySelector('#unitCode').value !== undefined ? document.querySelector('#unitCode').value : '';
|
||||
|
||||
formControl.create();
|
||||
},
|
||||
create() {
|
||||
|
||||
Reference in New Issue
Block a user