@use "config.scss" as *;
$table: "#{$namespace}-table";

/* proTable */
.#{$table}-box,
.#{$table}-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: 100%;

  // 表格 header 样式
  .#{$table}-header {
    .#{$table}-header-button-lf,
    .#{$table}-header-button-ri {
      display: flex;
      flex-wrap: wrap;
      gap: 15px 12px;
      margin-bottom: 15px;
      .el-button:not(.el-input .el-button) {
        margin-left: 0;
      }
    }
    .#{$table}-header-button-lf {
      float: left;
    }
    .#{$table}-header-button-ri {
      float: right;
    }
  }

  // el-table 表格样式
  .el-table {
    flex: 1;

    // 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
    table {
      width: 100%;
    }
    .el-table__header th {
      height: 45px;
      font-size: 15px;
      font-weight: bold;
      color: var(--el-text-color-primary);
      background: var(--el-fill-color-light);
    }
    .el-table__row {
      height: 45px;
      font-size: 14px;
      .move {
        cursor: move;
        .el-icon {
          cursor: move;
        }
      }
    }

    // 设置 el-table 中 header 文字不换行，并省略
    .el-table__header .el-table__cell > .cell {
      // white-space: nowrap;
      white-space: wrap;
    }

    // 解决表格数据为空时样式不居中问题(仅在element-plus中)
    .el-table__empty-block {
      position: absolute;
      .table-empty {
        line-height: 30px;
        img {
          display: inline-flex;
        }
      }
    }

    // table 中 image 图片样式
    .table-image {
      width: 50px;
      height: 50px;
      border-radius: 50%;
    }
  }

  // 表格 pagination 样式
  .el-pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
  }
}

/* el-table 组件大小 */
.el-table--small {
  .el-table__header th {
    height: 40px !important;
    font-size: 14px !important;
  }
  .el-table__row {
    height: 40px !important;
    font-size: 13px !important;
  }
}
.el-table--large {
  .el-table__header th {
    height: 50px !important;
    font-size: 16px !important;
  }
  .el-table__row {
    height: 50px !important;
    font-size: 15px !important;
  }
}