<%@ 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;
|
}
|
|
|
//checkboxs
|
function isIE() {
|
if (window.attachEvent) {
|
return true;
|
}
|
return false;
|
}
|
|
//moveRow在IE支持而在火狐里不支持!以下是扩展火狐下的moveRow
|
if (!isIE()) {
|
function getTRNode(nowTR, sibling) {
|
while (nowTR = nowTR[sibling]) if (nowTR.tagName == 'TR') break;
|
return nowTR;
|
}
|
|
if (typeof Element != 'undefined') {
|
Element.prototype.moveRow = function (sourceRowIndex, targetRowIndex) //执行扩展操作
|
{
|
if (!/^(table|tbody|tfoot|thead)$/i.test(this.tagName) || sourceRowIndex === targetRowIndex) return false;
|
var pNode = this;
|
if (this.tagName == 'TABLE') pNode = this.getElementsByTagName('tbody')[0]; //firefox会自动加上tbody标签,所以需要取tbody,直接table.insertBefore会error
|
var sourceRow = pNode.rows[sourceRowIndex],
|
targetRow = pNode.rows[targetRowIndex];
|
if (sourceRow == null || targetRow == null) return false;
|
var targetRowNextRow = sourceRowIndex > targetRowIndex ? false : getTRNode(targetRow, 'nextSibling');
|
if (targetRowNextRow === false) pNode.insertBefore(sourceRow, targetRow); //后面行移动到前面,直接insertBefore即可
|
else { //移动到当前行的后面位置,则需要判断要移动到的行的后面是否还有行,有则insertBefore,否则appendChild
|
if (targetRowNextRow == null) pNode.appendChild(sourceRow);
|
else pNode.insertBefore(sourceRow, targetRowNextRow);
|
}
|
}
|
}
|
}
|
|
/*删除tr*/
|
function fnDeleteRow(obj) {
|
var oTable = document.getElementById("options_table");
|
while (obj.tagName != 'TR') {
|
obj = obj.parentNode;
|
}
|
oTable.deleteRow(obj.rowIndex);
|
}
|
|
|
/*生成tr*/
|
function fnAddComboTr(tf, ttf, sf, num) {
|
var oTable = document.getElementById('options_table');
|
var new_tr_node = oTable.insertRow(oTable.rows.length);
|
var new_td_node0 = new_tr_node.insertCell(0), new_td_node1 = new_tr_node.insertCell(1),
|
new_td_node2 = new_tr_node.insertCell(2);
|
|
new_td_node0.innerHTML = '<td><div class="input-group"><input type="text" id="targetipt_' + num + '" placeholder="目标模块字段" value="' + tf + '" class="form-control"><input type="text" id="targettitleipt_' + num + '" placeholder="目标模块字段中文名" value="' + ttf + '" style="display:none" class="form-control"><span class="input-group-btn"><button class="btn btn-default" onclick="selectColumn(\'targetipt_' + num + '\',\'targettitleipt_' + num + '\');">选</button></span></div></td>';
|
new_td_node1.innerHTML = '<td><div class="input-group"><input type="text" id="localipt_' + num + '" placeholder="本模块字段" value="' + sf + '" class="form-control"><span class="input-group-btn"><button class="btn btn-default" onclick="selectColumn(\'localipt_' + num + '\');">选</button></span></div></td>';
|
new_td_node2.innerHTML = '<td><div class="btn-group"><a title="删除" class="btn btn-small btn-danger" href="javascript:void(0);" onclick="fnDeleteRow(this)"><i class="fa fa-close"></i></a></div></td>';
|
return true;
|
}
|
|
function fnAdd() {
|
var dName = $G('orgname').value;
|
if (!dName) {
|
alert("请先选择字段!");
|
return false;
|
}
|
num++;
|
fnAddComboTr("", "", "", num);
|
}
|
|
/*组合checkbox*/
|
function fnParseOptions() {
|
var oTable = document.getElementById('options_table');
|
var nTr = oTable.getElementsByTagName('tr'), trLength = nTr.length, targetFields = "",
|
targetFieldTitles = "", sourceFields = "";
|
|
if (trLength > 0) {
|
for (var i = 0; i < trLength; i++) {
|
var inputs = nTr[i].getElementsByTagName('input');
|
if (inputs.length > 0) {
|
if (!inputs[0].value || !inputs[1].value) continue;
|
targetFields += inputs[0].value + ",";
|
targetFieldTitles += inputs[1].value + ",";
|
sourceFields += inputs[2].value + ",";
|
}
|
}
|
|
targetFields = targetFields.slice(0, -1);
|
targetFieldTitles = targetFieldTitles.slice(0, -1);
|
sourceFields = sourceFields.slice(0, -1);
|
}
|
|
|
return {"targetFields": targetFields, "targetFieldTitles": targetFieldTitles, "sourceFields": sourceFields};
|
|
}
|
</script>
|
</head>
|
|
<body>
|
<div class="content">
|
<table class="table table-bordered table-striped">
|
<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('orgtablename')">选表</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('orgname')">选字段</button>
|
</span>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<th>
|
<span>宽 X  高 字体大小 & 样式名</span>
|
</th>
|
<th>
|
<span>必填性 & 可编辑性</span>
|
</th>
|
</tr>
|
<tr>
|
<td>
|
<input id="orgwidth" type="text" value="98%" style="width:50px" class="input-small span1"
|
placeholder="auto"/> X
|
<input id="orgheight" type="text" value="" class="input-small span1" style="width:50px"
|
placeholder="auto"/> &
|
<input id="orgfontsize" type="text" value="" class="input-small span1" style="width:50px"
|
placeholder="auto"/> px &
|
<input id="orgcss" type="text" value="" style="width:80px;" style="width:50px" placeholder="无则不填"/>
|
|
</td>
|
<td>
|
|
<label class="checkbox-inline">
|
<input id="orgrequired" type="checkbox"/> 必填 </label>
|
<label class="checkbox-inline">
|
<input id="orgedit" type="checkbox" checked/> 编辑 </label>
|
<label class="checkbox-inline">
|
<input id="orgauto" type="checkbox"/> 自动 </label>
|
<label class="checkbox-inline">
|
<input id="orgmulti" type="checkbox"/> 多选 </label>
|
</td>
|
</tr>
|
<tr>
|
<th colspan="3">
|
<span>显示名称</span>
|
</th>
|
|
</tr>
|
<tr>
|
<td colspan="3">
|
<input id="orgdisplayname" type="text" class="form-control"/>
|
</td>
|
</tr>
|
<tr>
|
<th>
|
<span>目标模块</span>
|
|
</th>
|
<th>
|
<span>目标表</span>
|
</th>
|
</tr>
|
<tr>
|
<td>
|
<div class="input-group">
|
<input type="hidden" type="text" id="orgtargetmoduleid" name="orgtargetmoduleid">
|
<input id="orgtargetmodulename" name="orgtargetmodulename" class="form-control">
|
<span class="input-group-btn">
|
<button class="btn btn-default" id="selectTargetModule"
|
onclick="selectTargetModule()">选模块</button>
|
</span>
|
</div>
|
</td>
|
<td>
|
<div class="input-group">
|
<input type="hidden" type="text" id="orgtargettableid" name="orgtargettableid">
|
<input id="orgtargettablename" id="orgtargettablename" name="orgtargettablename"
|
class="form-control">
|
<span class="input-group-btn">
|
<button class="btn btn-default" id="selectTargetTable"
|
onclick="selectTable('orgtargettablename')">选表</button>
|
</span>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<th><span>内容来源</span></th>
|
<th><span>返回函数名</span></th>
|
</tr>
|
<tr>
|
<td>
|
<label class="radio-inline">
|
<input id="orgdatasource0" checked="checked" name="orgdatasource" value="0" type="radio"
|
onclick="dataSourceChange();"> 默认
|
</label>
|
<label class="radio-inline">
|
<input id="orgdatasource1" name="orgdatasource" value="1" type="radio"
|
onclick="dataSourceChange();"> 视图 </label>
|
|
</td>
|
<td>
|
<input type="text" id="orgfunname" class="form-control">
|
</td>
|
</tr>
|
<tr id="tr_default_1">
|
<th>
|
<span>本模块关联字段</span>
|
|
</th>
|
<th>
|
<span>目标模块关联字段</span>
|
</th>
|
</tr>
|
<tr id="tr_default_2">
|
<td>
|
<div class="input-group">
|
<input type="text" id="orgsourcerelfield" class="form-control">
|
<span class="input-group-btn">
|
<button class="btn btn-default" id="selectSourceRelField"
|
onclick="selectColumn('orgsourcerelfield')">选字段</button>
|
</span>
|
</div>
|
</td>
|
<td>
|
<div class="input-group">
|
<input type="text" id="orgtargetrelfield" class="form-control">
|
<span class="input-group-btn">
|
<button class="btn btn-default" id="selectTargetRelField"
|
onclick="selectColumn('orgtargetrelfield')">选字段</button>
|
</span>
|
</div>
|
</td>
|
</tr>
|
<tr id="tr_default_3">
|
<th colspan="2"><span>过滤条件</span></th>
|
</tr>
|
<tr id="tr_default_4">
|
<td colspan="2"><textarea rows="2" id="orgsql" class="form-control"></textarea></td>
|
</tr>
|
<tr id="tr_view_1">
|
<th colspan="2"><span>目标模块视图列表</span></th>
|
</tr>
|
<tr id="tr_view_2">
|
<td colspan="2">
|
<select id="orgview" class="form-control">
|
</select>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<table class="table table-hover table-condensed" id="options_table">
|
<tr>
|
<th>将目标模块字段</th>
|
<th>读取到本模块字段中</th>
|
<th>操作</th>
|
</tr>
|
</table>
|
<a title="添加字段" class="btn btn-primary" onclick="fnAdd();">添加字段</a>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<script type="text/javascript">
|
var oNode = null, thePlugins = 'resource';
|
var num = 0;
|
var gView = "";
|
window.onload = function () {
|
if (UE.plugins[thePlugins].editdom) {
|
oNode = UE.plugins[thePlugins].editdom;
|
var gTitle = oNode.getAttribute('title').replace(/"/g, "\"");
|
var gName = oNode.getAttribute('name').replace(/"/g, "\"");
|
var gFontSize = oNode.getAttribute('orgfontsize');
|
var gWidth = oNode.getAttribute('orgwidth');
|
var gHeight = oNode.getAttribute('orgheight');
|
var gTableName = oNode.getAttribute('orgtablename');
|
var gDataSource = oNode.getAttribute('orgdatasource');
|
var gTargetModuleId = oNode.getAttribute('orgtargetmoduleid');
|
var gTargetModuleName = oNode.getAttribute('orgtargetmodulename');
|
var gTargetTableName = oNode.getAttribute('orgtargettablename');
|
var gTargetTableId = oNode.getAttribute('orgtargettableid');
|
var gTargetFields = oNode.getAttribute('orgtargetfields'); //目标模块字段
|
var gTargetFieldTitles = oNode.getAttribute('orgtargetfieldtitles'); //目标模块字段中文名
|
var gSourceFields = oNode.getAttribute('orgsourcefields');//本模块字段
|
var gEdit = oNode.getAttribute('orgedit');
|
var gRequired = oNode.getAttribute('orgrequired');
|
var gAuto = oNode.getAttribute('orgauto');
|
var gMulti = oNode.getAttribute('orgmulti');
|
var gSourceRelField = oNode.getAttribute('orgsourcerelfield');
|
var gTargetRelField = oNode.getAttribute('orgtargetrelfield');
|
var gSql = oNode.getAttribute('orgsql');
|
gView = oNode.getAttribute('orgview');
|
var gFunName = oNode.getAttribute('orgfunname');
|
|
$G('orgdisplayname').value = gTitle;
|
$G('orgname').value = gName;
|
$G('orgtablename').value = gTableName;
|
|
gRequired == "1" ? $G('orgrequired').checked = true : $G('orgrequired').checked = false;
|
gDataSource == '0' ? $G('orgdatasource0').checked = true : $G('orgdatasource1').checked = true;
|
gAuto == "1" ? $G('orgauto').checked = true : $G('orgauto').checked = false;
|
gMulti == "1" ? $G('orgmulti').checked = true : $G('orgmulti').checked = false;
|
$G('orgtargetmoduleid').value = gTargetModuleId;
|
$G('orgtargetmodulename').value = gTargetModuleName;
|
$G('orgtargetmoduleid').value = gTargetModuleId;
|
$G('orgtargettablename').value = gTargetTableName;
|
$G('orgtargettableid').value = gTargetTableId;
|
$G('orgsql').value = gSql;
|
$G('orgview').value = gView;
|
$G('orgfunname').value = gFunName;
|
$G('orgsourcerelfield').value = gSourceRelField;
|
$G('orgtargetrelfield').value = gTargetRelField;
|
$G('orgfontsize').value = gFontSize;
|
$G('orgwidth').value = gWidth;
|
$G('orgheight').value = gHeight;
|
gEdit == "1" ? $G('orgedit').checked = true : $G('orgedit').checked = false;
|
|
var arrTargetFields = gTargetFields.split(',');
|
var arrTargetFieldTitles = gTargetFieldTitles.split(',');
|
var arrSourceFields = gSourceFields.split(',');
|
var length = arrTargetFields.length;
|
num = length;
|
for (var i = 0; i < length; i++) {
|
num++;
|
fnAddComboTr(arrTargetFields[i], arrTargetFieldTitles[i], arrSourceFields[i], num);
|
}
|
|
|
}
|
//初始化数据源
|
dataSourceChange();
|
|
}
|
dialog.oncancel = function () {
|
if (UE.plugins[thePlugins].editdom) {
|
delete UE.plugins[thePlugins].editdom;
|
}
|
};
|
dialog.onok = function () {
|
if ($G('orgname').value == '') {
|
alert('字段名称不能为空!');
|
return false;
|
}
|
var gName = $G('orgname').value.replace(/\"/g, """);
|
var gTitle = $G('orgdisplayname').value.replace(/\"/g, """);
|
|
|
var gTableName = $G('orgtablename').value;
|
var gDataSource = "0";
|
if ($G("orgdatasource1").checked) {
|
gDataSource = "1";
|
}
|
var gSql = $G('orgsql').value;
|
var gTargetModuleId = $G('orgtargetmoduleid').value;
|
var gTargetModuleName = $G('orgtargetmodulename').value;
|
var gTargetTableName = $G('orgtargettablename').value;
|
var gTargetModuleId = $G('orgtargetmoduleid').value;
|
var gTargetTableId = $G('orgtargettableid').value;
|
var gView = $G('orgview').value;
|
var gSourceRelField = $G('orgsourcerelfield').value;
|
var gFunName = $G('orgfunname').value;
|
var gTargetRelField = $G('orgtargetrelfield').value;
|
var gFontSize = $G('orgfontsize').value;
|
var gWidth = $G('orgwidth').value;
|
var gHeight = $G('orgheight').value;
|
var gPlaceholder = $G('orgdisplayname').value;
|
var gEdit = "1";
|
if (!$G("orgedit").checked) {
|
gEdit = "0";
|
}
|
var gRequired = "0";
|
if ($G("orgrequired").checked) {
|
gRequired = "1";
|
}
|
var gAuto = "0";
|
if ($G("orgauto").checked) {
|
gAuto = "1";
|
}
|
var gMulti = '0';
|
if ($G('orgmulti').checked) gMulti = '1';
|
|
var gTargetFields = "";
|
var gTargetFieldTitles = "";
|
var gSourceFields = "";
|
//if(gDataSource=="0"){
|
var fields = fnParseOptions();
|
gTargetFields = fields.targetFields;
|
gTargetFieldTitles = fields.targetFieldTitles;
|
gSourceFields = fields.sourceFields;
|
//}
|
|
if (!oNode) {
|
try {
|
//var gTimestamp = new Date().getTime();//相同的gTimestamp为同一组checkbox
|
//var options = fnParseOptions(gTitle, gChecked, gTimestamp);
|
|
//if (gTargetFields == ""||gSourceFields=="") {
|
//if (!options) {
|
//alert('目标或本模块字段不能为空!');
|
//return false;
|
//}
|
//}
|
var gWidthVal = gWidth;
|
if (gWidth != '') {
|
if (gWidth.indexOf('%') == -1) {
|
gWidthVal = gWidth + 'px';
|
}
|
}
|
var html = '<input leipiplugins="resource" type="" title="' + gTitle + '" name="' + gName + '" orgtablename="' + gTableName + '" orgdatasource="' + gDataSource + '" orgtargetmoduleid="' + gTargetModuleId + '" orgtargetmodulename="' + gTargetModuleName
|
+ '" orgtargettableid="' + gTargetTableId + '" orgtargettablename="' + gTargetTableName + '" orgtargetfields="' + gTargetFields + '" orgtargetfieldtitles="' + gTargetFieldTitles + '" orgsourcefields="' + gSourceFields + '" orgsql="' + gSql + '" orgauto="' + gAuto + '" orgmulti="' + gMulti + '" orgfunname="' + gFunName
|
+ '" orgsourcerelfield="' + gSourceRelField + '" orgtargetrelfield="' + gTargetRelField + '" orgedit="' + gEdit + '" orgfontsize="' + gFontSize + '" orgwidth="' + gWidth + '" orgrequired="' + gRequired + '" orgheight="' + gHeight + '" orgView="' + gView
|
+ '" placeholder="' + gPlaceholder + '" style="width:' + gWidthVal + ';fontSize:' + gFontSize + 'px" />';
|
// html += '<button onclick="selectResource();">选</button>';
|
|
editor.execCommand('insertHtml', html);
|
return true;
|
} catch (e) {
|
try {
|
editor.execCommand('error');
|
} catch (e) {
|
alert('控件异常,请联系管理员!');
|
}
|
return false;
|
}
|
} else {
|
if (gFontSize != '') {
|
oNode.style.fontSize = gFontSize + 'px';
|
oNode.setAttribute('orgfontsize', gFontSize);
|
} else {
|
oNode.style.fontSize = '';
|
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.style.height = '';
|
oNode.setAttribute('orgheight', '');
|
}
|
oNode.setAttribute('title', gTitle);
|
oNode.setAttribute('name', gName);
|
oNode.setAttribute('orgtablename', gTableName);
|
oNode.setAttribute('orgname', gName);
|
oNode.setAttribute('orgmulti', gMulti);
|
oNode.setAttribute('orgtargetmoduleid', gTargetModuleId);
|
oNode.setAttribute('orgtargetmodulename', gTargetModuleName);
|
oNode.setAttribute('orgtargettablename', gTargetTableName);
|
oNode.setAttribute('orgtargettableid', gTargetTableId);
|
oNode.setAttribute('orgdatasource', gDataSource);
|
oNode.setAttribute('placeholder', gPlaceholder);
|
oNode.setAttribute('orgsql', gSql);
|
oNode.setAttribute('orgfunname', gFunName);
|
oNode.setAttribute('orgedit', gEdit);
|
oNode.setAttribute('orgrequired', gRequired);
|
oNode.setAttribute('orgauto', gAuto);
|
oNode.setAttribute('orgsourcerelfield', gSourceRelField);
|
oNode.setAttribute('orgtargetrelfield', gTargetRelField);
|
oNode.setAttribute('orgsourcefields', gSourceFields);
|
oNode.setAttribute('orgtargetfields', gTargetFields);
|
oNode.setAttribute('orgtargetfieldtitles', gTargetFieldTitles);
|
oNode.setAttribute('orgview', gView);
|
delete UE.plugins[thePlugins].editdom;
|
return true;
|
}
|
};
|
|
|
function dataSourceChange() {
|
var sourceradio = document.getElementsByName("orgdatasource");
|
var tr_default_1 = document.getElementById("tr_default_1");
|
var tr_default_2 = document.getElementById("tr_default_2");
|
var tr_default_3 = document.getElementById("tr_default_3");
|
var tr_default_4 = document.getElementById("tr_default_4");
|
var tr_view_1 = document.getElementById("tr_view_1");
|
var tr_view_2 = document.getElementById("tr_view_2");
|
|
for (var i = 0; i < sourceradio.length; i++) {
|
if (sourceradio[i].checked) {
|
switch (i) {
|
case 0:
|
tr_default_1.style.display = "";
|
tr_default_2.style.display = "";
|
tr_default_3.style.display = "";
|
tr_default_4.style.display = "";
|
tr_view_1.style.display = "none";
|
tr_view_2.style.display = "none";
|
break;
|
case 1:
|
loadTargetModuleView();
|
tr_default_1.style.display = "none";
|
tr_default_2.style.display = "none";
|
//tr_default_3.style.display = "none";
|
//tr_default_4.style.display = "none";
|
tr_view_1.style.display = "";
|
tr_view_2.style.display = "";
|
break;
|
|
}
|
|
return false;
|
}
|
}
|
|
}
|
|
//目标模块字段
|
function selectTargetField(obj) {
|
obj.value = "Tfield100";
|
}
|
|
//本模块字段
|
function selectSourceField(obj) {
|
obj.value = "Sfield100";
|
}
|
|
//选择表
|
function selectTable(inputId) {
|
var multiSelect = false;
|
var orgtargetmoduleid = $("#orgtargetmoduleid").val();
|
wcp.picker.selectTable({
|
title: "请选择表",
|
multiSelect: multiSelect,
|
nameElement: inputId,
|
idElement: "orgtargettableid",
|
moduleId: orgtargetmoduleid,
|
layerOpener: window
|
});
|
}
|
|
//选择字段
|
function selectColumn(inputId, inputtitleId) {
|
var tableNames = '';
|
if (inputId == 'orgname' || inputId == 'orgsourcerelfield' || inputId.indexOf('localipt_') > -1) {
|
tableNames = $('#orgtablename').val();
|
} else if (inputId == 'orgtargetrelfield' || inputId.indexOf('targetipt_') > -1) {
|
tableNames = $('#orgtargettablename').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);
|
$('#' + inputId).val(selectedColumns);
|
if (inputId == 'orgname') {
|
$('#orgdisplayname').val(selectedDisplayName);
|
} else if (inputId.indexOf('targetipt_') > -1) {
|
$('#' + inputtitleId).val(selectedDisplayName);
|
}
|
});
|
}
|
|
//选模块
|
function selectTargetModule() {
|
wcp.picker.selectModule({
|
title: "请选择模块",
|
multiSelect: true,
|
nameElement: "orgtargetmodulename",
|
idElement: "orgtargetmoduleid",
|
layerOpener: window
|
});
|
}
|
|
//绑定目标模块视图
|
function loadTargetModuleView() {
|
var orgtargetmoduleid = $("#orgtargetmoduleid").val();
|
$.ajax({
|
type: 'POST',
|
contentType: "application/json; charset=utf-8",
|
url: "config/view/getViewListByModuleId?moduleId=" + orgtargetmoduleid,
|
dataType: 'json',
|
success: function (datas) {
|
var option = "<option value=\"0\">==请选择目标视图==</option> ";
|
for (var num = 0; num < datas.length; num++) {
|
var selected = "";
|
if (gView == datas[num].viewId) {
|
selected = "selected";
|
}
|
option += "<option value=\"" + datas[num].viewId + "\" " + selected + ">" + datas[num].viewName + "</option>";
|
//若为最后一项
|
if (num == datas.length - 1) {
|
selected = "";
|
if (gView == -1) {
|
selected = "selected";
|
}
|
option += "<option value=\"-1\" " + selected + ">根据视图标识匹配</option>";
|
}
|
}
|
$('#orgview').html(option);
|
}
|
});
|
}
|
</script>
|
</body>
|
|
</html>
|