feat: 节点表单信息配置
parent
682592fcdf
commit
3a61651a98
|
|
@ -49,6 +49,11 @@ public class SysFormController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/formList")
|
||||||
|
public AjaxResult formList(SysForm sysForm) {
|
||||||
|
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 导出流程表单列表
|
* 导出流程表单列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ public class FlowTaskListener implements TaskListener{
|
||||||
|
|
||||||
log.info("任务监听器:{}", JSON.toJSONString(delegateTask));
|
log.info("任务监听器:{}", JSON.toJSONString(delegateTask));
|
||||||
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
|
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,13 @@ export function listForm(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function listAllForm(query) {
|
||||||
|
return request({
|
||||||
|
url: '/flowable/form/formList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询流程表单详细
|
// 查询流程表单详细
|
||||||
export function getForm(formId) {
|
export function getForm(formId) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
<script>
|
<script>
|
||||||
import mixinPanel from '@/components/Process/common/mixinPanel'
|
import mixinPanel from '@/components/Process/common/mixinPanel'
|
||||||
import {formatJsonKeyValue} from '@/components/Process/common/parseElement'
|
import {formatJsonKeyValue} from '@/components/Process/common/parseElement'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixinPanel],
|
mixins: [mixinPanel],
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -106,8 +107,7 @@ export default {
|
||||||
loopCharacteristics.$attrs[this.prefix + 'elementVariable'] = this.formData.elementVariable
|
loopCharacteristics.$attrs[this.prefix + 'elementVariable'] = this.formData.elementVariable
|
||||||
|
|
||||||
if (this.formData.completionCondition) {
|
if (this.formData.completionCondition) {
|
||||||
const completionCondition = model.create('bpmn:Expression', {body: this.formData.completionCondition})
|
loopCharacteristics['completionCondition'] = model.create('bpmn:Expression', {body: this.formData.completionCondition})
|
||||||
loopCharacteristics['completionCondition'] = completionCondition
|
|
||||||
}
|
}
|
||||||
this.updateProperties({loopCharacteristics: loopCharacteristics})
|
this.updateProperties({loopCharacteristics: loopCharacteristics})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -60,12 +60,12 @@ export default {
|
||||||
label: '发起人',
|
label: '发起人',
|
||||||
show: !!_this.showConfig.initiator
|
show: !!_this.showConfig.initiator
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
xType: 'input',
|
// xType: 'input',
|
||||||
name: 'formKey',
|
// name: 'formKey',
|
||||||
label: '表单标识key',
|
// label: '表单标识key',
|
||||||
show: !!_this.showConfig.formKey
|
// show: !!_this.showConfig.formKey
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ import { commonParse, userTaskParse } from '../../common/parseElement'
|
||||||
import FlowUser from '@/components/flow/User'
|
import FlowUser from '@/components/flow/User'
|
||||||
import FlowRole from '@/components/flow/Role'
|
import FlowRole from '@/components/flow/Role'
|
||||||
import FlowExp from '@/components/flow/Expression'
|
import FlowExp from '@/components/flow/Expression'
|
||||||
import log from "@/views/monitor/job/log";
|
import { listAllForm } from '@/api/flowable/form'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -162,9 +162,7 @@ export default {
|
||||||
userVisible: false,
|
userVisible: false,
|
||||||
roleVisible: false,
|
roleVisible: false,
|
||||||
expVisible: false,
|
expVisible: false,
|
||||||
formData: {
|
formData: {},
|
||||||
userTypeOption: 'assignee',
|
|
||||||
},
|
|
||||||
assignee: null,
|
assignee: null,
|
||||||
candidateUsers: null,
|
candidateUsers: null,
|
||||||
candidateGroups: null,
|
candidateGroups: null,
|
||||||
|
|
@ -182,6 +180,8 @@ export default {
|
||||||
expList: this.exps,
|
expList: this.exps,
|
||||||
// 表达式类型
|
// 表达式类型
|
||||||
expType: null,
|
expType: null,
|
||||||
|
// 表单列表
|
||||||
|
formList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -222,6 +222,7 @@ export default {
|
||||||
xType: 'select',
|
xType: 'select',
|
||||||
name: 'userType',
|
name: 'userType',
|
||||||
label: '用户类型',
|
label: '用户类型',
|
||||||
|
// clearable: true,
|
||||||
dic: _this.userTypeOption,
|
dic: _this.userTypeOption,
|
||||||
// rules: [{ required: true, message: '用户类型不能为空' }],
|
// rules: [{ required: true, message: '用户类型不能为空' }],
|
||||||
show: !!_this.showConfig.userType
|
show: !!_this.showConfig.userType
|
||||||
|
|
@ -266,10 +267,18 @@ export default {
|
||||||
label: '优先级',
|
label: '优先级',
|
||||||
show: !!_this.showConfig.priority
|
show: !!_this.showConfig.priority
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// xType: 'input',
|
||||||
|
// name: 'formKey',
|
||||||
|
// label: '表单标识key',
|
||||||
|
// show: !!_this.showConfig.formKey
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
xType: 'input',
|
xType: 'select',
|
||||||
name: 'formKey',
|
name: 'formKey',
|
||||||
label: '表单标识key',
|
label: '表单标识key',
|
||||||
|
clearable: true,
|
||||||
|
dic: { data: _this.formList, label: 'formName', value: 'formId' },
|
||||||
show: !!_this.showConfig.formKey
|
show: !!_this.showConfig.formKey
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -417,7 +426,10 @@ export default {
|
||||||
this.computedExecutionListenerLength()
|
this.computedExecutionListenerLength()
|
||||||
this.computedTaskListenerLength()
|
this.computedTaskListenerLength()
|
||||||
this.computedHasMultiInstance()
|
this.computedHasMultiInstance()
|
||||||
this.checkValuesEcho()
|
// 人员信息回显
|
||||||
|
this.checkValuesEcho();
|
||||||
|
// 加载表单列表
|
||||||
|
this.getListForm();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
computedExecutionListenerLength() {
|
computedExecutionListenerLength() {
|
||||||
|
|
@ -435,6 +447,15 @@ export default {
|
||||||
this.hasMultiInstance = false
|
this.hasMultiInstance = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取表单信息
|
||||||
|
getListForm(){
|
||||||
|
listAllForm().then(res =>{
|
||||||
|
res.data.forEach(item =>{
|
||||||
|
item.formId = item.formId.toString();
|
||||||
|
})
|
||||||
|
this.formList = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
// 设计器右侧表单数据回显
|
// 设计器右侧表单数据回显
|
||||||
checkValuesEcho(){
|
checkValuesEcho(){
|
||||||
const that = this;
|
const that = this;
|
||||||
|
|
|
||||||
|
|
@ -844,16 +844,6 @@
|
||||||
"isAttr": true,
|
"isAttr": true,
|
||||||
"type": "Boolean"
|
"type": "Boolean"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"isAttr": true,
|
|
||||||
"type": "String"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "elementVariable",
|
|
||||||
"isAttr": true,
|
|
||||||
"type": "String"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "behavior",
|
"name": "behavior",
|
||||||
"type": "MultiInstanceBehavior",
|
"type": "MultiInstanceBehavior",
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ export default {
|
||||||
assignee: true,
|
assignee: true,
|
||||||
candidateUsers: true,
|
candidateUsers: true,
|
||||||
candidateGroups: true,
|
candidateGroups: true,
|
||||||
// assigneeFixed: true,
|
|
||||||
// candidateUsersFixed: true,
|
|
||||||
// candidateGroupsFixed: true,
|
|
||||||
async: true,
|
async: true,
|
||||||
priority: true,
|
priority: true,
|
||||||
formKey: true,
|
formKey: true,
|
||||||
|
|
|
||||||
|
|
@ -87,15 +87,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
taskList: {
|
|
||||||
type: Array,
|
|
||||||
default: () => []
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modeler: null,
|
modeler: null,
|
||||||
// taskList: [],
|
|
||||||
zoom: 1
|
zoom: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -163,9 +158,6 @@ export default {
|
||||||
await this.modeler.importXML(data)
|
await this.modeler.importXML(data)
|
||||||
this.adjustPalette()
|
this.adjustPalette()
|
||||||
this.fitViewport()
|
this.fitViewport()
|
||||||
if (this.taskList !==undefined && this.taskList.length > 0 ) {
|
|
||||||
this.fillColor()
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err.message, err.warnings)
|
console.error(err.message, err.warnings)
|
||||||
}
|
}
|
||||||
|
|
@ -222,77 +214,6 @@ export default {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fillColor() {
|
|
||||||
const canvas = this.modeler.get('canvas')
|
|
||||||
this.modeler._definitions.rootElements[0].flowElements.forEach(n => {
|
|
||||||
const completeTask = this.taskList.find(m => m.key === n.id)
|
|
||||||
const todoTask = this.taskList.find(m => !m.completed)
|
|
||||||
const endTask = this.taskList[this.taskList.length - 1]
|
|
||||||
if (n.$type === 'bpmn:UserTask') {
|
|
||||||
if (completeTask) {
|
|
||||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
n.outgoing?.forEach(nn => {
|
|
||||||
const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
|
|
||||||
if (targetTask) {
|
|
||||||
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){
|
|
||||||
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
}else {
|
|
||||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 排他网关
|
|
||||||
else if (n.$type === 'bpmn:ExclusiveGateway') {
|
|
||||||
if (completeTask) {
|
|
||||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
n.outgoing?.forEach(nn => {
|
|
||||||
const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
|
|
||||||
if (targetTask) {
|
|
||||||
|
|
||||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// 并行网关
|
|
||||||
else if (n.$type === 'bpmn:ParallelGateway') {
|
|
||||||
if (completeTask) {
|
|
||||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
n.outgoing?.forEach(nn => {
|
|
||||||
debugger
|
|
||||||
const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
|
|
||||||
if (targetTask) {
|
|
||||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (n.$type === 'bpmn:StartEvent') {
|
|
||||||
n.outgoing.forEach(nn => {
|
|
||||||
const completeTask = this.taskList.find(m => m.key === nn.targetRef.id)
|
|
||||||
if (completeTask) {
|
|
||||||
canvas.addMarker(nn.id, 'highlight')
|
|
||||||
canvas.addMarker(n.id, 'highlight')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else if (n.$type === 'bpmn:EndEvent') {
|
|
||||||
if (endTask.key === n.id && endTask.completed) {
|
|
||||||
canvas.addMarker(n.id, 'highlight')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 对外 api
|
// 对外 api
|
||||||
getProcess() {
|
getProcess() {
|
||||||
const element = this.getProcessElement()
|
const element = this.getProcessElement()
|
||||||
|
|
|
||||||
|
|
@ -497,11 +497,13 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 最后一个任务节点
|
// 最后一个任务节点
|
||||||
console.log(this.taskForm, "流程审批提交表单数据")
|
// console.log(this.taskForm, "流程审批提交表单数据")
|
||||||
complete(this.taskForm).then(response => {
|
// complete(this.taskForm).then(response => {
|
||||||
this.$modal.msgSuccess(response.msg);
|
// this.$modal.msgSuccess(response.msg);
|
||||||
this.goBack();
|
// this.goBack();
|
||||||
});
|
// });
|
||||||
|
this.completeOpen = true;
|
||||||
|
this.completeTitle = "流程审批";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue