<template>
  <el-container class="order-page panel-block">
    <el-main v-loading="loading">
      <el-table height="100%" class="sa-table" :data="table.data" stripe>
        <template #empty>
          <sa-empty />
        </template>
        <el-table-column prop="remark" label="事件" min-width="250" />
        <el-table-column label="操作人" min-width="120">
          <template #default="scope">
            <sa-user-profile type="oper" :user="scope.row.oper" :id="scope.row.oper_id" />
          </template>
        </el-table-column>
        <el-table-column prop="create_time" label="时间" min-width="120" align="center" />
      </el-table>
    </el-main>
  </el-container>
</template>
<script setup>
  import { onMounted, reactive, ref } from 'vue';
  import { api } from '../order.service';

  const props = defineProps(['modal']);

  const loading = ref(true);

  // 表格
  const table = reactive({
    data: [],
  });

  // 获取数据
  async function getData() {
    loading.value = true;
    const { data } = await api.order.action(props.modal.params.id);
    table.data = data;
    loading.value = false;
  }

  onMounted(() => {
    getData();
  });
</script>
