|
|
|
@ -10,13 +10,13 @@ |
|
|
|
|
<el-form-item :label="$t('note.table.original_text')"> |
|
|
|
|
<el-input autosize type="textarea" v-model="note_form.original_text" disabled></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item :label="$t('read.form.note_title')" prop="note_title"> |
|
|
|
|
<el-form-item :label="$t('note.table.note_title')" prop="note_title"> |
|
|
|
|
<el-input v-model="note_form.note_title" |
|
|
|
|
:placeholder="$t('input_please', { keyword: this.$t('read.form.note_title') })"></el-input> |
|
|
|
|
:placeholder="$t('input_please', { keyword: this.$t('note.table.note_title') })"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item :label="$t('read.form.note_content')" prop="note_content"> |
|
|
|
|
<el-form-item :label="$t('note.table.note_content')" prop="note_content"> |
|
|
|
|
<el-input autosize type="textarea" v-model="note_form.note_content" |
|
|
|
|
:placeholder="$t('input_please', { keyword: this.$t('read.form.note_content') })"></el-input> |
|
|
|
|
:placeholder="$t('input_please', { keyword: this.$t('note.table.note_content') })"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="addNote">{{$t('button.add')}}</el-button> |
|
|
|
@ -80,6 +80,8 @@ |
|
|
|
|
> |
|
|
|
|
<el-button size="mini" type="danger" slot="reference" icon="el-icon-delete"></el-button> |
|
|
|
|
</el-popconfirm> |
|
|
|
|
<el-button size="mini" type="success" @click="download(item)" |
|
|
|
|
icon="el-icon-download"></el-button> |
|
|
|
|
</el-button-group> |
|
|
|
|
</el-row> |
|
|
|
|
</div> |
|
|
|
@ -165,12 +167,12 @@ |
|
|
|
|
rules: { |
|
|
|
|
note_title: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: this.$t('input_please', { keyword: this.$t('read.form.note_title') }), |
|
|
|
|
message: this.$t('input_please', { keyword: this.$t('note.table.note_title') }), |
|
|
|
|
trigger: 'blur' |
|
|
|
|
}], |
|
|
|
|
note_content: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: this.$t('input_please', { keyword: this.$t('read.form.note_content') }), |
|
|
|
|
message: this.$t('input_please', { keyword: this.$t('note.table.note_content') }), |
|
|
|
|
trigger: 'blur' |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
@ -232,6 +234,28 @@ |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
|
//导出笔记 |
|
|
|
|
download(item) { |
|
|
|
|
|
|
|
|
|
console.info(item) |
|
|
|
|
let ele = document.createElement('a') |
|
|
|
|
//设置下载文件名 |
|
|
|
|
ele.download = `${this.$t('note.table.note_title')}.txt` |
|
|
|
|
//隐藏元素 |
|
|
|
|
ele.style.display = 'none' |
|
|
|
|
//字符内容转变成blob地址 |
|
|
|
|
let blob = new Blob([`${this.$t('note.table.note_title')}:${item.title} |
|
|
|
|
${this.$t('note.table.paper_name')}:《${this.activeContent.title}》 |
|
|
|
|
${this.$t('note.table.original_text')}:${item.originalText} |
|
|
|
|
${this.$t('note.table.note_content')}:${item.content}`]) |
|
|
|
|
//如果是链接,这里也可以直接设置链接地址 |
|
|
|
|
ele.href = URL.createObjectURL(blob) |
|
|
|
|
document.body.appendChild(ele) |
|
|
|
|
//模拟点击 |
|
|
|
|
ele.click() |
|
|
|
|
//移除元素 |
|
|
|
|
document.body.removeChild(ele) |
|
|
|
|
}, |
|
|
|
|
//收藏 |
|
|
|
|
star(e, item) { |
|
|
|
|
e.stopPropagation() |
|
|
|
@ -434,7 +458,7 @@ |
|
|
|
|
paperId: this.activeContent.id, |
|
|
|
|
score1: this.stars[0].value, |
|
|
|
|
score2: this.stars[1].value, |
|
|
|
|
score3:this.stars[2].value, |
|
|
|
|
score3: this.stars[2].value |
|
|
|
|
}, function(res) { |
|
|
|
|
if (res.code === '200') { |
|
|
|
|
that.queryRating() |
|
|
|
@ -601,7 +625,8 @@ |
|
|
|
|
id: item.noteId, |
|
|
|
|
title: item.noteTitle, |
|
|
|
|
content: item.noteContent, |
|
|
|
|
isActive:item.noteId===that.$route.query.noteId |
|
|
|
|
isActive: item.noteId === that.$route.query.noteId, |
|
|
|
|
originalText: item.originalText |
|
|
|
|
} |
|
|
|
|
that.noteList.push(obj) |
|
|
|
|
if (item.noteId === that.$route.query.noteId) { |
|
|
|
|