diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 608bc6f..f79dd85 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -15,7 +15,7 @@ export default function RootLayout({ }>) { return ( - {children} + {children} ); } diff --git a/src/app/lib/definitions.ts b/src/app/lib/definitions.ts index 1cb2af3..50fcf29 100644 --- a/src/app/lib/definitions.ts +++ b/src/app/lib/definitions.ts @@ -39,7 +39,7 @@ export type DataType ={ priority: number|string|undefined; type:number; action?:React.ReactNode; - expectedStartTime?:Date; + expectedStartTime?:Date|string; expectedEndTime?:Date; expectedTimeRange?:(string|Dayjs)[]; actualStartTime?:Date; diff --git a/src/app/task/four/layout.tsx b/src/app/task/four/layout.tsx index 6bd0d34..34ca3fb 100644 --- a/src/app/task/four/layout.tsx +++ b/src/app/task/four/layout.tsx @@ -2,7 +2,8 @@ import SideNav from '@/app/ui/dashboard/sidenav'; import TreeTable from "@/app/ui/task/project/TreeTable"; import '@/app/ui/task/four/index.modules.css' -import {useEffect} from "react"; +import {useContext, useEffect} from "react"; +import LocalContext from "@/app/ui/LocalContent"; export default function Layout({children}: { children: React.ReactNode }) { // useEffect(() => { @@ -33,12 +34,30 @@ export default function Layout({children}: { children: React.ReactNode }) { // @ts-ignore document.getElementById('tenLeft').style.fontSize = divHeight/6*4 + 'px'; }, []); - + const data = useContext(LocalContext); + console.log('data-data.taskState',data.taskState,); + const leftUp = [{name:"priority",value:"3",operateType:"="}]; + const rightUp =[{name:"priority",value:"2",operateType:"="}]; + const leftDown = [{name:"priority",value:"1",operateType:"="}]; + const rightDown = [{name:"priority",value:"0",operateType:"="}]; + if (data.taskState.length>0){ + leftUp.push({name:"state",value:data.taskState,operateType:"IN"}); + rightUp.push({name:"state",value:data.taskState,operateType:"IN"}); + leftDown.push({name:"state",value:data.taskState,operateType:"IN"}); + rightDown.push({name:"state",value:data.taskState,operateType:"IN"}); + } + if (data.expectedStartTime.length>0){ + const parse = JSON.parse(data.expectedStartTime); + leftUp.push(...parse); + rightUp.push(...parse); + leftDown.push(...parse); + rightDown.push(...parse); + } return (
- +
@@ -46,7 +65,7 @@ export default function Layout({children}: { children: React.ReactNode }) {
- +
@@ -54,14 +73,14 @@ export default function Layout({children}: { children: React.ReactNode }) {
- +
向上重要
{/*
{children}
*/}
- +
diff --git a/src/app/task/layout.tsx b/src/app/task/layout.tsx index 1e463ed..35ccd81 100644 --- a/src/app/task/layout.tsx +++ b/src/app/task/layout.tsx @@ -1,12 +1,21 @@ 'use client' import React from "react"; import {TitleOperation} from "@/app/ui/task/TitleOperation"; +import LocalContext from "../ui/LocalContent"; +import dayjs from "dayjs"; export default function Layout({children}: { children: React.ReactNode }) { - + const [taskState, setTaskState] = React.useState('8,9') + let expectStartTimeList=[]; + expectStartTimeList.push({'name':"expectedStartTime",'value':dayjs().subtract(7,'day'),'operateType':">="}); + expectStartTimeList.push({'name':"expectedStartTime",'value':dayjs().add(7,'day'),'operateType':"<"}) + const [expectedStartTime, setExpectedStartTime] = React.useState(JSON.stringify(expectStartTimeList)) return (
- - {children}
+ + + {children} + + ); } diff --git a/src/app/task/list/page.tsx b/src/app/task/list/page.tsx new file mode 100644 index 0000000..e9e36c9 --- /dev/null +++ b/src/app/task/list/page.tsx @@ -0,0 +1,12 @@ +import TreeTable from "@/app/ui/task/project/TreeTable"; +import TreeTablePro from "@/app/ui/task/project/TreeTablePro"; + +const Page: React.FC = () => { + return ( + <> + + + ); +}; + +export default Page; diff --git a/src/app/ui/LocalContent.tsx b/src/app/ui/LocalContent.tsx new file mode 100644 index 0000000..3ea2f10 --- /dev/null +++ b/src/app/ui/LocalContent.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +const LocalContext = React.createContext({'taskState':'','expectedStartTime':''}); + +export default LocalContext; diff --git a/src/app/ui/task/TitleOperation.modules.css b/src/app/ui/task/TitleOperation.modules.css new file mode 100644 index 0000000..fcceb82 --- /dev/null +++ b/src/app/ui/task/TitleOperation.modules.css @@ -0,0 +1,3 @@ +.ant-select-selection-overflow-item-suffix{ + visibility: hidden; +} diff --git a/src/app/ui/task/TitleOperation.tsx b/src/app/ui/task/TitleOperation.tsx index 5dbe971..1262e8e 100644 --- a/src/app/ui/task/TitleOperation.tsx +++ b/src/app/ui/task/TitleOperation.tsx @@ -1,25 +1,91 @@ import React from "react"; -import {Button} from "antd"; +import {Button, DatePicker, Flex, Select, Space} 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"; -import CustomSearchForm from "@/app/ui/task/CustomSearchForm"; -// export const TitleOperation: React.FC= () => -export const TitleOperation: React.FC = () => { +import {OPERATION_BUTTON_TYPE, taskStateList} from "@/app/lib/task/project/data"; +import './TitleOperation.modules.css' +import dayjs from "dayjs"; +interface TitleOperationProps { + setTaskState: (value: string) => void; + setExpectedStartTime:(value:string)=>void; +} + + +export const TitleOperation: React.FC = ({setTaskState,setExpectedStartTime}: TitleOperationProps) => { const {replace} = useRouter(); const [currentPath, setCurrentPath] = React.useState(usePathname()); - return
- - {currentPath.startsWith("/task/project") ? : - } - -
+ const {RangePicker} = DatePicker; + return + + {currentPath.startsWith("/task/project") ? + <> + + + : + currentPath.startsWith("/task/list") ? + <> + + + : <> + + + + } + {/**/} + 任务状态: +