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") ?
+ <>
+
+
+ > : <>
+
+
+ >
+ }
+ {/**/}
+ 任务状态:
+
+ {/**/}
}
diff --git a/src/app/ui/task/four/index.modules.css b/src/app/ui/task/four/index.modules.css
index f324857..24eee90 100644
--- a/src/app/ui/task/four/index.modules.css
+++ b/src/app/ui/task/four/index.modules.css
@@ -4,7 +4,7 @@ div{
.leftUp{
width: 49%;
height: 45vh;
- background: red;
+ /*background: red;*/
}
.up{
width: 2%;
@@ -14,7 +14,7 @@ div{
.rightUp{
width: 49%;
height: 45vh;
- background: yellow;
+ /*background: yellow;*/
}
.left{
width: 100%;
@@ -25,13 +25,13 @@ div{
.leftDown{
width: 49%;
height: 45vh;
- background: gray;
+ /*background: gray;*/
}
.rightDown{
/*float: right;*/
width: 49%;
height: 45vh;
- background: green;
+ /*background: green;*/
}
/*#tenLeft {*/
diff --git a/src/app/ui/task/project/TreeTable.tsx b/src/app/ui/task/project/TreeTable.tsx
index e0f1240..89eee9e 100644
--- a/src/app/ui/task/project/TreeTable.tsx
+++ b/src/app/ui/task/project/TreeTable.tsx
@@ -1,12 +1,11 @@
'use client'
import React, {useEffect, useState} from 'react';
-import {Button, ColorPicker, Dropdown, MenuProps, Space, Switch, Table} from 'antd';
+import {Table} from 'antd';
import type {TableColumnsType, TableProps} from 'antd';
import {getTaskTreeResult, taskPriorityList, taskStateList, taskTreeResult} from "@/app/lib/task/project/data";
import {DataType, ResponseVO, ResultPage} from "@/app/lib/definitions";
-import {DownOutlined} from "@ant-design/icons";
-import {useSearchParams, usePathname, useRouter} from 'next/navigation';
import OperationButton from "@/app/ui/task/project/OperationButton";
+import dayjs from "dayjs";
type TableRowSelection = TableProps['rowSelection'];
@@ -24,12 +23,12 @@ const columns: TableColumnsType = [
key: 'name',
width: '20%',
},
- {
- title: '任务描述',
- dataIndex: 'description',
- width: '30%',
- key: 'description',
- },
+ // {
+ // title: '任务描述',
+ // dataIndex: 'description',
+ // // width: '30%',
+ // key: 'description',
+ // },
{
title: '任务状态',
dataIndex: 'state',
@@ -42,6 +41,12 @@ const columns: TableColumnsType = [
// width: '10%',
// key: 'priority',
// },
+ {
+ title: '期望开始时间',
+ dataIndex: 'expectedStartTime',
+ width: '10%',
+ key: 'expectedStartTime',
+ },
{
title: '操作',
dataIndex: 'action',
@@ -79,23 +84,27 @@ const TreeTable: React.FC = (props) => {
)
item.state = taskStateList.find(taskState => taskState.code === item.state?.toString())?.name;
item.priority = taskPriorityList.find(taskPriority => taskPriority.code === item.priority?.toString())?.name;
+ if (item.expectedStartTime) {
+ item.expectedStartTime = dayjs(item.expectedStartTime).format('YYYY-MM-DD HH:mm:ss')
+ }
if (item.children && item.children.length > 0) {
- recursionActionChild(item.children)
- } else {
- item.children = undefined
+ if (item.children && item.children.length > 0) {
+ recursionActionChild(item.children)
+ } else {
+ item.children = undefined
+ }
}
}
}
-
// const [checkStrictly, setCheckStrictly] = useState(false);
const [data, setData] = useState([]);
const [pageNumber, setPageNumber] = useState(1);
- const [pageSize, setPageSize] = useState(10);
+ const [pageSize, setPageSize] = useState(100);
const refreshDate = (): void => {
getTaskTreeResult(JSON.stringify({
pageSize,
pageNumber,
- data: [props.search]
+ data: props.search
})).then((result: ResponseVO>) => {
if (result.status.success) {
recursionActionChild(result.data.content);
@@ -105,7 +114,7 @@ const TreeTable: React.FC = (props) => {
}
useEffect(() => {
refreshDate();
- }, []);
+ }, [props.search]);
return (
<>
{/**/}
@@ -116,6 +125,7 @@ const TreeTable: React.FC = (props) => {
columns={columns}
// rowSelection={{ ...rowSelection, checkStrictly}}
dataSource={data}
+ pagination={{ pageSize: 10 }}
/>
>
);