<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<meta name="viewport" charset="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
<title>表单字段配置</title>
|
<link rel="stylesheet" href="static/plugins/font-awesome/css/font-awesome.min.css">
|
<link rel="stylesheet" href="static/plugins/ueditor-formdesign/js/ueditor/formdesign/bootstrap/css/bootstrap.css">
|
<!--[if lte IE 6]>
|
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-ie6.css">
|
<![endif]-->
|
<!--[if lte IE 7]>
|
<link rel="stylesheet" type="text/css" href="bootstrap/css/ie.css">
|
<![endif]-->
|
<link rel="stylesheet" href="static/plugins/ueditor-formdesign/js/ueditor/formdesign/leipi.style.css">
|
<script type="text/javascript" src="static/plugins/ueditor-formdesign/js/ueditor/dialogs/internal.js"></script>
|
|
<link rel="stylesheet" href="static/plugins/jquery-steps/css/main.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/jquery-steps/css/jquery.steps.css" type="text/css">
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
|
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
|
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
|
<script src="static/plugins/ace/src-noconflict/ace.js" type="text/javascript"></script>
|
<!-- 弹窗加载组件 -->
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
<!-- wcp组件 -->
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
|
|
<script type="text/javascript">
|
|
function createElement(type, name) {
|
var element = null;
|
try {
|
element = document.createElement('<' + type + ' name="' + name + '">');
|
} catch (e) { }
|
if (element == null) {
|
element = document.createElement(type);
|
element.name = name;
|
}
|
return element;
|
}
|
</script>
|
|
|
</head>
|
|
<body>
|
<div class="content">
|
<table class="table table-bordered table-striped table-hover">
|
<tr>
|
<th>
|
<span>所属表名</span>
|
</th>
|
<th width="50%">
|
<span>字段名称</span>
|
<span class="label label-important">*</span>
|
</th>
|
</tr>
|
<tr>
|
<td>
|
<div class="input-group">
|
<input type="text" id="orgtablename" class="form-control" value="${formColumn.tableName}">
|
<span class="input-group-btn">
|
<button class="btn btn-default" onclick="selectTable()">选表</button>
|
</span>
|
</div>
|
</td>
|
<td>
|
<div class="input-group">
|
<input type="text" id="orgname" class="form-control" placeholder="必填项">
|
<span class="input-group-btn">
|
<button class="btn btn-default" id="selectField" onclick="selectColumn()">选字段</button>
|
</span>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<th><span>显示名称</span></th>
|
<th><span>宽 X 高 & 字体大小</span> </th>
|
</tr>
|
<tr>
|
<td><input id="orgdisplayname" type="text" class="form-control"/></td>
|
<td>
|
宽 <input id="orgwidth" type="text" value="99%" style="width:50px" class="input-small span1" placeholder="auto"/> px
|
|
高 <input id="orgheight" type="text" value="80" style="width:50px" class="input-small span1" placeholder="auto"/> px
|
<input id="orgfontsize" type="text" value="" style="width:50px" class="input-small span1" placeholder="auto"/> px</td>
|
</tr>
|
<tr>
|
<th><span>可见性 & 必填性 & 增强性 & 可编辑性</span> </th>
|
<th><span>验证</span> </th>
|
</tr>
|
<tr>
|
|
<td>
|
<label class="checkbox-inline">
|
<input id="orghide" type="checkbox" disabled/> 隐藏 </label>
|
<label class="checkbox-inline">
|
<input id="orgrequired" type="checkbox" /> 必填 </label>
|
<label class="checkbox-inline">
|
<input id="orgrich" type="checkbox" /> 富文本形式 </label>
|
<label class="checkbox-inline">
|
<input id="orgedit" type="checkbox" checked /> 编辑 </label>
|
</td>
|
<td>
|
<input id="orgzz" type="text" value="" class="form-control" placeholder="参看easyui的validType" />
|
</td>
|
</tr>
|
<tr>
|
<th colspan="2"><span>默认值</span> </th>
|
</tr>
|
<tr>
|
<td colspan="2">
|
|
<textarea rows="3" id="orgdefaultvalue" placeholder="多行文本框默认值..." class="form-control"></textarea>
|
<a style="margin-top:2px;" title="选默认值" class="btn btn-primary">选值</a>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<script type="text/javascript">
|
var oNode = null,thePlugins = 'textarea';
|
window.onload = function() {
|
if( UE.plugins[thePlugins].editdom ){
|
oNode = UE.plugins[thePlugins].editdom;
|
var gValue = oNode.getAttribute('value').replace(/"/g,"\""),gTitle=oNode.getAttribute('title').replace(/"/g,"\""),gName = oNode.getAttribute('name').replace(/"/g, "\""), gHidden = oNode.getAttribute('orghide'),gFontSize=oNode.getAttribute('orgfontsize'),gWidth=oNode.getAttribute('orgwidth'),gHeight=oNode.getAttribute('orgheight'),gRich=oNode.getAttribute('orgrich'),gZZ = oNode.getAttribute('orgzz'), gRequired = oNode.getAttribute('orgrequired'), gEdit = oNode.getAttribute('orgedit'),gTableName=oNode.getAttribute('orgtablename'),gDisplayName=oNode.getAttribute('placeholder');
|
|
gValue = gValue==null ? '' : gValue;
|
gTitle = gTitle==null ? '' : gTitle;
|
$G('orgdefaultvalue').value = gValue;
|
$G('orgname').value = gName;
|
$G('orgdisplayname').value=gDisplayName;
|
if ( gRich == '1' ) {
|
$G('orgrich').checked = true ;
|
}
|
|
if (gHidden == '1') {
|
$G('orghide').checked = true;
|
}
|
if (gRequired == "1") {
|
$G('orgrequired').checked = true;
|
}
|
if(gEdit=="1"){
|
$G('orgedit').checked = true;
|
}else{
|
$G('orgedit').checked=false;
|
}
|
|
|
$G('orgfontsize').value = gFontSize;
|
$G('orgwidth').value = gWidth;
|
$G('orgheight').value = gHeight;
|
$G('orgzz').value = gZZ;
|
$G('orgtablename').value=gTableName;
|
}
|
}
|
dialog.oncancel = function () {
|
if( UE.plugins[thePlugins].editdom ) {
|
delete UE.plugins[thePlugins].editdom;
|
}
|
};
|
dialog.onok = function (){
|
if($G('orgname').value==''){
|
wcp.notify.warn('请输入字段名称!');
|
return false;
|
}
|
var gValue=$G('orgdefaultvalue').value.replace(/\"/g,"""),gName=$G('orgname').value.replace(/\"/g,"""),gTitle=$G('orgdisplayname').value.replace(/\"/g,"""),gFontSize=$G('orgfontsize').value,gWidth=$G('orgwidth').value,gHeight=$G('orgheight').value,gEdit = $G('orgedit'), gRequired = $G("orgrequired"), gZZ = $G('orgzz').value,gTableName=$G('orgtablename').value,gHidden=$G("orghide"),gRich=$G("orgrich");
|
if( !oNode ) {
|
try {
|
|
var html = '<textarea ';
|
html += ' title = "' + gTitle + '"';
|
html += ' name = "'+gName+'"';
|
html += ' leipiPlugins = "'+thePlugins+'"';
|
html += ' value = "' + gValue + '"';
|
if (gRich.checked ) {
|
html += ' orgrich = "1"';
|
} else {
|
html += ' orgrich = "0"';
|
}
|
if (gRequired.checked ) {
|
html += ' orgrequired = "1"';
|
} else {
|
html += ' orgrequired = "0"';
|
}
|
if (gHidden.checked ) {
|
html += ' orghide = "1"';
|
} else {
|
html += ' orghide = "0"';
|
}
|
if (gEdit.checked) {
|
html += ' orgedit = "1"';
|
} else {
|
html += ' orgedit = "0"';
|
html+='disabled="disabled"';
|
}
|
if( gFontSize != '' ) {
|
html += ' orgfontsize = "' + gFontSize + '"';
|
} else {
|
html += ' orgfontsize = ""';
|
}
|
if( gWidth != '' ) {
|
html += ' orgwidth = "' + gWidth + '"';
|
} else {
|
html += ' orgwidth = ""';
|
}
|
if(gHeight != '') {
|
html += ' orgheight = "' + gHeight + '"';
|
} else {
|
html += ' orgheight = ""';
|
}
|
if(gTableName != '') {
|
html += ' orgtablename = "' + gTableName + '"';
|
} else {
|
html += ' orgtablename = ""';
|
}
|
if(gTitle != '') {
|
html += ' orgdisplayname = "' + gTitle + '"';
|
} else {
|
html += ' orgdisplayname = ""';
|
}
|
if(gTitle != '') {
|
html += ' placeholder = "' + gTitle + '"';
|
} else {
|
html += ' placeholder = ""';
|
}
|
if(gZZ!=''){
|
|
html += ' orgzz = "' + gZZ + '"';
|
} else {
|
html += ' orgzz = ""';
|
}
|
|
html += ' style = "';
|
if( gFontSize != '' ) {
|
html += 'font-size:' + gFontSize + 'px;';
|
}
|
if( gWidth != '' ) {
|
if(gWidth.indexOf('%')>-1)
|
{
|
html += 'width:' + gWidth + ';';
|
}else{
|
html += 'width:' + gWidth + 'px;';
|
}
|
}
|
if( gHeight != '' ) {
|
html += 'height:' + gHeight + 'px;';
|
}
|
html += '">';
|
html += gValue + '</textarea>';
|
editor.execCommand('insertHtml',html);
|
} catch (e) {
|
try {
|
editor.execCommand('error');
|
} catch ( e ) {
|
alert('控件异常,请联系管理员!');
|
}
|
return false;
|
}
|
} else {
|
oNode.setAttribute('title', gTitle);
|
oNode.setAttribute('value',gValue);
|
oNode.innerHTML = gValue;
|
if( gRich.checked ) {
|
oNode.setAttribute('orgrich', 1);
|
} else {
|
oNode.setAttribute('orgrich', 0);
|
}
|
if( gHidden.checked ) {
|
oNode.setAttribute('orghide', 1);
|
} else {
|
oNode.setAttribute('orghide', 0);
|
}
|
if( gEdit.checked ) {
|
oNode.setAttribute('orgedit', 1);
|
} else {
|
oNode.setAttribute('orgedit', 0);
|
oNode.setAttribute('disabled','disabled');
|
}
|
if( gRequired.checked ) {
|
oNode.setAttribute('orgrequired', 1);
|
} else {
|
oNode.setAttribute('orgrequired', 0);
|
}
|
if( gFontSize != '' ) {
|
oNode.style.fontSize = gFontSize+ 'px';
|
oNode.setAttribute('orgfontsize',gFontSize );
|
}else{
|
oNode.setAttribute('orgfontsize', '');
|
}
|
if (gWidth != '') {
|
if(gWidth.indexOf('%')>-1)
|
{
|
oNode.style.width = gWidth ;
|
}else{
|
oNode.style.width = gWidth + 'px';
|
}
|
oNode.setAttribute('orgwidth', gWidth);
|
} else {
|
oNode.style.width = '';
|
oNode.setAttribute('orgwidth', '');
|
}
|
if( gHeight != '' ) {
|
oNode.style.height = gHeight+ 'px';
|
oNode.setAttribute('orgheight',gHeight );
|
}else{
|
oNode.setAttribute('orgheight', '');
|
}
|
oNode.setAttribute('name',gName);
|
oNode.setAttribute('orgname',gName);
|
oNode.setAttribute('orgtablename',gTableName);
|
oNode.setAttribute('orgdisplayname',gTitle);
|
oNode.setAttribute('placeholder',gTitle);
|
oNode.setAttribute('orgdefaultvalue',gValue);
|
oNode.setAttribute('orgzz',gZZ);
|
|
delete UE.plugins[thePlugins].editdom;
|
}
|
};
|
//选择表
|
function selectTable() {
|
var multiSelect=false;
|
wcp.picker.selectTable({
|
title : "请选择表",
|
multiSelect : multiSelect,
|
layerOpener : window
|
},function(rows){
|
var selectedTables ="";
|
$.each(rows, function(index, value) {
|
selectedTables+=value.tableName+',';
|
});
|
selectedTables=selectedTables.substr(0,selectedTables.length-1);
|
$('#orgtablename').val(selectedTables);
|
});
|
}
|
//选择字段
|
function selectColumn() {
|
var tableNames=$('#orgtablename').val();
|
var multiSelect=false;
|
wcp.picker.selectTableColumn({
|
title : "请选择字段",
|
tableName :tableNames,
|
multiSelect : multiSelect,
|
layerOpener : window
|
},function(rows){
|
var selectedColumns ="";
|
var selectedDisplayName="";
|
$.each(rows, function(index, value) {
|
selectedColumns+=value.columnName+',';
|
selectedDisplayName+=value.displayName+',';
|
});
|
selectedColumns=selectedColumns.substr(0,selectedColumns.length-1);
|
selectedDisplayName=selectedDisplayName.substr(0,selectedDisplayName.length-1);
|
$('#orgname').val(selectedColumns);
|
$('#orgdisplayname').val(selectedDisplayName);
|
});
|
}
|
</script>
|
</body>
|
</html>
|