<!--
  @description: 报表统计-异常统计
  @Modifier：杨胜国
  @routerPath:
  @date：  2021/02/23
-->
<template>
  <div>
    <div class="reportChart-content">
      <!-- 统计分析-报表统计-搜索条件 -->
      <abnormalStatisticsSearch />
      <el-row :gutter="crudObj.gutter" class="el-row-x-1">
        <!-- 招标异常 -->
        <el-col :span="24">
          <abnormalBid reportchart="reportChart" :height="heightData.abnormalBid_h" />
        </el-col>
      </el-row>
      <el-row :gutter="crudObj.gutter" class="el-row-x-1">
        <!-- 采购异常 -->
        <el-col :span="24">
          <abnormalProcurement reportchart="reportChart" :height="heightData.abnormalProcurement_h" />
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
/* 组件 */
import abnormalStatisticsSearch from './abnormalStatisticsSearch.vue' // 统计分析-专家统计-搜索条件
import abnormalBid from './../abnormalBid/abnormalBid.vue' // 招标异常
import abnormalProcurement from './../abnormalProcurement/abnormalProcurement.vue' // 招标异常

export default {
  inject: ['crudObj'],
  components: {
    abnormalStatisticsSearch, // 统计分析-专家统计-搜索条件
    abnormalBid, // 招标异常
    abnormalProcurement // 采购异常
  },
  data() {
    return {
      // echarts 高度换算
      heightData: {
        search_h: '2.6875rem', // 搜索条件的高度
        h_p: '1.875rem', // 间距
        abnormalBid_h: '', // 招标异常
        abnormalProcurement_h: '' // 采购异常
      },
      // 统计汇总
      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.abnormalBid_h = `calc((${bidAndProcMapCharts_h} - 6.225rem) / 2)`
      // 采购异常
      this.heightData.abnormalProcurement_h = this.heightData.abnormalBid_h
    }
  }
}
</script>
<style lang="less" scoped>
</style>
