This commit is contained in:
zhaofang
2022-11-03 10:38:50 +08:00
parent e72bcba847
commit a693cf7fbd

View File

@@ -69,7 +69,15 @@
<h6>{{ item.sysUpdateTime }}</h6>
</div>
<div class="all-content" style="word-break:break-all;">
<span v-if="item.contentType != 3">{{ item.content }}</span>
<span v-if="item.type == 1">{{item.content}}</span>
<span v-if="item.contentType != 3 && item.type == 2">
<!-- {{ item.content }} -->
{{displayAll(item)}}
<span style="color:#588afc;cursor:pointer;" v-if="item.content && item.content.length>150" @click.stop="changeIsAll(item)">
{{item.isAll?'收起':'全文展开'}}
</span>
</span>
<div v-else>
<template v-for="img in item.content">
<img @click="showBigImg(fileBaseUrl + img)" :src="fileBaseUrl + img" alt="" style="max-width: 400px;"/>
@@ -266,6 +274,15 @@ export default {
});
},
methods: {
displayAll(item) {
if (!item.isAll && item.content && item.content.length > 180) {
return item.content.slice(0, 150) + "...";
}
return item.content;
},
changeIsAll(item) {
item.isAll = !item.isAll;
},
// 笔记图片放大
showBigImg(path){
this.currentImagePath = path;
@@ -535,6 +552,9 @@ export default {
apiNote.query(data).then(res=>{
if(res.status == 200) {
res.result.list.forEach((item,index)=>{
if(item.type == 2 && item.contentType !== 3) {
item.isAll = false;
}
if(item.contentType == 3) {
item.content = item.content.split(',');
}