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