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 海浪 阅读(145) | 评论 (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 海浪 阅读(256) | 评论 (0)编辑 收藏

仅列出标题