|
|
|
@ -178,8 +178,8 @@ |
|
|
|
|
disabled: true, |
|
|
|
|
//替换目标 |
|
|
|
|
replace: {}, |
|
|
|
|
stars: [{ value: 0 }, { value: 0 }, { value: 0 }], |
|
|
|
|
show_star_button: true |
|
|
|
|
stars: [], |
|
|
|
|
show_star_button: false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -228,6 +228,22 @@ |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
|
//查找评价记录 |
|
|
|
|
queryRating(){ |
|
|
|
|
let that=this |
|
|
|
|
this.GLOBAL.fetchGet('/v1/api/paper/findRating', { paperId:this.activeContent.id },function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
if(res.data===null){ |
|
|
|
|
that.stars=[{ value: 0 }, { value: 0 }, { value: 0 }] |
|
|
|
|
}else{ |
|
|
|
|
that.stars=[{ value: res.data.score1 }, { value: res.data.score2 }, { value: res.data.score3 }] |
|
|
|
|
} |
|
|
|
|
that.show_star_button=res.data===null |
|
|
|
|
}else{ |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//滚动正文 |
|
|
|
|
scrollContent(e) { |
|
|
|
|
this.$store.commit('read/scroll', e.target.scrollTop) |
|
|
|
@ -366,6 +382,20 @@ |
|
|
|
|
//提交评分 |
|
|
|
|
submitRating() { |
|
|
|
|
console.info(this.stars) |
|
|
|
|
let that=this |
|
|
|
|
this.GLOBAL.fetchJSON('/v1/api/paper/rating','POST',{ |
|
|
|
|
paperId:this.activeContent.id, |
|
|
|
|
score1:this.stars[0].value, |
|
|
|
|
score2:this.stars[1].value, |
|
|
|
|
score3:this.stars[2].value, |
|
|
|
|
},function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
that.queryRating() |
|
|
|
|
that.$message.info(that.$t('read.tip.rating_ok').toString()) |
|
|
|
|
}else{ |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//高亮笔记 |
|
|
|
|
highlighting(item: any) { |
|
|
|
@ -493,9 +523,16 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
let that = this |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
if(this.activeContent) { |
|
|
|
|
that.queryRating() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.activeName = this.$store.state.read.activeName |
|
|
|
|
|
|
|
|
|
let that = this |
|
|
|
|
|
|
|
|
|
addEventListener('keyup', function(event) { |
|
|
|
|
//监听查找操作 |
|
|
|
|
if (event.shiftKey && 'F' === event.key.toUpperCase()) { |
|
|
|
|