瀏覽代碼

feat: 增加筛选物业转版筛选条件

zhangsiya 1 年之前
父節點
當前提交
530831efda

+ 8 - 0
apps/bigmember_pc/src/api/modules/bi.js

@@ -16,3 +16,11 @@ export function ajaxSetInfoId(data) {
     data
   })
 }
+
+// 获取物业专版的筛选条件
+export function getPropertyFilters() {
+  return request({
+    url: '/jyapi/jybx/core/property/searchCriteria',
+    method: 'post'
+  })
+}

+ 1 - 0
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -10,6 +10,7 @@ const {
   isLogin,
   isInApp,
   isInWeb,
+  inBIPropertyIframe,
   activeTab,
   guideGoWorkSpace,
   filterState,

+ 18 - 0
apps/bigmember_pc/src/views/search/bidding/constant/index.js

@@ -0,0 +1,18 @@
+import { createBiSearchBidBaseSchema, createBiSearchBidMoreSchema } from '@/views/search/bidding/constant/search-filters-bi.js'
+import { createSearchBidBaseSchema, createSearchBidMoreSchema  } from '@/views/search/bidding/constant/search-filters.js'
+
+export function getCreateSearchSchema(conf) {
+  const { bi } = conf
+  console.log(bi)
+  if(bi) {
+    return {
+      createSearchBidBaseSchema: createBiSearchBidBaseSchema,
+      createSearchBidMoreSchema: createBiSearchBidMoreSchema
+    }
+  } else {
+    return {
+      createSearchBidBaseSchema,
+      createSearchBidMoreSchema
+    }
+  }
+}

+ 266 - 0
apps/bigmember_pc/src/views/search/bidding/constant/search-filters-bi.js

@@ -0,0 +1,266 @@
+import { getPropertyFilters } from '@/api/modules/bi'
+
+import RegionCollapseSelector from '@/components/filter-items/RegionCollapseSelector'
+import CommonCheckboxSelector from '@/components/filter-items/CommonCheckboxSelector'
+import PriceSelector from '@/components/selector/PriceSelector'
+// 信息类型
+import InfoTypeDropdown from '@/components/filter-items/InfoTypeDropdown.vue'
+// 搜索范围
+import SearchRangeDropdown from '@/components/filter-items/SearchRangeDropdown.vue'
+// 发布时间
+import TimeDropdown from '@/components/selector/timeDropdown'
+// 附件
+import AttachmentSelector from '@/components/filter-items/AttachmentSelector.vue'
+// 换手率
+import ChangeHandsDropdown from '@/components/filter-items/ChangeHandsDropdown.vue'
+import SearchTimeScopeSelector from '@/components/selector/SearchTimeScopeSelector.vue'
+import ContactSelector from '@/components/filter-items/ContactSelector.vue'
+import KeywordTagsSelector from '@/components/filter-items/KeywordTagsSelector'
+import basicDropdown from '@/components/selector/basicDropdown'
+
+// 获取物业专版筛选条件
+let propertyListData = {}
+async function getFilters () {
+  const { error_code: code, data} = await getPropertyFilters()
+  if(code === 0) {
+    let newData = {}
+    Object.keys(data).forEach(v => {
+      newData[v] = []
+      data[v].forEach(s => {
+        let sArr = s.split('#')
+        s = {
+          label: sArr[0],
+          value: sArr[1]
+        }
+        newData[v].push(s)
+      })
+    })
+    propertyListData = newData
+    createBiSearchBidBaseSchema()
+  }
+}
+getFilters()
+
+function createBiSearchBidBaseSchema() {
+  const businessList = propertyListData['业务类型'] || []
+  const SearchBidBaseSchema = [
+    {
+      key: 'regionMap',
+      label: '地区:',
+      defaultVal: {},
+      _name: 'regionMap',
+      _type: 'component',
+      expand: {
+        component: RegionCollapseSelector,
+        props: {
+          showSelectedList: false
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'expireTime',
+      label: '到期时间:',
+      defaultVal: '',
+      _name: 'expireTime',
+      _type: 'component',
+      expand: {
+        component: SearchTimeScopeSelector,
+        props: {
+          type: 'expire'
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'subinformation',
+      label: '业务类型:',
+      defaultVal: [],
+      _name: 'subinformation',
+      _type: 'component',
+      expand: {
+        component: CommonCheckboxSelector,
+        props: {
+          options: {
+            value: businessList
+          }
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'scale',
+      label: '价格区间:',
+      defaultVal: '',
+      _name: 'scale',
+      _type: 'component',
+      expand: {
+        component: PriceSelector,
+        props: {},
+        hooks: {}
+      }
+    },
+    {
+      key: 'period',
+      label: '合同周期:',
+      defaultVal: '',
+      _name: 'period',
+      _type: 'component',
+      expand: {
+        component: CommonCheckboxSelector,
+        props: {},
+        hooks: {}
+      }
+    },
+    {
+      key: 'propertyForm',
+      label: '物业业态:',
+      defaultVal: '',
+      _name: 'propertyForm',
+      _type: 'component',
+      expand: {
+        component: CommonCheckboxSelector,
+        props: {},
+        hooks: {}
+      }
+    }
+  ]
+
+  return SearchBidBaseSchema
+}
+
+function createBiSearchBidMoreSchema() {
+  const SearchBidMoreSchema = [
+    {
+      key: 'selectType',
+      label: '搜索范围',
+      defaultVal: ['title', 'content'],
+      _name: 'selectType',
+      _type: 'component',
+      expand: {
+        component: SearchRangeDropdown,
+        hooks: {}
+      }
+    },
+    {
+      key: 'subtype',
+      label: '信息类型',
+      defaultVal: '',
+      _name: 'subtype',
+      _type: 'component',
+      expand: {
+        component: InfoTypeDropdown,
+        props: {
+          notNJ: true
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'publishTime',
+      label: '发布时间',
+      defaultVal: 'fiveyear',
+      _name: 'publishTime',
+      _type: 'component',
+      expand: {
+        component: TimeDropdown,
+        props: {
+          placeholder: '发布时间',
+          selectData: [{
+            value: 'lately-7',
+            label: '最近7天'
+          }, {
+            value: 'lately-30',
+            label: '最近30天'
+          }, {
+            value: 'thisyear',
+            label: '最近1年'
+          }, {
+            value: 'threeyear',
+            label: '最近3年'
+          }, {
+            value: 'fiveyear',
+            label: '最近5年'
+          }, {
+            value: '0',
+            label: '自定义',
+            disabled: true
+          }],
+          selectorType: 'line',
+          singleChoice: true,
+
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'changehand',
+      label: '换手率',
+      defaultVal: '',
+      _name: 'changehand',
+      _type: 'component',
+      expand: {
+        component: ChangeHandsDropdown,
+        hooks: {}
+      }
+    },
+    {
+      key: 'fileExists',
+      label: '附件',
+      defaultVal: '',
+      _name: 'fileExists',
+      _type: 'component',
+      expand: {
+        component: AttachmentSelector,
+        hooks: {}
+      }
+    },
+    {
+      key: 'buyertel',
+      label: '采购单位联系方式',
+      defaultVal: '',
+      _name: 'buyertel',
+      _type: 'component',
+      expand: {
+        component: ContactSelector,
+        props: {
+          source: 'buyer'
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'winnertel',
+      label: '中标企业联系方式',
+      defaultVal: '',
+      _name: 'winnertel',
+      _type: 'component',
+      expand: {
+        component: ContactSelector,
+        props: {
+          source: 'winner'
+        },
+        hooks: {}
+      }
+    },
+    {
+      key: 'notkey',
+      label: '排除词',
+      defaultVal: [],
+      _name: 'notKeyComponent',
+      _type: 'component',
+      expand: {
+        component: KeywordTagsSelector,
+        props: {
+          placeholder: '排除词',
+          inputPlaceholder: '请输入不希望包含的关键词',
+          maxTip: '排除词个数已达上限'
+        },
+        hooks: {}
+      }
+    }
+  ]
+  return SearchBidMoreSchema
+}
+
+export { createBiSearchBidBaseSchema, createBiSearchBidMoreSchema }

+ 15 - 6
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -7,7 +7,7 @@ import { mixinVisited } from '@/utils/mixins/visited-setup.js'
 import  { FilterHistoryAjaxModelRestore, getParam, openLinkInWorkspace, InContainer} from '@/utils'
 import $bus from '@/utils/bus'
 // 筛选条件动态组件方法
-import { createSearchBidBaseSchema, createSearchBidMoreSchema } from '@/views/search/bidding/constant/search-filters'
+import { getCreateSearchSchema } from '@/views/search/bidding/constant/index'
 // API 业务模型
 import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
 // 扩展业务模型
@@ -68,8 +68,8 @@ export default function () {
 
 
   // 是否在工作台内
-  const isInApp = ref(InContainer.inApp)
-  const isInWeb = ref(InContainer.inWeb)
+  const isInApp = ref(true) || ref(InContainer.inApp)
+  const isInWeb = ref(false) || ref(InContainer.inWeb)
 
   // 是否是渠道商
   const cooperateCode = ref(false)
@@ -127,8 +127,10 @@ export default function () {
     searchModelOptions,
     getFormatAPIParams: getFormatOfInputKeywords
   } = useSearchInputKeywordsModel()
-  const { filterState, getFormatAPIParams: getFormatOfFilter } =
-    useSearchFilterModel()
+  const {
+    filterState,
+    getFormatAPIParams: getFormatOfFilter,
+  } = useSearchFilterModel({ inBIPropertyIframe })
   const {
     limitActions,
     headerActions,
@@ -156,7 +158,11 @@ export default function () {
       }
     }
   }
-
+  // 筛选条件动态配置处理
+  const {
+    createSearchBidBaseSchema,
+    createSearchBidMoreSchema
+  } = getCreateSearchSchema({ bi: inBIPropertyIframe })
   // 处理当前信息类型--展示数据类型
   const  infoTypeDataType = computed(() =>  {
     let result = 'all'
@@ -456,6 +462,8 @@ export default function () {
    */
 
   function getParams(params = {}) {
+    // 物业专版筛选条件待处理
+    // filterProperty
     // 合并所有模型的搜索筛选项
     const result = Object.assign(
       {
@@ -549,6 +557,7 @@ export default function () {
       filterState.value,
       inputKeywordsState.value
     )
+
     return originParams
   }
 

+ 58 - 13
apps/bigmember_pc/src/views/search/bidding/model/modules/filter.js

@@ -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,49 @@ 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 +82,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
   }
 }

+ 2 - 1
apps/bigmember_pc/src/views/search/bidding/model/modules/tabs.js

@@ -2,7 +2,8 @@ import { computed, ref } from 'vue'
 
 export function useSearchTabsModel(conf) {
   const { showTabs2 } = conf
-  const activeTab = ref(0)
+  const defaultTab = showTabs2 ? 1 : 0
+  const activeTab = ref(defaultTab)
   const Tabs = [
     {
       label: '全部',