fix:....
This commit is contained in:
parent
f0347222c3
commit
cae04dfe4f
|
@ -144,7 +144,7 @@ export const taskPriorityList: DictType[] = [
|
||||||
code: '1',
|
code: '1',
|
||||||
name: '不重要紧急',
|
name: '不重要紧急',
|
||||||
order: 2,
|
order: 2,
|
||||||
color: 'gary'
|
color: 'blue'
|
||||||
}, {
|
}, {
|
||||||
id: 0,
|
id: 0,
|
||||||
code: '0',
|
code: '0',
|
||||||
|
|
|
@ -3,33 +3,33 @@ import {Button, Col, Form, Input, Row, Select, Space, theme} from "antd";
|
||||||
import React, {useState} from "react";
|
import React, {useState} from "react";
|
||||||
import {DownOutlined} from "@ant-design/icons";
|
import {DownOutlined} from "@ant-design/icons";
|
||||||
import {OperationButtonProps} from "@/app/ui/task/project/OperationButton";
|
import {OperationButtonProps} from "@/app/ui/task/project/OperationButton";
|
||||||
|
import {Span} from "next/dist/server/lib/trace/tracer";
|
||||||
|
import CustomSearchForm from "@/app/ui/task/CustomSearchForm";
|
||||||
|
|
||||||
const AdvancedSearchForm = () => {
|
const AdvancedSearchForm = () => {
|
||||||
const { token } = theme.useToken();
|
const { token } = theme.useToken();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [expand, setExpand] = useState(false);
|
|
||||||
const [searchFields, setSearchFields] = useState<any[]>([
|
const [searchFields, setSearchFields] = useState<any[]>([
|
||||||
<Form.Item>
|
// <Select
|
||||||
<Select
|
// defaultValue="state"
|
||||||
defaultValue="state"
|
// style={{ width: 120 }}
|
||||||
style={{ width: 120 }}
|
// allowClear
|
||||||
allowClear
|
// options={[{ value: 'state', label: '任务状态' }]}
|
||||||
options={[{ value: 'state', label: '任务状态' }]}
|
// />,
|
||||||
/>,
|
// <Select
|
||||||
<Select
|
// defaultValue='='
|
||||||
defaultValue="="
|
// style={{ width: 120 }}
|
||||||
style={{ width: 120 }}
|
// allowClear
|
||||||
allowClear
|
// options={[{ value: '=', label: '等于' },{value:'IN',label:"多个选择"}]}
|
||||||
options={[{ value: '=', label: '等于' },{value:'IN',label:"多个选择"}]}
|
// />,
|
||||||
/>,
|
<Select key='1'
|
||||||
<Select
|
|
||||||
mode="tags"
|
mode="tags"
|
||||||
defaultValue={['8','9']}
|
defaultValue={['8','9']}
|
||||||
style={{ width: 180 }}
|
style={{ width: 180 }}
|
||||||
allowClear
|
allowClear
|
||||||
options={[{ value: '8', label: '新建' },{ value: '9', label: '进行中' },{ value: '7', label: '完成' },]}
|
options={[{ value: '8', label: '新建' },{ value: '9', label: '进行中' },{ value: '7', label: '完成' },]}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const AdvancedSearchForm = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getFields = () => {
|
const getFields = () => {
|
||||||
const count = expand ? 10 : 6;
|
const count = 10;
|
||||||
const children = [];
|
const children = [];
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
children.push(
|
children.push(
|
||||||
|
@ -86,24 +86,35 @@ const AdvancedSearchForm = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form form={form} name="advanced_search" style={formStyle} onFinish={onFinish}>
|
<Form form={form} name="advanced_search" style={formStyle} onFinish={onFinish}>
|
||||||
<Row gutter={24}>{searchFields}</Row>
|
{/*<Form.Item>*/}
|
||||||
|
{/*<Row gutter={24}>{searchFields}</Row>*/}
|
||||||
|
{/* </Form.Item>*/}
|
||||||
{/*<div style={{ textAlign: 'right' }}>*/}
|
{/*<div style={{ textAlign: 'right' }}>*/}
|
||||||
{/* <Space size="small">*/}
|
{/* <Space size="small">*/}
|
||||||
<Form.Item>
|
{/*<Form.Item>*/}
|
||||||
<Button type="primary">
|
{/* <Button type="primary">*/}
|
||||||
添加
|
{/* 添加*/}
|
||||||
</Button>
|
{/* </Button>*/}
|
||||||
|
{/*<Form.Item>*/}
|
||||||
|
|
||||||
|
{searchFields}
|
||||||
|
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
搜索
|
搜索
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
{/*<CustomSearchForm/>*/}
|
||||||
onClick={() => {
|
{/*</Form.Item>*/}
|
||||||
form.resetFields();
|
{/*<Button type="primary" htmlType="submit">*/}
|
||||||
}}
|
{/* 自定义搜索*/}
|
||||||
>
|
{/*</Button>*/}
|
||||||
清空
|
{/*<Button*/}
|
||||||
</Button>
|
{/* onClick={() => {*/}
|
||||||
</Form.Item>
|
{/* form.resetFields();*/}
|
||||||
|
{/* }}*/}
|
||||||
|
{/*>*/}
|
||||||
|
{/* 清空*/}
|
||||||
|
{/*</Button>*/}
|
||||||
|
{/*</Form.Item>*/}
|
||||||
{/*<a*/}
|
{/*<a*/}
|
||||||
{/* style={{ fontSize: 12 }}*/}
|
{/* style={{ fontSize: 12 }}*/}
|
||||||
{/* onClick={() => {*/}
|
{/* onClick={() => {*/}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.ant-pro-query-filter.ant-pro-query-filter{
|
||||||
|
padding: 0;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
import {
|
||||||
|
ProFormDatePicker, ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
QueryFilter,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import '@/app/ui/task/CustomSearchForm.module.css'
|
||||||
|
import {taskStateList} from "@/app/lib/task/project/data";
|
||||||
|
const CustomSearchForm= () => {
|
||||||
|
return (
|
||||||
|
<QueryFilter defaultCollapsed split style={{paddingTop:0}}>
|
||||||
|
<ProFormSelect mode="tags" name='state' label='任务状态'
|
||||||
|
request={async () => taskStateList}/>
|
||||||
|
{/*</ProFormSelect>*/}
|
||||||
|
<ProFormText name="name" label="应用名称" />
|
||||||
|
<ProFormDatePicker name="createDate" label="创建时间" />
|
||||||
|
<ProFormText name="status" label="应用状态" />
|
||||||
|
<ProFormDatePicker name="replyDate" label="响应日期" />
|
||||||
|
<ProFormDatePicker name="startDate" label="创建时间" />
|
||||||
|
<ProFormDatePicker name="endDate" label="结束时间" />
|
||||||
|
</QueryFilter>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CustomSearchForm
|
|
@ -5,15 +5,14 @@ import {DetailFormProps} from "@/app/ui/task/project/DetailForm";
|
||||||
import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm";
|
import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm";
|
||||||
import {OPERATION_BUTTON_TYPE} from "@/app/lib/task/project/data";
|
import {OPERATION_BUTTON_TYPE} from "@/app/lib/task/project/data";
|
||||||
import AdvancedSearchForm from "@/app/ui/task/AdvancedSearchForm";
|
import AdvancedSearchForm from "@/app/ui/task/AdvancedSearchForm";
|
||||||
|
import CustomSearchForm from "@/app/ui/task/CustomSearchForm";
|
||||||
// export const TitleOperation: React.FC<DetailFormProps>= () =>
|
// export const TitleOperation: React.FC<DetailFormProps>= () =>
|
||||||
export const TitleOperation: React.FC = () => {
|
export const TitleOperation: React.FC = () => {
|
||||||
const {replace} = useRouter();
|
const {replace} = useRouter();
|
||||||
const [currentPath, setCurrentPath] = React.useState(usePathname());
|
const [currentPath, setCurrentPath] = React.useState(usePathname());
|
||||||
return <div style={{display: 'flex'}}>
|
return <div style={{display: 'flex'}}>
|
||||||
<DetailModelForm operationId={OPERATION_BUTTON_TYPE.ADD} description='添加主线任务'/>
|
<DetailModelForm operationId={OPERATION_BUTTON_TYPE.ADD} description='添加主线任务'/>
|
||||||
{
|
{currentPath.startsWith("/task/project") ? <Button type="primary" onClick={() => {
|
||||||
currentPath.startsWith("/task/project") ? <Button type="primary" onClick={() => {
|
|
||||||
replace("/task/four");
|
replace("/task/four");
|
||||||
setCurrentPath("/task/four");
|
setCurrentPath("/task/four");
|
||||||
}}>四象限显示</Button> :
|
}}>四象限显示</Button> :
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons';
|
import {EllipsisOutlined, PlusOutlined} from '@ant-design/icons';
|
||||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
import type {ActionType, ProColumns} from '@ant-design/pro-components';
|
||||||
import { ProTable, TableDropdown } from '@ant-design/pro-components';
|
import {ProTable, TableDropdown} from '@ant-design/pro-components';
|
||||||
import { Button, Dropdown, Space, Tag } from 'antd';
|
import {Button, Dropdown, Space, Tag} from 'antd';
|
||||||
import React, { useRef } from 'react';
|
import React, {useRef} from 'react';
|
||||||
import {DataType} from "@/app/lib/definitions";
|
import {DataType} from "@/app/lib/definitions";
|
||||||
import {OPERATION_BUTTON_TYPE, taskPriorityList, taskStateList, taskTreeResult} from "@/app/lib/task/project/data";
|
import {OPERATION_BUTTON_TYPE, taskPriorityList, taskStateList, taskTreeResult} from "@/app/lib/task/project/data";
|
||||||
import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm";
|
import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm";
|
||||||
|
|
||||||
const columns: ProColumns<DataType>[] = [
|
const columns: ProColumns<DataType>[] = [
|
||||||
{
|
{
|
||||||
title: '任务编码',
|
title: '任务编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
// valueType: 'indexBorder',
|
|
||||||
width: '10%',
|
width: '10%',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -35,27 +35,46 @@ const columns: ProColumns<DataType>[] = [
|
||||||
dataIndex: 'description',
|
dataIndex: 'description',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
disable: true,
|
title: '任务优先级',
|
||||||
title: '任务状态',
|
|
||||||
dataIndex: 'state',
|
|
||||||
filters: true,
|
|
||||||
onFilter: true,
|
|
||||||
ellipsis: true,
|
|
||||||
valueType: 'select',
|
|
||||||
fieldProps:{options:taskStateList.map(item => {return {label: item.name,value: item.code}})},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
disable: true,
|
|
||||||
title: '优先级',
|
|
||||||
dataIndex: 'priority',
|
dataIndex: 'priority',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
fieldProps:{options:taskPriorityList.map(item => {return {label: item.name,value: item.code}})},
|
fieldProps: {
|
||||||
|
options: taskPriorityList.map(item => {
|
||||||
|
return {label: item.name, value: item.code}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// renderFormItem: (_, { defaultRender }) => {
|
||||||
|
// return defaultRender(_);
|
||||||
|
// },
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space>
|
<Space>
|
||||||
{
|
{
|
||||||
<Tag color={taskPriorityList.find(item=> item.code===record.priority?.toString())?.color}
|
<Tag color={taskPriorityList.find(item => item.code === record.priority?.toString())?.color}
|
||||||
key={taskPriorityList.find(item=> item.code===record.priority?.toString())?.code}>
|
key={taskPriorityList.find(item => item.code === record.priority?.toString())?.code}>
|
||||||
{taskPriorityList.find(item=> item.code===record.priority?.toString())?.name}
|
{taskPriorityList.find(item => item.code === record.priority?.toString())?.name}
|
||||||
|
</Tag>
|
||||||
|
}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '任务状态',
|
||||||
|
dataIndex: 'state',
|
||||||
|
valueType: 'select',
|
||||||
|
fieldProps: {
|
||||||
|
options: taskStateList.map(item => {
|
||||||
|
return {label: item.name, value: item.code}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// renderFormItem: (_, { defaultRender }) => {
|
||||||
|
// return defaultRender(_);
|
||||||
|
// },
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
{
|
||||||
|
<Tag color={taskStateList.find(item => item.code === record.state?.toString())?.color}
|
||||||
|
key={taskStateList.find(item => item.code === record.state?.toString())?.code}>
|
||||||
|
{taskStateList.find(item => item.code === record.state?.toString())?.name}
|
||||||
</Tag>
|
</Tag>
|
||||||
}
|
}
|
||||||
</Space>
|
</Space>
|
||||||
|
@ -65,120 +84,39 @@ const columns: ProColumns<DataType>[] = [
|
||||||
title: '期望开始时间',
|
title: '期望开始时间',
|
||||||
dataIndex: 'expectedStartTime',
|
dataIndex: 'expectedStartTime',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
// hideInTable: true,
|
|
||||||
// search: {
|
|
||||||
// transform: (value) => {
|
|
||||||
// return {
|
|
||||||
// startTime: value,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '期望结束时间',
|
title: '期望结束时间',
|
||||||
dataIndex: 'expectedEndTime',
|
dataIndex: 'expectedEndTime',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
// hideInTable: true,
|
|
||||||
// search: {
|
|
||||||
// transform: (value) => {
|
|
||||||
// return {
|
|
||||||
// startTime: value,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '实际开始时间',
|
title: '实际开始时间',
|
||||||
dataIndex: 'actualStartTime',
|
dataIndex: 'actualStartTime',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
// hideInTable: true,
|
|
||||||
// search: {
|
|
||||||
// transform: (value) => {
|
|
||||||
// return {
|
|
||||||
// startTime: value,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '期望结束时间',
|
title: '期望结束时间',
|
||||||
dataIndex: 'actualEndTime',
|
dataIndex: 'actualEndTime',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
// hideInTable: true,
|
|
||||||
// search: {
|
|
||||||
// transform: (value) => {
|
|
||||||
// return {
|
|
||||||
// startTime: value,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: '创建时间',
|
|
||||||
// dataIndex: 'created_at',
|
|
||||||
// valueType: 'dateRange',
|
|
||||||
// hideInTable: true,
|
|
||||||
// search: {
|
|
||||||
// transform: (value) => {
|
|
||||||
// return {
|
|
||||||
// startTime: value[0],
|
|
||||||
// endTime: value[1],
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '操作',
|
|
||||||
// valueType: 'option',
|
|
||||||
// key: 'option',
|
|
||||||
// render: (text, record, _, action) => [
|
|
||||||
// <a
|
|
||||||
// key="editable"
|
|
||||||
// onClick={() => {
|
|
||||||
// action?.startEditable?.(record.id);
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// 编辑
|
|
||||||
// </a>,
|
|
||||||
// <a href={record.url} target="_blank" rel="noopener noreferrer" key="view">
|
|
||||||
// 查看
|
|
||||||
// </a>,
|
|
||||||
// <TableDropdown
|
|
||||||
// key="actionGroup"
|
|
||||||
// onSelect={() => action?.reload()}
|
|
||||||
// menus={[
|
|
||||||
// { key: 'copy', name: '复制' },
|
|
||||||
// { key: 'delete', name: '删除' },
|
|
||||||
// ]}
|
|
||||||
// />,
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const TreeTablePro: React.FC = () => {
|
const TreeTablePro: React.FC = () => {
|
||||||
const actionRef = useRef<ActionType>();
|
// const actionRef = useRef<ActionType>();
|
||||||
return (
|
return (
|
||||||
<ProTable<DataType>
|
<ProTable<DataType>
|
||||||
columns={columns}
|
columns={columns}
|
||||||
actionRef={actionRef}
|
// actionRef={actionRef}
|
||||||
cardBordered
|
cardBordered
|
||||||
request={async (params, sort, filter) => {
|
request={async (params, sort, filter) => {
|
||||||
console.log(sort, filter);
|
console.log('request',params,sort, filter);
|
||||||
// await waitTime(2000);
|
|
||||||
// return axios.post<{
|
|
||||||
// data: GithubIssueItem[];
|
|
||||||
// }>('https://proapi.azurewebsites.net/github/issues', {
|
|
||||||
// params,
|
|
||||||
// });
|
|
||||||
const response = await taskTreeResult()
|
const response = await taskTreeResult()
|
||||||
// axios.post('https://proapi.azurewebsites.net/github/issues', {
|
|
||||||
// params,
|
|
||||||
// });
|
|
||||||
return {
|
return {
|
||||||
data:response.data.content,
|
data: response.data.content,
|
||||||
success: response.status.success,
|
success: response.status.success,
|
||||||
}
|
}
|
||||||
// return response.data;
|
|
||||||
}}
|
}}
|
||||||
editable={{
|
editable={{
|
||||||
type: 'multiple',
|
type: 'multiple',
|
||||||
|
@ -187,34 +125,13 @@ const TreeTablePro: React.FC = () => {
|
||||||
persistenceKey: 'pro-table-singe-demos',
|
persistenceKey: 'pro-table-singe-demos',
|
||||||
persistenceType: 'localStorage',
|
persistenceType: 'localStorage',
|
||||||
defaultValue: {
|
defaultValue: {
|
||||||
option: { fixed: 'right', disable: true },
|
option: {fixed: 'right', disable: true},
|
||||||
},
|
|
||||||
onChange(value) {
|
|
||||||
console.log('value: ', value);
|
|
||||||
},
|
},
|
||||||
|
// onChange(value) {
|
||||||
|
// console.log('value: ', value);
|
||||||
|
// },
|
||||||
}}
|
}}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
// search={{
|
|
||||||
// labelWidth: 'auto',
|
|
||||||
// }}
|
|
||||||
search={false}
|
|
||||||
options={{
|
|
||||||
setting: {
|
|
||||||
listsHeight: 400,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
form={{
|
|
||||||
// 由于配置了 transform,提交的参与与定义的不同这里需要转化一下
|
|
||||||
syncToUrl: (values, type) => {
|
|
||||||
if (type === 'get') {
|
|
||||||
return {
|
|
||||||
...values,
|
|
||||||
created_at: [values.startTime, values.endTime],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return values;
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
pagination={{
|
pagination={{
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
onChange: (page) => console.log(page),
|
onChange: (page) => console.log(page),
|
||||||
|
@ -223,29 +140,6 @@ const TreeTablePro: React.FC = () => {
|
||||||
headerTitle="任务管理"
|
headerTitle="任务管理"
|
||||||
toolBarRender={() => [
|
toolBarRender={() => [
|
||||||
<DetailModelForm operationId={OPERATION_BUTTON_TYPE.ADD} description='添加主线任务'/>,
|
<DetailModelForm operationId={OPERATION_BUTTON_TYPE.ADD} description='添加主线任务'/>,
|
||||||
// <Dropdown
|
|
||||||
// key="menu"
|
|
||||||
// menu={{
|
|
||||||
// items: [
|
|
||||||
// {
|
|
||||||
// label: '1st item',
|
|
||||||
// key: '1',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: '2nd item',
|
|
||||||
// key: '1',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: '3rd item',
|
|
||||||
// key: '1',
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// <Button>
|
|
||||||
// <EllipsisOutlined />
|
|
||||||
// </Button>
|
|
||||||
// </Dropdown>,
|
|
||||||
]}></ProTable>
|
]}></ProTable>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue