Browse Source

Merge pull request #475 from snowlyg/master

修复删除最后一个列表数据,重新加载数据报错
奇淼(piexlmax 3 years ago
parent
commit
849d3ff8b6

+ 2 - 2
server/resource/template/web/table.vue.tpl

@@ -228,7 +228,7 @@ export default {
             type: 'success',
             message: '删除成功'
           })
-          if (this.tableData.length == ids.length) {
+          if (this.tableData.length == ids.length && this.page > 1) {
               this.page--;
           }
           this.deleteVisible = false
@@ -272,7 +272,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
             this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/example/customer/customer.vue

@@ -125,7 +125,7 @@ export default {
           type: "success",
           message: ""
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/example/upload/upload.vue

@@ -116,7 +116,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 2 - 2
web/src/view/superAdmin/api/api.vue

@@ -199,7 +199,7 @@ export default {
             type:"success",
             message:res.msg
           })
-         if (this.tableData.length == ids.length) {
+         if (this.tableData.length == ids.length && this.page > 1) {
               this.page--;
           }
           this.deleteVisible = false
@@ -265,7 +265,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 1 - 1
web/src/view/superAdmin/authority/authority.vue

@@ -191,7 +191,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 1 - 1
web/src/view/superAdmin/dictionary/sysDictionary.vue

@@ -220,7 +220,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/superAdmin/dictionary/sysDictionaryDetail.vue

@@ -209,7 +209,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/superAdmin/menu/menu.vue

@@ -324,7 +324,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 2 - 2
web/src/view/superAdmin/operation/sysOperationRecord.vue

@@ -177,7 +177,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == ids.length) {
+        if (this.tableData.length == ids.length && this.page > 1) {
           this.page--;
         }
         this.deleteVisible = false;
@@ -192,7 +192,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();