diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts index 80f122f..b949b51 100644 --- a/src/api/workflow/processInstance/index.ts +++ b/src/api/workflow/processInstance/index.ts @@ -29,33 +29,33 @@ export const getPageByFinish = (query: ProcessInstanceQuery): AxiosPromise { +export const getHistoryImage = (businessKey: string) => { return request({ - url: `/workflow/processInstance/getHistoryImage/${processInstanceId}` + '?t' + Math.random(), + url: `/workflow/processInstance/getHistoryImage/${businessKey}` + '?t' + Math.random(), method: 'get' }); }; /** - * 通过流程实例id获取历史流程图运行中,历史等节点 + * 通过业务id获取历史流程图运行中,历史等节点 */ -export const getHistoryList = (instanceId: string): AxiosPromise> => { +export const getHistoryList = (businessKey: string): AxiosPromise> => { return request({ - url: `/workflow/processInstance/getHistoryList/${instanceId}` + '?t' + Math.random(), + url: `/workflow/processInstance/getHistoryList/${businessKey}` + '?t' + Math.random(), method: 'get' }); }; /** * 获取审批记录 - * @param processInstanceId 流程实例id + * @param businessKey 业务id * @returns */ -export const getHistoryRecord = (processInstanceId: string) => { +export const getHistoryRecord = (businessKey: string) => { return request({ - url: `/workflow/processInstance/getHistoryRecord/${processInstanceId}`, + url: `/workflow/processInstance/getHistoryRecord/${businessKey}`, method: 'get' }); }; @@ -75,24 +75,24 @@ export const deleteRunInstance = (data: object) => { /** * 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息 - * @param processInstanceId 流程实例id + * @param businessKey 业务id * @returns */ -export const deleteRunAndHisInstance = (processInstanceId: string | string[]) => { +export const deleteRunAndHisInstance = (businessKey: string | string[]) => { return request({ - url: `/workflow/processInstance/deleteRunAndHisInstance/${processInstanceId}`, + url: `/workflow/processInstance/deleteRunAndHisInstance/${businessKey}`, method: 'delete' }); }; /** * 已完成的实例 删除程实例,删除历史记录,删除业务与流程关联信息 - * @param processInstanceId 流程实例id + * @param businessKey 业务id * @returns */ -export const deleteFinishAndHisInstance = (processInstanceId: string | string[]) => { +export const deleteFinishAndHisInstance = (businessKey: string | string[]) => { return request({ - url: `/workflow/processInstance/deleteFinishAndHisInstance/${processInstanceId}`, + url: `/workflow/processInstance/deleteFinishAndHisInstance/${businessKey}`, method: 'delete' }); }; @@ -112,12 +112,12 @@ export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise { +export const cancelProcessApply = (businessKey: string) => { return request({ - url: `/workflow/processInstance/cancelProcessApply/${processInstanceId}`, + url: `/workflow/processInstance/cancelProcessApply/${businessKey}`, method: 'post' }); }; diff --git a/src/components/BpmnView/index.vue b/src/components/BpmnView/index.vue index f07bc21..3d04246 100644 --- a/src/components/BpmnView/index.vue +++ b/src/components/BpmnView/index.vue @@ -51,7 +51,7 @@ const loading = ref(false); const bpmnVisible = ref(true); const historyList = ref([]); -const init = (instanceId) => { +const init = (businessKey) => { loading.value = true; bpmnVisible.value = true; nextTick(async () => { @@ -67,7 +67,7 @@ const init = (instanceId) => { MoveCanvasModule ] as ModuleDeclaration[] }); - const resp = await processApi.getHistoryList(instanceId); + const resp = await processApi.getHistoryList(businessKey); xml.value = resp.data.xml; taskList.value = resp.data.taskList; historyList.value = resp.data.historyList; diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index cbce87a..37667ca 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -67,17 +67,17 @@ const tabActiveName = ref('bpmn'); const bpmnViewRef = ref(); //初始化查询审批记录 -const init = async (instanceId: string) => { +const init = async (businessKey: string) => { visible.value = true; loading.value = true; tabActiveName.value = 'bpmn'; historyList.value = []; - processApi.getHistoryRecord(instanceId).then((resp) => { + processApi.getHistoryRecord(businessKey).then((resp) => { historyList.value = resp.data; loading.value = false; }); await nextTick(() => { - bpmnViewRef.value.init(instanceId); + bpmnViewRef.value.init(businessKey); }); }; diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index 23d5442..e47768d 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -93,7 +93,7 @@ size="small" type="primary" icon="Notification" - @click="handleCancelProcessApply(scope.row.processInstanceVo.id)" + @click="handleCancelProcessApply(scope.row.id)" >撤销 diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index e978ad8..b8742f7 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -243,7 +243,7 @@ const handleStartWorkFlow = async (data: LeaveVO) => { }; //审批记录 const handleApprovalRecord = () => { - approvalRecordRef.value.init(processInstanceId.value); + approvalRecordRef.value.init(form.value.id); }; //提交回调 const submitCallback = async () => { diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 4f994af..7c60880 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -167,6 +167,8 @@ const categoryTreeRef = ref(); const loading = ref(true); // 选中数组 const ids = ref>([]); +// 选中业务id数组 +const businessKeys = ref>([]); // 非单个禁用 const single = ref(true); // 非多个禁用 @@ -257,6 +259,7 @@ const resetQuery = () => { // 多选框选中数据 const handleSelectionChange = (selection: ProcessInstanceVO[]) => { ids.value = selection.map((item: any) => item.id); + businessKeys.value = selection.map((item: any) => item.businessKey); single.value = selection.length !== 1; multiple.value = !selection.length; }; @@ -281,14 +284,14 @@ const getProcessInstanceFinishList = () => { /** 删除按钮操作 */ const handleDelete = async (row: any) => { - const id = row.id || ids.value; - await proxy?.$modal.confirm('是否确认删除id为【' + id + '】的数据项?'); + const businessKey = row.businessKey || businessKeys.value; + await proxy?.$modal.confirm('是否确认删除业务id为【' + businessKey + '】的数据项?'); loading.value = true; if ('running' === tab.value) { - await deleteRunAndHisInstance(id).finally(() => (loading.value = false)); + await deleteRunAndHisInstance(businessKey).finally(() => (loading.value = false)); getProcessInstanceRunningList(); } else { - await deleteFinishAndHisInstance(id).finally(() => (loading.value = false)); + await deleteFinishAndHisInstance(businessKey).finally(() => (loading.value = false)); getProcessInstanceFinishList(); } proxy?.$modal.msgSuccess('删除成功'); @@ -308,7 +311,7 @@ const handleInvalid = async (row: ProcessInstanceVO) => { loading.value = true; if ('running' === tab.value) { let param = { - processInstanceId: row.id, + businessKey: row.businessKey, deleteReason: deleteReason.value }; await deleteRunInstance(param).finally(() => (loading.value = false));