<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
|
<head>
|
<title>流水号</title>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<link rel="stylesheet" href="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="leipi.style.css">
|
<script type="text/javascript" src="../dialogs/internal.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">
|
<span class="input-group-btn">
|
<button class="btn btn-default">选表</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">选字段</button>
|
</span>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<th>
|
<span>显示名称</span>
|
</th>
|
<th>
|
<span>获取类型</span>
|
</th>
|
</tr>
|
<tr>
|
<td>
|
<input type="text" id="orgdisplayname" class="form-control" value="流水号新增保存后自动生成">
|
</td>
|
<td>
|
<select id="orgtype" class="form-control">
|
<option value="0" selected>新增保存后自动生成</option>
|
<option value="1">手动生成</option>
|
</select>
|
|
</td>
|
</tr>
|
|
|
<tr>
|
|
<th>
|
<span>可见性 & 必填性 & 可编辑性 </span>
|
</th>
|
<th>
|
编号配置
|
</th>
|
</tr>
|
<tr>
|
|
<td>
|
|
<label class="checkbox-inline">
|
<input id="orghide" type="checkbox" /> 隐藏 </label>
|
<label class="checkbox-inline">
|
<input id="orgrequired" type="checkbox" /> 必填 </label>
|
<label class="checkbox-inline">
|
<input id="orgedit" type="checkbox" /> 编辑 </label>
|
|
</td>
|
<td>
|
<select id="orgnumber" class="form-control">
|
<option value="0">--请选择编号--</option>
|
<option value="1">测试编号一</option>
|
<option value="2">测试编号二</option>
|
</select>
|
</td>
|
</tr>
|
<tr>
|
|
|
</tr>
|
|
|
</table>
|
</div>
|
<script type="text/javascript">
|
var oNode = null, thePlugins = 'serial';
|
window.onload = function () {
|
if (UE.plugins[thePlugins].editdom) {
|
oNode = UE.plugins[thePlugins].editdom;
|
|
var gName = oNode.getAttribute('name').replace(/"/g, "\""), gHidden = oNode.getAttribute('orghide'), gType = oNode.getAttribute('orgtype'), gRequired = oNode.getAttribute('orgrequired'), gEdit = oNode.getAttribute('orgedit'), gTableName = oNode.getAttribute('orgtablename'), gDisplayName = oNode.getAttribute('placeholder'),gNumber=oNode.getAttribute("orgnumber");
|
|
gName = gName == null ? '' : gName;
|
gDisplayName = gDisplayName == null ? '' : gDisplayName;
|
|
$G('orgname').value = gName;
|
$G('orgdisplayname').value = gDisplayName;
|
|
if (gHidden == '1') {
|
$G('orghide').checked = true;
|
}
|
|
|
$G('orgtype').value = gType;
|
$G('orgnumber').value = gNumber;
|
$G('orgtablename').value = gTableName;
|
|
if (gRequired == "1") {
|
$G('orgrequired').checked = true;
|
}
|
if (gEdit == "1") {
|
$G('orgedit').checked = true;
|
}
|
|
|
}
|
|
//选字段
|
$G('selectField').onclick = function () {
|
openSelectField();
|
}
|
}
|
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, """), gType = $G('orgtype').value, gEdit = $G('orgedit'), gRequired = $G("orgrequired"), gTableName = $G('orgtablename').value, gDisplayName = $G("orgdisplayname").value, gHidden = $G("orghide"),gNumber=$G("orgnumber").value;
|
if (!oNode) {
|
try {
|
oNode = createElement('input', gName);
|
oNode.setAttribute('type', 'text');
|
oNode.setAttribute('title', gDisplayName);
|
oNode.setAttribute('name', gName);
|
oNode.setAttribute('id', gName);
|
oNode.setAttribute('placeholder', gDisplayName);
|
oNode.setAttribute('leipiPlugins', thePlugins);
|
if (!gEdit.checked) {
|
oNode.setAttribute('disabled', 'disabled');
|
}
|
|
if (gTableName) {
|
oNode.setAttribute('orgtablename', gTableName);
|
}
|
if (gName) {
|
oNode.setAttribute('orgname', gName);
|
}
|
if (gDisplayName) {
|
oNode.setAttribute('orgdisplayname', gDisplayName);
|
}
|
|
if (gType != '') {
|
oNode.setAttribute('orgtype', gType);
|
|
}
|
if (gNumber != '') {
|
oNode.setAttribute('orgnumber', gNumber);
|
}
|
|
if (gEdit.checked) {
|
oNode.setAttribute('orgedit', "1");
|
} else {
|
oNode.setAttribute('orgedit', "0");
|
}
|
if (gRequired.checked) {
|
oNode.setAttribute('orgrequired', "1");
|
} else {
|
oNode.setAttribute('orgrequired', "0");
|
}
|
if (gHidden.checked) {
|
oNode.setAttribute('orghide', "1");
|
} else {
|
oNode.setAttribute('orghide', "0");
|
}
|
|
|
//oNode.setAttribute('style',style );
|
//oNode.style.cssText=style;//ie7
|
editor.execCommand('insertHtml', oNode.outerHTML);
|
} catch (e) {
|
try {
|
editor.execCommand('error');
|
} catch (e) {
|
alert('控件异常,请联系管理员!');
|
}
|
return false;
|
}
|
} else {
|
|
//oNode.setAttribute('title', gTitle);
|
oNode.setAttribute('title', gDisplayName);
|
|
oNode.setAttribute('name', gName);
|
oNode.setAttribute('id', gName);
|
|
oNode.setAttribute('placeholder', gDisplayName);
|
|
if (gTableName) {
|
oNode.setAttribute('orgtablename', gTableName);
|
} else {
|
oNode.setAttribute('orgtablename', "");
|
}
|
if (gName) {
|
oNode.setAttribute('orgname', gName);
|
} else {
|
oNode.setAttribute('orgname', "");
|
}
|
if (gDisplayName) {
|
oNode.setAttribute('orgdisplayname', gDisplayName);
|
} else {
|
oNode.setAttribute('orgdisplayname', "");
|
}
|
|
|
if (!gEdit.checked) {
|
oNode.setAttribute('disabled', "disabled");
|
}
|
|
if (gHidden.checked) {
|
oNode.setAttribute('orghide', "1");
|
} else {
|
oNode.setAttribute('orghide', "0");
|
}
|
|
if (gType != '') {
|
oNode.setAttribute('orgtype', gType);
|
var className = getDateClass(gType);
|
oNode.setAttribute('class', className);
|
} else {
|
oNode.setAttribute('orgtype', '');
|
}
|
|
if(gNumber!=''){
|
oNode.setAttribute('orgnumber', gNumber);
|
}
|
|
if (gEdit.checked) {
|
oNode.setAttribute('orgedit', "1");
|
} else {
|
oNode.setAttribute('orgedit', "0");
|
}
|
|
|
delete UE.plugins[thePlugins].editdom;
|
}
|
};
|
|
|
function openSelectField() {
|
top.layer.open({
|
title: "选择表字段",
|
type: 2,
|
area: ['1000px', '600px'],
|
fixed: false, //不固定
|
content: '/select/selectField.html'
|
});
|
|
}
|
</script>
|
</body>
|
|
</html>
|