feat: add layout and org
This commit is contained in:
@@ -4,7 +4,7 @@ import { useUserStore } from '../store';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { Form } from 'antd';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { EditOutlined, SettingOutlined, LinkOutlined, SaveOutlined, DeleteOutlined, LeftOutlined } from '@ant-design/icons';
|
||||
import { EditOutlined, SettingOutlined, LinkOutlined, SaveOutlined, DeleteOutlined, LeftOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import clsx from 'clsx';
|
||||
import { isObjectNull } from '@/utils/is-null';
|
||||
import { CardBlank } from '@/components/card/CardBlank';
|
||||
@@ -106,7 +106,10 @@ export const List = () => {
|
||||
userStore.setShowEdit(true);
|
||||
};
|
||||
return (
|
||||
<div className='w-full h-full flex flex-col'>
|
||||
<div className='w-full h-full flex'>
|
||||
<div className='p-2'>
|
||||
<Button onClick={onAdd} icon={<PlusOutlined />}></Button>
|
||||
</div>
|
||||
<div className='flex flex-grow overflow-hidden h-full'>
|
||||
<div className='flex-grow overflow-auto scrollbar bg-gray-100'>
|
||||
<div className='flex flex-wrap gap-x-10 gap-y-4 rounded pt-10 justify-center'>
|
||||
|
||||
@@ -1,46 +1,4 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { Button } from 'antd';
|
||||
import { Outlet, useLocation } from 'react-router';
|
||||
import { useUserStore } from '../store';
|
||||
import { useEffect } from 'react';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
|
||||
import { LayoutMain } from '@/modules/layout';
|
||||
export const Main = () => {
|
||||
const containerStore = useUserStore(
|
||||
useShallow((state) => {
|
||||
return {
|
||||
setFormData: state.setFormData,
|
||||
setShowEdit: state.setShowEdit,
|
||||
};
|
||||
}),
|
||||
);
|
||||
const location = useLocation();
|
||||
const isEdit = location.pathname.includes('edit/list');
|
||||
return (
|
||||
<div className='flex w-full h-full flex-col'>
|
||||
<div className='layout-menu'>
|
||||
User
|
||||
<Button
|
||||
className={!isEdit ? 'hidden' : 'hidden'}
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
console.log('add');
|
||||
containerStore.setFormData({});
|
||||
containerStore.setShowEdit(true);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className='flex'
|
||||
style={{
|
||||
height: 'calc(100vh - 3rem)',
|
||||
}}>
|
||||
<div className='flex-grow overflow-hidden'>
|
||||
<div className='w-full h-full rounded-lg'>
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return <LayoutMain title='User' />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user