generated from template/vite-react-template
	feat: update new feature temp for panel
This commit is contained in:
		@@ -195,7 +195,7 @@ export const ContextMenu: React.FC<ContextMenuProps> = ({ x, y, onClose }) => {
 | 
			
		||||
        backgroundColor: 'white',
 | 
			
		||||
        border: '1px solid #ccc',
 | 
			
		||||
        width: 200,
 | 
			
		||||
        zIndex: 1000,
 | 
			
		||||
        zIndex: 100,
 | 
			
		||||
      }}
 | 
			
		||||
      onMouseLeave={onClose}>
 | 
			
		||||
      {menuList.map((item) => (
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import { getNodeData, useWallStore } from '../store/wall';
 | 
			
		||||
import { useReactFlow, useStore } from '@xyflow/react';
 | 
			
		||||
import { useUserWallStore, Wall } from '../store/user-wall';
 | 
			
		||||
import { message } from '@/modules/message';
 | 
			
		||||
import { useNavigate } from 'react-router-dom';
 | 
			
		||||
// import { useNavigate } from 'react-router-dom';
 | 
			
		||||
import { WallData } from './CustomNode';
 | 
			
		||||
 | 
			
		||||
function FormDialog({ open, handleClose, handleSubmit, initialData }) {
 | 
			
		||||
@@ -93,7 +93,7 @@ export const SaveModal = () => {
 | 
			
		||||
  const userWallStore = useUserWallStore(useShallow((state) => state));
 | 
			
		||||
  const { showFormDialog, setShowFormDialog, formDialogData, setFormDialogData } = wallStore;
 | 
			
		||||
  const reactFlowInstance = useReactFlow();
 | 
			
		||||
  const navigate = useNavigate();
 | 
			
		||||
  // const navigate = useNavigate();
 | 
			
		||||
  const { id } = wallStore;
 | 
			
		||||
  const onSubmit = async (values) => {
 | 
			
		||||
    const nodes = reactFlowInstance.getNodes();
 | 
			
		||||
@@ -122,7 +122,7 @@ export const SaveModal = () => {
 | 
			
		||||
        message.info('redirect to edit page');
 | 
			
		||||
        wallStore.clear();
 | 
			
		||||
        setTimeout(() => {
 | 
			
		||||
          navigate(`/edit/${data.id}`);
 | 
			
		||||
          // navigate(`/edit/${data.id}`);
 | 
			
		||||
        }, 2000);
 | 
			
		||||
      } else {
 | 
			
		||||
        // 编辑
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import { useUserWallStore } from '../../store/user-wall';
 | 
			
		||||
import { redirectToLogin } from '@/modules/require-to-login';
 | 
			
		||||
import { useStore } from '@xyflow/react';
 | 
			
		||||
import { message } from '@/modules/message';
 | 
			
		||||
import { useNavigate } from 'react-router-dom';
 | 
			
		||||
import { ClickAwayListener } from '@mui/material';
 | 
			
		||||
export const ToolbarItem = ({
 | 
			
		||||
  children,
 | 
			
		||||
@@ -68,7 +67,6 @@ export const ToolbarContent = ({ open }) => {
 | 
			
		||||
  const userWallStore = useUserWallStore(useShallow((state) => state));
 | 
			
		||||
  const store = useStore((state) => state);
 | 
			
		||||
  const hasLogin = !!userWallStore.user;
 | 
			
		||||
  const navigate = useNavigate();
 | 
			
		||||
 | 
			
		||||
  const menuList: MenuItem[] = [
 | 
			
		||||
    {
 | 
			
		||||
@@ -149,7 +147,7 @@ export const ToolbarContent = ({ open }) => {
 | 
			
		||||
      key: 'myWall',
 | 
			
		||||
      icon: <BrickWall />,
 | 
			
		||||
      onClick: () => {
 | 
			
		||||
        navigate('/list');
 | 
			
		||||
        //
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
@@ -170,7 +168,7 @@ export const ToolbarContent = ({ open }) => {
 | 
			
		||||
        onClick: async () => {
 | 
			
		||||
          const res = await userWallStore.deleteWall(wallStore.id!);
 | 
			
		||||
          if (res.code === 200) {
 | 
			
		||||
            navigate('/');
 | 
			
		||||
            // navigate('/');
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
@@ -212,7 +210,7 @@ export const ToolbarContent = ({ open }) => {
 | 
			
		||||
        key: 'add',
 | 
			
		||||
        icon: <Plus />,
 | 
			
		||||
        onClick: () => {
 | 
			
		||||
          navigate(`/`);
 | 
			
		||||
          // navigate(`/`);
 | 
			
		||||
          wallStore.clearQueryWall();
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
@@ -226,7 +224,7 @@ export const ToolbarContent = ({ open }) => {
 | 
			
		||||
          if (res.code === 200) {
 | 
			
		||||
            message.success('删除成功,返回首页');
 | 
			
		||||
            wallStore.clearQueryWall();
 | 
			
		||||
            navigate('/');
 | 
			
		||||
            // navigate('/');
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user