From db549c03b66a2fc7aeb7a98667d181460e75a170 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 09 Aug 2022 17:28:31 +0800
Subject: [PATCH] 地块管理页面分页查询

---
 src/views/land/cs.vue |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/views/land/cs.vue b/src/views/land/cs.vue
index 40ee59a..4dda0d7 100644
--- a/src/views/land/cs.vue
+++ b/src/views/land/cs.vue
@@ -39,6 +39,18 @@
                         clearable
                     ></el-input>
                 </div>
+                        <div class="el-page">
+                            <el-pagination
+                                @size-change="handleSizeChange"
+                                @current-change="handleCurrentChange"
+                                :current-page="page.currentPage"
+                                :hide-on-single-page="value"
+                                :page-size="page.pageSize"
+                                background
+                                layout="total, prev, pager, next"
+                                :total="page.total"
+                            ></el-pagination>
+                        </div>
             </div>
             <div>
                 <el-button size="small">
@@ -70,7 +82,7 @@
                 </div>
             </div>
         </div>
-        <div class="el-page">
+        <!-- <div class="el-page">
             <el-pagination
                 @size-change="handleSizeChange"
                 @current-change="handleCurrentChange"
@@ -81,7 +93,7 @@
                 layout="total, prev, pager, next"
                 :total="page.total"
             ></el-pagination>
-        </div>
+        </div> -->
         <landAdd v-if="landVisible" ref="land" @refreshOnLoad="onLoad"></landAdd>
     </div>
 </template>
@@ -108,7 +120,7 @@
             landVisible: false,
             farmPlanList: [],
             page: {
-                pageSize: 4,
+                pageSize: 8,
                 currentPage: 1,
                 total: 0,
             },
@@ -129,7 +141,7 @@
         ...mapGetters(["userInfo"]),
     },
     created () {
-        this.onLoad()
+        this.onLoad(this.page)
     },
     methods: {
         //圈地
@@ -178,8 +190,9 @@
             })
         },
         onLoad (page, params = {}) {
-            getList(1, 10, Object.assign(params, this.query)).then(res => {
+            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = res.data.data
+                this.page.total = data.total
                 this.farmPlanList = data.records
             })
         },
@@ -234,13 +247,15 @@
 
         .land-img {
             width: 100%;
-            height: 280px;
+            // height: 280px;
+            height: 240px;
             margin: 0 auto;
             text-align: center;
 
             .landimg {
                 width: 100%;
-                height: 280px;
+                // height: 280px;
+                height: 240px;
                 //border-radius: 100px;
                 //margin-top: 25px;
                 //margin-left: -25px;

--
Gitblit v1.9.3