routine update

This commit is contained in:
yubao
2018-03-20 23:15:09 +08:00
parent 1a880c0daf
commit 33f02fdeec
9 changed files with 202 additions and 246 deletions

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.App.Flow
{
public class FlowLine
{
public string id { get; set; }
public string type { get; set; }
public string from { get; set; }
public string to { get; set; }
public string name { get; set; }
public bool dash { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.App.Flow
{
public class FlowNode
{
public const string START = "start round mix";
public const string END = "end round";
public const string NODE = "node";
public string id { get; set; }
public string name { get; set; }
public string type { get; set; }
}
}

View File

@@ -1,41 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
using Infrastructure;
namespace OpenAuth.App.Extention
namespace OpenAuth.App.Flow
{
public class WF_Runtime
public class FlowRuntime
{
private WF_RuntimeModel _runtimeModel = null;
private FlowRuntimeModel _runtimeModel = null;
private GetFrmData _getFrmData = null;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="schemeContent">流程模板</param>
/// <param name="currentNodeId">当前节点</param>
/// <param name="frmData">表单数据</param>
public WF_Runtime(WF_RuntimeInitModel wfRuntimeInitModel,GetFrmData getFrmData = null)
public FlowRuntime(FlowRuntimeInitModel flowRuntimeInitModel)
{
_runtimeModel = new WF_RuntimeModel();
_getFrmData = getFrmData;
dynamic schemeContentJson = wfRuntimeInitModel.schemeContent.ToJson();//获取工作流模板内容的json对象;
_runtimeModel = new FlowRuntimeModel();
dynamic schemeContentJson = flowRuntimeInitModel.schemeContent.ToJson();//获取工作流模板内容的json对象;
_runtimeModel.schemeContentJson = schemeContentJson;//模板流程json对象
_runtimeModel.nodeDictionary = GetNodeDictionary(schemeContentJson);//节点集合
_runtimeModel.lineDictionary = GetLineDictionary(schemeContentJson);//线条集合
_runtimeModel.currentNodeId = (wfRuntimeInitModel.currentNodeId == "" ? _runtimeModel.startNodeId : wfRuntimeInitModel.currentNodeId);
_runtimeModel.currentNodeId = (flowRuntimeInitModel.currentNodeId == "" ? _runtimeModel.startNodeId : flowRuntimeInitModel.currentNodeId);
_runtimeModel.currentNodeType = GetNodeStatus(_runtimeModel.currentNodeId);
_runtimeModel.frmData = wfRuntimeInitModel.frmData;
if (getFrmData != null)
{
_runtimeModel.frmType = 1;
wfRuntimeInitModel.frmData = GetNodeFrmData(getFrmData);
}
else
{
_runtimeModel.frmType = 0;
}
_runtimeModel.frmData = flowRuntimeInitModel.frmData;
// flowRuntimeInitModel.frmData = GetNodeFrmData(getFrmData);
if (_runtimeModel.currentNodeType == 0 || _runtimeModel.currentNodeType == 4)
{
@@ -44,14 +35,13 @@ namespace OpenAuth.App.Extention
}
else
{
_runtimeModel.nextNodeId = GetNextNode(wfRuntimeInitModel.frmData);//下一个节点
_runtimeModel.nextNodeId = GetNextNode(flowRuntimeInitModel.frmData);//下一个节点
_runtimeModel.nextNodeType = GetNodeStatus(_runtimeModel.nextNodeId);
}
_runtimeModel.previousId = wfRuntimeInitModel.previousId;
_runtimeModel.previousId = flowRuntimeInitModel.previousId;
_runtimeModel.processId = wfRuntimeInitModel.processId.ToString();
_runtimeModel.sqlFrm = SqlBuider(schemeContentJson, wfRuntimeInitModel.frmData, wfRuntimeInitModel.processId.ToString());
_runtimeModel.flowInstanceId = flowRuntimeInitModel.processId.ToString();
}
@@ -199,77 +189,7 @@ namespace OpenAuth.App.Extention
return res;
}
/// <summary>
/// 获取SQL语句
/// </summary>
/// <param name="tablename"></param>
/// <param name="frmData"></param>
/// <returns></returns>
private string SqlBuider(dynamic schemeContentJson, string frmData, string keyValue)
{
return "";
try
{
if (schemeContentJson.Frm.isSystemTable.Value == 1)
{
var strSql = new StringBuilder();
var frmDataParam = frmData.ToJObject();
string sqlname = schemeContentJson.Frm.FrmTableId.Value, sqlvalues = "'" + keyValue + "'";
foreach (var item in frmDataParam)
{
if (item.Key != "__RequestVerificationToken")
{
sqlname += "," + item.Key;
if (item.Value.Type.ToString() == "String")
{
sqlvalues += ",'" + item.Value + "'";
}
else
{
sqlvalues += "," + item.Value;
}
}
}
strSql.Append(string.Format("insert into " + schemeContentJson.Frm.FrmTable.Value + " ({0})values({1})", sqlname, sqlvalues));
return strSql.ToString();
}
else
{
return "";
}
}
catch
{
throw;
}
}
/// <summary>
/// 系统表单获取表单数据
/// </summary>
/// <param name="getFrmData"></param>
/// <param name="nodeId"></param>
/// <returns></returns>
private string GetNodeFrmData(GetFrmData getFrmData,string nodeId = null)
{
try
{
string _nodeId = (nodeId == null ? _runtimeModel.currentNodeId : nodeId);
dynamic _node = _runtimeModel.nodeDictionary[_nodeId];
if (_node.setInfo != null)
{
return getFrmData(_node.setInfo.NodeDataBase.Value, _node.setInfo.NodeTable.Value, _node.setInfo.NodePram.Value, _runtimeModel.processId);
}
else
{
return "";
}
}
catch
{
throw;
}
}
/// <summary>
/// 获取下一个节点
/// </summary>
@@ -348,7 +268,7 @@ namespace OpenAuth.App.Extention
/// 工作流实例运行信息
/// </summary>
/// <returns></returns>
public WF_RuntimeModel runtimeModel
public FlowRuntimeModel runtimeModel
{
get { return _runtimeModel; }
}
@@ -445,14 +365,9 @@ namespace OpenAuth.App.Extention
try
{
string frmData = "";
if (_runtimeModel.frmType == 0)
{
frmData = _runtimeModel.frmData;
}
else
{
frmData = GetNodeFrmData(_getFrmData, nodeId);
}
// frmData = GetNodeFrmData(_getFrmData, nodeId);
return GetNextNode(frmData, nodeId);
}
catch

View File

@@ -1,27 +1,27 @@
namespace OpenAuth.App.Extention
{
public class WF_RuntimeInitModel
{
/// <summary>
/// GUID
/// </summary>
public string processId { get; set; }
/// <summary>
/// 工作流模板内容
/// </summary>
public string schemeContent { get; set; }
/// <summary>
/// 当前运行节点(默认开始节点)
/// </summary>
public string currentNodeId { get; set; }
/// <summary>
/// 提交的表单数据
/// </summary>
public string frmData { get; set; }
/// <summary>
/// 上一个节点
/// </summary>
public string previousId { get; set; }
}
}
namespace OpenAuth.App.Flow
{
public class FlowRuntimeInitModel
{
/// <summary>
/// GUID
/// </summary>
public string processId { get; set; }
/// <summary>
/// 工作流模板内容
/// </summary>
public string schemeContent { get; set; }
/// <summary>
/// 当前运行节点(默认开始节点)
/// </summary>
public string currentNodeId { get; set; }
/// <summary>
/// 提交的表单数据
/// </summary>
public string frmData { get; set; }
/// <summary>
/// 上一个节点
/// </summary>
public string previousId { get; set; }
}
}

View File

@@ -1,79 +1,66 @@
using System.Collections.Generic;
namespace OpenAuth.App.Extention
{
public class WF_RuntimeModel
{
/// <summary>
/// 运行实例的Id
/// </summary>
public string processId { get; set; }
/// <summary>
/// 开始节点的ID
/// </summary>
public string startNodeId { get; set; }
/// <summary>
/// 开始节点的对象
/// </summary>
public dynamic startNode { get { return this.nodeDictionary[this.startNodeId]; } }
/// <summary>
/// 当前节点的ID
/// </summary>
public string currentNodeId { get; set; }
/// <summary>
/// 当前节点类型 0会签开始,1会签结束,2一般节点,开始节点,4流程运行结束
/// </summary>
public int currentNodeType { get; set; }
/// <summary>
/// 当前节点的对象
/// </summary>
public dynamic currentNode { get { return this.nodeDictionary[this.currentNodeId]; } }
/// <summary>
/// 下一个节点
/// </summary>
public string nextNodeId { get; set; }
/// <summary>
/// 下一个节点类型
/// </summary>
public int nextNodeType { get; set; }
/// <summary>
/// 下一个节点对象
/// </summary>
public dynamic nextNode { get { return this.nodeDictionary[this.nextNodeId]; } }
/// <summary>
/// 上一个节点
/// </summary>
public string previousId { get; set; }
/// <summary>
/// 上一个节点
/// </summary>
public dynamic previousNode { get { return this.nodeDictionary[this.previousId]; } }
/// <summary>
/// 实例节点集合
/// </summary>
public Dictionary<string, dynamic> nodeDictionary { get; set; }
/// <summary>
/// 流转的线段集合
/// </summary>
public Dictionary<string, List<dynamic>> lineDictionary { get; set; }
/// <summary>
/// (建表的表单需要插入的数据表的语句)
/// </summary>
public string sqlFrm { get; set; }
/// <summary>
/// 模板json数据
/// </summary>
public dynamic schemeContentJson { get; set; }
/// <summary>
/// 表单数据
/// </summary>
public string frmData { get; set; }
/// <summary>
/// 表单类型(0自定义表单1系统表单)
/// </summary>
public int frmType { get; set; }
}
public delegate string GetFrmData(string DataBaseId, string tableName, string tableFiled, string processId);
}
using System.Collections.Generic;
namespace OpenAuth.App.Flow
{
public class FlowRuntimeModel
{
/// <summary>
/// 运行实例的Id
/// </summary>
public string flowInstanceId { get; set; }
/// <summary>
/// 开始节点的ID
/// </summary>
public string startNodeId { get; set; }
/// <summary>
/// 当前节点的ID
/// </summary>
public string currentNodeId { get; set; }
/// <summary>
/// 当前节点类型 0会签开始,1会签结束,2一般节点,开始节点,4流程运行结束
/// </summary>
public int currentNodeType { get; set; }
/// <summary>
/// 当前节点的对象
/// </summary>
public dynamic currentNode { get { return this.nodeDictionary[this.currentNodeId]; } }
/// <summary>
/// 下一个节点
/// </summary>
public string nextNodeId { get; set; }
/// <summary>
/// 下一个节点类型
/// </summary>
public int nextNodeType { get; set; }
/// <summary>
/// 下一个节点对象
/// </summary>
public FlowNode nextNode { get { return nodeDictionary[this.nextNodeId]; } }
/// <summary>
/// 上一个节点
/// </summary>
public string previousId { get; set; }
/// <summary>
/// 实例节点集合
/// </summary>
public Dictionary<string, FlowNode> nodeDictionary { get; set; }
/// <summary>
/// 流转的线段集合
/// </summary>
public Dictionary<string, List<dynamic>> lineDictionary { get; set; }
/// <summary>
/// 模板json数据
/// </summary>
public dynamic schemeContentJson { get; set; }
/// <summary>
/// 表单数据
/// </summary>
public string frmData { get; set; }
}
}

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Infrastructure;
using OpenAuth.App.Extention;
using OpenAuth.App.Flow;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.SSO;
@@ -72,18 +72,18 @@ namespace OpenAuth.App
/// <summary>
/// <20><EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
/// </summary>
/// <param name="wfRuntimeModel"></param>
/// <param name="flowRuntimeModel"></param>
/// <param name="flowInstance"></param>
/// <param name="processOperationHistoryEntity"></param>
/// <returns></returns>
public int SaveProcess(WF_RuntimeModel wfRuntimeModel, FlowInstance flowInstance, FlowInstanceOperationHistory processOperationHistoryEntity, FlowInstanceTransitionHistory processTransitionHistoryEntity)
public int SaveProcess(FlowRuntimeModel flowRuntimeModel, FlowInstance flowInstance, FlowInstanceOperationHistory processOperationHistoryEntity, FlowInstanceTransitionHistory processTransitionHistoryEntity)
{
try
{
if (string.Empty == (flowInstance.Id))
{
flowInstance.Id = (string)(wfRuntimeModel.processId);
flowInstance.Id = (string)(flowRuntimeModel.flowInstanceId);
UnitWork.Add(flowInstance);
}
else
@@ -205,14 +205,14 @@ namespace OpenAuth.App
FlowScheme FlowScheme = UnitWork.FindSingle<FlowScheme>(u => u.Id == schemeInfoId);
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
{
schemeContent = FlowScheme.SchemeContent,
currentNodeId = "",
frmData = frmData,
processId = processId
};
WF_Runtime wfruntime = null;
FlowRuntime wfruntime = null;
if (frmData == null)
{
@@ -220,7 +220,7 @@ namespace OpenAuth.App
}
else
{
wfruntime = new WF_Runtime(wfRuntimeInitModel);
wfruntime = new FlowRuntime(flowRuntimeInitModel);
}
@@ -253,7 +253,7 @@ namespace OpenAuth.App
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
processTransitionHistoryEntity.TransitionSate = 0;
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
@@ -290,13 +290,13 @@ namespace OpenAuth.App
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;//<2F><>ת<EFBFBD><D7AA>¼
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
{
currentNodeId = FlowInstance.ActivityId,
previousId = FlowInstance.PreviousId,
processId = processId
};
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
FlowRuntime wfruntime = new FlowRuntime(flowRuntimeInitModel);
#region <EFBFBD><EFBFBD>ǩ
@@ -309,7 +309,7 @@ namespace OpenAuth.App
string _makerList = "";
foreach (string item in _nodelist)
{
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.processId);
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.flowInstanceId);
if (_makerList != "-1")
{
var id = AuthUtil.GetCurrentUser().User.Id.ToString();
@@ -362,7 +362,7 @@ namespace OpenAuth.App
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
processTransitionHistoryEntity.TransitionSate = 0;
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
@@ -405,7 +405,7 @@ namespace OpenAuth.App
FromNodeName = wfruntime.runtimeModel.currentNode.name.Value,
FromNodeType = wfruntime.runtimeModel.currentNodeType,
ToNodeId = wfruntime.runtimeModel.nextNodeId,
ToNodeName = wfruntime.runtimeModel.nextNode.name.Value,
ToNodeName = wfruntime.runtimeModel.nextNode.name,
ToNodeType = wfruntime.runtimeModel.nextNodeType,
TransitionSate = 0
};
@@ -460,13 +460,13 @@ namespace OpenAuth.App
FlowInstance FlowInstance = GetEntity(processId);
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
{
currentNodeId = FlowInstance.ActivityId,
previousId = FlowInstance.PreviousId,
processId = processId
};
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
FlowRuntime wfruntime = new FlowRuntime(flowRuntimeInitModel);
string resnode = "";
@@ -493,7 +493,7 @@ namespace OpenAuth.App
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
processTransitionHistoryEntity.TransitionSate = 1;//
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
@@ -521,7 +521,7 @@ namespace OpenAuth.App
/// </summary>
/// <param name="wfruntime"></param>
/// <returns></returns>
private string GetMakerList(WF_Runtime wfruntime)
private string GetMakerList(FlowRuntime wfruntime)
{
try
{
@@ -536,7 +536,7 @@ namespace OpenAuth.App
string _makerList = "";
foreach (string item in _nodelist)
{
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.processId);
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.flowInstanceId);
if (_makerList == "-1")
{
throw (new Exception("<22>޷<EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ǩ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
@@ -557,7 +557,7 @@ namespace OpenAuth.App
}
else
{
makerList = GetMakerList(wfruntime.runtimeModel.nextNode, wfruntime.runtimeModel.processId);
makerList = GetMakerList(wfruntime.runtimeModel.nextNode, wfruntime.runtimeModel.flowInstanceId);
if (makerList == "-1")
{
throw (new Exception("<22>޷<EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
@@ -618,7 +618,7 @@ namespace OpenAuth.App
//}
//else if (node.setInfo.NodeDesignate.Value == "NodeDesignateType4")//ǰһ<C7B0><D2BB><EFBFBD><EFBFBD><EFBFBD>
//{
// FlowInstanceTransitionHistory transitionHistoryEntity = FlowInstanceTransitionHistoryService.GetEntity(processId, node.id.Value);
// FlowInstanceTransitionHistory transitionHistoryEntity = FlowInstanceTransitionHistoryService.GetEntity(flowInstanceId, node.id.Value);
// UserEntity userEntity = userService.GetEntity(transitionHistoryEntity.CreateUserId);
// if (string.IsNullOrEmpty(userEntity.ManagerId))
// {

View File

@@ -107,9 +107,11 @@
<Compile Include="AuthorizeApp.cs" />
<Compile Include="CategoryApp.cs" />
<Compile Include="Define.cs" />
<Compile Include="Extention\WF_Runtime.cs" />
<Compile Include="Extention\WF_RuntimeInitModel.cs" />
<Compile Include="Extention\WF_RuntimeModel.cs" />
<Compile Include="Flow\FlowRuntime.cs" />
<Compile Include="Flow\FlowRuntimeInitModel.cs" />
<Compile Include="Flow\FlowRuntimeModel.cs" />
<Compile Include="Flow\FlowLine.cs" />
<Compile Include="Flow\FlowNode.cs" />
<Compile Include="FormApp.cs" />
<Compile Include="Request\IdPageReq.cs" />
<Compile Include="Request\PageReq.cs" />

View File

@@ -103,15 +103,20 @@
}
};
var url = '/flowschemes/load';
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
zTreeObj.addNodes(null, json.data);
$.ajax(url,
{
async: false
$("#menutree").html("点击预览表单效果");
zTreeObj.expandAll(true);
});
, success: function (data) {
var json = JSON.parse(data);
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
zTreeObj.addNodes(null, json.data);
$("#menutree").html("点击预览表单效果");
zTreeObj.expandAll(true);
}
});
var setCheck = function (id) { //设置已经选中的表单
if (id == null | id == '') return;

View File

@@ -57,13 +57,19 @@
};
var url = '/forms/load';
$.getJSON(url, function (json) { //todo这个地方要用同步方式不然后面的setCheck会出问题
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
zTreeObj.addNodes(null, json.data);
$.ajax(url,
{
async: false
$("#menutree").html("点击预览表单效果");
zTreeObj.expandAll(true);
});
, success: function (data) {
var json = JSON.parse(data);
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
zTreeObj.addNodes(null, json.data);
$("#menutree").html("点击预览表单效果");
zTreeObj.expandAll(true);
}
});
var setCheck = function (id) { //设置已经选中的表单
if (id == null | id == '') return;