管理后台初始化,登录,团队管理,报价单管理 完成

This commit is contained in:
‘Liammcl’
2024-12-15 17:39:58 +08:00
commit 5882bf9548
91 changed files with 16260 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import { Table } from 'antd';
export const BaseTable = ({
columns,
dataSource,
loading = false,
rowKey = 'id',
...props
}) => (
<Table
columns={columns}
dataSource={dataSource}
loading={loading}
rowKey={rowKey}
{...props}
/>
);

View File

@@ -0,0 +1,26 @@
import React from 'react';
import { useTheme } from '@/contexts/ThemeContext';
export const ColorIcon = ({ icon: Icon, background }) => {
const { isDarkMode } = useTheme();
return (
<div
className={`
inline-flex items-center justify-center
w-8 h-8 rounded-lg transition-all duration-300
${isDarkMode ? 'bg-opacity-25' : 'bg-opacity-15'}
hover:${isDarkMode ? 'bg-opacity-35' : 'bg-opacity-25'}
`}
style={{ backgroundColor: background }}
>
<span
className="text-base transition-colors duration-300"
style={{ color: background }}
>
{Icon}
</span>
</div>
);
};

View File

@@ -0,0 +1,17 @@
import React from 'react';
export const Icon = ({ name, className = '', style = {} }) => (
<span
className={`material-symbols-rounded ${className}`}
style={{
fontSize: '20px',
background: 'var(--primary-gradient)',
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontVariationSettings: "'FILL' 1, 'wght' 400, 'GRAD' 200, 'opsz' 20",
...style
}}
>
{name}
</span>
);

View File

@@ -0,0 +1,21 @@
import React from 'react';
export const Logo = ({ collapsed, isDarkMode }) => (
<div className="logo">
<div className="flex items-center justify-center gap-2">
<span className="material-symbols-rounded text-primary-500">
rocket_launch
</span>
<h1
style={{
color: isDarkMode ? '#fff' : '#000',
fontSize: collapsed ? '14px' : '18px',
margin: 0,
display: collapsed ? 'none' : 'block',
}}
>
Uppeta
</h1>
</div>
</div>
);

View File

@@ -0,0 +1,19 @@
import React from 'react';
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
export const MenuTrigger = ({ collapsed, setCollapsed, isDarkMode }) => {
const Icon = collapsed ? MenuUnfoldOutlined : MenuFoldOutlined;
return (
<Icon
className="trigger"
onClick={() => setCollapsed(!collapsed)}
style={{
fontSize: '18px',
padding: '0 24px',
cursor: 'pointer',
color: isDarkMode ? '#fff' : '#000'
}}
/>
);
};

View File

@@ -0,0 +1,14 @@
import React from 'react';
import { Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
export const PageHeader = ({ title, onAdd, addButtonText = '新增' }) => (
<div className="flex justify-between items-center mb-4">
<h1 className="text-2xl font-bold">{title}</h1>
{onAdd && (
<Button type="primary" icon={<PlusOutlined />} onClick={onAdd}>
{addButtonText}
</Button>
)}
</div>
);