feat : 电流、有毒气体和传感器echarts按日月年监控数据

This commit is contained in:
2024-02-22 17:10:06 +08:00
parent 98799e8bcc
commit 3a23b467ec
7 changed files with 132 additions and 209 deletions

View File

@@ -98,13 +98,13 @@
<div id="containerFan"></div>
<div style="width: 1px;"></div>
</div>
<!-- <div class="time-select">-->
<!-- <time-range-btn-->
<!-- :buttonList="timeList"-->
<!-- v-model="selectTimeButton"-->
<!-- @select="timeSelect"-->
<!-- />-->
<!-- </div>-->
<div class="time-select">
<time-range-btn
:buttonList="timeList"
v-model="selectTimeButton"
@select="timeSelect"
/>
</div>
<div class="left-bottom-icon"></div>
<div class="right-bottom-icon"></div>
</el-dialog>
@@ -115,6 +115,7 @@
<script setup>
import * as echarts from "echarts";
import FanInfoItem from "./FanInfoItem.vue";
import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"
import {
editFrequency,
editFrequencyModelSwitch,
@@ -122,6 +123,8 @@ import {
getFanEchartsInfo
} from "@/api/largeScreen";
const timeList = ref(["年", "月", "日"]);
const selectTimeButton = ref(2);
const props = defineProps({
list: Array,
tunnelId: Number,
@@ -132,7 +135,6 @@ const props = defineProps({
const socketData = ref()
let Echarts_info1 = null;
let fan01_option = reactive();
const shuntThreshold = ref(23)
const transducerData = ref([])
const shuntList = ref([
{
@@ -154,6 +156,7 @@ const stateC = ref(false)
const isVisited = ref(false)
const showLoading = ref(false)
const fanIndex = ref(0)
const openEquipmentId = ref(0)
let myEcharts = reactive({});
watch(() => props.loading, (now) => {
props.loading = now
@@ -194,6 +197,15 @@ watch(() => props.list, (now) => {
})
handleOnMounted()
}, {deep: true});
const timeSelect = (index) => {
if (index === 0) {
getFanInfo(openEquipmentId.value,'years')
} else if (index === 1) {
getFanInfo(openEquipmentId.value,'month')
} else if (index === 2) {
getFanInfo(openEquipmentId.value,'day')
}
};
const packageData = (item, type, flag) => {
let number = 0
if (item.equipmentType === "frequency1") {
@@ -234,10 +246,10 @@ const changeModel = (item) => {
// console.log('修改自动模式', res)
// })
}
const getFanInfo = (equipmentId) => {
const getFanInfo = (equipmentId, type = 'day') => {
isVisited.value = true
showLoading.value = true
getFanEchartsInfo(equipmentId).then(res => {
getFanEchartsInfo(equipmentId, type).then(res => {
if (res?.code === 1000) {
showLoading.value = false
nextTick(() => {
@@ -247,8 +259,8 @@ const getFanInfo = (equipmentId) => {
})
}
const handleOpenChart = (item, index) => {
getFanInfo(item.equipmentId)
openEquipmentId.value = item.equipmentId
getFanInfo(item.equipmentId, 'day')
fanIndex.value = index + 1
}
const getTransData = (data) => {
@@ -858,6 +870,7 @@ input[type="number"] {
white-space: pre;
margin-right: 14px;
}
//:deep(.is-disabled) {
// .el-input__inner{
// color: #FFFFFF!important;