From 539cd7a9d839410fc1a0735a7ee2c49e848da9ad Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 13 Dec 2024 17:36:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Workflow/Definition/Design/index.tsx | 27 +++++++++++++------ .../src/pages/Workflow/Definition/index.tsx | 2 +- .../src/pages/Workflow/Definition/service.ts | 10 ++++++- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/Workflow/Definition/Design/index.tsx b/frontend/src/pages/Workflow/Definition/Design/index.tsx index 29f81897..726da214 100644 --- a/frontend/src/pages/Workflow/Definition/Design/index.tsx +++ b/frontend/src/pages/Workflow/Definition/Design/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState, useRef } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; -import { Button, Space, Card, Row, Col, message } from 'antd'; +import { Button, Space, Card, Row, Col, message, Modal } from 'antd'; import { ArrowLeftOutlined, SaveOutlined, PlayCircleOutlined } from '@ant-design/icons'; import { Graph, Cell } from '@antv/x6'; import { getDefinitionDetail, saveDefinition } from '../service'; @@ -257,7 +257,24 @@ const WorkflowDesign: React.FC = () => { // 调用保存接口 await saveDefinition(saveData); - message.success('流程保存成功'); + + // 使用 Modal.confirm 显示操作选择 + Modal.confirm({ + title: '保存成功', + content: '流程设计已保存成功,请选择下一步操作', + okText: '继续设计', + cancelText: '返回列表', + onOk: () => { + // 重新加载设计数据 + if (id) { + loadDefinitionDetail(graph, id); + } + }, + onCancel: () => { + // 返回列表页 + navigate('/workflow/definition'); + } + }); } catch (error) { console.error('保存流程失败:', error); message.error('保存流程失败'); @@ -277,12 +294,6 @@ const WorkflowDesign: React.FC = () => { > 保存 -