|
|
@@ -29,13 +29,13 @@ const Notification = () => {
|
|
|
const initData = async params => {
|
|
|
setState({ ...state, loading: true })
|
|
|
const {
|
|
|
- data: { message = [], total },
|
|
|
+ data: { message: list = [], total },
|
|
|
code = -1
|
|
|
} = await queryMessageList({ ...params, pageSize: state.pageSize })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
setState({
|
|
|
...state,
|
|
|
- message: params?.current === 1 ? message : state.message.concat(message),
|
|
|
+ list: params?.current === 1 ? list : state.list.concat(message),
|
|
|
total,
|
|
|
loading: false,
|
|
|
hasMore: total > params.current * state.pageSize,
|
|
|
@@ -52,7 +52,7 @@ const Notification = () => {
|
|
|
|
|
|
const { run: trySendMessage } = useRequest(sendMessage, {
|
|
|
manual: true,
|
|
|
- onSuccess: result => {
|
|
|
+ onSuccess: () => {
|
|
|
tRef.current?.reload()
|
|
|
// sendMsg(cmdType.Notice, result)
|
|
|
},
|
|
|
@@ -74,11 +74,12 @@ const Notification = () => {
|
|
|
hasMore={state.hasMore}
|
|
|
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
|
|
endMessage={<Divider plain>别再滚啦,已是尽头</Divider>}
|
|
|
- scrollableTarget="scrollableDiv">
|
|
|
+ scrollableTarget="scrollableDiv"
|
|
|
+ >
|
|
|
<List
|
|
|
itemLayout="horizontal"
|
|
|
// pagination={{ pageSize: 5 }}
|
|
|
- dataSource={state.message}
|
|
|
+ dataSource={state.list}
|
|
|
renderItem={item => (
|
|
|
<List.Item key={item.id}>
|
|
|
<List.Item.Meta
|