<!--
  @description: 报表统计-专家统计
  @Modifier：肖文龙
  @routerPath:
  @date：  2021/02/23
-->
<template>
  <div>
    <div class="reportChart-content">
      <!-- 统计分析-专家统计-搜索条件 -->
      <expertStatisticsSearch />
      <el-row :gutter="crudObj.gutter" class="el-row-x-1">
        <!-- 专家数量统计 -->
        <el-col :span="8">
          <expertTotalCurd reportchart="reportChart" :height="heightData.expertTotalCurd_h" />
        </el-col>
        <!-- 专家等级占比 -->
        <el-col :span="8">
          <expertClassChart reportchart="reportChart" :height="heightData.expertClassChart_h" />
        </el-col>
        <!-- 专家专业分类 -->
        <el-col :span="8">
          <expertSpecialtyClassify reportchart="reportChart" :height="heightData.expertSpecialtyClassify_h" />
        </el-col>
      </el-row>
      <el-row :gutter="crudObj.gutter" class="el-row-x-1">
        <!-- 专家评标次数TOP -->
        <el-col :span="8">
          <expertEvaluationNumber reportchart="reportChart" :height="heightData.expertEvaluationNumber_h" />
        </el-col>
        <!-- 专家出席率 -->
        <el-col :span="8">
          <expertBePresentRate reportchart="reportChart" :height="heightData.expertBePresentRate_h" />
        </el-col>
        <!-- 专家地区分布TOP-->
        <el-col :span="8">
          <expertRegionTOP reportchart="reportChart" :height="heightData.expertRegionTOP_h" />
        </el-col>
      </el-row>
      <el-row :gutter="crudObj.gutter" class="el-row-x-1">
        <!-- 最新入库专家 -->
        <el-col :span="12">
          <newExpert reportchart="reportChart" :height="heightData.newExpert_h" />
        </el-col>
        <!-- 专家好评TOP10 -->
        <el-col :span="12">
          <expertEnterTImeTOP reportchart="reportChart" :height="heightData.expertEnterTImeTOP_h" />
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
/* 组件 */
import expertStatisticsSearch from './expertStatisticsSearch.vue' // 统计分析-专家统计-搜索条件
import expertTotalCurd from './../expertTotal/expertTotalCurd.vue' // 专家数量统计
import expertEvaluationNumber from './../expertEvaluationNumber/expertEvaluationNumberTOP.vue' // 专家评标次数TOP
import expertBePresentRate from './../expertBePresentRate/expertBePresentRate.vue' // 专家出席率
import expertClassChart from './../expertClass/expertClassChart.vue' // 专家等级占比
import newExpert from './../newExpert/newExpert.vue' // 最新入库专家
import expertSpecialtyClassify from './../expertSpecialtyClassify/expertSpecialtyClassify.vue' // 专家专业分类
import expertEnterTImeTOP from './../expertEnterTIme/expertEnterTImeTOP.vue' // 专家好评TOP10
import expertRegionTOP from './../expertRegion/expertRegionTOP.vue' // 专家地区分布TOP

export default {
  inject: ['crudObj'],
  components: {
    expertStatisticsSearch, // 统计分析-专家统计-搜索条件
    expertTotalCurd, // 专家数量统计
    expertEvaluationNumber, // 专家评标次数TOP
    expertBePresentRate, // 专家出席率
    expertClassChart, // 专家等级占比
    newExpert, // 最新入库专家
    expertSpecialtyClassify, // 专家专业分类
    expertEnterTImeTOP, // 专家好评TOP10
    expertRegionTOP// 专家地区分布TOP
  },
  data() {
    return {
      // echarts 高度换算
      heightData: {
        search_h: '2.6875rem', // 搜索条件的高度
        h_p: '1.875rem', // 间距
        expertTotalCurd_h: '', // 专家数量统计
        expertEvaluationNumber_h: '', // 专家评标次数TOP
        expertBePresentRate_h: '', // 专家出席率
        expertClassChart_h: '', // 专家等级占比
        newExpert_h: '', // 最新入库专家
        expertSpecialtyClassify_h: '', // 专家专业分类
        expertEnterTImeTOP_h: '', // 专家好评TOP10
        expertRegionTOP_h: '' // 专家地区分布TOP
      },
      // 统计汇总
      crudList: []
    }
  },
  created() {
    this.initHeightData()// 高度计算
  },
  methods: {
    // 高度计算
    initHeightData() {
      // 计算content一减去头部的高度
      let bidAndProcMapCharts_h = ''
      if (this.crudObj.height_default) {
        bidAndProcMapCharts_h = this.crudObj.height_default
      } else {
        bidAndProcMapCharts_h = 'calc( ' +
        this.crudObj.height_default + ' - ' +
        this.crudObj.header_H + ' - ' +
        this.heightData.search_h + ' - ' +
        this.heightData.h_p + ')'
      }
      //  专家数量统计
      this.heightData.expertTotalCurd_h = `calc((${bidAndProcMapCharts_h} - .625rem) / 2)`
      // 专家评标次数TOP
      this.heightData.expertEvaluationNumber_h = this.heightData.expertTotalCurd_h
      // 专家出席率
      this.heightData.expertBePresentRate_h = this.heightData.expertTotalCurd_h
      // 专家等级占比
      this.heightData.expertClassChart_h = this.heightData.expertTotalCurd_h
      // 最新入库专家
      this.heightData.newExpert_h = this.heightData.expertTotalCurd_h
      // 专家专业分类
      this.heightData.expertSpecialtyClassify_h = this.heightData.expertTotalCurd_h
      // 专家好评TOP10
      this.heightData.expertEnterTImeTOP_h = this.heightData.expertTotalCurd_h
      // 专家地区分布TOP
      this.heightData.expertRegionTOP_h = this.heightData.expertTotalCurd_h
    }
  }
}
</script>
<style lang="less" scoped>
</style>
