diff --git a/src/main/java/com/laker/admin/module/flow/SnakerflowFacetsController.java b/src/main/java/com/laker/admin/module/flow/SnakerflowFacetsController.java index 800e8ad..4cad461 100644 --- a/src/main/java/com/laker/admin/module/flow/SnakerflowFacetsController.java +++ b/src/main/java/com/laker/admin/module/flow/SnakerflowFacetsController.java @@ -149,11 +149,11 @@ public class SnakerflowFacetsController { */ @GetMapping("/task/todoList") @ApiOperation(value = "根据当前用户查询待办任务列表", tags = "流程引擎-任务") - public Response userTaskTodoList() { + public PageResponse userTaskTodoList() { Page page = new Page<>(30); snakerEngineFacets.getEngine().query().getWorkItems(page, new QueryFilter().setOperator(StpUtil.getLoginIdAsString())); - return Response.ok(page); + return PageResponse.ok(page.getResult(), page.getTotalCount()); } /** @@ -161,11 +161,11 @@ public class SnakerflowFacetsController { */ @GetMapping("/task/doneList") @ApiOperation(value = "根据当前用户查询已办任务列表", tags = "流程引擎-任务") - public Response userTaskdoneList() { + public PageResponse userTaskdoneList() { Page page = new Page<>(30); snakerEngineFacets.getEngine().query().getHistoryWorkItems(page, new QueryFilter().setOperator(StpUtil.getLoginIdAsString())); - return Response.ok(page); + return PageResponse.ok(page.getResult(), page.getTotalCount()); } @GetMapping("/task/actor/add") @@ -236,7 +236,7 @@ public class SnakerflowFacetsController { return Response.ok(); } - @RequestMapping(value = "/task/approval", method = RequestMethod.POST) + @RequestMapping(value = "/task/approval", method = RequestMethod.GET) @ApiOperation(value = "【审批任务】同意", tags = "流程引擎-任务") public Response doApproval(String taskId, String reason) { snakerEngineFacets.execute(taskId, StpUtil.getLoginIdAsString(), null); @@ -265,6 +265,9 @@ public class SnakerflowFacetsController { } + /** + * ------------------ 流程 + */ /** * 流程实例管理 */ @@ -280,4 +283,26 @@ public class SnakerflowFacetsController { return PageResponse.ok(JSONUtil.parse(page.getResult()), page.getTotalCount()); } + + + /** + * @param name + * @param version + * @param args + * @return + */ + @ApiOperation("模拟 相关参数和 流程") + @PostMapping("/startAndExecute") + public Response startAndExecute(String name, Integer version, @RequestBody Map args) { + args.put("user1", StpUtil.getLoginIdAsString()); + args.put("user2", "yang"); + args.put("user3", "zhang"); + Object day = args.get("day"); + if (day != null) { + args.put("day", Integer.valueOf((String) day)); + } + + snakerEngineFacets.startAndExecute(name, version, StpUtil.getLoginIdAsString(), args); + return Response.ok(); + } } diff --git a/web/admin/component/snaker/snaker.designer.js b/web/admin/component/snaker/snaker.designer.js index 73ee01b..43a4672 100644 --- a/web/admin/component/snaker/snaker.designer.js +++ b/web/admin/component/snaker/snaker.designer.js @@ -248,12 +248,12 @@ if (!designer.config.editable) { designer.util.tip(_rect, _o.props['name'].value); } else { - var returnValue = window.showModalDialog(designer.config.ctxPath + '/config/form?lookup=1', window, 'dialogWidth:1000px;dialogHeight:600px'); - if (returnValue) { - var formPath = "/config/form/use/" + returnValue; - _o.props.form.value = formPath; - document.getElementById("pform").innerHTML = ''; - } + // var returnValue = window.showModalDialog(designer.config.ctxPath + '/config/form?lookup=1', window, 'dialogWidth:1000px;dialogHeight:600px'); + // if (returnValue) { + // var formPath = "/config/form/use/" + returnValue; + // _o.props.form.value = formPath; + // document.getElementById("pform").innerHTML = ''; + // } } }); _rect.click(function () { @@ -262,14 +262,14 @@ } }); _rect.dblclick(function () { - if (designer.config.editable) { - var returnValue = window.showModalDialog(designer.config.ctxPath + '/config/form?lookup=1', window, 'dialogWidth:1000px;dialogHeight:600px'); - if (returnValue) { - var formPath = "/config/form/use/" + returnValue; - _o.props.form.value = formPath; - document.getElementById("pform").innerHTML = ''; - } - } + // if (designer.config.editable) { + // var returnValue = window.showModalDialog(designer.config.ctxPath + '/config/form?lookup=1', window, 'dialogWidth:1000px;dialogHeight:600px'); + // if (returnValue) { + // var formPath = "/config/form/use/" + returnValue; + // _o.props.form.value = formPath; + // document.getElementById("pform").innerHTML = ''; + // } + // } }); _img.drag(function (dx, dy) { dragMove(dx, dy); diff --git a/web/admin/component/snaker/snaker.model.js b/web/admin/component/snaker/snaker.model.js index 2e13e28..d975c94 100644 --- a/web/admin/component/snaker/snaker.model.js +++ b/web/admin/component/snaker/snaker.model.js @@ -112,13 +112,20 @@ return new snakerflow.editors.inputEditor(); } }, - assignee: {name: 'assignee', value: ''}, - assigneeDisplay: { - name: 'assigneeDisplay', label: '参与者', value: '', editor: function () { - // return new snakerflow.editors.assigneeEditor('/dialogs/selectDialog.jsp?type=orgUserTree'); + // assignee: {name: 'assignee', value: ''}, + assignee: { + name: 'assignee', label: '参与者', value: '', editor: function () { return new snakerflow.editors.inputEditor(); } - }, + } + // , + // assigneeDisplay: { + // name: 'assigneeDisplay', label: '参与者', value: '', editor: function () { + // // return new snakerflow.editors.assigneeEditor('/dialogs/selectDialog.jsp?type=orgUserTree'); + // return new snakerflow.editors.inputEditor(); + // } + // } + , assignmentHandler: { name: 'assignmentHandler', label: '参与者处理类', value: '', editor: function () { return new snakerflow.editors.inputEditor(); diff --git a/web/admin/index.html b/web/admin/index.html index 26f71b3..66d8371 100644 --- a/web/admin/index.html +++ b/web/admin/index.html @@ -93,17 +93,12 @@ if (JSON.stringify(user) == "{}") { location.href = "login.html"; } - admin.setAvatar("admin/images/avatar.jpg", "laker"); - admin.setConfigType("yml"); - admin.setConfigPath("config/pear.config.yml"); - console.log(admin.readConfig()); - let readConfig = admin.readConfig(); - const menuUrl = EasyAdminContext.url + "/sys/menu/tree"; $.ajax({ - url: menuUrl, + url: EasyAdminContext.url+"/api/v1/tokenInfo", dataType: 'json', - success: function () { + success: function (data) { + admin.setAvatar("admin/images/avatar.jpg", data.data.loginId); }, error: function () { // 用于验证前端信息 对应到不对的会话情况 @@ -112,6 +107,15 @@ location.href = "login.html"; } }); + + + + admin.setConfigType("yml"); + admin.setConfigPath("config/pear.config.yml"); + console.log(admin.readConfig()); + let readConfig = admin.readConfig(); + const menuUrl = EasyAdminContext.url + "/sys/menu/tree"; + readConfig.menu.data = menuUrl; admin.render(readConfig); diff --git a/web/admin/view/flow/process/leave.html b/web/admin/view/flow/process/leave.html new file mode 100644 index 0000000..3f454a6 --- /dev/null +++ b/web/admin/view/flow/process/leave.html @@ -0,0 +1,82 @@ + + + + + Title + + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ + +
+
+
+ + + + + + \ No newline at end of file diff --git a/web/admin/view/flow/taskList.html b/web/admin/view/flow/taskList.html new file mode 100644 index 0000000..30ae23a --- /dev/null +++ b/web/admin/view/flow/taskList.html @@ -0,0 +1,169 @@ + + + + + 任务列表 + + + +
+
+
+
    +
  • 待办任务
  • +
  • 已办任务
  • +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file