SYSRightList.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <%--
  2. - FileName : SYSRightList.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014.6.22
  5. - Copyright : www.udapsoft.co.kr
  6. -
  7. - Description: 권한별 사용가능 프로그램 관리
  8. --%>
  9. <%@ page contentType="text/html; charset=utf-8" %>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*"%>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. ValueObject user = ctx.getUser();
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. RowSet rowSet = storage.getRowSet("ROWSET");
  21. String temp1="";
  22. String temp2="";
  23. for(int i=0;i<rowSet.size();i++){
  24. if(i==rowSet.size()-1){
  25. temp1 +=(rowSet.getColumn(i,"ACCT_TYPE_NAME").toString()).substring(15);
  26. temp2 +=(rowSet.getColumn(i,"ACCT_TYPE_ID").toString()).substring(13);
  27. }else{
  28. temp1 =temp1+(rowSet.getColumn(i,"ACCT_TYPE_NAME").toString()+"|").substring(15);
  29. temp2 =temp2+(rowSet.getColumn(i,"ACCT_TYPE_ID").toString()+"|").substring(13);
  30. }
  31. }
  32. %>
  33. <SCRIPT language="JavaScript">
  34. /*예약함수*/
  35. var sheet1;
  36. var sheet1Row;
  37. var sheet1PageNo = 1;
  38. var pageLastRowIndex = 1;
  39. var validationResult = false;
  40. var filterShow = false;
  41. function _onReady(){
  42. gridInit(sheet1);
  43. jQuery("#btnSearch").click(function() {
  44. jQuery("#fevent").val("GET_SYS_LIST");
  45. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/security/SYSRightList_sheet.screen";
  46. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  47. });
  48. jQuery("#btnAdd").click(function() {
  49. sheet1.DataAutoTrim = false;
  50. sheet1.DataInsert();
  51. });
  52. jQuery("#btnSave").click(function() {
  53. if (confirm("저장하시겠습니까?")) {
  54. jQuery("#fevent").val("SAVE_SYS_LIST");
  55. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/security/SYSRightList_sheet.screen";
  56. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  57. }
  58. });
  59. autoResize();
  60. }
  61. function gridInit(sheetName){
  62. var init_sheet = {};
  63. init_sheet.Cfg = {SearchMode:2, Page:30};
  64. init_sheet.Cols = [
  65. {Header:'삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center"},
  66. {Header:'번호', Type:"Seq", SaveName:"NO", Width:60, Align:"Center"},
  67. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  68. {Header:'계정타입', Type:"Combo", SaveName:"ACCT_TYPE_ID", Width:100, KeyField:"true", Align:"Center", ComboText:"<%=temp1%>", ComboCode:"<%=temp2%>"},
  69. {Header:'권한ID', Type:"Text", SaveName:"RIGHT_ID", Width:150, KeyField:"false", Align:"Left", Hidden:"True", Edit:"false" },
  70. {Header:'☞ 권한', Type:"Text", SaveName:"RIGHT_NAME", Width:290, Align:"Left", KeyField:"true", Cursor:"Pointer"},
  71. {Header:'Description', Type:"Text", SaveName:"DSCR", Width:260, Align:"Left" },
  72. {Header:'등록자', Type:"Text", SaveName:"CRE_BY", Width:60, Align:"Center", Edit:"false" },
  73. {Header:'등록일', Type:"Date", SaveName:"CRE_DATE", Width:90, Align:"Center", Edit:"false" },
  74. {Header:'수정자', Type:"Text", SaveName:"UPD_BY", Width:60, Align:"Center", Edit:"false"},
  75. {Header:'수정일', Type:"Date", SaveName:"UPD_DATE", Width:90, Align:"Center", Edit:"false"}
  76. ];
  77. init_sheet.HeaderMode = {Sort:1};
  78. IBS_InitSheet(sheetName, init_sheet);
  79. sheetName.SetDataAutoTrim(0);
  80. setGridSize();
  81. }
  82. function setGridSize() {
  83. sheet1.FitColWidth();
  84. }
  85. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  86. if (sheet1.ColSaveName(Col) == "RIGHT_NAME") {//right_name 일떄만 리턴하기
  87. jQuery("#right_id").val(sheet1.GetCellValue(Row, "RIGHT_ID"));
  88. jQuery("#fevent").val("");
  89. jQuery("#form1").attr("action", "/sycs/security/SYSRightPgmList.screen");
  90. jQuery("#form1").attr("target", "_self");
  91. jQuery("#form1").attr("method", "post");
  92. jQuery("#form1").submit();
  93. }
  94. }
  95. function sheet1_OnSearchEnd(code, message) {
  96. if(code == 0) {
  97. setGridSize();
  98. sheet1.SetColFontColor("RIGHT_NAME", "#0000ff");
  99. } else {
  100. //조회 에러 수행
  101. //alert(message);
  102. alert("조회 실패");
  103. }
  104. }
  105. function sheet1_OnSaveEnd(code, msg) {
  106. if(code >= 0) {
  107. alert("저장 성공");
  108. } else {
  109. alert(msg);
  110. }
  111. jQuery("#btnSearch").click();
  112. }
  113. function sheet1_OnSmartResize(Width, Height) {
  114. sheet1.FitColWidth();
  115. autoResize();
  116. }
  117. function autoResize(){
  118. var t1_height = document.getElementById("search-table").scrollHeight + 24;
  119. var iframeHeight= document.body.scrollHeight - t1_height;
  120. sheet1.SetSheetHeight(iframeHeight);
  121. }
  122. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  123. </SCRIPT>
  124. <modular:search id="form1">
  125. <modular:key id="fevent" />
  126. </modular:search>
  127. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  128. <INPUT type="hidden" name="fevent" value="">
  129. <input type="hidden" value="" name="right_id">
  130. <TABLE id="search-table" border="0" cellspacing="0" cellpadding="0" width="100%">
  131. <TR>
  132. <td>
  133. <div align="left" id="title">
  134. <ul>
  135. <li>권한관리</li>
  136. </ul>
  137. </div>
  138. </td>
  139. <td class="button" align="right">
  140. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  141. <span class="btnSearch center"><a href="javascript:void(0);" id="btnAdd">추가</a></span>
  142. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  143. </td>
  144. </tr>
  145. <!-- 검색조건 영역, 테이터 영역 구분 여백 : 종료 -->
  146. </TABLE>
  147. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 450px; overflow: auto;">
  148. <SCRIPT>
  149. createIBSheet('sheet1','100%', '450px');
  150. </SCRIPT>
  151. </div>
  152. </FORM>