mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
修改高度控制
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="searBox" v-if="speciData.length > 15">
|
||||
<div class="searBox" v-if="searchwd">
|
||||
<el-button type="text" id="closeSearchBtn" @click="closeSearch">
|
||||
{{word}}
|
||||
<i :class="showAll ? 'el-icon-arrow-up ': 'el-icon-arrow-down'"></i>
|
||||
@@ -281,8 +281,9 @@ export default {
|
||||
speciData:[],
|
||||
moreState: 1, // 1 加载更多 2 加载中 3无数据
|
||||
isSeach: false,
|
||||
searchwd: true,
|
||||
searchwd: false,
|
||||
showAll: true, //是否展开全部
|
||||
initHeight:40,//原始 高度
|
||||
searchRecords: [],
|
||||
caseList: {
|
||||
count: 0,
|
||||
@@ -326,9 +327,9 @@ export default {
|
||||
this.queryCondition.orgDomain = null;
|
||||
};
|
||||
this.specialized();
|
||||
this.$nextTick(function() {
|
||||
this.closeSearch();
|
||||
});
|
||||
// this.$nextTick(function() {
|
||||
// this.closeSearch();
|
||||
// });
|
||||
if (!this.portalCase.readProtocol) {
|
||||
this.protocolDialogVisible = true;
|
||||
}
|
||||
@@ -362,9 +363,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
specialized(){
|
||||
let $this=this;
|
||||
apiCase.majorTypes().then(res =>{
|
||||
if(res.status == 200){
|
||||
this.speciData = res.result
|
||||
this.speciData = res.result;
|
||||
this.$nextTick(function() {
|
||||
$this.initHeight = document.getElementById("searchBox").offsetHeight;
|
||||
$this.closeSearch();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -399,17 +405,18 @@ export default {
|
||||
closeSearch() {
|
||||
this.showAll = !this.showAll;
|
||||
var searchBoxHeght = document.getElementById("searchBox");
|
||||
var searchBoxWidth = document.getElementById("searchBox");
|
||||
if (searchBoxWidth.clientWidth > 950) {
|
||||
this.searchwd = false;
|
||||
//console.log(this.initHeight,'this.initHeight');
|
||||
if(this.initHeight>80){
|
||||
this.searchwd = true;
|
||||
}
|
||||
if (this.showAll == false) {
|
||||
searchBoxHeght.style.height = 40 + "px";
|
||||
} else {
|
||||
searchBoxHeght.style.height = "auto";
|
||||
//console.log(het,'het');
|
||||
if(this.showAll){
|
||||
//searchBoxHeght.style.height = "auto";
|
||||
searchBoxHeght.style.maxHeight = this.initHeight + "px";
|
||||
}else{
|
||||
searchBoxHeght.style.maxHeight = 70 + "px";
|
||||
}
|
||||
},
|
||||
|
||||
getAnkingData() {
|
||||
apiCase.usernameList(5).then(res => {
|
||||
if (res.status == 200) {
|
||||
@@ -781,6 +788,7 @@ export default {
|
||||
}
|
||||
#searchBox {
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
.ranking-title {
|
||||
line-height: 34px;
|
||||
|
||||
Reference in New Issue
Block a user