环保
This commit is contained in:
@@ -23,18 +23,32 @@
|
||||
<span class="blueTitle"></span>
|
||||
<span>检测指标趋势图</span>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area @submit="getTrend"/>
|
||||
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { environmentalCheckRealtime } from '@/api/safetyEnvironmental/environmental'
|
||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
||||
import LineChart from './../../components/lineChart'
|
||||
import SearchArea from './../../components/searchArea'
|
||||
export default {
|
||||
name: 'WasteGasManagement',
|
||||
data(){
|
||||
return {
|
||||
realtimeList:[]
|
||||
realtimeList:[],
|
||||
queryParams:{
|
||||
checkType: 2,
|
||||
timeDim: null,
|
||||
timeRange: []
|
||||
},
|
||||
chartData: {}
|
||||
}
|
||||
},
|
||||
components: { LineChart, SearchArea },
|
||||
mounted() {
|
||||
this.getMsg()
|
||||
},
|
||||
@@ -44,6 +58,20 @@ export default {
|
||||
console.log(res)
|
||||
this.realtimeList = res.data || []
|
||||
})
|
||||
},
|
||||
getTrend(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.chartData = res.data
|
||||
} else {
|
||||
this.chartData = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user