<template>
  <div style="margin-top: 10px">
    <el-table :data="props.list" border style="width: 100%">
      <el-table-column prop="shopName" align="center" label="商户名称" />
      <el-table-column prop="staffName" align="center" label="职员名称" />
      <el-table-column prop="orderCount" align="center" label="订单数量" />
      <el-table-column prop="orderTurnover" align="center" label="应交金额" />
      <el-table-column prop="balance" align="center" label="余额支付" />
      <el-table-column prop="refundAmount" align="center" label="退款金额" />
      <el-table-column prop="turnover" align="center" label="总收入" />
      <el-table-column prop="loginTime" align="center" label="开始时间" />
      <el-table-column prop="handoverTime" align="center" label="交班时间" />
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">
            查看
          </el-button>
          <el-button size="small" type="primary" link icon="Edit" @click="handleExport(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);
}
// 导出
function handleExport(row) {
  emit("handleExport", row);
}
</script>
