index.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-03 14:28:27
  4. * @LastEditTime: 2021-10-09 10:42:35
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: /MedicalWisdomCheckSys/src/components/RightContent/index.tsx
  8. */
  9. import { Space,message } from 'antd';
  10. import React from 'react';
  11. import { useModel } from 'umi';
  12. import Avatar from './AvatarDropdown';
  13. import styles from './index.less';
  14. import NoticeIcon from '@/components/NoticeIcon/NoticeIcon';
  15. export type SiderTheme = 'light' | 'dark';
  16. const Notice = () => {
  17. const list:API.NoticeIconItem[] = [
  18. {
  19. id: '000000001',
  20. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
  21. title: '你收到了 14 份新周报',
  22. datetime: '2017-08-09',
  23. type: 'notification',
  24. },
  25. {
  26. id: '000000002',
  27. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
  28. title: '你推荐的 曲妮妮 已通过第三轮面试',
  29. datetime: '2017-08-08',
  30. type: 'notification',
  31. },
  32. ];
  33. return (
  34. <NoticeIcon
  35. count={10}
  36. onItemClick={(item) => {
  37. message.info(`${item.title} 被点击了`);
  38. }}
  39. onClear={(title: string, key: string) => message.info('点击了清空更多')}
  40. loading={false}
  41. clearText="清空"
  42. viewMoreText="查看更多"
  43. onViewMore={() => message.info('点击了查看更多')}
  44. clearClose
  45. >
  46. <NoticeIcon.Tab
  47. tabKey="notification"
  48. count={2}
  49. list={list}
  50. title="通知"
  51. emptyText="你已查看所有通知"
  52. showViewMore
  53. />
  54. <NoticeIcon.Tab
  55. tabKey="message"
  56. count={2}
  57. list={list}
  58. title="消息"
  59. emptyText="您已读完所有消息"
  60. showViewMore
  61. />
  62. <NoticeIcon.Tab
  63. tabKey="event"
  64. title="待办"
  65. emptyText="你已完成所有待办"
  66. count={2}
  67. list={list}
  68. showViewMore
  69. />
  70. </NoticeIcon>
  71. );
  72. };
  73. const GlobalHeaderRight: React.FC = () => {
  74. const { initialState } = useModel('@@initialState');
  75. if (!initialState || !initialState.settings) {
  76. return null;
  77. }
  78. const { navTheme, layout } = initialState.settings;
  79. let className = styles.right;
  80. if ((navTheme === 'dark' && layout === 'top') || layout === 'mix') {
  81. className = `${styles.right} ${styles.dark}`;
  82. }
  83. return (
  84. <Space className={className}>
  85. {/* <Notice /> */}
  86. <Avatar menu={true} />
  87. </Space>
  88. );
  89. };
  90. export default GlobalHeaderRight;