diff --git a/src/app/lib/task/project/data.tsx b/src/app/lib/task/project/data.tsx index 1761a81..7724c86 100644 --- a/src/app/lib/task/project/data.tsx +++ b/src/app/lib/task/project/data.tsx @@ -1,6 +1,23 @@ import {unstable_noStore as noStore} from 'next/cache'; import axios, {AxiosResponse} from "axios"; import {DataType, DictType, ResponseVO, ResultPage} from "@/app/lib/definitions"; +import { URL } from 'url'; +export async function getTaskTreeResult(requestParam:string): Promise>> { + noStore(); + try { + + // 使用 Axios 发送 POST 请求获取数据 + const response: AxiosResponse>> = await axios.get( + 'http://localhost:8090/search/task_message_tree?search='+encodeURIComponent(requestParam)); + // 从响应中提取数据并返回 + return response.data; + } catch (error) { + // 处理错误 + console.error('Error fetching data:', error); + // 返回一个默认值或者抛出错误 + throw new Error('Failed to fetch data'); + } +} export async function taskTreeResult(): Promise>> { noStore(); @@ -111,26 +128,26 @@ export async function editPriority(id:number,priority:number): Promise
- +
向上重要
-
- +
+
@@ -54,14 +54,14 @@ export default function Layout({children}: { children: React.ReactNode }) {
- +
向上重要
{/*
{children}
*/}
- +
diff --git a/src/app/ui/task/AdvancedSearchForm.tsx b/src/app/ui/task/AdvancedSearchForm.tsx new file mode 100644 index 0000000..969b46a --- /dev/null +++ b/src/app/ui/task/AdvancedSearchForm.tsx @@ -0,0 +1,119 @@ +'use client' +import {Button, Col, Form, Input, Row, Select, Space, theme} from "antd"; +import React, {useState} from "react"; +import {DownOutlined} from "@ant-design/icons"; +import {OperationButtonProps} from "@/app/ui/task/project/OperationButton"; + +const AdvancedSearchForm = () => { + const { token } = theme.useToken(); + const [form] = Form.useForm(); + const [expand, setExpand] = useState(false); + const [searchFields, setSearchFields] = useState([ + + , + + + ) : ( + + + + )} + , + ); + } + return children; + }; + + const onFinish = (values: any) => { + console.log('Received values of form: ', values); + }; + + return ( +
+ {searchFields} + {/*
*/} + {/* */} + + + + + + {/* {*/} + {/* setExpand(!expand);*/} + {/* }}*/} + {/*> Collapse*/} + {/**/} + {/* */} + {/*
*/} +
+ ); +}; +export default AdvancedSearchForm; diff --git a/src/app/ui/task/TitleOperation.tsx b/src/app/ui/task/TitleOperation.tsx new file mode 100644 index 0000000..87c7c99 --- /dev/null +++ b/src/app/ui/task/TitleOperation.tsx @@ -0,0 +1,26 @@ +import React from "react"; +import {Button} from "antd"; +import {usePathname, useRouter} from "next/navigation"; +import {DetailFormProps} from "@/app/ui/task/project/DetailForm"; +import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm"; +import {OPERATION_BUTTON_TYPE} from "@/app/lib/task/project/data"; +import AdvancedSearchForm from "@/app/ui/task/AdvancedSearchForm"; + +// export const TitleOperation: React.FC= () => +export const TitleOperation: React.FC = () => { + const {replace} = useRouter(); + const [currentPath, setCurrentPath] = React.useState(usePathname()); + return
+ + { + currentPath.startsWith("/task/project") ? : + } + +
+} diff --git a/src/app/ui/task/project/DetailForm.tsx b/src/app/ui/task/project/DetailForm.tsx index 3e8a5b5..cd4c692 100644 --- a/src/app/ui/task/project/DetailForm.tsx +++ b/src/app/ui/task/project/DetailForm.tsx @@ -199,7 +199,7 @@ export const DetailForm: React.FC = (props) => {