update: 优化关系图谱交互逻辑

This commit is contained in:
xiamuceer-j
2026-03-02 17:20:22 +08:00
parent 2625ebe869
commit 4af79e290b
3 changed files with 144 additions and 140 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import { Card, Table, Tag, Button, Space, message, Modal, Form, Select, Slider, Input, Tabs, AutoComplete, Descriptions, Divider } from 'antd';
import { useParams, useNavigate } from 'react-router-dom';
import { Card, Table, Tag, Button, Space, message, Modal, Form, Select, Slider, Input, Tabs, AutoComplete } from 'antd';
import { PlusOutlined, ApartmentOutlined, UserOutlined, EditOutlined } from '@ant-design/icons';
import { useStore } from '../store';
import axios from 'axios';
@@ -35,6 +35,7 @@ interface Character {
export default function Relationships() {
const { projectId } = useParams<{ projectId: string }>();
const { currentProject } = useStore();
const navigate = useNavigate();
const [relationships, setRelationships] = useState<Relationship[]>([]);
const [relationshipTypes, setRelationshipTypes] = useState<RelationshipType[]>([]);
const [characters, setCharacters] = useState<Character[]>([]);
@@ -320,7 +321,7 @@ export default function Relationships() {
extra={
<Space>
<Button
onClick={() => window.open(`/project/${projectId}/relationships-graph`, '_blank')}
onClick={() => projectId && navigate(`/project/${projectId}/relationships-graph`)}
size={isMobile ? 'small' : 'middle'}
>