1
This commit is contained in:
parent
871dd32c91
commit
5eb44c62cb
27
frontend/src/components/ui/page-container.tsx
Normal file
27
frontend/src/components/ui/page-container.tsx
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
interface PageContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PageContainer = React.forwardRef<HTMLDivElement, PageContainerProps>(
|
||||||
|
({ className, children, ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn(
|
||||||
|
"flex w-full flex-col space-y-4 p-6",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
PageContainer.displayName = "PageContainer";
|
||||||
|
|
||||||
|
export { PageContainer };
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import {PageContainer} from '@ant-design/pro-layout';
|
import {PageContainer} from '@/components/ui/page-container';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
@ -269,77 +269,61 @@ const ProjectGroupList: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<Card className="mb-4">
|
<div className="flex items-center justify-between">
|
||||||
<CardHeader>
|
<h2 className="text-3xl font-bold tracking-tight">项目组管理</h2>
|
||||||
<CardTitle>搜索条件</CardTitle>
|
<Button onClick={() => setModalVisible(true)}>
|
||||||
</CardHeader>
|
新建
|
||||||
<CardContent>
|
</Button>
|
||||||
<Form {...form}>
|
</div>
|
||||||
<form onSubmit={form.handleSubmit(handleSearch)} className="flex items-end gap-4">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="projectGroupCode"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>项目组编码</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input placeholder="请输入项目组编码" {...field} />
|
|
||||||
</FormControl>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormField
|
<Card>
|
||||||
control={form.control}
|
<div className="p-6">
|
||||||
name="projectGroupName"
|
<div className="flex items-center gap-4">
|
||||||
render={({ field }) => (
|
<Input
|
||||||
<FormItem>
|
placeholder="项目组编码"
|
||||||
<FormLabel>项目组名称</FormLabel>
|
value={form.getValues('projectGroupCode')}
|
||||||
<FormControl>
|
onChange={(e) => form.setValue('projectGroupCode', e.target.value)}
|
||||||
<Input placeholder="请输入项目组名称" {...field} />
|
className="max-w-[200px]"
|
||||||
</FormControl>
|
/>
|
||||||
</FormItem>
|
<Input
|
||||||
)}
|
placeholder="项目组名称"
|
||||||
/>
|
value={form.getValues('projectGroupName')}
|
||||||
|
onChange={(e) => form.setValue('projectGroupName', e.target.value)}
|
||||||
<FormField
|
className="max-w-[200px]"
|
||||||
control={form.control}
|
/>
|
||||||
name="type"
|
<Select
|
||||||
render={({ field }) => (
|
value={form.getValues('type')}
|
||||||
<FormItem>
|
onValueChange={(value) => form.setValue('type', value)}
|
||||||
<FormLabel>项目组类型</FormLabel>
|
>
|
||||||
<Select
|
<SelectTrigger className="max-w-[200px]">
|
||||||
onValueChange={field.onChange}
|
<SelectValue placeholder="项目组类型" />
|
||||||
defaultValue={field.value}
|
</SelectTrigger>
|
||||||
>
|
<SelectContent>
|
||||||
<FormControl>
|
<SelectItem value={ProjectGroupTypeEnum.PRODUCT}>产品型</SelectItem>
|
||||||
<SelectTrigger className="w-[200px]">
|
<SelectItem value={ProjectGroupTypeEnum.PROJECT}>项目型</SelectItem>
|
||||||
<SelectValue placeholder="请选择项目组类型" />
|
</SelectContent>
|
||||||
</SelectTrigger>
|
</Select>
|
||||||
</FormControl>
|
<Select
|
||||||
<SelectContent>
|
value={form.getValues('enabled')?.toString()}
|
||||||
<SelectItem value={ProjectGroupTypeEnum.PRODUCT}>产品型</SelectItem>
|
onValueChange={(value) => form.setValue('enabled', value === 'true')}
|
||||||
<SelectItem value={ProjectGroupTypeEnum.PROJECT}>项目型</SelectItem>
|
>
|
||||||
</SelectContent>
|
<SelectTrigger className="max-w-[200px]">
|
||||||
</Select>
|
<SelectValue placeholder="状态" />
|
||||||
</FormItem>
|
</SelectTrigger>
|
||||||
)}
|
<SelectContent>
|
||||||
/>
|
<SelectItem value="true">启用</SelectItem>
|
||||||
|
<SelectItem value="false">禁用</SelectItem>
|
||||||
<Button
|
</SelectContent>
|
||||||
type="button"
|
</Select>
|
||||||
variant="outline"
|
<Button variant="outline" onClick={() => form.reset()}>
|
||||||
onClick={() => form.reset()}
|
重置
|
||||||
>
|
</Button>
|
||||||
重置
|
<Button variant="ghost" onClick={() => handleSearch(form.getValues())}>
|
||||||
</Button>
|
<SearchOutlined className="mr-1" />
|
||||||
<Button type="submit">
|
搜索
|
||||||
<SearchOutlined className="mr-1" />
|
</Button>
|
||||||
搜索
|
</div>
|
||||||
</Button>
|
</div>
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user