Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
2ca9cf20
提交
2ca9cf20
authored
7月 14, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:论坛动态审核
上级
7096d47a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
90 行增加
和
17 行删除
+90
-17
forumManageType.ts
src/api/interface/forumManageType.ts
+16
-7
forumManageAPI.ts
src/api/modules/forumManageAPI.ts
+4
-0
index.tsx
src/pages/forumManage/dynamicList/index.tsx
+70
-10
没有找到文件。
src/api/interface/forumManageType.ts
浏览文件 @
2ca9cf20
import
{
InterFunction
,
Inter
Item
Function
}
from
'~/api/interface'
;
import
{
InterFunction
,
Inter
List
Function
}
from
'~/api/interface'
;
//论坛-列表
export
type
forumListType
=
Inter
Item
Function
<
export
type
forumListType
=
Inter
List
Function
<
{
keyword
?:
string
},
{
id
:
number
;
description
:
string
;
mediaVO
:
null
;
show
:
number
;
userBaseInfo
:
{
nickName
:
string
;
userImg
:
string
;
userName
:
null
;
phone
:
string
;
uid
:
string
;
userImg
:
string
;
userName
:
string
;
};
show
:
number
;
id
:
number
;
}[]
userAccountId
:
number
;
dynamicPublishTime
:
string
;
checkStatus
:
0
|
1
|
2
;
}
>
;
//论坛-删除
export
type
deleteForumType
=
InterFunction
<
{
dynamicId
:
number
},
any
>
;
...
...
@@ -44,3 +48,8 @@ export type likeUserInfoType = InterFunction<
{
dynamicId
:
number
},
{
nickName
:
string
;
userImg
:
string
;
userName
:
string
}[]
>
;
// 论坛-审核
export
type
checkDynamicType
=
InterFunction
<
{
dynamicId
:
number
;
status
:
number
},
NonNullable
<
unknown
>
>
;
src/api/modules/forumManageAPI.ts
浏览文件 @
2ca9cf20
import
{
checkDynamicType
,
deleteForumType
,
forumDetailType
,
forumListType
,
...
...
@@ -23,4 +24,7 @@ export class ForumManageAPI {
// 论坛-点赞人信息
static
getLikeUserInfoList
:
likeUserInfoType
=
(
params
)
=>
axios
.
get
(
'/release/backstage/forum/likeUserInfo'
,
{
params
});
// 动态审核
static
checkDynamic
:
checkDynamicType
=
(
params
)
=>
axios
.
get
(
'/release/backstage/forum/checkDynamic'
,
{
params
});
}
src/pages/forumManage/dynamicList/index.tsx
浏览文件 @
2ca9cf20
...
...
@@ -3,13 +3,20 @@ import { Button, message, Modal, Table, Tooltip } from 'antd';
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
DynamicDetailModal
from
'./components/dynamicDetailModal'
;
import
{
ForumManageAPI
}
from
'
../../..
/api'
;
import
{
InterDataType
,
Inter
ReqListType
,
PaginationProps
}
from
'../../..
/api/interface'
;
import
{
forumDetailType
,
forumListType
}
from
'
../../..
/api/interface/forumManageType'
;
import
{
ForumManageAPI
}
from
'
~
/api'
;
import
{
InterDataType
,
Inter
ListType
,
InterReqListType
,
PaginationProps
}
from
'~
/api/interface'
;
import
{
forumDetailType
,
forumListType
}
from
'
~
/api/interface/forumManageType'
;
import
'./index.scss'
;
// 动态审核状态
const
checkStatusList
=
[
{
label
:
'审核中'
,
value
:
0
},
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
2
},
];
//论坛列表返回类型
type
forumType
=
Inter
DataType
<
forumListType
>
[
'list'
]
;
type
forumType
=
Inter
ListType
<
forumListType
>
;
//论坛列表参数类型
type
forumParameters
=
InterReqListType
<
forumListType
>
;
//论坛详情返回类型
...
...
@@ -44,6 +51,12 @@ const DynamicList = () => {
),
},
{
title
:
'审核状态'
,
align
:
'center'
,
dataIndex
:
'checkStatus'
,
render
:
(
text
:
number
)
=>
checkStatusList
.
find
((
i
)
=>
i
.
value
===
text
)?.
label
||
text
,
},
{
title
:
'用户UID'
,
align
:
'center'
,
render
:
(
_text
:
string
,
record
)
=>
<
div
>
{
record
.
userBaseInfo
?.
uid
||
''
}
</
div
>,
...
...
@@ -54,18 +67,41 @@ const DynamicList = () => {
render
:
(
_text
:
string
,
record
)
=>
<
div
>
{
record
.
userBaseInfo
?.
phone
||
''
}
</
div
>,
},
{
title
:
'发布时间'
,
align
:
'center'
,
dataIndex
:
'dynamicPublishTime'
,
},
{
title
:
'操作'
,
align
:
'center'
,
fixed
:
'right'
,
width
:
180
,
render
:
(
_text
:
string
,
record
)
=>
(
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleCheckStatus
(
record
)
}
disabled=
{
record
.
checkStatus
!==
0
}
>
审核
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
lookDynamicDetail
(
record
)
}
>
查看
详情
详情
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
deleteForumClick
(
record
)
}
>
强制删除
<
Button
type=
'link'
onClick=
{
()
=>
deleteForumClick
(
record
)
}
danger
disabled=
{
record
.
checkStatus
===
0
}
>
删除
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
hiddenForumClick
(
record
)
}
>
{
record
.
show
?
'恢复显示'
:
'强制隐藏'
}
<
Button
type=
'link'
onClick=
{
()
=>
hiddenForumClick
(
record
)
}
disabled=
{
record
.
checkStatus
===
0
}
>
{
record
.
show
?
'显示'
:
'隐藏'
}
</
Button
>
</>
),
...
...
@@ -155,7 +191,30 @@ const DynamicList = () => {
}
});
};
// 是否确认审核
const
handleCheckStatus
=
(
record
:
forumType
[
0
])
=>
{
Modal
.
confirm
({
title
:
`确认审核`
,
content
:
`请确认是否审核通过?通过后动态将展示在论坛列表`
,
okText
:
'审核通过'
,
cancelText
:
'审核不通过'
,
onOk
:
async
()
=>
{
const
res
=
await
ForumManageAPI
.
checkDynamic
({
dynamicId
:
record
.
id
,
status
:
1
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'操作成功'
);
paginationChange
(
pagination
.
pageNo
,
pagination
.
pageSize
);
}
},
onCancel
:
async
()
=>
{
const
res
=
await
ForumManageAPI
.
checkDynamic
({
dynamicId
:
record
.
id
,
status
:
2
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'操作成功'
);
paginationChange
(
pagination
.
pageNo
,
pagination
.
pageSize
);
}
},
});
};
// 组件挂载
useEffect
(()
=>
{
getDynamicList
();
},
[]);
...
...
@@ -163,6 +222,7 @@ const DynamicList = () => {
<
div
className=
'dynamic-list'
>
<
SearchBox
search=
{
searchColumnsData
}
searchData=
{
searchSuccess
}
/>
<
Table
size=
{
'small'
}
bordered
columns=
{
tableColumns
}
dataSource=
{
tableData
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论