fix:修改所有表格翻页后不回到顶部的问题 并且保证删除修改后滚动条位置不变
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<button :title="$t('overall.batchEdit')" @click.stop="batchEdit" class="nz-btn nz-btn-size-normal nz-btn-style-light" id="asset-batch-asset" style="margin-left: 15px" v-has="'asset_toBatchEdit'">
|
||||
<i class="nz-icon nz-icon-batch-edit"></i>
|
||||
</button>
|
||||
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" api="asset" v-has="'asset_delete'"></delete-button>
|
||||
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true" api="asset" v-has="'asset_delete'"></delete-button>
|
||||
</div>
|
||||
<div class="pagination-top pagination-top-hide display-none"></div>
|
||||
</div>
|
||||
@@ -388,11 +388,11 @@
|
||||
idcId: '',
|
||||
idcIds: ''
|
||||
},
|
||||
|
||||
assetPingSwitch: localStorage.getItem('nz-sys-asset-ping-switch'),
|
||||
tagKeys:[],
|
||||
|
||||
scrollbarWrap: null
|
||||
scrollbarWrap: null,
|
||||
delFlag:false,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
@@ -434,6 +434,14 @@
|
||||
}else if(n.length === 0 && this.pageObj.pageNo === 1){
|
||||
this.afterTableListChange();
|
||||
}
|
||||
|
||||
if(!this.delFlag){ // 不是删除时回到顶部
|
||||
this.$refs.assetTable.bodyWrapper.scrollTop = 0
|
||||
}else{
|
||||
this.delFlag=false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -555,6 +563,7 @@
|
||||
this.$delete("asset?ids=" + asset.id).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
||||
this.delFlag=true;
|
||||
this.getTableData()
|
||||
} else {
|
||||
this.$message.error(response.msg);
|
||||
@@ -593,6 +602,7 @@
|
||||
this.rightBox.show = false;
|
||||
this.rightBox.batchShow = false;
|
||||
if (refresh) {
|
||||
this.delFlag=true;
|
||||
this.getTableData()
|
||||
this.loadKeys();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user