BlogJava 首頁 新隨筆 聯系 聚合 管理
            2 Posts :: 0 Stories :: 0 Comments :: 0 Trackbacks

          2008年3月4日 #

          <%@ page contentType="text/html; charset=GBK"%>
          <%@ include file="/common/inc_bns.jsp"%>


          <%
          String orgGuid = (String)request.getParameter("orgGuid");
          %>
          <html>
           <head>
            <script language="javascript" src="<%=mainWeb%>/script/util/xmlutil.js"></script>
            <script language="javascript" src="<%=mainWeb%>/script/util/stringutil.js"></script>
            <script language="javascript" src="<%=mainWeb%>/script/ajax/ajax.js"></script>
           </head>
           <body topmargin="18">
             <table class="data_tb" align="center" width="90%">
              <tr height="25">
               <td class="data_tb_td" width="30%">任務名稱&nbsp;<font color="red">*</font></td>
               <td ><input style="width:65%" id="jobName" name="jobName"></td>
              </tr>
              <tr>
               <td class="data_tb_td">spring bean</td>
               <td><input style="width:65%" id="springBean" name="springBean"></td>
              </tr>
              <tr>
               <td class="data_tb_td">方法名</td>
               <td><input style="width:65%" id="methodName" name="methodName" onkeyup="showMethod()" onblur=selMethod($('javaMethod').value)></td>
              </tr>
              <tr>
               <td class="data_tb_td">方法描述</td>
               <td><select style="width:65%" id="javaMethod" name="javaMethod" onblur=selMethod($('javaMethod').value)></select></td>
              </tr>
              <tr>
               <td class="data_tb_td">任務描述</td>
               <td><textarea rows="4" id="jobRemark" name="jobRemark" style="width:90%" ></textarea></td>
              </tr>
              <tr id="paramTR" style="display:none">
               <td colspan="2">
                <div class="splitDiv">
                  <div class="tip">
                  <img src="<%=skinImage%>/main/arrow.gif">參數定義</div>
                   <table width="100%" border="0" class="data_tb" id="tbParam" cellspacing="0" cellpadding="0">
                    <tr height="25">
                     <td class="list_table_head" width="40%" >參數名稱</td>
                     <td class="list_table_head" width="60%">參數描述</td>
                    </tr>
                    <!--用來復制的空行 開始-->
                    <tr height="25" style="display:none">
                     <td align="center"><input type='text' style="width:70%" name="paramName" class="txtInput"/></td>
                     <td align="center"><input type='text' style="width:80%" name="paramRemark" class="txtInput"/></td>
                    </tr>
                   </table>
                  </div>
                  <!-- 快捷鍵配置 結束 -->
                  </tr>
                 </table>
                </div>
               </td>
              </tr>
             </table>
             <div class="buttonDiv" style="margin-top:18px;">
              <input type="button" class="button" name="save" value="保  存" onclick="doSave()">
              &nbsp;<input type="button" class="button" value="取  消" onclick="window.close();">
             </div>
           </body>
          </html>
          <script>
          var orgGuid = '<%=orgGuid%>';

          function doSave(){
           if (trim($('jobName').value) != '') {
            var reqUrl = webPath + '/JobMngAction.do?method=saveNewJob';
            if(checkKeysRowData() != true) {
             return;
            }else {
             var param = getData();
             sendRequestMore(reqUrl,param,"doJobSave()");
             document.all.save.disabled = true;
             }
           } else {
            alert("請輸入任務名稱");
            return;
           }
          }

          //新增回調
          function doJobSave(){
           if(xml_request.responseText != ''){
            var retScript = parseXmlbyXMLHttpRequest(xml_request,"resultInfo");
            popAlert(retScript,function(){
             window.close();
            });
           }
          }

          //以XML格式組織待保存的數據
          function getData(){
           return (getJobData() + getParamData());
          }

          //獲取系統樣式基本配置信息
          function getJobData(){
           var xml = '<Jobs>';
            xml += '<job><jobName>' + document.all.jobName.value + '</jobName>';
            xml += '<springBean>' + document.all.springBean.value + '</springBean>';
            xml += '<methodName>' + document.all.methodName.value + '</methodName>';
            xml += '<javaMethod>' + document.all.javaMethod.value + '</javaMethod>';
            xml += '<jobRemark>' + trim(document.all.jobRemark.value) + '</jobRemark>';
            xml += '<orgGuid>' + orgGuid + '</orgGuid>';
            xml += '</job>';
           xml += '</Jobs>';
           return xml;
          }

          //獲取錄入參數信息
          function getParamData(){
           var rows = document.getElementById('tbParam').rows;
           var xml = '<Params>';
           for(var k = 2,len = rows.length; k < len; k++){
            xml += '<param><name>' + trim(rows[k].cells[0].firstChild.value) + '</name>';
            xml += '<remark>' + trim(rows[k].cells[1].firstChild.value) + '</remark>';
            xml += '</param>';
           }
           xml += '</Params>';
           return xml;
          }

          //獲取方法描述
          function showMethod(){
           if (checkLength($('springBean').value)>0 && checkLength($('methodName').value)>0){
            var url = "<%=mainWeb%>/JobMngAction.do?method=getMethod&springBean="+$('springBean').value+"&methodName="+$('methodName').value;
            sendRequest(url,"showJobDetail()");
           }else  {
            return;
           }
          }
          //展示方法描述,同時展示對應所需要的方法參數的個數
          function showJobDetail(){
           if(http_request.responseText!=""){
            $('javaMethod').outerHTML = http_request.responseText;
            var hadoption = $('javaMethod').outerHTML.split("OPTION");
            if (hadoption.length > 1) {
             var textValue = $('javaMethod').options[$('javaMethod').selectedIndex].innerText;
             var leftpoint = textValue.indexOf("(");
             var rightpoint = textValue.lastIndexOf(")");
             var newtextValue = textValue.substr( parseInt(leftpoint),parseInt(rightpoint) );
             document.all.save.disabled = false;
             if (newtextValue != null && newtextValue != 'null' && newtextValue.length>0) {
              var params = newtextValue.split("String");
              if (params.length-1 > 0) {
               /*取得當前表*/
               var tab = document.getElementById('tbParam');
               var lc = tab.rows.length;
               if (lc > 2){
                for (var i=lc;i>2;i--) {
                 /*執行刪除*/
                 tab.rows[i-1].removeNode(true);
                }
                $('paramTR').style.display="";
               }
               
               for (var num=0;num<params.length-1;num++) {
                /*取得表內容第一行*/
                var rows = document.getElementById('tbParam').rows;
                var firstTR = tab.rows[1];
                  /*克隆第一行內容*/
                  var newTR = firstTR.cloneNode(true);
                  /*將克隆的一行追加到當前DOM對象的最后*/
                  tab.firstChild.appendChild(newTR);
                  /*將克隆的一行顯示出來*/
                  newTR.style.display = "";
               }
               $('paramTR').style.display="";
              }else {
               $('paramTR').style.display="none";
              }
             }
            }else  {
             document.all.save.disabled = true;
             return;
            }
           }else  {
            return;
           }
          }


          //響應方法描述下拉礦選擇,變換方法名稱
          function selMethod(value){
           var index = value.indexOf("(");
           $('methodName').value=value.substring(0,index);
           $('javaMethod').value=value;
           selectShowJobDetail();
          }

          //選擇方法描述后選擇到的方法
          function selectShowJobDetail() {
           if(http_request.responseText!=""){
            var textValue = document.all.javaMethod.value;
            var hadoption = $('javaMethod').outerHTML.split("OPTION");
            if (hadoption.length > 1) {
             var leftpoint = textValue.indexOf("(");
             var rightpoint = textValue.lastIndexOf(")");
             var newtextValue = textValue.substr( parseInt(leftpoint),parseInt(rightpoint) );
             document.all.save.disabled = false;
             if (newtextValue != null && newtextValue != 'null' && newtextValue.length > 0) {
              var params = newtextValue.split("String");
              if (params.length-1 > 0) {
               /*取得當前表*/
               var tab = document.getElementById('tbParam');
               var lc = tab.rows.length;
               if (lc > 2){
                for (var i=lc;i>2;i--) {
                 /*執行刪除*/
                 tab.rows[i-1].removeNode(true);
                }
                $('paramTR').style.display="";
               }
               
               for (var num=0;num<params.length-1;num++) {
                /*取得表內容第一行*/
                var rows = document.getElementById('tbParam').rows;
                var firstTR = tab.rows[1];
                  /*克隆第一行內容*/
                  var newTR = firstTR.cloneNode(true);
                  /*將克隆的一行追加到當前DOM對象的最后*/
                  tab.firstChild.appendChild(newTR);
                  /*將克隆的一行顯示出來*/
                  newTR.style.display = "";
               }
               $('paramTR').style.display="";
              }else {
               $('paramTR').style.display="none";
              }
             }
            }else  {
             document.all.save.disabled = true;
             return;
            }
           }else  {
            return;
           }
          }

           

          function doAddNewTD(obj){
             /*取得當前表*/
             var tab = obj.parentElement.parentElement.parentElement;
             /*取得表內容第一行*/
             var firstTR = tab.rows[1];
             var rows = document.getElementById('tbParam').rows;
             /*克隆第一行內容*/
             var newTR = firstTR.cloneNode(true);
             /*將克隆的一行顯示出來*/
             newTR.style.display = "";
             /*將克隆的一行追加到當前DOM對象的最后*/
             tab.appendChild(newTR);
          }

          /*從表格中移出一行*/
          function doRemoveTD(obj){
             /*取得當前行*/
             var curRow = obj.parentElement.parentElement;
             /*取得當前操作表*/
             var tab = curRow.parentElement;
             /*只有大于兩行的時候才準予刪除*/
             if (tab.rows.length > 3){
           /*執行刪除*/
           tab.deleteRow(curRow.rowIndex);
             }
          }

          //檢驗任務錄入的數據是否合法
          function checkJobData() {
           var jobName = document.all.jobName.value;
           var springBean = document.all.springBean.value;
           var methodName = document.all.methodName.value;
           var javaMethod = document.all.javaMethod.value;
           var jobRemark = document.all.jobRemark.value;
           if (checkLength(jobName)>50) {
            alert("任務名稱過長!");
            return false;
           }
           if (trim(jobName) == '' ) {
            alert("任務名稱不能為空!");
            return false;
           }
           if (checkLength(springBean)>30) {
            alert("spring Bean名稱過長!");
            return false;
           }
           if (trim(springBean) == '' ) {
            alert("spring Bean名稱不能為空!");
            return false;
           }
           if (checkLength(methodName)>30) {
            alert("方法名過長!");
            return false;
           }
           if (trim(methodName) == '' ) {
            alert("方法名不能為空!");
            return false;
           }
           if (checkLength(javaMethod)>250) {
            alert("方法描述過長!");
            return false;
           }
           if (trim(javaMethod) == '' ) {
            alert("方法描述不能為空!");
            return false;
           }
           if (checkLength(jobRemark)>250) {
            alert("任務描述過長!");
            return false;
           }
           return true;
          }


          //檢驗行內錄入的參數否合法
          function checkKeysRowData(){
           var rows = document.getElementById('tbParam').rows;
           checkJobData();
           for(var i=2,len = rows.length;i<len;i++) {
            var strvalueName = rows[i].cells[0].firstChild.value;
            var strvalueRemark = rows[i].cells[1].firstChild.value;
            if (trim(strvalueName) == "" || trim(strvalueRemark) == "") {
             alert("參數不能為空");
             return false;
            }
            if (checkLength(strvalueName)>50) {
             alert("第"+i+"行參數名稱太長!");
             return false;
            }
            if (checkLength(strvalueRemark)>100) {
             alert("第"+i+"行參數描述太長!");
             return false;
            }
           }
           return true;
          }
          </script>

          posted @ 2008-03-04 18:36 海浪 閱讀(160) | 評論 (0)編輯 收藏

          <%@ page contentType="text/html; charset=GBK"%>
          <%@ include file="/common/inc_bns.jsp"%>
          <%@ page import="com.jiuqi.common.PageControl"%>
          <%@ page import="com.jiuqi.ccp.common.DicMap" %>
          <%@ page import="com.jiuqi.ccp.formbean.form.CcpMscMonitorExtForm"%>

           

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
          <%
          PageControl pageCtrl = (PageControl) request.getAttribute(Constants.PAGE_CONTROL);
          String orgGuid = (String)request.getAttribute("orgGuid");
          String opResult = (String)request.getAttribute("opResult");
          String beginTime = (String)request.getAttribute("beginTime");
          String endTime = (String)request.getAttribute("endTime");
          String inputUserTitle = (String)request.getAttribute("inputUserTitle");
          %>
          <html>
          <head>
           <script language="javascript" src="<%=mainWeb%>/script/table/table.js"></script>
           <script language="javascript" src="<%=mainWeb%>/script/ajax/ajax.js"></script>
          <style>
          .txtInput{
           width:140px;
          }
          </style>
          </head>
          <body >
           <!-- 查詢條件 begin -->
           <html:form action="/BusLogAction.do" method="post">
           <input type="hidden" name="method" value="queryBusLog">
           <input type="hidden" name="orgGuid" value="<%=orgGuid%>">
           <html:hidden property="pageNum" value="" />
           <html:hidden property="pageSize" value="" />
            <table border="0" cellspacing="0" cellpadding="0" class="data_tb" width="100%">
             <tr height="25px">
              <td class="data_tb_td" width="20%">開始時間</td>
              <td width="30%"><input type="text" class="txtInput" name="beginTime" ></td>
              <td class="data_tb_td" width="15%">結束時間</td>
              <td width="30%"><input type="text" class="txtInput" name="endTime" ></td>
             </tr>
             <tr height="25px">
              <td class="data_tb_td">用戶姓名</td>
               <td><input type="text" class="txtInput" name="inputUserTitle" ></td>
              <td class="data_tb_td">操作結果</td>
              <td>
                  <select style="width:155px" name="opResult" onchange="doQuerySelect(this.value)">
                  <option value="00">00 | 全部</option>
                    <%=DicMap.getInstance().getSelectOptionHtml("DIC_OPRESULT","")%>
                    </select>
              </td>
             </tr>
             <tr height="25px">
                 <td colspan="4" align="right"><input type="button" class="button" name="btnQuery" id="btnQuery" value="過 濾" onclick="doQuery();"/></td>
                </tr>
            </table>
           </html:form>
           
           <div class="splitDiv" id="dataDiv" name="dataDiv" align="center">
            <div class="tip" align="left"><img src="<%=skinImage%>/main/arrow.gif">業務日志列表</div>
            <table width="100%" border="0" name="dataTB" id="dataTB" >
               <tr height="25px">
              <td width="5%" id="chse" datatype="CNPY" ><a href="#" onclick="javascript:sel()">選擇</a></td>
              <td width="5%">序號</td>
              <td width="6%">用戶名</td>
              <td width="10%">姓名</td>
              <td width="12%">所屬機構</td>
              <td width="12%">操作時間</td>
              <td width="25%">業務描述</td>
              <td width="7%">操作結果</td>
              <td width="8%">IP地址</td>
             </tr>
             <logic:present name="busLogList">
               <logic:iterate id="itbusLogList" name="busLogList" scope="request" type="com.jiuqi.ccp.formbean.form.CcpMscMonitorExtForm" indexId="index">     
                   <tr height="25px">
                      <td align="center"><input type="checkbox" name="cbMetadata" value='<bean:write name="itbusLogList" property="cmmGuid" />' class="checkbox"/></td>
                    <td align="center" cmmGuid='<bean:write name="itbusLogList" property="cmmGuid" />'><%=(pageCtrl.getPageNum()-1)*pageCtrl.getPageSize()+ index.intValue() + 1%></td>
                  <td align="center"><bean:write name="itbusLogList" property="userName" /></td>
                  <td align="center"><a href="#" onclick="msgbox('<%=mainWeb%>/BusLogAction.do?method=getUserInfo&orgGuid=<%=orgGuid%>&userGuid=<bean:write name="itbusLogList" property="userGuid" />&userTitle=<bean:write name="itbusLogList" property="userTitle" />','用戶信息與日志記錄',700,500);"><bean:write name="itbusLogList" property="userTitle" /></a></td>
                  <td align="center"><bean:write name="itbusLogList" property="orgTitle" /></td>
                  <td align="center"><bean:write name="itbusLogList" property="opTime" /></td>
                  <td align="center"><bean:write name="itbusLogList" property="businessDesc" /></td>
                  <td align="center">
                   <logic:equal name="itbusLogList" property="opResult" value="03" >
                  <a href="#" onclick="msgbox('<%=mainWeb%>/BusLogAction.do?method=viewException&cmmGuid=<bean:write name="itbusLogList" property="cmmGuid" />','查看異常信息',500,380);">
                  <font style="font-size: 13px;" color="red"><bean:write name="itbusLogList" property="opResultValue" /></font></a>
                 </logic:equal>
                 <logic:equal name="itbusLogList" property="opResult" value="02" >
                  <font style="font-size: 13px" color="orange">
                  <bean:write name="itbusLogList" property="opResultValue" />
                  </font>
                 </logic:equal>
                 <logic:equal name="itbusLogList" property="opResult" value="01" >
                  <font style="font-size: 13px" color="green">
                  <bean:write name="itbusLogList" property="opResultValue" />
                  </font>
                 </logic:equal>
                  </td>
                  <td align="center"><bean:write name="itbusLogList" property="loginIp" /></td>
                     </tr>
                  </logic:iterate>
                </logic:present>
             </table>
            </div>
            <!--引入分頁控件開始-->
            <%@ include file="/common/pagectrl.jsp" %>
            
            <!--引入分頁控件結束-->
          </body>
          </html>
          <script> 
          var tcApply = new table(dataTB);
          applyTB(tcApply, dataDiv);
          var cmmGuid = "";
          var orgGuid = '<%=orgGuid%>';

          if ('<%=opResult%>' != null && '<%=opResult%>' != '' && '<%=opResult%>' != 'null') {
           document.all.opResult.value = '<%=opResult%>';
          }else  {
           document.all.opResult.value = '00';
          }

          if ('<%=beginTime%>' != null && '<%=beginTime%>' != '' && '<%=beginTime%>' != 'null') {
           document.all.beginTime.value = '<%=beginTime%>';
          }else {
           document.all.beginTime.value = "";
          }

          if ('<%=endTime%>' != null && '<%=endTime%>' != '' && '<%=endTime%>' != 'null') {
           document.all.endTime.value = '<%=endTime%>';
          }else {
           document.all.endTime.value = "";
          }

          if ('<%=inputUserTitle%>' != 'null' ) {
           document.all.inputUserTitle.value = '<%=inputUserTitle%>';
          }else {
           document.all.inputUserTitle.value = "";
          }

          function doSelectRow(rowObj){
           if(rowObj != null && rowObj != ""){
            cmmGuid = rowObj.cells[1].getAttribute('cmmGuid');
           }
          }

          //分頁
           function gotoPage(pagenum){
              var orgGuid = "";
           orgGuid = '<%=orgGuid%>';
           if (orgGuid != null && orgGuid != "" && orgGuid != 'null') {
            document.location.href="<%=mainWeb%>/BusLogAction.do?method=queryBusLog&pageNum="+pagenum+"&pageSize="+document.all.goPageSize.value+"&orgGuid="+orgGuid;
            }
           }

          //執行業務日志查詢
          function doQuery() {
           var orgGuid = "";
           orgGuid = '<%=orgGuid%>';
           if (orgGuid != null && orgGuid != "" && orgGuid != 'null') {
            ccpMscMonitorForm.submit();
           }
          }

          //選擇條件執行業務日志查詢
          function doQuerySelect(obj) {
           var orgGuid = "";
           orgGuid = '<%=orgGuid%>';
           if (orgGuid != null && orgGuid != "" && orgGuid != 'null') {
            ccpMscMonitorForm.submit();
           }
          }

          //刪除業務日志,組織參數,執行刪除操作
          function delmscmonitor() {
           if(typeof(document.all.cbMetadata)=="undefined"){
                alert("當前沒有記錄!");
                return;
              }
           window.setTimeout("countsel()",1000);
           window.setTimeout("doRemove()",1000);
          }

          var logGuidString = "";
          function countsel() {
              if(typeof(document.all.cbMetadata.length)!="undefined"){
               for(var i=0;i<document.all.cbMetadata.length;i++){
                 if(document.all.cbMetadata[i].checked) {
                    logGuidString += dataTB.rows[i+1].cells[1].getAttribute("cmmGuid") + "~";
                   }
               }
              }else{
            return;
              }
          }

          //執行刪除業務日志操作
          function doRemove(){
           if(cmmGuid==""||cmmGuid==undefined){
            popAlert("請選擇記錄!");
            return;
           }
           var removeConfirm = function (){
            sendRequest('<%=mainWeb%>/BusLogAction.do?method=removeBusLog&logGuidString='+logGuidString,"fDealDel()");
           }
           popConfirm("確定刪除業務日志?",removeConfirm);
          }
           
          //處理刪除回調
          function fDealDel(){
           if(http_request.responseText != ''){
            var temp = http_request.responseText.split('|');
            if(temp[0] == 'true')
            popAlert(temp[1]);
            document.location.href="<%=mainWeb%>/BusLogAction.do?method=queryBusLog&orgGuid=<%=orgGuid%>";
           }
          }


          //根據條件導出業務日志
          function doExport() {
           showDiv();
          }

          function showDiv() {
           var obj=document.createElement("div");
           obj.style.border="solid 1px;"
           obj.innerHTML = '<div id="select" align="right" style="margin-top:4px"><table width="20%" height="15%"  border="0" cellpadding="1" cellspacing="1"><tr><td width="10%" class="data_tb_td"><input type="radio" value="01" id="choice" name="choice" checked />當前所有查詢結果</td></tr><tr><td width="10%" class="data_tb_td"><input type="radio" value="02" id="choice" name="choice" />所有業務日志記錄</td></tr><tr><td width="10%" class="data_tb_td"><input type="button" class="button" name="btnExport" id="btnExport" value="導 出" onclick="daoChu();"/><input type="button" class="button" name="btnExportClose" id="btnExportClose" value="關 閉" onclick="closeWindow();"/></td></tr></table></div>';
           obj.style.position="absolute";
           obj.style.right="0px";
           obj.style.top="0px";

           document.all.opResult.style.display="none";
           document.body.appendChild(obj);

          }

          function daoChu(){
           var exportConfirm = function (){
            if(document.all.choice[0].checked) {
             sendRequest('<%=mainWeb%>/BusLogAction.do?method=exportBusLog&orgGuid='+document.all.orgGuid.value+'&beginTime='+document.all.beginTime.value+'&endTime='+document.all.endTime.value+'&inputUserTitle='+document.all.inputUserTitle.value+'&opResult='+document.all.opResult.value+"&select="+document.all.choice[0].value,"fDealExport()");
            }else if (document.all.choice[1].checked) {
             sendRequest('<%=mainWeb%>/BusLogAction.do?method=exportBusLog&orgGuid='+document.all.orgGuid.value+'&beginTime='+document.all.beginTime.value+'&endTime='+document.all.endTime.value+'&inputUserTitle='+document.all.inputUserTitle.value+'&opResult='+document.all.opResult.value+"&select="+document.all.choice[1].value,"fDealExport()");
            }
            closeWindow();
           }
           popConfirm("確定導出業務日志?",exportConfirm);
          }

          //刪除顯示的導出選擇框
          function closeWindow() {
           var obj=document.getElementById("select");
           obj.removeNode(true);
           document.all.opResult.style.display="";
          }

          //處理導出業務日志回調
          function fDealExport(){
           if(http_request.responseText != ''){
            var temp = http_request.responseText.split('|');
             if(temp[0] == 'true')
             popAlert(temp[1]);
           }
          }

          </script>

          posted @ 2008-03-04 18:27 海浪 閱讀(268) | 評論 (0)編輯 收藏

          僅列出標題  
          主站蜘蛛池模板: 乌恰县| 集安市| 延长县| 涡阳县| 石城县| 灯塔市| 龙州县| 洪泽县| 静宁县| 抚远县| 襄城县| 五家渠市| 昭通市| 深泽县| 济南市| 新津县| 渭南市| 大安市| 横峰县| 高唐县| 庆城县| 吉隆县| 若尔盖县| 宜良县| 长葛市| 顺昌县| 故城县| 中卫市| 吐鲁番市| 沂水县| 涞水县| 石渠县| 光泽县| 南郑县| 玉环县| 当雄县| 平陆县| 濉溪县| 拉萨市| 枣强县| 清流县|