|
@@ -31,7 +31,7 @@ import { ConnectorType } from "@/enum";
|
|
|
import { set, cloneDeep } from "lodash-es";
|
|
|
import FindReplaceModal from "@/components/FindReplaceModal";
|
|
|
import { useFindReplace } from "@/hooks/useFindReplace";
|
|
|
-import MermaidModal, { MermaidResult } from "./MermaidModal";
|
|
|
+import MermaidModal, { MermaidResult } from "@/components/ai/MermaidModal";
|
|
|
import { nodeMenu, edgeMenu } from "@/utils/contentMenu";
|
|
|
import BaseNode from "@/components/base";
|
|
|
import { Cell } from "@antv/x6";
|
|
@@ -43,6 +43,8 @@ export default function ToolBar() {
|
|
|
toggleFormatBrush,
|
|
|
enableFormatBrush,
|
|
|
pageState,
|
|
|
+ activeAIChat,
|
|
|
+ setActiveAIChat,
|
|
|
} = useModel("appModel");
|
|
|
const { canRedo, canUndo, onRedo, onUndo, selectedCell, graph } =
|
|
|
useModel("graphModel");
|
|
@@ -740,31 +742,15 @@ export default function ToolBar() {
|
|
|
</Tooltip>
|
|
|
</Dropdown>
|
|
|
|
|
|
- <Dropdown
|
|
|
- menu={{
|
|
|
- items: [
|
|
|
- {
|
|
|
- key: "mermaid",
|
|
|
- label: (
|
|
|
- <div>
|
|
|
- <i className="iconfont icon-Mermaid mr-8px" />
|
|
|
- Mermaid导入
|
|
|
- </div>
|
|
|
- ),
|
|
|
- onClick: () =>
|
|
|
- mermaidModelRef.current?.open()
|
|
|
- },
|
|
|
- ],
|
|
|
- }}
|
|
|
- >
|
|
|
+ <Tooltip title="Mermaid导入">
|
|
|
<Button
|
|
|
type="text"
|
|
|
className="w-50px"
|
|
|
+ onClick={() => mermaidModelRef.current?.open()}
|
|
|
>
|
|
|
- <i className="iconfont icon-ai"></i>
|
|
|
- <CaretDownOutlined className="text-12px" />
|
|
|
+ <i className="iconfont icon-Mermaid color-#ff356f"></i>
|
|
|
</Button>
|
|
|
- </Dropdown>
|
|
|
+ </Tooltip>
|
|
|
|
|
|
{/* <Dropdown menu={{ items: [] }}>
|
|
|
<Button type="text" className="w-50px">
|
|
@@ -788,6 +774,17 @@ export default function ToolBar() {
|
|
|
/>
|
|
|
<MermaidModal ref={mermaidModelRef} onChange={handleInsertMermaid}/>
|
|
|
<div>
|
|
|
+ <Tooltip placement="bottom" title="打开聊天">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-AI" />}
|
|
|
+ className={activeAIChat ? "active" : ""}
|
|
|
+ style={{marginRight: 16}}
|
|
|
+ onClick={() => {
|
|
|
+ setActiveAIChat(!activeAIChat);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
<Tooltip placement="bottom" title="替换">
|
|
|
<Button
|
|
|
type="text"
|