<template>
  <div class="knowledgeTrack">
    <h3 class="title">历次考试知识点追踪</h3>
    <!-- 内容区域 -->
    <div class="map_content" v-if="examRange.length > 0 || knowledgeStats.length > 0">
      <!-- 考试范围说明 -->
      <div class="knowledge_stats">
        <!-- <p class="range_text" v-if="examRange">
          <span class="dot"></span>历次考试：<span v-html="examRange" style="color:#333333;font-weight:600;"></span>
        </p> -->
        <p class="range_text">
          <span class="dot"></span>
          本次选择考试 <span v-for="(item, index) in examRange" :key="index" >
            {{ item.examName }}<i :style="{background: item.knowledgeNum >0 ? '#2E64FA' : '#FB9F34'}">{{ item.knowledgeNum }}</i>
            <span v-if="index < examRange.length - 1">、</span>
          </span>
        </p>
          <p class="stats_text" v-for="(item, index) in knowledgeStats" :key="index">
            <span class="dot"></span> <span v-html="item"></span>
          </p>
      </div>
    </div>

    <!-- 暂无数据 -->
    <div class="noData" v-else>
      <div class="module_chart no_content_data no_data" element-loading-background="#ffffff">
        <span>暂无数据</span>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  name: "KnowledgeTrack",
  props: {
    // 考试范围
    examRange: {
      type: Array,
      default: function () {
        return [];
      }
    },
    // 包含知识点数据
    knowledgeStats: {
      type: Array,
      default: () => []
    },
    // 模式：class/grade/student
    mode: {
      type: String,
      default: 'grade'
    }
  },
  data() {
    return {
      
    };
  },
  computed: {
    
  },
  mounted() {

  },
  methods: {
    
  }
};
</script>

<style scoped lang="scss">
.knowledgeTrack {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;

  .title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 20px 0;
  }
  .map_content {
    background: #F7F7F8;
    border-radius: 5px 5px 5px 5px;
    border: 1px solid #EBEEF5;
    padding: 12px;
    p{
      margin-bottom: 5px;
    }
    .range_text,.stats_text {
      font-size: 14px;
      line-height: 1.8;
      color: #666;
      padding-left: 17px;
      position: relative;
      text-align: justify;

      .dot {
        position: absolute;
        left: 0;
        top: 8px;
        display: inline-block;
        width: 6px;
        height: 6px;
        background: #666666;
        border-radius: 50%;
      }
    }
    .range_text{
      span{
        color:#333333;
        font-weight:600;
        i{
          font-size: 10px;
          color: #ffffff;
          border-radius: 4px 4px 4px 4px;
          padding: 2px 4px;
          margin-left: 5px;
        }
      }
    }
  }

  //暂无数据
  .noData {
    position: relative;
    height: 220px;

    /* 暂无数据样式 */
    .no_data {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 14px;
      color: #909399;
      text-align: center;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      span{
        margin-top: 11%;
      }
    }
  }
}  

</style>