|
|
|
@ -107,7 +107,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import dayjs from "dayjs"; |
|
|
|
import {selectCollectRecordByItemList} from "../../../api/cdc/collect"; |
|
|
|
import {getBaseTime, selectCollectRecordByItemList} from "../../../api/cdc/collect"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'collectScreen', |
|
|
|
@ -248,6 +248,22 @@ export default { |
|
|
|
let myChart = this.$echarts.init(document.getElementById('main')); |
|
|
|
|
|
|
|
this.option && myChart.setOption(this.option); |
|
|
|
}, |
|
|
|
|
|
|
|
getBaseTime(){ |
|
|
|
let params = {} |
|
|
|
getBaseTime(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.getDataList(); |
|
|
|
this.times = setInterval(() => { |
|
|
|
this.getDataList(); |
|
|
|
}, 1000 * data.time); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
@ -270,14 +286,11 @@ export default { |
|
|
|
} |
|
|
|
this.option.xAxis = val.map(item=>item.deviceDesc) |
|
|
|
this.initCharts() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getDataList(); |
|
|
|
this.times = setInterval(() => { |
|
|
|
this.getDataList(); |
|
|
|
}, 1000 * 30); |
|
|
|
this.getBaseTime(); |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.initCharts(); |
|
|
|
|