浏览代码

Merge branch 'dev/v1.0.36_wmh' of jianyu/web into feature/v1.0.36

wenmenghao 1 年之前
父节点
当前提交
64b47c40e2

+ 1 - 0
apps/bigmember_pc/src/assets/js/selector.js

@@ -859,3 +859,4 @@ export const buyerContactData = [
     value: 'y'
   }
 ]
+

+ 1 - 0
apps/bigmember_pc/src/components/filter-items/CheckboxGroupSelector.vue

@@ -10,6 +10,7 @@
         <span class="checkbox-item-label">{{ item.label }}</span>
         <slot name="tips" :prop="item.value"></slot>
       </div>
+      <slot name="endOther"></slot>
     </div>
   </div>
 </template>

+ 311 - 0
apps/bigmember_pc/src/components/filter-items/EntamountRangeData.vue

@@ -0,0 +1,311 @@
+<template>
+  <Layout ref="layoutRef" :type="type" :placeholder="placeholder" :trigger="trigger" :value="activeLabel"
+    @visible="onVisibleChange">
+    <div class="filter-list" slot="empty">
+      <div class="filter-item" :class="{ 'active': item.value === activeValue, 'highlight': item.disabled && isCustom }"
+        v-for="item in options" :key="item.label" :label="item.label" :value="item.value" @click="handleChange(item)">
+        <el-popover v-if="item.disabled" class="custom-popover" :append-to-body="false" placement="right-end"
+          :trigger="popoverTrigger" :offset="12" v-model="showPopover" ref="customPricePopover">
+          <div class="custom-money">
+            <div class="custom-money-item">
+              从<el-input class="price-input" :class="{ 'focus': price.min }" v-model="price.min"
+                oninput="value=value.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/,'$1')" maxlength="9"></el-input>万
+            </div>
+            <div class="custom-money-item">
+              至<el-input class="price-input" :class="{ 'focus': price.max }" v-model="price.max"
+                oninput="value=value.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/,'$1')" maxlength="9"></el-input>万
+            </div>
+            <div class="custom-money-button">
+              <el-button type="primary" @click.stop="onSubmitPrice">确定</el-button>
+            </div>
+          </div>
+          <div slot="reference" class="custom-label">
+            <span>{{ item.label }}</span>
+            <i class="el-icon-arrow-right"></i>
+          </div>
+        </el-popover>
+        <span v-else>{{ item.label }}</span>
+      </div>
+    </div>
+  </Layout>
+</template>
+
+<script>
+import { Popover, Button, Input } from 'element-ui'
+import { amountRangeData } from '@/assets/js/selector.js'
+import Layout from '@/components/filter-items/Layout.vue'
+
+export default {
+  name: 'SelectContainer',
+  components: {
+    [Popover.name]: Popover,
+    [Button.name]: Button,
+    [Input.name]: Input,
+    Layout
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'dropdown'
+    },
+    trigger: {
+      type: String,
+      default: 'hover'
+    },
+    placeholder: {
+      type: String,
+      default: '金额区间'
+    },
+    popoverTrigger: {
+      type: String,
+      default: 'hover'
+    },
+    value: {
+      type: [String, Object],
+      default: null
+    },
+    options: {
+      type: Array,
+      default: () => []
+    }
+  },
+  model: {
+    prop: 'value',
+    event: 'change'
+  },
+  data() {
+    return {
+      activeValue: this.value,
+      isCustom: false, // 当前是否是自定义选项
+      price: {
+        min: '',
+        max: ''
+      },
+      showPopover: false
+    }
+  },
+  computed: {
+    activeLabel() {
+      const price = this.activeValue
+      if (price) {
+        const priceArr = price.split('-')
+        if (priceArr.length > 1) {
+          const min = priceArr[0]
+          const max = priceArr[1]
+          if (min && max) {
+            if (min === '0') {
+              return `${max}万以下`
+            } else {
+              return `${min}-${max}万`
+            }
+          } else if (!min) {
+            return `${max}万以下`
+          } else if (!max) {
+            return `${min}万以上`
+          } else {
+            return ''
+          }
+        } else {
+          return ''
+        }
+      } else {
+        return ''
+      }
+    }
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.setState(val)
+      }
+    }
+  },
+  methods: {
+    onVisibleChange(flag) {
+      this.isFocus = flag
+      if (flag) {
+        this.setState(this.activeValue)
+        this.$nextTick(() => {
+          if (this.showPopover) {
+            setTimeout(() => {
+              // popover在下拉框展示时需要重新计算位置,通过先将popover弹框透明度将为0等位置计算完成后再恢复
+              this.$refs.customPricePopover[0].updatePopper()
+              const $popover = this.$root.$el.querySelector('.custom-popover > .el-popover')
+              $popover.style.opacity = '1'
+            }, 300)
+          }
+        })
+      }
+    },
+    compareMinMax() {
+      const { min, max } = this.price
+      const hasMinAndMax = String(min).length && String(max).length
+      if (hasMinAndMax && Number(min) > Number(max)) {
+        this.price.max = min
+        this.price.min = max
+      }
+    },
+    onSubmitPrice() {
+      this.compareMinMax()
+      const { min, max } = this.price
+      if (!min && !max) return
+      this.activeValue = `${min}-${max}`
+      this.options.forEach(item => {
+        if (item.label === '自定义') {
+          item.value = `${min}-${max}`
+        }
+      })
+      this.isCustom = true
+      this.$refs.layoutRef.$refs.dropdownRef.hide()
+      this.$refs.customPricePopover[0].doClose()
+      this.$emit('change', this.activeValue)
+    },
+    handleChange(item) {
+      if (item.label !== '自定义') {
+        this.activeValue = item.value
+        this.isCustom = false
+        this.price.min = ''
+        this.price.max = ''
+        this.$refs.layoutRef.$refs.dropdownRef.hide()
+        this.$refs.customPricePopover[0].doClose()
+        this.$emit('change', this.activeValue)
+      } else {
+        this.isCustom = true
+      }
+    },
+    getState() {
+      return {
+        label: this.activeLabel,
+        value: this.activeValue,
+        isCustom: this.isCustom
+      }
+    },
+    setState(data) {
+      this.isCustom = false
+      if (data) {
+        const valueArr = this.options.filter(v => !v.disabled).map(t => t.value)
+        if (valueArr.includes(data)) {
+          this.activeValue = data
+        } else {
+          const priceArr = data.split('-')
+          const min = priceArr[0]
+          const max = priceArr[1]
+          this.isCustom = true
+          this.price.min = min
+          this.price.max = max
+          this.activeValue = data
+          this.showPopover = true
+          this.$nextTick(() => {
+            const $popover = this.$root.$el.querySelector('.custom-popover > .el-popover')
+            $popover.style.opacity = '0'
+          })
+        }
+      } else {
+        this.activeValue = data
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-list {
+  min-width: 140px;
+  padding: 8px 0;
+  border: 1px solid $color_main;
+  background: #fff;
+  border-radius: 5px;
+  margin-top: 2px;
+
+  .filter-item {
+    padding: 4px 16px;
+    font-size: 14px;
+    line-height: 22px;
+    color: #1d1d1d;
+    text-align: left;
+    cursor: pointer;
+
+    &:hover {
+      background: #ECECEC;
+    }
+
+    &.active {
+      background: #ECECEC;
+    }
+
+    &.highlight {
+      color: $color_main;
+    }
+
+    span {
+      display: inline-block;
+      width: 100%;
+    }
+  }
+
+  .custom-label {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    .el-icon-arrow-right {
+      margin-right: -8px;
+    }
+  }
+
+  .custom-popover {
+    .custom-money {
+      padding: 12px;
+      margin-left: 4px;
+      border: 1px solid $color_main;
+      background: #fff;
+      border-radius: 4px;
+
+      &-item {
+        display: flex;
+        align-items: center;
+        margin-bottom: 12px;
+      }
+
+      &-button {
+        display: flex;
+        justify-content: flex-end;
+
+        .el-button {
+          width: 60px;
+          height: 28px;
+          padding: 0;
+        }
+      }
+    }
+
+    ::v-deep {
+      .el-popover {
+        margin-left: 16px;
+        border-color: $color_main;
+        padding: 0;
+        border: 0;
+        background: transparent;
+      }
+
+      .price-input {
+        width: 88px;
+        height: 24px;
+        margin: 0 4px;
+
+        .el-input__inner {
+          height: 100%;
+          padding: 0 8px;
+        }
+
+        &.focus {
+          .el-input__inner {
+            border-color: $color_main;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 0 - 3
apps/bigmember_pc/src/components/filter-items/EstablishTimeSelector.vue

@@ -156,7 +156,6 @@ export default {
       this.isCustom = true
       this.$refs.layoutRef.$refs.dropdownRef.hide()
       this.$refs.customPopover[0].doClose()
-      this.$emit('input', this.getState())
       this.$emit('change', this.getState())
     },
     handleChange(item) {
@@ -168,7 +167,6 @@ export default {
         this.time.end = ''
         this.$refs.layoutRef.$refs.dropdownRef.hide()
         this.$refs.customPopover[0].doClose()
-        this.$emit('input', this.getState())
         this.$emit('change', this.getState())
       } else {
         this.isCustom = true
@@ -208,7 +206,6 @@ export default {
       } else {
         this.activeValue = data
       }
-      this.$emit('input', this.getState())
     }
   }
 }

+ 231 - 0
apps/bigmember_pc/src/components/filter-items/OnecascadeContent.vue

@@ -0,0 +1,231 @@
+<template>
+  <Layout :type="type" :placeholder="placeholder" :trigger="trigger" :value="computedVal">
+    <div class="cascade-content" slot="empty">
+      <div class="cascade-content-module">
+        <header class="module-header">{{ placeholder }}</header>
+        <div class="module-main">
+          <ul>
+            <li class="module-item" :class="{ 'active': fActive === fIndex }" v-for="(first, fIndex) in firstList"
+              :key="first.name">
+              <el-checkbox v-model="first.checked" :indeterminate="first.indeterminate"
+                @change="onFirstChange($event, first, fIndex)">
+              </el-checkbox>
+              <span class="item-name">{{ first.label }}</span>
+            </li>
+          </ul>
+        </div>
+      </div>
+    </div>
+  </Layout>
+</template>
+
+<script>
+import Layout from '@/components/filter-items/Layout.vue'
+import { Checkbox } from 'element-ui'
+export default {
+  name: 'CascadeContent',
+  components: {
+    [Checkbox.name]: Checkbox,
+    Layout
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'dropdown'
+    },
+    trigger: {
+      type: String,
+      default: 'hover'
+    },
+    placeholder: {
+      type: String,
+      default: '企业类型'
+    },
+    options: {
+      type: Array,
+      default: () => []
+    },
+    value: {
+      type: [Object, Array],
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      firstList: [],
+      fActive: -1,
+      sActive: -1,
+      fTimer: null,
+      sTimer: null
+    }
+  },
+  model: {
+    prop: 'value',
+    event: 'change'
+  },
+  computed: {
+    computedVal() {
+      return this.value.length ? `${this.placeholder}${this.value.length}个` : ''
+    }
+  },
+  watch: {
+    value(val) {
+      // this.setState(val)
+    }
+  },
+  mounted() {
+    this.initData()
+  },
+  methods: {
+    getArray() {
+      const options = this.options
+      const toArray = options.map(item => {
+        return {
+          value: item.value,
+          label: item.label,
+          checked: false,
+          indeterminate: false,
+          disabled: false
+        }
+      })
+      return toArray
+    },
+    initData() {
+      const sourceList = this.getArray()
+      sourceList.unshift({
+        label: '全部',
+        value: '全部',
+        checked: false,
+        disabled: false,
+        indeterminate: false,
+        all: true
+      })
+      this.firstList = sourceList
+      this.setState(this.value)
+    },
+    onFirstChange(checked, first, fIndex) {
+      if (first.all) {
+        this.firstList.forEach(item => {
+          item.checked = checked
+        })
+      } else {
+        first.checked = checked
+      }
+      this.checkFirstAllStatus()
+      this.$emit('change', this.getState())
+    },
+    restState() {
+      this.firstList.forEach(item => {
+        item.checked = false
+        item.indeterminate = false
+      })
+    },
+    checkFirstAllStatus() {
+      const allFistList = this.firstList.filter(item => !item.all)
+      const selectedFirstList = this.firstList.filter(item => !item.all && item.checked)
+      const allHalfSelected = this.firstList.filter(item => !item.all && item.indeterminate)
+      if (allFistList.length === selectedFirstList.length) {
+        this.firstList[0].checked = true
+        this.firstList[0].indeterminate = false
+      } else {
+        this.firstList[0].checked = false
+        this.firstList[0].indeterminate = selectedFirstList.length > 0 || allHalfSelected.length > 0
+      }
+    },
+    getState() {
+      const list = JSON.parse(JSON.stringify(this.firstList))
+      let arr = []
+      list.forEach(item => {
+        if (item.checked) {
+          arr.push(item.value)
+        }
+      })
+      if (arr.includes('全部')) {
+        return []
+      } else {
+        return arr
+      }
+    },
+    setState(value) {
+      this.restState()
+      if (!value || value.length === 0) {
+        this.firstList.forEach(item => {
+          item.checked = false
+          item.indeterminate = false
+        })
+      } else {
+        this.firstList.forEach(item => {
+          if (value.includes(item.value)) {
+            item.checked = true
+            item.indeterminate = false
+          }
+        })
+      }
+      this.checkFirstAllStatus()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cascade-content {
+  display: flex;
+  align-items: center;
+  min-width: 210px;
+  height: 240px;
+  margin-top: 2px;
+  border-radius: 5px;
+  background: #fff;
+  overflow: hidden;
+  border: 1px solid $color_main;
+
+  &-module {
+    flex: 1;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+
+    &:not(:last-child) {
+      border-right: 1px solid #ececec;
+    }
+
+    .module-header {
+      padding: 12px 11px;
+      color: #999999;
+      font-size: 14px;
+      line-height: 22px;
+    }
+
+    .module-main {
+      flex: 1;
+      overflow-y: scroll;
+    }
+
+    .module-item {
+      position: relative;
+      display: flex;
+      align-items: center;
+      padding: 0 8px;
+      height: 30px;
+      font-size: 14px;
+      line-height: 22px;
+      color: #1d1d1d;
+
+      &.active,
+      &:hover {
+        background: #ececec;
+        cursor: pointer;
+      }
+
+      .item-name {
+        flex: 1;
+        margin-left: 4px;
+      }
+    }
+
+    .module-main::-webkit-scrollbar {
+      width: 4px;
+    }
+  }
+}
+</style>

+ 8 - 2
apps/bigmember_pc/src/components/filter-items/RegionSelector.vue

@@ -42,12 +42,12 @@
               <li class="module-item" @mouseover="onCityMouseOver(city, cIndex)" @mouseout="onCityMouseOut($event)" :class="{'active': cActive === cIndex}" v-for="(city, cIndex) in citiesList" :key="city.name">
                 <el-checkbox v-model="city.checked" :disabled="city.disabled" :indeterminate="city.indeterminate" @change="onCitiesChange($event, city, cIndex)"></el-checkbox>
                 <span class="item-name" @click.self="onOpenCountry(city, cIndex)">{{ city.name }}</span>
-                <i class="el-icon-arrow-right"></i>
+                <i class="el-icon-arrow-right" v-show="showCounty"></i>
               </li>
             </ul>
           </div>
         </div>
-        <div class="module-container country-container">
+        <div class="module-container country-container" v-show="showCounty">
           <header class="module-header"><span :class="{'icon-have-vip': !vip}">区县</span></header>
           <div class="module-main">
             <ul>
@@ -124,6 +124,12 @@ export default {
       type: Number,
       default: -1
     },
+    // 是否显示区县
+    showCounty: {
+      type: Boolean,
+      default: true
+
+    },
     value: {
       type: Object,
       default: () => {

+ 99 - 0
apps/bigmember_pc/src/views/search/ent/assets/options.js

@@ -0,0 +1,99 @@
+// 企业搜索筛选项-搜索范围
+export const searchScopeEntData = [
+  {
+    label: '企业名称',
+    value: 'A'
+  },
+  {
+    label: '法定代表人',
+    value: 'B'
+  },
+  // {
+  //     label: '股东',
+  //     value: 'C'
+  // },
+  // {
+  //     label: '高管',
+  //     value: 'D'
+  // },
+  {
+    label: '经营范围',
+    needVip: true,
+    value: 'F'
+  },
+  {
+    label: '中标项目/标的物',
+    needVip: true,
+    value: 'E'
+  }
+]
+// 注册资本
+export const entPriceList = [
+  {
+    value: '',
+    label: '全部'
+  },
+  {
+    label: '100万以下',
+    value: '0-100'
+  },
+  {
+    label: '100-500万',
+    value: '100-500'
+  },
+  {
+    label: '500-1000万',
+    value: '500-1000'
+  },
+  {
+    label: '1000-5000万',
+    value: '1000-5000'
+  },
+  {
+    label: '5000万以上',
+    value: '5000-'
+  },
+  {
+    value: '0',
+    label: '自定义',
+    disabled: true
+  }
+]
+// 企业类型
+export const entTypeList = [
+  {
+    label: '有限责任公司',
+    value: 'A'
+  },
+  {
+    label: '股份有限公司',
+    value: 'B'
+  },
+  {
+    label: '有限合伙',
+    value: 'C'
+  },
+  {
+    label: '普通合伙',
+    value: 'D'
+  }
+]
+// 企业状态
+export const entStateList = [
+  {
+    label: '存续(在营、开业、在业)',
+    value: 'A'
+  },
+  {
+    label: '吊销',
+    value: 'B'
+  },
+  {
+    label: '注销',
+    value: 'C'
+  },
+  {
+    label: '撤销',
+    value: 'D'
+  }
+]

+ 99 - 59
apps/bigmember_pc/src/views/search/ent/constant/search-filters.js

@@ -1,102 +1,142 @@
-import SearchScopeSelector from '@/components/filter-items/SearchScopeSelector.vue'
-import BuyerTypeSelector from '@/components/filter-items/BuyerTypeSelector.vue'
-import ContactSelector from '@/components/filter-items/ContactSelector.vue'
-import AttachmentSelector from '@/components/filter-items/AttachmentSelector.vue'
-import AmountRangeSelector from '@/components/filter-items/AmountRangeSelector.vue'
-import IndustrySelector from '@/components/filter-items/IndustrySelector.vue'
-
+import CheckboxGroupSelector from '@/components/filter-items/CheckboxGroupSelector.vue'
+import RegionSelector from '@/components/filter-items/RegionSelector.vue'
+import EntamountRangeData from '@/components/filter-items/EntamountRangeData.vue'
+import OnecascadeContent from '@/components/filter-items/OnecascadeContent.vue'
+import { searchScopeEntData, entPriceList, entTypeList, entStateList } from '../assets/options.js'
 const SearchEntBaseSchema = [
   {
-    key: 'selectType',
+    key: 'matchType',
     label: '搜索范围:',
-    defaultVal: ['content', 'title'],
-    _name: 'type',
+    defaultVal: ['A'],
+    _name: 'matchType',
     _type: 'component',
     expand: {
-      component: SearchScopeSelector,
+      component: CheckboxGroupSelector,
       props: {
         style: {
           margin: 0
-        }
+        },
+        options: searchScopeEntData
+
       },
       hooks: {}
     }
   }
 ]
-
+// 更多筛选
 const SearchEntMoreSchema = [
   {
-    key: 'industry',
-    label: '行业',
-    defaultVal: '',
-    _name: 'type',
+    key: 'area',
+    label: '注册地',
+    defaultVal: {},
+    _name: 'area',
     _type: 'component',
     expand: {
-      component: IndustrySelector,
-      hooks: {}
-    }
-  },
-  {
-    key: 'fileExists',
-    label: '附件',
-    defaultVal: '',
-    _name: 'type',
-    _type: 'component',
-    expand: {
-      component: AttachmentSelector,
-      hooks: {}
-    }
-  },
-  {
-    key: 'priceScope',
-    label: '金额区间',
-    defaultVal: '',
-    _name: 'type',
-    _type: 'component',
-    expand: {
-      component: AmountRangeSelector,
+      component: RegionSelector,
+      props: {
+        showCounty: false, // 隐藏区县
+        showCount:false, // 隐藏可选已选
+        placeholder: '注册地'
+      },
       hooks: {}
     }
   },
   {
-    key: 'buyerclass',
-    label: '采购单位类型',
+    key: 'entCapital',
+    label: '注册资本',
     defaultVal: '',
-    _name: 'type',
+    _name: 'entCapital',
     _type: 'component',
     expand: {
-      component: BuyerTypeSelector,
+      component: EntamountRangeData,
+      props: {
+        options: entPriceList,
+        placeholder: '注册资本'
+      },
       hooks: {}
     }
   },
   {
-    key: 'buyertel',
-    label: '采购单位联系方式',
-    defaultVal: '',
-    _name: 'type',
+    key: 'entType',
+    label: '企业类型',
+    defaultVal: [],
+    _name: 'entType',
     _type: 'component',
     expand: {
-      component: ContactSelector,
-      props: {
-        source: 'buyer'
+      component: OnecascadeContent,
+      props:{
+        options: entTypeList,
+        placeholder: '企业类型'
       },
       hooks: {}
     }
   },
   {
-    key: 'winnertel',
-    label: '中标企业联系方式',
-    defaultVal: '',
-    _name: 'type',
+    key: 'entStatus',
+    label: '企业状态',
+    defaultVal: [],
+    _name: 'entStatus',
     _type: 'component',
     expand: {
-      component: ContactSelector,
-      props: {
-        source: 'winner'
+      component: OnecascadeContent,
+      props:{
+        options: entStateList,
+        placeholder: '企业状态'
       },
       hooks: {}
     }
-  }
+  },
+
+  // {
+  //   key: 'fileExists',
+  //   label: '附件',
+  //   defaultVal: '',
+  //   _name: 'type',
+  //   _type: 'component',
+  //   expand: {
+  //     component: '',
+  //     hooks: {}
+  //   }
+  // },
+  // {
+  //   key: 'buyerclass',
+  //   label: '采购单位类型',
+  //   defaultVal: '',
+  //   _name: 'type',
+  //   _type: 'component',
+  //   expand: {
+  //     component: BuyerTypeSelector,
+  //     hooks: {}
+  //   }
+  // },
+  // {
+  //   key: 'buyertel',
+  //   label: '采购单位联系方式',
+  //   defaultVal: '',
+  //   _name: 'type',
+  //   _type: 'component',
+  //   expand: {
+  //     component: ContactSelector,
+  //     props: {
+  //       source: 'buyer'
+  //     },
+  //     hooks: {}
+  //   }
+  // },
+  // {
+  //   key: 'winnertel',
+  //   label: '中标企业联系方式',
+  //   defaultVal: '',
+  //   _name: 'type',
+  //   _type: 'component',
+  //   expand: {
+  //     component: ContactSelector,
+  //     props: {
+  //       source: 'winner'
+  //     },
+  //     hooks: {}
+  //   }
+  // }
 ]
 
 export { SearchEntBaseSchema, SearchEntMoreSchema }

+ 0 - 2
apps/bigmember_pc/src/views/search/ent/index.vue

@@ -17,7 +17,6 @@ import {
   SearchEntMoreSchema
 } from './constant/search-filters'
 </script>
-
 <template>
   <div class="search-ent-page">
     <div class="search-ent-header-container b-rd-8px m-t-24px">
@@ -32,7 +31,6 @@ import {
           <i class="iconfont icon-zhankai"></i>
         </div>
       </search-header-card>
-
       <div class="search-ent-filter p-l-32px p-b-16px">
         <!--  标准筛选  -->
         <search-schema-filter

+ 27 - 2
apps/bigmember_pc/src/views/search/ent/model/index.js

@@ -46,7 +46,7 @@ const listState = reactive({
   finished,
   loading,
   pageNum: 1,
-  pageSize: 5,
+  pageSize: 10,
   total
 })
 
@@ -81,9 +81,34 @@ function getParams() {
   return {
     match: inputKeywordsState.value.input,
     pageNum: listState.pageNum,
-    pageSize: listState.pageSize
+    pageSize: listState.pageSize,
+    ...getFormatAPIParams()
   }
 }
+function getFormatAPIParams() { // 入参处理为符合接口的格式
+  // 地区数据格式处理
+  let areaobj = filterState.value.area
+  let entArea = []
+  let entCity = []
+  for (const key in areaobj) {
+    if (Object.keys(areaobj[key]).length > 0) { // 二级不为空则选的是市
+      entCity.push(...Object.keys(areaobj[key]))
+    } else { // 二级为空则选的是全省
+      entArea.push(key)
+    }
+  }
+  // 地区数据格式处理结束
+  const params = {
+    matchType: filterState.value.matchType.join(','),
+    entArea: entArea.join(','),
+    entCity: entCity.join(','),
+    entCapital: filterState.value.entCapital,
+    entType: filterState.value.entType.join(','),
+    entStatus: filterState.value.entStatus.join(','),
+  }
+
+  return params
+}
 
 export {
   // 列表

+ 12 - 2
apps/bigmember_pc/src/views/search/ent/model/modules/filter.js

@@ -1,5 +1,15 @@
 import { ref } from 'vue'
 
-const filterState = ref({})
-
+const filterState = ref({
+  // 搜索范围
+  matchType: ['A'],
+  // 注册地 
+  area: {},
+  // 注册资本
+  entCapital: '',
+  //企业类型
+  entType: [],
+ //企业状态
+  entStatus: [],
+})
 export { filterState }