<template>
  <div style="margin-top: 10px;">
    <el-table :data="props.list" border style="width: 100%">
      <el-table-column prop="id" align="center" label="店铺ID" />
      <el-table-column prop="amount" align="center" label="充值金额" />
      <el-table-column prop="giftAmount" align="center" label="赠送金额" />
      <el-table-column prop="giftPoints" align="center" label="赠送积分" />
      <el-table-column prop="isGiftCoupon" align="center" label="是否使用优惠卷">
        <template v-slot="scope">
          {{ scope.row.isGiftCoupon == 0 ? '否' : '是' }}
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
const emit = defineEmits(['handleDelete', 'handleEdit'])
const props = defineProps({
  list: {
    type: Array,
    default: () => []
  }
})

function handleEdit(row) {
  emit('handleEdit', row)
}
function handleDelete(index, row) {
  emit('handleDelete', row.id)
}

</script>
