feat(流程设计): 更改人员列表为后端接口获取

approve-sys
zhuyong 3 years ago
parent 7a1ff7b7e9
commit 6cfec4ef7f

@ -1,14 +1,15 @@
package com.ruoyi.flowable.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.flowable.domain.dto.FlowProcDefDto;
import com.ruoyi.flowable.domain.dto.FlowSaveXmlVo;
import com.ruoyi.flowable.service.IFlowDefinitionService;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -21,6 +22,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
/**
@ -40,6 +42,9 @@ public class FlowDefinitionController {
@Autowired
private IFlowDefinitionService flowDefinitionService;
@Autowired
private ISysUserService userService;
@GetMapping(value = "/list")
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
@ -161,4 +166,11 @@ public class FlowDefinitionController {
return AjaxResult.success();
}
@ApiOperation(value = "指定流程办理人员列表")
@GetMapping("/userList")
public AjaxResult userList(SysUser user) {
List<SysUser> list = userService.selectUserList(user);
return AjaxResult.success(list);
}
}

@ -35,6 +35,15 @@ export function updateState(params) {
})
}
// 指定流程办理人员列表
export function userList(query) {
return request({
url: '/flowable/definition/userList',
method: 'get',
params: query
})
}
// 读取xml文件
export function readXml(deployId) {
return request({

@ -122,7 +122,7 @@ export default {
label: '指定人员',
allowCreate: true,
filterable: true,
dic: { data: _this.users, label: 'name', value: 'id' },
dic: { data: _this.users, label: 'nickName', value: 'userId' },
show: !!_this.showConfig.assignee && _this.formData.userType === 'assignee'
},
{
@ -132,7 +132,7 @@ export default {
multiple: true,
allowCreate: true,
filterable: true,
dic: { data: _this.users, label: 'name', value: 'id' },
dic: { data: _this.users, label: 'nickName', value: 'userId' },
show: !!_this.showConfig.candidateUsers && _this.formData.userType === 'candidateUsers'
},
{

@ -13,7 +13,7 @@
</template>
<script>
import { readXml, saveXml } from "@/api/flowable/definition";
import { readXml, saveXml, userList } from "@/api/flowable/definition";
// import bpmnModeler from "workflow-bpmn-modeler";
import bpmnModeler from '@/components/Process/index'
@ -26,9 +26,9 @@ export default {
return {
xml: "", // xml
users: [
{ name: "张三", id: "1" },
{ name: "李四", id: "2" },
{ name: "轩轩", id: "100" },
// { name: "", id: "1" },
// { name: "", id: "2" },
// { name: "", id: "100" },
],
groups: [
{ name: "超级管理员", id: "1" },
@ -43,17 +43,21 @@ export default {
},
created () {
const deployId = this.$route.query && this.$route.query.deployId;
// xml
if (deployId) {
this.getModelDetail(deployId);
}
this.getUserList()
},
methods: {
/** xml 文件 */
getModelDetail(deployId) {
// xml
readXml(deployId).then(res =>{
this.xml = res.data
})
},
/** 保存xml */
save(data) {
const params = {
name: data.process.name,
@ -67,6 +71,16 @@ export default {
this.$router.go(-1)
})
},
/** 指定流程办理人员列表 */
getUserList() {
// todo
// const params = {
//
// }
userList().then(res =>{
this.users = res.data
})
},
},
};
</script>

Loading…
Cancel
Save