<template>
  <div class="ContComp">
    <div class="title">任务数据</div>
    <div id="chart01" />
  </div>
</template>

<script setup name="ContComp">
import { onMounted } from 'vue'
import myChart from '@/utils/echarts'
import { pilotTaskDate } from '@/api/dashboard/index'

onMounted(() => {
  pilotTaskDate().then(({ data }) => {
    const xAxis = data.map(it => it.checkTime)
    const YAxis = data.map(it => it.pilotTaskSum)
    myChart.line1('chart01', xAxis, YAxis)
  })
})

</script>
<style scoped lang='scss'>
.ContComp {
  margin-top: 20px;

  .title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 1);
  }

  #chart01 {
    width: 100%;
    height: 300px;
  }
}
</style>
