|
@@ -2,13 +2,13 @@
|
|
|
<div class="discussion-area">
|
|
<div class="discussion-area">
|
|
|
<h1 class="sub-title vertical-center">
|
|
<h1 class="sub-title vertical-center">
|
|
|
本页留言板
|
|
本页留言板
|
|
|
- <c-button theme="green" :left="12" :icon="showWriteTool ? 'unfold_less' : 'edit'" text @click="showWriteTool = !showWriteTool">
|
|
|
|
|
- {{showWriteTool ? '隐藏编辑器' : '发帖'}}
|
|
|
|
|
|
|
+ <c-button theme="green" :left="12" :icon="focus ? 'unfold_less' : 'edit'" text @click="handleFocusButtonClick">
|
|
|
|
|
+ {{focus ? '隐藏编辑器' : '发帖'}}
|
|
|
</c-button>
|
|
</c-button>
|
|
|
</h1>
|
|
</h1>
|
|
|
<div class="discussion-area-content">
|
|
<div class="discussion-area-content">
|
|
|
<show-transition>
|
|
<show-transition>
|
|
|
- <write-new-comment v-show="showWriteTool" class="mb-8" ref="writeComment" @comment-submit="handleCommentSubmit"
|
|
|
|
|
|
|
+ <write-new-comment v-show="focus" class="mb-8" ref="writeComment" @comment-submit="handleCommentSubmit"
|
|
|
:placeholder="writingAreaPlaceholder"></write-new-comment>
|
|
:placeholder="writingAreaPlaceholder"></write-new-comment>
|
|
|
</show-transition>
|
|
</show-transition>
|
|
|
<div class="no-content-warning" v-if="comments === null">
|
|
<div class="no-content-warning" v-if="comments === null">
|
|
@@ -42,6 +42,7 @@ import WebsocketPublisher from '@/server/websocket/ws'
|
|
|
import { useCommentWsServer } from '@/config/server-info'
|
|
import { useCommentWsServer } from '@/config/server-info'
|
|
|
import CButton from '@/components/Basic/CButton'
|
|
import CButton from '@/components/Basic/CButton'
|
|
|
import ShowTransition from '@/animations/ShowTransition'
|
|
import ShowTransition from '@/animations/ShowTransition'
|
|
|
|
|
+import { FOCUS_ON_INPUT, USE_FOCUS } from '@/store/types/pdf-types'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: { ShowTransition, CButton, WriteNewComment, CComment },
|
|
components: { ShowTransition, CButton, WriteNewComment, CComment },
|
|
@@ -49,8 +50,7 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
comments: null,
|
|
comments: null,
|
|
|
wsComments: [],
|
|
wsComments: [],
|
|
|
- slideId: this.$route.params.slideId,
|
|
|
|
|
- showWriteTool: false
|
|
|
|
|
|
|
+ slideId: this.$route.params.slideId
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted () {
|
|
mounted () {
|
|
@@ -64,7 +64,8 @@ export default {
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapState({
|
|
...mapState({
|
|
|
userInfo: state => state.main.userInfo,
|
|
userInfo: state => state.main.userInfo,
|
|
|
- currentPage: state => state.pdf.currentPage
|
|
|
|
|
|
|
+ currentPage: state => state.pdf.currentPage,
|
|
|
|
|
+ focus: state => state.pdf.focus
|
|
|
}),
|
|
}),
|
|
|
writingAreaPlaceholder () {
|
|
writingAreaPlaceholder () {
|
|
|
return '主题'
|
|
return '主题'
|
|
@@ -93,9 +94,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
updateComments () {
|
|
updateComments () {
|
|
|
- this.getComments(30).then(() => {
|
|
|
|
|
- this.getComments(10000)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.getComments(1000)
|
|
|
},
|
|
},
|
|
|
getComments (size) {
|
|
getComments (size) {
|
|
|
return getComments({
|
|
return getComments({
|
|
@@ -122,6 +121,9 @@ export default {
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
this.$setErrorMessage(err.response.data.msg)
|
|
this.$setErrorMessage(err.response.data.msg)
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ handleFocusButtonClick () {
|
|
|
|
|
+ this.focus ? this.$store.commit(USE_FOCUS) : this.$store.commit(FOCUS_ON_INPUT)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -137,6 +139,7 @@ export default {
|
|
|
min-width: 405px;
|
|
min-width: 405px;
|
|
|
max-height: calc(100vh - 76px);
|
|
max-height: calc(100vh - 76px);
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
bottom: 0;
|
|
bottom: 0;
|
|
|
right: 0;
|
|
right: 0;
|
|
|
background-color: rgba(250, 250, 250, 0.8);
|
|
background-color: rgba(250, 250, 250, 0.8);
|