|
|
|
@ -62,7 +62,6 @@ |
|
|
|
|
<el-col :span="5" class="ml3 note-list"> |
|
|
|
|
<template v-if="noteList.length>0"> |
|
|
|
|
<el-row v-for="(item,index) in noteList" :key="index" class="mb2"> |
|
|
|
|
<el-tooltip :content="$t('read.tip.click_note_list')" :disabled="item.isEdit"> |
|
|
|
|
<el-card> |
|
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
|
<el-row type="flex" justify="space-around"> |
|
|
|
@ -78,7 +77,6 @@ |
|
|
|
|
</el-button-group> |
|
|
|
|
</el-row> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="text item" @click="jump(item)" @mouseover="highlighting(item)" |
|
|
|
|
@mouseout="reset(item)"> |
|
|
|
|
<transition v-if="item.isEdit" @after-leave="save(item)"> |
|
|
|
@ -88,11 +86,12 @@ |
|
|
|
|
</el-tooltip> |
|
|
|
|
</transition> |
|
|
|
|
<template v-else> |
|
|
|
|
<pre style="background-color: white">{{item.content}}</pre> |
|
|
|
|
<el-tooltip :content="$t('read.tip.click_note_list')" :disabled="item.isEdit"> |
|
|
|
|
<pre style="background-color: white">{{item.content}}</pre> |
|
|
|
|
</el-tooltip> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</el-tooltip> |
|
|
|
|
<el-alert v-if="item.message" |
|
|
|
|
@close="item.message=null;item.type=null" |
|
|
|
|
:title="item.message" |
|
|
|
@ -369,8 +368,19 @@ |
|
|
|
|
}, |
|
|
|
|
//保存笔记 |
|
|
|
|
save(item: any) { |
|
|
|
|
this.$set(item, 'type', 'success') |
|
|
|
|
this.$set(item, 'message', '保存成功') |
|
|
|
|
let that=this |
|
|
|
|
this.GLOBAL.fetchJSON('/v1/api/notes/update','PUT',{ |
|
|
|
|
noteId:item.id, |
|
|
|
|
noteContent:item.content |
|
|
|
|
},function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
that.$set(item, 'type', 'success') |
|
|
|
|
that.$set(item, 'message', that.$t('read.tip.update_note_ok')) |
|
|
|
|
}else { |
|
|
|
|
that.$set(item, 'type', 'error') |
|
|
|
|
that.$set(item, 'message', that.$t('read.tip.update_note_fail')) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//删除笔记 |
|
|
|
|
del(item: any, index: number) { |
|
|
|
|