From 847f013b33f4106b568943824c372d987045ad37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9F=E8=B4=A4?= Date: Sat, 26 Aug 2023 17:06:49 +0800 Subject: [PATCH] chore: update pnpm lock file --- src/pages/list/search/articles/index.tsx | 226 +++++++++++++++++++++++ src/pages/list/search/projects/index.tsx | 2 + 2 files changed, 228 insertions(+) diff --git a/src/pages/list/search/articles/index.tsx b/src/pages/list/search/articles/index.tsx index e69de29b..e11cef07 100644 --- a/src/pages/list/search/articles/index.tsx +++ b/src/pages/list/search/articles/index.tsx @@ -0,0 +1,226 @@ +import { LikeOutlined, LoadingOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; +import { useRequest } from '@umijs/max'; +import { Button, Card, Col, Form, List, Row, Select, Tag } from 'antd'; +import type { FC } from 'react'; +import React from 'react'; +import ArticleListContent from './components/ArticleListContent'; +import StandardFormRow from './components/StandardFormRow'; +import TagSelect from './components/TagSelect'; +import type { ListItemDataType } from './data.d'; +import { queryFakeList } from './service'; +import useStyles from './style.style'; + +const { Option } = Select; +const FormItem = Form.Item; + +const pageSize = 5; + +const Articles: FC = () => { + const [form] = Form.useForm(); + + const { styles } = useStyles(); + + const { data, reload, loading, loadMore, loadingMore } = useRequest( + () => { + return queryFakeList({ + count: pageSize, + }); + }, + { + loadMore: true, + }, + ); + + const list = data?.list || []; + + const setOwner = () => { + form.setFieldsValue({ + owner: ['wzj'], + }); + }; + + const owners = [ + { + id: 'wzj', + name: '我自己', + }, + { + id: 'wjh', + name: '吴家豪', + }, + { + id: 'zxx', + name: '周星星', + }, + { + id: 'zly', + name: '赵丽颖', + }, + { + id: 'ym', + name: '姚明', + }, + ]; + + const IconText: React.FC<{ + type: string; + text: React.ReactNode; + }> = ({ type, text }) => { + switch (type) { + case 'star-o': + return ( + + + {text} + + ); + case 'like-o': + return ( + + + {text} + + ); + case 'message': + return ( + + + {text} + + ); + default: + return null; + } + }; + + const formItemLayout = { + wrapperCol: { + xs: { span: 24 }, + sm: { span: 24 }, + md: { span: 12 }, + }, + }; + + const loadMoreDom = list.length > 0 && ( +
+ +
+ ); + + return ( + <> + +
+ + + + 类目一 + 类目二 + 类目三 + 类目四 + 类目五 + 类目六 + 类目七 + 类目八 + 类目九 + 类目十 + 类目十一 + 类目十二 + + + + + + + + + 只看自己的 + + + + + + + + + + + + + + + + +
+
+ + + size="large" + loading={loading} + rowKey="id" + itemLayout="vertical" + loadMore={loadMoreDom} + dataSource={list} + renderItem={(item) => ( + , + , + , + ]} + extra={
} + > + + {item.title} + + } + description={ + + Ant Design + 设计语言 + 蚂蚁金服 + + } + /> + + + )} + /> + + + ); +}; + +export default Articles; diff --git a/src/pages/list/search/projects/index.tsx b/src/pages/list/search/projects/index.tsx index c4be6ef7..2edec8ca 100644 --- a/src/pages/list/search/projects/index.tsx +++ b/src/pages/list/search/projects/index.tsx @@ -9,7 +9,9 @@ import TagSelect from './components/TagSelect'; import type { ListItemDataType } from './data.d'; import { queryFakeList } from './service'; import useStyles from './style.style'; + dayjs.extend(relativeTime); + const { Option } = Select; const FormItem = Form.Item; const { Paragraph } = Typography;