excel-table.css 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /* Excel风格表格样式 */
  2. .excel-table {
  3. border: 1px solid var(--border-color);
  4. border-radius: 4px;
  5. overflow: hidden;
  6. font-size: 14px;
  7. background-color: white;
  8. box-shadow: var(--shadow-sm);
  9. margin-bottom: 15px;
  10. position: relative;
  11. width: 100%;
  12. max-height: 400px;
  13. display: flex;
  14. flex-direction: column;
  15. }
  16. /* 表头样式 */
  17. .excel-header {
  18. display: flex;
  19. background-color: #f8f9fa;
  20. border-bottom: 1px solid var(--border-color);
  21. position: sticky;
  22. top: 0;
  23. z-index: 2;
  24. }
  25. .excel-corner-cell {
  26. min-width: 40px;
  27. height: 30px;
  28. border-right: 1px solid var(--border-color);
  29. border-bottom: 1px solid var(--border-color);
  30. background-color: #f1f3f5;
  31. display: flex;
  32. align-items: center;
  33. justify-content: center;
  34. font-weight: bold;
  35. user-select: none;
  36. }
  37. .excel-column-header {
  38. min-width: 80px;
  39. height: 30px;
  40. border-right: 1px solid var(--border-color);
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. font-weight: bold;
  45. user-select: none;
  46. position: relative;
  47. }
  48. .excel-add-column {
  49. min-width: 30px;
  50. height: 30px;
  51. display: flex;
  52. align-items: center;
  53. justify-content: center;
  54. background-color: #e9ecef;
  55. cursor: pointer;
  56. user-select: none;
  57. font-weight: bold;
  58. color: var(--primary-color);
  59. transition: var(--transition);
  60. }
  61. .excel-add-column:hover {
  62. background-color: #dee2e6;
  63. }
  64. /* 表格主体样式 */
  65. .excel-body {
  66. flex: 1;
  67. overflow-y: auto;
  68. max-height: 350px;
  69. }
  70. .excel-row {
  71. display: flex;
  72. border-bottom: 1px solid var(--border-color);
  73. }
  74. .excel-row:last-child {
  75. border-bottom: none;
  76. }
  77. .excel-row-header {
  78. min-width: 40px;
  79. height: 30px;
  80. border-right: 1px solid var(--border-color);
  81. background-color: #f8f9fa;
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. font-weight: bold;
  86. user-select: none;
  87. position: sticky;
  88. left: 0;
  89. z-index: 1;
  90. }
  91. .excel-cell {
  92. min-width: 80px;
  93. height: 30px;
  94. border-right: 1px solid var(--border-color);
  95. padding: 0 5px;
  96. display: flex;
  97. align-items: center;
  98. overflow: hidden;
  99. white-space: nowrap;
  100. outline: none;
  101. transition: var(--transition);
  102. }
  103. .excel-cell:focus, .excel-cell.active {
  104. background-color: #e8f4fc;
  105. box-shadow: inset 0 0 0 2px var(--primary-color);
  106. }
  107. .excel-cell:hover:not(:focus):not(.active) {
  108. background-color: #f0f7ff;
  109. }
  110. /* 表格底部样式 */
  111. .excel-footer {
  112. display: flex;
  113. border-top: 1px solid var(--border-color);
  114. }
  115. .excel-add-row {
  116. min-width: 40px;
  117. height: 30px;
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. background-color: #e9ecef;
  122. cursor: pointer;
  123. user-select: none;
  124. font-weight: bold;
  125. color: var(--primary-color);
  126. transition: var(--transition);
  127. }
  128. .excel-add-row:hover {
  129. background-color: #dee2e6;
  130. }
  131. /* 响应式样式 */
  132. @media (max-width: 768px) {
  133. .excel-table {
  134. font-size: 12px;
  135. }
  136. .excel-column-header,
  137. .excel-cell {
  138. min-width: 60px;
  139. }
  140. .excel-corner-cell,
  141. .excel-row-header {
  142. min-width: 30px;
  143. }
  144. }
  145. /* CSV粘贴模式样式 */
  146. .input-mode {
  147. display: none;
  148. }
  149. .input-mode.active {
  150. display: block;
  151. }
  152. .input-mode-toggle {
  153. display: flex;
  154. margin-bottom: 15px;
  155. }
  156. .input-mode-toggle button {
  157. padding: 8px 15px;
  158. background-color: #f8f9fa;
  159. border: 1px solid var(--border-color);
  160. cursor: pointer;
  161. transition: var(--transition);
  162. }
  163. .input-mode-toggle button:first-child {
  164. border-radius: 4px 0 0 4px;
  165. }
  166. .input-mode-toggle button:last-child {
  167. border-radius: 0 4px 4px 0;
  168. }
  169. .input-mode-toggle button.active {
  170. background-color: var(--primary-color);
  171. color: white;
  172. border-color: var(--primary-color);
  173. }