Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbalganjjm committed May 20, 2024
1 parent 8a2f7de commit 3df6dee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 167 deletions.
167 changes: 3 additions & 164 deletions src/main/resources/static/html/com/app/sample/type0401.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<div class="criteria-panel">
<ul>
<li><input id="name" type="text" class="mdc-text-field" data-label="Name"></li>
<li><select id="age" class="mdc-njs-select" data-label="Age"><option value=""></option></select></li>
<li><select id="gender" class="mdc-njs-select" data-label="Gender"><option value=""></option></select></li>
<li><select id="eyeColor" class="mdc-njs-select" data-label="Eye Color"><option value=""></option></select></li>
</ul>
Expand Down Expand Up @@ -80,11 +79,11 @@
<input id="favoriteFruit" type="checkbox">
</li>
<li>
<input id="registered" type="text" class="mdc-text-field" data-label="Registered">
<input id="registered" type="text" class="mdc-text-field" data-label="Registered" data-format='[["date",8,"date"]]'>
</li>
<li>
<p class="mdc-njs-fixed-label">Company</p>
<select id="company" multiple="multiple" style="height: 100px;"></select>
<select id="company"></select>
</li>
<li>
<textarea id="about" rows="4" cols="34" class="mdc-text-field" data-label="About"></textarea>
Expand All @@ -105,164 +104,4 @@
</div>
</article>

<script type="text/javascript">
(function() {

var cont = N(".type0401").cont({
"p.select.gender" : [ "gender" ],
"p.select.eyeColor" : [ "eyeColor" ],
"p.select.company" : [ "company" ],
"p.select.favoriteFruit" : [ "favoriteFruit" ],
"p.select.age" : [ "c.getCommonCodeList", "age", "age", function(data) {
return N(N.array.deduplicate(data, "age")).datasort("age");
}],
"p.form.search" : {
"usage" : {
"search-box" : {
"defaultButton" : ".btnSearch",
"events" : [{
"event" : "focusin",
"target" : "#name",
"handler" : function(e) {
N.log(e);
}
}]
}
}
},
"p.form.detail" : {
revert : true,
autoUnbind : true
},
"p.grid.master" : {
height : 500,
select : true,
selectScroll : false,
onSelect : function(index, rowEle, data, beforeRow, e) {
// TODO 전처리

APP.comm.utils.selectNBind.call(this, {
cont : cont,
form : "p.form.detail"
});

// 파일 요약 목록 생성
if(data.length > 0) {
APP.comm.utils.getFileSummaryList(cont["p.form.detail"].val("fileId"), "fileName", 60, cont["e.btnFile.click"]);
}

// TODO 후처리
},
onBind : function(context, data, isFirstPage, isLastPage) {
if(isFirstPage) {
this.select(0);
}
}
},
"p.popup.dept" : {
url : "html/com/app/sample/type04P0.html",
onOpen : "onOpen",
onClose : function(onCloseData) {
if (onCloseData) {
cont["p.form.detail"]
.val("deptNm", onCloseData.deptNm)
.val("deptCd", onCloseData.deptCd);
}
}
},
/**
* 공통 파일 팝업.
*/
"p.popup.file" : {
onClose : function(onCloseData) {
if(onCloseData) {
cont["p.form.detail"].val("fileId", onCloseData.fileId);

// 파일 요약 목록 생성
APP.comm.utils.createFileSummaryList(onCloseData.downloadList, "fileName", 60, cont["e.btnFile.click"]);
}
}
},
"c.getCommonCodeList" : function() {
return N.comm("sample/getSampleList.json");
},
"c.getSampleList" : function() {
return cont["p.form.search"].data(false).comm("sample/getSampleList.json");
},
"c.saveSampleList" : function() {
return N(cont["p.grid.master"].data("modified")).comm({
dataIsArray : true, // Array 타입의 여러 행데이터가 1 개 일때는 자동으로 Object로 변환됩니다. 자동으로 변환되지 않게 하려면 dataIsArray 옵션을 true로 지정해 주세요.
url : "sample/saveSampleList.json"
});
},
"e.btnSearch.click" : function(e) {
e.preventDefault();

if (cont["p.form.search"].validate()) {
cont["c.getSampleList"]().submit(function(data) {
// N.grid bind
cont["p.grid.master"].bind(data);
});
}
},
"e.btnDeptCd.click" : function(e) {
e.preventDefault();
cont["p.popup.dept"].open(cont["p.form.detail"].data(true)[0]);
},
"e.btnSave.click" : function(e) {
e.preventDefault();

return APP.comm.utils.save.call(this, {
cont : cont,
comm : "c.saveSampleList",
changed : "p.grid.master",
validate : "p.form.detail",
before : function() {
// TODO
},
after : function(data) {
cont["e.btnSearch.click"].click();
}
});
},
"e.btnAdd.click" : function(e) {
e.preventDefault();

if (cont["p.form.detail"].validate()) {
cont["p.form.detail"].add();
}
},
"e.btnDelete.click" : function(e) {
e.preventDefault();

cont["p.form.detail"].remove();
},
"e.btnRevert.click" : function(e) {
e.preventDefault();

if (cont["p.grid.master"].data("modified").length === 0) {
N(window).alert(N.message.get(APP.comm.messages, "COMM-0001")).show();
return false;
}

cont["p.form.detail"].revert();
},
"e.btnFile.click" : function(e) {
e.preventDefault();

cont["p.popup.file"].open(cont["p.form.detail"].val("fileId"));
},
init : function(view, request) {
// cont.opener는 탭이 포함된 부모페이지의 Controller Object.
if(cont.opener) {
cont["p.form.search"].context().hide().prev("h3").hide().prev(".view-intro").hide();
// 부모 페이지 컨트롤러의 검색 버튼 클릭
cont.opener["e.btnSearch.click"].click();
} else {
cont["e.btnSearch.click"].click();
}
}
});

})();
</script>
<script type="text/javascript" src="html/com/app/sample/type0401.js"></script>
4 changes: 2 additions & 2 deletions src/main/resources/static/html/com/app/sample/type0601.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<div style="max-width: 218px;">
<div class="flex-horizental">
<div class="btn-panel">
<button id="btnOpen" class="mdc-icon-button mdc-icon-button--mini">expand_more</button>
<button id="btnClose" class="mdc-icon-button mdc-icon-button--mini">chevron_right</button>
<button id="btnOpen" class="mdc-icon-button mdc-icon-button--mini" data-opts='{ "fill" : "outlined"}'>expand_more</button>
<button id="btnClose" class="mdc-icon-button mdc-icon-button--mini" data-opts='{ "fill" : "outlined" }'>chevron_right</button>
</div>
</div>
<div id="master" style="min-height: 676px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/natural_js/css/natural.ui.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@charset "utf-8";

@import url(light.css) screen and (prefers-color-scheme: light);
@import url(dark.css) screen and (prefers-color-scheme: dark);
@import url(light.css) screen and (prefers-color-scheme: dark);

/* Alert */
.alert_overlay__.block_overlay__ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,7 @@ a.btn_mouseout__, input[type='button'].btn_mouseout__, button.btn_mouseout__ {
.docs__>.docs_tab_context__>.docs_tabs__, .docs__>.docs_tab_context__>ul.docs_tab_utils__, .docs__>.docs_tab_context__>ul.docs_tab_utils__ .docs_tab_list__ {
list-style: none;
margin: 0;
background-color: inherit;
}

.docs__>.docs_tab_context__>.docs_tabs__ {
Expand Down

0 comments on commit 3df6dee

Please sign in to comment.