SPAEA02602_결과관리및조회사진관리(사이버나이프).xrw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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>사이버나이프 이미지 Upload/Download</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <list>
  11. <attachlist>
  12. <instcd/>
  13. <ckno/>
  14. <cknoseq/>
  15. <trseq/>
  16. <filename/>
  17. <filepath/>
  18. <filesize/>
  19. <filetype/>
  20. <fstrgstrid/>
  21. <fstrgstdt/>
  22. <lastupdtrid/>
  23. <lastupdtdt/>
  24. <imgseq/>
  25. </attachlist>
  26. </list>
  27. </main>
  28. <send>
  29. <attach>
  30. <file/>
  31. </attach>
  32. <rtno/>
  33. <ckno/>
  34. <cknoseq/>
  35. <trseq/>
  36. </send>
  37. <delsend>
  38. <rtno/>
  39. <filepath/>
  40. <seq/>
  41. <ckno/>
  42. <cknoseq/>
  43. <trseq/>
  44. <imgseq/>
  45. <rttmd/>
  46. <appgb/>
  47. <m/>
  48. </delsend>
  49. <init>
  50. </init>
  51. <hidden>
  52. <dflag>N</dflag>
  53. </hidden>
  54. <imgsend>
  55. <filepath/>
  56. </imgsend>
  57. <image>
  58. <attachfile>
  59. <image/>
  60. </attachfile>
  61. </image>
  62. </root>
  63. </instance>
  64. <script type="javascript" ev:event="xforms-model-construct">
  65. <![CDATA[
  66. ]]>
  67. </script>
  68. <submission id="TRAEA03904" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/"/>
  69. <submission id="TRAEA03905" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/imgsend" resultref="/root/imgbinary"/>
  70. <submission id="TXAEA03903" mediatype="multipart/form-data" method="form-data-post" ref="/root/send" resultref="/root/hidden"/>
  71. <submission id="TXAEA03904" mediatype="multipart/form-data" method="form-data-post" ref="/root/delsend"/>
  72. <script type="javascript" ev:event="xforms-ready">
  73. <![CDATA[
  74. fInitialize();
  75. //aezfSetSuppDeptcd();
  76. // opener.javascript.getScreenID()
  77. // var DispID = opener.javascript.getScreenID();
  78. // var Dispnm = opener.javascript.getTitle();
  79. // messageBox("["+Dispnm+"] 화면에 대한 메뉴얼 Upload/Download를 진행할 수 있습니다.","I999");
  80. // model.setValue("/root/send/dispid", DispID);
  81. // model.setValue("/root/send/rtno", "13920");
  82. // model.setValue("/root/send/cureroomflag", "1");
  83. //상준 테스트
  84. // model.setValue("/root/send/ckno","829");
  85. // model.setValue("/root/send/cknoseq","1");
  86. // model.setValue("/root/send/trseq","1");
  87. //
  88. // 해당 키값과 물려서 저장되어 있는 리스트를 가져오기 위해
  89. submit("TRAEA03904");
  90. model.refresh();
  91. ]]>
  92. </script>
  93. </model>
  94. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  95. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  96. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  97. <script type="javascript" src="../../../ast/examcureweb/js/AEZ0001.js"/>
  98. <script type="javascript">
  99. <![CDATA[
  100. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  101. function fInitialize() {
  102. model.removeNodeset("/root/main/list");
  103. model.removeNodeset("/root/send/attach");
  104. if(model.getValue("/root/send/statflag") != "S")
  105. {
  106. // 2010.02.18 김병현 선생님 요청으로 권한제어 해제. 향후 인증데이터 여부만 체크하도록 함.
  107. //button2.disabled = true;
  108. //btn_addfile.disabled = true;
  109. //btn_upload.disabled = true;
  110. }
  111. model.refresh();
  112. }
  113. var cnj_img_view = null;
  114. ]]>
  115. </script>
  116. </xhtml:head>
  117. <xhtml:body pagewidth="1200" pageheight="750" guideline="1,1175;1,1175;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  118. <group id="group3" scroll="auto" style="left:0px; top:0px; width:1180px; height:735px; ">
  119. <line id="line8" class="line_1" style="x1:0px; y1:42px; x2:1165px; y2:43px; "/>
  120. <caption id="caption20" class="tit_2" style="left:6px; top:27px; width:118px; height:14px; ">사진 목록</caption>
  121. <caption id="caption2" class="tit_1" style="left:0px; top:0px; width:217px; height:14px; vertical-align:middle; ">결과관리 및 조회 사진관리</caption>
  122. <button id="btn_upload" class="btn5_letter4" style="left:290px; top:390px; width:64px; height:19px; ">
  123. <caption>업로드</caption>
  124. <script type="javascript" ev:event="DOMActivate">
  125. <![CDATA[
  126. if (grd_attach.rows == 1)
  127. {
  128. messageBox("업로드될 파일이", "I004");
  129. return false;
  130. }
  131. // if (submit("TXAOR00105")) {
  132. model.setValue("/root/hidden/dflag", "");
  133. // 이미지를 삭제하기 전에 Physics 계정을 체크한다
  134. model.setValue("/root/delsend/rttmd", ""); // 1:Dometrist, 2:RTT, 3:Physicist, 4:MD
  135. model.setValue("/root/delsend/appgb","Y");
  136. model.setValue("/root/delsend/m","image"); //이미지 삭제에서 체크하는 권한임을 app단에서 체크하기 위해
  137. // alert(model.getValue("/root/hidden/dflag")); // 초기값 N 삭제할때 팝업에서 확인을 통과했는지 체크하기 위해
  138. setParameter("opener_parameter_id", model.getValue("/root/hidden/dflag"));
  139. modal("SPAEA03901", "", "800", "650", "SPAEA03901","/root/delsend","/root/popdata/treatment/treatmentlist");
  140. // alert("펑션나오고서" + model.getValue("/root/hidden/dflag"));
  141. // 초기값 N, 삭제할때 팝업에서 확인을 통과했는지 체크하기 위해
  142. if (model.getValue("/root/hidden/dflag") == "N" || model.getValue("/root/hidden/dflag") == ""){
  143. return 0;
  144. }
  145. if (submit("TXAEA03903")) {
  146. messageBox("Upload가 성공적으로 이루어졌습니다.","I999");
  147. model.removeNodeset("/root/send/attach");
  148. fInitialize();
  149. model.refresh();
  150. submit("TRAEA03904");
  151. model.refresh();
  152. model.makeNode("/root/hidden/dflag");
  153. }
  154. ]]>
  155. </script>
  156. </button>
  157. <button id="btn_addfile" class="btn2_letter4" style="left:215px; top:390px; width:64px; height:19px; ">
  158. <caption>파일추가</caption>
  159. <script type="javascript" ev:event="DOMActivate">
  160. <![CDATA[
  161. var maxsize = upload1.attribute("filesize");
  162. files = window.fileDialog("open", "|", true);
  163. filelist = files.split("|");
  164. for(var i = 0 ; i < filelist.length ; i++ ) {
  165. grd_attach.addRow(false);
  166. grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
  167. if (!checkFileSize(upload1)){
  168. grd_attach.removeItem();
  169. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  170. }
  171. }
  172. ]]>
  173. </script>
  174. </button>
  175. <datagrid id="grd_attachfile" nodeset="/root/main/list/attachlist" visibility="visible" caption="업로드일시^업로드ID^첨부파일명^파일크기(Byte)^파일종류^서버저장경로^화면ID^최초등록자^최초등록일시^trseq^순번" colwidth="78, 68, 159, 97, 100, 100, 100, 100, 100, 100, 100" extendlastcol="scroll" mergecellsfixedrows="bycolrec" style="left:0px; top:47px; width:350px; height:333px; ">
  176. <col ref="lastupdtdt" format="yyyy-mm-dd hh:nn:ss" style="text-align:center; "/>
  177. <col ref="lastupdtrid" style="text-align:center; "/>
  178. <col ref="filename"/>
  179. <col ref="filesize" visibility="hidden"/>
  180. <col ref="filetype" visibility="hidden"/>
  181. <col ref="filepath" visibility="hidden"/>
  182. <col ref="dispid" visibility="hidden"/>
  183. <col ref="fstrgstrid" visibility="hidden"/>
  184. <col ref="fstrgstdt" visibility="hidden"/>
  185. <col ref="trseq" visibility="hidden"/>
  186. <col ref="imgseq" visibility="hidden"/>
  187. <col ref="ckno" visibility="hidden"/>
  188. <script type="javascript" ev:event="onclick">
  189. <![CDATA[
  190. if (isDataCell()) {
  191. var idx = grd_attachfile.row;
  192. if(idx == 0) return false;
  193. var filepath = model.getValue("/root/main/list/attachlist["+idx+"]/filepath");
  194. model.setValue("/root/imgsend/filepath", filepath);
  195. submit("TRAEA03905");
  196. model.removenode("/root/image/attachfile/image[0]");
  197. setImageRefInstance("/root/image/attachfile/image");
  198. model.refresh();
  199. img1.initStyle("height");
  200. img1.initStyle("width");
  201. if(img1.currentStyle.width > 800)
  202. {
  203. var imgWidth = img1.currentStyle.width;
  204. var imgHeight = img1.currentStyle.height;
  205. var imgRate = 800 / imgWidth;
  206. img1.attribute("width") = 800;
  207. img1.attribute("height") = imgHeight * imgRate;
  208. }
  209. if(img1.currentStyle.height > 700)
  210. {
  211. var imgWidth = img1.currentStyle.width;
  212. var imgHeight = img1.currentStyle.height;
  213. var imgRate = 700 / imgHeight;
  214. img1.attribute("width") = imgWidth / imgRate;
  215. img1.attribute("height") = 700;
  216. }
  217. img1.refresh();
  218. }
  219. ]]>
  220. </script>
  221. </datagrid>
  222. <upload id="upload1" nodeset="/root/send/attach/file" ext="zip" filecount="5" filesize="5242880" validate="true" style="left:195px; top:380px; width:100px; height:20px; "/>
  223. <datagrid id="grd_attach" nodeset="/root/send/attach" caption="파일경로^" colwidth="644" extendlastcol="scroll" mergecellsfixedrows="bycolrec" style="left:0px; top:410px; width:355px; height:150px; ">
  224. <col ref="file"/>
  225. </datagrid>
  226. <button id="button2" class="btn5_letter3" style="left:295px; top:20px; width:53px; height:19px; ">
  227. <caption>삭제</caption>
  228. <script type="javascript" ev:event="DOMActivate">
  229. <![CDATA[
  230. if ( (grd_attachfile.row < grd_attachfile.fixedRows) ) {
  231. return false;
  232. }
  233. if ( messageBox("선택된 파일을 ","Q001") != 6 )
  234. {
  235. return false;
  236. }
  237. model.setValue("/root/hidden/dflag", "");
  238. // 이미지를 삭제하기 전에 Physics 계정을 체크한다
  239. model.setValue("/root/delsend/rttmd", ""); // 1:Dometrist, 2:RTT, 3:Physicist, 4:MD
  240. model.setValue("/root/delsend/appgb","Y");
  241. model.setValue("/root/delsend/m","image"); //이미지 삭제에서 체크하는 권한임을 app단에서 체크하기 위해
  242. // alert(model.getValue("/root/hidden/dflag")); // 초기값 N 삭제할때 팝업에서 확인을 통과했는지 체크하기 위해
  243. setParameter("opener_parameter_id", model.getValue("/root/hidden/dflag"));
  244. modal("SPAEA03901", "", "800", "650", "SPAEA03901","/root/delsend","/root/popdata/treatment/treatmentlist");
  245. // alert("펑션나오고서" + model.getValue("/root/hidden/dflag"));
  246. // 초기값 N, 삭제할때 팝업에서 확인을 통과했는지 체크하기 위해
  247. if (model.getValue("/root/hidden/dflag") == "N" || model.getValue("/root/hidden/dflag") == ""){
  248. return 0;
  249. }
  250. for(var i = 0 ; i < grd_attachfile.selectedRows; i++)
  251. {
  252. var cur_row = grd_attachfile.selectedRow(i);
  253. var ckno = model.getValue("/root/main/list/attachlist["+cur_row+"]/ckno");
  254. var cknoseq = model.getValue("/root/main/list/attachlist["+cur_row+"]/cknoseq");
  255. var filepath = model.getValue("/root/main/list/attachlist["+cur_row+"]/filepath");
  256. var trseq = model.getValue("/root/main/list/attachlist["+cur_row+"]/trseq");
  257. var imgseq = model.getValue("/root/main/list/attachlist["+cur_row+"]/imgseq");
  258. model.setValue("/root/delsend/ckno", ckno);
  259. model.setValue("/root/delsend/cknoseq", cknoseq);
  260. model.setValue("/root/delsend/trseq", trseq);
  261. model.setValue("/root/delsend/imgseq", imgseq);
  262. submit("TXAEA03904");
  263. }
  264. messageBox("파일을 삭제하였습니다.","I999");
  265. model.removeNodeset("/root/send/attach");
  266. fInitialize();
  267. model.refresh();
  268. submit("TRAEA03904");
  269. model.makeNode("/root/hidden/dflag");
  270. ]]>
  271. </script>
  272. </button>
  273. <img id="img1" ref="/root/image/attachfile/image" style="left:360px; top:50px; background-stretch:stretch; border-color:#B0B0B0; border-style:solid; ">
  274. <script type="javascript" ev:event="onclick">
  275. <![CDATA[
  276. // 파라미터를 이용한 방법 첫번째
  277. // setParameter("opener_parameter_id", model.getValue("/root/image/attachfile/image"));
  278. // modal("SPAEA02603", "0", "900", "900", "SPAEA02603","","");
  279. // 파라미터 두번째 방법
  280. var image = model.getValue("/root/image/attachfile/image");
  281. var printyn = "N";
  282. var sendimage = (image + "▦" + printyn);
  283. setParameter("opener_parameter_id", sendimage);
  284. modal("SPAEA02603", "0", "0", "0", "SPAEA02603","","");
  285. ]]>
  286. </script>
  287. </img>
  288. <button id="button1" class="btn2_letter4" style="left:1100px; top:20px; width:64px; height:19px; ">
  289. <caption>파일저장</caption>
  290. <script type="javascript" ev:event="DOMActivate">
  291. <![CDATA[
  292. if(model.getValue("/root/image/attachfile/image") != "")
  293. {
  294. var idx = grd_attachfile.row;
  295. var filepath = model.getValue("/root/main/list/attachlist["+idx+"]/filepath");
  296. var filenm = model.getValue("/root/main/list/attachlist["+idx+"]/filename");
  297. var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
  298. if (localfile != "") {
  299. model.download(getActionURL("TRAEA03910")+"&filepath="+filepath,localfile);
  300. var rtn = messageBox("파일을", "Q004");
  301. if( rtn == 6 ) {
  302. window.exec(localfile);
  303. }
  304. }
  305. }
  306. ]]>
  307. </script>
  308. </button>
  309. </group>
  310. </xhtml:body>
  311. </xhtml:html>