fix:修改所有表格翻页后不回到顶部的问题 并且保证删除修改后滚动条位置不变
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<button :title="$t('overall.createModel')" @click="add" class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="model-add" v-has="'model_toAdd'">
|
||||
<i class="nz-icon-create-square nz-icon"></i>
|
||||
</button>
|
||||
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" api="model" v-has="'model_delete'"></delete-button>
|
||||
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true" api="model" v-has="'model_delete'"></delete-button>
|
||||
</div>
|
||||
<div class="pagination-top pagination-top-hide display-none"></div>
|
||||
</div>
|
||||
@@ -204,6 +204,7 @@
|
||||
},
|
||||
searchLabel: {}, //搜索参数
|
||||
scrollbarWrap: null,
|
||||
delFlag:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -248,6 +249,7 @@
|
||||
}).then(() => {
|
||||
this.$delete("model?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 {
|
||||
@@ -266,6 +268,7 @@
|
||||
closeRightBox(refresh) {
|
||||
this.rightBox.show = false;
|
||||
if (refresh) {
|
||||
this.delFlag=true;
|
||||
this.getTableData();
|
||||
}
|
||||
},
|
||||
@@ -371,6 +374,11 @@
|
||||
if (n.length === 0 && this.pageObj.pageNo > 1) {
|
||||
this.pageNo(this.pageObj.pageNo-1);
|
||||
}
|
||||
if(!this.delFlag){ // 不是删除时回到顶部
|
||||
this.$refs.modelTable.bodyWrapper.scrollTop = 0
|
||||
}else{
|
||||
this.delFlag=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user