fix: 列表当前页被删除空后页码减一

This commit is contained in:
陈劲松
2020-12-29 15:38:04 +08:00
committed by chenjinsong
parent af0561cabe
commit b2dd73c4fd
10 changed files with 84 additions and 0 deletions

View File

@@ -715,6 +715,14 @@
this.getAlertList(); this.getAlertList();
} }
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
created(){ created(){
//是否存在分页缓存 //是否存在分页缓存

View File

@@ -503,6 +503,14 @@
this.bottomBox.ruleDetail = this.convertToDetail(n); this.bottomBox.ruleDetail = this.convertToDetail(n);
} }
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
beforeDestroy() { beforeDestroy() {
bus.$off("alert-rule-list-change"); bus.$off("alert-rule-list-change");

View File

@@ -691,6 +691,14 @@
showSubList(n) { showSubList(n) {
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
created(){ created(){
//是否存在分页缓存 //是否存在分页缓存

View File

@@ -452,6 +452,14 @@
let vm = this; let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
created(){ created(){
//是否存在分页缓存 //是否存在分页缓存

View File

@@ -510,6 +510,14 @@
let vm = this; let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
beforeDestroy(){ beforeDestroy(){
bus.$off("dc-list-change"); bus.$off("dc-list-change");

View File

@@ -345,6 +345,16 @@
this.getTableData(); this.getTableData();
}, },
}, },
watch: {
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
},
created(){ created(){
//是否存在分页缓存 //是否存在分页缓存
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);

View File

@@ -365,6 +365,14 @@
let vm = this; let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
beforeDestroy() { beforeDestroy() {
this.scrollbarWrap.removeEventListener('scroll', bus.debounce); this.scrollbarWrap.removeEventListener('scroll', bus.debounce);

View File

@@ -445,6 +445,14 @@
let vm = this; let vm = this;
this.$bottomBoxWindow.showSubListWatch(vm, n); this.$bottomBoxWindow.showSubListWatch(vm, n);
}, },
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
}, },
} }
</script> </script>

View File

@@ -293,6 +293,16 @@
this.getTableData(); this.getTableData();
}, },
}, },
watch: {
tableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.pageObj.pageNo > 1) {
this.pageNo(this.pageObj.pageNo-1);
}
}
}
},
created(){ created(){
//是否存在分页缓存 //是否存在分页缓存
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);

View File

@@ -836,6 +836,14 @@
}); });
} }
}, },
endpointTableData: {
deep: true,
handler(n) {
if (n.length === 0 && this.endpointPageObj.pageNo > 1) {
this.endpointPageNo(this.endpointPageObj.pageNo-1);
}
}
}
}, },
beforeDestroy() { beforeDestroy() {
bus.$off("project-page-type"); bus.$off("project-page-type");