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.

193 lines
6.7 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<html>
<head>
<title>显示列设置</title>
<link href="../Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../../Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" />
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/config.js"></script>
<script src="../Gener.js?va2=2" type="text/javascript"></script>
<link href="../../../DataUser/Style/ccbpm.css" rel="Stylesheet" />
<script type="text/javascript">
//页面启动函数.
$(function () {
var ensName = GetQueryString("EnsName");
//全局配置.
var en = new Entity("BP.Sys.EnCfg");
en.No = ensName;
en.Retrieve();
//获得该实体的列.
//var handler = new HttpHandler("BP.WF.HttpHandler.WF_Comm");
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", ensName, "Idx");
if (mapAttrs.length == 0) {
var hander = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner");
hander.Clear();
hander.AddPara("IsFirst", 1);
hander.AddPara("FK_MapData", ensName);
hander.AddPara("FK_Flow", GetQueryString("FK_Flow"));
hander.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = hander.DoMethodReturnString("Designer_Init");
mapAttrs.Retrieve("FK_MapData", ensName, "Idx");
}
//alert("请启动傻瓜表单设计器");
for (var i = 0; i < mapAttrs.length; i++) {
var mapAttr = mapAttrs[i];
if (mapAttr.KeyOfEn == 'OID')
continue;
var mapAttrEn = new Entity("BP.Sys.MapAttr", mapAttr);
var html = "";
html += "<tr>";
html += "<td>" + i + "</td>";
html += "<td>" + mapAttr.KeyOfEn + "</td>";
html += "<td> <input class='form-control' value='" + mapAttr.Name + "' type=text style='width:80%;' id='TB_" + mapAttr.KeyOfEn + "' /></td>";
html += "<td> <input class='form-control' value='" + mapAttr.UIWidth + "' type=text style='width:66px;' id='TBW_" + mapAttr.KeyOfEn + "' /></td>";
if (mapAttrEn.GetPara("SearchVisable") == "1")
html += "<td><a class='btn btn-default btn-sm' href=\"javascript:HiddenIt('" + mapAttr.MyPK + "')\">隐藏</a></td>";
else
html += "<td><a class='btn btn-default btn-sm' style='margin-left:25%' href=\"javascript:ShowIt('" + mapAttr.MyPK + "')\">显示</a></td>";
html += "<td><a class='btn btn-default btn-sm' href=\"javascript:Up('" + mapAttr.MyPK + "')\">上移</a> &nbsp&nbsp <a class='btn btn-default btn-sm' href=\"javascript:Down('" + mapAttr.MyPK + "')\">下移</a></td>";
html += "</tr>";
$("#Table1 tr:last").after(html);
}
});
function HiddenIt(mypk, i) {
var mapAttrEn = new Entity("BP.Sys.MapAttr", mypk);
mapAttrEn.SetPara("SearchVisable", 0);
mapAttrEn.Update();
Reload();
}
function ShowIt(mypk) {
var mapAttrEn = new Entity("BP.Sys.MapAttr", mypk);
mapAttrEn.SetPara("SearchVisable", 1);
mapAttrEn.Update();
Reload();
}
function Up(mypk) {
var mapAttrEn = new Entity("BP.Sys.MapAttr", mypk);
mapAttrEn.DoMethodReturnString("DoUpTabIdx");
Reload();
}
function Down(mypk) {
var mapAttrEn = new Entity("BP.Sys.MapAttr", mypk);
mapAttrEn.DoMethodReturnString("DoDownTabIdx");
Reload();
}
function SaveCols() {
var ensName = GetQueryString("EnsName");
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", ensName, "Idx");
for (var i = 0; i < mapAttrs.length; i++) {
var mapAttr = mapAttrs[i];
if (mapAttr.KeyOfEn == 'OID') {
continue;
}
var mapAttrEn = new Entity("BP.Sys.MapAttr", mapAttr);
mapAttrEn.MyPK = mapAttr.MyPK;
mapAttrEn.Name = $("#TB_" + mapAttrEn.KeyOfEn).val();
mapAttrEn.UIWidth = $("#TBW_" + mapAttrEn.KeyOfEn).val();
mapAttrEn.Update();
}
Reload();
}
function Back() {
var url = "SearchSetting.htm?EnsName=" + GetQueryString("EnsName");
SetHref(url);
}
function Clear() {
if (confirm('您确定要重置吗?重置后傻瓜表单设计内容,与排序内容都将会被清除,系统将会使用bp实体类的属性展示.') == false)
return;
var mapdata = new Entity("BP.Sys.MapData", GetQueryString("EnsName"));
mapdata.Delete();
var mapAttrs = new Entities("BP.Sys.MapAttrs", "FK_MapData", GetQueryString("EnsName"));
for (var i = 0; i < mapAttrs.length; i++) {
mapAttrs[i].Delete();
}
//重置排序顺序
Reload();
}
function FoolDesinger() {
var url = "../../Admin/FoolFormDesigner/Designer.htm?FK_MapData=" + GetQueryString("EnsName") + "&FK_Flow=&FK_Node=0&IsFirst=1";
window.open(url);
}
</script>
<style type="text/css">
caption {
text-align: left;
font-family: 'Microsoft YaHei';
font-weight: bolder;
border-bottom: none;
margin-bottom: 10px;
}
</style>
</head>
<body>
<table class="table table-bordered table-striped table-hover table-condensed" id="Table1" style="width: 96%;">
<tr>
<th colspan="5"> 设置显示的列(说明:标题、时间、日期类型的字段长度固定:标题 230px;时间类型 145px;日期类型125px; </th>
<th colspan="1">
<button id="Btn_Save" onclick="SaveCols()"> 保存</button>
<button id="Btn_Clear" onclick="Clear()"> 清空设置</button>
</th>
</tr>
<tr>
<th> 序号 </th>
<th>
字段
</th>
<th>
中文名
</th>
<th>
宽度
</th>
<th>
设置显示/隐藏
</th>
<th>顺序 </th>
</tr>
</table>
</body>
</html>