FileOverview.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="card-b">
  3. <div class="box" v-for="item in tabs" :key="item.id" @click="$emit('click', item)">
  4. <div class="img"> <img :src="item.src" alt="" /> </div>
  5. <div class="text">{{ item.text }}</div>
  6. <div class="num">{{ item.num }}</div>
  7. </div>
  8. </div>
  9. </template>
  10. <script lang="ts" setup>
  11. import { ref } from 'vue';
  12. import leftImg from '/@/assets/images/files/homes/file.svg';
  13. import rightImg from '/@/assets/images/files/homes/sp.svg';
  14. defineEmits(['click']);
  15. let tabs = ref([
  16. { src: leftImg, text: '文档总数', num: 233, id: 'file_cfg_001' },
  17. { src: rightImg, text: '待审批数', num: 50, id: 'file_cfg_002' },
  18. ]);
  19. </script>
  20. <style lang="less" scoped>
  21. @font-face {
  22. font-family: 'douyuFont';
  23. src: url(/@/assets/images/files/douyuFont.otf);
  24. }
  25. .card-b {
  26. display: flex;
  27. flex-direction: row;
  28. .box {
  29. display: flex;
  30. flex: 1;
  31. flex-direction: column;
  32. justify-content: flex-start;
  33. align-items: center;
  34. &:first-child .img {
  35. position: relative;
  36. width: 72px;
  37. height: 78px;
  38. background: url(/@/assets/images/files/homes/file1.png) no-repeat center;
  39. img {
  40. position: absolute;
  41. left: 50%;
  42. top: 50%;
  43. transform: translate(-50%, -75%);
  44. }
  45. }
  46. &:last-child .img {
  47. position: relative;
  48. width: 72px;
  49. height: 78px;
  50. background: url(/@/assets/images/files/homes/sp.png) no-repeat center;
  51. img {
  52. position: absolute;
  53. left: 50%;
  54. top: 50%;
  55. transform: translate(-50%, -75%);
  56. }
  57. }
  58. .text {
  59. margin: 5px 0px;
  60. font-family: '思源黑体', 'Microsoft Yahei';
  61. color: #fff;
  62. font-size: 14px;
  63. }
  64. &:first-child .num {
  65. width: 120px;
  66. height: 30px;
  67. font-family: 'douyuFont';
  68. color: #fff;
  69. font-size: 20px;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. background: url(/@/assets/images/files/homes/file2.png) no-repeat center;
  74. }
  75. &:last-child .num {
  76. width: 120px;
  77. height: 30px;
  78. font-family: 'douyuFont';
  79. color: #fff;
  80. font-size: 20px;
  81. display: flex;
  82. justify-content: center;
  83. align-items: center;
  84. background: url(/@/assets/images/files/homes/sp2.png) no-repeat center;
  85. }
  86. }
  87. }
  88. </style>