Compare commits

...

2 Commits

1 changed files with 13 additions and 3 deletions

View File

@ -113,7 +113,6 @@ export default {
}) })
}, },
handleClick(val){ handleClick(val){
console.log('handleClick',val)
let that = this; let that = this;
that.mpointList.forEach(item=>{ that.mpointList.forEach(item=>{
if(item.nickname == that.activeName){ if(item.nickname == that.activeName){
@ -128,11 +127,22 @@ export default {
params.timex__lte = that.endTime; params.timex__lte = that.endTime;
params.page = 0; params.page = 0;
that.$API.enm.mplogx.req(params).then((res) => { that.$API.enm.mplogx.req(params).then((res) => {
let xAxisData = [],seriesData = [];
res.forEach(item=>{ res.forEach(item=>{
that.option.xAxis.data.unshift(item.timex); xAxisData.unshift(item.timex);
let value = Number(item.val_float).toFixed(3); let value = Number(item.val_float).toFixed(3);
that.option.series.data.unshift(value); seriesData.unshift(value);
}) })
function getMinValue(arr) {
return Math.min.apply(null, arr);
}
if(that.activeName.indexOf("温度") != -1){
let minNum = getMinValue(seriesData);
console.log(minNum);
that.option.yAxis.min = minNum;
}
that.option.xAxis.data = xAxisData;
that.option.series.data = seriesData;
}) })
} }
}) })