生产管理系统前端 开发中心配置系统 所有页面

This commit is contained in:
2025-10-21 18:04:39 +08:00
parent 4a5d278d89
commit 9afc680833
185 changed files with 13677 additions and 4487 deletions

View File

@@ -0,0 +1,110 @@
'use client';
import React from 'react';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Badge } from '@/components/ui/badge';
import { Role, RoleType } from '../types';
interface RoleDetailDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
selectedRole: Role | null;
}
export function RoleDetailDialog({
open,
onOpenChange,
selectedRole
}: RoleDetailDialogProps) {
const getRoleTypeBadge = (type: RoleType) => {
return type === 'system' ? (
<Badge className="bg-blue-100 text-blue-700"></Badge>
) : (
<Badge className="bg-green-100 text-green-700"></Badge>
);
};
const getStatusBadge = (status: string) => {
return status === 'active' ? (
<Badge className="bg-green-100 text-green-700"></Badge>
) : (
<Badge className="bg-gray-100 text-gray-700"></Badge>
);
};
if (!selectedRole) return null;
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl">
<DialogHeader>
<DialogTitle></DialogTitle>
<DialogDescription className="sr-only">
</DialogDescription>
</DialogHeader>
<div className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div>
<Label></Label>
<div className="mt-1">{selectedRole.name}</div>
</div>
<div>
<Label></Label>
<div className="mt-1">{selectedRole.code}</div>
</div>
<div className="col-span-2">
<Label></Label>
<div className="mt-1">{selectedRole.description || '-'}</div>
</div>
<div>
<Label></Label>
<div className="mt-1">{getRoleTypeBadge(selectedRole.type)}</div>
</div>
<div>
<Label></Label>
<div className="mt-1">{getStatusBadge(selectedRole.status)}</div>
</div>
{selectedRole.defaultHomePage && (
<div className="col-span-2">
<Label></Label>
<div className="mt-1">{selectedRole.defaultHomePage}</div>
</div>
)}
<div>
<Label></Label>
<div className="mt-1">
{selectedRole.menuIds.includes('*') ? '全部' : selectedRole.menuIds.length}
</div>
</div>
<div>
<Label></Label>
<div className="mt-1">
{selectedRole.permissionIds.includes('*') ? '全部' : selectedRole.permissionIds.length}
</div>
</div>
<div>
<Label></Label>
<div className="mt-1">
{new Date(selectedRole.createdAt).toLocaleString('zh-CN')}
</div>
</div>
<div>
<Label></Label>
<div className="mt-1">
{new Date(selectedRole.updatedAt).toLocaleString('zh-CN')}
</div>
</div>
</div>
</div>
<DialogFooter>
<Button variant="outline" onClick={() => onOpenChange(false)}>
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}