FileOverview.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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">{{ data[item.prop] }}</div>
  7. </div>
  8. </div>
  9. </template>
  10. <script lang="ts" setup>
  11. import { onMounted, ref, shallowRef } from 'vue';
  12. import { FILE_OVERVIEW_CONFIG } from '../billboard.data';
  13. import { getSummary } from '../billboard.api';
  14. defineEmits(['click']);
  15. const data = shallowRef<any>({});
  16. function fetchData() {
  17. getSummary().then((r) => {
  18. data.value = r.fileServerInfo;
  19. });
  20. }
  21. onMounted(() => {
  22. fetchData();
  23. });
  24. let tabs = ref(FILE_OVERVIEW_CONFIG);
  25. </script>
  26. <style lang="less" scoped>
  27. @font-face {
  28. font-family: 'douyuFont';
  29. src: url(/@/assets/images/files/douyuFont.otf);
  30. }
  31. .card-b {
  32. height: 100%;
  33. display: flex;
  34. flex-direction: row;
  35. align-items: center;
  36. .box {
  37. display: flex;
  38. flex: 1;
  39. flex-direction: column;
  40. justify-content: flex-start;
  41. align-items: center;
  42. &:first-child .img {
  43. position: relative;
  44. width: 72px;
  45. height: 78px;
  46. background: url(/@/assets/images/files/homes/file1.png) no-repeat center;
  47. img {
  48. position: absolute;
  49. left: 50%;
  50. top: 50%;
  51. transform: translate(-50%, -75%);
  52. }
  53. }
  54. &:last-child .img {
  55. position: relative;
  56. width: 72px;
  57. height: 78px;
  58. background: url(/@/assets/images/files/homes/sp.png) no-repeat center;
  59. img {
  60. position: absolute;
  61. left: 50%;
  62. top: 50%;
  63. transform: translate(-50%, -75%);
  64. }
  65. }
  66. .text {
  67. margin: 5px 0px;
  68. font-family: '思源黑体', 'Microsoft Yahei';
  69. color: #fff;
  70. font-size: 14px;
  71. }
  72. &:first-child .num {
  73. width: 120px;
  74. height: 30px;
  75. font-family: 'douyuFont';
  76. color: #fff;
  77. font-size: 20px;
  78. display: flex;
  79. justify-content: center;
  80. align-items: center;
  81. background: url(/@/assets/images/files/homes/file2.png) no-repeat center;
  82. }
  83. &:last-child .num {
  84. width: 120px;
  85. height: 30px;
  86. font-family: 'douyuFont';
  87. color: #fff;
  88. font-size: 20px;
  89. display: flex;
  90. justify-content: center;
  91. align-items: center;
  92. background: url(/@/assets/images/files/homes/sp2.png) no-repeat center;
  93. }
  94. }
  95. }
  96. </style>
  97. onMounted, import { getSummary } from '../billboard.api';onMounted, import { getSummary } from '../billboard.api';