<template>
  <div>
    <!-- <pieStudy ref="studyPie" :pieStudyData="pieStudyData"></pieStudy>
    <tableUnstudy></tableUnstudy>
    <tableStudy></tableStudy>
    <pieDownload ref="downloadPie"></pieDownload>
    <tableUndownload></tableUndownload>
    <tableDownload></tableDownload>
    <bar-score></bar-score>
    <score-table></score-table> -->
    <div class="container normal-panel normal-margin">
      <el-row :gutter="16" class="flex-align-stretch">
        <el-col :span="10">
          <pieStudy ref="studyPie" :pieStudyData="pieStudyData"></pieStudy>
        </el-col>
        <el-col :span="14">
          <tableUnstudy></tableUnstudy>
          <tableStudy></tableStudy>
        </el-col>
      </el-row>
    </div>
    <div class="container normal-panel normal-margin">
      <el-row :gutter="16" class="flex-align-stretch">
        <el-col :span="10">
          <pieDownload ref="downloadPie"></pieDownload>
        </el-col>
        <el-col :span="14">
          <tableUndownload></tableUndownload>
          <tableDownload></tableDownload>
        </el-col>
      </el-row>
    </div>
    <div class="container normal-panel">
      <el-row :gutter="16" class="flex-align-stretch">
        <el-col class="height-full" :span="10">
          <bar-score></bar-score>
        </el-col>
        <el-col :span="14">
          <score-table></score-table>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import pieStudy from './modules/pieStudy.vue'
import tableUnstudy from './modules/tableUnstudy.vue'
import tableStudy from './modules/tableStudy.vue'

import pieDownload from './modules/pieDownload.vue'
import tableUndownload from './modules/tableUndownload.vue'
import tableDownload from './modules/tableDownload.vue'
import barScore from './modules/barScore.vue'
import scoreTable from './modules/scoreTable.vue'


export default {
  components:{
    pieStudy,
    tableUnstudy,
    tableStudy,
    pieDownload,
    tableUndownload,
    tableDownload,
    barScore,
    scoreTable
  },
  data () {
    return {
      pieStudyData:[],
      pieDownloadData:[]
    }
  },
  methods:{
    async getAgentData () {
      const res = await this.$api.requested({
        "classname": "webmanage.saletool.notice.statistics.team",
        "method": "getTeamStudyData",
        "content": {
          "sat_noticeid": this.$route.query.id
        }
      })
      this.pieStudyData = [{type:'已学习',num:res.data.studyNum},{type:'未学习',num:res.data.unStudyNum}]
      this.pieDownloadData = [{type:'已下载',num:res.data.downloadNum},{type:'未下载',num:res.data.unDownloadNum}]
      this.$refs.studyPie.piePlot.changeData(this.pieStudyData)
      this.$refs.downloadPie.piePlot.changeData(this.pieDownloadData)
    }
  },
  created () {
    this.getAgentData()
  }
}

</script>
<style>
</style>