From 667faed54d311ec0315f93a59bc84b8e8bcda46d Mon Sep 17 00:00:00 2001 From: 1708-huayu <57060237+1708-huayu@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:54:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailForm/index.js | 34 +++-- src/components/ParentTask/index.js | 225 +++++++++-------------------- src/pages/Home/index.js | 2 +- src/pages/ToDoList/index.js | 40 ++--- src/utils/index.js | 11 +- 5 files changed, 124 insertions(+), 188 deletions(-) diff --git a/src/components/DetailForm/index.js b/src/components/DetailForm/index.js index 9487795..7ff01bd 100644 --- a/src/components/DetailForm/index.js +++ b/src/components/DetailForm/index.js @@ -11,16 +11,30 @@ import { import ParentTask from "../ParentTask"; import DatePickerItem from "../DataPickerItem" import "./index.css" +import {addTask} from "../../utils"; export default () => { - const now = new Date() + const [form] = Form.useForm(); const onFinish = (values) => { - Dialog.alert({ - content:
{JSON.stringify(values, null, 2)}, + // Dialog.alert({ + // content:
{JSON.stringify(values, null, 2)}, + // }) + console.log(values) + if (values.pidArray===undefined){ + values.pid='0' + }else { + values.pid=values.pidArray[values.pidArray.length-1]; + } + addTask(values).then(values=>{ + Dialog.alert({ + content: '添加任务成功' + values.data, + onConfirm:()=>{} + }) }) } return ( <>