<template>
  <el-table :data="modelValue" style="width: 100%">
    <el-table-column prop="date" label="文件信息">
      <template #default="scope">
        <div class="flex items-center">
          <el-image :src="scope.row.url" alt="" fit="cover" srcset="" class="h-91px w-181px rd-4px" />
          <div class="ml-17px">
            <div class="text-14px font-normal">{{ scope.row.title }}</div>
          </div>
        </div>
      </template>
    </el-table-column>
    <el-table-column prop="type" label="文件类型" width="180">
      <template #default="scope">{{ scope.row.type === 1 ? '图纸' : scope.row.type === 2 ? '文本' : '模型' }}</template>
    </el-table-column>
    <el-table-column prop="createTime" label="下载时间" width="180">
      <template #default="scope">{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
  import type { ProjectHistoryResVO } from '~/api/personal-center/types'
  import dayjs from 'dayjs'

  const modelValue = defineModel<ProjectHistoryResVO[]>('modelValue', {
    required: true,
  })
</script>

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