|
|
@ -237,6 +237,7 @@ import { |
|
|
|
getParams, |
|
|
|
getPortions, |
|
|
|
getDeviceInfos, |
|
|
|
getDeviceInfosPolling, |
|
|
|
weatherHoursList |
|
|
|
} from '@/api/device/index'; |
|
|
|
import { partitionVo, classVo, parameterVo, seriesVo, mainInfoVo } from '@/api/device/types'; |
|
|
@ -346,7 +347,8 @@ const options = { |
|
|
|
tooltip: { |
|
|
|
trigger: 'axis', |
|
|
|
axisPointer: { |
|
|
|
type: 'cross' |
|
|
|
type: 'cross', |
|
|
|
animation: false |
|
|
|
} |
|
|
|
}, |
|
|
|
legend: { |
|
|
@ -383,15 +385,17 @@ const options = { |
|
|
|
dataZoom: [ |
|
|
|
{ |
|
|
|
type: 'inside', |
|
|
|
startValue: '0' |
|
|
|
startValue: 0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
startValue: '0' |
|
|
|
startValue: 0 |
|
|
|
} |
|
|
|
], |
|
|
|
xAxis: { |
|
|
|
type: 'time', |
|
|
|
boundaryGap: false |
|
|
|
splitLine: { |
|
|
|
show: false |
|
|
|
} |
|
|
|
}, |
|
|
|
yAxis: [{}], |
|
|
|
series: [{}] |
|
|
@ -880,7 +884,7 @@ function getweatherHoursList() { |
|
|
|
|
|
|
|
const debounceClick = debounce(() => { |
|
|
|
getDevicePolling(); |
|
|
|
}, 360000); |
|
|
|
}, 10000); |
|
|
|
|
|
|
|
function getDevicePolling() { |
|
|
|
//轮询获取折线图数据 |
|
|
@ -891,13 +895,13 @@ function getDevicePolling() { |
|
|
|
params.stepType = '3'; |
|
|
|
params.queryType = 2; |
|
|
|
console.log(params); |
|
|
|
getDeviceInfos(params).then((res: any) => { |
|
|
|
getDeviceInfosPolling(params).then((res: any) => { |
|
|
|
if (res.code === 200) { |
|
|
|
if (isCurrentRoute.value) { |
|
|
|
timer.value = setTimeout(async () => { |
|
|
|
await (timer.value && clearTimeout(timer.value)); |
|
|
|
await getDevicePolling(); |
|
|
|
}, 360000); |
|
|
|
}, 5000); |
|
|
|
} |
|
|
|
if (res.data.additionalInfo != null) { |
|
|
|
currentEndTime.value = res.data.additionalInfo.endTime; |
|
|
@ -907,6 +911,7 @@ function getDevicePolling() { |
|
|
|
res.data.mainInfos.forEach((newObj: any) => { |
|
|
|
if (originalObj.name === newObj.name) { |
|
|
|
newObj.data.map((item: any) => { |
|
|
|
originalObj.data.shift(); |
|
|
|
originalObj.data.push(item); |
|
|
|
}); |
|
|
|
} |
|
|
@ -951,6 +956,10 @@ function init(data: any) { |
|
|
|
console.log('offsetData--', offsetData); |
|
|
|
options.yAxis.push({ |
|
|
|
type: 'value', |
|
|
|
boundaryGap: [0, '100%'], |
|
|
|
splitLine: { |
|
|
|
show: false |
|
|
|
}, |
|
|
|
name: `${item.name}(${item.unit})`, |
|
|
|
position: `${index === 0 ? 'left' : 'right'}`, |
|
|
|
alignTicks: true, |
|
|
@ -982,7 +991,7 @@ function init(data: any) { |
|
|
|
name: item.name, |
|
|
|
type: 'line', |
|
|
|
smooth: true, |
|
|
|
symbol: 'none', |
|
|
|
showSymbol: false, |
|
|
|
yAxisIndex: item.index, |
|
|
|
data: item.data, |
|
|
|
tooltip: { |
|
|
|