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

View File

@@ -519,12 +519,14 @@
return parseFloat(item).toFixed(2); return parseFloat(item).toFixed(2);
} }
}); });
}else{
current=[null,null];
} }
this.requestIndex += 1; this.requestIndex += 1;
item.current = current; item.current = current;
if (this.requestIndex === this.tableData.length) { if (this.requestIndex === this.tableData.length) {
this.$set(item, "current", current); this.$set(item, "current", current);
this.requestIndex = 0; this.requestIndex = 0;
} }
}); });
} }
@@ -643,7 +645,14 @@
} }
this.getAlertList(); this.getAlertList();
} }
} },
tableData(){
if(this.$refs.alertMessageTable&&this.$refs.alertMessageTable.bodyWrapper){
this.$nextTick(()=>{
this.$refs.alertMessageTable.bodyWrapper.scrollTop = 0;
})
}
},
}, },
mounted() { mounted() {
//是否存在分页缓存 //是否存在分页缓存

View File

@@ -259,7 +259,12 @@
this.getTableData(); this.getTableData();
} }
} }
} },
tableData(){
if(this.$refs.cabTable&&this.$refs.cabTable.bodyWrapper){
this.$refs.cabTable.bodyWrapper.scrollTop = 0;
}
},
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

View File

@@ -476,7 +476,12 @@
}) })
} }
} }
} },
tableData(){
if(this.$refs.endpointTable&& this.$refs.endpointTable.bodyWrapper){
this.$refs.endpointTable.bodyWrapper.scrollTop = 0;
}
},
}, },
mounted() { mounted() {
//初始化表头 //初始化表头

View File

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

View File

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

View File

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

View File

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

View File

@@ -357,7 +357,12 @@
'bottomBox.showSubList': function(n) { 'bottomBox.showSubList': function(n) {
let vm = this; let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
} },
tableData(n){
if(this.$refs.accountTable){
this.$refs.accountTable.bodyWrapper.scrollTop = 0;
}
},
}, },
mounted() { mounted() {
//初始化表头 //初始化表头

View File

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

View File

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

View File

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

View File

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

View File

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