From f049bd7530d9f9d9178e49462f9c9754e1a7cfe7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 16 Jan 2022 17:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=94=AF=E6=8C=81=E4=B8=9A=E5=8A=A1=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-ui/src/api/bpm/processInstance.js | 7 + yudao-admin-ui/src/api/bpm/task.js | 1 + .../src/views/bpm/processInstance/create.vue | 36 ++-- .../src/views/bpm/processInstance/detail.vue | 171 ++++++++++++++++++ .../src/views/bpm/processInstance/index.vue | 2 +- 5 files changed, 197 insertions(+), 20 deletions(-) create mode 100644 yudao-admin-ui/src/views/bpm/processInstance/detail.vue diff --git a/yudao-admin-ui/src/api/bpm/processInstance.js b/yudao-admin-ui/src/api/bpm/processInstance.js index 2340356f8..54feaedea 100644 --- a/yudao-admin-ui/src/api/bpm/processInstance.js +++ b/yudao-admin-ui/src/api/bpm/processInstance.js @@ -26,3 +26,10 @@ export function cancelProcessInstance(id, reason) { } }) } + +export function getMyProcessInstance(id) { + return request({ + url: '/bpm/process-instance/get?id=' + id, + method: 'get', + }) +} diff --git a/yudao-admin-ui/src/api/bpm/task.js b/yudao-admin-ui/src/api/bpm/task.js index 3b4dc305f..8a5704884 100644 --- a/yudao-admin-ui/src/api/bpm/task.js +++ b/yudao-admin-ui/src/api/bpm/task.js @@ -39,3 +39,4 @@ export function rejectTask(data) { data: data }) } + diff --git a/yudao-admin-ui/src/views/bpm/processInstance/create.vue b/yudao-admin-ui/src/views/bpm/processInstance/create.vue index d265bc9ee..1d3c09651 100644 --- a/yudao-admin-ui/src/views/bpm/processInstance/create.vue +++ b/yudao-admin-ui/src/views/bpm/processInstance/create.vue @@ -32,7 +32,7 @@
- {{ selectProcessInstance.name }} + 申请信息【{{ selectProcessInstance.name }}】 选择其它流程
@@ -58,10 +58,11 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {getForm} from "@/api/bpm/form"; import {decodeFields} from "@/utils/formGenerator"; import Parser from '@/components/parser/Parser' -import {createProcessInstance} from "@/api/bpm/processInstance"; +import {createProcessInstance, getMyProcessInstancePage} from "@/api/bpm/processInstance"; +// 流程实例的发起 export default { - name: "processDefinition", + name: "ProcessInstanceCreate", components: { Parser }, @@ -109,28 +110,25 @@ export default { }, /** 处理选择流程的按钮操作 **/ handleSelect(row) { - // 如果无表单,则无法发起流程 - if (!row.formId) { - this.$message.error('该流程未绑定表单,无法发起流程!请重新选择你要发起的流程'); - return; - } // 设置选择的流程 this.selectProcessInstance = row; - // 加载对应的表单 - getForm(row.formId).then(response => { - // 设置值 - const data = response.data + // 流程表单 + if (row.formId) { + // 设置对应的表单 this.detailForm = { - ...JSON.parse(data.conf), - fields: decodeFields(data.fields) + ...JSON.parse(row.formConf), + fields: decodeFields(row.formFields) } - }); - // 加载流程图 - getProcessDefinitionBpmnXML(row.id).then(response => { - this.bpmnXML = response.data - }) + // 加载流程图 + getProcessDefinitionBpmnXML(row.id).then(response => { + this.bpmnXML = response.data + }) + } else if (row.formCustomCreatePath) { + this.$router.push({ path: row.formCustomCreatePath}); + // 这里暂时无需加载流程图,因为跳出到另外个 Tab; + } }, /** 提交按钮 */ submitForm(params) { diff --git a/yudao-admin-ui/src/views/bpm/processInstance/detail.vue b/yudao-admin-ui/src/views/bpm/processInstance/detail.vue new file mode 100644 index 000000000..1365e57c4 --- /dev/null +++ b/yudao-admin-ui/src/views/bpm/processInstance/detail.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/yudao-admin-ui/src/views/bpm/processInstance/index.vue b/yudao-admin-ui/src/views/bpm/processInstance/index.vue index a339ffdb7..851ffec04 100644 --- a/yudao-admin-ui/src/views/bpm/processInstance/index.vue +++ b/yudao-admin-ui/src/views/bpm/processInstance/index.vue @@ -129,7 +129,7 @@ import { import {deleteErrorCode} from "@/api/system/errorCode"; export default { - name: "ProcessInstanceExt", + name: "ProcessInstance", components: { }, data() {