⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 archive_query_conditionvalue_modify.jsp

📁 oa 源码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import = "java.net.URLEncoder"%>
<%@ page import = "java.util.*"%>
<%@ page import = "cn.js.fan.util.*"%>
<%@ page import = "cn.js.fan.web.*"%>
<%@ page import = "com.redmoon.oa.archive.*"%>
<%@ page import = "com.redmoon.oa.BasicDataMgr"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户档案查询</title>
<link href="../common.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
function selDate(name,condition){ 
   if(name.all.item(condition).value == "1"){
      name.all.item("SEGMENT_DATE_TD").style.display = "none";
      name.all.item("POINT_DATE_TD").style.display = "";	
	  name.all.item("VAGUE_SEGMENT_YEAR_TD").style.display = "none";
	  name.all.item("VAGUE_POINT_YEAR_TD").style.display = "none";  
   }else{
      if(name.all.item(condition).value == "2"){
		  name.all.item("SEGMENT_DATE_TD").style.display = "none";
		  name.all.item("POINT_DATE_TD").style.display = "none";	
		  name.all.item("VAGUE_SEGMENT_YEAR_TD").style.display = "";
		  name.all.item("VAGUE_POINT_YEAR_TD").style.display = "none";
	  }else{
		  if(name.all.item(condition).value == "3"){
			  name.all.item("SEGMENT_DATE_TD").style.display = "none";
			  name.all.item("POINT_DATE_TD").style.display = "none";	
			  name.all.item("VAGUE_SEGMENT_YEAR_TD").style.display = "none";
			  name.all.item("VAGUE_POINT_YEAR_TD").style.display = "";
		  }else{
			  name.all.item("SEGMENT_DATE_TD").style.display = "";
			  name.all.item("POINT_DATE_TD").style.display = "none";	
			  name.all.item("VAGUE_SEGMENT_YEAR_TD").style.display = "none";
			  name.all.item("VAGUE_POINT_YEAR_TD").style.display = "none";
		  }
	  }
   }
}

function addORConditionSel(btnObj,name){ 
    var text = "&nbsp;或者&nbsp;<select name='" + name + "'>" + maintable.all.item(name + "_OPTION").value + "</select>";
	btnObj.insertAdjacentHTML("BeforeBegin", text);
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

var GetDate=""; 
function SelectDate(ObjName,FormatDate){
	var PostAtt = new Array;
	PostAtt[0]= FormatDate;
	PostAtt[1]= findObj(ObjName);
	GetDate = showModalDialog("../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
}

function SetDate()
{ 
	findObj(ObjName).value = GetDate; 
}
</script>
</head>

<body>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
<%
	if (!privilege.isUserPrivValid(request, "archive.query")) {
		out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "pvg_invalid")));
		return;
	}
%>
<br>
<form name="form1" method="post" action="archive_query_do.jsp?op=modifyConditionFieldCode">
  <table width="95%" border="0">
    <tr>
      <td>
<%
    int queryId = ParamUtil.getInt(request, "id");

    String[] conditionFieldCodeArr = ParamUtil.getParameters(request,"fieldCode");
	String tableFullCodeStr = ParamUtil.get(request,"tableFullCodeStr");
	
	BasicDataMgr bdm = new BasicDataMgr("archive");
    String options = "", inputValue = "";
	String conditionFieldCodeStr="", sql="", fieldCode="", tableShortCode="", tableFieldCode="", conditionSign="";   
%>
      <table class="tableframe" cellSpacing="1" cellPadding="2" width="95%" align="center" border="0" bgcolor="#FFFFFF" id="maintable">
        <tbody>
          <tr>
            <td colspan="3" class="right-title">综合查询</td>
          </tr>
<%   
    //获得条件字段
	int i = 0 ;
	while(i < conditionFieldCodeArr.length){
	    conditionFieldCodeStr += conditionFieldCodeArr[i];
		if(i < conditionFieldCodeArr.length - 1){
		   conditionFieldCodeStr += ",";
		}
		i++;
	}
	
	int j = 0;
	TableFieldInfoDb tfid = new TableFieldInfoDb(); 
	String[] fieldCodeArr = null;
	
	ArchiveQueryConditionDb aqcd = new ArchiveQueryConditionDb();
	
	while(j < conditionFieldCodeArr.length){
	   fieldCodeArr = conditionFieldCodeArr[j].split("\\."); 
	   tableShortCode = fieldCodeArr[0];
	   fieldCode = fieldCodeArr[1];
	    
	   sql = ArchiveSQLBuilder.getArchiveTableField(tableShortCode,fieldCode);	      
	   Vector vt = tfid.list(sql);
	   Iterator ir = null;
	   ir = vt.iterator();
	   if (ir!=null && ir.hasNext()) {
		   tfid = (TableFieldInfoDb)ir.next();	
		   
		   sql = "select id from ARCHIVE_QUERY_CONDITION where query_id=" + queryId + " and condition_field_code=" + StrUtil.sqlstr(conditionFieldCodeArr[j]) + " order by id";
		    	   
           //处理文本字段
           if(Integer.parseInt(tfid.getFieldType()) == tfid.INPUT){
		   		boolean likeOrEquals = true;
				
			    Vector vt1 = aqcd.list(sql);
				if(vt1.size() > 0){
					Iterator ir1 = vt1.iterator();
					if(ir1!=null && ir1.hasNext()){
						aqcd = (ArchiveQueryConditionDb)ir1.next();
						conditionSign = aqcd.getConditionSign();
						if(conditionSign.equals("="))
							likeOrEquals = true;
						else
							likeOrEquals = false;
					}
				}
				if(!aqcd.getInputValue().equals("null"))
					inputValue = aqcd.getInputValue();
				else
					inputValue = "";
%>
          <tr>
            <td width="16%" noWrap><%=tfid.getFieldName()%>:</td>         
			<td width="84%" noWrap>
              <table width="100%">
			    <tr>
				  <td>
					<select name="<%=tableShortCode%>_<%=fieldCode%>_SIGN">
					  <option value="=" <%if(likeOrEquals){%>selected<%}%>>等于</option>
					  <option value="like" <%if(!likeOrEquals){%>selected<%}%>>包含</option>
					</select>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="<%=tableShortCode%>_<%=fieldCode%>" size="20" value="<%=inputValue%>"/>
				  </td>
				 </tr>
			   </table>
			 </td>
          </tr>
<%		   
		   }else{
		   
		   //处理列表字段
		   if(Integer.parseInt(tfid.getFieldType()) == tfid.SELECTED){
			   Vector vt1 = aqcd.list(sql);
			   options = bdm.getOptionsStr(fieldCode);
%>
          <tr>
            <td width="16%" noWrap><%=tfid.getFieldName()%>:</td>         
			<td width="84%" noWrap>
              <table width="100%">
			   <tr>
			    <td>
				<input type="hidden" value="<%=options%>" name="<%=tableShortCode%>_<%=fieldCode%>_OPTION">
				<%
				if(vt1.size() > 0){
					Iterator ir1 = vt1.iterator();
					int indexs = 0, len = vt1.size();
					while(ir1.hasNext()){
						aqcd = (ArchiveQueryConditionDb)ir1.next();
				%>
				  <select name="<%=tableShortCode%>_<%=fieldCode%>">
					 <%=options%>
				  </select>
				<%
						if(indexs < len - 1)
							out.print("&nbsp;或者&nbsp;");
						indexs++;
					}
					ir1 = vt1.iterator();
					indexs = 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -