Merge pull request #145 from guanweiwang/main

fix: 路径问题
This commit is contained in:
Yoko
2025-07-24 20:33:51 +08:00
committed by GitHub
12 changed files with 20 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ const ADMIN_BREADCRUMB_MAP: Record<string, { title: string; to: string }> = {
chat: { title: '对话记录', to: '/chat' },
completion: { title: '补全记录', to: '/completion' },
model: { title: '模型管理', to: '/model' },
'user-management': { title: '成员管理', to: '/user-management' },
'member-management': { title: '成员管理', to: '/member-management' },
admin: { title: '管理员', to: '/admin' },
};

View File

@@ -51,8 +51,8 @@ const ADMIN_MENUS = [
},
{
label: '成员管理',
value: '/user-management',
pathname: 'user-management',
value: '/member-management',
pathname: 'member-management',
icon: 'icon-yonghuguanli1',
show: true,
disabled: false,

View File

@@ -205,6 +205,7 @@ const GlobalStatistic = ({ timeRange }: { timeRange: TimeRange }) => {
<LineCharts
title='补全任务采纳率'
data={acceptedPerChartData}
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
extra={
<>
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}

View File

@@ -9,9 +9,15 @@ interface ILineChartsProps {
xData: (string | number)[];
yData: number[];
};
formatValueTooltip?: (value: number) => string;
}
const LineCharts: React.FC<ILineChartsProps> = ({ title, data, extra }) => {
const LineCharts: React.FC<ILineChartsProps> = ({
title,
data,
extra,
formatValueTooltip,
}) => {
const { xData, yData } = data;
const domRef = useRef(null);
const echartsRef = useRef<echarts.ECharts>(null);
@@ -75,7 +81,9 @@ const LineCharts: React.FC<ILineChartsProps> = ({ title, data, extra }) => {
) => {
if (params[0]) {
const { name, seriesName, value } = params[0];
return `<div style="font-family: G;">${name}<div>${seriesName} ${value}</div></div>`;
return `<div style="font-family: G;">${name}<div>${seriesName} ${
formatValueTooltip ? formatValueTooltip(value) : value
}</div></div>`;
}
return '';
},

View File

@@ -202,6 +202,7 @@ const MemberStatistic = ({
<LineCharts
title='补全任务采纳率'
data={acceptedPerChartData}
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
extra={
<>
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}

View File

@@ -305,7 +305,7 @@ const MemberManage = () => {
<Card sx={{ flex: 1, height: '100%' }}>
<Menu anchorEl={anchorEl} open={!!anchorEl} onClose={handleClose}>
{currentUser?.status === ConstsUserStatus.UserStatusActive && (
<MenuItem onClick={onLockUser}></MenuItem>
<MenuItem onClick={onLockUser}></MenuItem>
)}
{currentUser?.status === ConstsUserStatus.UserStatusLocked && (
<MenuItem onClick={onUnLockUser}></MenuItem>

View File

@@ -178,6 +178,7 @@ const MemberStatistic = ({
<LineCharts
title='补全任务采纳率'
data={acceptedPerChartData}
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
extra={
<>
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}

View File

@@ -32,7 +32,7 @@ const Dashboard = LazyLoadable(lazy(() => import('@/pages/dashboard')));
const Chat = LazyLoadable(lazy(() => import('@/pages/chat')));
const Completion = LazyLoadable(lazy(() => import('@/pages/completion')));
const Model = LazyLoadable(lazy(() => import('@/pages/model')));
const User = LazyLoadable(lazy(() => import('@/pages/user-management')));
const MemberManage = LazyLoadable(lazy(() => import('@/pages/memberManage')));
const Admin = LazyLoadable(lazy(() => import('@/pages/admin')));
const Invite = LazyLoadable(lazy(() => import('@/pages/invite')));
const Auth = LazyLoadable(lazy(() => import('@/pages/auth')));
@@ -79,8 +79,8 @@ const routerConfig = [
element: <Model />,
},
{
path: 'user-management',
element: <User />,
path: 'member-management',
element: <MemberManage />,
},
{
path: 'admin',