<script lang='ts' setup>
// import { AfferentThree, Delete, EfferentThree, Plus } from '@icon-park/vue-next';
import { defineEmits, defineProps } from 'vue';

const props = defineProps({
  permission: { type: Object, required: true },
});

const emit = defineEmits<{
  (e: 'onClickAdd'): void
  (e: 'OnClickDelete'): void
  (e: 'OnClickImport'): void
  (e: 'OnClickExport'): void
}>();

</script>

<template>
  <div v-if="props.permission.button">
    <!--新增-->
    <el-button v-if="props.permission.button.i_btn_add !== ''" @click="emit('onClickAdd')">{{
      props.permission.button.i_btn_add
    }}
      <template #icon>
        <plus fill='#333' size='24' theme='outline' />
      </template>
    </el-button>
    <!--删除-->
    <el-button v-if="props.permission.button.i_btn_delete !== ''" @click="emit('OnClickDelete')">
      {{ props.permission.button.i_btn_delete }}
      <template #icon>
        <delete fill='#333' size='24' theme='outline' />
      </template>
    </el-button>
    <!--导入-->
    <el-button v-if="props.permission.button.i_btn_import !== ''" @click="emit('OnClickImport')">
      {{ props.permission.button.i_btn_import }}
      <template #icon>
        <Upload fill='#333' size='24' theme='outline' />
      </template>
    </el-button>
    <!--导出-->
    <el-button v-if="props.permission.button.i_btn_export !== ''" @click="emit('OnClickExport')">
      {{ props.permission.button.i_btn_export }}
      <template #icon>
        <Download fill='#333' size='24' theme='outline' />
      </template>
    </el-button>
    <slot></slot>
  </div>
</template>

<style scoped></style>