<!--阈值设置模块-->
<template>
  <div class="threshold-setting-modal">
    <el-table
      :data="tableData"
      :header-cell-style="{
        background: '#BFBFBF',
        boxShadow: 'inset grey 0px -1px',
        color: '#333333',
        borderColor: '#eaeaea',
        fontSize: '20px',
        padding: '12px 0',
      }"
      :cell-style="{
        color: '#333333',
        borderColor: '#919191',
        fontSize: '18px',
        backgroundColor: '#ebebeb',
        height: '200px',
        fontWeight: '400',
      }"
      row-key="id"
      border
      stripe
      style="width: 100%">
      <el-table-column
        v-for="(item, index) in tableColumns"
        :key="index"
        :column-key="item.prop"
        :label="item.label"
        :width="item.width"
        :class-name="index === 0 ? 'table-meter-column' : 'table-meter-row'"
        align="center"
      >
        <template slot-scope="scope">
          <div v-if="scope.column.columnKey !== 'meteringStation'">
            <el-input v-model="scope.row[item.prop]">
              <div style="height: 40px;line-height: 40px;color: #333333" slot="suffix">℃</div>
            </el-input>
          </div>
          <div v-else>{{ scope.row[item.prop] }}</div>
        </template>
      </el-table-column>
    </el-table>

    <br/>

    <div class="jg-btn-group" style="float: right">
      <div class="jg-btn">确认</div>
      <div class="jg-btn">取消</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ThresholdSettingModal',
  data() {
    return {
      tableData: [
        {
          id: 1,
          meteringStation: '修改',
          pressureRange: '1.00',
          pressureDiffRange: '1000'
        },
      ],
      tableColumns: [
        {
          label: '',
          width: '200',
          prop: 'meteringStation'
        },
        {
          label: '上限值',
          prop: 'pressureRange'
        },
        {
          label: '下限值',
          prop: 'pressureDiffRange'
        },
      ],
    }
  },
}
</script>

<style lang="less" scoped>
  .threshold-setting-modal {
    padding: 100px 40px ;

    /deep/ .el-table {
      box-shadow: 0.05rem 0.05rem 0.1rem #AAA7A7, 0.05rem 0.05rem 0.1rem #FFFFFF;

      .cell {
        white-space: pre-line;
      }
    }

    /deep/ .el-table--border, .el-table--group {
      /*border-radius: 10px;*/
    }

    /deep/ .el-table__row {
      .table-meter-column {
        background-color: #d9d9d9 !important;
        box-shadow: inset #BFBFBF -1px -1px !important;
      }

      .table-meter-row {
        padding: 16px 40px;
        .cell {
          padding: 0;
          background-color: #ebebeb;
          box-shadow: inset 0.1rem 0.1rem 0.1rem #AAA7A7, inset -0.1rem -0.1rem 0.1rem #FFFFFF;
        }
      }
    }

    /deep/ .el-input__inner {
      background-color: #ebebeb;
      box-shadow: inset 0.1rem 0.1rem 0.1rem #AAA7A7, inset -0.1rem -0.1rem 0.1rem #FFFFFF;
      border: none;
      font-size: 16px;
      color: #333333;
      text-align: center;
      font-weight: bolder;
    }

    /deep/ .el-input__suffix {
      right: 16px;
      font-weight: bolder;
    }

    .jg-btn-group {
      display: flex;
      padding: 1px;
      text-align: center;

      .jg-btn {
        width: 100px;
        height: 40px;
        line-height: 40px;
        margin-left: 16px;
        padding: 0 8px;
        box-sizing: border-box;
        font-size: 16px;
        font-weight: 500;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0.1rem 0.1rem 0.1rem #aaa7a7, -0.1rem -0.1rem 0.1rem #FFFFFF;
      }

      .jg-btn:active {
        color: #FFFFFF;
        background-color: #A20D13;
        box-shadow: inset 0.2rem 0.2rem 0.5rem #6e090c, inset -0.2rem -0.2rem 0.5rem #c71016;
      }
    }
  }
</style>
