Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust_web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
cust_web
Commits
8397249f
Commit
8397249f
authored
Mar 07, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改审核问题
parent
9a799160
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
31 deletions
+46
-31
opmArticle.js
src/api/contentManagement/opmArticle.js
+7
-3
index.vue
src/views/operationsManagement/article/index.vue
+39
-28
No files found.
src/api/contentManagement/opmArticle.js
View file @
8397249f
...
@@ -68,10 +68,14 @@ export function exportOpmArticle(query) {
...
@@ -68,10 +68,14 @@ export function exportOpmArticle(query) {
}
}
// 7. 逻辑删除动态评论
// 7. 逻辑删除动态评论
export
function
deleteComment
(
businessId
)
{
export
function
deleteComment
(
data
)
{
return
request
({
return
request
({
url
:
'/opmarticle/deleteComment/'
+
businessId
,
url
:
'/opmarticle/deleteComment/'
+
data
.
businessId
,
method
:
'delete'
method
:
'delete'
,
data
:
JSON
.
stringify
(
data
),
// 确保数据被正确序列化为 JSON 字符串
headers
:
{
'Content-Type'
:
'application/json'
// 设置正确的 Content-Type
}
})
})
}
}
...
...
src/views/operationsManagement/article/index.vue
View file @
8397249f
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
@
click=
"handleView(scope.row)"
@
click=
"handleView(scope.row)"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
v-show=
"scope.row.examStatus === '0'"
v-show=
"scope.row.examStatus === '0'
|| scope.row.examStatus === '4'
"
v-has-permi=
"['opm:article:update']"
v-has-permi=
"['opm:article:update']"
:class=
"commonField.resetPasClass"
:class=
"commonField.resetPasClass"
:type=
"commonField.typeParent"
:type=
"commonField.typeParent"
...
@@ -361,6 +361,7 @@ export default {
...
@@ -361,6 +361,7 @@ export default {
// pagination
// pagination
total
:
0
,
total
:
0
,
fullscreenLoading
:
false
,
fullscreenLoading
:
false
,
articleId
:
''
,
rules
:
{}
rules
:
{}
}
}
},
},
...
@@ -506,17 +507,25 @@ export default {
...
@@ -506,17 +507,25 @@ export default {
/** 审核按钮操作 */
/** 审核按钮操作 */
handleExam
(
row
)
{
handleExam
(
row
)
{
this
.
reset
()
this
.
reset
()
const
id
=
row
.
businessId
this
.
articleId
=
row
.
businessId
getOpmArticle
(
id
).
then
(
async
response
=>
{
this
.
getDetail
()
this
.
title
=
'动态审核'
this
.
open
=
true
this
.
isEdit
=
true
},
getDetail
()
{
getOpmArticle
(
this
.
articleId
).
then
(
async
response
=>
{
this
.
form
=
response
.
data
this
.
form
=
response
.
data
// 处理图片
// 处理图片
if
(
response
.
data
.
pictureId
!==
''
&&
response
.
data
.
pictureId
!==
null
)
{
if
(
response
.
data
.
pictureId
!==
''
&&
response
.
data
.
pictureId
!==
null
)
{
const
urlArray
=
JSON
.
parse
(
response
.
data
.
pictureId
)
const
urlArray
=
JSON
.
parse
(
response
.
data
.
pictureId
)
const
url
=
[]
const
url
=
[]
urlArray
.
id
.
forEach
(
item
=>
{
urlArray
.
id
.
forEach
(
item
=>
{
getOssUrl
(
item
).
then
(
imgRes
=>
{
if
(
item
!==
''
&&
item
!==
null
)
{
url
.
push
(
imgRes
.
data
)
getOssUrl
(
item
).
then
(
imgRes
=>
{
})
url
.
push
(
imgRes
.
data
)
})
}
})
})
this
.
form
.
url
=
url
this
.
form
.
url
=
url
}
}
...
@@ -528,23 +537,23 @@ export default {
...
@@ -528,23 +537,23 @@ export default {
// 处理评论的头像
// 处理评论的头像
if
(
this
.
form
.
articleCommentVOList
!=
null
&&
this
.
form
.
articleCommentVOList
.
length
>
0
)
{
if
(
this
.
form
.
articleCommentVOList
!=
null
&&
this
.
form
.
articleCommentVOList
.
length
>
0
)
{
await
this
.
form
.
articleCommentVOList
.
forEach
(
item
=>
{
await
this
.
form
.
articleCommentVOList
.
forEach
(
item
=>
{
getOssUrl
(
item
.
avatarId
).
then
(
res
=>
{
if
(
item
.
avatarId
!==
''
&&
item
.
avatarId
!==
null
)
{
item
.
avatarUrl
=
res
.
data
getOssUrl
(
item
.
avatarId
).
then
(
res
=>
{
})
item
.
avatarUrl
=
res
.
data
})
}
// 处理子评论头像
// 处理子评论头像
if
(
item
.
childrenCommentList
.
length
>
0
)
{
if
(
item
.
childrenCommentList
.
length
>
0
)
{
item
.
childrenCommentList
.
forEach
(
children
=>
{
item
.
childrenCommentList
.
forEach
(
children
=>
{
getOssUrl
(
children
.
avatarId
).
then
(
resp
=>
{
if
(
children
.
avatarId
!==
''
&&
children
.
avatarId
!==
null
)
{
children
.
avatarUrl
=
resp
.
data
getOssUrl
(
children
.
avatarId
).
then
(
resp
=>
{
})
children
.
avatarUrl
=
resp
.
data
})
}
})
})
}
}
})
})
}
}
console
.
log
(
'this.form'
,
this
.
form
)
this
.
title
=
'动态审核'
this
.
open
=
true
this
.
isEdit
=
true
})
})
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
...
@@ -595,11 +604,14 @@ export default {
...
@@ -595,11 +604,14 @@ export default {
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
return
deleteComment
(
row
.
businessId
)
const
form
=
{
businessId
:
row
.
businessId
,
parentId
:
row
.
parentId
,
articleId
:
this
.
articleId
}
return
deleteComment
(
form
)
}).
then
(()
=>
{
}).
then
(()
=>
{
// 使用 filter 创建一个新的数组,并重新赋值给 this.form.comments
this
.
getDetail
()
this
.
form
.
articleCommentVOList
=
this
.
form
.
articleCommentVOList
.
filter
(
comment
=>
comment
.
businessId
!==
row
.
businessId
)
this
.
$forceUpdate
()
// 触发视图更新
// 触发视图更新
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$message
({
this
.
$message
({
...
@@ -615,15 +627,14 @@ export default {
...
@@ -615,15 +627,14 @@ export default {
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
return
deleteComment
(
row
.
businessId
)
const
form
=
{
businessId
:
row
.
businessId
,
parentId
:
row
.
parentId
,
articleId
:
this
.
articleId
}
return
deleteComment
(
form
)
}).
then
(()
=>
{
}).
then
(()
=>
{
// 遍历找到对应的父评论,并更新其子评论
this
.
getDetail
()
this
.
form
.
articleCommentVOList
.
forEach
(
comment
=>
{
if
(
comment
.
businessId
===
row
.
parentId
)
{
comment
.
children
=
comment
.
children
.
filter
(
reply
=>
reply
.
businessId
!==
row
.
businessId
)
}
})
this
.
$forceUpdate
()
// 触发视图更新
// 触发视图更新
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$message
({
this
.
$message
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment