<script setup lang="ts">
const props = withDefaults(
  defineProps<{
    dataList?: any
  }>(),
  {
    dataList: () => [
      {
        answerCount: 0,
        correctCount: 0,
        knowledgeName: '',
        masteryDegree: 0,
        recommendedNum: 0,
      },
    ],
  },
)

const goKnowledge = (item: anyObj) => {}
</script>
<template>
  <div class="list-box hidden_scroll">
    <div class="list-item list-title">
      <div class="content">知识点名称</div>
      <div class="count">答题次数</div>
      <div class="type">掌握程度</div>
    </div>
    <div v-for="(item, index) in dataList" :key="index" class="list-item">
      <div :class="{ content: true, active: item.masteryDegree === 3 }" @click="goKnowledge(item)">
        {{ item.knowledgeName }}
      </div>
      <div class="count">
        {{ item.answerCount }}
      </div>
      <div :class="['type', ['', 'isnone', 'isblue', 'isgreen'][item.masteryDegree]]">
        {{ ['待点亮', '陌生', '熟悉', '已掌握'][item.masteryDegree] }}
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.list-box {
  width: 1424px;
  margin: 4.67vh auto 0;
  height: 49vh;
  border-radius: 1.67vh;
  border: 0.33vh solid #8a94fd;
  overflow-y: scroll;
  .list-item {
    display: flex;
    text-align: center;
    height: 7.5vh;
    line-height: 7.5vh;
    color: $font-color;
    font-size: 2.33vh;
    font-style: normal;
    border-bottom: 0.17vh dashed #deedfc;
    .content {
      width: 780px;
      cursor: pointer;
      &.active {
        color: #8409d6;
        text-decoration-line: underline;
        text-decoration-style: wavy;
        text-underline-offset: 6px;
      }
    }
    .count {
      border-left: 0.17vh dashed #deedfc;
      border-right: 0.17vh dashed #deedfc;
    }
    .count,
    .type {
      width: 320px;
    }
    .isnone {
      color: #a13c00;
    }
    .isblue {
      color: #2d39bc;
    }
    .isgreen {
      color: #2f8a5b;
    }
  }
  .list-title {
    background-color: #c7ccff;
    color: var(--, $font-color);
    font-family: $font-special;
    font-size: 2.33vh;
  }
}
</style>
