|
@@ -14,7 +14,7 @@ const Notification = () => {
|
|
|
message: [],
|
|
message: [],
|
|
|
hasMore: false,
|
|
hasMore: false,
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- pageSize: 10,
|
|
|
|
|
|
|
+ pageSize: 15,
|
|
|
total: 0
|
|
total: 0
|
|
|
})
|
|
})
|
|
|
const initData = async params => {
|
|
const initData = async params => {
|
|
@@ -46,36 +46,38 @@ const Notification = () => {
|
|
|
<span className="py-4">通知中心</span>
|
|
<span className="py-4">通知中心</span>
|
|
|
<div style={{ height: 'calc(100vh - 96px - 3.5rem)', overflowY: 'auto' }}>
|
|
<div style={{ height: 'calc(100vh - 96px - 3.5rem)', overflowY: 'auto' }}>
|
|
|
<div id="scrollableDiv">
|
|
<div id="scrollableDiv">
|
|
|
- <InfiniteScroll
|
|
|
|
|
- dataLength={state.message?.length}
|
|
|
|
|
- next={loadMoreData}
|
|
|
|
|
- hasMore={state.hasMore}
|
|
|
|
|
- loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
|
|
|
|
- endMessage={<Divider plain>别再滚啦,已是尽头</Divider>}
|
|
|
|
|
- scrollableTarget="scrollableDiv"
|
|
|
|
|
- >
|
|
|
|
|
- <List
|
|
|
|
|
- itemLayout="horizontal"
|
|
|
|
|
- // pagination={{ pageSize: 5 }}
|
|
|
|
|
- dataSource={state.message}
|
|
|
|
|
- renderItem={item => (
|
|
|
|
|
- <List.Item key={item.id}>
|
|
|
|
|
- <List.Item.Meta
|
|
|
|
|
- avatar={<Avatar src={item.avatar} />}
|
|
|
|
|
- title={<a href="#">{item.title}</a>}
|
|
|
|
|
- description={
|
|
|
|
|
- <div className="mb-1">
|
|
|
|
|
- <Tag color="purple">{msgTypeEnum[item.msgType]}</Tag> '发布于',
|
|
|
|
|
- <span className="ml-2">全公司</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- }
|
|
|
|
|
- />
|
|
|
|
|
- {item.content}
|
|
|
|
|
- <div className="mt-1 text-hex-aaa">{item.createTime}</div>
|
|
|
|
|
- </List.Item>
|
|
|
|
|
- )}
|
|
|
|
|
- />
|
|
|
|
|
- </InfiniteScroll>
|
|
|
|
|
|
|
+ {state.message?.length ? (
|
|
|
|
|
+ <InfiniteScroll
|
|
|
|
|
+ dataLength={state.message?.length}
|
|
|
|
|
+ next={loadMoreData}
|
|
|
|
|
+ hasMore={state.hasMore}
|
|
|
|
|
+ loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
|
|
|
|
+ endMessage={<Divider plain>别再滚啦,已是尽头</Divider>}
|
|
|
|
|
+ scrollableTarget="scrollableDiv"
|
|
|
|
|
+ >
|
|
|
|
|
+ <List
|
|
|
|
|
+ itemLayout="horizontal"
|
|
|
|
|
+ // pagination={{ pageSize: 5 }}
|
|
|
|
|
+ dataSource={state.message}
|
|
|
|
|
+ renderItem={item => (
|
|
|
|
|
+ <List.Item key={item.id}>
|
|
|
|
|
+ <List.Item.Meta
|
|
|
|
|
+ avatar={<Avatar src={item.avatar} />}
|
|
|
|
|
+ title={<a href="#">{item.title}</a>}
|
|
|
|
|
+ description={
|
|
|
|
|
+ <div className="mb-1">
|
|
|
|
|
+ <Tag color="purple">{msgTypeEnum[item.msgType]}</Tag> '发布于',
|
|
|
|
|
+ <span className="ml-2">全公司</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
|
|
+ {item.content}
|
|
|
|
|
+ <div className="mt-1 text-hex-aaa">{item.createTime}</div>
|
|
|
|
|
+ </List.Item>
|
|
|
|
|
+ )}
|
|
|
|
|
+ />
|
|
|
|
|
+ </InfiniteScroll>
|
|
|
|
|
+ ) : null}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|