From c0ac04289d3c8b8fcf1c66477bf9ff69a2100c65 Mon Sep 17 00:00:00 2001 From: ZLY Date: Tue, 19 Aug 2025 11:02:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(components):=20=E6=96=B0=E5=A2=9E=20Custom?= =?UTF-8?q?Card=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/scene/engineering.tsx | 98 +++++++++++++++++++ src/pages/scene/index.tsx | 37 ++++++- src/pages/scene/style/engineering.module.less | 6 ++ src/pages/scene/style/index.module.less | 2 + 4 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 src/pages/scene/engineering.tsx create mode 100644 src/pages/scene/style/engineering.module.less create mode 100644 src/pages/scene/style/index.module.less diff --git a/src/pages/scene/engineering.tsx b/src/pages/scene/engineering.tsx new file mode 100644 index 0000000..d5e76b6 --- /dev/null +++ b/src/pages/scene/engineering.tsx @@ -0,0 +1,98 @@ +import React, { useState } from 'react'; +import style from './style/engineering.module.less'; +import { Input, Grid, Card, Result, Pagination } from '@arco-design/web-react'; +import { IconPlus, IconApps } from '@arco-design/web-react/icon'; + +const InputSearch = Input.Search; +const Row = Grid.Row; +const Col = Grid.Col; + +interface EngineeringProps { + dataType: 'my' | 'public', + showAdd?: boolean, +} + + +const Engineering: React.FC = ({ dataType, showAdd = true }) => { + const [searchValue, setSearchValue] = useState(''); + const [count, setCount] = useState(12); + + const onSearchHandle = (value: string) => { + if (!value) return; + console.log('状态值:', searchValue); + }; + + const handleChange = (value: string) => { + setSearchValue(value); + }; + return ( + <> +
+ {/*搜索*/} + + + + + + {/*卡片模式数据渲染*/} + + + {/*新建工程按钮*/} + {showAdd && ( + + } + > + + )} + + {/*遍历生成4个卡片*/} + {Array.from({ length: count }).map((item, index) => ( + + + } + > + + + ))} + + + + + + +
+ + ); +}; + +export default Engineering; \ No newline at end of file diff --git a/src/pages/scene/index.tsx b/src/pages/scene/index.tsx index 0da8716..4419f17 100644 --- a/src/pages/scene/index.tsx +++ b/src/pages/scene/index.tsx @@ -1,10 +1,43 @@ import React from 'react'; +import CustomCard from '@/components/CustomCard'; +import Engineering from './engineering'; +import { Tabs, Typography } from '@arco-design/web-react'; +import { IconUser, IconPublic } from '@arco-design/web-react/icon'; +import style from './style/index.module.less'; + +const TabPane = Tabs.TabPane; function Scene() { return ( <> -
- 所有应用 +
+ + {/*tabs工具栏*/} + + + + 我的工程 + + }> + + + + + + + 公开工程 + + }> + + + + + +
); diff --git a/src/pages/scene/style/engineering.module.less b/src/pages/scene/style/engineering.module.less new file mode 100644 index 0000000..49b6bd2 --- /dev/null +++ b/src/pages/scene/style/engineering.module.less @@ -0,0 +1,6 @@ +.engineeringContainer { + .cardStyle { + margin: 5px; + border: 1px solid var(--color-neutral-3); + } +} \ No newline at end of file diff --git a/src/pages/scene/style/index.module.less b/src/pages/scene/style/index.module.less new file mode 100644 index 0000000..204049c --- /dev/null +++ b/src/pages/scene/style/index.module.less @@ -0,0 +1,2 @@ +.container { +} \ No newline at end of file