123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SPAER00401" position="absolute 0 0 665 562" titletext="결과관리(서식)첨부파일 Upload/Download" oninit="SPAER00401_oninit" onload="SPAER00401_onload">
- <Layouts>
- <Layout>
- <Div position="absolute 0 0 664 561" id="group3" scrollbars="autoboth">
- <Layouts>
- <Layout>
- <Shape position="absolute 0 43 663 49" linetype="horizontal" id="line8" class="line_1" style="strokepen:3 solid #33bbbbff;" anchor="default"/>
- <Static text="첨부파일 목록" position="absolute 1 27 119 43" id="caption20" class="tit_2" anchor="default"/>
- <Button position="absolute 607 390 663 409" id="btn_upload" class="btn5" text="업로드" anchor="default" onclick="group3_btn_upload_onclick"/>
- <Button position="absolute 538 390 604 409" id="btn_addfile" class="btn2" text="파일추가" anchor="default" onclick="group3_btn_addfile_onclick"/>
- <Grid position="absolute 0 410 663 560" id="grd_attach" binddataset="ds_send_attach" anchor="default" autofittype="col">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="644"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell text="파일경로"/>
- </Band>
- <Band id="body">
- <Cell style="align:left;padding:0 3 0 3;" text="bind:fullpath"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Button position="absolute 607 21 663 43" id="button1" class="btn1" text="조회" anchor="default" onclick="group3_button1_onclick"/>
- <Button position="absolute 549 21 605 43" id="button2" class="btn4" text="삭제" anchor="default" onclick="group3_button2_onclick"/>
- <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">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="126"/>
- <Column size="0"/>
- <Column size="235"/>
- <Column size="100"/>
- <Column size="100"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell text="업로드일시"/>
- <Cell col="1" text="업로드ID"/>
- <Cell col="2" text="첨부파일명"/>
- <Cell col="3" text="파일크기(Byte)"/>
- <Cell col="4" text="파일종류"/>
- <Cell col="5" text="서버저장경로"/>
- <Cell col="6" text="최초등록자"/>
- <Cell col="7" text="최초등록일시"/>
- <Cell col="8" text="결과일자"/>
- <Cell col="9" text="결과번호"/>
- <Cell col="10" text="부서코드"/>
- <Cell col="11" text="서식코드"/>
- <Cell col="12" text="순번"/>
- </Band>
- <Band id="body">
- <Cell text="bind:lastupdtdt" mask="####-##-## ##:##:##"/>
- <Cell col="1" text="bind:lastupdtrid"/>
- <Cell col="2" style="align:left;padding:0 3 0 3;" text="bind:filename"/>
- <Cell col="3" style="align:right;padding:0 3 0 3;" text="bind:filesize"/>
- <Cell col="4" text="bind:filetype"/>
- <Cell col="5" text="bind:filepath"/>
- <Cell col="6" text="bind:fstrgstrid"/>
- <Cell col="7" text="bind:fstrgstdt"/>
- <Cell col="8" text="bind:rsltdd"/>
- <Cell col="9" text="bind:rsltno"/>
- <Cell col="10" text="bind:suppdeptcd"/>
- <Cell col="11" text="bind:tmplcd"/>
- <Cell col="12" text="bind:seq"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Static id="caption2" text="결과관리(서식)첨부파일 Upload/Download" class="tit_1" position="absolute 0 0 310 25" anchor="default"/>
- </Layout>
- </Layouts>
- </Div>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_main_attachlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="lastupdtdt" type="STRING" size="256"/>
- <Column id="lastupdtrid" type="STRING" size="256"/>
- <Column id="filename" type="STRING" size="256"/>
- <Column id="filesize" type="STRING" size="256"/>
- <Column id="filetype" type="STRING" size="256"/>
- <Column id="filepath" type="STRING" size="256"/>
- <Column id="fstrgstrid" type="STRING" size="256"/>
- <Column id="fstrgstdt" type="STRING" size="256"/>
- <Column id="rsltdd" type="STRING" size="256"/>
- <Column id="rsltno" type="STRING" size="256"/>
- <Column id="suppdeptcd" type="STRING" size="256"/>
- <Column id="tmplcd" type="STRING" size="256"/>
- <Column id="seq" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="lastupdtdt"/>
- <Col id="lastupdtrid"/>
- <Col id="filename"/>
- <Col id="filesize"/>
- <Col id="filetype"/>
- <Col id="filepath"/>
- <Col id="fstrgstrid"/>
- <Col id="fstrgstdt"/>
- <Col id="rsltdd"/>
- <Col id="rsltno"/>
- <Col id="suppdeptcd"/>
- <Col id="tmplcd"/>
- <Col id="seq"/>
- </Row>
- </Rows>
- </Dataset>
- <Dataset id="ds_send_attach" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="file" type="STRING" size="256"/>
- <Column id="filedata" type="BLOB" size="256"/>
- <Column id="filenm" type="STRING" size="256"/>
- <Column id="filesize" type="STRING" size="256"/>
- <Column id="filetype" type="STRING" size="256"/>
- <Column id="fullpath" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="dispid" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row/>
- </Rows>
- </Dataset>
- <Dataset id="ds_delsend" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="rsltdd" type="STRING" size="256"/>
- <Column id="suppdeptcd" type="STRING" size="256"/>
- <Column id="rsltno" type="STRING" size="256"/>
- <Column id="tmplcd" type="STRING" size="256"/>
- <Column id="seq" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="rsltdd"/>
- <Col id="suppdeptcd"/>
- <Col id="rsltno"/>
- <Col id="tmplcd"/>
- <Col id="seq"/>
- </Row>
- </Rows>
- </Dataset>
- <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_hidden" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_download" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_req" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * Creator :
- * Make Date : 2015-11-10
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2015-11-10 Live Converter TF->XP
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // Lib Include
- //---------------------------------------------------------------------------------------
- include "com_commonxp::comm_main.xjs"
- include "ast_examcurexp::AEZ0001.xjs"
- //=======================================================================================
- // Global Form Variable
- //---------------------------------------------------------------------------------------
- var arErrorCode = new HashArray();
- //=======================================================================================
- // Function
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument : N/A
- * Description : 파일리스트 조회
- ****************************************************************************************/
- function call_TRAER00412() {
- var oParam = {};
- oParam.id = "TRAER00412";
- oParam.service = "examcureresultapp.RsltInpt";
- oParam.method = "reqGetAttachFileList";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_attachlist=attachlist";
- oParam.async = false;
- oParam.callback = "cf_TRAER00412";
- tranf_submit(oParam);
- }
- function cf_TRAER00412(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- dsf_setTypeFormat(ds_main_attachlist, "filesize:INT^rsltno:INT^seq:INT");
- }
- //=======================================================================================
- // Event
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Components : Form
- * Components ID : SPAER00401
- * Event : oninit
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description : 화면 처음 초기화시 폼초기화
- ****************************************************************************************/
- function SPAER00401_oninit(obj:Form, e:InitEventInfo)
- {
- frmf_initForm(obj); // 폼 초기화
- }
- /****************************************************************************************
- * Components : Form
- * Components ID : SPAER00401
- * Event : onload
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description : 화면 처음 초기화시 폼초기화
- ****************************************************************************************/
- function SPAER00401_onload(obj:Form, e:LoadEventInfo)
- {
- ds_send.copyData(arg_ds_send);
-
- call_TRAER00412();
- }
- function group3_button2_onclick(obj:Button, e:ClickEventInfo)
- {
- if ( ds_main_attachlist.rowposition > -1 ) {
- var cur_row = ds_main_attachlist.rowposition;
- var rsltdd = ds_main_attachlist.getColumn(cur_row,"rsltdd");
- var suppdeptcd = ds_main_attachlist.getColumn(cur_row,"suppdeptcd");
- var rsltno = ds_main_attachlist.getColumn(cur_row,"rsltno");
- var tmplcd = ds_main_attachlist.getColumn(cur_row,"tmplcd");
- var seq = ds_main_attachlist.getColumn(cur_row,"seq");
- ds_delsend.setColumn(0,"rsltdd" ,rsltdd);
- ds_delsend.setColumn(0,"suppdeptcd" ,suppdeptcd);
- ds_delsend.setColumn(0,"rsltno" ,rsltno);
- ds_delsend.setColumn(0,"tmplcd" ,tmplcd);
- ds_delsend.setColumn(0,"seq" ,seq);
- if ( sysf_messageBox("파일 ["+ds_main_attachlist.getColumn(cur_row,"filename")+"] 을 ","Q001")==6 ) {
- var oParam = {};
- oParam.id = "TXAER00404";
- oParam.service = "examcureresultapp.RsltInpt";
- oParam.method = "reqDelUploadFile";
- oParam.inds = "req=ds_delsend";
- oParam.outds = "ds_hidden=item";
- oParam.async = false;
- oParam.callback = "cf_TXAER00404";
- tranf_submit(oParam);
-
- if ( arErrorCode.pop("TXAER00404") > -1 ) {
- sysf_messageBox("파일을 삭제하였습니다.","I999");
- call_TRAER00412();
- }else {
- sysf_messageBox("파일삭제 실패하였습니다. 전산실로 문의하십시오.","I999");
- ds_delsend.clearData();
- return;
- }
- }else {
- ds_delsend.clearData();
- }
- }
- }
- function cf_TXAER00404(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- function group3_button1_onclick(obj:Button, e:ClickEventInfo)
- {
- call_TRAER00412();
- }
- function group3_grd_attachfile_oncelldblclick(obj:Grid, e:GridClickEventInfo)
- {
- // var idx = ds_main_attachlist.rowposition;
- // var filepath = ds_main_attachlist.getColumn(idx,"filepath");
- // var filenm = ds_main_attachlist.getColumn(idx,"filename");
- //
- // var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
- //
- // if (localfile != "") {
- // model.download(getActionURL("TRAER00413")+"&filepath="+filepath,localfile);
- // var rtn = messageBox("파일을", "Q004");
- // if( rtn == 6 ) {
- // window.exec(localfile);
- // }
- // }
- if(e.row < 0) return;
- var idx = e.row;
- var filepath = ds_main_attachlist.getColumn(idx, "filepath");
- var filenm = ds_main_attachlist.getColumn(idx, "filename");
-
- ds_req.clearData();
- dsf_makeValue(ds_req,"filepath","string",filepath);
- var oParam = {};
- oParam.id = "TRAER00413";
- oParam.service = "examcureresultapp.RsltInpt";
- oParam.method = "reqGetAttachFile";
- oParam.inds = "req=ds_req";
- oParam.outds = "ds_download=attachfile";
- oParam.async = false;
- oParam.error = false;
- oParam.callback = "cf_TRAER00413";
- tranf_submit(oParam);
- }
- function cf_TRAER00413(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- var fd = new FileDialog;
- var objVFile = fd.open("FileSave", FileDialog.SAVE, "%MYDOCUMENT%", ds_main_attachlist.getColumn(ds_main_attachlist.rowposition, "filename")); // 단일 파일 선택
- if (objVFile != null)
- {
- sysf_trace("objVFile.fullpath : " + objVFile.fullpath);
- var temp = dsf_readFileFromDs(objVFile.fullpath, ds_download, 0, "filedata"); // 파일저장
- sleep(1000);
- if( !utlf_isNull(temp) )
- {
- var rtn = sysf_messageBox("파일을", "Q004");
- if( rtn == 6 )
- {
- var text = new String(objVFile.fullpath);
- var replaceText = text.replace(" ", "");
- if( text.length != replaceText.length )
- {
- sysf_messageBox("공백이 포함된 [파일명/폴더]는 자동열기가 실행되지 않습니다.", "E999", "");
- return;
- }
- else
- {
- system.execShell(objVFile.fullpath);
- }
- }
- }
- }
- }
- function group3_btn_addfile_onclick(obj:Button, e:ClickEventInfo)
- {
- // 파일다이얼로그를 띄워 사용자에게 파일경로를 입력받는다.
- var fd = new FileDialog;
- var objVFile = fd.open("FileOpen", FileDialog.SINGLELOAD); // 단일 파일 선택
-
- if(!utlf_isNull(objVFile)) {
- var nRow = ds_send_attach.addRow();
- // 해당 파일을 데이터 셋에 저장한다.
- lf_saveFile(objVFile, nRow);
- }
- }
- function lf_saveFile(objVFile, nRow)
- {
- // var sRowType = ds_send_attach.getRowType(nRow);
- // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
- var file = dsf_writeFileToDs(objVFile, ds_send_attach, nRow, "filedata");
-
- if(file.filesize > 5242880) {
- ds_send_attach.deleteRow(nRow);
- sysf_messageBox("파일 크기가 최대치(5242880Byte)를", "E003");
- return;
- }
-
- var filename = file.filename;
- var filesize = file.filesize;
- var idx = filename.indexOf(".");
- // ds_send_attach.setColumn(nRow, "file" , filename);
- ds_send_attach.setColumn(nRow, "filenm", file.filename);
- ds_send_attach.setColumn(nRow, "filesize", file.filesize);
- ds_send_attach.setColumn(nRow, "filetype", file.filetype);
- ds_send_attach.setColumn(nRow, "fullpath", objVFile.fullpath);
- }
- function group3_btn_upload_onclick(obj:Button, e:ClickEventInfo)
- {
- // 필수입력 체크
- var nUpdatedRow = 0;
- for (var i=0; i<ds_send_attach.rowcount ; i++)
- {
- var sRowType = ds_send_attach.getRowType(i);
-
- if (sRowType == Dataset.ROWTYPE_INSERT ||
- sRowType == Dataset.ROWTYPE_UPDATE ||
- sRowType == Dataset.ROWTYPE_DELETE)
- {
- nUpdatedRow++;
- }
- }
- if (nUpdatedRow == 0)
- {
- sysf_messageBox("변경된 데이터가 없습니다.","E999");
- }
- else {
- var oParam = {};
- oParam.id = "TXAER00403";
- oParam.service = "examcureresultapp.RsltInpt";
- oParam.method = "reqExeUploadFile";
- oParam.inds = "attach=ds_send_attach rsltdd=ds_send";
- oParam.outds = "ds_hidden=item";
- oParam.async = false;
- oParam.callback = "cf_TXAER00403";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TXAER00403") > -1) {
- sysf_messageBox("Upload가 성공적으로 이루어졌습니다.","I999");
- ds_send_attach.clearData();
- call_TRAER00412();
- }
- }
- }
- function cf_TXAER00403(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }]]></Script>
- </Form>
- </FDL>
|