diff --git a/src/pages/Setting/Flow/index.module.css b/src/pages/Setting/Flow/index.module.css index f59931a7ba2b51e19efc8ea42c130d56e8fc0f44..a8f76d9c4eb119efd5a4f354ec7b197d91553cf6 100644 --- a/src/pages/Setting/Flow/index.module.css +++ b/src/pages/Setting/Flow/index.module.css @@ -25,6 +25,16 @@ font-size: 20px; } +.tools { + position: absolute; + padding: 6px 10px; + z-index: 100; + background-color: #fff; + left: 16px; + top: 16px; + border-radius: 10px; +} + .lineNode { height: 120px; position: relative; diff --git a/src/pages/Setting/Flow/index.tsx b/src/pages/Setting/Flow/index.tsx index 0cf088a1f98f1a9db650ba682995566278a0b05b..0a282bfa8cd1d0a803fdb166280ac4bd0af3a3b6 100644 --- a/src/pages/Setting/Flow/index.tsx +++ b/src/pages/Setting/Flow/index.tsx @@ -1,4 +1,4 @@ -import { Button, Empty, message, notification } from "antd"; +import { Button, Empty, message, notification, Tooltip } from "antd"; import styles from "./index.module.css"; import { useEffect, useLayoutEffect, useRef, useState } from "react"; import { useFormContext } from ".."; @@ -34,6 +34,7 @@ import useGlobalData from "@/store/useGlobalData"; import X6ActionContext from "./X6ActionContext"; import BaseConditionNodeSetting from "./setting/baseConditionNodeSetting"; +import { ClearOutlined, RestFilled, RestOutlined } from "@ant-design/icons"; const X6ReactPortalProvider = Portal.getProvider(); @@ -123,7 +124,6 @@ const Flow = () => { setActionNode(startEvent?.data); renderGraph(); /** 居中内容 */ - graphRef.current?.centerPoint(0, 300); } }, [flowData]); @@ -132,7 +132,6 @@ const Flow = () => { const renderGraph = () => { const newX6Data = buildLineX6data(originalXNodesData.current); - console.log(newX6Data); setX6Data(newX6Data); }; @@ -674,9 +673,42 @@ const Flow = () => { originalXNodesData.current = cloneX6Data; renderGraph(); }; + const onReset = () => { + originalXNodesData.current = [ + { + id: "startEvent", + shape: "custom-activity-node", + y: 0, + data: { + ...getDefaultNodeByType(1), + pid: undefined, + }, + }, + { + id: "endEvent", + shape: "custom-end-node", + y: 300, + data: { + ...getDefaultNodeByType(), + pid: "startEvent", + }, + }, + ]; + setActionNode(undefined); + renderGraph(); + }; return (