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.

300 lines
12 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>
<title></title>
<link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet"
type="text/css" />
<link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<script src="../../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
<script src="../../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
<script src="../../../Scripts/config.js" type="text/javascript"></script>
<script src="../../../Comm/JScript.js" type="text/javascript"></script>
<script src="../../../Scripts/CommonUnite.js" type="text/javascript"></script>
<script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
<script src="../../../Scripts/QueryString.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" />
<!-- 自己的系统风格统一end -->
<script src="DDLBar.js" type="text/javascript"></script>
<script src="../../CCFlowEnum.js" type="text/javascript"></script>
<script type="text/javascript">
var nodeID = 0;
var fk_flow = "";
$(function () {
InitBar(FormSlnType.SDKFormSmart);
Sln(); //设置权限控制方案.
});
//权限控制方案.
function Sln() {
var nodeID = GetQueryString("FK_Node");
var node = new Entity("BP.WF.Node", nodeID);
//if (node.FormType != FormSlnType.FoolTruck)
// return;
$("#sln").html("正在加载表单方案,请稍后...");
var html = "<table style='width:95%;'>";
html + "<tr>";
html += "<th>节点ID</th>";
html += "<th>节点名称</th>";
html += "<th>表单方案</th>";
html += "<th> 元素 </th>";
html + "</tr>";
var nodes = new Entities("BP.WF.Nodes");
nodes.Retrieve("FK_Flow", node.FK_Flow, "NodeID");
var currentNode = GetQueryString("FK_Node");
for (var i = 0; i < nodes.length; i++) {
var nd = nodes[i];
if (nd.NodeID == nodeID)
continue;
var sln = new Entity("BP.WF.Template.FoolTruckNodeFrm");
sln.MyPK = "ND" + nd.NodeID + "_" + currentNode + "_" + nd.FK_Flow;
if (sln.RetrieveFromDBSources() == 0) {
sln.FK_Flow = nd.FK_Flow;
sln.FK_Frm = "ND" + nd.NodeID;
sln.FK_Node = currentNode; //节点ID.
sln.FrmSln = 1; //只读方案.
sln.Insert();
}
//if (sln.FrmSln == 0) {
// html += "<li>[默认]<a href=\"javascript:EditSln('" + sln.MyPK + "')\">" + nd.NodeID + " - " + nd.Name + "</a></li>";
// continue;
//}
//if (sln.FrmSln == 1) {
// html += "<li>[只读]<a href=\"javascript:EditSln('" + sln.MyPK + "')\">" + nd.NodeID + " - " + nd.Name + "</a></li>";
// continue;
//}
html += "<tr>";
html += "<td>" + nd.NodeID + "</td>";
html += "<td><a href=\"javascript:EditSln('" + sln.MyPK + "')\">" + nd.Name + "</a></td>";
if (sln.FrmSln == 0) {
html += "<td>默认</td>";
}
if (sln.FrmSln == 1) {
html += "<td>只读</td>";
}
if (sln.FrmSln == 2) {
html += "<td>自定义</td>";
}
html += "<td> <a href=\"javascript:DefEle('" + nd.NodeID + "')\" >定义元素(字段)权限</a> </td>";
html + "</tr>";
// html += "<li>[" + sln.FrmSlnText + "]<a href=\"javascript:EditSln('" + sln.MyPK + "')\">" + json.NodeID + " - " + json.Name + "</a> " + def + "</li>";
}
html += "</table>";
$("#sln").html(html);
}
function DefEle(nodeID, FK_Flow) {
var url = "13.SDKFormSmartEles.htm?FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + nodeID + "&DoType=Field";
window.open(url);
}
function EditSln(mypk) {
var url = "../../../Comm/EnOnly.htm?EnName=BP.WF.Template.FoolTruckNodeFrm&MyPK=" + mypk;
OpenEasyUiDialog(url, "eudlgframe", '表单方案', 600, 300, "icon-property", true, null, null, null, function () {
Reload();
});
}
function Save() {
$("#Btn_Save").val("正在保存...");
var nodeID = GetQueryString("FK_Node");
var node = new Entity("BP.WF.Node", nodeID);
node.FormType = FormSlnType.FoolTruck;
node.NodeFrmID = "ND" + nodeID;
node.Update();
//更新表单类型.
var frmID = "ND" + nodeID;
var mapData = new Entity("BP.Sys.MapData", frmID);
mapData.FrmType = FrmType.FoolForm;
mapData.Update();
//执行流程检查.
var flow = new Entity("BP.WF.Flow", node.FK_Flow);
flow.DoMethodReturnString("DoCheck");
$("#Btn_Save").val("保存成功.");
}
///设置该流程的所有节点都是用该方案。
function SetAllNodeFrmUseThisSln() {
if (confirm('您确定要设置吗?') == false)
return;
var nodeID = GetQueryString("FK_Node");
var node = new Entity("BP.WF.Node", nodeID);
var flowNo = node.FK_Flow;
var nds = new Entities("BP.WF.Nodes");
nds.Retrieve("FK_Flow", flowNo);
for (var i = 0; i < nds.length; i++) {
var jsNode = nds[i];
var node = new Entity("BP.WF.Node", jsNode);
node.FormType = FormSlnType.FoolTruck;
node.NodeFrmID = "ND" + node.NodeID;
node.Update();
//更新表单类型.
var frmID = "ND" + node.NodeID;
var mapData = new Entity("BP.Sys.MapData", frmID);
mapData.FrmType = 0; //FormSlnType.FoolTruck;
mapData.Update();
}
//设置显示的主表单,在完成的流程轨迹里可以看到该表单.
SetNDxxRpt_FrmType(flowNo, 0);
//执行流程检查.
var flow = new Entity("BP.WF.Flow", flowNo);
flow.DoMethodReturnString("DoCheck");
alert('设置成功.');
Reload();
}
function SetDemo() {
var val = $("#TB_FormURL").val();
if (val != null) {
alert('请删除当前值在设置demo.');
return;
}
$("#TB_FormURL").val("/SDKFlowDemo/SDK/SmartSDKFrm.html");
$("#TB_FrmTable").val("HR_QingJia");
$("#TB_FrmPKField").val("WorkID");
}
</script>
<style type="text/css">
tbGreen {
color: green;
font-size: large;
font-weight: bold;
}
</style>
</head>
<body>
<div id="bar">
</div>
<fieldset>
<legend>只能SDK表单绑定url设置 -</legend>
<br />
<table style="width:100%; border-color:antiquewhite">
<tr>
<td colspan="4" style="width:70%;">
请输入URL:
<br />
<input type="text" style="width:97%;" class="tbGreen" placeholder="请输入SDK表单的URL" value="" id="TB_FormURL" name="TB_FormURL" />
</td>
</tr>
<tr>
<td>表单业务数据存储的主表: </td>
<td><input type="text" id="TB_FrmTable" placeholder="比如:HR_QingJia" style="width:98%;" /> </td>
<td>主表的int类型的主键: </td>
<td><input type="text" id="TB_FrmPKField" placeholder="比如:WorkID,没有就创建一个" style="width:98%;" /> </td>
</tr>
<tr>
<td colspan="4">
<a href="javascript:ShowFWCAttr()"><img src="../../../Img/Components.png" />组件属性</a>
-
<a href="javascript:SetAllNodeFrmUseThisSln()"> <img src="../../../Img/Setting.png" />设置该流程所有的节点都采用此表单方案</a>
-
<a href="javascript:SetDemo()">设置演示DEMO</a>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>表单权限控制方案</legend>
<br />
<div id="sln">
</div>
</fieldset>
<fieldset>
<legend>开发步骤</legend>
<ul>
<li>0. 首先您需要改造您的表单存储 WorkID 字段,并且作为该流程实例的标识 .</li>
<li>1. 首先引入/WF/ccbpm.js文件.</li>
<li>2. 在自己的页面上增加一个ID为ToolBar的div标记流程的控制按钮工具栏的摆放位置.</li>
<li>3. 如果要引入其他的控件比如审核组件WorkCheck评论组件FlowBBS, 需要在增加对应ID的div以方便ccbpm解析.</li>
<li>4. 按照约定编写一个Save的方法该方法返回true,false true=保存成功 false=保存失败. 在工具栏的发送与保存按钮调用,如果保存失败就不能发送.</li>
<li>5. 工具栏上的按钮是在节点属性上可以控制或者隐藏,比如:退回、移交、加签、轨迹等按钮.</li>
<li>6. 如果使用绝对路径可以使用ccbpm的全局变量@SDKFromServHost ,比如: @SDKFromServHost/MyFile.htm </li>
<li>7. 例如:/SDKFlowDemo/SDK/SmartSDKFrm.html , /SDKFlowDemo/SDK/SmartSDKFrm.html</li>
<li>8. 系统在实际执行的时候,会向您的页面里面传入参数</li>
<li>8. 比如SmartSDKFrm.html?WorkID=1223&FK_Node=105&FK_Flow=001&UserNo=zhangsan&SID=xcwwxccsdsdsd</li>
<li>9. 您可以在您的页面里,接受系统参数进行相关的操作。</li>
<li>10. 首先接受WorkID作为您的业务表主键进行数据的保存与读取,也可以使用FK_Node判断当前调用的节点进行相关的界面权限操作.</li>
<li>11. 其次可以使用FK_Node判断当前调用的节点进行相关的界面元素的权限操作,也可以使用我们系统提供的元素权限控制方案.</li>
</ul>
<legend>如何与我的业务表数据结合?</legend>
<ul>
<li>1. 系统会向您的页面通过url的方式ABC.htm?WorkID=xxxxx传入WorkID参数,它是流程的实例,全局唯一,不重复,可以用它作为您的主键.</li>
<li>2. 如果您的业务表是以int类型作为主键的请把workid作为主键存取如果不是Int类型的主键请扩展一个int类型的列(例如WorkID)存取WorkID.</li>
</ul>
<legend>如何控制页面元素的权限?</legend>
<ul>
<li>11. 其次可以使用FK_Node判断当前调用的节点进行相关的界面元素的权限操作,也可以使用我们系统提供的元素权限控制方案.</li>
</ul>
<legend>解释说明</legend>
<ul>
<li>1. 如果要在您的业务表单上跑流程,仅仅要做的是把 SmartSDKFrm.js 放入到您的页面里面. </li>
<li>2. 系统就会自动生成流程引擎的控制toolbar toolbar 的按钮权限在节点属性里直接控制.</li>
<li>3. 您可以充分利用ccbpm的很多组件功能比如定位、地图、拍照、附件、评论、写字板、超链接组件等等.</li>
<!--<li>运行效果图 - <a href="javascript:OpenAPI()">查看发送退回API接口.</a> </li>-->
<li><img style=" border:1px;" class="HelpImg" src="SDKFrmSmart.png" /></li>
</ul>
</fieldset>
</body>
</html>