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.

312 lines
13 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.

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>组件权限</title>
<link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script src="../../Scripts/config.js" type="text/javascript"></script>
<script src="../../Comm/Gener.js" type="text/javascript"></script>
<!-- 自己的系统风格统一. -->
<link href="../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
<link href="../../Style/skin/css/Default.css" rel="stylesheet" />
<link href="../../Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<base target="_self" />
<style type="text/css">
th, td {
text-align: center;
}
</style>
<script type="text/javascript">
var frmID;
var fk_flow;
var fk_Node;
$(function () {
alert("取消了,请使用字段权限,控制.");
return;
var frmID = GetQueryString("FK_MapData");
var nodeID = GetQueryString("FK_Node");
var flowNo = GetQueryString("FK_Flow");
//获得字段集合.
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", frmID, "Y");
fieldsData = mapAttrs;
var groups = new Entities("BP.Sys.GroupFields", "FrmID", frmID);
for (var k = 0; k < groups.length; k++) {
var group = groups[k];
if (group.CtrlType == "Ath" || group.CtrlType == "Dtl")
continue;
if (group.CtrlType.length > 1)
continue;
html = "";
html += "<tr>";
html += "<td colspan=12 class=Sum><font color=green><b>" + group.Lab + "</b></font></td>";
html += "</tr>";
$("#Table1 tr:last").after(html);
var idx = 1;
for (var i = 0; i < mapAttrs.length; i++) {
var en = mapAttrs[i];
if (en.UIVisible == 0 || en.GroupID != group.OID)
continue;
//if (en.MyDataType == 2 && en.DefValType == 0 && en.DefVal == '10002') {
// en.DefVal = "";
//}
if (en.UIContralType == "0" || en.UIContralType == "1" || en.UIContralType == "2" || en.UIContralType == "3")
continue;
var html = "";
html += "<tr >";
html += "<td class=Idx>" + idx + "</td>";
html += "<td>" + en.KeyOfEn + "</td>";
html += "<td>" + en.Name + "</td>";
if (en.LGType == 0) html += "<td>普通</td>";
if (en.LGType == 1) html += "<td>枚举</td>";
if (en.LGType == 2) html += "<td>外键</td>";
//html += "<td><input onkeydown='upischange(" + i + ");' id='" + en.KeyOfEn + "_RegularExp" + "' type='text' placeholder='正则表达式' value=''/></td>";
//html += "<td><input onkeydown='upischange(" + i + ");' id='" + en.KeyOfEn + "_DefVal" + "' type='text' placeholder='默认值…' value='" + en.DefVal + "'/></td>";
html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='UIVisible' id='" + en.KeyOfEn + "_UIVisible" + "' type='checkbox' " + (en.UIVisible ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_UIVisible" + "'>可见</div></label></td>";
html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='UIIsEnable' id='" + en.KeyOfEn + "_UIIsEnable" + "' type='checkbox' " + (en.UIIsEnable ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_UIIsEnable" + "'>可用</div></label></td>";
//html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='IsSigan' id='" + en.KeyOfEn + "_IsSigan" + "' type='checkbox' " + (en.IsSigan ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_IsSigan" + "'>签名</div></label></td>";
//html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='IsNotNull' id='" + en.KeyOfEn + "_IsNotNull" + "' type='checkbox' " + (en.UIIsInput ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_IsNotNull" + "'>必填</div></label></td>";
//html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='IsWriteToFlowTable' id='" + en.KeyOfEn + "_IsWriteToFlowTable" + "' type='checkbox' " + (en.IsWriteToFlowTable ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_IsWriteToFlowTable" + "'>写入ND" + parseInt(flowNo) + "Rpt</div></label></td>";
//html += "<td><label class='checkbox' ><input onclick='checkclick(this," + i + ");' class='IsWriteToGenerWorkFlow' id='" + en.KeyOfEn + "_IsWriteToGenerWorkFlow" + "' type='checkbox' " + (en.IsWriteToGenerWorkFlow ? "checked" : "") + "><div id='lab_" + en.KeyOfEn + "_IsWriteToGenerWorkFlow" + "'>写入WF_GernrWorkFlow</div></label></td>";
html += "</tr>";
idx++;
$("#Table1 tr:last").after(html);
}
}
//获得FF集合个性化的设置信息都在这个表里面与Sys_MapAttr无关系.
var ffs = new Entities("BP.WF.Template.FrmFields");
ffs.Retrieve("FK_MapData", frmID, "FK_Node", nodeID);
//给相关的字段赋值.
for (var i = 0; i < ffs.length; i++) {
var ff = ffs[i];
//$("#" + ff.KeyOfEn + "_DefVal").val(ff.DefVal); //设置默认值.
//$("#" + ff.KeyOfEn + "_RegularExp").val(ff.RegularExp); //设置默认值.
SetCheckBox(ff, "UIVisible", ff.UIVisible, '可见');
SetCheckBox(ff, "UIIsEnable", ff.UIIsEnable, '可用');
//SetCheckBox(ff, "IsSigan", ff.IsSigan, '签名');
//SetCheckBox(ff, "IsNotNull", ff.IsNotNull, '必填');
//SetCheckBox(ff, "IsWriteToFlowTable", ff.IsWriteToFlowTable, '写入NDxxRpt');
//SetCheckBox(ff, "IsWriteToGenerWorkFlow", ff.IsWriteToGenerWorkFlow, '写入WF_GernrWorkFlow');
}
});
function SetCheckBox(ff, key, val, label) {
//是否可用.
var isCheckedReal = $('#' + ff.KeyOfEn + "_" + key).is(':checked');
if (isCheckedReal == true)
isCheckedReal = 1;
else
isCheckedReal = 0;
if (val != isCheckedReal) {
if (val == 1)
$("#" + ff.KeyOfEn + "_" + key).attr("checked", true);
else
$("#" + ff.KeyOfEn + "_" + key).attr("checked", false);
$("#lab_" + ff.KeyOfEn + "_" + key).html("<font color=green><b>" + label + "</b></font>");
}
}
var FieldsAttrs = new Object();
var fieldsData = null;
//保存字段方案
function Save() {
var frmID = GetQueryString("FK_MapData");
var nodeID = parseInt(GetQueryString("FK_Node"));
var flowNo = GetQueryString("FK_Flow");
//获得字段集合.
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", frmID);
//删除以前的设置..
//var ff = new Entity("BP.WF.Template.FrmField");
//ff.Delete("FK_MapData", frmID, "FK_Node", nodeID);
for (var i = 0; i < mapAttrs.length; i++) {
var en = mapAttrs[i];
if (en.UIVisible == 0)
continue;
ff = new Entity("BP.WF.Template.FrmField");
ff.SetPKVal(frmID + '_' + nodeID + '_' + en.KeyOfEn);
ff.FK_Flow = flowNo;
ff.FK_Node = nodeID;
ff.FK_MapData = frmID;
ff.KeyOfEn = en.KeyOfEn;
ff.EleType = "Field";
ff.Name = en.Name;
//给其他的字段赋值.
//ff.DefVal = $("#" + en.KeyOfEn + "_DefVal").val(); //默认值.
//ff.RegularExp = $("#" + en.KeyOfEn + "_RegularExp").val(); //表达式.
if ($('#' + ff.KeyOfEn + "_UIVisible").is(':checked'))
ff.UIVisible = 1;
else
ff.UIVisible = 0;
if ($('#' + ff.KeyOfEn + "_UIIsEnable").is(':checked'))
ff.UIIsEnable = 1;
else
ff.UIIsEnable = 0;
//判断变化的是否需要保存.
var isNeedSave = false;
if (en.UIVisible != ff.UIVisible)
isNeedSave = true;
if (en.UIIsEnable != ff.UIIsEnable)
isNeedSave = true;
ff.Save();
}
Reload();
}
function replaceTrim(val) {//去除空格
return val.replace(/[ ]/g, "");
}
function upischange(index) {
fieldsData[index].IsChange = true;
}
//绑定是否全选或者取消全选
function checkclick(o, index) {
upischange(index);
var ischeckedall = true;
var rowstype = o.classList;
$('.' + rowstype).each(function () {
if (this.type == 'checkbox' && !this.checked) {
ischeckedall = false;
return ischeckedall;
}
});
if (ischeckedall)
$('#KeyOfEn_' + rowstype)[0].checked = true;
else
$('#KeyOfEn_' + rowstype)[0].checked = false;
}
//全选或者反选
function CheckAll(rowstype) {
$('.' + rowstype).each(function () {
if (this.type == 'checkbox') {
$('#KeyOfEn_' + rowstype)[0].checked ? this.checked = true : this.checked = false;
}
});
upstate(true);
}
function upstate(ischange) {
for (var i = 0; i < fieldsData.length; i++) {
en.IsChange = ischange;
}
}
/**/</script>
</head>
<body>
<div class="container-full">
<div class="attrnode-bar-header">
<span class="pull-right">
<button id="Btn_Save" name="Btn_Save" onclick="Save();" class="cc-btn-tab btn-save">保存</button>
</span>
<strong> 组件权限</strong>
</div>
<table id="Table1" style="width: 100%; padding: 2px;">
<tr>
<th>
</th>
<th>
字段
</th>
<th>
名称
</th>
<th>
类型
</th>
<!--<th>
正则表达式
</th>
<th>
默认值
</th>-->
<th>
<input onclick="CheckAll('UIVisible');" id='KeyOfEn_UIVisible' type="checkbox" />
<label for="KeyOfEn_UIVisible">
可见
</label>
</th>
<th>
<input onclick="CheckAll('UIIsEnable');" id='KeyOfEn_UIIsEnable' type='checkbox' /><label for="KeyOfEn_UIIsEnable">
可用
</label>
</th>
<!--<th>
<input onclick="CheckAll('IsSigan');" id='KeyOfEn_IsSigan' type='checkbox' /><label for="KeyOfEn_IsSigan">
签名
</label>
</th>
<th>
<input onclick="CheckAll('IsNotNull');" id='KeyOfEn_IsNotNull' type='checkbox' /><label for="KeyOfEn_IsNotNull">
必填
</label>
</th>-->
<!--<th>
<input onclick="CheckAll('IsWriteToFlowTable');" id='KeyOfEn_IsWriteToFlowTable'
type='checkbox' /><label for="KeyOfEn_IsWriteToFlowTable">
写入流程数据表
</label>
</th>-->
<!--<th>
<input onclick="CheckAll('IsWriteToGenerWorkFlow');" id='KeyOfEn_IsWriteToGenerWorkFlow'
type='checkbox' /><label for="KeyOfEn_IsWriteToGenerWorkFlow">
写入流程注册表
</label>
</th>-->
</tr>
</table>
</div>
</body>
</html>