xSMRPE03000_기관마크이미지관리.xrw 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>SMRPE03000_기관마크 이미지 관리</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <imgdata>
  11. <photimg/>
  12. </imgdata>
  13. <imgviewlist>
  14. <instcd/>
  15. <photimg/>
  16. </imgviewlist>
  17. </main>
  18. <send>
  19. <issinstcd/>
  20. <imgviewlist/>
  21. </send>
  22. <init/>
  23. <hidden/>
  24. <temp/>
  25. </root>
  26. </instance>
  27. <script type="javascript" ev:event="xforms-ready">
  28. <![CDATA[
  29. fCheckAuth();
  30. model.removeNodeset(grd_imgviewlist.nodeset);
  31. misfMsterDetailSet(grd_imgviewlist, null, "TRRPE03001" ,"Y");
  32. misfComboInstCdListMulti("cmb_issinstcd_search",getCurrentDate(),"","N");
  33. model.refresh();
  34. ]]>
  35. </script>
  36. <script type="javascript">
  37. <![CDATA[
  38. //========================================================================================
  39. //버튼에 대한 화면 권한 체크(R : 읽기, X : 입력/수정/삭제, P : 출력)
  40. //========================================================================================
  41. function fCheckAuth() {
  42. btn_search.disabled = !checkAuth("R") ;
  43. btn_save.disabled = !checkAuth("X") ;
  44. }
  45. function fChangeImage(imgsrc) {
  46. img_hidden.src = imgsrc; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
  47. var data = img_hidden.getbase64data(); // base64 encoding 문자열을 가져온다.
  48. model.setValue("/root/main/imgdata/photimg",data,true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
  49. setImageRefInstance("/root/main/imgdata/photimg"); //base64 encoding 문자열을 이미지로 변환하여 보여준다,
  50. img_view.attribute("width")= "200";
  51. img_view.attribute("height")= "45";
  52. var cur_rows = grd_imgviewlist.rows;
  53. var instcd=model.getValue("/root/send/issinstcd");
  54. var imginstcd=model.getValue("/root/main/imgviewlist[1]/instcd");
  55. if(img_hidden.src != "../../../com/commonweb/images/no_image.gif" && imginstcd == ""){//이미지추가시 그리드 추가
  56. grd_imgviewlist.addrow(); // 입력할 행 추가.
  57. cur_row = grd_imgviewlist.row; // 추가된 행 번호 가져오기
  58. // 그리드에 추가
  59. model.setValue("/root/main/imgviewlist["+cur_row+"]/instcd",instcd);
  60. model.setValue("/root/main/imgviewlist["+cur_row+"]/photimg",data,true);
  61. }else if(img_hidden.src != "../../../com/commonweb/images/no_image.gif" && imginstcd != ""){//업데이트시 그리드셋팅
  62. grd_imgviewlist.addStatus(1,"update");
  63. model.setValue("/root/main/imgviewlist[1]/instcd",instcd);
  64. model.setValue("/root/main/imgviewlist[1]/photimg",data,true);
  65. }
  66. model.refresh();
  67. }
  68. function fRetrImage() {//조회시 그리드에 base64 encoding data셋팅하고 사진이미지 보여준다.
  69. if (grd_imgviewlist.Rows <= grd_imgviewlist.fixedRows) {
  70. fChangeImage("../../../com/commonweb/images/no_image.gif");//초기 이미지설정
  71. }
  72. else {
  73. for( var i = grd_imgviewlist.fixedRows ; i < grd_imgviewlist.Rows ; i++ ) {
  74. var imgdata = model.getValue("/root/main/imgviewlist["+i+"]/photimg"); // base64 encoding 문자열을 가져온다.
  75. model.setValue("/root/main/imgdata/photimg", imgdata,true);
  76. setImageRefInstance("/root/main/imgdata/photimg");
  77. }
  78. grd_imgviewlist.rebuild();
  79. }
  80. model.refresh();
  81. }
  82. ]]>
  83. </script>
  84. <submission id="TRRPE03001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/imgviewlist"/>
  85. <submission id="TXRPE03001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/save" resultref="/root/temp"/>
  86. </model>
  87. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  88. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  89. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  90. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  91. </xhtml:head>
  92. <xhtml:body pagewidth="500" pageheight="300">
  93. <group id="group1" style="left:0px; top:0px; width:405px; height:13px; ">
  94. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:240px; height:13px; ">기관마크 이미지 관리</caption>
  95. </group>
  96. <group id="group2" scroll="auto" style="left:0px; top:38px; width:445px; height:212px; ">
  97. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:10px; width:410px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  98. <caption id="caption2" class="search_name" style="left:15px; top:19px; width:151px; height:17px; ">기관선택 :</caption>
  99. <line id="line207" class="line_1" style="x1:0px; y1:65px; x2:410px; y2:65px; "/>
  100. <button id="btn_search" class="btn1_letter2" navindex="8" style="left:345px; top:18px; width:56px; height:22px; text-align:left; ">
  101. <caption>조회</caption>
  102. <script type="javascript" ev:event="DOMActivate">
  103. <![CDATA[
  104. submit("TRRPE03001"); //직인이미지
  105. fRetrImage();
  106. ]]>
  107. </script>
  108. </button>
  109. <line id="line2" class="line_4" style="x1:330px; y1:14px; x2:330px; y2:40px; border-color:#ffe4bb; border-left-style:solid; "/>
  110. <select1 id="cmb_issinstcd_search" ref="/root/send/issinstcd" class="combo_s_essential" appearance="minimal" style="left:104px; top:19px; width:159px; height:19px; ">
  111. <choices>
  112. <itemset>
  113. <label/>
  114. <value/>
  115. </itemset>
  116. </choices>
  117. <script type="javascript" ev:event="xforms-value-changed">
  118. <![CDATA[
  119. btn_search.dispatch("DOMActivate");
  120. ]]>
  121. </script>
  122. </select1>
  123. <caption id="caption172" class="cell_1" style="left:10px; top:80px; width:210px; height:55px; vertical-align:middle; "/>
  124. <button id="btn_fileupload" class="btn2_letter9" style="left:10px; top:140px; width:119px; height:19px; text-align:center; ">
  125. <caption>마 크 업 로 드</caption>
  126. <script type="javascript" ev:event="DOMActivate">
  127. <![CDATA[
  128. var instcd=model.getValue("/root/send/issinstcd");
  129. if(instcd == ""){
  130. messageBox("기관을 ","C002");
  131. return;
  132. }
  133. var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
  134. if (file == "") {
  135. return;
  136. }
  137. fChangeImage(file);
  138. model.refresh();
  139. ]]>
  140. </script>
  141. </button>
  142. <img id="img_view" ref="/root/main/imgdata/photimg" style="left:15px; top:85px; width:200px; height:45px; background-stretch:stretch; "/>
  143. <img id="img_hidden" visibility="hidden" style="left:15px; top:83px; width:200px; height:45px; "/>
  144. <datagrid id="grd_imgviewlist" nodeset="/root/main/imgviewlist" visibility="hidden" caption="기관코드^마크이미지" colsep="^" colwidth="100, 100" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:175px; top:90px; width:240px; height:50px; ">
  145. <col ref="instcd"/>
  146. <col ref="photimg" style="background-stretch:stretch; "/>
  147. </datagrid>
  148. </group>
  149. <group id="grp_btn" scroll="auto" style="left:0px; top:12px; width:405px; height:28px; ">
  150. <button id="button16" class="btn3_letter4" visibility="hidden" style="left:0px; top:3; width:80px; height:22px; ">
  151. <caption>화면이동</caption>
  152. </button>
  153. <button id="btn_save" class="btn4_letter2" style="left:345px; top:3px; width:56px; height:22px; ">
  154. <caption>저장</caption>
  155. <script type="javascript" ev:event="DOMActivate">
  156. <![CDATA[
  157. misfSave("TXRPE03001");
  158. ]]>
  159. </script>
  160. </button>
  161. </group>
  162. </xhtml:body>
  163. </xhtml:html>