basic-table.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. $bg-base-color: #ffffff;
  2. $header-color: #909399;
  3. $footer-bg-color: #f5f7fa;
  4. $table-border: #edeeee;
  5. $table-stripe-color: #fafafa;
  6. .base-table {
  7. overflow: auto;
  8. box-sizing: content-box;
  9. &.is-border {
  10. border: 1px solid $table-border;
  11. border-bottom: none;
  12. .b-th,
  13. .b-td {
  14. border-right: 1px solid $table-border;
  15. &:last-of-type {
  16. border-right: none;
  17. }
  18. }
  19. }
  20. &.no-data {
  21. .base-table-body {
  22. border-bottom: 1px solid $table-border;
  23. }
  24. }
  25. .base-table-inner {
  26. display: flex;
  27. height: 100%;
  28. flex-direction: column;
  29. .base-table-header,
  30. .base-table-footer {
  31. width: 100%;
  32. flex-shrink: 0;
  33. position: sticky;
  34. z-index: 3;
  35. }
  36. .base-table-header {
  37. top: 0;
  38. .b-td {
  39. background-color: $bg-base-color;
  40. }
  41. }
  42. .base-table-footer {
  43. bottom: 0;
  44. .b-tr {
  45. background-color: $footer-bg-color !important;
  46. }
  47. .b-td {
  48. border-top: 1px solid $table-border;
  49. background-color: $footer-bg-color !important;
  50. }
  51. }
  52. .base-table-body {
  53. position: relative;
  54. flex: 1;
  55. }
  56. .b-table {
  57. table-layout: fixed;
  58. display: table;
  59. .b-thead {
  60. color: $header-color;
  61. table-layout: fixed;
  62. display: table-header-group;
  63. vertical-align: middle;
  64. font-weight: bold;
  65. }
  66. .b-tbody {
  67. display: table-row-group;
  68. vertical-align: middle;
  69. table-layout: fixed;
  70. }
  71. .b-tr {
  72. background-color: $bg-base-color;
  73. display: table-row;
  74. &.is-stripe {
  75. .b-td {
  76. background-color: $table-stripe-color;
  77. }
  78. }
  79. }
  80. .b-th,
  81. .b-td {
  82. font-size: 14px;
  83. display: table-cell;
  84. border-bottom: 1px solid $table-border;
  85. padding: 8px 0;
  86. box-sizing: border-box;
  87. text-overflow: ellipsis;
  88. position: relative;
  89. vertical-align: middle;
  90. text-align: left;
  91. z-index: 1;
  92. .b-cell {
  93. box-sizing: border-box;
  94. overflow: hidden;
  95. text-overflow: ellipsis;
  96. white-space: normal;
  97. word-break: break-all;
  98. line-height: 23px;
  99. padding: 0 8px;
  100. }
  101. &.fixed {
  102. position: sticky !important;
  103. z-index: 2;
  104. background: $bg-base-color;
  105. border-right: 0;
  106. &::before {
  107. content: '';
  108. position: absolute;
  109. top: 0px;
  110. width: 10px;
  111. bottom: -1px;
  112. }
  113. }
  114. &.fixed-left {
  115. left: 0;
  116. &::before {
  117. right: -10px;
  118. box-shadow: inset 10px 0 10px -10px rgba(0, 0, 0, 0.15);
  119. }
  120. }
  121. &.fixed-right {
  122. right: 0;
  123. &::before {
  124. left: -10px;
  125. box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.15);
  126. }
  127. }
  128. }
  129. .base-table-empty {
  130. min-height: 60px;
  131. line-height: 60px;
  132. width: 100%;
  133. text-align: center;
  134. color: $header-color;
  135. font-size: 24rpx;
  136. }
  137. }
  138. }
  139. }