<template>
  <view>
    <view class="h-16 bg-back my-32"></view>
    <index-test :directed-school="directedSchool" />
    <view v-if="list.length > 0" class="px-30 pb-30 bg-back">
      <view class="h-94 flex items-center justify-center">
        <view class="h-0 w-160 border-0 border-b border-dashed border-border"></view>
        <ie-image src="/pagesStudy/static/image/icon-ear-left.png" customClass="w-20 h-26 ml-26 mr-30" />
        <view class="text-30 text-fore-title font-bold">考试记录</view>
        <ie-image src="/pagesStudy/static/image/icon-ear-right.png" customClass="w-20 h-26 ml-26 mr-30" />
        <view class="h-0 w-160 border-0 border-b border-dashed border-border"></view>
      </view>
      <view v-for="value in list" :key="value.id" class="rounded-10 mb-20 bg-white px-20 py-38">
        <ie-exam-record-item :data="value" />
      </view>
    </view>
  </view>
</template>
<script lang="ts" setup>
import IndexTest from './index-test.vue';
import IeExamRecordItem from '@/pagesStudy/components/ie-exam-record-item.vue';
import { getSimulatedRecord } from '@/api/modules/study';
import { Study } from '@/types';

const props = defineProps<{
  directedSchool: Study.DirectedSchool;
}>();

const list = ref<Study.SimulatedRecord[]>([]);
const loadData = async () => {
  const { data } = await getSimulatedRecord();
  list.value = data || [];
}
onShow(() => {
  loadData();
});
</script>
<style lang="scss" scoped></style>