import {Card, Avatar, List, Badge, Tag, Divider, Typography, Space, Empty} from 'antd'; import { ProjectOutlined, TeamOutlined, BellOutlined, ClockCircleOutlined, MailOutlined, PhoneOutlined, EnvironmentOutlined, LinkOutlined, SmileOutlined, AppstoreOutlined, ShopOutlined, FileTextOutlined, } from '@ant-design/icons'; import { useTranslation } from 'react-i18next'; import useAuthStore from "@/stores/user"; import type {ReactNode} from "react"; const { Meta } = Card; const { Text, Title } = Typography; interface AppType { id: number; name: string; description: string; icon: ReactNode; badge?: string; color: string; } const PersonalCenter = () => { const { t } = useTranslation(); // 用户信息数据 const userInfo = useAuthStore(state => state.userinfo); if (! userInfo ) return <>; // 标签页列表数据 const tabList = [ { key: "projects", label: <> {t('dashboard.workplace.myProjects')} , }, { key: "teams", label: <> {t('dashboard.workplace.myTeams')} , }, { key: "activities", label: <> {t('dashboard.workplace.latestActivities')} , }, { key: "notifications", label: ( {t('dashboard.workplace.notifications')} ) }, ] // 我的项目数据 const projects = [ { id: 1, name: t('dashboard.workplace.project1.name'), description: t('dashboard.workplace.project1.desc'), status: t('dashboard.workplace.status.inProgress'), progress: 65, members: 5, }, { id: 2, name: t('dashboard.workplace.project2.name'), description: t('dashboard.workplace.project2.desc'), status: t('dashboard.workplace.status.completed'), progress: 100, members: 3, }, { id: 3, name: t('dashboard.workplace.project3.name'), description: t('dashboard.workplace.project3.desc'), status: t('dashboard.workplace.status.planning'), progress: 10, members: 2, }, { id: 4, name: t('dashboard.workplace.project4.name'), description: t('dashboard.workplace.project4.desc'), status: '2023-06-10', progress: 10, members: 2, }, { id: 5, name: t('dashboard.workplace.project5.name'), description: t('dashboard.workplace.project5.desc'), status: '2023-06-08', progress: 15, members: 5, }, { id: 6, name: t('dashboard.workplace.project6.name'), description: t('dashboard.workplace.project6.desc'), status: '2023-06-05', progress: 60, members: 3, }, ]; // APP 应用列表 const apps: AppType[] = [ { id: 1, name: t('dashboard.workplace.appStore'), icon: , description: t('dashboard.workplace.appStore.desc'), badge: t('dashboard.workplace.badge.new'), color: '#1890ff', }, { id: 2, name: t('dashboard.workplace.mallSystem'), icon: , description: t('dashboard.workplace.mallSystem.desc'), color: '#52c41a', }, { id: 3, name: t('dashboard.workplace.collaboration'), icon: , description: t('dashboard.workplace.collaboration.desc'), color: '#faad14', }, { id: 4, name: t('dashboard.workplace.docCenter'), icon: , description: t('dashboard.workplace.docCenter.desc'), color: '#13c2c2', } ]; // 获取当前时间问候语 const getGreeting = () => { const hour = new Date().getHours(); if (hour < 12) return t('dashboard.workplace.greeting.morning'); if (hour < 18) return t('dashboard.workplace.greeting.afternoon'); return t('dashboard.workplace.greeting.evening'); }; // APP 应用卡片 const AppCard = (props: {app: AppType}) => ( } > {props.app.name}} description={props.app.description} /> ) return (
{/* 左侧布局显示内容 */}
} className="border-2 border-white shadow" />
{getGreeting()},{userInfo.nickname},{t('dashboard.workplace.welcome')}
{t('dashboard.workplace.today')} {new Date().toLocaleDateString('zh-CN', { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' })}
{apps.map((app) => (
{ app.badge ? : }
))}
( } />} title={{item.name}} description={item.description} />
{item.status}
{t('dashboard.workplace.progress')}: {item.progress}% {t('dashboard.workplace.members')}: {item.members}{t('dashboard.workplace.people')}
)} />
{/* 右侧布局显示内容 */}

{userInfo.nickname}

{userInfo.dept_name}

hello

{userInfo.email}
{userInfo.mobile}
{t('dashboard.workplace.location')}
); }; export default PersonalCenter;