94 lines
1.9 KiB
Vue
Raw Normal View History

2025-03-31 18:24:37 +08:00
<template>
2025-04-25 18:23:20 +08:00
<div class="monitoring-top-col">
<div class="item" v-for="item in funcList">
<div class="item-left">
<div class="item-left-head">
<div class="title">{{ item.title }}</div>
<div class="en">{{ item.en }}</div>
2025-03-31 18:24:37 +08:00
</div>
2025-04-25 18:23:20 +08:00
<div class="item-left-bottom">
<div class="num" :style="{ color: item.color }">{{ item.num || item.num == 0 ? item.num : "--" }}</div>
<div class="unit" :style="{ color: item.color }">{{ item.unit }}</div>
2025-03-31 18:24:37 +08:00
</div>
</div>
2025-04-25 18:23:20 +08:00
<div class="item-img">
<img :src="item.icon" />
</div>
</div>
</div>
2025-03-31 18:24:37 +08:00
</template>
2025-04-10 13:33:38 +08:00
<script setup lang="ts">
interface TFuncList {
title: string;
en: string;
icon: string;
unit: string;
num: number;
color: string;
}
defineProps({
funcList: {
type: Array<TFuncList>,
default: () => [],
},
});
2025-03-31 18:24:37 +08:00
</script>
<style scoped lang="less">
2025-04-25 18:23:20 +08:00
.monitoring-top-col {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin-bottom: 20px;
}
.item {
height: 160px;
padding: 25px 33px 16px 36px;
box-sizing: border-box;
background: #ffffff;
2025-03-31 18:24:37 +08:00
display: flex;
2025-04-25 18:23:20 +08:00
align-items: center;
2025-03-31 18:24:37 +08:00
justify-content: space-between;
2025-04-25 18:23:20 +08:00
position: relative;
flex-shrink: 0;
.item-left {
2025-03-31 18:24:37 +08:00
display: flex;
2025-04-25 18:23:20 +08:00
flex-direction: column;
2025-03-31 18:24:37 +08:00
justify-content: space-between;
2025-04-25 18:23:20 +08:00
.item-left-head {
.title {
font-size: 18px;
color: #061550;
2025-03-31 18:24:37 +08:00
}
2025-04-25 18:23:20 +08:00
.en {
color: #787878;
font-size: 8px;
2025-03-31 18:24:37 +08:00
}
}
2025-04-25 18:23:20 +08:00
.item-left-bottom {
display: flex;
align-items: baseline;
.num {
color: #ff0303;
font-size: 60px;
2025-03-31 18:24:37 +08:00
}
2025-04-25 18:23:20 +08:00
.unit {
color: #ff0303;
font-size: 20px;
}
}
}
.item-img {
position: absolute;
right: 20px;
top: 20px;
width: 60px;
height: 60px;
flex-shrink: 0;
img {
width: 100%;
height: 100%;
2025-03-31 18:24:37 +08:00
}
}
}
</style>