123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <div class="card-b">
- <div class="box" v-for="item in FILE_OVERVIEW_CONFIG" :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">{{ fileData[item.prop] }}</div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { onMounted, shallowRef } from 'vue';
- import { BillboardType, DEFAULT_TEST_DATA, FILE_OVERVIEW_CONFIG } from '../billboard.data';
- const props = withDefaults(
- defineProps<{
- data?: BillboardType;
- }>(),
- {
- data: () => DEFAULT_TEST_DATA,
- }
- );
- defineEmits(['click']);
- const fileData = shallowRef<BillboardType['fileServerInfo']>({
- totalNum: 0,
- approvalNum: 0,
- });
- function fetchData() {
- fileData.value = props.data.fileServerInfo;
- }
- onMounted(() => {
- fetchData();
- });
- </script>
- <style lang="less" scoped>
- @font-face {
- font-family: 'douyuFont';
- src: url(/@/assets/images/files/douyuFont.otf);
- }
- .card-b {
- height: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- .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>
- onMounted, import { getSummary } from '../billboard.api';onMounted, import { getSummary } from '../billboard.api';
|