Commit 7725797f authored by 王玉鑫's avatar 王玉鑫

feat: 列表页查询参数修改

parent d6a2e86f
...@@ -30,4 +30,6 @@ export default { ...@@ -30,4 +30,6 @@ export default {
queryFiltersList: '/postcard/api/sysDictData/listByCodes', queryFiltersList: '/postcard/api/sysDictData/listByCodes',
/** 登录 */ /** 登录 */
login: '/postcard/user/login', login: '/postcard/user/login',
/** 主导产业 */
queryIndustryList: '/postcard/api/parkInfo/v1.0/industryList',
} }
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-show="activeBar !== 1">
<dropdown-vue <dropdown-vue
ref="dropDown" ref="dropDown"
:menuList="$u.deepClone(menuList[activeBar])" :menuList="$u.deepClone(menuList[activeBar])"
...@@ -58,8 +59,9 @@ ...@@ -58,8 +59,9 @@
:top="166" :top="166"
></dropdown-vue> ></dropdown-vue>
</div> </div>
<template v-if="mode === 'list'"> </div>
<view class="tab-contant">
<view v-if="mode === 'list'" class="tab-contant content" :class="{'no-filter': activeBar === 1}">
<view <view
class="media-card" class="media-card"
v-for="cardInfo in dataList" v-for="cardInfo in dataList"
...@@ -70,7 +72,6 @@ ...@@ -70,7 +72,6 @@
<land-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 1"></land-card-vue> <land-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 1"></land-card-vue>
<carrier-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue> <carrier-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue>
</view> </view>
</view>
<u-loadmore <u-loadmore
v-if="dataList.length && (!haveMore || isLoading)" v-if="dataList.length && (!haveMore || isLoading)"
:status="isLoading ? 'loading' : 'nomore'" :status="isLoading ? 'loading' : 'nomore'"
...@@ -93,8 +94,8 @@ ...@@ -93,8 +94,8 @@
marginTop="120" marginTop="120"
> >
</u-empty> </u-empty>
</template> </view>
<div v-else class=""> <div v-else class="content">
<map id="mapId" @markertap="handleMarkerClick" @callouttap="handleMarkerClick" :scale='10' style="width: 100%;height: calc(100vh - 246rpx)" latitude="31.464086" longitude="116.944909" class="map" :markers="markers"> <map id="mapId" @markertap="handleMarkerClick" @callouttap="handleMarkerClick" :scale='10' style="width: 100%;height: calc(100vh - 246rpx)" latitude="31.464086" longitude="116.944909" class="map" :markers="markers">
</map> </map>
<div v-if="activeInfo.id" :key="activeInfo.id" @click="toDetail(activeInfo)" style="position: fixed;padding: 0 30rpx;bottom: 30rpx;width: 100vw;z-index: 999;box-sizing: border-box;"> <div v-if="activeInfo.id" :key="activeInfo.id" @click="toDetail(activeInfo)" style="position: fixed;padding: 0 30rpx;bottom: 30rpx;width: 100vw;z-index: 999;box-sizing: border-box;">
...@@ -134,7 +135,7 @@ export default { ...@@ -134,7 +135,7 @@ export default {
[ [
{ {
id: 1, id: 1,
name: "级别", name: "主导产业",
isMultiple: false, //是否多选 isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4) showType: 3, //下拉框类型(1、2、3、4)
}, },
...@@ -147,18 +148,18 @@ export default { ...@@ -147,18 +148,18 @@ export default {
}, },
], ],
[ [
{ // {
id: 1, // id: 1,
name: "土地类型", // name: "土地类型",
isMultiple: false, //是否多选 // isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4) // showType: 3, //下拉框类型(1、2、3、4)
}, // },
{ // {
id: 2, // id: 2,
name: "面积", // name: "面积",
isMultiple: false, //是否多选 // isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4) // showType: 3, //下拉框类型(1、2、3、4)
}, // },
], ],
[ [
{ {
...@@ -171,7 +172,7 @@ export default { ...@@ -171,7 +172,7 @@ export default {
id: 2, id: 2,
name: "建筑结构", name: "建筑结构",
isMultiple: false, //是否多选 isMultiple: false, //是否多选
showType: 1, //下拉框类型(1、2、3、4) showType: 3, //下拉框类型(1、2、3、4)
}, },
{ {
id: 3, id: 3,
...@@ -206,10 +207,15 @@ export default { ...@@ -206,10 +207,15 @@ export default {
}, },
mounted() { mounted() {
this.getList(); this.getList();
store.dispatch('getFilterEnum').then(() => { this.initFilterList();
},
methods: {
initFilterList() {
const list = [this.initIndustryList(), store.dispatch('getFilterEnum')];
Promise.all(list).then(([industryList]) => {
this.filterList = [ this.filterList = [
{ {
itemList1: this.filterEnum.park_level, itemList1: industryList.map((i) => ({ dictLabel: i, dictValue: i, dictType: 'primaryIndustry' })),
itemList2: this.filterEnum.park_area, itemList2: this.filterEnum.park_area,
}, },
{ {
...@@ -224,7 +230,30 @@ export default { ...@@ -224,7 +230,30 @@ export default {
] ]
}) })
}, },
methods: { initIndustryList() {
return this.$fetch({
url: API.queryIndustryList,
methods: "get",
data: {},
});
} ,
handleParams(params) {
const config = {
park_area: 'parkArea',
carrier_type: 'carrierType',
carrier_construction: 'carrierConstruction',
carrier_area: 'carrierArea',
}
const result = Object.entries(params).map(([key, value]) => {
const target = config[key];
if (target) {
return [target, value];
} else {
return [key, value];
}
});
return Object.fromEntries(result);
},
getList() { getList() {
if (!this.haveMore) return; if (!this.haveMore) return;
this.isLoading = true; this.isLoading = true;
...@@ -241,6 +270,7 @@ export default { ...@@ -241,6 +270,7 @@ export default {
} }
} }
searchCondition.name = this.searchKey searchCondition.name = this.searchKey
searchCondition = this.handleParams(searchCondition);
this.$fetch({ this.$fetch({
url: this.api, url: this.api,
methods: "post", methods: "post",
...@@ -419,7 +449,12 @@ export default { ...@@ -419,7 +449,12 @@ export default {
} }
.tab-contant { .tab-contant {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
}
.content {
padding-top: 250rpx + 20rpx; padding-top: 250rpx + 20rpx;
&.no-filter {
padding-top: 250rpx + 20rpx - 80rpx;
}
} }
.media-card { .media-card {
margin-bottom: 15rpx; margin-bottom: 15rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment