2024-10-29 09:45:49 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: SunTao 328867980@qq.com
|
|
|
|
|
* @Date: 2024-10-08 09:26:24
|
|
|
|
|
* @LastEditors: SunTao 328867980@qq.com
|
2024-11-15 15:43:39 +08:00
|
|
|
* @LastEditTime: 2024-11-15 11:16:08
|
2024-10-29 09:45:49 +08:00
|
|
|
* @FilePath: \znxjxt-ui\src\views\index.vue
|
|
|
|
|
* @Description: 系统首页
|
|
|
|
|
-->
|
2024-09-05 15:44:36 +08:00
|
|
|
<template>
|
2024-09-25 09:45:16 +08:00
|
|
|
<div class="app-container">
|
2024-10-29 14:46:32 +08:00
|
|
|
<fssm-scroll :showBar="false">
|
|
|
|
|
<div class="top-content">
|
|
|
|
|
<div
|
|
|
|
|
class="top-div"
|
|
|
|
|
:class="`top-div-${index}`"
|
|
|
|
|
v-for="(item, index) in topList"
|
|
|
|
|
:key="`top-div-${index}`"
|
|
|
|
|
>
|
|
|
|
|
<div class="name">{{ item.name }}</div>
|
|
|
|
|
<div class="value">
|
|
|
|
|
<span>{{ item.value }}</span
|
|
|
|
|
>{{ item.unit }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="middle-content">
|
2024-10-30 14:51:40 +08:00
|
|
|
<div class="daily-content">
|
|
|
|
|
<daily-index></daily-index>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="disease-content">
|
|
|
|
|
<disease-index></disease-index>
|
|
|
|
|
</div>
|
2024-10-29 14:46:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="bottom-content">
|
2024-10-30 14:51:40 +08:00
|
|
|
<div class="road-content">
|
|
|
|
|
<road-index></road-index>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="traffic-content">
|
|
|
|
|
<traffic-index></traffic-index>
|
|
|
|
|
</div>
|
2024-10-29 14:46:32 +08:00
|
|
|
</div>
|
|
|
|
|
</fssm-scroll>
|
2024-09-25 09:45:16 +08:00
|
|
|
</div>
|
2024-09-05 15:44:36 +08:00
|
|
|
</template>
|
|
|
|
|
<script>
|
2024-10-29 14:46:32 +08:00
|
|
|
import FssmScroll from "@/components/scroll/fssm-scroll.vue";
|
2024-10-30 14:51:40 +08:00
|
|
|
import DailyIndex from "./index-components/daily-index.vue";
|
|
|
|
|
import DiseaseIndex from "./index-components/disease-index.vue";
|
|
|
|
|
import RoadIndex from "./index-components/road-index.vue";
|
|
|
|
|
import TrafficIndex from "./index-components/traffic-index.vue";
|
2024-11-15 15:43:39 +08:00
|
|
|
import { getTotalCount } from "@/api/xj/index/index";
|
2024-09-05 15:44:36 +08:00
|
|
|
export default {
|
|
|
|
|
name: "Index",
|
2024-10-29 14:46:32 +08:00
|
|
|
components: {
|
|
|
|
|
FssmScroll,
|
2024-10-30 14:51:40 +08:00
|
|
|
DailyIndex,
|
|
|
|
|
DiseaseIndex,
|
|
|
|
|
RoadIndex,
|
|
|
|
|
TrafficIndex,
|
2024-10-29 14:46:32 +08:00
|
|
|
},
|
2024-09-05 15:44:36 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2024-10-29 14:46:32 +08:00
|
|
|
// 顶栏循环数据
|
|
|
|
|
topList: [],
|
2024-09-05 15:44:36 +08:00
|
|
|
};
|
|
|
|
|
},
|
2024-10-29 14:46:32 +08:00
|
|
|
created() {
|
|
|
|
|
this.getTopData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 获取顶栏数据 */
|
|
|
|
|
getTopData() {
|
2024-11-15 15:43:39 +08:00
|
|
|
getTotalCount().then(({ code, data }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
this.topList = [
|
|
|
|
|
{ name: "路面病害总数", value: data.road, unit: "个" },
|
|
|
|
|
{ name: "交安事件病害总数 ", value: data.event, unit: "个" },
|
|
|
|
|
{ name: "桥隧病害总数", value: data.bridge, unit: "个" },
|
|
|
|
|
{ name: "绿化病害总数", value: data.green, unit: "个" },
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-10-29 14:46:32 +08:00
|
|
|
},
|
|
|
|
|
},
|
2024-09-05 15:44:36 +08:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2024-10-29 14:46:32 +08:00
|
|
|
.app-container {
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
height: calc(100vh - 5.4rem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.top-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 20%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-around;
|
2024-11-06 11:07:52 +08:00
|
|
|
background: url("../assets/index/top-content.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
2024-10-29 14:46:32 +08:00
|
|
|
|
|
|
|
|
.top-div {
|
|
|
|
|
width: 22%;
|
|
|
|
|
height: 80%;
|
|
|
|
|
padding: 1.5rem;
|
|
|
|
|
|
|
|
|
|
.name {
|
|
|
|
|
font-family: "DouYu";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.value {
|
|
|
|
|
line-height: 4rem;
|
|
|
|
|
|
2024-10-30 14:51:40 +08:00
|
|
|
span {
|
2024-10-29 14:46:32 +08:00
|
|
|
font-size: 1.8rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-25 09:45:16 +08:00
|
|
|
}
|
2024-11-06 11:07:52 +08:00
|
|
|
|
|
|
|
|
.top-div-0 {
|
|
|
|
|
background: url("../assets/index/top-div-0.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.top-div-1 {
|
|
|
|
|
background: url("../assets/index/top-div-1.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.top-div-2 {
|
|
|
|
|
background: url("../assets/index/top-div-2.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.top-div-3 {
|
|
|
|
|
background: url("../assets/index/top-div-3.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
2024-10-29 14:46:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.middle-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 60%;
|
2024-10-30 14:51:40 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
.daily-content,
|
|
|
|
|
.disease-content {
|
|
|
|
|
width: 49.5%;
|
|
|
|
|
height: calc(100% - 1rem);
|
|
|
|
|
margin-top: 1rem;
|
2024-11-06 11:07:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.daily-content {
|
|
|
|
|
background: url("../assets/index/daily-content.png") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.disease-content {
|
|
|
|
|
background: url("../assets/index/disease-content.png") no-repeat;
|
|
|
|
|
background-size: 107% 100%;
|
2024-10-30 14:51:40 +08:00
|
|
|
}
|
2024-10-29 14:46:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 60%;
|
2024-10-30 14:51:40 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
.road-content,
|
|
|
|
|
.traffic-content {
|
|
|
|
|
width: 49.5%;
|
|
|
|
|
height: calc(100% - 1rem);
|
|
|
|
|
margin-top: 1rem;
|
2024-11-06 11:07:52 +08:00
|
|
|
background: url("../assets/index/road-content.png") no-repeat;
|
|
|
|
|
background-size: 112% 100%;
|
2024-10-30 14:51:40 +08:00
|
|
|
}
|
2024-10-29 14:46:32 +08:00
|
|
|
}
|
2024-09-05 15:44:36 +08:00
|
|
|
</style>
|
|
|
|
|
|