<template>
  <!-- 过滤客户资料表格 -->
  <div class="filterTable">
    <FilterOption :selectList="selectList" :inputList="inputList" :buttonList="buttonList" />
    <slot></slot>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { QhjCustomer } from '@/services/go/ermcp/qhj/interface';
import { useFilter } from '@/common/components/filter/setup';
import FilterOption from '@/common/components/filter/index.vue';

export default defineComponent({
  name: 'filter-custom-table',
  components: {
    FilterOption
  },
  setup(props, context) {
    const { selectList, inputList, buttonList, search } = useFilter<QhjCustomer>(context);

    selectList.value = [
      {
        key: 'userinfotype',
        selectedValue: 0,
        options: [
          { label: '全部客户类型', value: 0 },
          { label: '个人', value: 1 },
          { label: '企业', value: 2 }
        ],
        onChange: search
      },
    ]

    inputList.value = [
      { keys: ['nickname'], value: '', placeholder: '模糊搜索客户简称' },
      { keys: ['customername'], value: '', placeholder: '模糊搜索客户名称' },
      { keys: ['mobile'], value: '', placeholder: '模糊搜索手机号码' },
    ]

    return {
      selectList,
      inputList,
      buttonList,
    }
  },
})
</script>