From 5699236a311f20083310bbac724771e1811ec981 Mon Sep 17 00:00:00 2001 From: Je <967707@dms.yudean.com> Date: Sun, 26 Jan 2025 11:46:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E5=8F=91=E8=B5=B7=E5=AE=A1=E6=89=B9=E5=90=8E=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8E=9F=E8=8D=89=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/components/processTasks/DraftsV2.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/workflow/task/components/processTasks/DraftsV2.vue b/src/views/workflow/task/components/processTasks/DraftsV2.vue index 5ee58ba..0593587 100644 --- a/src/views/workflow/task/components/processTasks/DraftsV2.vue +++ b/src/views/workflow/task/components/processTasks/DraftsV2.vue @@ -15,11 +15,13 @@ import userTaskTable from './../../hooks/userTaskTable'; import LaunchProcess from './../LaunchProcess.vue'; import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { deleteDraft, getDraftInfo, getSchemaTask } from '/@/api/workflow/process'; -import { reactive } from 'vue'; +import { reactive, onMounted } from 'vue'; import { notification } from 'ant-design-vue'; import { TaskTypeUrl } from '/@/enums/workflowEnum'; import { useI18n } from '/@/hooks/web/useI18n'; import { useRouter } from 'vue-router'; +import useEventBus from '/@/hooks/event/useEventBus'; +const { bus, CREATE_FLOW } = useEventBus(); const { t } = useI18n(); const router = useRouter(); @@ -72,6 +74,10 @@ const [registerTable, { reload }] = useTable({ } }); +onMounted(() => { + bus.on(CREATE_FLOW, handleRefresh); +}); + function tableActions(record) { return [ { @@ -122,6 +128,11 @@ async function handleDelete(record) { } } catch (error) { } } + +function handleRefresh() { + reload(); +} + From ec6175753c9778c01915196c6bd35a3f0ce062a2 Mon Sep 17 00:00:00 2001 From: Je <967707@dms.yudean.com> Date: Sun, 26 Jan 2025 16:01:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E5=8F=91=E8=B5=B7=E5=AE=A1=E6=89=B9=E5=90=8E=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8E=9F=E8=8D=89=E7=A8=BF-=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/secondDev/createFlow.vue | 28 ++++++++++++++++++- .../task/components/processTasks/DraftsV2.vue | 5 +++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/views/secondDev/createFlow.vue b/src/views/secondDev/createFlow.vue index 44b9cd7..da93071 100644 --- a/src/views/secondDev/createFlow.vue +++ b/src/views/secondDev/createFlow.vue @@ -60,7 +60,7 @@ import { useMultipleTabStore } from '/@/store/modules/multipleTab'; import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue'; import { nextTick, onMounted, ref, toRaw, reactive } from 'vue'; - import { postDraft, putDraft } from '/@/api/workflow/process'; + import { deleteDraft, postDraft, putDraft } from '/@/api/workflow/process'; import { useI18n } from '/@/hooks/web/useI18n'; import { separator } from '/@bpmn/config/info'; import { message } from 'ant-design-vue'; @@ -250,12 +250,38 @@ isClose: true }); message.success('操作成功'); + if (rQuery?.createType === 'drafts') { + handleDelete(); + } setTimeout(() => { bus.emit(CREATE_FLOW, {}); close(); }, 500); } + async function handleDelete() { + try { + let res = await deleteDraft([rDraftsId]); + if (res) { + notification.open({ + type: 'success', + message: t('草稿删除'), + description: t('删除成功') + }); + setTimeout(() => { + bus.emit(CREATE_FLOW, {}); + close(); + }, 500); + } else { + notification.open({ + type: 'error', + message: t('草稿删除'), + description: t('删除失败') + }); + } + } catch (error) { } + } + function flowFail() { opinionDlg.value.stopLoading(); } diff --git a/src/views/workflow/task/components/processTasks/DraftsV2.vue b/src/views/workflow/task/components/processTasks/DraftsV2.vue index 0593587..47c66f9 100644 --- a/src/views/workflow/task/components/processTasks/DraftsV2.vue +++ b/src/views/workflow/task/components/processTasks/DraftsV2.vue @@ -104,7 +104,10 @@ async function handleEdit(record) { processData.visible = true;*/ localStorage.setItem('draftsJsonStr', res.formData); router.push({ - path: `/flow/${res.schemaId}/${record.id}/createFlow` + path: `/flow/${res.schemaId}/${record.id}/createFlow`, + query: { + createType: 'drafts' + } }); } catch (error) { } } From 414d3e229988442d755f1f6d319e7ffca4455e02 Mon Sep 17 00:00:00 2001 From: Je <967707@dms.yudean.com> Date: Sun, 26 Jan 2025 16:50:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E5=B7=B2=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E6=97=A0=E9=9C=80=E9=87=8D=E5=A4=8D=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=A1=A5=E5=85=85=E8=8D=89?= =?UTF-8?q?=E7=A8=BFID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/secondDev/createFlow.vue | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/views/secondDev/createFlow.vue b/src/views/secondDev/createFlow.vue index da93071..8919934 100644 --- a/src/views/secondDev/createFlow.vue +++ b/src/views/secondDev/createFlow.vue @@ -250,38 +250,12 @@ isClose: true }); message.success('操作成功'); - if (rQuery?.createType === 'drafts') { - handleDelete(); - } setTimeout(() => { bus.emit(CREATE_FLOW, {}); close(); }, 500); } - async function handleDelete() { - try { - let res = await deleteDraft([rDraftsId]); - if (res) { - notification.open({ - type: 'success', - message: t('草稿删除'), - description: t('删除成功') - }); - setTimeout(() => { - bus.emit(CREATE_FLOW, {}); - close(); - }, 500); - } else { - notification.open({ - type: 'error', - message: t('草稿删除'), - description: t('删除失败') - }); - } - } catch (error) { } - } - function flowFail() { opinionDlg.value.stopLoading(); } @@ -316,7 +290,8 @@ /*stampId: values.stampId, stampPassword: values.password,*/ isOldSystem: system, - nextTaskUser: approvalData.nextTaskUser + nextTaskUser: approvalData.nextTaskUser, + draftId: rDraftsId, }; }