|
|
@@ -40,7 +40,8 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
comments: null,
|
|
|
- wsComments: []
|
|
|
+ wsComments: [],
|
|
|
+ slideId: this.$route.params.slideId
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
@@ -54,8 +55,7 @@ export default {
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
userInfo: state => state.main.userInfo,
|
|
|
- currentPage: state => state.pdf.currentPage,
|
|
|
- slide: state => state.pdf.slideInfo
|
|
|
+ currentPage: state => state.pdf.currentPage
|
|
|
}),
|
|
|
writingAreaPlaceholder () {
|
|
|
return '写下针对本页的讨论(标题)'
|
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initWs () {
|
|
|
- this._ws = new WebsocketPublisher(useCommentWsServer('/slide/') + this.slide.id)
|
|
|
+ this._ws = new WebsocketPublisher(useCommentWsServer('/slide/') + this.$route.params.slideId)
|
|
|
this._ws.subscribe({
|
|
|
onNext: data => {
|
|
|
this.wsComments.unshift(data)
|
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getComments (size) {
|
|
|
- return getComments({ slideId: this.slide.id, size, pageNumber: this.currentPage, sort: ['topNumber,desc', 'createAt,desc'] }).then(res => {
|
|
|
+ return getComments({ slideId: this.slideId, size, pageNumber: this.currentPage, sort: ['topNumber,desc', 'createAt,desc'] }).then(res => {
|
|
|
this.wsComments = []
|
|
|
this.comments = res.data
|
|
|
}).catch(err => {
|
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
},
|
|
|
handleCommentSubmit (comment) {
|
|
|
createComment({
|
|
|
- slideId: this.slide.id,
|
|
|
+ slideId: this.slideId,
|
|
|
pageNumber: this.currentPage,
|
|
|
title: comment.title,
|
|
|
content: comment.content
|