fix:修改所有表格翻页后不回到顶部的问题 并且保证删除修改后滚动条位置不变

This commit is contained in:
zhangyu
2020-12-31 17:41:40 +08:00
parent b267dfa3f3
commit 62f88ebf6c
12 changed files with 125 additions and 13 deletions

View File

@@ -16,7 +16,7 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="prom-add">
<i class="nz-icon-create-square nz-icon"></i>
</button>
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" api="promServer" v-has="'prom_delete'"></delete-button>
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true" api="promServer" v-has="'prom_delete'"></delete-button>
</div>
<div class="pagination-top pagination-top-hide display-none"></div>
</div>
@@ -224,6 +224,7 @@
searchLabel: {}, //搜索参数
promServerType:null,
scrollbarWrap: null,
delFlag:false,
}
},
methods: {
@@ -276,6 +277,7 @@
}).then(() => {
this.$delete("promServer?ids=" + u.id).then(response => {
if (response.code === 200) {
this.delFlag=true;
this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.getTableData();
} else {
@@ -296,6 +298,7 @@
closeRightBox(refresh) {
this.rightBox.show = false;
if (refresh) {
this.delFlag=true;
this.getTableData();
}
},
@@ -451,6 +454,11 @@
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
if(!this.delFlag){ // 不是删除时回到顶部
this.$refs.promTable.bodyWrapper.scrollTop = 0
}else{
this.delFlag=false;
}
}
}
},