mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-18 17:48:01 +08:00
拆分流程列表为我的列表、待处理、已处理;
调整模块菜单按模块标识映射; 优化API错误提示;
This commit is contained in:
BIN
DOC/核心设计.EAP
BIN
DOC/核心设计.EAP
Binary file not shown.
@@ -29,6 +29,7 @@
|
||||
{
|
||||
public const string SPECIAL_USER = "SPECIAL_USER"; //指定用户
|
||||
public const string ALL_USER = "ALL_USER"; //所有用户
|
||||
public const string SPECIAL_ROLE = "SPECIAL_ROLE";
|
||||
/// <summary>
|
||||
/// 节点执行权限类型
|
||||
/// </summary>
|
||||
|
@@ -53,6 +53,8 @@ namespace OpenAuth.App
|
||||
FlowInstanceOperationHistory processOperationHistoryEntity = new FlowInstanceOperationHistory
|
||||
{
|
||||
InstanceId = flowInstance.Id,
|
||||
CreateUserId = user.User.Id,
|
||||
CreateUserName = user.User.Name,
|
||||
Content = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
+ user.User.Name
|
||||
+ "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>̡<EFBFBD>"
|
||||
@@ -73,9 +75,11 @@ namespace OpenAuth.App
|
||||
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
||||
ToNodeName = wfruntime.runtimeModel.nextNode.name,
|
||||
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
||||
TransitionSate = 0
|
||||
IsFinish = wfruntime.runtimeModel.nextNodeType == 4?1:0,
|
||||
TransitionSate = 0,
|
||||
CreateUserId = user.User.Id,
|
||||
CreateUserName = user.User.Name
|
||||
};
|
||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||
#endregion
|
||||
|
||||
UnitWork.Add(flowInstance);
|
||||
@@ -93,7 +97,10 @@ namespace OpenAuth.App
|
||||
public bool NodeVerification(string instanceId, bool flag, string description = "")
|
||||
{
|
||||
FlowInstance flowInstance = Get(instanceId);
|
||||
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
||||
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
|
||||
{
|
||||
InstanceId = instanceId
|
||||
};//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
||||
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;//<2F><>ת<EFBFBD><D7AA>¼
|
||||
|
||||
FlowRuntime wfruntime = new FlowRuntime(flowInstance);
|
||||
@@ -166,15 +173,18 @@ namespace OpenAuth.App
|
||||
|
||||
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
|
||||
{
|
||||
InstanceId = flowInstance.Id,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name,
|
||||
FromNodeId = wfruntime.runtimeModel.currentNodeId,
|
||||
FromNodeName = wfruntime.runtimeModel.currentNode.name,
|
||||
FromNodeType = wfruntime.runtimeModel.currentNodeType,
|
||||
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
||||
ToNodeName = wfruntime.runtimeModel.nextNode.name,
|
||||
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
||||
IsFinish = wfruntime.runtimeModel.nextNodeType ==4?1:0,
|
||||
TransitionSate = 0
|
||||
};
|
||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||
#endregion
|
||||
|
||||
break;
|
||||
@@ -204,19 +214,23 @@ namespace OpenAuth.App
|
||||
|
||||
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
|
||||
{
|
||||
InstanceId = flowInstance.Id,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name,
|
||||
FromNodeId = wfruntime.runtimeModel.currentNodeId,
|
||||
FromNodeName = wfruntime.runtimeModel.currentNode.name,
|
||||
FromNodeType = wfruntime.runtimeModel.currentNodeType,
|
||||
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
||||
ToNodeName = wfruntime.runtimeModel.nextNode.name,
|
||||
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
||||
IsFinish = wfruntime.runtimeModel.nextNodeType == 4 ? 1 : 0,
|
||||
TransitionSate = 0
|
||||
};
|
||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||
#endregion
|
||||
|
||||
|
||||
flowInstanceOperationHistory.Content = "<22><>" + "todo name" + "<22><><EFBFBD><EFBFBD>" + wfruntime.runtimeModel.currentNode.name + "<22><><EFBFBD><EFBFBD>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "<22><>ͬ<EFBFBD><CDAC>,<2C><>ע<EFBFBD><D7A2>" + description;
|
||||
flowInstanceOperationHistory.Content = "<22><>" + "todo name" + "<22><><EFBFBD><EFBFBD>" + wfruntime.runtimeModel.currentNode.name
|
||||
+ "<22><><EFBFBD><EFBFBD>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "<22><>ͬ<EFBFBD><CDAC>,<2C><>ע<EFBFBD><D7A2>" + description;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -224,7 +238,9 @@ namespace OpenAuth.App
|
||||
tag.Taged = -1;
|
||||
wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, tag);
|
||||
|
||||
flowInstanceOperationHistory.Content = "<22><>" + "todo name" + "<22><><EFBFBD><EFBFBD>" + wfruntime.runtimeModel.currentNode.name + "<22><><EFBFBD><EFBFBD>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "<22><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>,<2C><>ע<EFBFBD><D7A2>" + description;
|
||||
flowInstanceOperationHistory.Content = "<22><>" + "todo name" + "<22><><EFBFBD><EFBFBD>"
|
||||
+ wfruntime.runtimeModel.currentNode.name + "<22><><EFBFBD><EFBFBD>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "<22><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>,<2C><>ע<EFBFBD><D7A2>"
|
||||
+ description;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -243,9 +259,15 @@ namespace OpenAuth.App
|
||||
/// <returns></returns>
|
||||
public bool NodeReject(VerificationReq reqest)
|
||||
{
|
||||
var user = AuthUtil.GetCurrentUser().User;
|
||||
|
||||
FlowInstance flowInstance = Get(reqest.FlowInstanceId);
|
||||
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory();
|
||||
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;
|
||||
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
|
||||
{
|
||||
InstanceId = reqest.FlowInstanceId,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name
|
||||
};
|
||||
|
||||
FlowRuntime wfruntime = new FlowRuntime(flowInstance);
|
||||
|
||||
@@ -260,7 +282,6 @@ namespace OpenAuth.App
|
||||
resnode = reqest.NodeRejectStep;
|
||||
}
|
||||
|
||||
var user = AuthUtil.GetCurrentUser().User;
|
||||
var tag = new Tag
|
||||
{
|
||||
Description = reqest.VerificationOpinion,
|
||||
@@ -280,29 +301,32 @@ namespace OpenAuth.App
|
||||
flowInstance.MakerList = GetMakerList(wfruntime.runtimeModel.nodes[resnode], flowInstance.PreviousId);//<2F><>ǰ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
#region <EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>¼
|
||||
|
||||
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
|
||||
var processTransitionHistoryEntity = new FlowInstanceTransitionHistory
|
||||
{
|
||||
InstanceId = flowInstance.Id,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name,
|
||||
FromNodeId = wfruntime.runtimeModel.currentNodeId,
|
||||
FromNodeName = wfruntime.runtimeModel.currentNode.name,
|
||||
FromNodeType = wfruntime.runtimeModel.currentNodeType,
|
||||
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
||||
ToNodeName = wfruntime.runtimeModel.nextNode.name,
|
||||
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
||||
IsFinish = wfruntime.runtimeModel.nextNodeType ==4?1:0,
|
||||
TransitionSate = 1
|
||||
};
|
||||
//
|
||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||
|
||||
UnitWork.Add(processTransitionHistoryEntity);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
flowInstanceOperationHistory.Content = "<22><>" + "todo name" + "<22><><EFBFBD><EFBFBD>"
|
||||
+ wfruntime.runtimeModel.currentNode.name
|
||||
+ "<22><><EFBFBD><EFBFBD>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ע<EFBFBD><D7A2>" + reqest.VerificationOpinion;
|
||||
|
||||
UnitWork.Update(flowInstance);
|
||||
UnitWork.Add(flowInstanceOperationHistory);
|
||||
UnitWork.Add(processTransitionHistoryEntity);
|
||||
UnitWork.Save();
|
||||
|
||||
return true;
|
||||
@@ -361,32 +385,38 @@ namespace OpenAuth.App
|
||||
/// <returns></returns>
|
||||
private string GetMakerList(FlowNode node, string processId)
|
||||
{
|
||||
string makerlsit = "";
|
||||
string makerList = "";
|
||||
|
||||
if (node.setInfo == null)
|
||||
{
|
||||
makerlsit = "-1";
|
||||
makerList = "-1";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.setInfo.NodeDesignate == Setinfo.ALL_USER)//<2F><><EFBFBD>г<EFBFBD>Ա
|
||||
{
|
||||
makerlsit = "1";
|
||||
makerList = "1";
|
||||
}
|
||||
else if (node.setInfo.NodeDesignate == Setinfo.SPECIAL_USER)//ָ<><D6B8><EFBFBD><EFBFBD>Ա
|
||||
{
|
||||
// makerlsit = GenericHelpers.ArrayToString(node.setInfo.NodeDesignateData.role, makerlsit);
|
||||
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.post, makerlsit);
|
||||
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.usergroup, makerlsit);
|
||||
makerlsit = GenericHelpers.ArrayToString(node.setInfo.NodeDesignateData.users, makerlsit);
|
||||
makerList = GenericHelpers.ArrayToString(node.setInfo.NodeDesignateData.users, makerList);
|
||||
|
||||
if (makerlsit == "")
|
||||
if (makerList == "")
|
||||
{
|
||||
makerlsit = "-1";
|
||||
makerList = "-1";
|
||||
}
|
||||
}
|
||||
else if (node.setInfo.NodeDesignate == Setinfo.SPECIAL_ROLE)
|
||||
{
|
||||
makerList = GenericHelpers.ArrayToString(node.setInfo.NodeDesignateData.role, makerList);
|
||||
|
||||
if (makerList == "")
|
||||
{
|
||||
makerList = "-1";
|
||||
}
|
||||
}
|
||||
}
|
||||
return makerlsit;
|
||||
return makerList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -419,21 +449,25 @@ namespace OpenAuth.App
|
||||
{
|
||||
//todo:<3A><><EFBFBD><EFBFBD>/<2F>Ѱ<EFBFBD>/<2F>ҵ<EFBFBD>
|
||||
var result = new TableData();
|
||||
var user = AuthUtil.GetCurrentUser();
|
||||
|
||||
result.count = UnitWork.Find<FlowInstance>(u => u.CreateUserId == request.userid).Count();
|
||||
if (request.type == "inbox") //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (request.type == "wait") //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
result.data = UnitWork.Find<FlowInstance>(request.page, request.limit, "CreateDate descending", null).ToList();
|
||||
result.count = UnitWork.Find<FlowInstance>(u => u.MakerList =="1" || u.MakerList.Contains(user.User.Id)).Count();
|
||||
|
||||
result.data = UnitWork.Find<FlowInstance>(request.page, request.limit, "CreateDate descending",
|
||||
u => u.MakerList == "1" || u.MakerList.Contains(user.User.Id)).ToList();
|
||||
|
||||
}
|
||||
else if (request.type == "outbox") //<2F>Ѱ<EFBFBD><D1B0><EFBFBD><EFBFBD><EFBFBD>
|
||||
else if (request.type == "disposed") //<2F>Ѱ<EFBFBD><D1B0><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
result.data = UnitWork.Find<FlowInstance>(request.page, request.limit, "CreateDate descending", null).ToList();
|
||||
|
||||
}
|
||||
else //<2F>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
result.data = UnitWork.Find<FlowInstance>(request.page, request.limit, "CreateDate descending", null).ToList();
|
||||
result.count = UnitWork.Find<FlowInstance>(u => u.CreateUserId == user.User.Id).Count();
|
||||
result.data = UnitWork.Find<FlowInstance>(request.page, request.limit,
|
||||
"CreateDate descending", u => u.CreateUserId == user.User.Id).ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -3,6 +3,5 @@
|
||||
public class QueryFlowInstanceListReq : PageReq
|
||||
{
|
||||
public string type { get; set; }
|
||||
public string userid { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -55,6 +55,8 @@ namespace OpenAuth.App.Response
|
||||
/// </summary>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模块中的元素
|
||||
/// </summary>
|
||||
|
@@ -43,15 +43,12 @@ namespace OpenAuth.App.SSO
|
||||
filterContext.Result = LoginResult("");
|
||||
return;
|
||||
}
|
||||
else
|
||||
//验证
|
||||
if (AuthUtil.CheckLogin(token, request.RawUrl) == false)
|
||||
{
|
||||
//验证
|
||||
if (AuthUtil.CheckLogin(token, request.RawUrl) == false)
|
||||
{
|
||||
//会话丢失,跳转到登录页面
|
||||
filterContext.Result = LoginResult("");
|
||||
return;
|
||||
}
|
||||
//会话丢失,跳转到登录页面
|
||||
filterContext.Result = LoginResult("");
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnActionExecuting(filterContext);
|
||||
|
@@ -22,6 +22,22 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 待处理的流程
|
||||
/// </summary>
|
||||
public ActionResult Wait()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 已完成的流程
|
||||
/// </summary>
|
||||
public ActionResult Disposed()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Edit()
|
||||
{
|
||||
return View();
|
||||
|
@@ -70,10 +70,20 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(menus);
|
||||
}
|
||||
|
||||
|
||||
public string LoadAuthorizedMenus()
|
||||
/// <summary>
|
||||
/// 获取发起页面的菜单权限
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
public string LoadAuthorizedMenus(string modulecode)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(CurrentModule.Elements);
|
||||
var user = AuthUtil.GetCurrentUser();
|
||||
var module = user.Modules.First(u =>u.Code == modulecode);
|
||||
if (module != null)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(module.Elements);
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
@@ -198,6 +198,8 @@
|
||||
<Content Include="js\utils.js" />
|
||||
<Content Include="userJs\flowInstanceOp.js" />
|
||||
<Content Include="userJs\flowInstanceEdit.js" />
|
||||
<Content Include="userJs\flowInstanceWait.js" />
|
||||
<Content Include="userJs\flowInstanceDisposed.js" />
|
||||
<Content Include="userJs\flowSchemes.js" />
|
||||
<Content Include="userJs\formEdit.js" />
|
||||
<Content Include="userJs\nodeInfo.js" />
|
||||
@@ -635,6 +637,8 @@
|
||||
<Content Include="Views\FlowInstances\Edit.cshtml" />
|
||||
<Content Include="Views\FlowInstances\Verification.cshtml" />
|
||||
<Content Include="Views\Forms\Edit.cshtml" />
|
||||
<Content Include="Views\FlowInstances\Disposed.cshtml" />
|
||||
<Content Include="Views\FlowInstances\Wait.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
|
53
OpenAuth.Mvc/Views/FlowInstances/Disposed.cshtml
Normal file
53
OpenAuth.Mvc/Views/FlowInstances/Disposed.cshtml
Normal file
@@ -0,0 +1,53 @@
|
||||
@section header
|
||||
{
|
||||
<link rel="stylesheet" href="/css/treetable.css" />
|
||||
}
|
||||
<blockquote class="layui-elem-quote news_search toolList" id="menus">
|
||||
</blockquote>
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs3">
|
||||
<ul id="tree" class="ztree"
|
||||
style="padding: 2px; border: 1px solid #ddd; overflow: auto;">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-col-xs9">
|
||||
<table class="layui-table"
|
||||
lay-data="{height: 'full-80', page:true, id:'mainList'}"
|
||||
lay-filter="list" lay-size="sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||
<th lay-data="{field:'Id', width:150}">主键Id</th>
|
||||
<th lay-data="{field:'IsFinish', width:150, templet:'#IsFinish'}">是否完成</th>
|
||||
<th lay-data="{field:'CustomName', width:150}">实例名称</th>
|
||||
<th lay-data="{field:'Code', width:150}">实例编号</th>
|
||||
<th lay-data="{field:'ActivityName', width:150}">当前节点名称</th>
|
||||
<th lay-data="{field:'CreateDate', width:150}">创建时间</th>
|
||||
<th lay-data="{field:'CreateUserName', width:150}">创建用户</th>
|
||||
<th lay-data="{field:'Description', width:150}">实例备注</th>
|
||||
<th lay-data="{fixed: 'right', width:160, align:'center', toolbar: '#barList'}"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/html" id="IsFinish">
|
||||
{{# if(d.IsFinish == 0){ }}
|
||||
<span class="layui-badge layui-bg-blue">正在运行</span>
|
||||
{{# } else if(d.IsFinish == 4){ }}
|
||||
<span class="layui-badge">被驳回</span>
|
||||
{{# } else{}}
|
||||
<span class="layui-badge layui-bg-green">已完成</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="barList">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="/userJs/flowInstanceDisposed.js"></script>
|
||||
|
||||
|
53
OpenAuth.Mvc/Views/FlowInstances/Wait.cshtml
Normal file
53
OpenAuth.Mvc/Views/FlowInstances/Wait.cshtml
Normal file
@@ -0,0 +1,53 @@
|
||||
@section header
|
||||
{
|
||||
<link rel="stylesheet" href="/css/treetable.css" />
|
||||
}
|
||||
<blockquote class="layui-elem-quote news_search toolList" id="menus">
|
||||
</blockquote>
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs3">
|
||||
<ul id="tree" class="ztree"
|
||||
style="padding: 2px; border: 1px solid #ddd; overflow: auto;">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-col-xs9">
|
||||
<table class="layui-table"
|
||||
lay-data="{height: 'full-80', page:true, id:'mainList'}"
|
||||
lay-filter="list" lay-size="sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||
<th lay-data="{field:'Id', width:150}">主键Id</th>
|
||||
<th lay-data="{field:'IsFinish', width:150, templet:'#IsFinish'}">是否完成</th>
|
||||
<th lay-data="{field:'CustomName', width:150}">实例名称</th>
|
||||
<th lay-data="{field:'Code', width:150}">实例编号</th>
|
||||
<th lay-data="{field:'ActivityName', width:150}">当前节点名称</th>
|
||||
<th lay-data="{field:'CreateDate', width:150}">创建时间</th>
|
||||
<th lay-data="{field:'CreateUserName', width:150}">创建用户</th>
|
||||
<th lay-data="{field:'Description', width:150}">实例备注</th>
|
||||
<th lay-data="{fixed: 'right', width:160, align:'center', toolbar: '#barList'}"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/html" id="IsFinish">
|
||||
{{# if(d.IsFinish == 0){ }}
|
||||
<span class="layui-badge layui-bg-blue">正在运行</span>
|
||||
{{# } else if(d.IsFinish == 4){ }}
|
||||
<span class="layui-badge">被驳回</span>
|
||||
{{# } else{}}
|
||||
<span class="layui-badge layui-bg-green">已完成</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="barList">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="/userJs/flowInstanceWait.js"></script>
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
{
|
||||
<link rel="stylesheet" href="/css/treetable.css" />
|
||||
}
|
||||
<blockquote class="layui-elem-quote news_search toolList">
|
||||
@Html.Action("MenuHeader", "Home")
|
||||
<blockquote class="layui-elem-quote news_search toolList" id="menus">
|
||||
</blockquote>
|
||||
|
||||
<div class="layui-row">
|
||||
|
@@ -15,6 +15,7 @@
|
||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||
<th lay-data="{field:'Name', width:120, sort: true, fixed: true}">模块名称</th>
|
||||
<th lay-data="{field:'CascadeId', width:80}">层级ID</th>
|
||||
<th lay-data="{field:'Code', width:80}">模块标识</th>
|
||||
<th lay-data="{field:'Url', width:200}">Url</th>
|
||||
<th lay-data="{field:'IconName', width:60,templet: '#iconTpl'}">图标</th>
|
||||
<th lay-data="{field:'ParentName', width:135}">父节点名称</th>
|
||||
@@ -79,7 +80,13 @@
|
||||
placeholder="请输入部门名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模块标识</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="Code" v-model="Code"
|
||||
placeholder="比如:Module" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL地址</label>
|
||||
<div class="layui-input-block">
|
||||
|
@@ -26,9 +26,9 @@ layui.define("jquery", function (exports) {
|
||||
|
||||
//加载菜单
|
||||
$.fn.extend({
|
||||
loadMenus: function () {
|
||||
loadMenus: function (modulecode) {
|
||||
var dom = $(this);
|
||||
$.ajax("/ModuleManager/LoadAuthorizedMenus",
|
||||
$.ajax("/ModuleManager/LoadAuthorizedMenus?modulecode=" + modulecode,
|
||||
{
|
||||
async: false
|
||||
, success: function (data) {
|
||||
|
@@ -8,7 +8,7 @@ layui.config({
|
||||
var openauth = layui.openauth;
|
||||
layui.droptree("/Categories/AllTypes", "#TypeName", "#TypeId", false);
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("Category");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
|
184
OpenAuth.Mvc/userJs/flowInstanceDisposed.js
Normal file
184
OpenAuth.Mvc/userJs/flowInstanceDisposed.js
Normal file
@@ -0,0 +1,184 @@
|
||||
layui.config({
|
||||
base: "/js/"
|
||||
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth','utils'], function () {
|
||||
var form = layui.form,
|
||||
layer = (top == undefined || top.layer === undefined )? layui.layer : top.layer,
|
||||
$ = layui.jquery;
|
||||
var table = layui.table;
|
||||
var openauth = layui.openauth;
|
||||
var thiswin = (top == undefined) ? window : top.window;
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus("FlowInstanceDisposed");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {
|
||||
type:'disposed'
|
||||
}; //table的参数,如搜索key,点击tree的id
|
||||
var mainList = function (options) {
|
||||
if (options != undefined) {
|
||||
$.extend(config, options);
|
||||
}
|
||||
table.reload('mainList', {
|
||||
url: '/FlowInstances/Load',
|
||||
where: config
|
||||
});
|
||||
}
|
||||
//左边树状机构列表
|
||||
var ztree = function () {
|
||||
var url = '/UserSession/GetOrgs';
|
||||
var zTreeObj;
|
||||
var setting = {
|
||||
view: { selectedMulti: false },
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick: function (event, treeId, treeNode) {
|
||||
mainList({ orgId: treeNode.Id });
|
||||
}
|
||||
}
|
||||
};
|
||||
var load = function () {
|
||||
$.getJSON(url, function (json) {
|
||||
zTreeObj = $.fn.zTree.init($("#tree"), setting);
|
||||
var newNode = { Name: "根节点", Id: null, ParentId: "" };
|
||||
json.push(newNode);
|
||||
zTreeObj.addNodes(null, json);
|
||||
mainList({ orgId: "" });
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
};
|
||||
load();
|
||||
return {
|
||||
reload: load
|
||||
}
|
||||
}();
|
||||
$("#tree").height($("div.layui-table-view").height());
|
||||
|
||||
//添加(编辑)对话框
|
||||
var editDlg = function () {
|
||||
|
||||
var update = false; //是否为更新
|
||||
var show = function (data) {
|
||||
var title = update ? "编辑信息" : "添加";
|
||||
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: ['800px', '700px'], //宽高
|
||||
maxmin: true, //开启最大化最小化按钮
|
||||
title: title,
|
||||
content: '/flowInstances/edit?id=' + data.Id,
|
||||
btn: ['保存', '关闭'],
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = thiswin[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
}
|
||||
});
|
||||
}
|
||||
return {
|
||||
add: function () { //弹出添加
|
||||
update = false;
|
||||
show({
|
||||
Id: ''
|
||||
});
|
||||
},
|
||||
update: function (data) { //弹出编辑框
|
||||
update = true;
|
||||
show(data);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
//监听表格内部按钮
|
||||
table.on('tool(list)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'detail') { //查看
|
||||
layer.msg('ID:' + data.Id + ' 的查看操作');
|
||||
}
|
||||
});
|
||||
|
||||
//监听页面主按钮操作
|
||||
var active = {
|
||||
btnDel: function () { //批量删除
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
openauth.del("/FlowInstances/Delete",
|
||||
data.map(function (e) { return e.Id; }),
|
||||
mainList);
|
||||
}
|
||||
, btnAdd: function () { //添加
|
||||
editDlg.add();
|
||||
}
|
||||
, btnEdit: function () { //编辑
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
if (data.length != 1) {
|
||||
layer.msg("请选择编辑的行,且同时只能编辑一行");
|
||||
return;
|
||||
}
|
||||
editDlg.update(data[0]);
|
||||
}
|
||||
|
||||
, btnVerification: function () { //处理
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
if (data.length != 1) {
|
||||
layer.msg("请选择要处理的流程,且同时只能选择一条");
|
||||
return;
|
||||
}
|
||||
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: ['750px', '550px'], //宽高
|
||||
maxmin: true, //开启最大化最小化按钮
|
||||
title: '处理流程',
|
||||
content: '/flowInstances/Verification?id=' + data[0].Id,
|
||||
btn: ['保存', '关闭'],
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = thiswin[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
, search: function () { //搜索
|
||||
mainList({ key: $('#key').val() });
|
||||
}
|
||||
, btnRefresh: function() {
|
||||
mainList();
|
||||
}
|
||||
};
|
||||
|
||||
$('.toolList .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
//监听页面主按钮操作 end
|
||||
})
|
184
OpenAuth.Mvc/userJs/flowInstanceWait.js
Normal file
184
OpenAuth.Mvc/userJs/flowInstanceWait.js
Normal file
@@ -0,0 +1,184 @@
|
||||
layui.config({
|
||||
base: "/js/"
|
||||
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth','utils'], function () {
|
||||
var form = layui.form,
|
||||
layer = (top == undefined || top.layer === undefined )? layui.layer : top.layer,
|
||||
$ = layui.jquery;
|
||||
var table = layui.table;
|
||||
var openauth = layui.openauth;
|
||||
var thiswin = (top == undefined) ? window : top.window;
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus("FlowInstanceWait");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {
|
||||
type:'wait'
|
||||
}; //table的参数,如搜索key,点击tree的id
|
||||
var mainList = function (options) {
|
||||
if (options != undefined) {
|
||||
$.extend(config, options);
|
||||
}
|
||||
table.reload('mainList', {
|
||||
url: '/FlowInstances/Load',
|
||||
where: config
|
||||
});
|
||||
}
|
||||
//左边树状机构列表
|
||||
var ztree = function () {
|
||||
var url = '/UserSession/GetOrgs';
|
||||
var zTreeObj;
|
||||
var setting = {
|
||||
view: { selectedMulti: false },
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick: function (event, treeId, treeNode) {
|
||||
mainList({ orgId: treeNode.Id });
|
||||
}
|
||||
}
|
||||
};
|
||||
var load = function () {
|
||||
$.getJSON(url, function (json) {
|
||||
zTreeObj = $.fn.zTree.init($("#tree"), setting);
|
||||
var newNode = { Name: "根节点", Id: null, ParentId: "" };
|
||||
json.push(newNode);
|
||||
zTreeObj.addNodes(null, json);
|
||||
mainList({ orgId: "" });
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
};
|
||||
load();
|
||||
return {
|
||||
reload: load
|
||||
}
|
||||
}();
|
||||
$("#tree").height($("div.layui-table-view").height());
|
||||
|
||||
//添加(编辑)对话框
|
||||
var editDlg = function () {
|
||||
|
||||
var update = false; //是否为更新
|
||||
var show = function (data) {
|
||||
var title = update ? "编辑信息" : "添加";
|
||||
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: ['800px', '700px'], //宽高
|
||||
maxmin: true, //开启最大化最小化按钮
|
||||
title: title,
|
||||
content: '/flowInstances/edit?id=' + data.Id,
|
||||
btn: ['保存', '关闭'],
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = thiswin[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
}
|
||||
});
|
||||
}
|
||||
return {
|
||||
add: function () { //弹出添加
|
||||
update = false;
|
||||
show({
|
||||
Id: ''
|
||||
});
|
||||
},
|
||||
update: function (data) { //弹出编辑框
|
||||
update = true;
|
||||
show(data);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
//监听表格内部按钮
|
||||
table.on('tool(list)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'detail') { //查看
|
||||
layer.msg('ID:' + data.Id + ' 的查看操作');
|
||||
}
|
||||
});
|
||||
|
||||
//监听页面主按钮操作
|
||||
var active = {
|
||||
btnDel: function () { //批量删除
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
openauth.del("/FlowInstances/Delete",
|
||||
data.map(function (e) { return e.Id; }),
|
||||
mainList);
|
||||
}
|
||||
, btnAdd: function () { //添加
|
||||
editDlg.add();
|
||||
}
|
||||
, btnEdit: function () { //编辑
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
if (data.length != 1) {
|
||||
layer.msg("请选择编辑的行,且同时只能编辑一行");
|
||||
return;
|
||||
}
|
||||
editDlg.update(data[0]);
|
||||
}
|
||||
|
||||
, btnVerification: function () { //处理
|
||||
var checkStatus = table.checkStatus('mainList')
|
||||
, data = checkStatus.data;
|
||||
if (data.length != 1) {
|
||||
layer.msg("请选择要处理的流程,且同时只能选择一条");
|
||||
return;
|
||||
}
|
||||
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: ['750px', '550px'], //宽高
|
||||
maxmin: true, //开启最大化最小化按钮
|
||||
title: '处理流程',
|
||||
content: '/flowInstances/Verification?id=' + data[0].Id,
|
||||
btn: ['保存', '关闭'],
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = thiswin[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
, search: function () { //搜索
|
||||
mainList({ key: $('#key').val() });
|
||||
}
|
||||
, btnRefresh: function() {
|
||||
mainList();
|
||||
}
|
||||
};
|
||||
|
||||
$('.toolList .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
//监听页面主按钮操作 end
|
||||
})
|
@@ -9,7 +9,7 @@
|
||||
var thiswin = (top == undefined) ? window : top.window;
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("FlowInstance");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
@@ -151,7 +151,7 @@
|
||||
content: '/flowInstances/Verification?id=' + data[0].Id,
|
||||
btn: ['保存', '关闭'],
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
var iframeWin = thiswin[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("FlowScheme");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config = {}; //table的参数,如搜索key,点击tree的id
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("Form");
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
var mainList = function (options) {
|
||||
|
@@ -8,7 +8,7 @@ layui.config({
|
||||
var openauth = layui.openauth;
|
||||
layui.droptree("/UserSession/QueryModuleList", "#ParentName", "#ParentId", false);
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("Module");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
|
@@ -8,7 +8,7 @@ layui.config({
|
||||
var openauth = layui.openauth;
|
||||
layui.droptree("/UserSession/GetOrgs", "#ParentName", "#ParentId", false);
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("Org");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
|
@@ -8,7 +8,7 @@ layui.config({
|
||||
var openauth = layui.openauth;
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("Role");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
|
@@ -8,7 +8,7 @@ layui.config({
|
||||
var openauth = layui.openauth;
|
||||
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
|
||||
|
||||
$("#menus").loadMenus();
|
||||
$("#menus").loadMenus("User");
|
||||
|
||||
//主列表加载,可反复调用进行刷新
|
||||
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||
|
@@ -27,6 +27,7 @@ namespace OpenAuth.Repository.Domain
|
||||
this.Status= 0;
|
||||
this.Vector= string.Empty;
|
||||
this.SortNo= 0;
|
||||
this.Code = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,5 +64,11 @@ namespace OpenAuth.Repository.Domain
|
||||
/// </summary>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模块标识
|
||||
/// </summary>
|
||||
/// <value>The code.</value>
|
||||
public string Code { get; set; }
|
||||
|
||||
}
|
||||
}
|
@@ -72,6 +72,10 @@ namespace OpenAuth.Repository.Mapping
|
||||
.HasColumnName("ParentId")
|
||||
.HasMaxLength(50)
|
||||
.IsOptional();
|
||||
Property(t => t.Code)
|
||||
.HasColumnName("Code")
|
||||
.HasMaxLength(50)
|
||||
.IsOptional();
|
||||
|
||||
// Relationships
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ namespace OpenAuth.UnitTest
|
||||
{
|
||||
_runApp.Verification(new VerificationReq
|
||||
{
|
||||
FlowInstanceId = "c4aa73f2-d5ea-43c3-8b7e-903e31ba5828",
|
||||
FlowInstanceId = "132333fe-d8db-4373-b101-b0ac574d3b1a",
|
||||
VerificationFinally = "3"
|
||||
});
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
1. 484498493【已满】
|
||||
|
||||
1. 626433139【将满】
|
||||
1. 626433139【已满】
|
||||
|
||||
1. 566344079
|
||||
|
||||
|
BIN
建表&初始化数据.sql
BIN
建表&初始化数据.sql
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user