Browse Source

修改 数据改变后分页不会到第一页

asd123a20 2 years ago
parent
commit
b6368d519a

+ 2 - 0
admin-code/src/views/Home.vue

@@ -133,6 +133,7 @@ export default {
     treeClick(e) {
       this.type = e.data.code;
       this.filterQuery();
+      this.$refs.filterList.resetPage(-1);
     },
     // 表单保存
     async formSave(e) {
@@ -155,6 +156,7 @@ export default {
           msg = '字典添加成功';
         }
         this.filterQuery();
+        this.$refs.filterList.resetPage(-1);
       } else {
         // 字典类别
         if (e._id) {

+ 2 - 0
admin-content/src/views/home.vue

@@ -202,6 +202,7 @@ export default {
       const filter = { bind: this.types };
       this.filterQuery({ filter });
       this.visibleSync = false;
+      this.$refs.filterList.resetPage(-1);
     },
     // 富文本改变
     editChage (e) {
@@ -239,6 +240,7 @@ export default {
       this.types = data.code;
       const filter = { bind: data.code };
       await this.filterQuery({ filter });
+      this.$refs.filterList.resetPage(-1);
     }
   }
 };

+ 3 - 0
admin-frame/src/components/filterList/index.vue

@@ -103,6 +103,9 @@ export default {
       this.filters = e;
       this.$refs.pagination.resetPage(-1);
     },
+    resetPage(e) {
+      this.$refs.pagination.resetPage(e);
+    },
     // 分页函数
     paginationsQuery(e) {
       this.paging = e;

+ 2 - 0
admin-img-news/src/views/home.vue

@@ -194,6 +194,7 @@ export default {
     treeClick(e) {
       this.type = e.data.code;
       this.filterQuery();
+      this.$refs.filterList.resetPage(-1);
     },
     // 表单保存
     async formSave (e) {
@@ -214,6 +215,7 @@ export default {
           msg = '内容添加成功';
         }
         this.filterQuery();
+        this.$refs.filterList.resetPage(-1);
       } else {
         // 新闻类别
         if (e._id) {

+ 2 - 0
admin-menu/src/views/home.vue

@@ -149,11 +149,13 @@ export default {
       await this.menusQueryAll();
       this.$resChange(res, msg);
       this.visibleSync = false;
+      this.$refs.filterList.resetPage(-1);
     },
     async treeClick({ data, node }) {
       this.types = data.code;
       const filter = { parentCode: data.code };
       await this.filterQuery({ filter });
+      this.$refs.filterList.resetPage(-1);
     }
   }
 };

+ 1 - 0
admin-page/src/views/home.vue

@@ -128,6 +128,7 @@ export default {
       this.$resChange(res, msg);
       this.filterQuery();
       this.visibleSync = false;
+      this.$refs.filterList.resetPage(-1);
     },
     // 富文本改变
     editChage (e) {

+ 1 - 0
admin-role/src/views/home.vue

@@ -99,6 +99,7 @@ export default {
       this.$resChange(res, msg);
       this.filterQuery();
       this.visibleSync = false;
+      this.$refs.filterList.resetPage(-1);
     }
   }
 };

+ 1 - 0
admin-toconfig/src/views/home.vue

@@ -103,6 +103,7 @@ export default {
       this.$resChange(res, msg);
       this.filterQuery();
       this.visibleSync = false;
+      this.$refs.filterList.resetPage(-1);
     }
   }
 };