2024-11-11 14:40:40 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: SunTao 328867980@qq.com
|
|
|
|
|
* @Date: 2024-10-18 10:25:29
|
|
|
|
|
* @LastEditors: SunTao 328867980@qq.com
|
2024-11-13 15:37:25 +08:00
|
|
|
* @LastEditTime: 2024-11-13 14:01:48
|
2024-11-11 14:40:40 +08:00
|
|
|
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\work-order.vue
|
|
|
|
|
* @Description: 总览大屏-巡查里程
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="patrol-div">
|
2024-11-13 15:37:25 +08:00
|
|
|
<div class="value">
|
|
|
|
|
<span>{{ formatNumber(patrolObject.len) }}</span
|
|
|
|
|
>km
|
|
|
|
|
</div>
|
2024-11-11 14:40:40 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="patrol-div">
|
2024-11-13 15:37:25 +08:00
|
|
|
<div class="value">
|
|
|
|
|
<span>{{ formatTime(patrolObject.time) }}</span
|
|
|
|
|
>h
|
|
|
|
|
</div>
|
2024-11-11 14:40:40 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-11-13 15:37:25 +08:00
|
|
|
import { getMileage } from "@/api/xj/screen/disease-screen";
|
2024-11-11 14:40:40 +08:00
|
|
|
export default {
|
|
|
|
|
name: "PatrolOrder",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 累计里程数据
|
2024-11-13 15:37:25 +08:00
|
|
|
patrolObject: {},
|
2024-11-11 14:40:40 +08:00
|
|
|
};
|
|
|
|
|
},
|
2024-11-13 15:37:25 +08:00
|
|
|
created() {
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 获取巡查里程数据 */
|
|
|
|
|
getData() {
|
|
|
|
|
getMileage().then(({ code, data }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
this.patrolObject = data;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 累计里程修改 */
|
|
|
|
|
formatNumber(num) {
|
|
|
|
|
if (num >= 100000000) {
|
|
|
|
|
// 超过1亿显示 x.xx亿
|
|
|
|
|
return (num / 100000000).toFixed(2) + "亿";
|
|
|
|
|
} else if (num >= 10000) {
|
|
|
|
|
// 超过1万显示 x.xx万
|
|
|
|
|
return (num / 10000).toFixed(2) + "万";
|
|
|
|
|
} else {
|
|
|
|
|
// 小于1万直接返回原数字
|
|
|
|
|
return num;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 累计时长修改 */
|
|
|
|
|
formatTime(num){
|
|
|
|
|
if (num >= 100000000) {
|
|
|
|
|
// 超过1亿显示 x.xx亿
|
|
|
|
|
return (num / 100000000).toFixed(2) + "亿";
|
|
|
|
|
} else if (num >= 10000) {
|
|
|
|
|
// 超过1万显示 x.xx万
|
|
|
|
|
return (num / 10000).toFixed(2) + "万";
|
|
|
|
|
} else {
|
|
|
|
|
// 小于1万直接返回原数字
|
|
|
|
|
return num;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-11 14:40:40 +08:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
color: #ffffff;
|
2024-11-13 15:37:25 +08:00
|
|
|
background: url("~@/assets/screen/disease/patrol-order.png") no-repeat;
|
|
|
|
|
background-size: 90%;
|
|
|
|
|
background-position: 50%;
|
2024-11-11 14:40:40 +08:00
|
|
|
|
2024-11-13 15:37:25 +08:00
|
|
|
.patrol-div {
|
|
|
|
|
width: 50%;
|
2024-11-11 14:40:40 +08:00
|
|
|
height: 100%;
|
2024-11-13 15:37:25 +08:00
|
|
|
padding-left: 5rem;
|
|
|
|
|
padding-bottom: 1rem;
|
2024-11-11 14:40:40 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
2024-11-13 15:37:25 +08:00
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 0.8rem;
|
2024-11-11 14:40:40 +08:00
|
|
|
|
2024-11-13 15:37:25 +08:00
|
|
|
.value {
|
|
|
|
|
span {
|
2024-11-11 14:40:40 +08:00
|
|
|
font-family: "DouYu";
|
2024-11-13 15:37:25 +08:00
|
|
|
font-size: 1.4rem;
|
2024-11-11 14:40:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|