Your Name
2022-08-26 b1bdac435d4aa9fe34bde1a859490842166b47f7
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue
@@ -5,6 +5,8 @@
<script>
import {getInspectComplete} from "../../../../../../api/inspectStatistics";
export default {
    name: 'index',
    data(){
@@ -14,18 +16,32 @@
        }
    },
    mounted() {
        this.drawTodayLine()
    },
    methods:{
        async updateData(val){
            let res = await getInspectComplete(val)
            if(res.data.code === '200'){
                this.numData = res.data.data.map(item =>{
                    return item.num
                })
                this.timeData = res.data.data.map(item =>{
                    return item.taskDate
                })
            }else{
                this.$message({
                    type:'warning',
                    message:res.data.message
                })
            }
            this.drawTodayLine()
        },
        async drawTodayLine(){
            this.timeData = [1,2,3,4,]
            this.numData = [2,5,7,9]
            let myChart = this.$echarts.init(document.getElementById('inspectionComplete'))
            myChart.setOption({
                xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2022-4-1', '2022-4-2', '2022-4-4', '2022-4-4', '2022-4-5', '2022-4-6', '2022-4-7']
                data:this.timeData
                },
                yAxis: {
                    type: 'value'
@@ -33,7 +49,7 @@
                color:'#5470c6',
                series: [
                    {
                    data: [820, 932, 901, 934, 1290, 1330, 1320],
                    data: this.numData,
                    type: 'line',
                    smooth: true
                    }