MRF004.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**
  2. * @group :
  3. * @ver : 2007.02.27
  4. * @by : 이은영
  5. * @---------------------------------------------------
  6. * @type : function
  7. * @access : public
  8. * @desc : 화면 초기화
  9. * @param :
  10. * @return :
  11. * @---------------------------------------------------
  12. */
  13. function fInit(){
  14. fSearch();
  15. }
  16. /**
  17. * @group :
  18. * @ver : 2007.02.27
  19. * @by : 이은영
  20. * @---------------------------------------------------
  21. * @type : function
  22. * @access : public
  23. * @desc : 이미지 정보 조회
  24. * @param :
  25. * @return :
  26. * @---------------------------------------------------
  27. */
  28. function fSearch(){
  29. model.removenodeset("/root/main/list");
  30. if(model.getValue("/root/main/cond/imgnm") != "")
  31. model.makeValue("/root/send/imgnm", model.getValue("/root/main/cond/imgnm"));
  32. else
  33. model.makeValue("/root/send/imgnm", "%");
  34. submit("TRMRF00401");
  35. model.removenodeset("/root/send/imgnm");
  36. }
  37. /**
  38. * @group :
  39. * @ver : 2007.02.27
  40. * @by : 이은영
  41. * @---------------------------------------------------
  42. * @type : function
  43. * @access : public
  44. * @desc : 이미지 정보 초기화
  45. * @param :
  46. * @return :
  47. * @---------------------------------------------------
  48. */
  49. function fClearImgInfo(){
  50. var xPath ="/root/main/imginfo";
  51. model.setValue(xPath+"/imgcd","");
  52. model.setValue(xPath+"/ioflag","");
  53. model.setValue(xPath+"/orddeptcd","");
  54. model.setValue(xPath+"/anotoindxcd","");
  55. model.setValue(xPath+"/imgnm","");
  56. model.setValue(xPath+"/imgfilenm","");
  57. model.setValue(xPath+"/userimgfilenm","");
  58. model.setValue(xPath+"/imgdesc","");
  59. model.setValue(xPath+"/usdt",getDate());
  60. model.setValue(xPath+"/uedt","29991231");
  61. model.setValue(xPath+"/valiflag","");
  62. model.setValue(xPath+"/updtuser","");
  63. model.setValue(xPath+"/updtdt","");
  64. model.setValue(xPath+"/updtrsn","");
  65. model.setValue(xPath+"/rem","");
  66. model.setValue(xPath+"/imgdata","");
  67. model.setValue(xPath+"/imgno","");
  68. model.refresh();
  69. }
  70. /**
  71. * @group :
  72. * @ver : 2007.02.27
  73. * @by : 이은영
  74. * @---------------------------------------------------
  75. * @type : function
  76. * @access : public
  77. * @desc : 이미지 정보 저장
  78. * @param :
  79. * @return :
  80. * @---------------------------------------------------
  81. */
  82. function fSave(){
  83. var xPath = "/root/main/imginfo";
  84. model.setValue("/root/main/cond/imgnm","");
  85. model.makeValue("/root/send/imginfo","");
  86. model.copyNode("/root/send/imginfo","/root/main/imginfo");
  87. model.removenodeset("/root/main/list");
  88. submit("TXMRF00401");
  89. fClearImgInfo();
  90. model.removenodeset("/root/send/imginfo");
  91. model.refresh();
  92. }
  93. /**
  94. * @group :
  95. * @ver : 2007.02.27
  96. * @by : 이은영
  97. * @---------------------------------------------------
  98. * @type : function
  99. * @access : public
  100. * @desc : 그리드 더블 클릭시..
  101. * @param :
  102. * @return :
  103. * @---------------------------------------------------
  104. */
  105. function fGridDlClick(){
  106. var sRow = grd_imglist.row;
  107. var xImglistPath = "/root/main/list/imglist";
  108. var xImgInfoPath = "/root/main/imginfo";
  109. model.setValue(xImgInfoPath+"/imgcd",model.getValue(xImglistPath+"["+sRow+"]/imgcd"));
  110. model.setValue(xImgInfoPath+"/ioflag",model.getValue(xImglistPath+"["+sRow+"]/ioflag"));
  111. model.setValue(xImgInfoPath+"/orddeptcd",model.getValue(xImglistPath+"["+sRow+"]/orddeptcd"));
  112. model.setValue(xImgInfoPath+"/anotoindxcd",model.getValue(xImglistPath+"["+sRow+"]/anotoindxcd"));
  113. model.setValue(xImgInfoPath+"/imgnm",model.getValue(xImglistPath+"["+sRow+"]/imgnm"));
  114. model.setValue(xImgInfoPath+"/imgfilenm",model.getValue(xImglistPath+"["+sRow+"]/imgfilenm"));
  115. model.setValue(xImgInfoPath+"/userimgfilenm",model.getValue(xImglistPath+"["+sRow+"]/userimgfilenm"));
  116. model.setValue(xImgInfoPath+"/imgdesc",model.getValue(xImglistPath+"["+sRow+"]/imgdesc"));
  117. model.setValue(xImgInfoPath+"/usdt",model.getValue(xImglistPath+"["+sRow+"]/usdt"));
  118. model.setValue(xImgInfoPath+"/uedt",model.getValue(xImglistPath+"["+sRow+"]/uedt"));
  119. model.setValue(xImgInfoPath+"/valiflag",model.getValue(xImglistPath+"["+sRow+"]/valiflag"));
  120. model.setValue(xImgInfoPath+"/imgdata",model.getValue(xImglistPath+"["+sRow+"]/imgdata"));
  121. setImageRefInstance(xImgInfoPath+"/imgdata");
  122. model.setValue(xImgInfoPath+"/imgno",model.getValue(xImglistPath+"["+sRow+"]/imgno"));
  123. model.refresh();
  124. }
  125. /**
  126. * @group :
  127. * @ver : 2007.02.27
  128. * @by : 이은영
  129. * @---------------------------------------------------
  130. * @type : function
  131. * @access : public
  132. * @desc : 파일 열기
  133. * @param :
  134. * @return :
  135. * @---------------------------------------------------
  136. */
  137. function fOpenFile(){
  138. var file =openImageFileDialog(32768); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
  139. if (file == "") {
  140. return;
  141. }
  142. img_hidden.src=file; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
  143. var data = img_hidden.getbase64data(); // base64 encoding 문자열을 가져온다.
  144. model.setValue("/root/main/imginfo/imgdata",data,true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
  145. setImageRefInstance("/root/main/imginfo/imgdata");
  146. model.refresh();
  147. }