195 lines
4.2 KiB
Vue
Raw Normal View History

2024-10-18 17:31:35 +08:00
<!--
* @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 15:22:31
* @LastEditors: SunTao 328867980@qq.com
2024-10-22 09:55:33 +08:00
* @LastEditTime: 2024-10-22 09:13:22
2024-10-18 17:31:35 +08:00
* @FilePath: \znxjxt-ui\src\views\big-screen\road-components\road-statistic.vue
* @Description: 道路资产大屏-路产统计
-->
<template>
<div class="content">
<div
class="road-div"
v-for="(item, index) in roadList"
:key="`road-${index}`"
>
<div class="road-top">
<div class="road-top-name">
2024-10-22 09:55:33 +08:00
<a>{{ index + 1 < 10 ? "0" + (index + 1) : index + 1 }}</a
2024-10-18 17:31:35 +08:00
>{{ item.name }}
</div>
2024-10-22 09:55:33 +08:00
<div class="road-top-value">
<span>{{ item.value }}</span
><a></a>
</div>
2024-10-18 17:31:35 +08:00
</div>
<div class="road-bottom">
<div
2024-10-22 09:55:33 +08:00
class="road-bottom-div"
:style="{ width: `${item.value * 10}%` }"
:class="`bottom-${index}`"
>
<div
v-for="(it, ind) in item.value"
:key="`info-${ind}`"
class="road-info"
></div>
</div>
2024-10-18 17:31:35 +08:00
</div>
</div>
</div>
</template>
<script>
export default {
name: "RoadStatistic",
data() {
return {
roadList: [
2024-10-22 09:55:33 +08:00
{ name: "G10152", value: 7 },
{ name: "G10152", value: 6 },
{ name: "G10152", value: 5 },
{ name: "G10152", value: 5 },
{ name: "G10152", value: 1 },
{ name: "G10152", value: 5 },
{ name: "G10152", value: 3 },
{ name: "G10152", value: 8 },
{ name: "G10152", value: 3 },
{ name: "G10152", value: 6 },
2024-10-18 17:31:35 +08:00
],
};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.content {
width: 100%;
height: 100%;
color: #ffffff;
.road-div {
2024-10-22 09:55:33 +08:00
height: 2.5rem;
2024-10-18 17:31:35 +08:00
width: 100%;
padding: 0 1.5rem;
display: flex;
flex-direction: column;
justify-content: center;
> div {
display: flex;
align-items: center;
justify-content: space-between;
}
.index {
width: 4.5rem;
}
.name {
width: 5rem;
}
.value {
width: 6.5rem;
}
.road-top {
.road-top-name {
line-height: 1.5rem;
2024-10-22 09:55:33 +08:00
color: #c7daf2;
a {
display: inline-block;
width: 1.5rem;
color: #808c9f;
}
}
.road-top-value {
span {
font-family: "DouYu";
color: #c7daf2;
background: linear-gradient(
to bottom,
#ffffff,
#2773d0
); /*设置渐变的方向从左到右 颜色从ff0000到ffff00*/
background-clip: text; /*将设置的背景颜色限制在文字中*/
-webkit-text-fill-color: transparent; /*给文字设置成透明*/
}
a {
margin-left: 0.5rem;
font-size: 0.8rem;
color: #808c9f;
}
2024-10-18 17:31:35 +08:00
}
}
.road-bottom {
2024-10-22 09:55:33 +08:00
width: 100%;
2024-10-18 17:31:35 +08:00
height: 0.5rem;
2024-10-22 09:55:33 +08:00
background-color: rgba(50, 72, 127, 0.3);
position: relative;
.img {
position: absolute;
width: 100%;
height: 100%;
}
.road-bottom-div {
width: 100%;
height: 100%;
display: flex;
.road-info {
height: 100%;
width: 40px;
border-left: 2px black solid;
margin: 0 0.1rem;
}
}
.bottom-0 {
background: linear-gradient(90deg, #0e183e 0%, #4087e8 100%);
}
.bottom-1 {
background: linear-gradient(90deg, #0e183e 0%, #08b4a6 100%);
}
.bottom-2 {
background: linear-gradient(90deg, #0e183e 0%, #be8b13 100%);
}
.bottom-3 {
background: linear-gradient(90deg, #0e183e 0%, #4087e8 100%);
}
.bottom-4 {
background: linear-gradient(90deg, #0e183e 0%, #08b4a6 100%);
}
.bottom-5 {
background: linear-gradient(90deg, #0e183e 0%, #be8b13 100%);
}
.bottom-6 {
background: linear-gradient(90deg, #0e183e 0%, #4087e8 100%);
}
.bottom-7 {
background: linear-gradient(90deg, #0e183e 0%, #08b4a6 100%);
}
.bottom-8 {
background: linear-gradient(90deg, #0e183e 0%, #be8b13 100%);
}
.bottom-9 {
background: linear-gradient(90deg, #0e183e 0%, #4087e8 100%);
}
2024-10-18 17:31:35 +08:00
}
}
}
</style>