feat: 节点表单信息配置

rf
tony 2022-12-19 14:21:47 +08:00
parent 682592fcdf
commit 3a61651a98
10 changed files with 1248 additions and 1303 deletions

View File

@ -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);
}
/**
*
*/

View File

@ -26,6 +26,8 @@ public class FlowTaskListener implements TaskListener{
log.info("任务监听器:{}", JSON.toJSONString(delegateTask));
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
}
}

View File

@ -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) {

View File

@ -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 {

View File

@ -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
// }
]
}
}

View File

@ -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

View File

@ -10,9 +10,6 @@ export default {
assignee: true,
candidateUsers: true,
candidateGroups: true,
// assigneeFixed: true,
// candidateUsersFixed: true,
// candidateGroupsFixed: true,
async: true,
priority: true,
formKey: true,

View File

@ -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()

View File

@ -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 = "流程审批";
}
})
},