Skip to content

Commit 1c4dc4a

Browse files
committed
增加编辑保存后不重置分页页数(停留在当前页的数据)
1 parent f03fe43 commit 1c4dc4a

File tree

2 files changed

+16
-8
lines changed
  • Vol.Vue/src/components/basic/ViewGridConfig
  • 开发版dev/Vue.NetCore/Vol.Vue/src/components/basic/ViewGridConfig

2 files changed

+16
-8
lines changed

Vol.Vue/src/components/basic/ViewGridConfig/methods.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ let methods = {
556556
formData.delKeys = this.detailOptions.delKeys;
557557
}
558558
//保存前拦截
559-
if (this.currentAction == this.const.ADD) {
559+
let _currentIsAdd = this.currentAction == this.const.ADD;
560+
if (_currentIsAdd) {
560561
//2020.12.06增加新建前异步处理方法
561562
if (!this.addBefore(formData) || await !this.addBeforeAsync(formData)) return;
562563
} else {
@@ -566,7 +567,7 @@ let methods = {
566567
let url = this.getUrl(this.currentAction);
567568
this.http.post(url, formData, true).then(x => {
568569
//保存后
569-
if (this.currentAction == this.const.ADD) {
570+
if (_currentIsAdd) {
570571
if (!this.addAfter(x)) return;
571572
} else {
572573
if (!this.updateAfter(x)) return;
@@ -576,7 +577,9 @@ let methods = {
576577
//如果保存成功后需要关闭编辑框,直接返回不处理后面
577578
if (this.boxOptions.saveClose) {
578579
this.boxModel = false;
579-
this.refresh();
580+
//2020.12.27如果是编辑保存后不重置分页页数,刷新页面时还是显示当前页的数据
581+
this.$refs.table.load(null, _currentIsAdd);
582+
//this.refresh();
580583
return;
581584
}
582585
let resultRow;
@@ -600,7 +603,8 @@ let methods = {
600603
this.$refs.detail.rowData.push(...resultRow.list);
601604
}
602605
}
603-
this.refresh();
606+
this.$refs.table.load(null, _currentIsAdd);
607+
// this.refresh();
604608
});
605609
},
606610
del () {

开发版dev/Vue.NetCore/Vol.Vue/src/components/basic/ViewGridConfig/methods.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ let methods = {
556556
formData.delKeys = this.detailOptions.delKeys;
557557
}
558558
//保存前拦截
559-
if (this.currentAction == this.const.ADD) {
559+
let _currentIsAdd = this.currentAction == this.const.ADD;
560+
if (_currentIsAdd) {
560561
//2020.12.06增加新建前异步处理方法
561562
if (!this.addBefore(formData) || await !this.addBeforeAsync(formData)) return;
562563
} else {
@@ -566,7 +567,7 @@ let methods = {
566567
let url = this.getUrl(this.currentAction);
567568
this.http.post(url, formData, true).then(x => {
568569
//保存后
569-
if (this.currentAction == this.const.ADD) {
570+
if (_currentIsAdd) {
570571
if (!this.addAfter(x)) return;
571572
} else {
572573
if (!this.updateAfter(x)) return;
@@ -576,7 +577,9 @@ let methods = {
576577
//如果保存成功后需要关闭编辑框,直接返回不处理后面
577578
if (this.boxOptions.saveClose) {
578579
this.boxModel = false;
579-
this.refresh();
580+
//2020.12.27如果是编辑保存后不重置分页页数,刷新页面时还是显示当前页的数据
581+
this.$refs.table.load(null, _currentIsAdd);
582+
//this.refresh();
580583
return;
581584
}
582585
let resultRow;
@@ -600,7 +603,8 @@ let methods = {
600603
this.$refs.detail.rowData.push(...resultRow.list);
601604
}
602605
}
603-
this.refresh();
606+
this.$refs.table.load(null, _currentIsAdd);
607+
// this.refresh();
604608
});
605609
},
606610
del () {

0 commit comments

Comments
 (0)