<template>
  <div class="card-b">
    <div class="box" v-for="item in tabs" :key="item.id" @click="$emit('click', item)">
      <div class="img"> <img :src="item.src" alt="" /> </div>
      <div class="text">{{ item.text }}</div>
      <div class="num">{{ item.num }}</div>
    </div>
  </div>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import leftImg from '/@/assets/images/files/homes/file.svg';
  import rightImg from '/@/assets/images/files/homes/sp.svg';

  defineEmits(['click']);

  let tabs = ref([
    { src: leftImg, text: '文档总数', num: 233, id: 'file_cfg_001' },
    { src: rightImg, text: '待审批数', num: 50, id: 'file_cfg_002' },
  ]);
</script>

<style lang="less" scoped>
  @font-face {
    font-family: 'douyuFont';
    src: url(/@/assets/images/files/douyuFont.otf);
  }

  .card-b {
    display: flex;
    flex-direction: row;

    .box {
      display: flex;
      flex: 1;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;

      &:first-child .img {
        position: relative;
        width: 72px;
        height: 78px;
        background: url(/@/assets/images/files/homes/file1.png) no-repeat center;

        img {
          position: absolute;
          left: 50%;
          top: 50%;
          transform: translate(-50%, -75%);
        }
      }

      &:last-child .img {
        position: relative;
        width: 72px;
        height: 78px;
        background: url(/@/assets/images/files/homes/sp.png) no-repeat center;

        img {
          position: absolute;
          left: 50%;
          top: 50%;
          transform: translate(-50%, -75%);
        }
      }

      .text {
        margin: 5px 0px;
        font-family: '思源黑体', 'Microsoft Yahei';
        color: #fff;
        font-size: 14px;
      }

      &:first-child .num {
        width: 120px;
        height: 30px;
        font-family: 'douyuFont';
        color: #fff;
        font-size: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: url(/@/assets/images/files/homes/file2.png) no-repeat center;
      }

      &:last-child .num {
        width: 120px;
        height: 30px;
        font-family: 'douyuFont';
        color: #fff;
        font-size: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: url(/@/assets/images/files/homes/sp2.png) no-repeat center;
      }
    }
  }
</style>
