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

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

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

    selectList.value = [
      {
        key: 'contracttype',
        selectedValue: 0,
        options: [
          { label: '全部计划类型', value: 0 },
          { label: '采购', value: 1 },
          { label: '销售', value: -1 }
        ],
        onChange: search
      },
    ]

    inputList.value = [
      { keys: ['hedgeplanno'], value: '', placeholder: '模糊搜索计划' },
      { keys: ['wrstandardname'], value: '', placeholder: '模糊搜索商品' }
    ]

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