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-25 17:29:08 +08:00
|
|
|
* @LastEditTime: 2024-10-25 16:11:56
|
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-25 17:29:08 +08:00
|
|
|
>{{ item.label }}
|
2024-10-18 17:31:35 +08:00
|
|
|
</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"
|
2024-10-25 17:29:08 +08:00
|
|
|
:style="{ width: `${item.rate * 100}%` }"
|
2024-10-22 09:55:33 +08:00
|
|
|
:class="`bottom-${index}`"
|
2024-10-25 17:29:08 +08:00
|
|
|
></div>
|
2024-10-18 17:31:35 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-10-25 17:29:08 +08:00
|
|
|
import { roadStatisticList } from "@/api/xj/screen/road-screen";
|
2024-10-18 17:31:35 +08:00
|
|
|
export default {
|
|
|
|
|
name: "RoadStatistic",
|
2024-10-25 17:29:08 +08:00
|
|
|
props: {
|
|
|
|
|
select: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-10-18 17:31:35 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2024-10-25 17:29:08 +08:00
|
|
|
roadList: [],
|
2024-10-18 17:31:35 +08:00
|
|
|
};
|
|
|
|
|
},
|
2024-10-25 17:29:08 +08:00
|
|
|
watch: {
|
|
|
|
|
select: {
|
|
|
|
|
handler() {
|
|
|
|
|
this.getRoadList();
|
|
|
|
|
},
|
|
|
|
|
immediate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 获取路产统计信息 */
|
|
|
|
|
getRoadList() {
|
|
|
|
|
roadStatisticList({ type: this.select }).then(({ code, data }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
let sum = 0;
|
|
|
|
|
data.forEach((element) => {
|
|
|
|
|
sum += element.value;
|
|
|
|
|
});
|
|
|
|
|
this.roadList = data.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
rate: item.value / sum,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-10-18 17:31:35 +08:00
|
|
|
};
|
|
|
|
|
</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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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>
|
|
|
|
|
|