|
|
@ -178,8 +178,8 @@ |
|
|
|
disabled: true, |
|
|
|
disabled: true, |
|
|
|
//替换目标 |
|
|
|
//替换目标 |
|
|
|
replace: {}, |
|
|
|
replace: {}, |
|
|
|
stars: [{ value: 0 }, { value: 0 }, { value: 0 }], |
|
|
|
stars: [], |
|
|
|
show_star_button: true |
|
|
|
show_star_button: false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -228,6 +228,22 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
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) { |
|
|
|
scrollContent(e) { |
|
|
|
this.$store.commit('read/scroll', e.target.scrollTop) |
|
|
|
this.$store.commit('read/scroll', e.target.scrollTop) |
|
|
@ -366,6 +382,20 @@ |
|
|
|
//提交评分 |
|
|
|
//提交评分 |
|
|
|
submitRating() { |
|
|
|
submitRating() { |
|
|
|
console.info(this.stars) |
|
|
|
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) { |
|
|
|
highlighting(item: any) { |
|
|
@ -493,9 +523,16 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
|
|
|
|
let that = this |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
if(this.activeContent) { |
|
|
|
|
|
|
|
that.queryRating() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.activeName = this.$store.state.read.activeName |
|
|
|
this.activeName = this.$store.state.read.activeName |
|
|
|
|
|
|
|
|
|
|
|
let that = this |
|
|
|
|
|
|
|
addEventListener('keyup', function(event) { |
|
|
|
addEventListener('keyup', function(event) { |
|
|
|
//监听查找操作 |
|
|
|
//监听查找操作 |
|
|
|
if (event.shiftKey && 'F' === event.key.toUpperCase()) { |
|
|
|
if (event.shiftKey && 'F' === event.key.toUpperCase()) { |
|
|
|