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

@@ -5,7 +5,7 @@
<div class="title">有害气体</div>
<div v-if="badGasList==null||badGasList.length===0" class="showNull">
<div class="loading" v-if="loading===0"></div>
{{loading===0?'加载中...':'暂无数据~'}}
{{ loading === 0 ? '加载中...' : '暂无数据~' }}
</div>
<div v-else class="info-list">
<gas-info-item
@@ -26,7 +26,7 @@
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="loading-block" v-if="showLoading">
<div class="loading" ></div>
<div class="loading"></div>
<span>加载中...</span>
</div>
<div class="chat-dialog" v-else>
@@ -100,13 +100,12 @@ watch(
{deep: true}
);
const timeSelect = (index) => {
console.log("选择时间", index);
if (index === 0) {
console.log("--年");
getBadGasChartInfo('years')
} else if (index === 1) {
console.log("--月");
getBadGasChartInfo('month')
} else if (index === 2) {
console.log("--日");
getBadGasChartInfo('day')
}
};
const getBadGasInfo = (now) => {
@@ -138,13 +137,13 @@ const changeData = (item) => {
unit: item.unit,
};
};
const getBadGasChartInfo = () => {
const getBadGasChartInfo = (type) => {
isBadGasVisited.value = true
showLoading.value=true
showLoading.value = true
let id = props.tunnelId
getBadGasEchartsInfo(id).then(res => {
getBadGasEchartsInfo(id, type).then(res => {
if (res?.code === 1000) {
showLoading.value=false
showLoading.value = false
nextTick(() => {
initChart(res.data.dates, res.data)
})
@@ -152,7 +151,7 @@ const getBadGasChartInfo = () => {
})
}
const handleOpenChart = () => {
getBadGasChartInfo()
getBadGasChartInfo('day')
};
const getImageUrl = (name) => {
return new URL(`../../../assets/images/badGasInfo/${name}`, import.meta.url)
@@ -366,7 +365,7 @@ const initChart = (type, values) => {
<style lang="scss" scoped>
#bad-gas-info {
margin-top:40px;
margin-top: 40px;
cursor: pointer;
//position: absolute;
width: 824px;
@@ -376,6 +375,7 @@ const initChart = (type, values) => {
//right: 72px;
background-image: url(../../../assets/images/badGasInfo/bg.png);
padding: 22px 17px 25px 50px;
.title {
font-size: 38px;
font-weight: 800;