From 099b979ce788d5a4320c52480060c3a1fa8fb25c Mon Sep 17 00:00:00 2001 From: dengqichen Date: Sat, 25 Oct 2025 01:56:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A1=E6=89=B9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/domain/dataSource/presets/deploy.ts | 8 +- .../components/StartWorkflowModal.tsx | 137 +++++++++++------- 2 files changed, 90 insertions(+), 55 deletions(-) diff --git a/frontend/src/domain/dataSource/presets/deploy.ts b/frontend/src/domain/dataSource/presets/deploy.ts index 8d716ff7..22d4408e 100644 --- a/frontend/src/domain/dataSource/presets/deploy.ts +++ b/frontend/src/domain/dataSource/presets/deploy.ts @@ -44,11 +44,11 @@ export const applicationsConfig: DataSourceConfig = { params: { enabled: true }, transform: (data: any[]) => { return data.map((item: any) => ({ - label: item.name, - value: item.id, - code: item.code, + label: item.appName, // ✅ 修正:使用 appName + value: item.appCode, + code: item.appCode, // ✅ 修正:使用 appCode projectGroupId: item.projectGroupId, - description: item.description + description: item.appDesc || item.description // ✅ 修正:使用 appDesc })); } }; diff --git a/frontend/src/pages/Workflow/Definition/components/StartWorkflowModal.tsx b/frontend/src/pages/Workflow/Definition/components/StartWorkflowModal.tsx index ff049ff2..df68999b 100644 --- a/frontend/src/pages/Workflow/Definition/components/StartWorkflowModal.tsx +++ b/frontend/src/pages/Workflow/Definition/components/StartWorkflowModal.tsx @@ -6,6 +6,18 @@ import React, { useRef, useState } from 'react'; import { Modal } from 'antd'; import { Button } from '@/components/ui/button'; +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogPortal, + AlertDialogOverlay, +} from '@/components/ui/alert-dialog'; import { FormRenderer, type FormRendererRef } from '@/components/FormDesigner'; import type { FormDefinitionResponse } from '@/pages/Form/Definition/types'; import type { WorkflowDefinition } from '../types'; @@ -32,6 +44,7 @@ const StartWorkflowModal: React.FC = ({ }) => { const formRef = useRef(null); const [loading, setLoading] = useState(false); + const [showCancelConfirm, setShowCancelConfirm] = useState(false); // 处理提交 const handleSubmit = async (formData: Record) => { @@ -58,14 +71,14 @@ const StartWorkflowModal: React.FC = ({ // 处理取消 const handleCancel = () => { - Modal.confirm({ - title: '确认取消', - content: '工作流将不会启动,确定要取消吗?', - onOk: () => { - formRef.current?.reset(); - onClose(); - }, - }); + setShowCancelConfirm(true); + }; + + // 确认取消 + const confirmCancel = () => { + formRef.current?.reset(); + setShowCancelConfirm(false); + onClose(); }; // 处理表单提交触发 @@ -87,50 +100,72 @@ const StartWorkflowModal: React.FC = ({ const { schema } = formDefinition; return ( - formRef.current?.reset()}> - 重置 - , - , - , - ]} - destroyOnClose - > - + <> + + + + + + } + destroyOnClose + > + - {/* 表单元信息 */} -
-
工作流标识:{workflowDefinition.key}
-
工作流版本:v{workflowDefinition.flowVersion}
-
表单标识:{formDefinition.key}
-
表单版本:v{formDefinition.formVersion}
-
-
+ {/* 表单元信息 */} +
+
工作流标识:{workflowDefinition.key}
+
工作流版本:v{workflowDefinition.flowVersion}
+
表单标识:{formDefinition.key}
+
表单版本:v{formDefinition.formVersion}
+
+
+ + {/* 取消确认对话框 - 设置更高的 z-index 确保在 Modal 之上 */} + + + + + + 确认取消 + + 工作流将不会启动,确定要取消吗? + + + + setShowCancelConfirm(false)}>返回 + 确定取消 + + + + + ); };