diff --git a/src/components/DescriptionList/index.md b/src/components/DescriptionList/index.md index 377d03513c91022f05e6c6a3a6c5fc52c177002f..364fa107e5ced5e99789ae1d447833dd6a4b3fe8 100644 --- a/src/components/DescriptionList/index.md +++ b/src/components/DescriptionList/index.md @@ -5,7 +5,7 @@ cols: 1 order: 4 --- -描述列表用来展示一系列文本信息。 +成组展示多个只读字段,常见于详情页的信息展示。 ## API diff --git a/src/components/HeaderSearch/demo/basic.md b/src/components/HeaderSearch/demo/basic.md index 733e5555b2f24e2ff7c7120f3e7ba3740ffbc858..67703459ceab3329bf95cfe9af9fb9ceded4149a 100644 --- a/src/components/HeaderSearch/demo/basic.md +++ b/src/components/HeaderSearch/demo/basic.md @@ -3,7 +3,7 @@ order: 0 title: 全局搜索 --- -通常放在全局导航条右侧。 +通常放置在导航工具条右侧。(点击搜索图标预览效果) ````jsx import HeaderSearch from 'ant-design-pro/lib/HeaderSearch'; diff --git a/src/components/HeaderSearch/index.md b/src/components/HeaderSearch/index.md index 106fac0d65a91bf54caaf188f829df5556da1c4f..7064228de1d4605916aebee0f9c4c75b7093295a 100644 --- a/src/components/HeaderSearch/index.md +++ b/src/components/HeaderSearch/index.md @@ -5,7 +5,7 @@ cols: 1 order: 8 --- -用在顶部导航上,提供应用全局搜索入口。 +通常作为全局搜索的入口,放置在导航工具条右侧。 ## API diff --git a/src/components/NoticeIcon/demo/basic.md b/src/components/NoticeIcon/demo/basic.md index 26835db4b449f77d59ec2ff9d7c3d26391a14eac..dc9afeaa84b67071ac477b3cdda7f1e6b3acda9f 100644 --- a/src/components/NoticeIcon/demo/basic.md +++ b/src/components/NoticeIcon/demo/basic.md @@ -3,7 +3,7 @@ order: 1 title: 通知图标 --- -通常用在全局导航上。 +通常用在导航工具栏上。 ````jsx import NoticeIcon from 'ant-design-pro/lib/NoticeIcon'; diff --git a/src/components/NoticeIcon/demo/popover.md b/src/components/NoticeIcon/demo/popover.md index 4ec8150918e4c36f4fa2213c2b2e6f1e402dda54..6c047b7ed2a062fe17e6e689756286b24e599a6d 100644 --- a/src/components/NoticeIcon/demo/popover.md +++ b/src/components/NoticeIcon/demo/popover.md @@ -3,32 +3,94 @@ order: 2 title: 带浮层卡片 --- -点击展开通知卡片,展现多种类型的通知,通常放在顶部通栏。 +点击展开通知卡片,展现多种类型的通知,通常放在导航工具栏。 ````jsx import NoticeIcon from 'ant-design-pro/lib/NoticeIcon'; import moment from 'moment'; +import groupBy from 'lodash/groupBy'; import { Tag } from 'antd'; const data = [{ - key: '1', + id: '000000001', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', + title: '你收到了 14 份新周报', + datetime: '2017-08-09', + type: '通知', +}, { + id: '000000002', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', + title: '你推荐的 曲妮妮 已通过第三轮面试', + datetime: '2017-08-08', + type: '通知', +}, { + id: '000000003', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', + title: '这种模板可以区分多种通知类型', + datetime: '2017-08-07', + read: true, + type: '通知', +}, { + id: '000000004', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + datetime: '2017-08-07', + type: '通知', +}, { + id: '000000005', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', + title: '内容不要超过两行字,超出时自动截断', + datetime: '2017-08-07', + type: '通知', +}, { + id: '000000006', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', title: '曲丽丽 评论了你', description: '描述信息描述信息描述信息', - datetime: moment('2017-08-07').fromNow(), + datetime: '2017-08-07', + type: '消息', }, { - key: '2', + id: '000000007', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', title: '朱偏右 回复了你', description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: moment('2017-08-07').fromNow(), + datetime: '2017-08-07', + type: '消息', }, { - key: '3', + id: '000000008', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', title: '标题', description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: moment('2017-08-07').fromNow(), - extra: 标签, + datetime: '2017-08-07', + type: '消息', +}, { + id: '000000009', + title: '任务名称', + description: '任务需要在 2017-01-12 20:00 前启动', + extra: '未开始', + status: 'todo', + type: '待办', +}, { + id: '000000010', + title: '第三方紧急代码变更', + description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + extra: '马上到期', + status: 'urgent', + type: '待办', +}, { + id: '000000011', + title: '信息安全考试', + description: '指派竹尔于 2017-01-09 前完成更新并发布', + extra: '已耗时 8 天', + status: 'doing', + type: '待办', +}, { + id: '000000012', + title: 'ABCD 版本发布', + description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + extra: '进行中', + status: 'processing', + type: '待办', }]; function onItemClick(item, tabProps) { @@ -39,6 +101,35 @@ function onClear(tabTitle) { console.log(tabTitle); } +function getNoticeData(notices) { + if (notices.length === 0) { + return {}; + } + const newNotices = notices.map((notice) => { + const newNotice = { ...notice }; + if (newNotice.datetime) { + newNotice.datetime = moment(notice.datetime).fromNow(); + } + // transform id to item key + if (newNotice.id) { + newNotice.key = newNotice.id; + } + if (newNotice.extra && newNotice.status) { + const color = ({ + todo: '', + processing: 'blue', + urgent: 'red', + doing: 'gold', + })[newNotice.status]; + newNotice.extra = {newNotice.extra}; + } + return newNotice; + }); + return groupBy(newNotices, 'type'); +} + +const noticeData = getNoticeData(data); + ReactDOM.render(
- + , mountNode); ```` + +```css + +``` diff --git a/src/components/NoticeIcon/index.md b/src/components/NoticeIcon/index.md index abd8fb08eabb47426d3dc53c15f752e996232d8d..0c91c8e30bae4817bf58578c345cb454f79cb401 100644 --- a/src/components/NoticeIcon/index.md +++ b/src/components/NoticeIcon/index.md @@ -5,7 +5,7 @@ cols: 1 order: 9 --- -用在顶部导航上,作为整个产品统一的通知中心。 +用在导航工具栏上,作为整个产品统一的通知中心。 ## API diff --git a/src/components/PageHeader/demo/standard.md b/src/components/PageHeader/demo/standard.md index 1aa167daf4f41a481a745ca3fd0eb9a87db9760d..c51b677c1c7b3601bb4d5138d07139010d64f82a 100644 --- a/src/components/PageHeader/demo/standard.md +++ b/src/components/PageHeader/demo/standard.md @@ -14,7 +14,7 @@ const { Description } = DescriptionList; const ButtonGroup = Button.Group; const description = ( - + 曲丽丽 XX 服务 2017-07-07 diff --git a/src/components/Result/demo/classic.md b/src/components/Result/demo/classic.md index 3988d95888d87a7af16d5c0cff0071361529c7c9..81e6a2eb8b8968e6828edbb4a6d390e3aa865688 100644 --- a/src/components/Result/demo/classic.md +++ b/src/components/Result/demo/classic.md @@ -12,20 +12,22 @@ import { Button, Row, Col, Icon, Steps } from 'antd'; const { Step } = Steps; const desc1 = ( -
-
- 曲丽丽 +
+
+ 曲丽丽 +
-
2016-12-12 12:32
+
2016-12-12 12:32
); const desc2 = ( -
-
- 周毛毛 +
+
+ 周毛毛 +
- +
); diff --git a/src/components/TagSelect/index.md b/src/components/TagSelect/index.md index 31c2e02565678ab9388ec93a0cec5c806c3401f5..337371ec5c8e7b526734c0c2f90d015b1567b455 100644 --- a/src/components/TagSelect/index.md +++ b/src/components/TagSelect/index.md @@ -5,7 +5,7 @@ cols: 1 order: 13 --- -一组标签选择器,带全选/展开/收起功能。 +可进行多选,带折叠收起和展开更多功能,常用于对列表进行筛选。 ## API diff --git a/src/components/Trend/index.md b/src/components/Trend/index.md index ea86120314c5f308808c052acc18178dbf09ccfe..6b1dc442ab70ea582db3f933c5a0d31e7b13e43b 100644 --- a/src/components/Trend/index.md +++ b/src/components/Trend/index.md @@ -5,7 +5,7 @@ cols: 1 order: 14 --- -趋势符号,标记上升和下降趋势。 +趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。 ## API