From f50ea69905437124f7303a4f41cedb07cefd2f66 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 18 Apr 2023 23:16:33 +0200 Subject: [PATCH] group tasks --- src/App.css | 6 +- src/Components/AppRoutes/index.js | 4 + src/Components/SideMenu/index.js | 23 +--- src/Pages/GroupTask/index.js | 107 ++++++++++++++++ src/Pages/GroupTasks/index.js | 203 ++++++++++++++++++++++++++++++ src/index.css | 7 +- 6 files changed, 325 insertions(+), 25 deletions(-) create mode 100644 src/Pages/GroupTask/index.js create mode 100644 src/Pages/GroupTasks/index.js diff --git a/src/App.css b/src/App.css index 80b0c34..a3885c8 100644 --- a/src/App.css +++ b/src/App.css @@ -1,7 +1,7 @@ .App { display: flex; flex-direction: column; - width: 100vw; + width: 100%; height: 100vh; } @@ -42,8 +42,8 @@ /* PageContent */ .PageContent { - padding-left: 12px; - padding-top: 12px; + padding: 12px; + width: 100%; } /* CameraScan */ diff --git a/src/Components/AppRoutes/index.js b/src/Components/AppRoutes/index.js index e79611d..89f4548 100644 --- a/src/Components/AppRoutes/index.js +++ b/src/Components/AppRoutes/index.js @@ -1,10 +1,14 @@ import { Route, Routes } from "react-router-dom"; import Dashboard from "../../Pages/Dashboard"; +import GroupTasks from "../../Pages/GroupTasks"; +import GroupTask from "../../Pages/GroupTask"; function AppRoutes() { return ( }> + }> + }> ); } diff --git a/src/Components/SideMenu/index.js b/src/Components/SideMenu/index.js index 6eb7ba7..61a80cd 100644 --- a/src/Components/SideMenu/index.js +++ b/src/Components/SideMenu/index.js @@ -1,9 +1,4 @@ -import { - AppstoreOutlined, - CameraOutlined, - ShoppingCartOutlined, - UserOutlined, -} from "@ant-design/icons"; +import { AppstoreOutlined, SnippetsOutlined } from "@ant-design/icons"; import { Menu } from "antd"; import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; @@ -35,19 +30,9 @@ function SideMenu() { key: "/", }, { - label: "Camera Scan", - icon: , - key: "/camera-scan", - }, - { - label: "Orders", - icon: , - key: "/orders", - }, - { - label: "Customers", - icon: , - key: "/customers", + label: "Group Tasks", + icon: , + key: "/group-tasks", }, ]} > diff --git a/src/Pages/GroupTask/index.js b/src/Pages/GroupTask/index.js new file mode 100644 index 0000000..55c3b75 --- /dev/null +++ b/src/Pages/GroupTask/index.js @@ -0,0 +1,107 @@ +import { + Alert, + Button, + Divider, + Form, + Input, + Modal, + Steps, + message, +} from "antd"; +import { useState } from "react"; + +const steps = [ + { + title: "First", + content: "First-content", + }, + { + title: "Second", + content: "Second-content", + }, + { + title: "Last", + content: "Last-content", + }, +]; + +const contentData = [ +
+ + + +
, + "", +

hakki

, +]; + +export default function GroupTask() { + const [current, setCurrent] = useState(0); + const [content, setContent] = useState(contentData[current]); + + const updateContentData = (value) => { + setContent(contentData[value]); + }; + + const next = () => { + setCurrent(current + 1); + updateContentData(current + 1); + }; + + const prev = () => { + setCurrent(current - 1); + updateContentData(current - 1); + }; + + return ( + <> +

GroupTask

+ console.log(value), + }, + { + title: "Label drucken", + description: current === 1 ? content : null, + }, + { + title: "Waiting", + description: current === 2 ? content : null, + }, + ]} + /> +
+ {current < steps.length - 1 && ( + + )} + {current === steps.length - 1 && ( + + )} + {current > 0 && ( + + )} +
+ + Success} + description="ok" + type="success" + showIcon + /> + + ); +} diff --git a/src/Pages/GroupTasks/index.js b/src/Pages/GroupTasks/index.js new file mode 100644 index 0000000..8bae050 --- /dev/null +++ b/src/Pages/GroupTasks/index.js @@ -0,0 +1,203 @@ +import { PlusOutlined } from "@ant-design/icons"; +import { + Badge, + Button, + Divider, + Form, + Input, + InputNumber, + Modal, + Select, + Space, + Table, +} from "antd"; +import { useState } from "react"; +import { Link } from "react-router-dom"; + +const columns = [ + { + title: "ID", + dataIndex: "id", + key: "id", + }, + { + title: "Task Name", + dataIndex: "taskname", + key: "taskname", + }, + { + title: "Step", + dataIndex: "step", + key: "step", + }, + { + title: "Status", + dataIndex: "status", + key: "status", + }, + { + title: "Datetime", + dataIndex: "datetime", + key: "datetime", + }, + { + title: "Action", + dataIndex: "action", + key: "action", + render: () => ( + + View + + ), + }, +]; + +const data = [ + { + key: "1", + id: "12312", + taskname: "Janex Device Acryl Led Lamp", + step: "6 / 6", + status: , + datetime: "2020-01-01 12:00:00", + }, + { + key: "2", + id: "9999", + taskname: "Acryl Glas schneiden", + step: "3 / 6", + status: , + datetime: "2020-01-01 12:00:00", + }, +]; + +export default function GroupTasks() { + const [isModalTaskTypeOpen, setIsModalTaskTypeOpen] = useState(false); + const [currentSelectedModalTaskType, setCurrentSelectedModalTaskType] = + useState(null); + + const showModal = (test) => { + console.log(test); + setIsModalTaskTypeOpen(true); + }; + + const handleCancel = () => { + setIsModalTaskTypeOpen(false); + }; + + const GroupTaskGlobalInputs = ({ taskType }) => { + if (taskType === "produktionstask1") { + return ( + <> + +

+ Fill in the global values for the task +

+
+ + + + + + +
+ + ); + } else if (taskType === "printer") { + return ( + <> + +

+ Fill in the global values for the task +

+
+ + + +
+ + ); + } + + return

{taskType}

; + }; + + return ( + <> +

GROUP TASKS

+ + + + + + + + + + + + , + ]} + > + + + + + + ); +} + +function GroupTask({ category, dataSource, showModal }) { + return ( + <> + {category} + + + + + + ); +} diff --git a/src/index.css b/src/index.css index 4a1df4d..f9875ed 100644 --- a/src/index.css +++ b/src/index.css @@ -1,8 +1,9 @@ body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", - "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", - sans-serif; + /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",sans-serif;*/ + font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }