<template>
  <div>
    <a-button
      v-for="(handBtn, index) in headArrBtn"
      :key="index"
      :type="handBtn.type"
      :disabled="handBtn.hasSelected"
      @click="headBtnClick(handBtn.name)"
      >{{ handBtn.name }}</a-button
    >
  </div>
  <!-- <a-form layout="inline">
    <a-row :gutter="24" type="flex" justify="space-between">
      <a-col :md="24" :sm="24" :class="$style.searchWrap">
        <a-form-item v-if="isSearch" label="">
          <a-input-search v-model="searchVal" placeholder="请输入查询内容" />
        </a-form-item>
        <a-form-item v-if="isSuperSearchBtn">
          <a-button @click="superBtnClick">
            <a-icon type="filter" />
          </a-button>
        </a-form-item>
        <a-form-item v-for="(handBtn, index) in headArrBtn" :key="index">
          <a-button
            :type="handBtn.type"
            :disabled="handBtn.hasSelected"
            @click="headBtnClick(handBtn.name)"
            >{{ handBtn.name }}</a-button
          >
        </a-form-item>
      </a-col>
    </a-row>
  </a-form> -->
</template>

<script>
import components from './_import-components/sd-head-button-import'

export default {
  name: 'SdHeadButton',
  components,
  props: {
    // 搜索框默认值
    searchVal: {
      type: String,
      default: '',
    },
    // 所有按钮数组
    headArrBtn: {
      type: Array,
      default() {
        return []
      },
    },
    // 是否显示搜索框
    isSearch: {
      type: Boolean,
      default: false,
    },
    // 是否展示高级搜索按钮
    isSuperSearchBtn: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {}
  },
  methods: {
    // 头部按钮
    headBtnClick(e) {
      this.$emit('headBtnClick', e)
    },
    // 高级搜索按钮
    superBtnClick() {
      this.$emit('superBtnClick')
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.search-wrap {
  text-align: right;
}
</style>
