|
|
@@ -2,12 +2,13 @@ import { useCallback, useEffect, useState } from 'react'
|
|
|
import { Tag, message } from 'antd'
|
|
|
import { groupBy } from 'lodash-es'
|
|
|
import { useModel, history } from 'umi'
|
|
|
-
|
|
|
+import { useModal } from '@/components/Modal'
|
|
|
import NoticeIcon from './NoticeIcon'
|
|
|
import styles from './index.less'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { queryNoticeList, updateNotice } from '@/services/login'
|
|
|
import consts from '@/consts'
|
|
|
+import MessageDrawer from '@/pages/Hr/Notification/components/MessageDrawer'
|
|
|
|
|
|
export type GlobalHeaderRightProps = {
|
|
|
fetchingNotices?: boolean
|
|
|
@@ -74,6 +75,7 @@ const NoticeIconView = () => {
|
|
|
const { initialState, setInitialState } = useModel('@@initialState')
|
|
|
const { currentUser } = initialState || {}
|
|
|
const [notices, setNotices] = useState([])
|
|
|
+ const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
const getNotices = useCallback(async () => {
|
|
|
const { code = -1, data } = await queryNoticeList({ current: 1, pageSize: 50 })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
@@ -105,6 +107,16 @@ const NoticeIconView = () => {
|
|
|
currentUser: { ...currentUser, unreadCount: currentUser.unreadCount - 1 }
|
|
|
})
|
|
|
}
|
|
|
+ setDrawerProps({
|
|
|
+ zIndex: 1056,
|
|
|
+ closable: true,
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
+ bodyStyle: {
|
|
|
+ height: '100vh'
|
|
|
+ },
|
|
|
+ children: <MessageDrawer item={item} />
|
|
|
+ })
|
|
|
+ toggleDrawer()
|
|
|
}
|
|
|
|
|
|
const clearReadState = async (title: string, key: string) => {
|