@import "~element-ui/packages/theme-chalk/src/mixins/mixins";
@import "~element-ui/packages/theme-chalk/src/common/var";


/* 一些样式修正  */
.el-table .el-table__cell{
  padding: 0;
}

@include b(table) {
  @include m(compact) {
    font-size: $--size-base;
    // margin-bottom: 2px;
    thead {
      th {
        font-weight: normal;
        background-color: #f1f8f8;
      }
    }
    th,
    td {
      padding: 0;
      color: #202020;
      height: $line-height + 2px;
      line-height: $line-height + 2px;

      .cell {
        padding: 2px 3px;
      }
    }
    tr td {
      cursor: default;
    }
    tr.current-row > td {
      background-color: #dff6ed !important;
    }
    .caret-wrapper {
      height: $line-height;
      line-height: $line-height;
    }
    .sort-caret {
      &.ascending {
        top: -1px;
      }

      &.descending {
        bottom: 0;
      }
    }
    .el-table__expanded-cell[class*="cell"] {
      padding: 5px;
    }
  }

  @include e(expanded-cell) {
    // 纯属为了增加权重
    &[class*="cell"] {
      padding: 5px;
    }
  }
}

.eport-table-wrap {
  border: $panel-border;
  border-radius: 6px;
  overflow: hidden;

  .el-table {
    border: none;
  }

  .table-header {
    padding: 0 10px;
    height: $header-height;
    line-height: $header-height;
    background-color: $card-header-color;
    border-bottom: $panel-border;

    &__title {
      float: left;
      color: #000;
      font-size: 12px;

      &:before {
        content: "";
        width: 2px;
        height: 12px;
        display: inline-block;
        background-color: #20a0ff;
        -webkit-transform: translateY(2px);
        transform: translateY(2px);
        margin-right: 4px;
      }
    }

    &__buttons {
      float: right;
      padding-right: $margin;
    }
  }

  .el-table--enable-row-transition .el-table__body td {
    transition: none !important;
    cursor: default;
  }

  .table-footer {
    border-top: 0;
    height: $line-height + $margin * 2;
    line-height: $line-height + $margin * 2;

    .el-pagination {
      float: right;
      font-weight: 500;

      button,
      span:not([class*="suffix"]) {
        height: $line-height;
        line-height: $line-height;
        min-width: 20px;
        margin: 0;
        padding: 0;
      }

      .number {
        min-width: 22px;
      }

      .el-input__inner {
        height: $line-height;
        line-height: $line-height;
        background-color: #fff !important;
      }

      .el-pager {
        height: $line-height;
        line-height: $line-height;

        li {
          padding: 0 1px;
          height: $line-height;
          line-height: $line-height;
        }
      }
    }

    .table-actions {
      display: inline-block;
      height: $line-height;
      line-height: $line-height;
      margin-left: $margin;

      .el-button {
        padding: $margin;
      }
    }
  }
}

/* TODO 兼容代码,准备删除 */
.el-table--compact ~ .el-pagination {
  float: right;
  font-weight: 500;
  padding: 0 0 0 0;

  button,
  span:not([class*="suffix"]) {
    height: $line-height;
    line-height: $line-height;
    min-width: 20px;
    margin: 0;
    padding: 0;
  }

  .el-input__inner {
    height: $line-height;
    line-height: $line-height;
    padding: 0;
    background-color: #fff !important;
  }

  .el-select .el-input {
    margin: 1px 0;
  }

  .btn-prev,
  .btn-next {
    min-width: 20px;
    padding: 0 1px;
    margin: 1px;
  }

  .el-pager {
    height: $line-height;
    line-height: $line-height;

    li {
      min-width: 20px;
      margin: 1px;
      height: $line-height;
      line-height: $line-height;
    }

    .more::before {
      height: $line-height;
      line-height: $line-height;
    }
  }
}

// 首列
.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell {
  padding-left: 3px;
}
