123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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/>
- <target/>
- <init>
- <operator>
- <code>=</code>
- <cdnm>=</cdnm>
- </operator>
- <conector>
- <code>AND</code>
- <cdnm>AND</cdnm>
- <code>OR</code>
- <cdnm>OR</cdnm>
- </conector>
- <condvalu1/>
- <condvalu2/>
- </init>
- <send>
- <captitle/>
- <operator/>
- <conector/>
- <condvalu1/>
- <condvalu2/>
- </send>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fSettingControl();
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript">
- <![CDATA[
- function fSettingControl()
- {
-
- var itemkind = model.getValue("/root/target/defaultvalue/itemkind");
- var operator = model.getValue("/root/target/defaultvalue/operator");
- var conector = model.getValue("/root/target/defaultvalue/conector");
- var condvalu1 = model.getValue("/root/target/defaultvalue/condvalu1");
- var condvalu2 = model.getValue("/root/target/defaultvalue/condvalu2");
- var itemnm = model.getValue("/root/target/defaultvalue/itemnm");
-
- condvalu1 = condvalu1.setReplaceWord("'","");
- condvalu2 = condvalu2.setReplaceWord("'","");
- if((operator == "IN" || operator == "NOT IN")){
- if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" ){
- var tmpcondvalua = condvalu1.split(",");
- var tmpcondvalub = "";
- for ( var i =0 ; i< tmpcondvalua.length;i++){
- tmpcondvalub = tmpcondvalub + tmpcondvalua[i] + ",";
- }
- condvalu1 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
- tmpcondvalua = condvalu2.split(",");
- tmpcondvalub = "";
- for ( var i =0 ; i< tmpcondvalua.length;i++){
- tmpcondvalub = tmpcondvalub + tmpcondvalua[i] + ",";
- }
- condvalu2 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
- }
- }
-
- if(itemkind.length> 0 && itemkind.substr(0, 2) == "YY"){
- if(itemkind == "YYMM"){
- // ipt_condvalu1.attribute("maxlength") = "4";
- // ipt_condvalu2.attribute("maxlength") = "4";
- ipt_condvalu1.attribute("format") = "yyyy-mm";
- ipt_condvalu2.attribute("format") = "yyyy-mm";
- }
- else if(itemkind == "YYMMDD"){
- // ipt_condvalu1.attribute("maxlength") = "8";
- // ipt_condvalu2.attribute("maxlength") = "8";
- ipt_condvalu1.attribute("format") = "yyyy-mm-dd";
- ipt_condvalu2.attribute("format") = "yyyy-mm-dd";
- }
- addGridComboItemAll("cmb_operator","BETWEEN","BETWEEN","above");
- addGridComboItemAll("cmb_operator",">",">","above");
- addGridComboItemAll("cmb_operator",">=",">=","above");
- addGridComboItemAll("cmb_operator","<","<","above");
- addGridComboItemAll("cmb_operator","<=","<=","above");
- }
- else{
- addGridComboItemAll("cmb_operator","<>","<>","above");
- addGridComboItemAll("cmb_operator","BETWEEN","BETWEEN","above");
- addGridComboItemAll("cmb_operator","IN","IN","above");
- addGridComboItemAll("cmb_operator","NOT IN","NOT IN","above");
- }
-
- if (operator == null || operator == "" ) {
- model.setValue(cmb_operator.attribute("ref"),"=");
- }
- else {
- model.setValue(cmb_operator.attribute("ref"),operator);
- }
- model.setValue(ipt_condvalu1.attribute("ref"),condvalu1);
- model.setValue(ipt_condvalu2.attribute("ref"),condvalu2);
-
- if(conector.length == 0){
- model.setValue(cmb_conector.attribute("ref"),"AND");
- }
- else{
- model.setValue(cmb_conector.attribute("ref"),conector);
- }
- if(operator == "BETWEEN"){
- ipt_condvalu2.disabled = false;
- }
- else{
- ipt_condvalu2.disabled = true;
- }
- model.setValue(opt_title.attribute("ref"),itemnm);
- model.refresh();
- }
- function fChkReturn(){
- var operator = model.getValue(cmb_operator.attribute("ref"));
- var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
- var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
- var itemkind = model.getValue("/root/target/defaultvalue/itemkind");
-
- if(operator.length == 0){
- messageBox("연산자는","I003");
- model.setFocus("cmb_operator");
- return false;
- }
- if(condvalu1.length == 0){
- messageBox("조건값1은","I003");
- model.setFocus("ipt_condvalu1");
- return false;
- }
-
- if((operator == "BETWEEN") && (condvalu2.length == 0)){
- messageBox("조건값2는","I003");
- model.setFocus("ipt_condvalu2");
- return false;
- }
- var curdate = getCurrentDate();
- if(itemkind == "YYMMDD"){
- if(condvalu1.length != 8){
- messageBox("조건값1의 입력값을[ex:" + curdate.substr(0, 8) + "]를 잘못입력하셨습니다.처리","E001");
- model.setFocus("ipt_condvalu1");
- return false;
- }
- if((operator == "BETWEEN") && condvalu2.length != 8){
- messageBox("조건값2의 입력값을[ex:" + curdate.substr(0, 8) + "]를 잘못입력하셨습니다.처리","E001");
- model.setFocus("ipt_condvalu2");
- return false;
- }
- }
- else if(itemkind == "YYMM"){
- if(condvalu1.length != 6){
- messageBox("조건값1의 입력값을[ex:" + curdate.substr(0, 6) + "]를 잘못입력하셨습니다.처리","E001");
- model.setFocus("ipt_condvalu1");
- return false;
- }
- if((operator == "BETWEEN") && condvalu2.length != 6){
- messageBox("조건값2의 입력값을[ex:" + curdate.substr(0, 6) + "]를 잘못입력하셨습니다.처리","E001");
- model.setFocus("ipt_condvalu2");
- return false;
- }
- }
- /*
- if(itemkind == "TEXT"){
- var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
- var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
-
- if(condvalu1.length > 0 ) model.setValue(ipt_condvalu1.attribute("ref"),"'" + condvalu1 + "'");
- if(condvalu2.length > 0 ) model.setValue(ipt_condvalu2.attribute("ref"),"'" + condvalu1 + "'");
- }
- */
- var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
- var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
-
- if((operator == "IN" || operator == "NOT IN")){
- if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" ){
- var tmpcondvalua = condvalu1.split(",");
- var tmpcondvalub = "";
- for ( var i =0 ; i< tmpcondvalua.length;i++){
- tmpcondvalub = tmpcondvalub + "'" + tmpcondvalua[i] + "',";
- }
- condvalu1 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
- tmpcondvalua = condvalu2.split(",");
- tmpcondvalub = "";
- for ( var i =0 ; i< tmpcondvalua.length;i++){
- tmpcondvalub = tmpcondvalub + "'" + tmpcondvalua[i] + "',";
- }
- condvalu2 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
- }
- }
- else{
- if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" && operator != "IN" && operator != "NOT IN"){
- if(condvalu1.length > 0 ) condvalu1 = "'" + condvalu1 + "'";
- if(condvalu2.length > 0 ) condvalu2 = "'" + condvalu2 + "'";
- }
- }
-
- model.setValue(ipt_condvalu1.attribute("ref"),condvalu1);
- model.setValue(ipt_condvalu2.attribute("ref"),condvalu2);
- //model.refresh();
- return true;
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="450" pageheight="160" guideline="1,155;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="group3" scroll="auto" style="left:10px; top:0px; width:385px; height:110px; ">
- <line id="line30" class="line_2" style="x1:4px; y1:55px; x2:385px; y2:55px; "/>
- <caption id="caption50" class="cell_1" style="left:3px; top:31px; width:56px; height:23px; vertical-align:middle; ">연산자</caption>
- <caption id="caption52" class="cell_1" style="left:3px; top:56px; width:56px; height:23px; vertical-align:middle; ">조건값1</caption>
- <select1 id="cmb_operator" ref="/root/send/operator" appearance="minimal" style="left:60px; top:33px; width:132px; height:19px; ">
- <choices>
- <itemset nodeset="/root/init/operator">
- <label ref="code"/>
- <value ref="cdnm"/>
- </itemset>
- </choices>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- var operation = model.getValue(cmb_operator.attribute("ref"));
- if(operation == "BETWEEN"){
- ipt_condvalu2.disabled = false;
- }
- else{
- ipt_condvalu2.disabled = true;
- model.setValue(ipt_condvalu2.attribute("ref"),"");
- ipt_condvalu2.refresh();
- }
- ]]>
- </script>
- </select1>
- <caption id="caption1" class="cell_1" style="left:195px; top:30px; width:56px; height:23px; vertical-align:middle; ">연결자</caption>
- <select1 id="cmb_conector" ref="/root/send/conector" appearance="minimal" style="left:252px; top:33px; width:132px; height:19px; ">
- <choices>
- <itemset nodeset="/root/init/conector">
- <label ref="cdnm"/>
- <value ref="code"/>
- </itemset>
- </choices>
- </select1>
- <input id="ipt_condvalu1" ref="/root/send/condvalu1" style="left:60px; top:58px; width:324px; height:19px; "/>
- <caption id="caption2" class="cell_1" style="left:3px; top:81px; width:56px; height:23px; vertical-align:middle; ">조건값2</caption>
- <input id="ipt_condvalu2" ref="/root/send/condvalu2" style="left:60px; top:83px; width:324px; height:19px; "/>
- <line id="line1" class="line_2" style="x1:4px; y1:80px; x2:385px; y2:80px; "/>
- <line id="line2" class="line_2" style="x1:3px; y1:104px; x2:384px; y2:104px; "/>
- <line id="line3" class="line_1" style="x1:3px; y1:25px; x2:385px; y2:25px; "/>
- <caption id="cap_title" class="tit_2" style="left:3px; top:10px; width:15px; height:13px; vertical-align:middle; "/>
- <output id="opt_title" ref="/root/send/captitle" style="left:13px; top:5px; width:360px; height:19px; font-weight:bold; "/>
- </group>
- <group id="group1" scroll="auto" style="left:10px; top:110px; width:386px; height:27px; ">
- <button id="btn_confirm" class="btn4_letter2" style="left:267px; top:2px; width:56px; height:22px; ">
- <caption>확인</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if(!fChkReturn())return;
-
- var rtnvalue = "operator▦conector▦condvalu1▦condvalu2▩" + cmb_operator.value + "▦" + cmb_conector.value + "▦" +ipt_condvalu1.value+ "▦" + ipt_condvalu2.value +"▩";
- if ( checkOpener() ) {
- opener.javascript.setParameter("SMRPB01701_", rtnvalue);
-
- } else {
- var rtn = messageBox("상위화면을 찾을 수", "E001");
- }
- window.close();
- ]]>
- </script>
- </button>
- <button id="btn_cancel" class="btn4_letter2" style="left:324px; top:2px; width:56px; height:22px; ">
- <caption>취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.close();
- ]]>
- </script>
- </button>
- <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:384; y2:0px; "/>
- </group>
- </xhtml:body>
- </xhtml:html>
|