From 6c06d89355ef3e3db365bf3971377c4649ba112d Mon Sep 17 00:00:00 2001 From: zhengjie <201507802@qq.com> Date: Tue, 25 Jun 2019 09:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=90=9C=E7=B4=A2=E5=92=8C=E5=88=A0=E9=99=A4BUG=20#20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/initData.js | 9 +++++++++ src/views/generator/index.vue | 1 + src/views/monitor/log/errorLog.vue | 1 + src/views/monitor/log/index.vue | 1 + src/views/monitor/redis/index.vue | 2 ++ src/views/system/dict/index.vue | 2 ++ src/views/system/dictDetail/index.vue | 2 ++ src/views/system/job/index.vue | 2 ++ src/views/system/role/index.vue | 2 ++ src/views/system/timing/index.vue | 2 ++ src/views/system/timing/module/log.vue | 1 + src/views/system/user/center/log.vue | 1 + src/views/system/user/index.vue | 2 ++ src/views/tools/picture/index.vue | 2 ++ src/views/tools/picture/module/header.vue | 1 + src/views/tools/qiniu/module/list.vue | 1 + src/views/tools/qiniu/module/module/header.vue | 1 + 17 files changed, 33 insertions(+) diff --git a/src/mixins/initData.js b/src/mixins/initData.js index 9648ae5..2c6110d 100644 --- a/src/mixins/initData.js +++ b/src/mixins/initData.js @@ -37,6 +37,15 @@ export default { this.page = 0 this.size = e this.init() + }, + // 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据 + dleChangePage(size) { + if (size === undefined) { + size = 1 + } + if (this.data.length === size && this.page !== 0) { + this.page = this.page - 1 + } } } } diff --git a/src/views/generator/index.vue b/src/views/generator/index.vue index 2c81e76..986cccb 100644 --- a/src/views/generator/index.vue +++ b/src/views/generator/index.vue @@ -23,6 +23,7 @@ { this.delLoading = false this.$refs[index].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 92782e6..ed3a0e4 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -40,6 +40,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/dictDetail/index.vue b/src/views/system/dictDetail/index.vue index f159003..07e3651 100644 --- a/src/views/system/dictDetail/index.vue +++ b/src/views/system/dictDetail/index.vue @@ -36,6 +36,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/job/index.vue b/src/views/system/job/index.vue index 78e7af8..f476af4 100644 --- a/src/views/system/job/index.vue +++ b/src/views/system/job/index.vue @@ -47,6 +47,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index e8974ec..fa2f328 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -45,6 +45,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/timing/index.vue b/src/views/system/timing/index.vue index 5901cce..002965c 100644 --- a/src/views/system/timing/index.vue +++ b/src/views/system/timing/index.vue @@ -44,6 +44,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/system/timing/module/log.vue b/src/views/system/timing/module/log.vue index 7308f31..6c4378e 100644 --- a/src/views/system/timing/module/log.vue +++ b/src/views/system/timing/module/log.vue @@ -40,6 +40,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/tools/picture/index.vue b/src/views/tools/picture/index.vue index 7134644..27ecc27 100644 --- a/src/views/tools/picture/index.vue +++ b/src/views/tools/picture/index.vue @@ -38,6 +38,7 @@ { this.delLoading = false this.$refs[id].doClose() + this.dleChangePage() this.init() this.$notify({ title: '删除成功', diff --git a/src/views/tools/picture/module/header.vue b/src/views/tools/picture/module/header.vue index e85308a..56391f8 100644 --- a/src/views/tools/picture/module/header.vue +++ b/src/views/tools/picture/module/header.vue @@ -67,6 +67,7 @@ export default { delAll(ids).then(res => { this.delLoading = false this.$parent.init() + this.$parent.dleChangePage(ids.length) this.$notify({ title: '删除成功', type: 'success', diff --git a/src/views/tools/qiniu/module/list.vue b/src/views/tools/qiniu/module/list.vue index 3b5a076..d93e9f7 100644 --- a/src/views/tools/qiniu/module/list.vue +++ b/src/views/tools/qiniu/module/list.vue @@ -48,6 +48,7 @@ { this.delLoading = false + this.$parent.dleChangePage(ids.length) this.$parent.init() this.$notify({ title: '删除成功',