perf: 优化table右侧滚动条区域;页面增加top按钮;

1.优化table右侧滚动条区域(暂时只有asset、endpoint页)
2.所有列表页增加top按钮
This commit is contained in:
陈劲松
2020-03-05 21:30:45 +08:00
parent 19bda65ad7
commit 2543b2cb48
10 changed files with 220 additions and 14 deletions

View File

@@ -56,6 +56,7 @@
v-scrollBar:el-table
border
tooltip-effect="light"
ref="assetTable"
>
<el-table-column
:resizable="false"
@@ -179,7 +180,7 @@
</el-table-column>
</el-table>
<Pagination :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
<!--<button class="to-top nz-btn nz-btn-size-normal nz-btn-style-light">TOP</button>-->
<button class="to-top nz-btn nz-btn-size-normal nz-btn-style-light" v-show="showTopBtn" @click="toTop">TOP</button>
</div>
<!--<asset-add-unit :add-unit-show='addUnitShow' @refreshData="flushData" ref="assetAddUnit"
@@ -249,6 +250,7 @@
disabled: false
}],
},
showTopBtn: false,
searchLabel: {}, //搜索参数
checkList: [],
tablelable: [],
@@ -503,6 +505,10 @@
});
window.open(routeData.href);
},
/*toTop() {
let el = document.querySelector(".el-table__body-wrapper");
el.scrollTop = 0;
},*/
cli(id,host,accounts){
let port = '';
let accountId = '';
@@ -764,6 +770,17 @@
this.checkList = [];
this.checkList = this.$store.state.assetData.selectedData;
}
//绑定滚动条事件控制top按钮
let el = this.$refs.assetTable.$el.querySelector(".el-table__body-wrapper");
if (el._ps_) {
el.addEventListener("ps-scroll-y", () => {
if (el._ps_.scrollbarYTop > 100) {
this.showTopBtn = true;
} else {
this.showTopBtn = false;
}
});
}
});
let localStorageTitle=localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path);
this.tablelable = localStorageTitle ? JSON.parse(localStorageTitle) : this.tableTitle;