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

📄 treedialog.jsp

📁 OBPM是一个开源
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"    pageEncoding="ISO-8859-1"%><%@ taglib prefix="ww" uri="webwork"%>
<%
	String contextPath = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title><%=request.getParameter("title")%></title><script src="<ww:url value='/script/check.js'/>"></script>
<script src="<ww:url value='/script/util.js'/>"></script>
<script src='<ww:url value="/dwr/engine.js"/>'></script>
<script src='<ww:url value="/dwr/util.js"/>'></script>
<script src='<ww:url value="/dwr/interface/ConfigUtil.js"/>'></script>
<script src='<ww:url value="/dwr/interface/DWRHtmlUtil.js"/>'></script>
<script src='<ww:url value="/dwr/interface/FormulaTreeHelper.js"/>'></script>
<script>
	var contextPath = '<%= request.getContextPath()%>';
	var valuetype = '<%= request.getParameter("valuetype") %>';
	var value = '<%= request.getParameter("value") %>';
	var moduleid = '<ww:property value="#parameters.s_module" />';
	
	function doReturn() {
		var elements = document.forms[0].elements;
		var rtn;
		for(var i=0; i<elements.length; i++) {
			if (elements[i].type != 'button' 
					&& elements[i].name != 'form'
					&& elements[i].value != null 
					&& elements[i].value != '') {
				var obj = new Object();
				
				if (elements[i].name == 'express' 
						&& valuetype == 'VALUE_TYPE_PROPERTY') { 
					obj.text = "\'" + elements[i].value + "\'" +' ';	
				} else {
					obj.text = elements[i].value + ' ';
				}
				
				
				obj.valuetype = document.all('valuetype').value;
				rtn = obj;
				//rtn += elements[i].value + ' ';
				//alert(rtn);
			}
		}
		window.returnValue = rtn;
		window.close();
	}

	function ev_onload() {
		var express = document.all('express');
		if(valuetype != 'null' && valuetype !='' && express != null) {
			ev_createClew(valuetype);
		}
	}
	
	function ev_init(fn1, fn2) {
		if (document.all(fn1) != null && document.all(fn2) != null) {
			var instance = '<%= session.getAttribute("APPLICATION")%>';
			var def0 = moduleid;
			var def1 = document.all(fn1).value;
			var def2 = document.all(fn2).value;
			
			var func = new Function("ev_init('"+fn1+"','"+fn2+"')");
			document.all(fn1).onchange = func;
			document.all(fn2).onchange = func;
			
			FormulaTreeHelper.createForm(fn1,def0,def1,instance,function(str) {var func=eval(str);func.call()});
			FormulaTreeHelper.createFiled(fn2,def1,def2,function(str) {var func=eval(str);func.call()});
			FormulaTreeHelper.getFieldtype(def2, def1, ev_setValuetype);
		}
	}

	function ev_setValuetype(type) {
		//alert("settype->" + type);
		document.all('valuetype').value = type;
	}

	function ev_createClew(type) {
		//alert(type);
		if (type != null && type != '') {
			//alert(type);
			var html = '<font color="red">Notice:please ';
			document.all('datebt').style.display = "none";
			if (type == 'VALUE_TYPE_VARCHAR') {
				html += ' input character string';
			} else if (type == 'VALUE_TYPE_NUMBER') {
				html += ' input number'; 
			} else if (type == 'VALUE_TYPE_DATE') {
				html += ' select date'
				document.all('datebt').style.display = "";
			} else if (type == 'VALUE_TYPE_PROPERTY') {
				html += ' select ' + value;
				document.all('selbt').style.display = "";
				//alert('****value->' + value);
			}
			
			html += ' </font>';
			
			clewDiv.innerHTML = html;
			curtype = type;
		}
	}

	function selectField() {
		  wx = '600px';
		  wy = '500px';
		  var url = contextPath + "/core/dynaform/document/select.action";
		 
		  url = addParam(url, 's_module', moduleid);
		  url = addParam(url, 'fieldname', value);
		  var rtn = showframe("{*[Select ]*}Form", url);
		  
		  if (rtn == null || rtn == 'undefined') {
		  }
		  else if (rtn == '') {
			document.all('express').value = '';
		  }
		  else {
			  	document.all('express').value = rtn;
			}
	}
</script>
</head><body onload="ev_onload()"><ww:form name="treeForm" method="post">	
	<ww:bean id="fth" name="cn.myapps.core.formula.FormulaTreeHelper" />
	<button class="button-image" onClick="doReturn();">
	<img src="<ww:url value="/resource/image/save.gif"/>">{*[Save]*}
	</button>
	
	<ww:hidden name="valuetype" />
	
	<ww:if test="#parameters.fieldName[0] == 'create'">
		<ww:select label="Operator" name="operator" list="#fth.ALL_SYMBOL"/>
		<!--  
		-->
	</ww:if>

	<ww:if test="#parameters.fieldName[0] == 'relation'">
		<ww:select label="Relation" name="relation" list="#fth.RELATION_SYMBOL" />
	</ww:if>
	
	<ww:if test="#parameters.fieldName[0] == 'operator'">
		<ww:select label="Operator" name="operator" list="#fth.OPERATOR_SYMBOL" />
	</ww:if>

	<ww:if test="#parameters.fieldName[0] == 'compare'">
		<ww:select label="Compare" name="compare" list="#fth.COMPARE_SYMBOL" />
	</ww:if>
	
	<ww:if test="#parameters.fieldName[0] == 'fieldname'">
		<ww:select label="Form" name="form" list="{}" />
		<ww:select label="FieldName" name="fieldname" list="{}" />
	</ww:if>

	<ww:if test="#parameters.fieldName[0] == 'express'">
		<tr><td colspan="2">
		<div id='clewDiv'></div></td></tr>
		<tr>
		<td class="tdLabel"><label class="label">Express:</label></td>
		<td><ww:textfield name="express" theme="simple"/></td>
		<td><button name="datebt" style="display:none" class="button-image" onClick="treeForm.elements['express'].value = selectDate(treeForm.elements['express'].value);">
			<img src="<ww:url value="/resource/image/search.gif"/>"></button>
			<input name="selbt" style="display:none" class="button-cmd" onclick="selectField()" type="button" value="{*[Select]*}" />
		</td></tr>
	</ww:if>
</ww:form>	
</body><script>
ev_init('form', 'fieldname');
</script>
</html>

⌨️ 快捷键说明

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