唐润平:显示面板雏形全部完成并优化了第一个风机面板样式

This commit is contained in:
trp
2023-12-09 03:09:53 +08:00
parent e20b7c1002
commit 305a5f9824
5 changed files with 401 additions and 86 deletions

View File

@@ -1,10 +1,65 @@
<template>
<div id="bad-gas-info">
<div class="title">有害气体</div>
<div class="info-list">
<gas-info-item :gasInfo="gasInfo" />
<gas-info-item :gasInfo="gasInfo2" />
<gas-info-item :gasInfo="gasInfo3" />
<gas-info-item :gasInfo="gasInfo4" />
<gas-info-item :gasInfo="gasInfo5" />
<gas-info-item :gasInfo="gasInfo6" />
</div>
</div>
</template>
<script setup></script>
<script setup>
import { reactive } from "vue";
import gasInfoItem from "./childComps/gasInfoItem.vue";
const gasInfo = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 50, //阈值
});
const gasInfo2 = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 10, //阈值
});
const gasInfo3 = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 70, //阈值
});
const gasInfo4 = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 40, //阈值
});
const gasInfo5 = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 20, //阈值
});
const gasInfo6 = reactive({
name: "氧气", //气体名称
max: 100, //最大值
value: 10, //传感器值
point: 20, //阈值
});
setInterval(() => {
gasInfo.value = parseInt(Math.random() * 10) * 10;
gasInfo2.value = parseInt(Math.random() * 10) * 10;
gasInfo3.value = parseInt(Math.random() * 10) * 10;
gasInfo4.value = parseInt(Math.random() * 10) * 10;
gasInfo6.value = parseInt(Math.random() * 10) * 10;
gasInfo5.value = parseInt(Math.random() * 10) * 10;
}, 2000);
</script>
<style lang="scss" scoped>
#bad-gas-info {
@@ -25,5 +80,13 @@
line-height: 45px;
margin: 22px 0px 0px 62px;
}
.info-list {
width: 100%;
height: calc(621px - 45px - 22px);
display: flex;
flex-wrap: wrap;
justify-content: space-around;
padding: 10px 0px 0px 10px;
}
}
</style>