<script setup lang="ts">
import { getAllLog } from "@/api/archive/archive-api";

const props = defineProps<{ patNo: string; times: number }>();

const data = ref([]);

onMounted(async () => {
  data.value = await getAllLog(props.patNo, props.times);
});
</script>

<template>
  <VxeTable
    :data="data"
    height="100%"
    :scroll-y="{ enabled: true, gt: 0 }"
    border
    :column-config="{ resizable: true }"
    show-overflow
  >
    <vxe-column field="[0]" title="日期" width="150"></vxe-column>
    <vxe-column field="[1]" title="级别" width="80">
      <template #default="{ row }">
        <span :class="`archive__log-span-${row[1]}`">{{ row[1] }}</span>
      </template>
    </vxe-column>
    <vxe-column field="[2]" title="操作人" width="120"></vxe-column>
    <vxe-column field="[3]" title="任务名" width="80"></vxe-column>
    <vxe-column field="[4]" title="日志信息" fixed="right"></vxe-column>
  </VxeTable>
</template>

<style lang="scss"></style>
