This commit is contained in:
dengqichen 2025-12-11 17:17:59 +08:00
parent d372f5edfc
commit 1c3c148221
2 changed files with 18 additions and 7 deletions

View File

@ -7,6 +7,7 @@ import type { DeployTeam } from '../types';
interface TeamSelectorProps {
teams: DeployTeam[];
currentTeamId: number | null;
currentTeamOwnerName?: string; // 当前团队负责人名称
pendingApprovalCount: number;
showApprovalButton: boolean; // 是否显示待审批按钮(基于当前环境)
onTeamChange: (teamId: string) => void;
@ -21,6 +22,7 @@ interface TeamSelectorProps {
export const TeamSelector: React.FC<TeamSelectorProps> = React.memo(({
teams,
currentTeamId,
currentTeamOwnerName,
pendingApprovalCount,
showApprovalButton,
onTeamChange,
@ -31,13 +33,21 @@ export const TeamSelector: React.FC<TeamSelectorProps> = React.memo(({
<div className="flex items-center gap-4">
{/* 书签按钮 */}
{onBookmarkClick && (
<Button
variant="outline"
onClick={onBookmarkClick}
>
<Bookmark className="h-4 w-4 mr-2" />
</Button>
<div className="flex items-center gap-2">
<Button
variant="outline"
onClick={onBookmarkClick}
>
<Bookmark className="h-4 w-4 mr-2" />
</Button>
<span className="text-xs text-muted-foreground">
{currentTeamOwnerName
? `(请联系团队负责人 "${currentTeamOwnerName}" 来维护)`
: '(请联系系统管理员来设置团队负责人)'
}
</span>
</div>
)}
{/* 待审批按钮 - 只在当前环境需要审批且用户有权限时显示 */}

View File

@ -145,6 +145,7 @@ const Dashboard: React.FC = () => {
<TeamSelector
teams={deploymentData.teams}
currentTeamId={deploymentData.currentTeamId}
currentTeamOwnerName={deploymentData.currentTeam?.ownerName}
pendingApprovalCount={approvalData.pendingApprovalCount}
showApprovalButton={shouldShowApprovalButton}
onTeamChange={deploymentData.handleTeamChange}