|
|
@@ -3,11 +3,12 @@
|
|
|
<h1 class="sub-title vertical-center">
|
|
|
讨论区
|
|
|
<c-button theme="green" :left="12" :icon="focus ? 'unfold_less' : 'edit'" text @click="handleFocusButtonClick">
|
|
|
- {{focus ? '隐藏编辑器' : '发帖'}}
|
|
|
+ {{focus ? '隐藏编辑器' : '讨论|笔记'}}
|
|
|
</c-button>
|
|
|
- <c-button v-if="focus" :no-bold="personal" text :theme="personal ? 'blue' : ''"
|
|
|
+ <c-button :no-bold="personal" text :theme="personal ? 'blue' : ''"
|
|
|
:icon="personal ? 'check_box' : 'check_box_outline_blank'"
|
|
|
- @click="handleSetPersonal">私人笔记
|
|
|
+ title="如果设置为私人笔记,则这条讨论仅自己可见"
|
|
|
+ @click="handleSetPersonal">笔记模式
|
|
|
</c-button>
|
|
|
</h1>
|
|
|
<div class="discussion-area-content">
|
|
|
@@ -124,14 +125,17 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getNote (size) {
|
|
|
- this.notes = []
|
|
|
return getSelfCommentsBySlide({
|
|
|
slideId: this.slideId,
|
|
|
pageNumber: this.currentPage,
|
|
|
show: false,
|
|
|
- size: 1000
|
|
|
+ size: 1000,
|
|
|
+ sort: ['createAt,desc']
|
|
|
})
|
|
|
- .then(res => (this.notes = res.data))
|
|
|
+ .then(res => {
|
|
|
+ this.notes = []
|
|
|
+ this.notes = res.data
|
|
|
+ })
|
|
|
.catch(err => this.$setErrorMessage(err.response.data.msg))
|
|
|
},
|
|
|
handleCommentSubmit (comment) {
|
|
|
@@ -144,6 +148,9 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.$refs.writeComment.resetContent()
|
|
|
this.$setSuccessMessage('您的讨论帖发表成功')
|
|
|
+ if (this.personal) {
|
|
|
+ this.getNote(1000)
|
|
|
+ }
|
|
|
}).catch(err => {
|
|
|
this.$setErrorMessage(err.response.data.msg)
|
|
|
})
|
|
|
@@ -210,7 +217,7 @@ export default {
|
|
|
color: #5a6a7a;
|
|
|
display: inline-block;
|
|
|
background-color: white;
|
|
|
- padding: 0 12px;
|
|
|
+ padding: 4px 12px;
|
|
|
line-height: 12px;
|
|
|
}
|
|
|
|