diff --git a/src/api/workflow/processDefinition/index.ts b/src/api/workflow/processDefinition/index.ts index f35069a..10d7478 100644 --- a/src/api/workflow/processDefinition/index.ts +++ b/src/api/workflow/processDefinition/index.ts @@ -3,7 +3,7 @@ const baseUrl = import.meta.env.VITE_APP_BASE_API; import { getToken } from '@/utils/auth'; /** - * 获取审批记录 + * 获取流程定义列表 * @param processInstanceId 流程实例id * @returns */ @@ -14,12 +14,30 @@ export const listProcessDefinition = (query: object) => { params: query }); }; +/** + * 按照流程定义key获取流程定义 + * @param processInstanceId 流程实例id + * @returns + */ +export const getProcessDefinitionListByKey = (key: string) => { + return request({ + url: `/workflow/processDefinition/getProcessDefinitionListByKey/${key}`, + method: 'get' + }); +}; /** * 通过流程定义id获取流程图 */ export const processDefinitionImage = (processDefinitionId: string) => { - return baseUrl + `/workflow/processDefinition/processDefinitionImage/${processDefinitionId}` + '?Authorization=Bearer ' + getToken() + '&t' + Math.random() + return ( + baseUrl + + `/workflow/processDefinition/processDefinitionImage/${processDefinitionId}` + + '?Authorization=Bearer ' + + getToken() + + '&t' + + Math.random() + ); }; /** @@ -80,7 +98,5 @@ export function deployProcessFile(data: any) { url: '/workflow/processDefinition/deployByFile', method: 'post', data: data - }) + }); } - - diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 7a9c8d2..698fed9 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -94,6 +94,11 @@ 转换模型 + + + 历史版本 + + @@ -120,6 +125,55 @@
PS:如若部署请部署从本项目模型管理导出的数据
+ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -131,7 +185,8 @@ import { deleteProcessDefinition, updateProcessDefState, convertToModel, - deployProcessFile + deployProcessFile, + getProcessDefinitionListByKey } from '@/api/workflow/processDefinition'; import { ComponentInternalInstance } from 'vue'; import ProcessPreview from './components/processPreview.vue'; @@ -156,23 +211,24 @@ const single = ref(true); const multiple = ref(true); const showSearch = ref(true); const total = ref(0); -const processDefinitionList = ref>([]); +const processDefinitionList = ref>([]); +const processDefinitionHistoryList = ref>([]); const url = ref>([]); const type = ref(''); const categoryOptions = ref([]); const categoryName = ref(''); const categoryTreeRef = ref(ElTree); -const dialog = reactive({ - visible: false, - title: '启动' -}); - const uploadDialog = reactive({ visible: false, title: '部署流程文件' }); +const processDefinitionDialog = reactive({ + visible: false, + title: '历史版本' +}); + // 查询参数 const queryParams = ref>({ pageNum: 1, @@ -182,12 +238,6 @@ const queryParams = ref>({ categoryCode: undefined }); -const submitFormData = ref>({ - businessKey: '', - processKey: '', - variables: {} -}); - onMounted(() => { getList(); getTreeselect(); @@ -253,6 +303,18 @@ const getList = () => { loading.value = false; }); }; +//获取历史流程定义 +const getProcessDefinitionHitoryList = (id:string,key:string) => { + processDefinitionDialog.visible = true + loading.value = true; + getProcessDefinitionListByKey(key).then((resp) => { + if(resp.data && resp.data.length > 0){ + processDefinitionHistoryList.value = resp.data.filter((item:any)=>item.id !== id); + } + loading.value = false; + }); +}; + //预览图片 const clickPreviewImg = (id: string) => { if (previewRef.value) {