diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index 127a64f..355afae 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -12,7 +12,10 @@ @@ -84,16 +87,16 @@ const init = async (businessKey: string | number) => { imgUrl.value = 'data:image/gif;base64,' + resp.data.image; if (historyList.value.length > 0) { historyList.value.forEach((item) => { - if(item.ext){ + if (item.ext) { getIds(item.ext).then((res) => { item.attachmentList = res.data; }); - }else{ + } else { item.attachmentList = []; } }); } - console.log(historyList.value,"2222222"); + console.log(historyList.value, '2222222'); loading.value = false; } }); diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index 413b197..7f6228c 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -44,6 +44,17 @@ + + + + + + @@ -80,6 +91,23 @@ const options = [ label: '婚假' } ]; +const flowCodeOptions = [ + { + value: 'leave1', + label: '请假申请-普通' + }, + { + value: 'leave2', + label: '请假申请-排他网关' + } +]; + +const flowCode = ref(''); + +const dialogVisible = reactive({ + visible: false, + title: '流程定义' +}); //提交组件 const submitVerifyRef = ref>(); //审批记录组件 @@ -119,6 +147,11 @@ const data = reactive>({ } }); +const handleClose = () => { + dialogVisible.visible = false; + flowCode.value = ''; + buttonLoading.value = false; +}; const { form, rules } = toRefs(data); /** 表单重置 */ @@ -168,12 +201,21 @@ const submitForm = (status: string) => { res = await addLeave(form.value); } form.value = res.data; - if (status === '0') { + if (status === 'draft') { buttonLoading.value = false; proxy?.$modal.msgSuccess('暂存成功'); proxy.$tab.closePage(proxy.$route); proxy.$router.go(-1); } else { + if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') { + flowCode.value = flowCodeOptions[0].value; + dialogVisible.visible = true; + return; + } + //说明启动过先随意穿个参数 + if (flowCode.value === '' || flowCode.value === null) { + flowCode.value = 'xx'; + } await handleStartWorkFlow(res.data); } } @@ -183,10 +225,14 @@ const submitForm = (status: string) => { } }; +const submitFlow = async () => { + handleStartWorkFlow(form.value); + dialogVisible.visible = false; +}; //提交申请 const handleStartWorkFlow = async (data: LeaveVO) => { try { - submitFormData.value.flowCode = 'leaveFlow-serial1'; + submitFormData.value.flowCode = flowCode.value; submitFormData.value.businessKey = data.id; //流程变量 taskVariables.value = { diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 19d4f88..7f8cf33 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -50,6 +50,9 @@ 部署流程文件 + + 导出 + @@ -272,8 +275,7 @@ type CategoryOption = { const loading = ref(true); const ids = ref>([]); -const deploymentIds = ref>([]); -const keys = ref>([]); +const flowCodeList = ref>([]); const single = ref(true); const multiple = ref(true); const showSearch = ref(true); @@ -374,8 +376,7 @@ const resetQuery = () => { // 多选框选中数据 const handleSelectionChange = (selection: any) => { ids.value = selection.map((item: any) => item.id); - deploymentIds.value = selection.map((item: any) => item.deploymentId); - keys.value = selection.map((item: any) => item.key); + flowCodeList.value = selection.map((item: any) => item.flowCode); single.value = selection.length !== 1; multiple.value = !selection.length; }; @@ -410,7 +411,6 @@ const handleDelete = async (row?: FlowDefinitionVo) => { /** 发布流程定义 */ const handlePublish = async (row?: FlowDefinitionVo) => { - const id = row?.id || ids.value; await proxy?.$modal.confirm( '是否确认发布流程定义KEY为【' + row.flowCode + '】版本为【' + row.version + '】的数据项?,发布后会将已发布流程定义改为失效!' ); @@ -526,4 +526,9 @@ const handleCopyDef = async (row: FlowDefinitionVo) => { }); }); }; +//导出 +/** 导出按钮操作 */ +const handleExportDef = () => { + proxy?.download(`/workflow/definition/exportDef/${ids.value[0]}`, {}, `${flowCodeList.value[0]}.xml`); +};