|
|
@@ -16,11 +16,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="message-content">
|
|
|
- <span class="type">{{messageTypeMap[message.type]}}</span>
|
|
|
+ <span class="type">{{messageTypeNaming[message.type]}}</span>
|
|
|
{{message.content}}
|
|
|
</div>
|
|
|
<div class="spacer"></div>
|
|
|
- <div class="link" v-if="message.slideId" title="点击前往相应幻灯片页面">
|
|
|
+ <div class="link" v-if="message.refId" title="点击前往相应幻灯片页面">
|
|
|
<icon-button @click.native.stop="handlePush" :size="40"> arrow_forward</icon-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -28,7 +28,7 @@
|
|
|
|
|
|
<script>
|
|
|
import momentFromNow from '@/utils/moment-from-now'
|
|
|
-import messageTypeMap from '@/utils/message-type-map'
|
|
|
+import messageTypeNaming, { messageType } from '@/enums/message-type'
|
|
|
import IconButton from '@/components/Basic/IconButton'
|
|
|
|
|
|
export default {
|
|
|
@@ -36,7 +36,7 @@ export default {
|
|
|
props: ['message', 'edit', 'deleteProp', 'archiveProp', 'read'],
|
|
|
data () {
|
|
|
return {
|
|
|
- messageTypeMap,
|
|
|
+ messageTypeNaming: messageTypeNaming,
|
|
|
toDelete: this.deleteProp,
|
|
|
toArchive: this.archiveProp
|
|
|
}
|
|
|
@@ -56,9 +56,15 @@ export default {
|
|
|
this.$emit('delete-state-change', { value: this.toDelete, id: this.message.id })
|
|
|
},
|
|
|
handlePush () {
|
|
|
- if (this.message.slideId) {
|
|
|
+ if (this.message.refId) {
|
|
|
const handler = () => {
|
|
|
- this.$router.push({ name: 'pdf-reader', params: { slideId: this.message.slideId } })
|
|
|
+ if (this.message.type === messageType.quizNew) {
|
|
|
+ this.$router.push({ name: 'student-quiz-detail', params: { quizId: this.message.refId } })
|
|
|
+ } else if (this.message.type === messageType.noticeNew) {
|
|
|
+ this.$router.push({ name: 'student-course-slides', params: { courseId: this.message.refId } })
|
|
|
+ } else {
|
|
|
+ this.$router.push({ name: 'pdf-reader', params: { slideId: this.message.refId } })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.edit) {
|