You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
219 lines
8.4 KiB
Plaintext
219 lines
8.4 KiB
Plaintext
11 months ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<title>云服务枚举值列表</title>
|
||
|
|
||
|
<link href="../../../WF/Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
||
|
<link href="../../../WF/Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
|
||
|
<script src="../../../WF/Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
|
||
|
<script src="../../../WF/Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
|
||
|
<script src="../../../WF/Scripts/QueryString.js" type="text/javascript"></script>
|
||
|
<link href="../../../WF/Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
|
||
|
<link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
|
||
|
<script language="JavaScript" type="text/javascript" src="../../../WF/Comm/JScript.js"></script>
|
||
|
<script src="../../../WF/Scripts/EasyUIUtility.js" type="text/javascript"></script>
|
||
|
<script language="JavaScript" type="text/javascript" src="MapDef.js"></script>
|
||
|
<script language="JavaScript" type="text/javascript" src="../../../WF/Style/Verify.js"></script>
|
||
|
<script language="JavaScript" type="text/javascript" src="../../../WF/Comm/JS/Calendar/WdatePicker.js" defer="defer"></script>
|
||
|
<base target="_self" />
|
||
|
|
||
|
<!-- 引用通用的js文件. -->
|
||
|
<script type="text/javascript" src="../../../WF/Scripts/config.js"></script>
|
||
|
<script type="text/javascript" src="../../../WF/Comm/Gener.js"></script>
|
||
|
<script language="javascript" type="text/javascript" >
|
||
|
|
||
|
closeWhileEscUp();
|
||
|
|
||
|
//页面启动函数.
|
||
|
$(function () {
|
||
|
|
||
|
$("#Msg").html("<img src=../../Img/loading.gif /> 正在加载,请稍后......");
|
||
|
|
||
|
InitPage();
|
||
|
|
||
|
$("#Msg").html("");
|
||
|
});
|
||
|
|
||
|
//初始化数据.
|
||
|
function InitPage() {
|
||
|
|
||
|
var fk_mapData = GetQueryString("FK_MapData");
|
||
|
|
||
|
var sysEnumMains = new Entities("BP.Cloud.Sys.SysEnumMains");
|
||
|
sysEnumMains.RetrieveAll();
|
||
|
|
||
|
var fields =null; // = data["Fields"];
|
||
|
var numEnum = 0;
|
||
|
|
||
|
//增加处理.
|
||
|
for (var i = 0; i < sysEnumMains.length; i++) {
|
||
|
|
||
|
var sysEnumMain = sysEnumMains[i];
|
||
|
|
||
|
//如果需要字段从集合里选择,排除没有的字段.
|
||
|
if (fields != null) {
|
||
|
|
||
|
var isHave = false; //是否存在.
|
||
|
for (var idx = 0; idx < fields.length; idx++) {
|
||
|
|
||
|
var field = fields[idx];
|
||
|
|
||
|
if (field.FType.indexOf('int') == -1) {
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
if (field.FName != sysEnumMain.No) {
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
isHave = true;
|
||
|
break;
|
||
|
}
|
||
|
if (isHave == false)
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
numEnum++;
|
||
|
|
||
|
var newRow = "";
|
||
|
newRow += "<tr>";
|
||
|
newRow += "<td class=Idx>" + i + "</td>";
|
||
|
var enumKey = sysEnumMain.EnumKey;
|
||
|
enumKey = enumKey == null || enumKey == undefined || enumKey == "" ? sysEnumMain.No : enumKey;
|
||
|
if (fk_mapData != null)
|
||
|
newRow += "<td><a href=\"javascript:AddFrm('" + sysEnumMain.EnumKey + "','" + fk_mapData + "','" + sysEnumMain.No + "');\" >" + enumKey + "</a></td>";
|
||
|
else
|
||
|
newRow += "<td>" + enumKey+ "</td>";
|
||
|
|
||
|
newRow += "<td>" + sysEnumMain.Name + "</td>";
|
||
|
if (sysEnumMain.OrgNo == null || sysEnumMain.OrgNo == "")
|
||
|
newRow += "<td>--</td>";
|
||
|
else
|
||
|
newRow += "<td>" + sysEnumMain.OrgNo + "</td>";
|
||
|
|
||
|
if (sysEnumMain.OrgNo == null || sysEnumMain.OrgNo == "") {
|
||
|
newRow += "<td>" + sysEnumMain.CfgVal + "</td>";
|
||
|
newRow += "<td>--</td>";
|
||
|
|
||
|
} else {
|
||
|
newRow += "<td><a href=\"javascript:Edit('" + sysEnumMain.No + "','" + sysEnumMain.Name + "','" + sysEnumMain.CfgVal + "','" + sysEnumMain.EnumKey + "')\" >" + sysEnumMain.CfgVal + "</a></td>";
|
||
|
newRow += "<td><a href=\"javascript:Del('" + sysEnumMain.No + "','" + sysEnumMain.Name + "','" + sysEnumMain.EnumKey + "','" + sysEnumMain.OrgNo + "');\" ><img src='../../../WF/Img/Btn/Delete.gif' alt='删除' ></a></td>";
|
||
|
|
||
|
}
|
||
|
|
||
|
newRow += "</tr>";
|
||
|
|
||
|
$("#Table1 tr:last").after(newRow);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
function AddFrm(enumKey, fk_mapdata,enumMainNo) {
|
||
|
|
||
|
var url = '';
|
||
|
var str = prompt("请输入字段名(必须为字母开头、数字或者下划线组合):", enumKey);
|
||
|
|
||
|
if (str == null)
|
||
|
return;
|
||
|
|
||
|
var groupField = GetQueryString("GroupField");
|
||
|
if (groupField == null)
|
||
|
groupField = "0";
|
||
|
|
||
|
var handler = new HttpHandler("BP.Cloud.HttpHandler.Admin_CCFormDesigner");
|
||
|
handler.AddPara("KeyOfEn", str);
|
||
|
handler.AddPara("FK_MapData", fk_mapdata);
|
||
|
handler.AddPara("GroupFeid", groupField);
|
||
|
handler.AddPara("EnumKey", enumKey);
|
||
|
handler.AddPara("EnumMainNo", enumMainNo);
|
||
|
|
||
|
var data = handler.DoMethodReturnString("SysEnumList_SaveEnumField");
|
||
|
if (data.indexOf("err@") >= 0) {
|
||
|
alert(data);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
url = "../../../WF/Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrEnum&PKVal=" + data;
|
||
|
SetHref(url);
|
||
|
}
|
||
|
|
||
|
function NewEnum() {
|
||
|
|
||
|
var url = 'Edit.htm?s=' + Math.random();
|
||
|
OpenEasyUiDialog(url, "eudlgframe", "新建枚举", 600, 400, "icon-edit", true, null, null, null, function () {
|
||
|
Reload();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function Edit(no,name,cfgKeys,enumKey ) {
|
||
|
|
||
|
var url = 'Edit.htm?No=' + no + '&EnumKey=' + enumKey + '&Name=' + name + '&CfgKeys=' + cfgKeys + '&DoType=FrmEnumeration_SaveEnum&s=' + Math.random();
|
||
|
|
||
|
OpenEasyUiDialog(url, "eudlgframe", "修改枚举值", 600, 400, "icon-edit", true, null, null, null, function () {
|
||
|
Reload();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function Del(pk, name,enumKey,OrgNo) {
|
||
|
|
||
|
if (pk == null || pk == "") {
|
||
|
alert('您没有选择行.');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var v = window.confirm("您确定要删除枚举值[" + name + " " + pk + "]吗?");
|
||
|
if (v == false)
|
||
|
return;
|
||
|
|
||
|
//检查该枚举值是否被其他表单字段引用.
|
||
|
var sql = "SELECT A.FK_MapData,A.KeyOfEn,A.Name From Sys_MapAttr A,Sys_MapData B Where A.FK_MapData=B.No AND A.UIBindKey='" + enumKey + "' AND B.OrgNo='" + OrgNo + "'";
|
||
|
//var mapAttrs = new Entities("BP.Sys.MapAttrs");
|
||
|
//mapAttrs.Retrieve("UIBindKey", enumKey);
|
||
|
var mapAttrs = DBAccess.RunSQLReturnTable(sql);
|
||
|
var info = '';
|
||
|
for (var i = 0; i < mapAttrs.length; i++) {
|
||
|
var attr = mapAttrs[i];
|
||
|
info += "\t\n" + i + ",表单编号:" + attr.FK_MapData + " , 字段:" + attr.KeyOfEn + ", 名称:" + attr.Name;
|
||
|
}
|
||
|
|
||
|
if (info != '') {
|
||
|
|
||
|
info = "如下表单引用了该字段您不能删除:" + info;
|
||
|
alert(info);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
//执行删除.
|
||
|
var enumMain = new Entity("BP.Cloud.Sys.SysEnumMain", pk);
|
||
|
enumMain.Delete();
|
||
|
var webUser = new WebUser();
|
||
|
|
||
|
Reload();
|
||
|
|
||
|
}
|
||
|
|
||
|
function Ref(key) {
|
||
|
alert('查看该枚举值,被那些表单字段引用功能尚未完成.');
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
</head>
|
||
|
<body onkeypress="Esc()" >
|
||
|
|
||
|
<table id="Table1" style=" width:100%;">
|
||
|
<caption>枚举值列表 <a href="javascript:NewEnum()">新建枚举</a> </caption>
|
||
|
<tr>
|
||
|
<th>序</th>
|
||
|
<th width="5%">枚举值</th>
|
||
|
<th width="5%">名称</th>
|
||
|
<th width="5%">组织</th>
|
||
|
<th>枚举信息</th>
|
||
|
<th>操作</th>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<div id="Msg"></div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|