<!--
  @description: 报表统计-专家出席率
  @Modifier：肖文龙
  @routerPath:
  @date：  2021/02/26
-->
<template>
  <!-- :style="{'height':height}" -->
  <dl
    class="reportChart_crud"
  >
    <dt>
      本年专家出席率
    </dt>
    <dd>
      <tableChart
        :height="dd_height"
        class="echart-dom"
        :option="option"
      />
      <!-- 报表统计-专家统计-专家出席率详情 -->
      <expertBePresentRateDetail ref="tenderDetail" />
      <!-- 报表统计-专家统计-最新入库专家-更多弹框 -->
      <expertBePresentRateMoreListDialog ref="moreList" />
    </dd>
  </dl>
</template>

<script>
/* api */
import { listExpertAttendanceRate } from '@api/statisticalAnalysis/reportChart.js'
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'// 分页
/* 組件 */
import tableChart from './../../components/tableChart'// table列表渲染组件
import expertBePresentRateDetail from './expertBePresentRateDetail-dialog.vue' // 报表统计-专家统计-专家出席率详情
import expertBePresentRateMoreListDialog from './expertBePresentRateMoreList-dialog.vue' // 报表统计-专家出席率-更多弹框
export default {
  name: 'ExpertBePresentRate',
  components: {
    expertBePresentRateDetail, // 报表统计-专家统计-专家出席率详情
    tableChart, // table列表渲染组件
    expertBePresentRateMoreListDialog // 报表统计-专家出席率-更多弹框
  },
  mixins: [ListMixin],
  props: {
    height: {
      type: String,
      default: '100%'
    }
  },
  data() {
    return {
      dd_height: 'calc(' + this.height + ' - 2.5rem)', // 内容的高度
      // 查询条件
      searchData: {},
      option: {
        // 底部-操作类
        footer: [
          {
            text: '更多',
            click: this.more
          }
        ],
        // 标题
        thead: [
          { lable: '专家姓名', prop: 'expertName', align: 'center' },
          { lable: '出席率', prop: 'attendanceRate', align: 'center' },
          { lable: '评标项目', width: 70,
            // 操作类
            handle: [
              {
                text: '查看',
                click: this.detail
              }
            ] }
        ],
        // 渲染数据
        data: []
      }
    }
  },
  methods: {
    /**
     * 获取数据
     *  @param {searchData} Object 查询条件
    */
    initChart(searchData) {
      // 查询条件
      this.searchData = searchData
      this.option.data = []
      const data = {
        pageNo: 1,
        pageSize: 10,
        ...searchData
      }
      listExpertAttendanceRate(data).then(res => {
        this.paginationData.total = res.data.total
        this.option.data.push(...res.data.records)
      })
    },
    // 查看
    detail(row) {
      this.$refs.tenderDetail.open(row.row)
    },
    // 更多
    more() {
      this.$refs.moreList.open(this.searchData)
    }
  }
}
</script>
<style lang="less" scoped>
</style>
