Files
data_visual/src/views/Overview/ProjectTotal.vue
2022-11-14 17:40:29 +08:00

122 lines
2.8 KiB
Vue

<template>
<div class="container">
<div class="project-total flex items-center justify-start">
<img class="icon" src="@/assets/polygon40@3x.png" alt="" />
<div class="title text-white">项目总数</div>
<div class="counting-board flex justify-between">
<div class="num" v-for="item in countChars" :key="item">{{ item }}</div>
</div>
</div>
<div class="acceptance flex items-center justify-start">
<img class="icon" src="@/assets/polygon40@3x.png" alt="" />
<div class="title text-white">在建/验收</div>
<!-- <div class="counting-board flex justify-between"></div> -->
<div class="num">
<span>{{ data.BUILDING }}</span
><span class="seg mx-1">/</span><span>{{ data.ACCEPT }}</span>
</div>
</div>
</div>
</template>
<script setup>
import { ref, toRefs, watch } from "vue";
const props = defineProps({
data: {
type: Object,
required: true,
},
});
const { data } = toRefs(props);
const countChars = ref([]);
watch(
data,
() => {
if (data.value.PROJECTCOUNT) {
countChars.value = `${parseInt(data.value.PROJECTCOUNT)}`.split("");
} else {
countChars.value = ["0"];
}
for (let i = countChars.value.length; i < 4; i++) {
countChars.value.unshift("0");
}
},
{ immediate: true, deep: true }
);
</script>
<style lang="scss" scoped>
.container {
width: 465px;
// height: 90px;
background-image: linear-gradient(
180deg,
rgba(4, 53, 99, 0.6) 0%,
rgba(4, 53, 99, 0.19) 100%
);
.icon {
margin-left: 16px;
width: 18px;
height: 18px;
}
.title {
margin-left: 10px;
font-family: PingFangSC-Regular;
font-size: 20px;
color: #ffffff;
letter-spacing: 0;
line-height: 30px;
text-shadow: 0 0 9px #158eff;
font-weight: 400;
}
.counting-board {
margin-left: 30px;
.num {
display: flex;
justify-content: center;
align-items: center;
width: 48px;
height: 56px;
opacity: 0.72;
background-image: linear-gradient(
180deg,
rgba(26, 101, 171, 0.88) 0%,
rgba(26, 101, 171, 0.48) 47%,
#1a65ab 100%
);
font-family: Impact;
font-size: 38px;
color: #f2f6fa;
letter-spacing: 0;
line-height: 30px;
font-weight: 900;
&:not(:last-child) {
margin-right: 24px;
}
}
}
.project-total {
height: 90px;
}
.acceptance {
height: 45px;
color: #fff;
.num {
display: flex;
align-items: center;
margin-left: 30px;
span {
font-family: PingFangSC-Regular;
font-size: 28px;
color: #b1e1ff;
letter-spacing: 0;
line-height: 24px;
text-shadow: 0 0 9px #158eff;
font-weight: 400;
}
// span.seg {
// }
}
}
}
</style>