From 311325c98fbe3ccfdbc85d64e007e7b5b638bbc0 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 09 Aug 2022 17:36:28 +0800
Subject: [PATCH] 修正地块分类查询查询条件,优化分页
---
src/views/land/cs.vue | 41 ++++++++++++++++++++++++++++++++---------
1 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/src/views/land/cs.vue b/src/views/land/cs.vue
index 715c834..26fdb32 100644
--- a/src/views/land/cs.vue
+++ b/src/views/land/cs.vue
@@ -15,7 +15,7 @@
<el-option label="果园" value="2"></el-option>
<el-option label="鱼塘" value="3"></el-option>
<el-option label="山地" value="4"></el-option>
- <el-option label="养殖区" value="4"></el-option>
+ <el-option label="养殖区" value="5"></el-option>
</el-select>
</div>
<!-- <div style="float: left; margin-left: 15px">-->
@@ -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>
@@ -103,12 +115,12 @@
keyword: "",
},
query: {},
- value: false,
+ value: true,
farmingCount: 0,
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: {
//圈地
@@ -143,6 +155,7 @@
stypeChange (value) {
this.query["landType"] = value
this.onLoad(this.page, this.query)
+ this.page.currentPage = 1
},
//库存 select 改变事件
stateChange (value) {
@@ -165,14 +178,22 @@
this.onLoad(this.page)
},
landInfo (item) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "地块详情") {
+ arr.push(item);
+ }
+ });
+ this.$store.state.tags.tagList = arr;
this.$router.push({
path: `/LandDetail`,
query: item,
})
},
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
})
},
@@ -227,13 +248,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