<template>
  <!-- 过滤 -->
  <div class="filterTable">
    <FilterOption :selectList="selectList"
                  :inputList="inputList"
                  :fixedBtnList="fixedBtnList">
      <template #selectAfter>
        <a-checkbox v-model:checked="includesub"
                    class="filter-check">包含子级</a-checkbox>
      </template>
    </FilterOption>
    <slot></slot>
  </div>
</template>

<script lang="ts">
import FilterOption from '@/common/components/filter/index.vue';
import { defineComponent, ref } from 'vue';
import { handleFilter, InputList } from '@/common/setup/filter';
import { initData } from '@/common/methods';
import { handleSelectOption } from '../../../../setup';

export default defineComponent({
    name: 'filter-platinum_pick_query',
    components: { FilterOption },
    setup(props, context) {
        const { select, getSelectList } = handleSelectOption();
        const input: InputList[] = [{ value: '', placeholder: '模糊搜索账号', key: 'filtername' }];
        // 是否包含子级 1-包含
        const includesub = ref<boolean>(false);

        const param = {
            search(result: any) {
                result.includesub = includesub.value ? 1 : 0;
            },
            reset() {
                includesub.value = false;
            },
        };
        const { selectList, inputList, fixedBtnList } = handleFilter(select, input, context, param);
        initData(() => {
            getSelectList();
        });
        return {
            includesub,
            selectList,
            inputList,
            fixedBtnList,
        };
    },
});
</script>

<style lang="less">
.filterTable {
    .commonPicker.ant-calendar-picker {
        display: inline-flex;
        padding-top: 9px;
        padding-bottom: 6px;
        margin-right: 10px;
        .ant-input {
            border: 0;
            background: @m-grey9;
        }
    }
}
</style>;
