SPRSC00201_이미지.xrw 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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>이미지</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <view>
  11. <goodimage>
  12. <status/>
  13. <instcd/>
  14. <goodcd/>
  15. <photimg/>
  16. <photimg2/>
  17. </goodimage>
  18. </view>
  19. </main>
  20. <target>
  21. <defaultvalue>
  22. <instcd/>
  23. <goodcd/>
  24. </defaultvalue>
  25. </target>
  26. <send>
  27. <instcd/>
  28. <goodcd/>
  29. </send>
  30. <init/>
  31. <temp/>
  32. </root>
  33. </instance>
  34. <script type="javascript" ev:event="xforms-ready">
  35. <![CDATA[
  36. //화면 Control을 초기화한다
  37. fCheckAuth();
  38. fInitialize();
  39. ]]>
  40. </script>
  41. <submission id="TRRSC00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/view"/>
  42. <submission id="TXRSC00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  43. </model>
  44. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  45. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  46. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  47. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  48. <script type="javascript">
  49. <![CDATA[
  50. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  51. function fInitialize() {
  52. // model.resetInstanceNode("/root/send");
  53. // model.resetInstanceNode("/root/main/view");
  54. model.setValue("/root/send/instcd" , model.getValue(PURTARGET_NODE + "/instcd"));
  55. model.setValue("/root/send/goodcd", model.getValue(PURTARGET_NODE + "/goodcd"));
  56. model.refresh();
  57. fRetrImage();
  58. }
  59. // function fChangeImage(imgsrc) {
  60. // img_hidden.src = imgsrc; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
  61. // var data = img_hidden.getbase64data(); // base64 encoding 문자열을 가져온다.
  62. // var imgSize = getImageSize(imgsrc);
  63. // var imgWidthSize = imgSize.split("^")[0];
  64. // var imgHeightSize = imgSize.split("^")[1];
  65. //
  66. // model.setValue("/root/main/view/goodimage/photimg",data,true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
  67. // setImageRefInstance("/root/main/view/goodimage/photimg");
  68. //
  69. // if( imgWidthSize <= 340)
  70. // img_good.attribute("width")= imgWidthSize;
  71. //
  72. // if( imgWidthSize <= 270)
  73. // img_good.attribute("height")= imgHeightSize;
  74. //
  75. // model.refresh();
  76. // }
  77. function fChangeImage(fimg_target, fimg_hidden, fTfile, fcheck)
  78. {
  79. if(fcheck == "Y")
  80. {
  81. file = fTfile;
  82. }else if(fcheck == "N")
  83. {
  84. var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
  85. if (file == "") {
  86. return;
  87. }
  88. }
  89. fimg_hidden.src = file; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
  90. var fdata = fimg_hidden.getbase64data(); // encoding 문자열을 가져온다.
  91. model.setValue(fimg_target.attribute("ref"), fdata, true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
  92. setImageRefInstance(fimg_target.attribute("ref"));
  93. fimg_target.attribute("width") = 232;
  94. fimg_target.attribute("height") = 277;
  95. model.refresh();
  96. return true;
  97. }
  98. function fMakeNode(pgoodcd){
  99. model.resetInstanceNode("/root/main/view");
  100. model.makeNode("/root/main/view/goodimage/status");
  101. model.makeNode("/root/main/view/goodimage/goodcd");
  102. model.makeNode("/root/main/view/goodimage/photimg");
  103. model.makeNode("/root/main/view/goodimage/photimg2");
  104. model.setValue("/root/main/view/goodimage/goodcd", pgoodcd);
  105. }
  106. function fRetrImage() {
  107. submit("TRRSC00201",false);
  108. setImageRefInstance("/root/main/view/goodimage/photimg");
  109. setImageRefInstance("/root/main/view/goodimage/photimg2");
  110. model.refresh();
  111. var data = img_gL.getbase64data() + img_gR.getbase64data();
  112. if(data == null || data.length == 0)
  113. {
  114. fMakeNode(model.getValue(PURTARGET_NODE + "/goodcd"));
  115. model.setValue("/root/main/view/goodimage/status","i");
  116. fChangeImage(img_gL, img_hL, "../../../com/commonweb/images/no_image.gif", "Y");
  117. fChangeImage(img_gR, img_hR, "../../../com/commonweb/images/no_image.gif", "Y");
  118. // fChangeImage( , , "../../../com/commonweb/images/no_image.gif", "");
  119. }
  120. else
  121. {
  122. model.makeNode("/root/main/view/goodimage/status");
  123. model.setValue("/root/main/view/goodimage/status","");
  124. }
  125. model.refresh();
  126. }
  127. function fSaveImage(){
  128. model.copyNode("/root/send","/root/main/view/goodimage");
  129. model.copyNode("/root/send/goodcd", PURTARGET_NODE + "/goodcd");
  130. model.refresh();
  131. submit("TXRSC00201");
  132. }
  133. function fCheckAuth() {
  134. //btn_search.disabled = !checkAuth("R") ;
  135. btn_save.disabled = !checkAuth("X") ;
  136. btn_delete.disabled = !checkAuth("X") ;
  137. //btn_prt.disabled = !checkAuth("P") ;
  138. }
  139. ]]>
  140. </script>
  141. </xhtml:head>
  142. <xhtml:body pagewidth="507" pageheight="393" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  143. <group id="grp_tle" style="left:0px; top:0px; width:495px; height:13px; ">
  144. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:243px; height:14px; ">사진 등록/변경</caption>
  145. </group>
  146. <shape id="rectangle9" fillStyle="solid" shape="rectangle" fillColor="#bbbbbb" style="left:0px; top:42px; width:496px; height:333px; border-color:#788daf; "/>
  147. <group id="grp_btn" scroll="auto" style="left:0px; top:14px; width:495px; height:27px; ">
  148. <button id="button45" class="btn4_letter2" style="left:433px; top:3px; width:56px; height:22px; ">
  149. <caption>닫기</caption>
  150. <script type="javascript" ev:event="DOMActivate">
  151. <![CDATA[
  152. window.close();
  153. ]]>
  154. </script>
  155. </button>
  156. <button id="btn_delete" class="btn4_letter2" style="left:376px; top:3px; width:56px; height:22px; ">
  157. <caption>삭제</caption>
  158. <script type="javascript" ev:event="DOMActivate">
  159. <![CDATA[
  160. if( messageBox("사진을 삭제 하시겠습니까", "Q999") != 6) return;
  161. model.setValue("/root/main/view/goodimage/status","d");
  162. btn_save.dispatch("DOMActivate");
  163. fRetrImage();
  164. ]]>
  165. </script>
  166. </button>
  167. <button id="btn_save" class="btn4_letter2" style="left:320px; top:3px; width:56px; height:22px; ">
  168. <caption>저장</caption>
  169. <script type="javascript" ev:event="DOMActivate">
  170. <![CDATA[
  171. fSaveImage();
  172. ]]>
  173. </script>
  174. </button>
  175. </group>
  176. <caption id="cap_gL" class="cell_1" style="left:5px; top:47px; width:240px; height:323px; text-align:center; vertical-align:middle; "/>
  177. <caption id="cap_gR" class="cell_1" style="left:251px; top:47px; width:240px; height:323px; text-align:center; vertical-align:middle; "/>
  178. <img id="img_hL" style="left:9px; top:51px; width:232px; height:277px; background-stretch:no-stretch; "/>
  179. <img id="img_hR" style="left:255px; top:51px; width:232px; height:277px; background-stretch:no-stretch; "/>
  180. <img id="img_gL" ref="/root/main/view/goodimage/photimg" style="left:10px; top:51px; width:232px; height:277px; background-stretch:stretch; "/>
  181. <img id="img_gR" ref="/root/main/view/goodimage/photimg2" style="left:256px; top:51px; width:232px; height:277px; background-stretch:stretch; "/>
  182. <button id="btn_imageLoadR" class="btn2_letter4" style="left:310px; top:340px; width:64px; height:19px; ">
  183. <caption>불러오기</caption>
  184. <script type="javascript" ev:event="DOMActivate">
  185. <![CDATA[
  186. // var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
  187. // if (file == "") {
  188. // return;
  189. // }
  190. fChangeImage(img_gR, img_hR, "", "N");
  191. if(model.getValue("/root/main/view/goodimage/status") == "") model.setValue("/root/main/view/goodimage/status","u");
  192. model.refresh();
  193. ]]>
  194. </script>
  195. </button>
  196. <button id="btn_imageLoadL" class="btn2_letter4" style="left:60px; top:340px; width:64px; height:19px; ">
  197. <caption>불러오기</caption>
  198. <script type="javascript" ev:event="DOMActivate">
  199. <![CDATA[
  200. // var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
  201. // if (file == "") {
  202. // return;
  203. // }
  204. //fChangeImage(file);
  205. fChangeImage(img_gL, img_hL, "", "N");
  206. if(model.getValue("/root/main/view/goodimage/status") == "") model.setValue("/root/main/view/goodimage/status","u");
  207. model.refresh();
  208. ]]>
  209. </script>
  210. </button>
  211. <button id="btn_cleanL" class="btn2_letter4" style="left:125px; top:340px; width:64px; height:19px; ">
  212. <caption>초기화</caption>
  213. <script type="javascript" ev:event="DOMActivate">
  214. <![CDATA[
  215. fChangeImage(img_gL, img_hL, "../../../com/commonweb/images/no_image.gif", "Y");
  216. model.refresh();
  217. ]]>
  218. </script>
  219. </button>
  220. <button id="btn_cleanR" class="btn2_letter4" style="left:375px; top:340px; width:64px; height:19px; ">
  221. <caption>초기화</caption>
  222. <script type="javascript" ev:event="DOMActivate">
  223. <![CDATA[
  224. fChangeImage(img_gR, img_hR, "../../../com/commonweb/images/no_image.gif", "Y");
  225. model.refresh();
  226. ]]>
  227. </script>
  228. </button>
  229. </xhtml:body>
  230. </xhtml:html>