1
This commit is contained in:
parent
10e4fa1232
commit
15c1e1ed25
@ -74,7 +74,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
const [list, setList] = useState<ProjectGroup[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const {toast} = useToast();
|
||||
|
||||
|
||||
const form = useForm<SearchFormValues>({
|
||||
resolver: zodResolver(searchFormSchema),
|
||||
defaultValues: {
|
||||
@ -171,7 +171,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
accessorKey: 'type',
|
||||
header: '项目组类型',
|
||||
size: 150,
|
||||
cell: ({ row }) => {
|
||||
cell: ({row}) => {
|
||||
const typeInfo = getProjectTypeInfo(row.original.type);
|
||||
return (
|
||||
<Badge variant="outline">
|
||||
@ -187,7 +187,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
accessorKey: 'enabled',
|
||||
header: '状态',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<Badge variant={row.original.enabled ? "outline" : "secondary"}>
|
||||
{row.original.enabled ? '启用' : '禁用'}
|
||||
</Badge>
|
||||
@ -197,7 +197,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
accessorKey: 'totalEnvironments',
|
||||
header: '环境数量',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<span className="flex items-center gap-1">
|
||||
<EnvironmentOutlined/>
|
||||
{row.original.totalEnvironments || 0}
|
||||
@ -208,7 +208,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
accessorKey: 'totalApplications',
|
||||
header: '项目数量',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<span className="flex items-center gap-1">
|
||||
<TeamOutlined/>
|
||||
{row.original.totalApplications || 0}
|
||||
@ -224,14 +224,14 @@ const ProjectGroupList: React.FC = () => {
|
||||
id: 'actions',
|
||||
header: '操作',
|
||||
size: 180,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => handleEdit(row.original)}
|
||||
>
|
||||
<EditOutlined className="mr-1" />
|
||||
<EditOutlined className="mr-1"/>
|
||||
编辑
|
||||
</Button>
|
||||
<AlertDialog>
|
||||
@ -241,7 +241,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
size="sm"
|
||||
className="text-destructive"
|
||||
>
|
||||
<DeleteOutlined className="mr-1" />
|
||||
<DeleteOutlined className="mr-1"/>
|
||||
删除
|
||||
</Button>
|
||||
</AlertDialogTrigger>
|
||||
@ -272,6 +272,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-3xl font-bold tracking-tight">项目组管理</h2>
|
||||
<Button onClick={() => setModalVisible(true)}>
|
||||
<PlusOutlined className="mr-1"/>
|
||||
新建
|
||||
</Button>
|
||||
</div>
|
||||
@ -296,7 +297,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
onValueChange={(value) => form.setValue('type', value)}
|
||||
>
|
||||
<SelectTrigger className="max-w-[200px]">
|
||||
<SelectValue placeholder="项目组类型" />
|
||||
<SelectValue placeholder="项目组类型"/>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={ProjectGroupTypeEnum.PRODUCT}>产品型</SelectItem>
|
||||
@ -308,7 +309,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
onValueChange={(value) => form.setValue('enabled', value === 'true')}
|
||||
>
|
||||
<SelectTrigger className="max-w-[200px]">
|
||||
<SelectValue placeholder="状态" />
|
||||
<SelectValue placeholder="状态"/>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="true">启用</SelectItem>
|
||||
@ -319,7 +320,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
重置
|
||||
</Button>
|
||||
<Button variant="ghost" onClick={() => handleSearch(form.getValues())}>
|
||||
<SearchOutlined className="mr-1" />
|
||||
<SearchOutlined className="mr-1"/>
|
||||
搜索
|
||||
</Button>
|
||||
</div>
|
||||
@ -329,10 +330,6 @@ const ProjectGroupList: React.FC = () => {
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>项目组列表</CardTitle>
|
||||
<Button onClick={handleAdd}>
|
||||
<PlusOutlined className="mr-1" />
|
||||
新建
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="rounded-md border">
|
||||
@ -342,7 +339,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
{columns.map((column) => (
|
||||
<TableHead
|
||||
key={column.accessorKey || column.id}
|
||||
style={{ width: column.size }}
|
||||
style={{width: column.size}}
|
||||
>
|
||||
{column.header}
|
||||
</TableHead>
|
||||
@ -357,7 +354,7 @@ const ProjectGroupList: React.FC = () => {
|
||||
key={column.accessorKey || column.id}
|
||||
>
|
||||
{column.cell
|
||||
? column.cell({ row: { original: item } })
|
||||
? column.cell({row: {original: item}})
|
||||
: item[column.accessorKey!]}
|
||||
</TableCell>
|
||||
))}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user