From 346881d1dffbc521b4207bb9eee8de38680a42d3 Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Thu, 20 Jan 2022 10:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95=E5=8F=8A?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/package.json | 2 +- admin/src/pages/course/card-list/_mock.ts | 120 -------------------- admin/src/pages/course/card-list/index.tsx | 104 ----------------- admin/src/pages/course/card-list/service.ts | 10 -- 4 files changed, 1 insertion(+), 235 deletions(-) delete mode 100644 admin/src/pages/course/card-list/_mock.ts delete mode 100644 admin/src/pages/course/card-list/index.tsx delete mode 100644 admin/src/pages/course/card-list/service.ts diff --git a/admin/package.json b/admin/package.json index c2e6f88..22b037a 100644 --- a/admin/package.json +++ b/admin/package.json @@ -53,7 +53,7 @@ "@ant-design/icons": "^4.5.0", "@ant-design/pro-card": "^1.18.23", "@ant-design/pro-descriptions": "^1.6.8", - "@ant-design/pro-form": "^1.18.3", + "@ant-design/pro-form": "^1.52.12", "@ant-design/pro-layout": "^6.15.3", "@ant-design/pro-list": "^1.21.17", "@ant-design/pro-table": "^2.30.8", diff --git a/admin/src/pages/course/card-list/_mock.ts b/admin/src/pages/course/card-list/_mock.ts deleted file mode 100644 index 0c828c3..0000000 --- a/admin/src/pages/course/card-list/_mock.ts +++ /dev/null @@ -1,120 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import type { Request, Response } from 'express'; -import type { CardListItemDataType } from './data'; - -const titles = [ - 'Alipay', - 'Angular', - 'Ant Design', - 'Ant Design Pro', - 'Bootstrap', - 'React', - 'Vue', - 'Webpack', -]; -const avatars = [ - 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay - 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular - 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design - 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro - 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap - 'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React - 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue - 'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png', // Webpack -]; - -const covers = [ - 'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png', - 'https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png', -]; -const desc = [ - '那是一种内在的东西, 他们到达不了,也无法触及的', - '希望是一个好东西,也许是最好的,好东西是不会消亡的', - '生命就像一盒巧克力,结果往往出人意料', - '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆', - '那时候我只会想自己想要什么,从不想自己拥有什么', -]; - -const user = [ - '付小小', - '曲丽丽', - '林东东', - '周星星', - '吴加好', - '朱偏右', - '鱼酱', - '乐哥', - '谭小仪', - '仲尼', -]; - -function fakeList(count: number): CardListItemDataType[] { - const list = []; - for (let i = 0; i < count; i += 1) { - list.push({ - id: `fake-list-${i}`, - owner: user[i % 10], - title: titles[i % 8], - avatar: avatars[i % 8], - cover: parseInt(`${i / 4}`, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)], - status: ['active', 'exception', 'normal'][i % 3] as - | 'normal' - | 'exception' - | 'active' - | 'success', - percent: Math.ceil(Math.random() * 50) + 50, - logo: avatars[i % 8], - href: 'https://ant.design', - updatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 2 * i).getTime(), - createdAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 2 * i).getTime(), - subDescription: desc[i % 5], - description: - '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。', - activeUser: Math.ceil(Math.random() * 100000) + 100000, - newUser: Math.ceil(Math.random() * 1000) + 1000, - star: Math.ceil(Math.random() * 100) + 100, - like: Math.ceil(Math.random() * 100) + 100, - message: Math.ceil(Math.random() * 10) + 10, - content: - '段落示意:蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。', - members: [ - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png', - name: '曲丽丽', - id: 'member1', - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png', - name: '王昭君', - id: 'member2', - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png', - name: '董娜娜', - id: 'member3', - }, - ], - }); - } - - return list; -} - -function getFakeList(req: Request, res: Response) { - const params = req.query as any; - - const count = Number(params.count) * 1 || 20; - - const result = fakeList(count); - return res.json({ - data: { - list: result, - }, - }); -} - -export default { - 'GET /api/card_fake_list': getFakeList, -}; diff --git a/admin/src/pages/course/card-list/index.tsx b/admin/src/pages/course/card-list/index.tsx deleted file mode 100644 index f321ddb..0000000 --- a/admin/src/pages/course/card-list/index.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { PlusOutlined } from '@ant-design/icons'; -import { Button, Card, List, Typography } from 'antd'; -import { PageContainer } from '@ant-design/pro-layout'; -import { useRequest } from 'umi'; -import { queryFakeList } from './service'; -import type { CardListItemDataType } from './data'; -import styles from './style.less'; - -const { Paragraph } = Typography; - -const CardList = () => { - const { data, loading } = useRequest(() => { - return queryFakeList({ - count: 8, - }); - }); - - const list = data?.list || []; - - const content = ( -
-

- 段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态, - 提供跨越设计与开发的体验解决方案。 -

-
- - {' '} - 快速开始 - - - {' '} - 产品简介 - - - {' '} - 产品文档 - -
-
- ); - - const extraContent = ( -
- 这是一个标题 -
- ); - const nullData: Partial = {}; - return ( - -
- > - rowKey="id" - loading={loading} - grid={{ - gutter: 16, - xs: 1, - sm: 2, - md: 3, - lg: 3, - xl: 4, - xxl: 4, - }} - dataSource={[nullData, ...list]} - renderItem={(item) => { - if (item && item.id) { - return ( - - 操作一, 操作二]} - > - } - title={{item.title}} - description={ - - {item.description} - - } - /> - - - ); - } - return ( - - - - ); - }} - /> -
-
- ); -}; - -export default CardList; diff --git a/admin/src/pages/course/card-list/service.ts b/admin/src/pages/course/card-list/service.ts deleted file mode 100644 index 42b1058..0000000 --- a/admin/src/pages/course/card-list/service.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { request } from 'umi'; -import type { CardListItemDataType } from './data'; - -export async function queryFakeList(params: { - count: number; -}): Promise<{ data: { list: CardListItemDataType[] } }> { - return request('/api/card_fake_list', { - params, - }); -}