From 33282d92296fa2960dbff836f7c9919182283a69 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Sat, 1 Nov 2025 12:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97=E8=BE=B9?= =?UTF-8?q?=E8=B7=9D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ui/toast.tsx | 1 + ...amConfigSheet.tsx => TeamConfigDialog.tsx} | 50 +++++++++--------- frontend/src/pages/Deploy/Team/List/index.tsx | 4 +- frontend/src/pages/System/Menu/List/index.tsx | 52 +++++++++++++++---- .../src/pages/System/Role/List/service.ts | 2 +- 5 files changed, 73 insertions(+), 36 deletions(-) rename frontend/src/pages/Deploy/Team/List/components/{TeamConfigSheet.tsx => TeamConfigDialog.tsx} (97%) diff --git a/frontend/src/components/ui/toast.tsx b/frontend/src/components/ui/toast.tsx index a2fb26db..f3b2ad6b 100644 --- a/frontend/src/components/ui/toast.tsx +++ b/frontend/src/components/ui/toast.tsx @@ -47,6 +47,7 @@ const Toast = React.forwardRef< ) diff --git a/frontend/src/pages/Deploy/Team/List/components/TeamConfigSheet.tsx b/frontend/src/pages/Deploy/Team/List/components/TeamConfigDialog.tsx similarity index 97% rename from frontend/src/pages/Deploy/Team/List/components/TeamConfigSheet.tsx rename to frontend/src/pages/Deploy/Team/List/components/TeamConfigDialog.tsx index 8aa82839..ff784e14 100644 --- a/frontend/src/pages/Deploy/Team/List/components/TeamConfigSheet.tsx +++ b/frontend/src/pages/Deploy/Team/List/components/TeamConfigDialog.tsx @@ -1,11 +1,11 @@ import React, { useState, useEffect } from 'react'; import { - Sheet, - SheetContent, - SheetHeader, - SheetTitle, - SheetFooter, -} from '@/components/ui/sheet'; + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogFooter, +} from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'; @@ -48,7 +48,7 @@ import { deleteTeamApplication, } from '../service'; -interface TeamConfigSheetProps { +interface TeamConfigDialogProps { open: boolean; teamId: number; teamName: string; @@ -59,7 +59,7 @@ interface TeamConfigSheetProps { onSuccess: () => void; } -const TeamConfigSheet: React.FC = ({ +const TeamConfigDialog: React.FC = ({ open, teamId, teamName, @@ -350,7 +350,7 @@ const TeamConfigSheet: React.FC = ({ description: '团队配置已保存', }); onSuccess(); - onOpenChange(false); // 关闭抽屉 + onOpenChange(false); } catch (error: any) { toast({ variant: 'destructive', @@ -511,11 +511,11 @@ const TeamConfigSheet: React.FC = ({ ); return ( - - - - 团队配置:{teamName} - + + + + 团队配置:{teamName} + {loading ? (
@@ -524,10 +524,12 @@ const TeamConfigSheet: React.FC = ({ ) : ( <> {/* 步骤指示器 */} - {renderStepIndicator()} +
+ {renderStepIndicator()} +
- -
+ +
{/* Step 1: 环境选择 */} {currentStep === 1 && ( @@ -904,14 +906,14 @@ const TeamConfigSheet: React.FC = ({ ); })}
- - + + )}
{/* 底部导航按钮 */} - + )}
- + )} -
-
+ + ); }; -export default TeamConfigSheet; +export default TeamConfigDialog; diff --git a/frontend/src/pages/Deploy/Team/List/index.tsx b/frontend/src/pages/Deploy/Team/List/index.tsx index 753c3b1f..ca5af943 100644 --- a/frontend/src/pages/Deploy/Team/List/index.tsx +++ b/frontend/src/pages/Deploy/Team/List/index.tsx @@ -9,7 +9,7 @@ import { getUserList } from '@/pages/System/User/List/service'; import type { UserResponse } from '@/pages/System/User/List/types'; import { getEnvironmentList, getApplicationList } from './service'; import type { Environment, Application } from './types'; -import TeamConfigSheet from './components/TeamConfigSheet'; +import TeamConfigDialog from './components/TeamConfigDialog'; import { Table, TableHeader, @@ -482,7 +482,7 @@ const TeamList: React.FC = () => { onOpenChange={setMemberDialogOpen} onSuccess={handleSuccess} /> - { // 当前菜单行 rows.push( - +
{hasChildren ? ( @@ -163,20 +167,49 @@ const MenuPage: React.FC = () => { ) : ( )} - {menu.name} + + {menu.name} + + {menu.hidden && ( + + + + + + +

隐藏菜单

+
+
+
+ )}
{menu.icon && ( -
+
{getIconComponent(menu.icon)}
)} - {menu.path || '-'} - + + {menu.path || '-'} + + {menu.component || '-'} + + {menu.permission ? ( + + {menu.permission} + + ) : ( + - + )} + {getTypeBadge(menu.type)} {menu.sort} @@ -304,13 +337,14 @@ const MenuPage: React.FC = () => { {/* 表格 */}
- +
菜单名称 图标 路由地址 组件路径 + 权限标识 菜单类型 显示排序 操作 @@ -319,7 +353,7 @@ const MenuPage: React.FC = () => { {loading ? ( - +
加载中... @@ -330,7 +364,7 @@ const MenuPage: React.FC = () => { menuTree.map(menu => renderMenuRow(menu)) ) : ( - +
暂无菜单数据
diff --git a/frontend/src/pages/System/Role/List/service.ts b/frontend/src/pages/System/Role/List/service.ts index e871edba..9957dd65 100644 --- a/frontend/src/pages/System/Role/List/service.ts +++ b/frontend/src/pages/System/Role/List/service.ts @@ -40,4 +40,4 @@ export const assignPermissions = (roleId: number, permissionIds: Number[]) => re export const getAllPermissions = () => request.get('/api/v1/permission/list'); // 获取权限树 -export const getPermissionTree = () => request.get('/api/v1/menu/permission-tree'); \ No newline at end of file +export const getPermissionTree = () => request.get('/api/v1/role/permission-tree'); \ No newline at end of file