<!-- 搜索表单 -->
<template>
  <a-space :size="10" style="flex-wrap: wrap">
    <a-button type="primary" class="ele-btn-icon" @click="add">
      <template #icon>
        <PlusOutlined />
      </template>
      <span>添加</span>
    </a-button>
    <a-button
      danger
      type="primary"
      class="ele-btn-icon"
      :disabled="!selection?.length"
      @click="remove"
    >
      <template #icon>
        <DeleteOutlined />
      </template>
      <span>批量删除</span>
    </a-button>
  </a-space>
</template>

<script lang="ts" setup>
  import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
  import type { ShopExpressTemplateDetail } from '@/api/shop/shopExpressTemplateDetail/model';

  const props = withDefaults(
    defineProps<{
      // 选中的表格数据
      selection?: ShopExpressTemplateDetail[];
    }>(),
    {}
  );

  const emit = defineEmits<{
    (e: 'add'): void;
    (e: 'remove'): void;
  }>();

  // 新增
  const add = () => {
    emit('add');
  };

  // 批量删除
  const remove = () => {
    emit('remove');
  };
</script>
