展开收起

This commit is contained in:
zhaofang
2022-06-07 17:34:30 +08:00
parent 0cf9d297e8
commit 1b3ca4ce1e

View File

@@ -90,25 +90,32 @@
<i class="el-icon-time"></i> <i class="el-icon-time"></i>
<time-show :time="item.sysCreateTime"></time-show> <time-show :time="item.sysCreateTime"></time-show>
</div> </div>
</div> </div>
</router-link> </router-link>
</div> </div>
<div style="height:35px"> <div style="height:35px">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author> <author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div> </div>
<router-link :to="'/case/detail?id='+item.id"> <!-- <router-link :to="'/case/detail?id='+item.id"> -->
<div class="case-info-summary" > <!-- class="case-info-summary" -->
{{item.summary}} <div>
<router-link :to="'/case/detail?id='+item.id">
<!-- {{item.summary}} -->
{{displayAll(item)}}
</router-link>
<span style="color:#588afc" v-if="item.summary.length>90" @click="changeIsAll(item)">
{{item.isAll?'收起':'全文'}}
</span>
</div> </div>
</router-link> <!-- </router-link> -->
<div class="button-wrap" v-if="needShowExpande"> <!-- <div class="button-wrap" v-if="needShowExpande">
<div class="exp-but" @click="expandeClick" v-if="!expande">展开 <div class="exp-but" @click="expandeClick" v-if="!expande">展开
</div> </div>
<div class="exp-but" @click="expandeClick" v-else>收起</div> <div class="exp-but" @click="expandeClick" v-else>收起</div>
</div> </div> -->
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div> <div>
<interactBar :type="0" :shares="false" :data="item" :readonly="false"></interactBar> </div> <interactBar :type="0" :shares="false" :data="item" :readonly="false"></interactBar> </div>
</div> </div>
@@ -331,17 +338,20 @@ export default {
window.removeEventListener("scroll",this.handleScroll); window.removeEventListener("scroll",this.handleScroll);
}, },
methods: { methods: {
//展示全部
tagsClose(tag, index){ displayAll(item) {
if(!item.isAll && item.summary && item.summary.length > 90) {
}, return item.summary.slice(0, 90) + "...";
}
return item.summary;
},
changeIsAll(item) {
item.isAll=!item.isAll;
},
closeSearch() { closeSearch() {
this.showAll = !this.showAll; this.showAll = !this.showAll;
var searchBoxHeght = document.getElementById("searchBox"); var searchBoxHeght = document.getElementById("searchBox");
var searchBoxWidth = document.getElementById("searchBox"); var searchBoxWidth = document.getElementById("searchBox");
// console.log(searchBoxWidth.clientWidth);
if(searchBoxWidth.clientWidth > 950){ if(searchBoxWidth.clientWidth > 950){
this.searchwd = false; this.searchwd = false;
} }
@@ -467,6 +477,7 @@ export default {
if(res.status==200){ if(res.status==200){
if(res.result.list.length>0){ if(res.result.list.length>0){
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.isAll=false;
item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null}; item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null};
if(item.isTop) { if(item.isTop) {
isTopList.push(item); isTopList.push(item);
@@ -765,7 +776,7 @@ export default {
} }
.case-info-summary { .case-info-summary {
height: 60px; height: 60px;
line-height: 30px; line-height: 30px;
font-size: 15px; font-size: 15px;
color: #444444; color: #444444;