|
|
@ -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-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> |
|
|
|
<el-form-item class="center"> |
|
|
|
<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-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
<el-table :data="tableData" border> |
|
|
|
<el-table :data="tableData" border> |
|
|
|
<el-table-column align="center" prop="paper_name" :label="$t('note.table.paper_name')" /> |
|
|
|
<el-table-column align="center" :label="$t('note.table.paper_name')"> |
|
|
|
<el-table-column align="center" prop="original_text" :label="$t('note.table.original_text')" /> |
|
|
|
<template slot-scope="scope" > |
|
|
|
<el-table-column align="center" prop="note_name" :label="$t('read.form.note_title')" /> |
|
|
|
《{{scope.row.paper.title}}》 |
|
|
|
<el-table-column align="center" prop="note_content" :label="$t('read.form.note_content')" /> |
|
|
|
</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')" > |
|
|
|
<el-table-column align="center" :label="$t('action')" > |
|
|
|
<template slot-scope="scope" > |
|
|
|
<template slot-scope="scope" > |
|
|
|
<el-button>{{$t('button.edit')}}</el-button> |
|
|
|
<el-button @click="read(scope.row)">{{$t('button.jump_note')}}</el-button> |
|
|
|
<el-button type="danger" @click="del">{{$t('button.del')}}</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -31,7 +34,7 @@ |
|
|
|
<div class="block center mt1"> |
|
|
|
<div class="block center mt1"> |
|
|
|
<el-pagination |
|
|
|
<el-pagination |
|
|
|
layout="prev, pager, next" |
|
|
|
layout="prev, pager, next" |
|
|
|
:total="1000"> |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -44,14 +47,9 @@ |
|
|
|
name: 'note', |
|
|
|
name: 'note', |
|
|
|
data(){ |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
return { |
|
|
|
tableData:[{ |
|
|
|
tableData:[], |
|
|
|
note_name:'笔记', |
|
|
|
|
|
|
|
original_text:'注释原文', |
|
|
|
|
|
|
|
note_content:'笔记内容', |
|
|
|
|
|
|
|
paper_name: '《论文》' |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
form:{ |
|
|
|
form:{ |
|
|
|
note_name:'', |
|
|
|
note_title:'', |
|
|
|
note_content:'' |
|
|
|
note_content:'' |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules:{ |
|
|
|
rules:{ |
|
|
@ -65,16 +63,51 @@ |
|
|
|
message: this.$t('input_please', { keyword: this.$t('read.form.note_content') }), |
|
|
|
message: this.$t('input_please', { keyword: this.$t('read.form.note_content') }), |
|
|
|
trigger: 'blur' |
|
|
|
trigger: 'blur' |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
total:1 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
methods:{ |
|
|
|
del(){ |
|
|
|
//查找笔记 |
|
|
|
this.$confirm(this.$t('note.tip.confirm_del').toString(),this.$t('tip').toString(),{ |
|
|
|
findNote(){ |
|
|
|
confirmButtonText:this.$t('button.ok').toString(), |
|
|
|
let that=this |
|
|
|
cancelButtonText:this.$t('button.cancel').toString() |
|
|
|
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> |
|
|
|
</script> |
|
|
|