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); 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)); log.info("任务监听器:{}", JSON.toJSONString(delegateTask));
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息 // TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
} }
} }

View File

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

View File

@ -25,7 +25,8 @@
<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 {

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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