|
@@ -4,7 +4,7 @@ import InfiniteScroll from 'react-infinite-scroll-component'
|
|
|
import { queryMessageList, sendMessage } from '@/services/staff'
|
|
import { queryMessageList, sendMessage } from '@/services/staff'
|
|
|
import AddMessage from './components/AddMessage'
|
|
import AddMessage from './components/AddMessage'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
-import { useRequest, useIntl } from 'umi'
|
|
|
|
|
|
|
+import { useRequest, useIntl, useAccess } from 'umi'
|
|
|
import { useModal } from '@/components/Modal'
|
|
import { useModal } from '@/components/Modal'
|
|
|
import MessageDrawer from './components/MessageDrawer'
|
|
import MessageDrawer from './components/MessageDrawer'
|
|
|
import ws, { CmdType } from '@/utils/ws'
|
|
import ws, { CmdType } from '@/utils/ws'
|
|
@@ -76,21 +76,25 @@ const Notification = () => {
|
|
|
toggleDrawer()
|
|
toggleDrawer()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const hasPerm = useAccess()?.validatePermByType('notification_add')
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="bg-hex-ffffff rounded-md px-6 pb-6">
|
|
<div className="bg-hex-ffffff rounded-md px-6 pb-6">
|
|
|
<div className="flex justify-between items-center">
|
|
<div className="flex justify-between items-center">
|
|
|
<h4 className="py-4 text-xl">通知中心</h4>
|
|
<h4 className="py-4 text-xl">通知中心</h4>
|
|
|
- <AddMessage onConfirm={trySendMessage} />
|
|
|
|
|
|
|
+ {hasPerm ? <AddMessage onConfirm={trySendMessage} /> : null}
|
|
|
</div>
|
|
</div>
|
|
|
- <div id="scrollableDiv" style={{ height: 'calc(100vh - 125px - 3.5rem)', overflowY: 'auto' }}>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ id="scrollableDiv"
|
|
|
|
|
+ className="pr-4"
|
|
|
|
|
+ style={{ height: 'calc(100vh - 125px - 3.5rem)', overflowY: 'auto' }}>
|
|
|
<InfiniteScroll
|
|
<InfiniteScroll
|
|
|
dataLength={state.total}
|
|
dataLength={state.total}
|
|
|
next={loadMoreData}
|
|
next={loadMoreData}
|
|
|
hasMore={state.hasMore}
|
|
hasMore={state.hasMore}
|
|
|
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
|
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
|
|
endMessage={<Divider plain>别再滚啦,已是尽头</Divider>}
|
|
endMessage={<Divider plain>别再滚啦,已是尽头</Divider>}
|
|
|
- scrollableTarget="scrollableDiv"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ scrollableTarget="scrollableDiv">
|
|
|
<List
|
|
<List
|
|
|
itemLayout="horizontal"
|
|
itemLayout="horizontal"
|
|
|
// pagination={{ pageSize: 5 }}
|
|
// pagination={{ pageSize: 5 }}
|
|
@@ -102,8 +106,7 @@ const Notification = () => {
|
|
|
title={
|
|
title={
|
|
|
<span
|
|
<span
|
|
|
className="cursor-pointer text-primary"
|
|
className="cursor-pointer text-primary"
|
|
|
- onClick={() => showMessageDrawer(item)}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ onClick={() => showMessageDrawer(item)}>
|
|
|
{item.title}
|
|
{item.title}
|
|
|
</span>
|
|
</span>
|
|
|
}
|
|
}
|