feat: 节点表单信息配置
parent
682592fcdf
commit
3a61651a98
|
|
@ -49,6 +49,11 @@ public class SysFormController extends BaseController {
|
|||
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));
|
||||
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@ export function listForm(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
export function listAllForm(query) {
|
||||
return request({
|
||||
url: '/flowable/form/formList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程表单详细
|
||||
export function getForm(formId) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
<script>
|
||||
import mixinPanel from '@/components/Process/common/mixinPanel'
|
||||
import { formatJsonKeyValue } from '@/components/Process/common/parseElement'
|
||||
import {formatJsonKeyValue} from '@/components/Process/common/parseElement'
|
||||
|
||||
export default {
|
||||
mixins: [mixinPanel],
|
||||
data() {
|
||||
|
|
@ -106,8 +107,7 @@ export default {
|
|||
loopCharacteristics.$attrs[this.prefix + 'elementVariable'] = this.formData.elementVariable
|
||||
|
||||
if (this.formData.completionCondition) {
|
||||
const completionCondition = model.create('bpmn:Expression', {body: this.formData.completionCondition})
|
||||
loopCharacteristics['completionCondition'] = completionCondition
|
||||
loopCharacteristics['completionCondition'] = model.create('bpmn:Expression', {body: this.formData.completionCondition})
|
||||
}
|
||||
this.updateProperties({loopCharacteristics: loopCharacteristics})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@ export default {
|
|||
label: '发起人',
|
||||
show: !!_this.showConfig.initiator
|
||||
},
|
||||
{
|
||||
xType: 'input',
|
||||
name: 'formKey',
|
||||
label: '表单标识key',
|
||||
show: !!_this.showConfig.formKey
|
||||
}
|
||||
// {
|
||||
// xType: 'input',
|
||||
// name: 'formKey',
|
||||
// label: '表单标识key',
|
||||
// show: !!_this.showConfig.formKey
|
||||
// }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ import { commonParse, userTaskParse } from '../../common/parseElement'
|
|||
import FlowUser from '@/components/flow/User'
|
||||
import FlowRole from '@/components/flow/Role'
|
||||
import FlowExp from '@/components/flow/Expression'
|
||||
import log from "@/views/monitor/job/log";
|
||||
import { listAllForm } from '@/api/flowable/form'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -162,9 +162,7 @@ export default {
|
|||
userVisible: false,
|
||||
roleVisible: false,
|
||||
expVisible: false,
|
||||
formData: {
|
||||
userTypeOption: 'assignee',
|
||||
},
|
||||
formData: {},
|
||||
assignee: null,
|
||||
candidateUsers: null,
|
||||
candidateGroups: null,
|
||||
|
|
@ -182,6 +180,8 @@ export default {
|
|||
expList: this.exps,
|
||||
// 表达式类型
|
||||
expType: null,
|
||||
// 表单列表
|
||||
formList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -222,6 +222,7 @@ export default {
|
|||
xType: 'select',
|
||||
name: 'userType',
|
||||
label: '用户类型',
|
||||
// clearable: true,
|
||||
dic: _this.userTypeOption,
|
||||
// rules: [{ required: true, message: '用户类型不能为空' }],
|
||||
show: !!_this.showConfig.userType
|
||||
|
|
@ -266,10 +267,18 @@ export default {
|
|||
label: '优先级',
|
||||
show: !!_this.showConfig.priority
|
||||
},
|
||||
// {
|
||||
// xType: 'input',
|
||||
// name: 'formKey',
|
||||
// label: '表单标识key',
|
||||
// show: !!_this.showConfig.formKey
|
||||
// },
|
||||
{
|
||||
xType: 'input',
|
||||
xType: 'select',
|
||||
name: 'formKey',
|
||||
label: '表单标识key',
|
||||
clearable: true,
|
||||
dic: { data: _this.formList, label: 'formName', value: 'formId' },
|
||||
show: !!_this.showConfig.formKey
|
||||
},
|
||||
{
|
||||
|
|
@ -417,7 +426,10 @@ export default {
|
|||
this.computedExecutionListenerLength()
|
||||
this.computedTaskListenerLength()
|
||||
this.computedHasMultiInstance()
|
||||
this.checkValuesEcho()
|
||||
// 人员信息回显
|
||||
this.checkValuesEcho();
|
||||
// 加载表单列表
|
||||
this.getListForm();
|
||||
},
|
||||
methods: {
|
||||
computedExecutionListenerLength() {
|
||||
|
|
@ -435,6 +447,15 @@ export default {
|
|||
this.hasMultiInstance = false
|
||||
}
|
||||
},
|
||||
// 获取表单信息
|
||||
getListForm(){
|
||||
listAllForm().then(res =>{
|
||||
res.data.forEach(item =>{
|
||||
item.formId = item.formId.toString();
|
||||
})
|
||||
this.formList = res.data;
|
||||
})
|
||||
},
|
||||
// 设计器右侧表单数据回显
|
||||
checkValuesEcho(){
|
||||
const that = this;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -10,9 +10,6 @@ export default {
|
|||
assignee: true,
|
||||
candidateUsers: true,
|
||||
candidateGroups: true,
|
||||
// assigneeFixed: true,
|
||||
// candidateUsersFixed: true,
|
||||
// candidateGroupsFixed: true,
|
||||
async: true,
|
||||
priority: true,
|
||||
formKey: true,
|
||||
|
|
|
|||
|
|
@ -87,15 +87,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
taskList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modeler: null,
|
||||
// taskList: [],
|
||||
zoom: 1
|
||||
}
|
||||
},
|
||||
|
|
@ -163,9 +158,6 @@ export default {
|
|||
await this.modeler.importXML(data)
|
||||
this.adjustPalette()
|
||||
this.fitViewport()
|
||||
if (this.taskList !==undefined && this.taskList.length > 0 ) {
|
||||
this.fillColor()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err.message, err.warnings)
|
||||
}
|
||||
|
|
@ -222,77 +214,6 @@ export default {
|
|||
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
|
||||
getProcess() {
|
||||
const element = this.getProcessElement()
|
||||
|
|
|
|||
|
|
@ -497,11 +497,13 @@ export default {
|
|||
}
|
||||
} else {
|
||||
// 最后一个任务节点
|
||||
console.log(this.taskForm, "流程审批提交表单数据")
|
||||
complete(this.taskForm).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.goBack();
|
||||
});
|
||||
// console.log(this.taskForm, "流程审批提交表单数据")
|
||||
// complete(this.taskForm).then(response => {
|
||||
// this.$modal.msgSuccess(response.msg);
|
||||
// this.goBack();
|
||||
// });
|
||||
this.completeOpen = true;
|
||||
this.completeTitle = "流程审批";
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue