소스 검색

修改分页

lex-xin 4 년 전
부모
커밋
cbff233863
1개의 변경된 파일9개의 추가작업 그리고 10개의 파일을 삭제
  1. 9 10
      src/views/musicalManager/index.vue

+ 9 - 10
src/views/musicalManager/index.vue

@@ -9,7 +9,6 @@
       <save-form
         :inline="true"
         :model="searchForm"
-        ref="searchForm"
         @submit="search"
         @reset="onReSet"
       >
@@ -155,10 +154,10 @@
         </el-table>
         <pagination
           sync
-          :total.sync="rules.total"
-          :page.sync="rules.page"
-          :limit.sync="rules.limit"
-          :page-sizes="rules.page_size"
+          :total.sync="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
           @pagination="getList"
         />
       </div>
@@ -187,7 +186,7 @@ export default {
       soundLists: [],
       organList: [],
       tableList:[],
-      rules: {
+      pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
         page: 1, // 当前页
@@ -211,18 +210,18 @@ export default {
       this.getCategory()
     },
    search() {
-      this.rules.page = 1;
+      this.pageInfo.page = 1;
       this.getList()
     },
     onReSet() {
-      this.$refs['searchForm'].resetFields()
+      this.pageInfo.page = 1;
       this.getList()
     },
     async getList() {
      try{
-       const res = await getInstrument({...this.searchForm,rows:this.rules.limit,page:this.rules.page})
+       const res = await getInstrument({...this.searchForm,rows:this.pageInfo.limit,page:this.pageInfo.page})
         this.tableList = res.data.rows
-        this.rules.total = res.data.total
+        this.pageInfo.total = res.data.total
      }catch(e){
        console.log(e)
      }