<template>
  <view class="h-full">
    <knowledge-table :data="dataList" />
  </view>
</template>
<script lang="ts" setup>
import { getKnowledgeRecord } from '@/api/modules/study';
import knowledgeTable from '@/pagesStudy/components/knowledge-table.vue';
import { Study } from '@/types';

const dataList = ref<Study.KnowledgeRecord[]>([]);
const loadData = async () => {
  uni.$ie.showLoading();
  try {
    const { rows } = await getKnowledgeRecord();
    dataList.value = rows.map(item => {
      const rate = item.rate;
      return {
        ...item,
        rate: Number(rate.toFixed(1))
      }
    });
  } finally {
    uni.$ie.hideLoading();
  }
}
loadData();
</script>
<style lang="scss" scoped></style>