feat : 新增echarts(折线图)下方滚动条型缩放组件

This commit is contained in:
2024-02-27 16:59:15 +08:00
parent bc3e7ddaea
commit 2a8cb0d389
5 changed files with 78 additions and 47 deletions

View File

@@ -3,7 +3,7 @@
<div class="name">风压</div>
<div v-if="wpList==null||wpList.length===0" class="showNull">
<div class="loading" v-if="loading===0"></div>
{{loading===0?'加载中...':'暂无数据~'}}
{{ loading === 0 ? '加载中...' : '暂无数据~' }}
</div>
<div v-else class="list">
<wind-pressure-item v-for="(item,index) in wpList" :key="item.equipmentId" :wp="item"
@@ -15,7 +15,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>
@@ -69,12 +69,12 @@ watch(() => props.winData, (now) => {
getScreenInfo(now.windPressureSensorList)
}, {deep: true});
const getWindInfo = (equipmentId,type='day') => {
const getWindInfo = (equipmentId, type = 'day') => {
isVisited.value = true
showLoading.value=true
getEchartsInfo(equipmentId,type).then(res => {
showLoading.value = true
getEchartsInfo(equipmentId, type).then(res => {
if (res?.code === 1000) {
showLoading.value=false
showLoading.value = false
nextTick(() => {
initChart(res.data.dates, res.data.values)
})
@@ -83,18 +83,18 @@ const getWindInfo = (equipmentId,type='day') => {
}
const handleOpenChart = (item) => {
selectTimeButton.value=2
selectTimeButton.value = 2
getWindInfo(item.equipmentId)
windSort.value = item.equipmentName
windSortId.value = item.equipmentId
}
const timeSelect = (index) => {
if (index === 0) {
getWindInfo(windSortId.value,'years')
getWindInfo(windSortId.value, 'years')
} else if (index === 1) {
getWindInfo(windSortId.value,'month')
getWindInfo(windSortId.value, 'month')
} else if (index === 2) {
getWindInfo(windSortId.value,'day')
getWindInfo(windSortId.value, 'day')
}
};
const getScreenInfo = (now) => {
@@ -136,7 +136,7 @@ const initChart = (type, values) => {
left: 0, // 左边距
right: 20, // 右边距
top: 80, // 顶边距
bottom: 0, // 底边距
bottom: 170, // 底边距
containLabel: true,
},
//提示框组件
@@ -169,7 +169,17 @@ const initChart = (type, values) => {
},
dataZoom: [{
type: 'inside'
}],
},
{
type: 'slider',
top: 1050,
height: 100,
textStyle: {
fontSize: 45,
color: '#fffff'
}
}
],
//X轴
xAxis: {
type: 'category',