📄 content.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<%@include file="/common/taglibs.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="ww" uri="webwork"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>{*[View Info]*}</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
<link rel="stylesheet"
href="<c:out value='${pageContext.request.contextPath}'/>/resource/css/main.css"
type="text/css">
<script src="<ww:url value='/script/list.js'/>"></script>
<script src='<ww:url value="/dwr/interface/FormHelper.js"/>'></script>
<ww:bean name="cn.myapps.core.style.repository.action.StyleRepositoryHelper" id="sh">
<ww:param name="moduleid" value="#parameters.s_module" />
</ww:bean>
<ww:bean name="cn.myapps.core.dynaform.view.action.ViewHelper" id="vh">
<ww:param name="moduleid" value="#parameters.s_module" />
</ww:bean>
<ww:bean name="cn.myapps.core.dynaform.form.action.FormHelper" id="fh">
<ww:param name="moduleid" value="#parameters.s_module" />
</ww:bean>
<script language="JavaScript" type="text/javascript">
var contextPath = '<%= request.getContextPath()%>';
function ev_preview(){
var viewid = document.forms[0].elements['content.id'].value;
if (viewid == "") {
alert("{*[Pls save]*}");
}
else {
var url = '<ww:url action="displayView" />'
+ '?_viewid=' + viewid;
//alert(url);
window.open(url);
}
}
function ev_isPagination(item) {
//alert(item);
if (item.checked && item.value == 'true') {
pl_tr.style.display="";
} else {
pl_tr.style.display="none";
document.all('content.pagelines').value="";
}
}
function ev_showTreeDialog() {
var url = contextPath + '/core/formula/tree.jsp';
var moduleid = '<ww:property value="#parameters.s_module" />';
var filterScript = document.all('content.filterScript').value;
//var include = "#include \"doclib\"; \n";
if (moduleid != null && moduleid != '') {
url = url + '?s_module=' + moduleid;
}
if (filterScript != null && filterScript.trim != '') {
filterScript = ev_filtrate(filterScript);
url = addParam(url, 'content', filterScript);
}
//alert("url->" + url);
var rtn = showframe('tree', url);
if (rtn != undefined && rtn != '' && rtn != null) {
//alert("rtn->" + rtn);
document.all('content.filterScript').value = "\""+ rtn + "\"";
}
}
function ev_filtrate(content) { //过滤掉#和"号;
//var newcontent = content.substring(include.length + 1, content.length);
var oldcontent
do {
oldcontent = content;
content = content.replace("#","%23");
content = content.replace("\"","");
//content = content.replace(" "," ")
}
while(oldcontent != content);
return content;
}
function adjust_clientdivheight() {
var clientHeight = document.body.clientHeight-45;
document.all.clientdiv.style.height = clientHeight+"px";
}
function modeChange(mode) { //Design和Code模式互换
for(var i=0;i<2;i++) {
var content = document.all('content' + i);
content.style.display = 'none';
}
switch (mode) {
case '00':
content0.style.display = '';
break;
case '01':
content1.style.display = '';
break;
default:
content0.style.display = '';
break;
}
}
function typeChange(type,index) { //Search Form,System Var,Text,Number,Date的改变
var ifd = $('ipField' + index);
var sfd = $('sfField' + index);
ifd.style.display = 'none';
sfd.style.display = 'none';
switch (type) {
case '00':
ifd.style.display = '';
break;
case '01':
ifd.style.display = '';
break;
case '02':
ifd.style.display = '';
break;
case '03':
sfd.style.display = '';
break;
case '04':
ifd.style.display = '';
break;
default:
break;
}
}
var rowIndex = 0;
var getField = function(data) {
var s ='';
s +='<select id="field'+ rowIndex +'" name="field" style="width:200">';
s +='<option value="'+data.field+'" selected></option>';
s +='</select>';
return s;
};
var getOperator = function(data) {
var operators = ['LIKE','=','<>','>','>=','<','<=','IN','NOT IN'];
var s ='';
s +='<select id="operator'+ rowIndex +'" name="operator" style="width:100">';
for (var i=0; i < operators.length; i++) {
if (data.operator.toUpperCase() == operators[i]) {
s+='<option value="'+operators[i]+'" selected>'+operators[i]+'</option>';
} else {
s+='<option value="'+operators[i]+'">'+operators[i]+'</option>';
}
}
s +='</select>';
return s;
};
var getMatch = function(data) {
var typeCodes = ['00','01','02','03','04'];
var typeNames = ['Text','Number','Date','Search Form','System Var'];
var s ='';
s +='<select name="type" onchange="typeChange(this.value,'+ rowIndex +')">';
for (var i=0; i < typeCodes.length; i++) {
if (data.type.toUpperCase() == typeCodes[i]) {
s+='<option value="'+typeCodes[i]+'" selected>'+typeNames[i]+'</option>';
} else {
s+='<option value="'+typeCodes[i]+'">'+typeNames[i]+'</option>';
}
}
s +='</select>';
s +='<input type="text" id="ipField'+ rowIndex +'" name="ipField" value="'+HTMLDencode(data.match)+'" size="27"/>';
s +='<select id="sfField'+ rowIndex +'" name="sfField" style="width:200">';
s +='<option value='+HTMLDencode(data.match)+'></option>';
s +='</select>';
return s;
};
var getDelete = function(data) {
var s = '<input type="button" value="{*[Delete]*}" onclick="delRow(tb, this.parentNode.parentNode)"/>';
rowIndex ++;
return s;
};
// 根据数据增加行
function addRows(datas) {
var cellFuncs = [getField, getOperator, getMatch, getDelete];
var rowdatas = datas;
if (!datas || datas.length == 0) {
var data = {field:'', operator:'', type:'',match:''};
rowdatas = [data];
}
DWRUtil.addRows("tb", rowdatas, cellFuncs);
var fl = document.all('formlist'); //normal form下拉联动
fl.onchange();
var sf = document.all('_searchformid'); //search form下拉联动
sf.onchange();
var types = document.getElementsByName("type");
for (var i=0; i < types.length; i++) {
types[i].onchange();
}
}
// 删除一行
function delRow(id, row) {
var elem = $(id);
if (elem) {
elem.deleteRow(row.rowIndex);
//rowIndex --;
}
}
// 增加element options
function addOptions(elemName, options) {
var elems = document.getElementsByName(elemName);
for (var i=0; i<elems.length; i++) {
var defVal = elems[i].value;
DWRUtil.removeAllOptions(elems[i].id);
DWRUtil.addOptions(elems[i].id, options);
DWRUtil.setValue(elems[i].id, defVal);
}
}
function ev_init() {
adjust_clientdivheight();
var elements = document.getElementsByName("_isPagination");
for (var i=0; i<elements.length; i++) {
if (elements[i].checked) ev_isPagination(elements[i]);
}
var fl = document.all('formlist');//normal form下拉联动
fl.onchange = function(){
FormHelper.getFilterScriptFields(fl.value, function(options) {
addOptions("field", options);
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -