<template>

  <div class="table-main">
    <el-table :data="mockTableData" height="357px" :header-cell-style="{ textAlign: 'center' } "
              :cell-style="{ textAlign: 'center' }">
      <el-table-column label="A相" >
        <el-table-column prop="stdA" :label="'标准值'"/>
        <el-table-column prop="dataA" :label="'被检值'"/>
        <el-table-column prop="isDataA" label="检测结果">
          <template #default="scope">
            <el-tooltip effect="dark" placement="bottom">
              <el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
              <el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
              <el-tag type="warning" v-if="scope.row.isDataA === 4">/</el-tag>
              <el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="B相" >
        <el-table-column prop="stdB" :label="'标准值'"/>
        <el-table-column prop="dataB" :label="'被检值'"/>
        <el-table-column prop="isDataB" label="检测结果">
          <template #default="scope">
            <el-tooltip effect="dark" placement="bottom">
              <el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
              <el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
              <el-tag type="warning" v-if="scope.row.isDataB === 4">/</el-tag>
              <el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="C相" >
        <el-table-column prop="stdC" :label="'标准值'"/>
        <el-table-column prop="dataC" :label="'被检值'"/>
        <el-table-column prop="isDataC" label="检测结果">
          <template #default="scope">
            <el-tooltip effect="dark" placement="bottom">
              <el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
              <el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
              <el-tag type="warning" v-if="scope.row.isDataC === 4">/</el-tag>
              <el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table-column>
    </el-table>
  </div>

</template>

<script lang="tsx" setup>

const mockTableData = [
  {
    stdA: "220.00",
    dataA: "219.85",
    isDataA: 1,
    maxErrorA: "±0.5%",
    errorA: "0.068%",
    unitA: "%",
    stdB: "220.00",
    dataB: "220.12",
    isDataB: 1,
    maxErrorB: "±0.5%",
    errorB: "0.055%",
    unitB: "%",
    stdC: "220.00",
    dataC: "219.95",
    isDataC: 1,
    maxErrorC: "±0.5%",
    errorC: "0.023%",
    unitC: "%",
    stdT: "0.15",
    dataT: "0.12",
    isDataT: 1,
    maxErrorT: "±0.2",
    errorT: "0.03",
    unitT: "",
    unit: "V"
  }
];




</script>

<style scoped>

.form-grid {
  display: flex;
  flex-direction: row; /* 横向排列 */
  flex-wrap: wrap; /* 允许换行 */
}

.form-grid .el-form-item {
  flex: 1 1 30%; /* 控件宽度 */
  margin-right: 20px; /* 控件间距 */
}

.form-grid .el-form-item:last-child {
  margin-right: 0; /* 最后一个控件不需要右边距 */
}

.dialog-footer {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
}

.el-tabs {
  margin-bottom: 20px; /* 添加底部边距 */
}

.el-table th, .el-table td {
  text-align: center; /* 所有单元格文字居中 */
}

</style>