diff --git a/src/components/card/CardProjAgent.tsx b/src/components/card/CardProjAgent.tsx new file mode 100644 index 0000000..4b6828d --- /dev/null +++ b/src/components/card/CardProjAgent.tsx @@ -0,0 +1,65 @@ +import './card-proj-agent.css' +import {OrderedListOutlined, NumberOutlined, SearchOutlined} from "@ant-design/icons"; +import { Tag } from 'antd'; + +export default function CardProjAgent() { + return ( +
+
+
+ 项目名称 +
+
+ 代理商:SDFSDF + 订单号:XXXXXXXXXXXXX +
+
+
+
+
+
+ 金额¥:500 +
+
+ 2024-03-05 17:22:02 +
+
+
+
+ + + 协议清单 + + + + 补正数量 + +
+
+ + + 查看结果 + +
+
+
+
+
+ + 待结单 + 已接单 + 未接单 + + + 已签署协议 + 未签署协议 + + + 进行中 + 完成 + 终止 + +
+
+ ) +} \ No newline at end of file diff --git a/src/components/card/card-proj-agent.css b/src/components/card/card-proj-agent.css new file mode 100644 index 0000000..865df57 --- /dev/null +++ b/src/components/card/card-proj-agent.css @@ -0,0 +1,79 @@ +.card-proj-agent { + border-radius: 6px; + border: 1px solid var(--color-border); + padding: 15px; +} + +.card-proj-agent .left { + position: unset; +} + +.card-proj-agent .right { + margin: 0; +} + +.card-proj-agent .title { + display: flex; + justify-content: space-between; + align-items: center; +} + +.card-proj-agent hr { + border-color: var(--color-border); + border-style: dashed; + border-left: 0; + border-bottom: 0; + border-right: 0; + margin-block-start: 10px; + margin-block-end: 10px; +} + +.card-proj-agent .title .left { + padding: 5px; + font-weight: bold; +} + +.card-proj-agent .title .right { + padding: 5px; +} + +.card-proj-agent .title .right span { + margin-left: 10px; +} + +.card-proj-agent .title .right span:first-child { + margin-left: 0; +} + +.card-proj-agent .body { + width: unset; + border: unset !important; + padding: 0 !important; +} + +.card-proj-agent .body .line { + display: flex; + justify-content: space-between; + align-items: center; + padding: 5px 0; +} + +.card-proj-agent .body .line .left { + display: flex; +} + +.card-proj-agent .body .line .left > span { + margin-right: 10px; +} + +.card-proj-agent .body .line .anticon { + margin-right: 5px; +} + +.card-proj-agent .body .line .right > span { + margin-left: 5px; +} + +.card-proj-agent .tail { +} + diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 5646d9c..ea26cc1 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -6,7 +6,9 @@ import type {SearchProps} from 'antd/es/input/Search'; const {Search} = Input; -const onSearch: SearchProps['onSearch'] = (value, _e, info) => console.log(info?.source, value); +const onSearch: SearchProps['onSearch'] = (value, _e, info) => { + console.log(info?.source, value) +}; export default function ListProj() { @@ -14,7 +16,6 @@ export default function ListProj() { const listRef: MutableRefObject = useRef(null); const domHeight = window.innerHeight - 301; - console.log(domHeight) return (
diff --git a/src/components/list/ListProjAgent.tsx b/src/components/list/ListProjAgent.tsx new file mode 100644 index 0000000..a602fa1 --- /dev/null +++ b/src/components/list/ListProjAgent.tsx @@ -0,0 +1,40 @@ +import './list-proj-agent.css'; +import CardProjAgent from "../card/CardProjAgent.tsx"; +import {useRef, MutableRefObject} from "react"; +import {Input, Pagination} from 'antd'; +import type {SearchProps} from 'antd/es/input/Search'; + +const {Search} = Input; + +const onSearch: SearchProps['onSearch'] = (value, _e, info) => { + console.log(info?.source, value) +}; + +export default function ListProjAgent() { + + const listProjRef: MutableRefObject = useRef(null); + const listRef: MutableRefObject = useRef(null); + + const domHeight = window.innerHeight - 301; + + return ( +
+
+ +
+
+
+ + + + + + +
+
+ +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/list/list-proj-agent.css b/src/components/list/list-proj-agent.css new file mode 100644 index 0000000..981abfc --- /dev/null +++ b/src/components/list/list-proj-agent.css @@ -0,0 +1,35 @@ +.list-proj-agent { + width: 100%; + padding: 15px 0; +} + +.list-proj-agent .top { + padding: 0 15px 15px 15px; + display: flex; + justify-content: right; + border-bottom: 1px solid var(--color-border); +} + +.list-proj-agent .body { + width: unset; + margin: 0; +} + +.list-proj-agent .list { + padding: 15px; + overflow: auto; +} + +.list-proj-agent .body .card-proj-agent { + margin-bottom: 10px; +} +.list-proj-agent .body .card-proj-agent:last-child { + margin-bottom: 0; +} + +.list-proj-agent .body .page { + border-top: 1px solid var(--color-border); + padding-top: 15px; + display: flex; + justify-content: right; +} \ No newline at end of file diff --git a/src/context/Context.ts b/src/context/Context.ts deleted file mode 100644 index 20f4168..0000000 --- a/src/context/Context.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {createContext} from "react"; -import axios from 'axios'; - -axios.defaults.baseURL = 'https://localhost:8080'; - -export const Axios = createContext(axios) \ No newline at end of file diff --git a/src/context/Context.tsx b/src/context/Context.tsx new file mode 100644 index 0000000..af3703e --- /dev/null +++ b/src/context/Context.tsx @@ -0,0 +1,11 @@ +import {Context, createContext} from "react"; +import axios from 'axios'; +import {BreadcrumbItemType, BreadcrumbSeparatorType} from "antd/es/breadcrumb/Breadcrumb"; + +axios.defaults.baseURL = 'https://localhost:8080'; + +export const Axios = createContext(axios) + +export const Navs:Context = createContext([{ + title: 首页 +}]) \ No newline at end of file diff --git a/src/layout/body/Body.tsx b/src/layout/body/Body.tsx index 16b15e5..4c20161 100644 --- a/src/layout/body/Body.tsx +++ b/src/layout/body/Body.tsx @@ -1,11 +1,16 @@ import './body.css' import {createBrowserRouter, RouterProvider} from 'react-router-dom'; import Index from '../../route/index'; +import ProjType from "../../route/proj/ProjType.tsx"; const router = createBrowserRouter([ { path: '/', element: + }, + { + path: '/proj-type', + element: } ]) diff --git a/src/layout/nav/Nav.tsx b/src/layout/nav/Nav.tsx index 8907d6d..f77dd06 100644 --- a/src/layout/nav/Nav.tsx +++ b/src/layout/nav/Nav.tsx @@ -1,19 +1,16 @@ import './nav.css'; +import {Breadcrumb } from 'antd'; +import {useContext} from "react"; +import {Navs} from '../../context/Context.tsx'; export default function Nav() { + + const [navs, _setNavs] = useContext(Navs) + console.log(navs) + return (
-
    -
  • - 首页 -
  • -
  • - 首页 -
  • -
  • - 首页 -
  • -
+
) } \ No newline at end of file diff --git a/src/route/index/index.tsx b/src/route/index/index.tsx index 67c1fb2..f7115ea 100644 --- a/src/route/index/index.tsx +++ b/src/route/index/index.tsx @@ -1,49 +1,58 @@ import './index.css'; -import {MouseEvent} from "react"; +import {MouseEvent, useState} from "react"; +import {useNavigate} from "react-router-dom"; import {IMenuListItem, IMenuWithTopButton} from "../../interfaces/menu/IMenuWithTopButton.ts"; import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx"; import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; import ListProj from "../../components/list/ListProj.tsx"; - -const projMenu: IMenuWithTopButton = { - button: { - name: '创建项目', - handle(e: MouseEvent) { - console.log(e) - } - }, - list: [ - {id: 'proj1', icon: './vite.svg', name: '全部项目'}, - {id: 'proj2', icon: './vite.svg', name: '进行中的'}, - {id: 'proj3', icon: './vite.svg', name: '已完成的'} - ], - handleListItem(e: MouseEvent, index: number, item: IMenuListItem) { - console.log(e); - console.log(index); - console.log(item) - } -} - -const agentMenu: IMenuWithTopButton = { - button: { - name: '代理服务', - handle(e: MouseEvent) { - console.log(e) - } - }, - list: [ - {id: 'agent1', icon: './vite.svg', name: '全部项目'}, - {id: 'agent2', icon: './vite.svg', name: '进行中的'}, - {id: 'agent3', icon: './vite.svg', name: '已完成的'}, - ], - handleListItem(e: MouseEvent, index: number, item: IMenuListItem) { - console.log(e); - console.log(index); - console.log(item) - } -} +import ListProjAgent from "../../components/list/ListProjAgent.tsx"; export default function Index() { + + const navigate = useNavigate(); + const [listType, setListType] = useState('proj'); + + const projMenu: IMenuWithTopButton = { + button: { + name: '创建项目', + handle(e: MouseEvent) { + console.log(e) + navigate('/proj-type') + } + }, + list: [ + {id: 'proj1', icon: './vite.svg', name: '全部项目'}, + {id: 'proj2', icon: './vite.svg', name: '进行中的'}, + {id: 'proj3', icon: './vite.svg', name: '已完成的'} + ], + handleListItem(e: MouseEvent, index: number, item: IMenuListItem) { + console.log(e); + console.log(index); + console.log(item) + setListType('proj'); + } + } + + const agentMenu: IMenuWithTopButton = { + button: { + name: '代理服务', + handle(e: MouseEvent) { + console.log(e) + } + }, + list: [ + {id: 'agent1', icon: './vite.svg', name: '全部项目'}, + {id: 'agent2', icon: './vite.svg', name: '进行中的'}, + {id: 'agent3', icon: './vite.svg', name: '已完成的'}, + ], + handleListItem(e: MouseEvent, index: number, item: IMenuListItem) { + console.log(e); + console.log(index); + console.log(item) + setListType('projAgent'); + } + } + return (
@@ -59,9 +68,7 @@ export default function Index() { handleListItem={agentMenu.handleListItem} />
-
- -
+
{listType === 'proj' ? : }
) } \ No newline at end of file diff --git a/src/route/proj/ProjType.tsx b/src/route/proj/ProjType.tsx new file mode 100644 index 0000000..bf5d9da --- /dev/null +++ b/src/route/proj/ProjType.tsx @@ -0,0 +1,9 @@ +import './proj-type.css' + +export default function ProjType() { + return ( +
+ +
+ ) +} \ No newline at end of file diff --git a/src/route/proj/proj-type.css b/src/route/proj/proj-type.css new file mode 100644 index 0000000..e69de29