浏览代码

修改页面翻页问题

lex-xin 4 年之前
父节点
当前提交
2c06ba4460

+ 9 - 0
src/layout/components/TagsView.vue

@@ -90,10 +90,19 @@ export default {
       const searchs = new Searchs();
       const allSearch = searchs.getSearchs();
       const sks = Object.keys(allSearch);
+      let route = this.$route
       for (const item of sks) {
         if (!(keys.includes(item) || keys.includes(allSearch[item].bind))) {
           searchs.removeByKey(item);
         }
+
+        let tempSaveKeyList = item.split('|')
+        // 大于1说明的特殊标识编号
+        if(tempSaveKeyList.length > 1) {
+          if(allSearch[item] && route.path == allSearch[item].bind && route.query[tempSaveKeyList[1]] != tempSaveKeyList[2]) {
+            searchs.removeByKey(item);
+          }
+        }
       }
     },
     async addViewTags() {

+ 2 - 1
src/views/teamDetail/components/studentList.vue

@@ -1510,7 +1510,8 @@ export default {
   },
   computed:{
     saveKey(){
-      return 'teamDetails-'+this.$route.query.id
+      // return 'teamDetails-'+this.$route.query.id
+      return 'teamDetails-studentList|id|' + this.$route.query.id
     }
   }
 };

+ 7 - 2
src/views/teamDetail/components/teacherList.vue

@@ -8,7 +8,7 @@
     <!-- 搜索类型 -->
     <save-form
       :inline="true"
-      save-key="teamDetails-teacherList"
+      :save-key="saveKey"
       class="searchForm"
       :model="searchForm"
       @submit="search"
@@ -99,7 +99,7 @@
         </el-table-column> -->
       </el-table>
       <pagination
-      save-key="teamDetails-teacherList"
+      :save-key="saveKey"
       sync
         :total.sync="rules.total"
         :page.sync="rules.page"
@@ -157,6 +157,11 @@ export default {
     //   }
     // })
   },
+  computed:{
+    saveKey(){
+      return 'teamDetails-teacherList|id|' + this.$route.query.id
+    }
+  },
   methods: {
     search() {
       this.rules.page = 1;

+ 3 - 3
src/views/teamDetail/index.vue

@@ -109,9 +109,9 @@ export default {
       // let teamInfo = this.$route.query;
       this.$nextTick(res=>{
         this.status = this.$route.query.status;
-      this.teamid = this.$route.query.id;
-      this.name = this.$route.query.name;
-      console.log(this.teamid)
+        this.teamid = this.$route.query.id;
+        this.name = this.$route.query.name;
+        // console.log(this.teamid)
       })
 
       // 判断是否带缓存参数