|
@@ -1,5 +1,9 @@
|
|
|
-import { ref } from 'vue'
|
|
|
-import { FilterHistoryViewModel2AjaxModel } from '@/utils'
|
|
|
+import { ref, computed } from 'vue'
|
|
|
+import {
|
|
|
+ FilterHistoryViewModel2AjaxModel,
|
|
|
+ areaObjTwoToSingle,
|
|
|
+ infoTypeMapFormat
|
|
|
+} from '@/utils'
|
|
|
|
|
|
export function useSearchFilterModel(conf) {
|
|
|
const { inBIPropertyIframe } = conf
|
|
@@ -41,7 +45,7 @@ export function useSearchFilterModel(conf) {
|
|
|
// 到期时间
|
|
|
expireTime: '',
|
|
|
// 业务类型
|
|
|
- subinformation: [],
|
|
|
+ subInformation: [],
|
|
|
// 价格区间
|
|
|
scale: [],
|
|
|
// 合同周期
|
|
@@ -51,19 +55,19 @@ export function useSearchFilterModel(conf) {
|
|
|
// 搜索范围
|
|
|
selectType: ['title', 'content'],
|
|
|
// 信息类型
|
|
|
- subtype: {},
|
|
|
+ subType: {},
|
|
|
// 发布时间
|
|
|
publishTime: 'fiveyear',
|
|
|
// 换手率
|
|
|
- changehand: '',
|
|
|
+ changeHand: '',
|
|
|
// 附件
|
|
|
fileExists: '',
|
|
|
// 采购单位联系方式
|
|
|
- buyertel: '',
|
|
|
+ buyerTel: '',
|
|
|
// 中标企业联系方式
|
|
|
- winnertel: '',
|
|
|
+ winnerTel: '',
|
|
|
// 排除词
|
|
|
- notkey: []
|
|
|
+ notKey: []
|
|
|
})
|
|
|
const filterState = ref({})
|
|
|
if(inBIPropertyIframe) {
|
|
@@ -109,7 +113,29 @@ export function useSearchFilterModel(conf) {
|
|
|
}
|
|
|
// 格式化物业专版的筛选条件
|
|
|
function getFormatAPIPropertyParams() {
|
|
|
- return filterState.value
|
|
|
+ const { publishTime, regionMap, notKey, subType } = filterState.value
|
|
|
+ const { area, city } = areaObjTwoToSingle(regionMap)
|
|
|
+ const rPublishTime = publishTime?.indexOf('_') > -1 ? publishTime.replace(/_/g, '-') : FilterHistoryViewModel2AjaxModel.formatTime(publishTime, true, '-')
|
|
|
+ const rSubtype = infoTypeMapFormat(subType)
|
|
|
+ const params = {
|
|
|
+ bidField: 'BIProperty',
|
|
|
+ province: area,
|
|
|
+ city,
|
|
|
+ expireTime: filterState.value.expireTime,
|
|
|
+ subInformation: filterState.value.subInformation?.join(),
|
|
|
+ scale: filterState.value.scale?.join(),
|
|
|
+ period: filterState.value.period?.join(),
|
|
|
+ propertyForm: filterState.value.propertyForm?.join(),
|
|
|
+ selectType: filterState.value.selectType?.join(','),
|
|
|
+ subType: rSubtype,
|
|
|
+ publishTime: rPublishTime,
|
|
|
+ changeHand: filterState.value.changeHand,
|
|
|
+ fileExists: filterState.value.fileExists,
|
|
|
+ buyerTel: filterState.value.buyerTel,
|
|
|
+ winnerTel: filterState.value.winnerTel,
|
|
|
+ exclusionWords: notKey?.join(','), // 排除词
|
|
|
+ }
|
|
|
+ return params
|
|
|
}
|
|
|
// 动态更新筛选条件
|
|
|
function updateFilterBase (keyObj = {}) {
|