|
|
|
@ -10,20 +10,23 @@ |
|
|
|
|
<el-input type="textarea" v-model="form.note_content" :placeholder="$t('input_please', { keyword: this.$t('read.form.note_content') })"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="center"> |
|
|
|
|
<el-button>{{$t('button.query')}}</el-button> |
|
|
|
|
<el-button @click="findNote">{{$t('button.query')}}</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<el-table :data="tableData" border> |
|
|
|
|
<el-table-column align="center" prop="paper_name" :label="$t('note.table.paper_name')" /> |
|
|
|
|
<el-table-column align="center" prop="original_text" :label="$t('note.table.original_text')" /> |
|
|
|
|
<el-table-column align="center" prop="note_name" :label="$t('read.form.note_title')" /> |
|
|
|
|
<el-table-column align="center" prop="note_content" :label="$t('read.form.note_content')" /> |
|
|
|
|
<el-table-column align="center" :label="$t('note.table.paper_name')"> |
|
|
|
|
<template slot-scope="scope" > |
|
|
|
|
《{{scope.row.paper.title}}》 |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" prop="originalText" :label="$t('note.table.original_text')" /> |
|
|
|
|
<el-table-column align="center" prop="noteTitle" :label="$t('read.form.note_title')" /> |
|
|
|
|
<el-table-column align="center" prop="noteContent" :label="$t('read.form.note_content')" /> |
|
|
|
|
<el-table-column align="center" :label="$t('action')" > |
|
|
|
|
<template slot-scope="scope" > |
|
|
|
|
<el-button>{{$t('button.edit')}}</el-button> |
|
|
|
|
<el-button type="danger" @click="del">{{$t('button.del')}}</el-button> |
|
|
|
|
<el-button @click="read(scope.row)">{{$t('button.jump_note')}}</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -31,7 +34,7 @@ |
|
|
|
|
<div class="block center mt1"> |
|
|
|
|
<el-pagination |
|
|
|
|
layout="prev, pager, next" |
|
|
|
|
:total="1000"> |
|
|
|
|
:total="total"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -44,14 +47,9 @@ |
|
|
|
|
name: 'note', |
|
|
|
|
data(){ |
|
|
|
|
return { |
|
|
|
|
tableData:[{ |
|
|
|
|
note_name:'笔记', |
|
|
|
|
original_text:'注释原文', |
|
|
|
|
note_content:'笔记内容', |
|
|
|
|
paper_name: '《论文》' |
|
|
|
|
}], |
|
|
|
|
tableData:[], |
|
|
|
|
form:{ |
|
|
|
|
note_name:'', |
|
|
|
|
note_title:'', |
|
|
|
|
note_content:'' |
|
|
|
|
}, |
|
|
|
|
rules:{ |
|
|
|
@ -65,16 +63,51 @@ |
|
|
|
|
message: this.$t('input_please', { keyword: this.$t('read.form.note_content') }), |
|
|
|
|
trigger: 'blur' |
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
total:1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods:{ |
|
|
|
|
del(){ |
|
|
|
|
this.$confirm(this.$t('note.tip.confirm_del').toString(),this.$t('tip').toString(),{ |
|
|
|
|
confirmButtonText:this.$t('button.ok').toString(), |
|
|
|
|
cancelButtonText:this.$t('button.cancel').toString() |
|
|
|
|
//查找笔记 |
|
|
|
|
findNote(){ |
|
|
|
|
let that=this |
|
|
|
|
this.GLOBAL.fetchGet("/v1/api/notes/list",{ |
|
|
|
|
noteTitle:that.form.note_title, |
|
|
|
|
noteContent:that.form.note_content |
|
|
|
|
},function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
that.tableData=[] |
|
|
|
|
that.tableData=res.data.data |
|
|
|
|
that.total=res.data.total |
|
|
|
|
}else{ |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//打开笔记 |
|
|
|
|
read(row){ |
|
|
|
|
let that=this |
|
|
|
|
let item=row.paper |
|
|
|
|
this.GLOBAL.fetchGet("/v1/api/file/find",{ |
|
|
|
|
paperId:item.id, |
|
|
|
|
},function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
item.content=res.msg |
|
|
|
|
that.$store.commit('menus/read') |
|
|
|
|
that.$store.commit('read/open', item) |
|
|
|
|
// that.$router.push({that.localePath('/read')}) |
|
|
|
|
that.$router.push({ |
|
|
|
|
path:that.localePath('/read'), |
|
|
|
|
query:row |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.findNote() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|