feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -22,10 +22,10 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
colorMode(容器上的 .dark/.light 类,与全局主题一致)。 */
|
||||
|
||||
.dept-flow-cinema {
|
||||
--dfc-glow: color-mix(in srgb, var(--semi-color-primary) 16%, transparent);
|
||||
--dfc-glow: color-mix(in srgb, var(--ui-color-primary) 16%, transparent);
|
||||
--dfc-glow-soft: color-mix(
|
||||
in srgb,
|
||||
var(--semi-color-primary) 9%,
|
||||
var(--ui-color-primary) 9%,
|
||||
transparent
|
||||
);
|
||||
/* 不支持 color-mix 的旧内核退化为纯渐变底 */
|
||||
@@ -47,7 +47,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
background: linear-gradient(180deg, #0b1020 0%, #0d1329 55%, #090e1c 100%);
|
||||
background: radial-gradient(
|
||||
1100px 520px at 50% -8%,
|
||||
color-mix(in srgb, var(--semi-color-primary) 24%, transparent),
|
||||
color-mix(in srgb, var(--ui-color-primary) 24%, transparent),
|
||||
transparent 62%
|
||||
),
|
||||
radial-gradient(
|
||||
@@ -84,18 +84,18 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
.dept-flow-cinema .react-flow__edge-path {
|
||||
stroke: color-mix(
|
||||
in srgb,
|
||||
var(--semi-color-primary) 55%,
|
||||
var(--ui-color-primary) 55%,
|
||||
rgba(148, 163, 184, 0.45)
|
||||
);
|
||||
filter: drop-shadow(0 0 3px var(--dfc-glow));
|
||||
}
|
||||
|
||||
.dept-flow-cinema .react-flow__edge.selected .react-flow__edge-path {
|
||||
stroke: var(--semi-color-primary);
|
||||
stroke: var(--ui-color-primary);
|
||||
}
|
||||
|
||||
.dept-flow-cinema .react-flow__connection-path {
|
||||
stroke: var(--semi-color-primary);
|
||||
stroke: var(--ui-color-primary);
|
||||
}
|
||||
|
||||
/* 缩放控件:磨玻璃 */
|
||||
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
Tag,
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
Plus,
|
||||
Pencil,
|
||||
@@ -150,19 +150,19 @@ const DeptNode = memo(({ data, selected }) => {
|
||||
<div
|
||||
className={`relative rounded-xl border bg-white/75 backdrop-blur-xl transition-all duration-150 dark:bg-[#0e1430]/65 ${
|
||||
selected
|
||||
? 'border-[var(--semi-color-primary)] shadow-lg ring-2 ring-[var(--semi-color-primary-light-default)]'
|
||||
: 'border-white/60 shadow-[0_10px_30px_-14px_rgba(15,23,42,0.35)] hover:border-[var(--semi-color-primary-light-active)] hover:shadow-lg dark:border-white/10'
|
||||
? 'border-[var(--ui-color-primary)] shadow-lg ring-2 ring-[var(--ui-color-primary-light-default)]'
|
||||
: 'border-white/60 shadow-[0_10px_30px_-14px_rgba(15,23,42,0.35)] hover:border-[var(--ui-color-primary-light-active)] hover:shadow-lg dark:border-white/10'
|
||||
} ${active ? '' : 'opacity-70'}`}
|
||||
style={{ width: NODE_WIDTH }}
|
||||
>
|
||||
{/* 根节点渐变顶条:一眼区分树的入口 */}
|
||||
{isRoot && (
|
||||
<div className='absolute inset-x-0 top-0 h-[3px] rounded-t-xl bg-gradient-to-r from-[var(--semi-color-primary)] to-[var(--semi-color-primary-light-active)]' />
|
||||
<div className='absolute inset-x-0 top-0 h-[3px] rounded-t-xl bg-gradient-to-r from-[var(--ui-color-primary)] to-[var(--ui-color-primary-light-active)]' />
|
||||
)}
|
||||
<Handle
|
||||
type='target'
|
||||
position={targetPos}
|
||||
className='!w-2.5 !h-2.5 !bg-[var(--semi-color-primary)] !border-2 !border-[var(--surface-card)]'
|
||||
className='!w-2.5 !h-2.5 !bg-[var(--ui-color-primary)] !border-2 !border-[var(--surface-card)]'
|
||||
/>
|
||||
<div className='px-3.5 pt-3'>
|
||||
<div className='flex items-center justify-between gap-2'>
|
||||
@@ -248,7 +248,7 @@ const DeptNode = memo(({ data, selected }) => {
|
||||
);
|
||||
const danger = pct >= 90;
|
||||
return (
|
||||
<div className='mt-2 rounded-md bg-[var(--semi-color-fill-0)] px-2 py-1'>
|
||||
<div className='mt-2 rounded-md bg-[var(--ui-color-fill-0)] px-2 py-1'>
|
||||
<div className='flex items-center justify-between gap-2 text-[11px] leading-4'>
|
||||
<span className='text-gray-500 dark:text-gray-400 flex-shrink-0'>
|
||||
{t('预算')} · {budgetInfo.label}
|
||||
@@ -256,7 +256,7 @@ const DeptNode = memo(({ data, selected }) => {
|
||||
<span
|
||||
className={
|
||||
danger
|
||||
? 'font-medium text-[var(--semi-color-danger)] truncate'
|
||||
? 'font-medium text-[var(--ui-color-danger)] truncate'
|
||||
: 'text-gray-600 dark:text-gray-300 truncate'
|
||||
}
|
||||
title={`${renderQuota(budgetInfo.used, 2)} / ${renderQuota(budgetInfo.cap, 2)}`}
|
||||
@@ -271,8 +271,8 @@ const DeptNode = memo(({ data, selected }) => {
|
||||
style={{
|
||||
width: `${pct}%`,
|
||||
background: danger
|
||||
? 'var(--semi-color-danger)'
|
||||
: 'var(--semi-color-primary)',
|
||||
? 'var(--ui-color-danger)'
|
||||
: 'var(--ui-color-primary)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -329,7 +329,7 @@ const DeptNode = memo(({ data, selected }) => {
|
||||
<Handle
|
||||
type='source'
|
||||
position={sourcePos}
|
||||
className='!w-2.5 !h-2.5 !bg-[var(--semi-color-primary)] !border-2 !border-[var(--surface-card)]'
|
||||
className='!w-2.5 !h-2.5 !bg-[var(--ui-color-primary)] !border-2 !border-[var(--surface-card)]'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -697,8 +697,8 @@ const FlowInner = ({
|
||||
nodeColor={(n) => {
|
||||
const dept = deptMap[parseInt(n.id, 10)];
|
||||
return dept && dept.status === 1
|
||||
? 'var(--semi-color-primary-light-active)'
|
||||
: 'var(--semi-color-fill-2)';
|
||||
? 'var(--ui-color-primary-light-active)'
|
||||
: 'var(--ui-color-fill-2)';
|
||||
}}
|
||||
maskColor={
|
||||
colorMode === 'dark'
|
||||
@@ -774,7 +774,7 @@ const FlowInner = ({
|
||||
return (
|
||||
<div
|
||||
key={m.user_id}
|
||||
className='flex items-center gap-3 rounded-lg px-2 py-1.5 hover:bg-[var(--semi-color-fill-0)]'
|
||||
className='flex items-center gap-3 rounded-lg px-2 py-1.5 hover:bg-[var(--ui-color-fill-0)]'
|
||||
>
|
||||
<Avatar size='extra-small' color='blue'>
|
||||
{name.slice(0, 1).toUpperCase()}
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TreeSelect } from '@douyinfe/semi-ui';
|
||||
import { TreeSelect } from '@/components/ui';
|
||||
import { buildDeptTreeData } from './deptTree';
|
||||
|
||||
// 部门树选择(受控):按组织架构展示层级,默认只允许选末级部门(成员主归属
|
||||
|
||||
@@ -26,10 +26,10 @@ import {
|
||||
Spin,
|
||||
Progress,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import OrgPanel from './OrgPanel';
|
||||
import { VChart } from '@visactor/react-vchart';
|
||||
import { initVChartSemiTheme } from '@visactor/vchart-semi-theme';
|
||||
import { initVChartTheme } from '@/components/ui/chartTheme';
|
||||
import {
|
||||
RefreshCw,
|
||||
PieChart,
|
||||
@@ -107,7 +107,7 @@ const DeltaBadge = ({ cur, prev, t }) => {
|
||||
<span
|
||||
className='text-xs font-medium'
|
||||
style={{
|
||||
color: up ? 'var(--semi-color-success)' : 'var(--semi-color-danger)',
|
||||
color: up ? 'var(--ui-color-success)' : 'var(--ui-color-danger)',
|
||||
}}
|
||||
>
|
||||
{up ? '▲' : '▼'} {Math.abs(pct).toFixed(1)}%
|
||||
@@ -117,7 +117,7 @@ const DeltaBadge = ({ cur, prev, t }) => {
|
||||
};
|
||||
|
||||
const KpiCard = ({ label, value, sub }) => (
|
||||
<div className='px-4 py-3 rounded-xl bg-[var(--semi-color-fill-0)]'>
|
||||
<div className='px-4 py-3 rounded-xl bg-[var(--ui-color-fill-0)]'>
|
||||
<div className='text-xs text-gray-500 mb-1'>{label}</div>
|
||||
<div className='text-lg font-semibold text-gray-900 dark:text-white truncate'>
|
||||
{value}
|
||||
@@ -191,7 +191,7 @@ const OrgAnalyticsPanel = ({ orgId }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
initVChartSemiTheme({ isWatchingThemeSwitch: true });
|
||||
initVChartTheme({ isWatchingThemeSwitch: true });
|
||||
}, []);
|
||||
|
||||
const dimensions = useMemo(
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Button, Input, Radio, RadioGroup } from '@douyinfe/semi-ui';
|
||||
import { Button, Input, Radio, RadioGroup } from '@/components/ui';
|
||||
import { Check, Image as ImageIcon, Palette, Type, UserRound } from 'lucide-react';
|
||||
import OrgPanel from './OrgPanel';
|
||||
import {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// 路径末段 → 侧栏菜单名;随角色变化的页面(审批中心/消耗明细等)不登记,由页头标题兜底。
|
||||
const orgPageTitles = {
|
||||
workbench: '工作台',
|
||||
'cloud-brain': '云端大脑',
|
||||
knowledge: '企业知识',
|
||||
'my-capabilities': '我的 AI 能力',
|
||||
'skill-center': '技能中心',
|
||||
'skill-assignments': '分发与锁定',
|
||||
experts: '企业专家工坊',
|
||||
connectors: 'Connector 管理',
|
||||
effectiveness: '效能分析',
|
||||
quality: '调用质量',
|
||||
'agent-audit': 'Agent 任务审计',
|
||||
dashboard: '数据看板',
|
||||
departments: '部门管理',
|
||||
'dept-manage': '部门管理',
|
||||
'project-manage': '我的项目',
|
||||
projects: '项目管理',
|
||||
budgets: '预算中心',
|
||||
tokens: '令牌管理',
|
||||
recharge: '企业充值',
|
||||
audit: '审计日志',
|
||||
'personal-settings': '个人设置',
|
||||
settings: '企业设置',
|
||||
};
|
||||
|
||||
/** 企业端统一面包屑:“企业中心 / 当前页面”,样式与用户中心一致。current 仅在路径未登记时兜底。 */
|
||||
export default function OrgBreadcrumb({ current }) {
|
||||
const { pathname } = useLocation();
|
||||
const { t } = useTranslation();
|
||||
const key = pathname.split('/').filter(Boolean)[1];
|
||||
const mapped = orgPageTitles[key];
|
||||
const title = mapped ? t(mapped) : current;
|
||||
if (!title) return null;
|
||||
return (
|
||||
<Breadcrumb
|
||||
className='ui-dashboard-breadcrumb ui-user-center-breadcrumb'
|
||||
items={[{ title: t('企业中心') }, { title }]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -19,11 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* 企业中心签名渐变区(方案 A+ 签名层的核心组件)。
|
||||
*
|
||||
* 冲击力护栏:每页至多使用一次;品牌渐变全部走 --brand-* token,
|
||||
* 随主题预设整套切换。亮色 = 品牌渐变实底;暗色 = midnight glow
|
||||
* (深底 + 渐变辉光边缘),两套模式各有性格。
|
||||
* 企业工作台横幅,背景与轮廓来自原型 .ew-hero。
|
||||
*
|
||||
* @param {React.ReactNode} eyebrow 顶部小字(如时段问候/版块名)
|
||||
* @param {React.ReactNode} title 大标题
|
||||
@@ -32,29 +28,29 @@ import React from 'react';
|
||||
* @param {React.ReactNode} [children] 底部扩展槽(如 KPI 行)
|
||||
* @param {string} [className]
|
||||
*/
|
||||
const OrgHero = ({ eyebrow, title, subtitle, actions, children, className = '' }) => (
|
||||
<div
|
||||
className={`relative overflow-hidden rounded-xl border border-brand/20 bg-gradient-to-br from-brand-from via-brand-via to-brand-to text-white shadow-[var(--elevation-md)] dark:border-white/10 dark:from-brand-via/30 dark:via-neutral-950 dark:to-neutral-950 ${className}`}
|
||||
>
|
||||
{/* 暗色 midnight glow:左上角品牌辉光,亮色下渐变实底本身就是签名,不再叠加 */}
|
||||
<div className='pointer-events-none absolute -left-16 -top-24 hidden h-56 w-56 rounded-full bg-brand-from/25 blur-3xl dark:block' />
|
||||
<div className='pointer-events-none absolute inset-x-0 top-0 hidden h-px bg-gradient-to-r from-transparent via-white/25 to-transparent dark:block' />
|
||||
|
||||
<div className='relative px-5 py-5 sm:px-6 sm:py-6'>
|
||||
<div className='flex items-start justify-between gap-4 flex-wrap'>
|
||||
const OrgHero = ({
|
||||
eyebrow,
|
||||
title,
|
||||
subtitle,
|
||||
actions,
|
||||
children,
|
||||
className = '',
|
||||
}) => (
|
||||
<div className={`org-workbench-hero ${className}`}>
|
||||
<div className='org-workbench-hero-art' aria-hidden='true'>
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
</div>
|
||||
<div className='org-workbench-hero-content'>
|
||||
<div className='org-workbench-hero-heading'>
|
||||
<div className='min-w-0'>
|
||||
{eyebrow && (
|
||||
<div className='mb-1 text-xs font-medium text-white/75 dark:text-brand-from/90'>
|
||||
{eyebrow}
|
||||
</div>
|
||||
<div className='org-workbench-hero-greeting'>{eyebrow}</div>
|
||||
)}
|
||||
<h1 className='text-xl sm:text-2xl font-bold tracking-tight truncate'>
|
||||
{title}
|
||||
</h1>
|
||||
<h1>{title}</h1>
|
||||
{subtitle && (
|
||||
<p className='mt-1 max-w-2xl text-sm text-white/70 dark:text-gray-400'>
|
||||
{subtitle}
|
||||
</p>
|
||||
<p className='org-workbench-hero-subtitle'>{subtitle}</p>
|
||||
)}
|
||||
</div>
|
||||
{actions && (
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
|
||||
/*
|
||||
* 企业中心统一弹窗包装。
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Input, Toast, Typography } from '@douyinfe/semi-ui';
|
||||
import { Input, Toast, Typography } from '@/components/ui';
|
||||
import { API } from '../../../helpers/api';
|
||||
import { showError } from '../../../helpers';
|
||||
import OrgModal from './OrgModal';
|
||||
|
||||
@@ -17,41 +17,26 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React from 'react';
|
||||
import UserCenterPageHeader from '../../../components/common/UserCenterPageHeader';
|
||||
import OrgBreadcrumb from './OrgBreadcrumb';
|
||||
|
||||
/**
|
||||
* 企业中心统一页面标题区。
|
||||
* 所有企业页(/org/*)共用,保证标题字号、副标题、右侧操作区写法一致。
|
||||
* 企业中心统一页面标题区(/org/*):与个人端共用 UserCenterPageHeader 的样式,
|
||||
* 面包屑为“企业中心 / 当前页面”,标题 28px、副标题 14px。
|
||||
*
|
||||
* @param {React.ComponentType} [icon] 可选的 lucide 图标组件(如 Wallet)
|
||||
* @param {React.ReactNode} title 主标题
|
||||
* @param {React.ReactNode} [subtitle] 副标题(一句话说明本页用途)
|
||||
* @param {React.ReactNode} [actions] 右侧操作区(刷新/新建等按钮)
|
||||
*/
|
||||
const OrgPageHeader = ({ icon: Icon, title, subtitle, actions }) => (
|
||||
<div className='mb-5 flex items-start justify-between gap-4 flex-wrap'>
|
||||
<div className='flex items-center gap-3 min-w-0'>
|
||||
{Icon && (
|
||||
<div className='flex-shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg bg-brand/10 text-brand'>
|
||||
<Icon size={18} />
|
||||
</div>
|
||||
)}
|
||||
<div className='min-w-0'>
|
||||
<h1 className='text-lg sm:text-xl font-semibold tracking-tight text-[var(--text-primary)] truncate'>
|
||||
{title}
|
||||
</h1>
|
||||
{subtitle && (
|
||||
<p className='text-[13px] text-gray-500 dark:text-gray-400 mt-0.5 max-w-3xl'>
|
||||
{subtitle}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{actions && (
|
||||
<div className='flex items-center gap-2 flex-wrap justify-end'>
|
||||
{actions}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
const OrgPageHeader = ({ title, subtitle, actions }) => (
|
||||
<UserCenterPageHeader
|
||||
breadcrumb={
|
||||
<OrgBreadcrumb current={typeof title === 'string' ? title : undefined} />
|
||||
}
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
extra={actions}
|
||||
/>
|
||||
);
|
||||
|
||||
export default OrgPageHeader;
|
||||
|
||||
@@ -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 from 'react';
|
||||
import { Card } from 'antd';
|
||||
|
||||
/**
|
||||
* 企业中心统一卡片容器(方案 A+ 底盘层)。
|
||||
@@ -43,9 +44,7 @@ const OrgPanel = ({
|
||||
}) => {
|
||||
const hasHeader = title || actions;
|
||||
return (
|
||||
<div
|
||||
className={`relative overflow-hidden rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-card)] shadow-[var(--elevation-xs)] ${className}`}
|
||||
>
|
||||
<Card className={`org-panel ${className}`} styles={{ body: { padding: 24 } }}>
|
||||
{hasHeader && (
|
||||
<div className='flex items-start justify-between gap-3 flex-wrap border-b border-[var(--border-subtle)] px-5 py-3.5'>
|
||||
<div className='flex items-center gap-2.5 min-w-0'>
|
||||
@@ -76,7 +75,7 @@ const OrgPanel = ({
|
||||
)}
|
||||
|
||||
<div className={`${padding} ${bodyClassName}`}>{children}</div>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Input, Toast, Typography } from '@douyinfe/semi-ui';
|
||||
import { Input, Toast, Typography } from '@/components/ui';
|
||||
import { API } from '../../../helpers/api';
|
||||
import { showError } from '../../../helpers';
|
||||
import OrgModal from './OrgModal';
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Select, Toast, Tooltip } from '@douyinfe/semi-ui';
|
||||
import { Button, Select, Toast, Tooltip } from '@/components/ui';
|
||||
import { Layers } from 'lucide-react';
|
||||
import { API } from '../../../helpers/api';
|
||||
import { showError } from '../../../helpers';
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React from 'react';
|
||||
import { SideSheet } from '@douyinfe/semi-ui';
|
||||
import { SideSheet } from '@/components/ui';
|
||||
|
||||
/*
|
||||
* 企业中心统一侧滑面板包装。与 OrgModal 同理:SideSheet 走 portal,
|
||||
@@ -25,7 +25,7 @@ import { SideSheet } from '@douyinfe/semi-ui';
|
||||
* 企业中心所有 <SideSheet> 一律使用本组件。
|
||||
*
|
||||
* 移动端适配:调用方普遍传固定像素宽(如技能详情的 720),在手机上会超出视口——
|
||||
* Semi 把 width 作为内联样式打在 .semi-sidesheet-inner 上,面板 right:0 定位,
|
||||
* Semi 把 width 作为内联样式打在 .ant-drawer-content 上,面板 right:0 定位,
|
||||
* 超出的部分被推到屏幕左侧外并裁掉。这里统一把像素宽钳到视口内。
|
||||
*
|
||||
* 用 min() 钳制而不是「窄屏一律 100%」:企业中心的移动端导航抽屉是
|
||||
|
||||
@@ -90,18 +90,22 @@ const OrgStatCard = ({
|
||||
const hasCountUp = typeof countTo === 'number';
|
||||
const animated = useCountUp(hasCountUp ? countTo : 0, { decimals });
|
||||
const displayValue = hasCountUp
|
||||
? (formatter ? formatter(animated) : animated.toLocaleString())
|
||||
? formatter
|
||||
? formatter(animated)
|
||||
: animated.toLocaleString()
|
||||
: value;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-card)] shadow-[var(--elevation-xs)] ${compact ? 'p-3' : 'p-4'} ${className}`}
|
||||
className={`org-stat-card rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-card)] shadow-[var(--elevation-xs)] ${compact ? 'p-3' : 'p-4'} ${className}`}
|
||||
>
|
||||
<div className={`flex ${compact ? 'items-center gap-3' : 'flex-col'}`}>
|
||||
<div className={`flex items-center gap-2.5 ${compact ? '' : 'mb-2.5'}`}>
|
||||
<div
|
||||
className={`org-stat-label flex items-center gap-2.5 ${compact ? '' : 'mb-2.5'}`}
|
||||
>
|
||||
{Icon && (
|
||||
<span
|
||||
className={`inline-flex flex-shrink-0 items-center justify-center rounded-lg ${palette.icon} ${compact ? 'h-8 w-8' : 'h-9 w-9'}`}
|
||||
className={`org-stat-icon inline-flex flex-shrink-0 items-center justify-center rounded-lg ${palette.icon} ${compact ? 'h-8 w-8' : 'h-9 w-9'}`}
|
||||
>
|
||||
<Icon size={compact ? 15 : 17} />
|
||||
</span>
|
||||
@@ -140,12 +144,12 @@ const OrgStatCard = ({
|
||||
) : (
|
||||
<>
|
||||
<div
|
||||
className={`text-2xl font-semibold tracking-tight tabular-nums ${palette.value}`}
|
||||
className={`org-stat-value text-2xl font-semibold tracking-tight tabular-nums ${palette.value}`}
|
||||
>
|
||||
{displayValue}
|
||||
</div>
|
||||
{sub && (
|
||||
<div className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||
<div className='org-stat-hint mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||
{sub}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Spin } from '@douyinfe/semi-ui';
|
||||
import { Spin } from '@/components/ui';
|
||||
import { Inbox } from 'lucide-react';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useEffect } from 'react';
|
||||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
import { TabPane, Tabs } from '@/components/ui';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user