commit
This commit is contained in:
@@ -1,15 +1,28 @@
|
|||||||
package com.budwk.app.flow.controller;
|
package com.budwk.app.flow.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.budwk.app.base.annotation.SLog;
|
||||||
|
import com.budwk.app.base.page.Pagination;
|
||||||
|
import com.budwk.app.base.param.PageForm;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.flow.entity.ProcessCategory;
|
import com.budwk.app.flow.entity.ProcessCategory;
|
||||||
|
import com.budwk.app.flow.entity.ProcessDefine;
|
||||||
|
import com.budwk.app.flow.service.ProcessDefineService;
|
||||||
|
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -21,12 +34,59 @@ public class FlowCategoryController {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Dao dao;
|
private Dao dao;
|
||||||
|
@Inject
|
||||||
|
private ProcessDefineService defineService;
|
||||||
|
|
||||||
@At
|
@At("")
|
||||||
|
@Ok("beetl:/platform/flow/category/index.html")
|
||||||
|
@SaCheckLogin
|
||||||
|
public void index() {}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("分页查询")
|
||||||
|
@SaCheckPermission("flow.category")
|
||||||
|
public Result pageData(PageForm pageForm, String name) {
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
select
|
||||||
|
*,
|
||||||
|
(select count(1) from wf_process_design where category = pc.id) as categoryCount
|
||||||
|
from
|
||||||
|
wf_process_category pc
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.andEX(ProcessCategory::getName, "=", name);
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
Pagination pagination = defineService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
return Result.success(pagination);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("flow.category")
|
||||||
|
@SLog(tag = "流程管理-流程分类", msg = "新增/编辑流程分类")
|
||||||
|
public Result submit(ProcessCategory category) {
|
||||||
|
dao.insertOrUpdate(category);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("flow.category")
|
||||||
|
@SLog(tag = "流程管理-流程分类", msg = "删除流程分类")
|
||||||
|
public Result delete(String id) {
|
||||||
|
int count = dao.count(ProcessDefine.class, Cnd.where(ProcessDefine::getCategory, "=", id));
|
||||||
|
if(count > 0) {
|
||||||
|
return Result.error("此分类已关联%s个流程,无法删除".formatted(count));
|
||||||
|
}
|
||||||
|
dao.delete(ProcessCategory.class, id);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
@SaCheckLogin
|
@SaCheckLogin
|
||||||
public Result list() {
|
public Result list() {
|
||||||
List<ProcessCategory> list = dao.query(ProcessCategory.class, Cnd.NEW());
|
List<ProcessCategory> list = dao.query(ProcessCategory.class, Cnd.NEW());
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.budwk.app.flow.controller;
|
package com.budwk.app.flow.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.budwk.app.base.exception.BaseException;
|
import com.budwk.app.base.exception.BaseException;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
|
import com.budwk.app.base.param.PageForm;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.flow.entity.ProcessDefine;
|
import com.budwk.app.flow.entity.ProcessDefine;
|
||||||
|
import com.budwk.app.flow.entity.ProcessDesign;
|
||||||
import com.budwk.app.flow.entity.ProcessInstance;
|
import com.budwk.app.flow.entity.ProcessInstance;
|
||||||
import com.budwk.app.flow.service.ProcessDefineService;
|
import com.budwk.app.flow.service.ProcessDefineService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -13,14 +16,18 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.util.NutMap;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
@At("/flow/define")
|
@At("/flow/define")
|
||||||
@@ -35,7 +42,7 @@ public class FlowDefineController {
|
|||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/flow/define/index.html")
|
@Ok("beetl:/platform/flow/define/index.html")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("flow.define")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,11 +63,10 @@ public class FlowDefineController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("删除流程定义")
|
@ApiOperation("删除流程定义")
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("flow.define")
|
||||||
public Result delete(@Param("id") Long id) {
|
public Result delete(@Param("id") Long id) {
|
||||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getProcessDefineId, "=", id));
|
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getProcessDefineId, "=", id));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
@@ -79,17 +85,44 @@ public class FlowDefineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("获取流程定义分页列表")
|
@ApiOperation("获取流程定义分页列表")
|
||||||
public Result pageData(Integer pageNumber, Integer pageSize, String type, String name, String displayName) {
|
@SaCheckPermission("flow.define")
|
||||||
Cnd cnd = Cnd.NEW();
|
public Result pageData(PageForm pageForm, String displayName, String name, String category) {
|
||||||
Pagination pagination = processDefineService.listPage(pageNumber, pageSize, cnd);
|
Sql sql = Sqls.create("""
|
||||||
return Result.success(pagination);
|
SELECT
|
||||||
|
*,
|
||||||
|
ROW_NUMBER() OVER (ORDER BY name ) AS rowNum
|
||||||
|
FROM
|
||||||
|
( SELECT *, ROW_NUMBER() OVER ( PARTITION BY NAME ORDER BY version DESC ) AS rn FROM wf_process_define ) t
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
|
||||||
|
cnd.and("rn", "=", 1);
|
||||||
|
cnd.and(Cnd.likeEX(ProcessDesign::getDisplayName, displayName));
|
||||||
|
cnd.and(Cnd.likeEX(ProcessDesign::getName, name));
|
||||||
|
cnd.andEX(ProcessDesign::getCategory, "=", category);
|
||||||
|
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
Pagination pagination = processDefineService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
|
||||||
|
List<NutMap> list = pagination.getList(NutMap.class);
|
||||||
|
for (NutMap nutMap : list) {
|
||||||
|
List<ProcessDefine> defineList = dao.query(
|
||||||
|
ProcessDefine.class,
|
||||||
|
Cnd.where(ProcessDefine::getName, "=", nutMap.getString("name"))
|
||||||
|
.and("id", "!=", nutMap.getString("id"))
|
||||||
|
.desc(ProcessDefine::getVersion)
|
||||||
|
);
|
||||||
|
nutMap.put("children", defineList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.success(pagination);
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("启用流程定义")
|
@ApiOperation("启用流程定义")
|
||||||
|
@SaCheckPermission("flow.define")
|
||||||
public Result enable(@Param("id") Long id) {
|
public Result enable(@Param("id") Long id) {
|
||||||
ProcessDefine define = new ProcessDefine();
|
ProcessDefine define = new ProcessDefine();
|
||||||
define.setId(id);
|
define.setId(id);
|
||||||
@@ -99,8 +132,8 @@ public class FlowDefineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("禁用流程定义")
|
@ApiOperation("禁用流程定义")
|
||||||
|
@SaCheckPermission("flow.define")
|
||||||
public Result disable(@Param("id") Long id) {
|
public Result disable(@Param("id") Long id) {
|
||||||
ProcessDefine define = new ProcessDefine();
|
ProcessDefine define = new ProcessDefine();
|
||||||
define.setId(id);
|
define.setId(id);
|
||||||
@@ -108,6 +141,4 @@ public class FlowDefineController {
|
|||||||
dao.updateIgnoreNull(define);
|
dao.updateIgnoreNull(define);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.budwk.app.flow.controller;
|
package com.budwk.app.flow.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.lang.ClassScanner;
|
import cn.hutool.core.lang.ClassScanner;
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
|
import com.budwk.app.base.param.PageForm;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.flow.engine.AssignmentHandler;
|
import com.budwk.app.flow.engine.AssignmentHandler;
|
||||||
import com.budwk.app.flow.engine.CandidateHandler;
|
import com.budwk.app.flow.engine.CandidateHandler;
|
||||||
@@ -89,10 +91,9 @@ public class FlowDesignController {
|
|||||||
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/flow/design/index.html")
|
@Ok("beetl:/platform/flow/design/index.html")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("flow.design")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,17 +105,23 @@ public class FlowDesignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("获取流程设计分页列表")
|
@ApiOperation("获取流程设计分页列表")
|
||||||
public Result pageData(Integer pageNumber, Integer pageSize, String name, String key, String category) {
|
@SaCheckPermission("flow.design")
|
||||||
|
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
Pagination pagination = processDesignService.listPage(pageNumber, pageSize, cnd);
|
|
||||||
|
cnd.and(Cnd.likeEX(ProcessDesign::getDisplayName, displayName));
|
||||||
|
cnd.and(Cnd.likeEX(ProcessDesign::getName, name));
|
||||||
|
cnd.andEX(ProcessDesign::getCategory, "=", category);
|
||||||
|
cnd.andEX(ProcessDesign::getIsDeployed, "=", deployed);
|
||||||
|
|
||||||
|
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||||
return Result.success(pagination);
|
return Result.success(pagination);
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("保存流程设计")
|
@ApiOperation("保存流程设计")
|
||||||
|
@SaCheckPermission("flow.design")
|
||||||
public Result insert(@Param("design") ProcessDesign processDesign) {
|
public Result insert(@Param("design") ProcessDesign processDesign) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.set("name", processDesign.getName());
|
jsonObject.set("name", processDesign.getName());
|
||||||
@@ -132,8 +139,8 @@ public class FlowDesignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("修改流程设计")
|
@ApiOperation("修改流程设计")
|
||||||
|
@SaCheckPermission("flow.design")
|
||||||
public Result update(@Param("design") ProcessDesign processDesign) {
|
public Result update(@Param("design") ProcessDesign processDesign) {
|
||||||
JSONObject jsonObject = processDesign.getContent();
|
JSONObject jsonObject = processDesign.getContent();
|
||||||
jsonObject.set("name", processDesign.getName());
|
jsonObject.set("name", processDesign.getName());
|
||||||
@@ -151,8 +158,8 @@ public class FlowDesignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("修改流程设计")
|
@ApiOperation("修改流程设计")
|
||||||
|
@SaCheckPermission("flow.design")
|
||||||
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
||||||
JSONObject jsonObject = processDesign.getContent();
|
JSONObject jsonObject = processDesign.getContent();
|
||||||
jsonObject.set("name", processDesign.getName());
|
jsonObject.set("name", processDesign.getName());
|
||||||
@@ -170,8 +177,8 @@ public class FlowDesignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("删除流程设计")
|
@ApiOperation("删除流程设计")
|
||||||
|
@SaCheckPermission("flow.design")
|
||||||
public Result delete(@Param("id") Long id) {
|
public Result delete(@Param("id") Long id) {
|
||||||
dao.delete(ProcessDesign.class, id);
|
dao.delete(ProcessDesign.class, id);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@@ -186,9 +193,9 @@ public class FlowDesignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
|
||||||
@ApiOperation("发布流程设计")
|
@ApiOperation("发布流程设计")
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("flow.design")
|
||||||
public Result deploy(@Param("id") Long id) {
|
public Result deploy(@Param("id") Long id) {
|
||||||
processDesignService.deploy(id);
|
processDesignService.deploy(id);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@@ -230,5 +237,4 @@ public class FlowDesignController {
|
|||||||
List<NutMap> list = sysUserService.listMap(sql);
|
List<NutMap> list = sysUserService.listMap(sql);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform.html"){
|
||||||
|
#-->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.design-dialog .el-dialog__body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="app" v-cloak>
|
||||||
|
<guava>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<search @search="doSearch">
|
||||||
|
<search-item label="分类名称">
|
||||||
|
<el-input v-model="pageForm.name" placeholder="请输入分类名称" clearable></el-input>
|
||||||
|
</search-item>
|
||||||
|
</search>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<table-tool>
|
||||||
|
<el-button type="primary" @click="onAdd" size="small" icon="el-icon-plus">新增</el-button>
|
||||||
|
</table-tool>
|
||||||
|
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||||
|
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||||
|
<el-table-column prop="name" label="分类名称"></el-table-column>
|
||||||
|
<el-table-column prop="categoryCount" label="关联流程数"></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" width="450px">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-button size="mini" type="primary" @click="onEdit(row)">编辑</el-button>
|
||||||
|
<el-button type="danger" size="mini" @click="onDelete(row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
|
</el-card>
|
||||||
|
</guava>
|
||||||
|
|
||||||
|
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="40%">
|
||||||
|
<el-form :model="formData" ref="formRef" label-width="80px">
|
||||||
|
<el-form-item label="类型名称" prop="name"
|
||||||
|
:rules="{ required: true, message: '请输入类型名称', trigger: 'blur' }">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入类型名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="图标" prop="icon">
|
||||||
|
<el-input v-model="formData.icon" placeholder="请输入图标"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new Vue({
|
||||||
|
el: "#app",
|
||||||
|
mixins: [initTableMixins],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
formData: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onAdd() {
|
||||||
|
this.formData = {}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
onEdit(row) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.formData = { ...row }
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.$axios.post("/flow/category/submit", this.formData).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.pageData()
|
||||||
|
this.dialogVisible = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onDelete(row) {
|
||||||
|
this.$confirm("您确定要删除吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(() => {
|
||||||
|
this.$axios.post("/flow/category/delete", { id: row.id }).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.pageData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.pageData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
@@ -6,38 +6,61 @@ layout("/layouts/platform.html"){
|
|||||||
.design-dialog .el-dialog__body {
|
.design-dialog .el-dialog__body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
.el-table__row--level-1 {
|
||||||
|
background-color: #FDF5E6 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<guava>
|
<guava>
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<search @search="doSearch">
|
<search @search="doSearch">
|
||||||
<search-item label="名称">
|
<search-item label="流程名称">
|
||||||
<el-input v-model="pageForm.displayName" placeholder="名称" clearable></el-input>
|
<el-input v-model="pageForm.displayName" placeholder="请输入流程名称" clearable></el-input>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="编码">
|
<search-item label="流程编码">
|
||||||
<el-input v-model="pageForm.name" placeholder="编码" clearable></el-input>
|
<el-input v-model="pageForm.name" placeholder="请输入流程编码" clearable></el-input>
|
||||||
|
</search-item>
|
||||||
|
<search-item label="流程分类">
|
||||||
|
<el-select v-model="pageForm.category" placeholder="请选择流程分类" style="width: 100%"
|
||||||
|
@change="doSearch" clearable>
|
||||||
|
<el-option v-for="item in categoryOptions" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<table-tool></table-tool>
|
<table-tool></table-tool>
|
||||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%"
|
||||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||||
<el-table-column prop="displayName" label="流程定义名称"></el-table-column>
|
<el-table-column label="序号" type="index" width="60">
|
||||||
<el-table-column prop="name" label="流程定义编码"></el-table-column>
|
<template v-slot="{ row }">
|
||||||
<el-table-column prop="categoryName" label="流程分类">
|
{{ row.rowNum }}
|
||||||
<template slot-scope="{row}">{{categoryOptions.find(item => item.id === row.category)?.categoryName}}</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="version" label="版本号"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column prop="state" label="状态">
|
:label="column.label"
|
||||||
<template slot-scope="{row}">
|
:prop="column.prop"
|
||||||
|
:key="column.prop"
|
||||||
|
:width="column.width"
|
||||||
|
:sortable="column.sortable"
|
||||||
|
align="center"
|
||||||
|
header-align="center"
|
||||||
|
show-overflow-tooltip
|
||||||
|
v-for="column in tableColumns"
|
||||||
|
>
|
||||||
|
<template v-slot="{ row }" v-if="column.prop === 'categoryName'">
|
||||||
|
{{ categoryOptions.find(item => item.id === row.category)?.name }}
|
||||||
|
</template>
|
||||||
|
<template v-slot="{ row }" v-else-if="column.prop === 'state'">
|
||||||
<el-tag size="mini" v-if="row.state===1" type="success">启用</el-tag>
|
<el-tag size="mini" v-if="row.state===1" type="success">启用</el-tag>
|
||||||
<el-tag size="mini" v-else-if="row.state===0" type="info">停用</el-tag>
|
<el-tag size="mini" v-else-if="row.state===0" type="info">停用</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot="{ row }" v-else-if="column.prop === 'createTime'">
|
||||||
|
{{ $moment(row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
|
||||||
<el-table-column label="操作" fixed="right" width="350px">
|
<el-table-column label="操作" fixed="right" width="350px">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<el-button type="primary" size="mini" @click="onView(row)">查看</el-button>
|
<el-button type="primary" size="mini" @click="onView(row)">查看</el-button>
|
||||||
@@ -66,7 +89,15 @@ layout("/layouts/platform.html"){
|
|||||||
return {
|
return {
|
||||||
categoryOptions: [],
|
categoryOptions: [],
|
||||||
designVisible: false,
|
designVisible: false,
|
||||||
designUrl: null
|
designUrl: null,
|
||||||
|
tableColumns: [
|
||||||
|
{prop: 'displayName', label: '流程定义名称'},
|
||||||
|
{prop: 'name', label: '流程定义编码'},
|
||||||
|
{prop: 'categoryName', label: '流程分类'},
|
||||||
|
{prop: 'version', label: '版本号'},
|
||||||
|
{prop: 'state', label: '状态'},
|
||||||
|
{prop: 'createTime', label: '创建时间'},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -12,11 +12,25 @@ layout("/layouts/platform.html"){
|
|||||||
<guava>
|
<guava>
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<search @search="doSearch">
|
<search @search="doSearch">
|
||||||
<search-item label="名称">
|
<search-item label="流程名称">
|
||||||
<el-input v-model="pageForm.displayName" placeholder="名称" clearable></el-input>
|
<el-input v-model="pageForm.displayName" placeholder="请输入流程名称" clearable></el-input>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="编码">
|
<search-item label="流程编码">
|
||||||
<el-input v-model="pageForm.name" placeholder="编码" clearable></el-input>
|
<el-input v-model="pageForm.name" placeholder="请输入流程编码" clearable></el-input>
|
||||||
|
</search-item>
|
||||||
|
<search-item label="流程分类">
|
||||||
|
<el-select v-model="pageForm.category" placeholder="请选择流程分类" style="width: 100%"
|
||||||
|
@change="doSearch" clearable>
|
||||||
|
<el-option v-for="item in categoryOptions" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</search-item>
|
||||||
|
<search-item label="是否部署">
|
||||||
|
<el-select v-model="pageForm.deployed" placeholder="请选择是否部署" style="width: 100%"
|
||||||
|
@change="doSearch" clearable>
|
||||||
|
<el-option label="全部" :value="null"></el-option>
|
||||||
|
<el-option label="已部署" :value="true"></el-option>
|
||||||
|
<el-option label="未部署" :value="false"></el-option>
|
||||||
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -70,7 +84,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form-item label="流程分类" prop="category"
|
<el-form-item label="流程分类" prop="category"
|
||||||
:rules="{ required: false, message: '请选择流程分类', trigger: 'change' }"
|
:rules="{ required: false, message: '请选择流程分类', trigger: 'change' }"
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-select v-model="formData.category" placeholder="请选择流程分类" clearable>
|
<el-select v-model="formData.category" placeholder="请选择流程分类" clearable style="width: 100%">
|
||||||
<el-option v-for="item in categoryOptions" :key="item.id" :label="item.name"
|
<el-option v-for="item in categoryOptions" :key="item.id" :label="item.name"
|
||||||
:value="item.id"></el-option>
|
:value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -119,7 +133,7 @@ layout("/layouts/platform.html"){
|
|||||||
categoryOptions: [],
|
categoryOptions: [],
|
||||||
designVisible: false,
|
designVisible: false,
|
||||||
designUrl: null,
|
designUrl: null,
|
||||||
formData: {}
|
formData: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -213,7 +227,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.categoryOptions = res.data
|
this.categoryOptions = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.pageData()
|
this.pageData()
|
||||||
|
|||||||
Reference in New Issue
Block a user