feat : 新增echarts中指定日期展示及细节优化
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
<div style="width: 1px;"></div>
|
||||
</div>
|
||||
<div class="time-select">
|
||||
<choose-time v-if="selectTimeButton===2" :time="dayValue" @select="daySelect"/>
|
||||
<choose-month v-if="selectTimeButton===1" :time="monthValue" @select="monthSelect"/>
|
||||
<time-range-btn
|
||||
:buttonList="timeList"
|
||||
v-model="selectTimeButton"
|
||||
@@ -51,7 +53,11 @@ import ItemInfo from "./childComps/ItemInfo.vue";
|
||||
import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"
|
||||
import * as echarts from 'echarts';
|
||||
import {getEchartsInfo} from "@/api/largeScreen";
|
||||
import ChooseTime from "@/components/ChooseTime/index.vue"
|
||||
import ChooseMonth from "@/components/ChooseMonth/index.vue"
|
||||
|
||||
const dayValue = ref('');
|
||||
const monthValue = ref('');
|
||||
let myEcharts = reactive({});
|
||||
const props = defineProps({
|
||||
list: Array,
|
||||
@@ -90,11 +96,18 @@ watch(() => props.airData, (now) => {
|
||||
windSpeed.value = 0
|
||||
}
|
||||
}, {deep: true});
|
||||
|
||||
const getChartInfo = (equipmentId, type = 'day') => {
|
||||
const daySelect = (val) => {
|
||||
dayValue.value = val
|
||||
getChartInfo(openDialogId.value, 'day',val)
|
||||
}
|
||||
const monthSelect = (val) => {
|
||||
monthValue.value = val
|
||||
getChartInfo(openDialogId.value, 'month',val)
|
||||
}
|
||||
const getChartInfo = (equipmentId, type = 'day',time='') => {
|
||||
isWindSpeedVisited.value = true
|
||||
showSpeedLoading.value = true
|
||||
getEchartsInfo(equipmentId, type).then(res => {
|
||||
getEchartsInfo(equipmentId,time, type).then(res => {
|
||||
if (res?.code === 1000) {
|
||||
showSpeedLoading.value = false
|
||||
nextTick(() => {
|
||||
@@ -124,15 +137,20 @@ const handleOpenChart = (id, type) => {
|
||||
getChartInfo(id, 'day')
|
||||
}
|
||||
}
|
||||
|
||||
const timeSelect = (index) => {
|
||||
if (index === 0) {
|
||||
getChartInfo(openDialogId.value, 'years')
|
||||
} else if (index === 1) {
|
||||
getChartInfo(openDialogId.value, 'month')
|
||||
} else if (index === 2) {
|
||||
getChartInfo(openDialogId.value, 'day')
|
||||
const changeDate = (index) => {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return 'years'
|
||||
case 1:
|
||||
return 'month'
|
||||
case 2:
|
||||
return 'day'
|
||||
}
|
||||
}
|
||||
const timeSelect = (index) => {
|
||||
dayValue.value = ''
|
||||
monthValue.value = ''
|
||||
getChartInfo(openDialogId.value, changeDate(index))
|
||||
};
|
||||
|
||||
const changeData = (item) => {
|
||||
@@ -148,8 +166,6 @@ const changeData = (item) => {
|
||||
}
|
||||
const changeIcon = (type) => {
|
||||
switch (type) {
|
||||
case "dust":
|
||||
return 'dust-icon.png';
|
||||
case "oxygen":
|
||||
return 'o2-icon.png';
|
||||
case "temperature":
|
||||
@@ -163,7 +179,7 @@ const getAirInfo = (now) => {
|
||||
let airObj = {}
|
||||
let airArr = []
|
||||
now?.map(item => {
|
||||
if (item.equipmentType === "dust" || item.equipmentType === "oxygen" || item.equipmentType === "temperature" || item.equipmentType === "humidness") {
|
||||
if (item.equipmentType === "oxygen" || item.equipmentType === "temperature" || item.equipmentType === "humidness") {
|
||||
airObj = changeData(item)
|
||||
airArr.push(airObj)
|
||||
} else if (item.equipmentType === "windSpeed") {
|
||||
|
||||
Reference in New Issue
Block a user