| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- @using VberZero.Workflow.StepBodies
- @using Abp.Extensions
- @using VberZero.Tools.StringModel
- @{
- //ViewBag.Title = L("StateTitle");
- ViewBag.Title = "工作流程设计器";
- ViewBag.ActiveMenu = PermissionNames.VberSystemMgWorkflowMg; //The menu item will be active for this page.
- string id = ViewBag.Id??"";
- int version = ViewBag.Version;
- IEnumerable<VberWorkflowStepBody> stepBodies = ViewBag.StepBodies;
- }
- @section css
- {
- @*<link href="/css/workflow.min.css" rel="stylesheet">*@
- }
- <div id="workflow-container" style="width: 100%;height: 100%">
- </div>
- @section scripts
- {
- @* <script src="~/libs-ext/jsplumb/dist/js/jsplumb.js" asp-append-version="false"></script> *@
- <script src="~/js/workflowHelper.js" asp-append-version="false"></script>
- <script type="text/javascript">
- //WF.stepBodies= @Html.Raw(stepBodies.Obj2String());
- //console.log("StepBody", WF.stepBodies);
- function SetSize(el) {
- var $content = $('.page>.wrapper>.content');
- $('#vber_content_container').css({padding:0}).width($content.width()).height($content.height());
- $(el).width($content.width());
- $(el).height($content.height());
- }
- $(function () {
- var workflowContainer = $('#workflow-container');
- SetSize(workflowContainer);
- @if (id.IsNullOrEmpty())
- {
- <text>
- workflowContainer.VbWorkflow({
- stepBodies: @Html.Raw(stepBodies.Obj2String()),
- submit: Create
- });
- </text>
- }
- else
- {
- <text>
- $.vbAjax4({
- url: abp.appUrl + "Workflow/GetByVersion",
- data: { id: '@(id)', version: @version },
- success: (res) => {
- workflowContainer.VbWorkflow({
- data: res || [],
- stepBodies: @Html.Raw(stepBodies.Obj2String()),
- submit: Update
- });
- }
- });
- </text>
- }
-
- //workflowContainer.VbWorkflow({
- // data:{"id":"Test","version":"","title":"测试工作流01","group":"GR01 ","icon":"","color":"","description":"",
- // "inputs":[
- // [{"id":"25743ead9f184eb69a78142650c13175","name":"test","label":"t01","items":[],"styles":[],"rules":[],"type":"text"}],[{"id":"2a4fdee6400640e3a77593a50a9a5993","name":"demo","label":"d01","items":[],"styles":[],"rules":[],"type":"text"}],[{"id":"3fd3598ecd4d49358a48d6c9f58087a7","name":"tr","label":"单选框","items":[{"label":"123","value":"3"},{"label":"33","value":"44"}],"styles":[],"rules":[],"type":"radio"}]
- // ],"nodes":[{"key":"start_141bf80e039946efb53f474bf6ba800a","title":"流程开始","icon":"fa fa-play","type":"success","group":"1","endpointOptions":[{"anchor":"Bottom","maxConnections":-1,"uuid":"start_141bf80e039946efb53f474bf6ba800a_Bottom"}],"position":[500,20],"parentNodes":[],"nextNodes":[{"nodeId":"step_ecb8d32b5b64481f8fa22b651a6b1b6a","label":"条件22","conditions":[{"field":"test","operator":">=","value":"3"}]}]},{"key":"end_ed3bdec599df4378bcb478fe3a865f5b","title":"流程结束","icon":"fa fa-square","type":"danger","group":"1","endpointOptions":[{"anchor":"Top","maxConnections":-1,"uuid":"end_ed3bdec599df4378bcb478fe3a865f5b_Top"}],"position":[500,260],"parentNodes":["step_ecb8d32b5b64481f8fa22b651a6b1b6a"],"nextNodes":[]},{"key":"step_ecb8d32b5b64481f8fa22b651a6b1b6a","title":"任务节点","icon":"fa fa-cog","type":"primary","group":"2","endpointOptions":[{"anchor":"Top","maxConnections":-1,"uuid":"step_ecb8d32b5b64481f8fa22b651a6b1b6a_Top"},{"anchor":"Bottom","maxConnections":-1,"uuid":"step_ecb8d32b5b64481f8fa22b651a6b1b6a_Bottom"}],"position":[500,140],"stepBody":{"Name":"FixedUserAudit","DisplayName":"指定用户审核","Inputs":{"UserId":{"Name":"UserId","DisplayName":"审核人","InputType":{"Name":"SELECT_USERS","Attributes":{},"Validator":{"Name":"NULL","Attributes":{}}},"Value":"admin"}},"StepBodyType":"VberZero.Workflows.GeneralAuditingStepBody, VberYue.Zero, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},"parentNodes":["start_141bf80e039946efb53f474bf6ba800a"],"nextNodes":[{"nodeId":"end_ed3bdec599df4378bcb478fe3a865f5b","label":"条件33","conditions":[{"field":"demo","operator":"!=","value":"4"}]}]}]},
- // stepBodies:@Html.Raw(stepBodies.Obj2String()),
- // submit:Create
- //});
-
- //const stepBodies = workflowContainer.VbWorkflow("setStepBodies",@Html.Raw(stepBodies.Obj2String()));
- //workflowContainer.VbWorkflow("getStepBodies");
- //console.log("StepBody", stepBodies);
- });
- function Create(data) {
- console.log(data);
- $.vbAjax({
- url: abp.appUrl + "Workflow/Create",
- data: data
- });
- }
- function Update(data) {
- console.log(data);
- $.vbAjax({
- url: abp.appUrl + "Workflow/Update",
- data: data
- });
- }
- </script>
-
- <script id="formatter" type="text/javascript">
- </script>
- }
|