From 65764a2cbca332b8ea9b33dea27a2b715dcc25fd Mon Sep 17 00:00:00 2001 From: ayou <550244300@qq.com> Date: Mon, 15 Sep 2025 23:22:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(FlowList):=20=E4=B8=BA=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=B7=BB=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=B9=B6=E6=94=B9=E8=BF=9B=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 Popconfirm 组件以防止误删流程,同时优化删除操作的错误提示 --- frontend/src/pages/FlowList.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/FlowList.tsx b/frontend/src/pages/FlowList.tsx index 5377d26..cc2d6bd 100644 --- a/frontend/src/pages/FlowList.tsx +++ b/frontend/src/pages/FlowList.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState } from 'react' -import { Button, Modal, Space, Table, message, Typography, Input, Form, Tooltip } from 'antd' +import { Button, Modal, Space, Table, message, Typography, Input, Form, Tooltip, Popconfirm } from 'antd' import { PlusOutlined, ReloadOutlined, DeleteOutlined, EditOutlined, EyeOutlined } from '@ant-design/icons' import { useNavigate } from 'react-router-dom' import api, { type ApiResp } from '../utils/axios' @@ -141,7 +141,12 @@ export default function FlowList() { - + onDelete(row)}> + + + 删除 + + ) @@ -182,8 +187,10 @@ export default function FlowList() { try { const { data } = await api.delete>(`/flows/${row.id}`) if (data?.code === 0) { - message.success('已删除') + message.success('删除成功') fetchList(page, pageSize, keyword) + } else { + throw new Error(data?.message || '删除失败') } } catch (e: any) { message.error(e?.message || '删除失败')