SPAER00401_결과관리(서식)첨부파일.xfdl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPAER00401" position="absolute 0 0 665 562" titletext="결과관리(서식)첨부파일 Upload/Download" oninit="SPAER00401_oninit" onload="SPAER00401_onload">
  5. <Layouts>
  6. <Layout>
  7. <Div position="absolute 0 0 664 561" id="group3" scrollbars="autoboth">
  8. <Layouts>
  9. <Layout>
  10. <Shape position="absolute 0 43 663 49" linetype="horizontal" id="line8" class="line_1" style="strokepen:3 solid #33bbbbff;" anchor="default"/>
  11. <Static text="첨부파일 목록" position="absolute 1 27 119 43" id="caption20" class="tit_2" anchor="default"/>
  12. <Button position="absolute 607 390 663 409" id="btn_upload" class="btn5" text="업로드" anchor="default" onclick="group3_btn_upload_onclick"/>
  13. <Button position="absolute 538 390 604 409" id="btn_addfile" class="btn2" text="파일추가" anchor="default" onclick="group3_btn_addfile_onclick"/>
  14. <Grid position="absolute 0 410 663 560" id="grd_attach" binddataset="ds_send_attach" anchor="default" autofittype="col">
  15. <Formats>
  16. <Format id="default">
  17. <Columns>
  18. <Column size="644"/>
  19. </Columns>
  20. <Rows>
  21. <Row size="24" band="head"/>
  22. <Row size="24"/>
  23. </Rows>
  24. <Band id="head">
  25. <Cell text="파일경로"/>
  26. </Band>
  27. <Band id="body">
  28. <Cell style="align:left;padding:0 3 0 3;" text="bind:fullpath"/>
  29. </Band>
  30. </Format>
  31. </Formats>
  32. </Grid>
  33. <Button position="absolute 607 21 663 43" id="button1" class="btn1" text="조회" anchor="default" onclick="group3_button1_onclick"/>
  34. <Button position="absolute 549 21 605 43" id="button2" class="btn4" text="삭제" anchor="default" onclick="group3_button2_onclick"/>
  35. <Grid position="absolute 0 48 663 376" id="grd_attachfile" visible="true" binddataset="ds_main_attachlist" anchor="default" autofittype="col" oncelldblclick="group3_grd_attachfile_oncelldblclick">
  36. <Formats>
  37. <Format id="default">
  38. <Columns>
  39. <Column size="126"/>
  40. <Column size="0"/>
  41. <Column size="235"/>
  42. <Column size="100"/>
  43. <Column size="100"/>
  44. <Column size="0"/>
  45. <Column size="0"/>
  46. <Column size="0"/>
  47. <Column size="0"/>
  48. <Column size="0"/>
  49. <Column size="0"/>
  50. <Column size="0"/>
  51. <Column size="0"/>
  52. </Columns>
  53. <Rows>
  54. <Row size="24" band="head"/>
  55. <Row size="24"/>
  56. </Rows>
  57. <Band id="head">
  58. <Cell text="업로드일시"/>
  59. <Cell col="1" text="업로드ID"/>
  60. <Cell col="2" text="첨부파일명"/>
  61. <Cell col="3" text="파일크기(Byte)"/>
  62. <Cell col="4" text="파일종류"/>
  63. <Cell col="5" text="서버저장경로"/>
  64. <Cell col="6" text="최초등록자"/>
  65. <Cell col="7" text="최초등록일시"/>
  66. <Cell col="8" text="결과일자"/>
  67. <Cell col="9" text="결과번호"/>
  68. <Cell col="10" text="부서코드"/>
  69. <Cell col="11" text="서식코드"/>
  70. <Cell col="12" text="순번"/>
  71. </Band>
  72. <Band id="body">
  73. <Cell text="bind:lastupdtdt" mask="####-##-## ##:##:##"/>
  74. <Cell col="1" text="bind:lastupdtrid"/>
  75. <Cell col="2" style="align:left;padding:0 3 0 3;" text="bind:filename"/>
  76. <Cell col="3" style="align:right;padding:0 3 0 3;" text="bind:filesize"/>
  77. <Cell col="4" text="bind:filetype"/>
  78. <Cell col="5" text="bind:filepath"/>
  79. <Cell col="6" text="bind:fstrgstrid"/>
  80. <Cell col="7" text="bind:fstrgstdt"/>
  81. <Cell col="8" text="bind:rsltdd"/>
  82. <Cell col="9" text="bind:rsltno"/>
  83. <Cell col="10" text="bind:suppdeptcd"/>
  84. <Cell col="11" text="bind:tmplcd"/>
  85. <Cell col="12" text="bind:seq"/>
  86. </Band>
  87. </Format>
  88. </Formats>
  89. </Grid>
  90. <Static id="caption2" text="결과관리(서식)첨부파일 Upload/Download" class="tit_1" position="absolute 0 0 310 25" anchor="default"/>
  91. </Layout>
  92. </Layouts>
  93. </Div>
  94. </Layout>
  95. </Layouts>
  96. <Objects>
  97. <Dataset id="ds_main_attachlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  98. <ColumnInfo>
  99. <Column id="lastupdtdt" type="STRING" size="256"/>
  100. <Column id="lastupdtrid" type="STRING" size="256"/>
  101. <Column id="filename" type="STRING" size="256"/>
  102. <Column id="filesize" type="STRING" size="256"/>
  103. <Column id="filetype" type="STRING" size="256"/>
  104. <Column id="filepath" type="STRING" size="256"/>
  105. <Column id="fstrgstrid" type="STRING" size="256"/>
  106. <Column id="fstrgstdt" type="STRING" size="256"/>
  107. <Column id="rsltdd" type="STRING" size="256"/>
  108. <Column id="rsltno" type="STRING" size="256"/>
  109. <Column id="suppdeptcd" type="STRING" size="256"/>
  110. <Column id="tmplcd" type="STRING" size="256"/>
  111. <Column id="seq" type="STRING" size="256"/>
  112. </ColumnInfo>
  113. <Rows>
  114. <Row>
  115. <Col id="lastupdtdt"/>
  116. <Col id="lastupdtrid"/>
  117. <Col id="filename"/>
  118. <Col id="filesize"/>
  119. <Col id="filetype"/>
  120. <Col id="filepath"/>
  121. <Col id="fstrgstrid"/>
  122. <Col id="fstrgstdt"/>
  123. <Col id="rsltdd"/>
  124. <Col id="rsltno"/>
  125. <Col id="suppdeptcd"/>
  126. <Col id="tmplcd"/>
  127. <Col id="seq"/>
  128. </Row>
  129. </Rows>
  130. </Dataset>
  131. <Dataset id="ds_send_attach" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  132. <ColumnInfo>
  133. <Column id="file" type="STRING" size="256"/>
  134. <Column id="filedata" type="BLOB" size="256"/>
  135. <Column id="filenm" type="STRING" size="256"/>
  136. <Column id="filesize" type="STRING" size="256"/>
  137. <Column id="filetype" type="STRING" size="256"/>
  138. <Column id="fullpath" type="STRING" size="256"/>
  139. </ColumnInfo>
  140. </Dataset>
  141. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  142. <ColumnInfo>
  143. <Column id="dispid" type="STRING" size="256"/>
  144. </ColumnInfo>
  145. <Rows>
  146. <Row/>
  147. </Rows>
  148. </Dataset>
  149. <Dataset id="ds_delsend" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  150. <ColumnInfo>
  151. <Column id="rsltdd" type="STRING" size="256"/>
  152. <Column id="suppdeptcd" type="STRING" size="256"/>
  153. <Column id="rsltno" type="STRING" size="256"/>
  154. <Column id="tmplcd" type="STRING" size="256"/>
  155. <Column id="seq" type="STRING" size="256"/>
  156. </ColumnInfo>
  157. <Rows>
  158. <Row>
  159. <Col id="rsltdd"/>
  160. <Col id="suppdeptcd"/>
  161. <Col id="rsltno"/>
  162. <Col id="tmplcd"/>
  163. <Col id="seq"/>
  164. </Row>
  165. </Rows>
  166. </Dataset>
  167. <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  168. <Dataset id="ds_hidden" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  169. <Dataset id="ds_download" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  170. <Dataset id="ds_req" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  171. </Objects>
  172. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  173. * System Name :
  174. * Job Name :
  175. * Creator :
  176. * Make Date : 2015-11-10
  177. * Description :
  178. *---------------------------------------------------------------------------------------
  179. * Modify Date Modifier Modify Description
  180. *---------------------------------------------------------------------------------------
  181. * 2015-11-10 Live Converter TF->XP
  182. *
  183. *---------------------------------------------------------------------------------------
  184. ****************************************************************************************/
  185. //=======================================================================================
  186. // Lib Include
  187. //---------------------------------------------------------------------------------------
  188. include "com_commonxp::comm_main.xjs"
  189. include "ast_examcurexp::AEZ0001.xjs"
  190. //=======================================================================================
  191. // Global Form Variable
  192. //---------------------------------------------------------------------------------------
  193. var arErrorCode = new HashArray();
  194. //=======================================================================================
  195. // Function
  196. //---------------------------------------------------------------------------------------
  197. /****************************************************************************************
  198. * Argument : N/A
  199. * Description : 파일리스트 조회
  200. ****************************************************************************************/
  201. function call_TRAER00412() {
  202. var oParam = {};
  203. oParam.id = "TRAER00412";
  204. oParam.service = "examcureresultapp.RsltInpt";
  205. oParam.method = "reqGetAttachFileList";
  206. oParam.inds = "req=ds_send";
  207. oParam.outds = "ds_main_attachlist=attachlist";
  208. oParam.async = false;
  209. oParam.callback = "cf_TRAER00412";
  210. tranf_submit(oParam);
  211. }
  212. function cf_TRAER00412(sSvcId, nErrorCode, sErrorMsg) {
  213. if(nErrorCode < 0) return;
  214. dsf_setTypeFormat(ds_main_attachlist, "filesize:INT^rsltno:INT^seq:INT");
  215. }
  216. //=======================================================================================
  217. // Event
  218. //---------------------------------------------------------------------------------------
  219. /****************************************************************************************
  220. * Components : Form
  221. * Components ID : SPAER00401
  222. * Event : oninit
  223. * Argument : 01.obj : Object Event has occurred
  224. * : 02.e : Event Object
  225. * Description : 화면 처음 초기화시 폼초기화
  226. ****************************************************************************************/
  227. function SPAER00401_oninit(obj:Form, e:InitEventInfo)
  228. {
  229. frmf_initForm(obj); // 폼 초기화
  230. }
  231. /****************************************************************************************
  232. * Components : Form
  233. * Components ID : SPAER00401
  234. * Event : onload
  235. * Argument : 01.obj : Object Event has occurred
  236. * : 02.e : Event Object
  237. * Description : 화면 처음 초기화시 폼초기화
  238. ****************************************************************************************/
  239. function SPAER00401_onload(obj:Form, e:LoadEventInfo)
  240. {
  241. ds_send.copyData(arg_ds_send);
  242. call_TRAER00412();
  243. }
  244. function group3_button2_onclick(obj:Button, e:ClickEventInfo)
  245. {
  246. if ( ds_main_attachlist.rowposition > -1 ) {
  247. var cur_row = ds_main_attachlist.rowposition;
  248. var rsltdd = ds_main_attachlist.getColumn(cur_row,"rsltdd");
  249. var suppdeptcd = ds_main_attachlist.getColumn(cur_row,"suppdeptcd");
  250. var rsltno = ds_main_attachlist.getColumn(cur_row,"rsltno");
  251. var tmplcd = ds_main_attachlist.getColumn(cur_row,"tmplcd");
  252. var seq = ds_main_attachlist.getColumn(cur_row,"seq");
  253. ds_delsend.setColumn(0,"rsltdd" ,rsltdd);
  254. ds_delsend.setColumn(0,"suppdeptcd" ,suppdeptcd);
  255. ds_delsend.setColumn(0,"rsltno" ,rsltno);
  256. ds_delsend.setColumn(0,"tmplcd" ,tmplcd);
  257. ds_delsend.setColumn(0,"seq" ,seq);
  258. if ( sysf_messageBox("파일 ["+ds_main_attachlist.getColumn(cur_row,"filename")+"] 을 ","Q001")==6 ) {
  259. var oParam = {};
  260. oParam.id = "TXAER00404";
  261. oParam.service = "examcureresultapp.RsltInpt";
  262. oParam.method = "reqDelUploadFile";
  263. oParam.inds = "req=ds_delsend";
  264. oParam.outds = "ds_hidden=item";
  265. oParam.async = false;
  266. oParam.callback = "cf_TXAER00404";
  267. tranf_submit(oParam);
  268. if ( arErrorCode.pop("TXAER00404") > -1 ) {
  269. sysf_messageBox("파일을 삭제하였습니다.","I999");
  270. call_TRAER00412();
  271. }else {
  272. sysf_messageBox("파일삭제 실패하였습니다. 전산실로 문의하십시오.","I999");
  273. ds_delsend.clearData();
  274. return;
  275. }
  276. }else {
  277. ds_delsend.clearData();
  278. }
  279. }
  280. }
  281. function cf_TXAER00404(sSvcId, nErrorCode, sErrorMsg) {
  282. arErrorCode.push(sSvcId, nErrorCode);
  283. }
  284. function group3_button1_onclick(obj:Button, e:ClickEventInfo)
  285. {
  286. call_TRAER00412();
  287. }
  288. function group3_grd_attachfile_oncelldblclick(obj:Grid, e:GridClickEventInfo)
  289. {
  290. // var idx = ds_main_attachlist.rowposition;
  291. // var filepath = ds_main_attachlist.getColumn(idx,"filepath");
  292. // var filenm = ds_main_attachlist.getColumn(idx,"filename");
  293. //
  294. // var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
  295. //
  296. // if (localfile != "") {
  297. // model.download(getActionURL("TRAER00413")+"&filepath="+filepath,localfile);
  298. // var rtn = messageBox("파일을", "Q004");
  299. // if( rtn == 6 ) {
  300. // window.exec(localfile);
  301. // }
  302. // }
  303. if(e.row < 0) return;
  304. var idx = e.row;
  305. var filepath = ds_main_attachlist.getColumn(idx, "filepath");
  306. var filenm = ds_main_attachlist.getColumn(idx, "filename");
  307. ds_req.clearData();
  308. dsf_makeValue(ds_req,"filepath","string",filepath);
  309. var oParam = {};
  310. oParam.id = "TRAER00413";
  311. oParam.service = "examcureresultapp.RsltInpt";
  312. oParam.method = "reqGetAttachFile";
  313. oParam.inds = "req=ds_req";
  314. oParam.outds = "ds_download=attachfile";
  315. oParam.async = false;
  316. oParam.error = false;
  317. oParam.callback = "cf_TRAER00413";
  318. tranf_submit(oParam);
  319. }
  320. function cf_TRAER00413(sSvcId, nErrorCode, sErrorMsg) {
  321. if(nErrorCode < 0) return;
  322. var fd = new FileDialog;
  323. var objVFile = fd.open("FileSave", FileDialog.SAVE, "%MYDOCUMENT%", ds_main_attachlist.getColumn(ds_main_attachlist.rowposition, "filename")); // 단일 파일 선택
  324. if (objVFile != null)
  325. {
  326. sysf_trace("objVFile.fullpath : " + objVFile.fullpath);
  327. var temp = dsf_readFileFromDs(objVFile.fullpath, ds_download, 0, "filedata"); // 파일저장
  328. sleep(1000);
  329. if( !utlf_isNull(temp) )
  330. {
  331. var rtn = sysf_messageBox("파일을", "Q004");
  332. if( rtn == 6 )
  333. {
  334. var text = new String(objVFile.fullpath);
  335. var replaceText = text.replace(" ", "");
  336. if( text.length != replaceText.length )
  337. {
  338. sysf_messageBox("공백이 포함된 [파일명/폴더]는 자동열기가 실행되지 않습니다.", "E999", "");
  339. return;
  340. }
  341. else
  342. {
  343. system.execShell(objVFile.fullpath);
  344. }
  345. }
  346. }
  347. }
  348. }
  349. function group3_btn_addfile_onclick(obj:Button, e:ClickEventInfo)
  350. {
  351. // 파일다이얼로그를 띄워 사용자에게 파일경로를 입력받는다.
  352. var fd = new FileDialog;
  353. var objVFile = fd.open("FileOpen", FileDialog.SINGLELOAD); // 단일 파일 선택
  354. if(!utlf_isNull(objVFile)) {
  355. var nRow = ds_send_attach.addRow();
  356. // 해당 파일을 데이터 셋에 저장한다.
  357. lf_saveFile(objVFile, nRow);
  358. }
  359. }
  360. function lf_saveFile(objVFile, nRow)
  361. {
  362. // var sRowType = ds_send_attach.getRowType(nRow);
  363. // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
  364. var file = dsf_writeFileToDs(objVFile, ds_send_attach, nRow, "filedata");
  365. if(file.filesize > 5242880) {
  366. ds_send_attach.deleteRow(nRow);
  367. sysf_messageBox("파일 크기가 최대치(5242880Byte)를", "E003");
  368. return;
  369. }
  370. var filename = file.filename;
  371. var filesize = file.filesize;
  372. var idx = filename.indexOf(".");
  373. // ds_send_attach.setColumn(nRow, "file" , filename);
  374. ds_send_attach.setColumn(nRow, "filenm", file.filename);
  375. ds_send_attach.setColumn(nRow, "filesize", file.filesize);
  376. ds_send_attach.setColumn(nRow, "filetype", file.filetype);
  377. ds_send_attach.setColumn(nRow, "fullpath", objVFile.fullpath);
  378. }
  379. function group3_btn_upload_onclick(obj:Button, e:ClickEventInfo)
  380. {
  381. // 필수입력 체크
  382. var nUpdatedRow = 0;
  383. for (var i=0; i<ds_send_attach.rowcount ; i++)
  384. {
  385. var sRowType = ds_send_attach.getRowType(i);
  386. if (sRowType == Dataset.ROWTYPE_INSERT ||
  387. sRowType == Dataset.ROWTYPE_UPDATE ||
  388. sRowType == Dataset.ROWTYPE_DELETE)
  389. {
  390. nUpdatedRow++;
  391. }
  392. }
  393. if (nUpdatedRow == 0)
  394. {
  395. sysf_messageBox("변경된 데이터가 없습니다.","E999");
  396. }
  397. else {
  398. var oParam = {};
  399. oParam.id = "TXAER00403";
  400. oParam.service = "examcureresultapp.RsltInpt";
  401. oParam.method = "reqExeUploadFile";
  402. oParam.inds = "attach=ds_send_attach rsltdd=ds_send";
  403. oParam.outds = "ds_hidden=item";
  404. oParam.async = false;
  405. oParam.callback = "cf_TXAER00403";
  406. tranf_submit(oParam);
  407. if(arErrorCode.pop("TXAER00403") > -1) {
  408. sysf_messageBox("Upload가 성공적으로 이루어졌습니다.","I999");
  409. ds_send_attach.clearData();
  410. call_TRAER00412();
  411. }
  412. }
  413. }
  414. function cf_TXAER00403(sSvcId, nErrorCode, sErrorMsg) {
  415. arErrorCode.push(sSvcId, nErrorCode);
  416. }]]></Script>
  417. </Form>
  418. </FDL>