123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>이미지</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <view>
- <goodimage>
- <status/>
- <instcd/>
- <goodcd/>
- <photimg/>
- <photimg2/>
- </goodimage>
- </view>
- </main>
- <target>
- <defaultvalue>
- <instcd/>
- <goodcd/>
- </defaultvalue>
- </target>
- <send>
- <instcd/>
- <goodcd/>
- </send>
- <init/>
- <temp/>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- //화면 Control을 초기화한다
- fCheckAuth();
- fInitialize();
- ]]>
- </script>
- <submission id="TRRSC00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/view"/>
- <submission id="TXRSC00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
- <script type="javascript">
- <![CDATA[
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- function fInitialize() {
- // model.resetInstanceNode("/root/send");
- // model.resetInstanceNode("/root/main/view");
-
- model.setValue("/root/send/instcd" , model.getValue(PURTARGET_NODE + "/instcd"));
- model.setValue("/root/send/goodcd", model.getValue(PURTARGET_NODE + "/goodcd"));
- model.refresh();
- fRetrImage();
- }
-
- // function fChangeImage(imgsrc) {
- // img_hidden.src = imgsrc; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
- // var data = img_hidden.getbase64data(); // base64 encoding 문자열을 가져온다.
- // var imgSize = getImageSize(imgsrc);
- // var imgWidthSize = imgSize.split("^")[0];
- // var imgHeightSize = imgSize.split("^")[1];
- //
- // model.setValue("/root/main/view/goodimage/photimg",data,true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
- // setImageRefInstance("/root/main/view/goodimage/photimg");
- //
- // if( imgWidthSize <= 340)
- // img_good.attribute("width")= imgWidthSize;
- //
- // if( imgWidthSize <= 270)
- // img_good.attribute("height")= imgHeightSize;
- //
- // model.refresh();
- // }
-
- function fChangeImage(fimg_target, fimg_hidden, fTfile, fcheck)
- {
- if(fcheck == "Y")
- {
- file = fTfile;
- }else if(fcheck == "N")
- {
- var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
- if (file == "") {
- return;
- }
- }
-
- fimg_hidden.src = file; // 파일에서 읽은 이미지의 base64 encoding 값을 가져오기 위한 이미지 컨트롤
- var fdata = fimg_hidden.getbase64data(); // encoding 문자열을 가져온다.
-
- model.setValue(fimg_target.attribute("ref"), fdata, true); // 이미지를 보여주기 위하여 view용 이미지컨트롤의 ref instance에 값을 저장
- setImageRefInstance(fimg_target.attribute("ref"));
-
- fimg_target.attribute("width") = 232;
- fimg_target.attribute("height") = 277;
-
- model.refresh();
- return true;
- }
-
-
- function fMakeNode(pgoodcd){
- model.resetInstanceNode("/root/main/view");
- model.makeNode("/root/main/view/goodimage/status");
- model.makeNode("/root/main/view/goodimage/goodcd");
- model.makeNode("/root/main/view/goodimage/photimg");
- model.makeNode("/root/main/view/goodimage/photimg2");
-
- model.setValue("/root/main/view/goodimage/goodcd", pgoodcd);
- }
-
- function fRetrImage() {
- submit("TRRSC00201",false);
- setImageRefInstance("/root/main/view/goodimage/photimg");
- setImageRefInstance("/root/main/view/goodimage/photimg2");
-
- model.refresh();
- var data = img_gL.getbase64data() + img_gR.getbase64data();
- if(data == null || data.length == 0)
- {
- fMakeNode(model.getValue(PURTARGET_NODE + "/goodcd"));
- model.setValue("/root/main/view/goodimage/status","i");
- fChangeImage(img_gL, img_hL, "../../../com/commonweb/images/no_image.gif", "Y");
- fChangeImage(img_gR, img_hR, "../../../com/commonweb/images/no_image.gif", "Y");
- // fChangeImage( , , "../../../com/commonweb/images/no_image.gif", "");
- }
- else
- {
- model.makeNode("/root/main/view/goodimage/status");
- model.setValue("/root/main/view/goodimage/status","");
- }
- model.refresh();
- }
-
- function fSaveImage(){
- model.copyNode("/root/send","/root/main/view/goodimage");
- model.copyNode("/root/send/goodcd", PURTARGET_NODE + "/goodcd");
- model.refresh();
- submit("TXRSC00201");
- }
- function fCheckAuth() {
- //btn_search.disabled = !checkAuth("R") ;
- btn_save.disabled = !checkAuth("X") ;
- btn_delete.disabled = !checkAuth("X") ;
- //btn_prt.disabled = !checkAuth("P") ;
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="507" pageheight="393" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="grp_tle" style="left:0px; top:0px; width:495px; height:13px; ">
- <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:243px; height:14px; ">사진 등록/변경</caption>
- </group>
- <shape id="rectangle9" fillStyle="solid" shape="rectangle" fillColor="#bbbbbb" style="left:0px; top:42px; width:496px; height:333px; border-color:#788daf; "/>
- <group id="grp_btn" scroll="auto" style="left:0px; top:14px; width:495px; height:27px; ">
- <button id="button45" class="btn4_letter2" style="left:433px; top:3px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.close();
- ]]>
- </script>
- </button>
- <button id="btn_delete" class="btn4_letter2" style="left:376px; top:3px; width:56px; height:22px; ">
- <caption>삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if( messageBox("사진을 삭제 하시겠습니까", "Q999") != 6) return;
-
- model.setValue("/root/main/view/goodimage/status","d");
- btn_save.dispatch("DOMActivate");
- fRetrImage();
- ]]>
- </script>
- </button>
- <button id="btn_save" class="btn4_letter2" style="left:320px; top:3px; width:56px; height:22px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fSaveImage();
- ]]>
- </script>
- </button>
- </group>
- <caption id="cap_gL" class="cell_1" style="left:5px; top:47px; width:240px; height:323px; text-align:center; vertical-align:middle; "/>
- <caption id="cap_gR" class="cell_1" style="left:251px; top:47px; width:240px; height:323px; text-align:center; vertical-align:middle; "/>
- <img id="img_hL" style="left:9px; top:51px; width:232px; height:277px; background-stretch:no-stretch; "/>
- <img id="img_hR" style="left:255px; top:51px; width:232px; height:277px; background-stretch:no-stretch; "/>
- <img id="img_gL" ref="/root/main/view/goodimage/photimg" style="left:10px; top:51px; width:232px; height:277px; background-stretch:stretch; "/>
- <img id="img_gR" ref="/root/main/view/goodimage/photimg2" style="left:256px; top:51px; width:232px; height:277px; background-stretch:stretch; "/>
- <button id="btn_imageLoadR" class="btn2_letter4" style="left:310px; top:340px; width:64px; height:19px; ">
- <caption>불러오기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
- // if (file == "") {
- // return;
- // }
- fChangeImage(img_gR, img_hR, "", "N");
-
- if(model.getValue("/root/main/view/goodimage/status") == "") model.setValue("/root/main/view/goodimage/status","u");
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_imageLoadL" class="btn2_letter4" style="left:60px; top:340px; width:64px; height:19px; ">
- <caption>불러오기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // var file = openImageFileDialog(1048576); // image 파일이 너무 크면 submit 시간이 매우 오래(5분이상) 걸리므로 가급적 사이즈를 작게 제한한다.
- // if (file == "") {
- // return;
- // }
- //fChangeImage(file);
-
- fChangeImage(img_gL, img_hL, "", "N");
-
- if(model.getValue("/root/main/view/goodimage/status") == "") model.setValue("/root/main/view/goodimage/status","u");
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_cleanL" class="btn2_letter4" style="left:125px; top:340px; width:64px; height:19px; ">
- <caption>초기화</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
-
- fChangeImage(img_gL, img_hL, "../../../com/commonweb/images/no_image.gif", "Y");
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_cleanR" class="btn2_letter4" style="left:375px; top:340px; width:64px; height:19px; ">
- <caption>초기화</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fChangeImage(img_gR, img_hR, "../../../com/commonweb/images/no_image.gif", "Y");
- model.refresh();
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|