管理后台初始化,登录,团队管理,报价单管理 完成
This commit is contained in:
18
src/components/common/BaseTable.jsx
Normal file
18
src/components/common/BaseTable.jsx
Normal 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}
|
||||
/>
|
||||
);
|
||||
26
src/components/common/ColorIcon.jsx
Normal file
26
src/components/common/ColorIcon.jsx
Normal 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>
|
||||
);
|
||||
};
|
||||
|
||||
17
src/components/common/Icon.jsx
Normal file
17
src/components/common/Icon.jsx
Normal 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>
|
||||
);
|
||||
21
src/components/common/Logo.jsx
Normal file
21
src/components/common/Logo.jsx
Normal 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>
|
||||
);
|
||||
19
src/components/common/MenuTrigger.jsx
Normal file
19
src/components/common/MenuTrigger.jsx
Normal 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'
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
14
src/components/common/PageHeader.jsx
Normal file
14
src/components/common/PageHeader.jsx
Normal 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>
|
||||
);
|
||||
Reference in New Issue
Block a user