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

feat: 列表页查询参数修改

parent d6a2e86f
......@@ -30,4 +30,6 @@ export default {
queryFiltersList: '/postcard/api/sysDictData/listByCodes',
/** 登录 */
login: '/postcard/user/login',
/** 主导产业 */
queryIndustryList: '/postcard/api/parkInfo/v1.0/industryList',
}
......@@ -49,27 +49,28 @@
</div>
</div>
</div>
<dropdown-vue
ref="dropDown"
:menuList="$u.deepClone(menuList[activeBar])"
:dataObj="$u.deepClone(filterList[activeBar])"
@change="change"
themeColor="#4374EF"
:top="166"
></dropdown-vue>
<div v-show="activeBar !== 1">
<dropdown-vue
ref="dropDown"
:menuList="$u.deepClone(menuList[activeBar])"
:dataObj="$u.deepClone(filterList[activeBar])"
@change="change"
themeColor="#4374EF"
:top="166"
></dropdown-vue>
</div>
</div>
<template v-if="mode === 'list'">
<view class="tab-contant">
<view
class="media-card"
v-for="cardInfo in dataList"
:key="cardInfo.id"
@click="toDetail(cardInfo)"
>
<park-card-vue :key-words="keyWords" :detail="cardInfo" v-if="activeBar == 0"></park-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>
</view>
<view v-if="mode === 'list'" class="tab-contant content" :class="{'no-filter': activeBar === 1}">
<view
class="media-card"
v-for="cardInfo in dataList"
:key="cardInfo.id"
@click="toDetail(cardInfo)"
>
<park-card-vue :key-words="keyWords" :detail="cardInfo" v-if="activeBar == 0"></park-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>
</view>
<u-loadmore
v-if="dataList.length && (!haveMore || isLoading)"
......@@ -93,8 +94,8 @@
marginTop="120"
>
</u-empty>
</template>
<div v-else class="">
</view>
<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>
<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 {
[
{
id: 1,
name: "级别",
name: "主导产业",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
......@@ -147,18 +148,18 @@ export default {
},
],
[
{
id: 1,
name: "土地类型",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
// {
// id: 1,
// name: "土地类型",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// },
// {
// id: 2,
// name: "面积",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// },
],
[
{
......@@ -171,7 +172,7 @@ export default {
id: 2,
name: "建筑结构",
isMultiple: false, //是否多选
showType: 1, //下拉框类型(1、2、3、4)
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 3,
......@@ -206,25 +207,53 @@ export default {
},
mounted() {
this.getList();
store.dispatch('getFilterEnum').then(() => {
this.filterList = [
{
itemList1: this.filterEnum.park_level,
itemList2: this.filterEnum.park_area,
},
{
itemList1: this.filterEnum.land_type,
itemList2: this.filterEnum.land_area,
},
{
itemList1: this.filterEnum.carrier_type,
itemList2: this.filterEnum.carrier_construction,
itemList3: this.filterEnum.carrier_area,
}
]
})
this.initFilterList();
},
methods: {
initFilterList() {
const list = [this.initIndustryList(), store.dispatch('getFilterEnum')];
Promise.all(list).then(([industryList]) => {
this.filterList = [
{
itemList1: industryList.map((i) => ({ dictLabel: i, dictValue: i, dictType: 'primaryIndustry' })),
itemList2: this.filterEnum.park_area,
},
{
itemList1: this.filterEnum.land_type,
itemList2: this.filterEnum.land_area,
},
{
itemList1: this.filterEnum.carrier_type,
itemList2: this.filterEnum.carrier_construction,
itemList3: this.filterEnum.carrier_area,
}
]
})
},
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() {
if (!this.haveMore) return;
this.isLoading = true;
......@@ -241,6 +270,7 @@ export default {
}
}
searchCondition.name = this.searchKey
searchCondition = this.handleParams(searchCondition);
this.$fetch({
url: this.api,
methods: "post",
......@@ -419,7 +449,12 @@ export default {
}
.tab-contant {
padding: 20rpx 30rpx;
}
.content {
padding-top: 250rpx + 20rpx;
&.no-filter {
padding-top: 250rpx + 20rpx - 80rpx;
}
}
.media-card {
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