diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts index 17b232fb5..d48253c3a 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts @@ -1,5 +1,24 @@ import request from '@/config/axios' +export type Task = { + id: string + name: string +} +export type ProcessInstanceVO = { + id: number + name: string + processDefinitionId: string + category: string + result: number + tasks: Task[] + fields: string[] + status: number + remark: string + businessKey: string + createTime: string + endTime: string +} + export const getMyProcessInstancePageApi = async (params) => { return await request.get({ url: '/bpm/process-instance/my-page', params }) } diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts deleted file mode 100644 index 3ab506389..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type task = { - id: string - name: string -} -export type ProcessInstanceVO = { - id: number - name: string - processDefinitionId: string - category: string - result: number - tasks: task[] - fields: string[] - status: number - remark: string - businessKey: string - createTime: string - endTime: string -} diff --git a/yudao-ui-admin-vue3/src/utils/formCreate.ts b/yudao-ui-admin-vue3/src/utils/formCreate.ts index e70ae39e9..fccc0dc75 100644 --- a/yudao-ui-admin-vue3/src/utils/formCreate.ts +++ b/yudao-ui-admin-vue3/src/utils/formCreate.ts @@ -37,9 +37,18 @@ export const setConfAndFields = (designerRef: object, conf: string, fields: stri } // 设置表单的 Conf 和 Fields -export const setConfAndFields2 = (detailPreview: object, conf: string, fields: string) => { +export const setConfAndFields2 = ( + detailPreview: object, + conf: string, + fields: string, + value: object +) => { // @ts-ignore detailPreview.value.option = JSON.parse(conf) // @ts-ignore detailPreview.value.rule = decodeFields(fields) + if (value) { + // @ts-ignore + detailPreview.value.value = value + } } diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue index 787709cb4..555920b95 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue @@ -9,9 +9,12 @@ -
- -
+
@@ -40,6 +43,15 @@ const processInstanceLoading = ref(false) // 流程实例的加载中 const processInstance = ref({}) // 流程实例 // ========== 申请信息 ========== +import { setConfAndFields2 } from '@/utils/formCreate' +import { ApiAttrs } from '@form-create/element-ui/types/config' +const fApi = ref() +// 流程表单详情 +const detailForm = ref({ + rule: [], + option: {}, + value: {} +}) // ========== 初始化 ========== onMounted(() => { @@ -53,7 +65,20 @@ onMounted(() => { } processInstance.value = data - // TODO 设置表单信息 + // 设置表单信息 + const processDefinition = data.processDefinition + if (processDefinition.formType === 10) { + setConfAndFields2( + detailForm, + processDefinition.formConf, + processDefinition.formFields, + data.formVariables + ) + nextTick().then(() => { + fApi.value.btn.show(false) + fApi.value.resetBtn.show(false) + }) + } // TODO 加载流程图 diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue index ac639c4cf..c648318e7 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue @@ -67,7 +67,7 @@ const handleDetail = (row) => { router.push({ name: 'BpmProcessInstanceDetail', query: { - id: row.processInstanceId + id: row.id } }) }