【修改】 修改报告详情

This commit is contained in:
zhoulingpo
2023-05-09 15:55:20 +08:00
parent 6c01b7f587
commit ea9052882f
2 changed files with 36 additions and 19 deletions
+20 -9
View File
@@ -162,17 +162,12 @@ export default {
// 点赞
goodLuck (data) {
return request({
url: '/api/report/praise/'+data,
method: 'get',
})
},
// 取消点赞
NogoodLuck (data) {
return request({
url: '/api/report/delPraise/'+data,
url: '/api/reportLogBook/thumbUpOrDown',
method: 'get',
params:data
})
},
//删除评论 {id}
delJuggle (data) {
return request({
@@ -204,6 +199,22 @@ export default {
params:data
})
},
// 获取
// 获取评分
getScore(data) {
return request({
url: '/api/report-rating/rating',
method: 'get',
params:data
})
},
// 获取点赞
getGood(data){
return request({
url: '/api/reportLogBook/getThumbUpCount',
method: 'get',
params:data
})
}
}
+16 -10
View File
@@ -121,23 +121,27 @@ export default {
}
},
methods: {
// 获取评分
getScore(){
this.$api.report.getScore({reportId:this.reportId}).then(res=>{
this.userRating=res.data/2
})
},
// 获取点赞数量及其状态
getGood(){
this.$api.report.getGood({reportId:this.reportId}).then(res=>{
})
},
//点赞
pointZan(type){
if(type== 'n'){
this.$api.report.NogoodLuck(this.reportId).then(res=>{
this.isShow=!this.isShow
this.$message.success("取消成功")
}).catch(()=>{
this.$message.warning("操作失败")
})
}else{
this.$api.report.goodLuck(this.reportId).then(res=>{
this.isShow=!this.isShow
this.$message.success("点赞成功")
this.$message.success("操作成功")
}).catch(()=>{
this.$message.warning("操作失败")
})
}
},
//评分
saveScore(){
@@ -248,6 +252,8 @@ export default {
// this.previewRow()
this.getComment()
this.getReportDetail()
this.getScore()
this.getGood()
}
}
</script>