|
|
|
|
@ -30,11 +30,11 @@ export default { |
|
|
|
|
methods: { |
|
|
|
|
// 动态路由跳转
|
|
|
|
|
dynamicRoute(row, type) { |
|
|
|
|
const { id, taskId, processInstanceId, formKey, formUrl } = row |
|
|
|
|
const { id, taskId, processInstanceId, processId, formKey, formUrl } = row |
|
|
|
|
let param = Buffer.from(JSON.stringify({ |
|
|
|
|
processId: id, |
|
|
|
|
taskId, |
|
|
|
|
processInsId: processInstanceId |
|
|
|
|
processInsId: processInstanceId || processId |
|
|
|
|
})).toString('base64') |
|
|
|
|
|
|
|
|
|
if (formKey && formKey.startsWith('wf_ex_')) { |
|
|
|
|
@ -59,7 +59,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 根据可读可写,过滤avue column
|
|
|
|
|
filterAvueColumn(column, taskForm, props = { label: 'label', prop: 'prop' }) { |
|
|
|
|
if (!column || column.length == 0) return { column } |
|
|
|
|
if (!column || column.length == 0) return { column, vars: [] } |
|
|
|
|
|
|
|
|
|
const values = [] |
|
|
|
|
const vars = [] |
|
|
|
|
@ -97,6 +97,7 @@ export default { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
getFormByProcessId({ processId }).then(res => { |
|
|
|
|
const { process } = res.data.data |
|
|
|
|
process.hideComment = true |
|
|
|
|
this.process = process |
|
|
|
|
this.tag.label = '发起流程 - ' + process.name |
|
|
|
|
resolve(res.data.data) |
|
|
|
|
@ -110,6 +111,10 @@ export default { |
|
|
|
|
* @param form {"processId": "流程定义id", ...表单自定义字段变量} |
|
|
|
|
*/ |
|
|
|
|
handleStartProcess(form) { |
|
|
|
|
if (this.$refs.examineForm && this.$refs.examineForm.examineForm) { |
|
|
|
|
const { copyUser, assignee } = this.$refs.examineForm.examineForm |
|
|
|
|
form = { ...form, copyUser, assignee } |
|
|
|
|
} |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
startProcess(form).then(() => { |
|
|
|
|
resolve() |
|
|
|
|
@ -130,18 +135,9 @@ export default { |
|
|
|
|
const { process, form, flow, button } = res.data.data |
|
|
|
|
const { xml } = process |
|
|
|
|
|
|
|
|
|
const flows = [] |
|
|
|
|
flow.forEach(f => { |
|
|
|
|
const ff = { |
|
|
|
|
id: f.historyActivityId |
|
|
|
|
} |
|
|
|
|
if (f.historyActivityType == 'sequenceFlow') ff.class = "lineWarn" |
|
|
|
|
else ff.class = "nodeWarn" |
|
|
|
|
flows.push(ff) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const bpmnOption = { |
|
|
|
|
mode: 'view', xml, flows |
|
|
|
|
mode: 'view', xml,
|
|
|
|
|
flows: this.handleResolveFlows(flow) |
|
|
|
|
} |
|
|
|
|
this.process = process |
|
|
|
|
this.flow = flow |
|
|
|
|
@ -260,6 +256,55 @@ export default { |
|
|
|
|
handleCloseTag(path) { |
|
|
|
|
this.$store.commit('DEL_TAG', this.tag) |
|
|
|
|
if (path) this.$router.push(path) |
|
|
|
|
}, |
|
|
|
|
handleResolveFlows(flow) { |
|
|
|
|
const flows = [] |
|
|
|
|
flow.forEach(f => { |
|
|
|
|
const { assigneeName, createTime, comments } = f |
|
|
|
|
const ff = { |
|
|
|
|
id: f.historyActivityId, |
|
|
|
|
} |
|
|
|
|
let tooltip = '' |
|
|
|
|
if (assigneeName) { |
|
|
|
|
tooltip = `${assigneeName}<br><span title='${createTime}'>${createTime}</span><br>` |
|
|
|
|
|
|
|
|
|
if (comments && comments.length > 0) { |
|
|
|
|
let comment |
|
|
|
|
let { type, fullMessage } = comments[0] |
|
|
|
|
if (type == 'transferComment') { |
|
|
|
|
comment = '转办:' + fullMessage |
|
|
|
|
ff.class = 'nodeWarn' |
|
|
|
|
} |
|
|
|
|
if (type == 'delegateComment') { |
|
|
|
|
comment = '委托:' + fullMessage |
|
|
|
|
ff.class = 'nodeWarn' |
|
|
|
|
} |
|
|
|
|
if (type == 'rollbackComment') { |
|
|
|
|
comment = '驳回:' + fullMessage |
|
|
|
|
ff.class = 'nodeError' |
|
|
|
|
} |
|
|
|
|
if (type == 'terminateComment') { |
|
|
|
|
comment = '终止:' + fullMessage |
|
|
|
|
ff.class = 'nodeError' |
|
|
|
|
} |
|
|
|
|
if (type == 'comment') { |
|
|
|
|
comment = '审批:' + fullMessage |
|
|
|
|
ff.class = 'nodeSuccess' |
|
|
|
|
} |
|
|
|
|
tooltip += `<span title='${comment}'>${comment}</span>` |
|
|
|
|
} |
|
|
|
|
ff.tooltip = tooltip |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (f.historyActivityType == 'sequenceFlow') ff.class = 'lineWarn' |
|
|
|
|
else { |
|
|
|
|
if (!ff.class) ff.class = 'nodeSuccess' |
|
|
|
|
} |
|
|
|
|
const index = flows.findIndex(fl => fl.id == f.historyActivityId) |
|
|
|
|
if (index != -1) flows.splice(index, 1, ff) |
|
|
|
|
else flows.push(ff) |
|
|
|
|
}) |
|
|
|
|
return flows |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |