<template>
  <div class="tab">
    <el-row>
      <el-col :span="24" class="title">{{ list.title }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="4">统计报表时间</el-col>
      <el-col :span="20">{{ list.ReportTime }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="4">检修时间</el-col>
      <el-col :span="20">{{ list.repairTime }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="4">监测线路</el-col>
      <el-col :span="12">{{ list.detectionLine }}</el-col>
      <el-col :span="4">电压等级(kV)</el-col>
      <el-col :span="4">{{ list.voltage }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="4">PT变化</el-col>
      <el-col :span="4">{{ list.changePT }}</el-col>
      <el-col :span="4">CT变化</el-col>
      <el-col :span="4">{{ list.changeCT }}</el-col>
      <el-col :span="4">基准短路容量(MVA)</el-col>
      <el-col :span="4">{{ list.benchmark }}</el-col>
    </el-row>

    <el-row>
      <el-col :span="4">母线最小短路容量(MVA)</el-col>
      <el-col :span="4">{{ list.busBar }}</el-col>
      <el-col :span="4">用户协议最小短路容量(MVA)</el-col>
      <el-col :span="4">{{ list.UserAgreement }}</el-col>
      <el-col :span="4">供电设备容量(MVA)</el-col>
      <el-col :span="4">{{ list.powerSupply }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="4" class="bottom">工况</el-col>
      <el-col :span="20" class="bottom">{{ list.workingCondition }}</el-col>
    </el-row>
    <el-row v-for="(item, ind) in list.tableData" :key="ind">
      <el-row>
        <el-col :span="24" class="title tableTitle">{{
          list.tableTitle[ind]
        }}</el-col>
      </el-row>
      <el-table
        stripe
        stripe
        header-cell-class-name="table_header"
        :data="item"
        border
        style="width: 100%"
        :height="vh / num"
      >
        <el-table-column prop="name" label="名称"> </el-table-column>
        <el-table-column prop="company" label="单位"> </el-table-column>
        <el-table-column label="最大值">
          <el-table-column prop="maxA" label="A"> </el-table-column>
          <el-table-column prop="maxB" label="B"> </el-table-column>
          <el-table-column prop="maxC" label="C"> </el-table-column>
        </el-table-column>
        <el-table-column label="最小值">
          <el-table-column prop="minA" label="A"> </el-table-column>
          <el-table-column prop="minB" label="B"> </el-table-column>
          <el-table-column prop="minC" label="C"> </el-table-column>
        </el-table-column>
        <el-table-column label="平均值">
          <el-table-column prop="averageA" label="A"> </el-table-column>
          <el-table-column prop="averageB" label="B"> </el-table-column>
          <el-table-column prop="averageC" label="C"> </el-table-column>
        </el-table-column>
        <el-table-column label="95概率大值">
          <el-table-column prop="probabilityA" label="A"> </el-table-column>
          <el-table-column prop="probabilityB" label="B"> </el-table-column>
          <el-table-column prop="probabilityC" label="C"> </el-table-column>
        </el-table-column>
        <el-table-column prop="conclusion" label="结论"> </el-table-column>
        <el-table-column prop="Limit" label="国际限值"> </el-table-column>
      </el-table>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    list: {
      type: [Array, Object],
      required: true,
    },
  },
  data() {
    return {
      vh: undefined,
      num: "",
    };
  },
  mounted() {},
  created() {},

  methods: {},

  computed: {},

  watch: {
    list() {
      if (this.list.tableData.length == 1) {
        this.vh = window.sessionStorage.getItem("appheight") - 380;
      } else {
        this.vh = window.sessionStorage.getItem("appheight") - 410;
      }
      this.num = this.list.tableData.length;
    },
  },
};
</script>
<style lang="less" scoped>
.tab {
  .el-row {
    .el-col {
      font-size: 14px;
      padding-left: 5px;
      border-top: 1px solid #ebeef5;
      border-left: 1px solid #ebeef5;

      &:last-child {
        border-right: 1px solid #ebeef5;
      }
    }
  }
  .bottom {
    border-bottom: 1px solid #ebeef5;
  }

  .title {
    font-size: 16px;
    height: 30px;
    line-height: 30px;
    font-weight: 600;
    text-align: center;
  }
  .tableTitle {
    border-top: 3px solid #ebeef5 !important;
  }
}
</style>
