From ea4c16ae2132070fd265cce12f334eb9c056bd17 Mon Sep 17 00:00:00 2001 From: vapao Date: Tue, 6 Jul 2021 00:46:06 +0800 Subject: [PATCH] fix issues --- spug_web/src/layout/Notification.js | 22 ++++++++++++++++++---- spug_web/src/layout/layout.module.less | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/spug_web/src/layout/Notification.js b/spug_web/src/layout/Notification.js index a8f8951..a80e99f 100644 --- a/spug_web/src/layout/Notification.js +++ b/spug_web/src/layout/Notification.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { Menu, List, Dropdown, Badge, Button, notification } from 'antd'; -import { CheckOutlined, NotificationOutlined } from '@ant-design/icons'; +import { NotificationOutlined, MonitorOutlined, FlagOutlined, ScheduleOutlined } from '@ant-design/icons'; import { http, X_TOKEN } from 'libs'; import moment from 'moment'; import styles from './layout.module.less'; @@ -8,6 +8,20 @@ import styles from './layout.module.less'; let ws = {readyState: 3}; let timer; + +function Icon(props) { + switch (props.type) { + case 'monitor': + return + case 'schedule': + return + case 'flag': + return + default: + return null + } +} + export default function () { const [loading, setLoading] = useState(false); const [notifies, setNotifies] = useState([]); @@ -63,7 +77,7 @@ export default function () { e.stopPropagation(); if (reads.indexOf(item.id) === -1) { reads.push(item.id); - setReads(reads) + setReads([...reads]) http.patch('/api/notify/', {ids: [item.id]}) } } @@ -88,7 +102,7 @@ export default function () { handleRead(e, item)}> } + avatar={} title={{item.title}} description={[
{item.content}
, @@ -97,7 +111,7 @@ export default function () {
)}/> {notifies.length !== 0 && ( -
全部 已读
+
全部 已读
)} diff --git a/spug_web/src/layout/layout.module.less b/spug_web/src/layout/layout.module.less index 0b5c5c4..45bec76 100644 --- a/spug_web/src/layout/layout.module.less +++ b/spug_web/src/layout/layout.module.less @@ -54,7 +54,7 @@ background-color: rgb(233, 247, 254); } - .footer { + .btn { line-height: 46px; text-align: center; cursor: pointer;