|
@@ -1,9 +1,10 @@
|
|
|
import { ref } from 'vue'
|
|
|
import { FilterHistoryViewModel2AjaxModel } from '@/utils'
|
|
|
|
|
|
-export function useSearchFilterModel() {
|
|
|
+export function useSearchFilterModel(conf) {
|
|
|
+ const { inBIPropertyIframe } = conf
|
|
|
// 筛选组件状态
|
|
|
- const filterState = ref({
|
|
|
+ const filterBase = ref({
|
|
|
// 发布时间
|
|
|
publishTime: 'thisyear',
|
|
|
// 搜索范围
|
|
@@ -31,11 +32,48 @@ export function useSearchFilterModel() {
|
|
|
// 中标企业
|
|
|
winner: [],
|
|
|
// 招标代理机构
|
|
|
- agency: []
|
|
|
+ agency: [],
|
|
|
})
|
|
|
+ const filterProperty = ref({
|
|
|
+ bidField: 'BIProperty',
|
|
|
+ // 地区
|
|
|
+ regionMap: {},
|
|
|
+ // 到期时间
|
|
|
+ expireTime: '',
|
|
|
+ // 业务类型
|
|
|
+ subinformation: [],
|
|
|
+ // 价格区间
|
|
|
+ scale: [],
|
|
|
+ // 合同周期
|
|
|
+ period: [],
|
|
|
+ // 物业业态
|
|
|
+ propertyForm: [],
|
|
|
+ // 搜索范围
|
|
|
+ selectType: ['title', 'content'],
|
|
|
+ // 信息类型
|
|
|
+ subtype: {},
|
|
|
+ // 发布时间
|
|
|
+ publishTime: 'fiveyear',
|
|
|
+ // 换手率
|
|
|
+ changehand: '',
|
|
|
+ // 附件
|
|
|
+ fileExists: '',
|
|
|
+ // 采购单位联系方式
|
|
|
+ buyertel: '',
|
|
|
+ // 中标企业联系方式
|
|
|
+ winnertel: '',
|
|
|
+ // 排除词
|
|
|
+ notkey: []
|
|
|
+ })
|
|
|
+ const filterState = ref({})
|
|
|
+ if(inBIPropertyIframe) {
|
|
|
+ filterState.value = filterProperty.value
|
|
|
+ } else {
|
|
|
+ filterState.value = filterBase.value
|
|
|
+ }
|
|
|
|
|
|
function getFormatAPIParams() {
|
|
|
- const { publishTime, regionMap, industry, notkey, buyerclass, subtype } = filterState.value
|
|
|
+ const { publishTime, regionMap, industry, notkey, buyerclass, subtype } = filterBase.value
|
|
|
const { area, city, district } = FilterHistoryViewModel2AjaxModel.formatAreaCity(regionMap)
|
|
|
const rPublishTime = publishTime?.indexOf('_') > -1 ? publishTime.replace(/_/g, '-') : FilterHistoryViewModel2AjaxModel.formatTime(publishTime, true, '-')
|
|
|
const rIndustry = FilterHistoryViewModel2AjaxModel.formatIndustry(industry)
|
|
@@ -43,27 +81,33 @@ export function useSearchFilterModel() {
|
|
|
const rSubtype = FilterHistoryViewModel2AjaxModel.formatInfoType(subtype)
|
|
|
const params = {
|
|
|
publishTime: rPublishTime,
|
|
|
- selectType: filterState.value.selectType.join(','),
|
|
|
+ selectType: filterBase.value.selectType.join(','),
|
|
|
subtype: rSubtype,
|
|
|
exclusionWords: notkey.join(','), // 排除词
|
|
|
- buyer: filterState.value.buyer.join(','),
|
|
|
- winner: filterState.value.winner.join(','),
|
|
|
- agency: filterState.value.agency.join(','),
|
|
|
+ buyer: filterBase.value.buyer.join(','),
|
|
|
+ winner: filterBase.value.winner.join(','),
|
|
|
+ agency: filterBase.value.agency.join(','),
|
|
|
industry: rIndustry,
|
|
|
province: area,
|
|
|
city,
|
|
|
district,
|
|
|
buyerClass: rBuyerClass,
|
|
|
- fileExists: filterState.value.fileExists,
|
|
|
- price: filterState.value.price,
|
|
|
- buyertel: filterState.value.buyertel,
|
|
|
- winnertel: filterState.value.winnertel
|
|
|
+ fileExists: filterBase.value.fileExists,
|
|
|
+ price: filterBase.value.price,
|
|
|
+ buyerTel: filterBase.value.buyertel,
|
|
|
+ winnerTel: filterBase.value.winnertel
|
|
|
}
|
|
|
return params
|
|
|
}
|
|
|
|
|
|
+ function getFormatAPIPropertyParams() {
|
|
|
+ return filterProperty.value
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
filterState,
|
|
|
- getFormatAPIParams
|
|
|
+ filterProperty,
|
|
|
+ getFormatAPIParams,
|
|
|
+ getFormatAPIPropertyParams
|
|
|
}
|
|
|
}
|