fix 无限滚动
This commit is contained in:
@@ -202,7 +202,7 @@ namespace Ewide.Core
|
||||
.Select(u => u.Permission).ToListAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetPermission(userId, permissions); // 缓存结果
|
||||
await _sysCacheService.SetPermission(UserId, permissions); // 缓存结果
|
||||
#endif
|
||||
}
|
||||
return permissions;
|
||||
|
||||
@@ -688,3 +688,10 @@
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.yo-popover-infinite-scroll {
|
||||
.ant-popover-inner-content {
|
||||
overflow-y: auto;
|
||||
|
||||
max-height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,3 +682,10 @@
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.yo-popover-infinite-scroll {
|
||||
.ant-popover-inner-content {
|
||||
overflow-y: auto;
|
||||
|
||||
max-height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Badge, Divider, List, Menu, Modal, Popover, Row, Spin } from 'antd'
|
||||
import { Badge, Button, Divider, List, Menu, Modal, Popover, Row, Spin } from 'antd'
|
||||
import { AntIcon, Image } from 'components'
|
||||
import { api } from 'common/api'
|
||||
import InfiniteScroll from 'react-infinite-scroller'
|
||||
@@ -69,7 +69,7 @@ export default class notice extends Component {
|
||||
loadMore={pageIndex => this.onInfiniteOnLoad(pageIndex)}
|
||||
hasMore={!loading && hasMore}
|
||||
useWindow={false}
|
||||
threshold={100}
|
||||
threshold={50}
|
||||
>
|
||||
<List
|
||||
itemLayout="vertical"
|
||||
@@ -79,14 +79,15 @@ export default class notice extends Component {
|
||||
<List.Item.Meta
|
||||
avatar={<Image id={item.avatar} type="avatar" />}
|
||||
title={
|
||||
<a
|
||||
className="ellipsis"
|
||||
onClick={() => this.onOpenDetail(item.id)}
|
||||
>
|
||||
{item.title}
|
||||
</a>
|
||||
<>
|
||||
<a onClick={() => this.onOpenDetail(item.id)}>
|
||||
{item.title}
|
||||
</a>
|
||||
<small className="text-normal ml-xs">
|
||||
{moment(item.createdTime || item.publicTime).fromNow()}
|
||||
</small>
|
||||
</>
|
||||
}
|
||||
description={moment(item.createdTime || item.publicTime).fromNow()}
|
||||
/>
|
||||
<div className="ellipsis-3 text-gray">{item.content}</div>
|
||||
</List.Item>
|
||||
@@ -98,6 +99,11 @@ export default class notice extends Component {
|
||||
</div>
|
||||
)}
|
||||
</List>
|
||||
{!hasMore && (
|
||||
<Button type="text" block>
|
||||
查看全部
|
||||
</Button>
|
||||
)}
|
||||
</InfiniteScroll>
|
||||
)
|
||||
}
|
||||
@@ -110,8 +116,9 @@ export default class notice extends Component {
|
||||
arrowPointAtCenter={true}
|
||||
placement="bottomRight"
|
||||
content={this.renderList()}
|
||||
overlayInnerStyle={{ width: 300, maxHeight: 300, overflowY: 'auto' }}
|
||||
overlayInnerStyle={{ width: 300 }}
|
||||
overlayStyle={{ zIndex: 999 }}
|
||||
overlayClassName="yo-popover-infinite-scroll"
|
||||
>
|
||||
<span className="header-action">
|
||||
<Badge count={count}>
|
||||
|
||||
Reference in New Issue
Block a user