feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { timestamp2string } from '../../helpers/utils';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -29,7 +30,7 @@ import {
|
||||
Empty,
|
||||
Spin,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
Wallet,
|
||||
Key,
|
||||
@@ -128,7 +129,7 @@ const isFeatureEnabled = (flags, key) => {
|
||||
|
||||
// 用量趋势小块:窗口标题 + 消耗 + 请求数
|
||||
const UsageBlock = ({ t, title, data }) => (
|
||||
<div className='flex-1 min-w-[140px] rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-card)] px-4 py-3'>
|
||||
<div className='org-workbench-usage-block'>
|
||||
<div className='text-xs font-medium text-gray-500 dark:text-gray-400 mb-1'>
|
||||
{title}
|
||||
</div>
|
||||
@@ -385,8 +386,11 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
summary?.member?.display_name || summary?.member?.username || '';
|
||||
|
||||
return (
|
||||
<div className='org-stagger p-4 sm:p-6 lg:p-8 space-y-5'>
|
||||
{/* 签名时刻:hero 问候区(每页至多一个签名渐变区,见方案 A+ 冲击力护栏) */}
|
||||
<div className='org-stagger org-workbench'>
|
||||
<Breadcrumb
|
||||
className='org-workbench-breadcrumb'
|
||||
items={[{ title: t('企业中心') }, { title: t('工作台') }]}
|
||||
/>
|
||||
<OrgHero
|
||||
eyebrow={`${getGreeting(t)}${memberName ? ',' + memberName : ''}`}
|
||||
title={summary?.organization?.name || t('企业工作台')}
|
||||
@@ -423,7 +427,7 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
/>
|
||||
|
||||
{/* 关键指标卡组 */}
|
||||
<div className='grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4'>
|
||||
<div className='org-workbench-stats'>
|
||||
<StatCard
|
||||
icon={Coins}
|
||||
label={quotaUsageLabel}
|
||||
@@ -451,8 +455,8 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
</div>
|
||||
|
||||
{/* 我的额度进度 + 我的令牌 */}
|
||||
<div className='grid grid-cols-1 md:grid-cols-3 gap-4'>
|
||||
<OrgPanel className='md:col-span-2'>
|
||||
<div className='org-workbench-middle'>
|
||||
<OrgPanel className='org-workbench-quota'>
|
||||
<div className='flex items-center gap-2 mb-3'>
|
||||
<Wallet size={18} className='text-brand-deep' />
|
||||
<Text strong>{t('我的额度')}</Text>
|
||||
@@ -462,7 +466,7 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
<Progress
|
||||
percent={quotaPercent}
|
||||
stroke={
|
||||
quotaPercent >= 90 ? 'var(--semi-color-danger)' : undefined
|
||||
quotaPercent >= 90 ? 'var(--ui-color-danger)' : undefined
|
||||
}
|
||||
style={{ marginBottom: 8 }}
|
||||
/>
|
||||
@@ -496,7 +500,7 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
</div>
|
||||
</OrgPanel>
|
||||
|
||||
<OrgPanel>
|
||||
<OrgPanel className='org-workbench-tokens'>
|
||||
<div className='flex items-center gap-2 mb-3'>
|
||||
<Key size={18} className='text-brand-deep' />
|
||||
<Text strong>{t('我的令牌')}</Text>
|
||||
@@ -515,12 +519,12 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
</div>
|
||||
|
||||
{/* 个人用量趋势 */}
|
||||
<OrgPanel>
|
||||
<OrgPanel className='org-workbench-usage'>
|
||||
<div className='flex items-center gap-2 mb-3'>
|
||||
<TrendingUp size={18} className='text-brand-deep' />
|
||||
<Text strong>{t('个人用量趋势')}</Text>
|
||||
</div>
|
||||
<div className='flex flex-wrap gap-4'>
|
||||
<div className='org-workbench-usage-grid'>
|
||||
<UsageBlock t={t} title={t('今日')} data={usage.today} />
|
||||
<UsageBlock t={t} title={t('近 7 天')} data={usage.last7d} />
|
||||
<UsageBlock t={t} title={t('近 30 天')} data={usage.last30d} />
|
||||
@@ -535,7 +539,7 @@ const OrgWorkbench = ({ orgId, orgRole, featureFlags }) => {
|
||||
<Text strong>{t('最近申请')}</Text>
|
||||
</div>
|
||||
{summary?.recent_requests?.length ? (
|
||||
<div className='flex flex-col divide-y divide-[var(--semi-color-border)]'>
|
||||
<div className='flex flex-col divide-y divide-[var(--ui-color-border)]'>
|
||||
{summary.recent_requests.map((r) => (
|
||||
<div
|
||||
key={r.id}
|
||||
|
||||
Reference in New Issue
Block a user