fix: 修改查询后 表格不会到顶部的问题

This commit is contained in:
zhangyu
2020-11-16 15:16:39 +08:00
parent e735a380be
commit 6928b325de
15 changed files with 94 additions and 11 deletions

View File

@@ -829,6 +829,11 @@
}
},
watch: {
tableData(){
if(this.$refs.alertListTable&&this.$refs.alertListTable.bodyWrapper){
this.$refs.alertListTable.bodyWrapper.scrollTop = 0;
}
},
showSubList(n) {
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
@@ -888,7 +893,7 @@
: this.tableTitle;
}
*/
}
},
}
</script>

View File

@@ -519,6 +519,8 @@
return parseFloat(item).toFixed(2);
}
});
}else{
current=[null,null];
}
this.requestIndex += 1;
item.current = current;
@@ -643,8 +645,15 @@
}
this.getAlertList();
}
},
tableData(){
if(this.$refs.alertMessageTable&&this.$refs.alertMessageTable.bodyWrapper){
this.$nextTick(()=>{
this.$refs.alertMessageTable.bodyWrapper.scrollTop = 0;
})
}
},
},
mounted() {
//是否存在分页缓存
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);

View File

@@ -259,8 +259,13 @@
this.getTableData();
}
}
},
tableData(){
if(this.$refs.cabTable&&this.$refs.cabTable.bodyWrapper){
this.$refs.cabTable.bodyWrapper.scrollTop = 0;
}
},
},
mounted() {
this.$nextTick(() => {
//绑定滚动条事件控制top按钮

View File

@@ -476,8 +476,13 @@
})
}
}
},
tableData(){
if(this.$refs.endpointTable&& this.$refs.endpointTable.bodyWrapper){
this.$refs.endpointTable.bodyWrapper.scrollTop = 0;
}
},
},
mounted() {
//初始化表头
this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/projectBottom")

View File

@@ -201,6 +201,11 @@
'alertLabel':alertLabel,
},
watch:{
tableData(){
if(this.$refs.alertListTable&&this.$refs.alertListTable.bodyWrapper){
this.$refs.alertListTable.bodyWrapper.scrollTop = 0;
}
},
},
computed: {
tagType() {

View File

@@ -124,6 +124,11 @@
'alertLabel':alertLabel,
},
watch:{
tableData(){
if(this.$refs.assetTable&& this.$refs.assetTable.bodyWrapper){
this.$refs.assetTable.bodyWrapper.scrollTop = 0;
}
},
},
computed: {
tagType() {

View File

@@ -115,6 +115,11 @@
'alertLabel':alertLabel,
},
watch:{
tableData(){
if(this.$refs.endpointTable){
this.$refs.endpointTable.bodyWrapper.scrollTop = 0;
}
},
},
computed: {
tagType() {

View File

@@ -427,8 +427,13 @@
this.dispatchEvent('asset-ping-switch-change',pingTitle.show)
}
}
},
tableData(){
if(this.$refs.assetTable&&this.$refs.assetTable.bodyWrapper){
this.$refs.assetTable.bodyWrapper.scrollTop = 0;
}
},
},
methods: {
fullScreen() {
let vm = this;
@@ -480,7 +485,7 @@
this.tools.loading = false;
if (response.code === 200) {
this.tableData = response.data.list;
this.pageObj.total = response.data.total
this.pageObj.total = response.data.total;
}
});
},

View File

@@ -357,8 +357,13 @@
'bottomBox.showSubList': function(n) {
let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
tableData(n){
if(this.$refs.accountTable){
this.$refs.accountTable.bodyWrapper.scrollTop = 0;
}
},
},
mounted() {
//初始化表头
this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)

View File

@@ -487,8 +487,13 @@
'bottomBox.showSubList': function(n) {
let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
tableData(){
if(this.$refs.dcTable&&this.$refs.dcTable.bodyWrapper){
this.$refs.dcTable.bodyWrapper.scrollTop = 0;
}
},
},
destroyed() {
window.onresize = null;
},

View File

@@ -368,6 +368,11 @@
let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
tableData(){
if(this.$refs.modelTable&&this.$refs.modelTable.bodyWrapper){
this.$refs.modelTable.bodyWrapper.scrollTop = 0;
}
},
}
}
</script>

View File

@@ -259,6 +259,13 @@
this.getTableData();
},
},
watch:{
tableData(){
if(this.$refs.operationLogTable&&this.$refs.operationLogTable.bodyWrapper){
this.$refs.operationLogTable.bodyWrapper.scrollTop = 0;
}
},
},
computed: {
isCurrentUser() {
return function(username) {

View File

@@ -443,7 +443,12 @@
'bottomBox.showSubList': function(n) {
let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
tableData(){
if(this.$refs.promTable&&this.$refs.promTable.bodyWrapper){
this.$refs.promTable.bodyWrapper.scrollTop = 0;
}
},
}
}
</script>

View File

@@ -284,6 +284,13 @@
this.getTableData();
},
},
watch:{
tableData(){
if(this.$refs.terminalLogTablethis.$refs.terminalLogTable.bodyWrapper){
this.$refs.terminalLogTable.bodyWrapper.scrollTop = 0;
}
},
},
mounted() {
//初始化表头
this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)

View File

@@ -837,6 +837,11 @@
});
}
},
endpointTableData(){
if(this.$refs.endpointTable&&this.$refs.endpointTable.bodyWrapper){
this.$refs.endpointTable.bodyWrapper.scrollTop = 0;
}
},
},
destroyed(){
window.onresize=null;