From cd6d413f0890affb4d45957cb6c114f4955547e9 Mon Sep 17 00:00:00 2001
From: dap <15891557205@163.com>
Date: Thu, 16 Jan 2025 16:57:17 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=96=B0=E5=A2=9E=E5=90=8E?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=9C=AA=E5=8F=91=E5=B8=83=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/workflow/processDefinition/index.vue | 13 +++++++++++--
.../processDefinition/process-definition-modal.vue | 13 ++++++++-----
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/apps/web-antd/src/views/workflow/processDefinition/index.vue b/apps/web-antd/src/views/workflow/processDefinition/index.vue
index c0a6c583..1a51fddc 100644
--- a/apps/web-antd/src/views/workflow/processDefinition/index.vue
+++ b/apps/web-antd/src/views/workflow/processDefinition/index.vue
@@ -107,7 +107,7 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
// 左边的切换
const statusOptions = [
- { label: '全部流程', value: 1 },
+ { label: '已发布流程', value: 1 },
{ label: '未发布流程', value: 0 },
];
const currentStatus = ref(1);
@@ -246,11 +246,20 @@ function handleDeploy() {
deployModalApi.open();
}
+// 部署流程json
async function handleDeploySuccess() {
// 跳转到未发布
currentStatus.value = 0;
await tableApi.reload();
}
+
+// 新增完成需要跳转到未发布
+async function handleReload(type: 'add' | 'update') {
+ if (type === 'add') {
+ currentStatus.value = 0;
+ }
+ await tableApi.reload();
+}
@@ -358,7 +367,7 @@ async function handleDeploySuccess() {
- tableApi.reload()" />
+
diff --git a/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue b/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue
index 9c4d7bc7..22997090 100644
--- a/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue
+++ b/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue
@@ -15,7 +15,7 @@ import {
import { modalSchema } from './data';
-const emit = defineEmits<{ reload: [] }>();
+const emit = defineEmits<{ reload: [type: 'add' | 'update'] }>();
const isUpdate = ref(false);
const title = computed(() => {
@@ -96,10 +96,13 @@ async function handleConfirm() {
return;
}
const data = cloneDeep(await formApi.getValues());
- await (isUpdate.value
- ? workflowDefinitionUpdate(data)
- : workflowDefinitionAdd(data));
- emit('reload');
+ if (isUpdate.value) {
+ await workflowDefinitionUpdate(data);
+ emit('reload', 'update');
+ } else {
+ await workflowDefinitionAdd(data);
+ emit('reload', 'add');
+ }
await handleCancel();
} catch (error) {
console.error(error);