Visualization.wxss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /* 确保搜索框和新增按钮固定在顶部 */
  2. .top {
  3. position: sticky; /* 使搜索框在页面滚动时固定 */
  4. top: 0; /* 固定在顶部 */
  5. z-index: 100; /* 确保在表格之上 */
  6. background-color: #f7f7f7; /* 背景色 */
  7. padding: 2% 0; /* 上下内边距 */
  8. }
  9. .topsearch {
  10. width: 90%;
  11. margin-left: 5%;
  12. display: flex;
  13. align-items: center;
  14. justify-content: space-between; /* 确保搜索框和按钮分开 */
  15. }
  16. .frame {
  17. background-color: white;
  18. width: 75%;
  19. border-radius: 20rpx;
  20. padding: 0 3%;
  21. }
  22. .frame > input {
  23. font-size: 24rpx;
  24. margin: 6rpx 0;
  25. }
  26. .topsearch > text {
  27. width: 10%;
  28. margin-left: 5%;
  29. color: #a8a7a7fa;
  30. }
  31. /* 新增按钮容器 */
  32. .add-btn-container {
  33. position: sticky;
  34. top: 0;
  35. background-color: #fff; /* 背景色为白色 */
  36. z-index: 101; /* 确保新增按钮高于表格 */
  37. padding: 10rpx; /* 增加按钮的上内边距 */
  38. display: flex;
  39. justify-content: center;
  40. margin-top: 10rpx; /* 新增按钮的上边距 */
  41. }
  42. /* 新增按钮 */
  43. .add-btn {
  44. padding: 5px 12px;
  45. background-color: #007aff;
  46. color: #fff;
  47. border-radius: 4px;
  48. font-size: 14px;
  49. }
  50. /* 表格容器 */
  51. .table-container {
  52. width: 100%;
  53. overflow-x: auto; /* 启用横向滚动 */
  54. background-color: #fff;
  55. border: 1rpx solid #ddd;
  56. margin-top: 20rpx; /* 添加上边距,确保不会和顶部元素重叠 */
  57. white-space: nowrap; /* 禁止换行 */
  58. }
  59. /* 表头样式 */
  60. .table-header {
  61. display: flex;
  62. width: max-content;
  63. background-color: #FFD700;
  64. font-weight: bold;
  65. border-bottom: 1rpx solid #ddd;
  66. z-index: 99; /* 确保表头高于表格内容 */
  67. }
  68. /* 表格单元格样式 */
  69. .table-cell {
  70. flex: none;
  71. width: 250rpx;
  72. padding: 10rpx;
  73. text-align: center;
  74. font-size: 28rpx;
  75. color: #333;
  76. border-right: 1rpx solid #ddd;
  77. white-space: nowrap;
  78. overflow: hidden;
  79. text-overflow: ellipsis;
  80. }
  81. /* 表格内容样式 */
  82. .table-body {
  83. display: flex;
  84. flex-direction: column;
  85. width: max-content;
  86. }
  87. .table-row {
  88. display: flex;
  89. }
  90. .table-row:nth-child(odd) {
  91. background-color: #f9f9f9;
  92. }
  93. .table-row:nth-child(even) {
  94. background-color: #ffffff;
  95. }
  96. /* 模态框背景 */
  97. .modal {
  98. position: fixed; /* 固定定位,始终在屏幕中央 */
  99. top: 0;
  100. left: 0;
  101. right: 0;
  102. bottom: 0;
  103. display: flex;
  104. justify-content: center;
  105. align-items: center;
  106. background-color: rgba(0, 0, 0, 0.6); /* 半透明背景色,增加一点深度感 */
  107. z-index: 1000; /* 提高层级,确保模态框在其他元素之上 */
  108. }
  109. /* 模态框内容 */
  110. .modal-content {
  111. background-color: #fff; /* 模态框内容背景为白色 */
  112. border-radius: 16px; /* 圆角 */
  113. width: 80%; /* 宽度占80% */
  114. max-width: 500rpx; /* 最大宽度限制 */
  115. box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* 添加阴影效果,增加浮动感 */
  116. padding: 20rpx; /* 内边距 */
  117. transition: transform 0.3s ease-out; /* 平滑的动画过渡 */
  118. }
  119. /* 每个选项项 */
  120. .modal-item {
  121. text-align: center; /* 每个项的文本居中 */
  122. font-size: 32rpx; /* 字体大小 */
  123. padding: 20rpx 0; /* 内边距 */
  124. border-top: 1rpx solid #eee; /* 上边框为浅灰色 */
  125. cursor: pointer; /* 鼠标悬停时显示为手指 */
  126. transition: background-color 0.2s; /* 添加鼠标悬停的平滑过渡 */
  127. }
  128. /* 第一项不显示上边框 */
  129. .modal-item:first-child {
  130. border-top: none;
  131. }
  132. /* 提交按钮样式 */
  133. .submit-btn {
  134. background-color: #4CAF50; /* 绿色背景 */
  135. color: white; /* 白色字体 */
  136. border: none; /* 去掉边框 */
  137. padding: 10rpx 20rpx; /* 内边距 */
  138. font-size: 32rpx; /* 字体大小 */
  139. border-radius: 8rpx; /* 圆角 */
  140. cursor: pointer; /* 鼠标悬停时显示为手指 */
  141. transition: background-color 0.3s ease; /* 背景色变化平滑过渡 */
  142. }
  143. /* 提交按钮悬停效果 */
  144. .submit-btn:hover {
  145. background-color: #45a049; /* 悬停时变为更深的绿色 */
  146. }
  147. /* 取消按钮样式 */
  148. .cancel-btn {
  149. background-color: #e74c3c; /* 红色背景 */
  150. color: white; /* 白色字体 */
  151. border: none; /* 去掉边框 */
  152. padding: 10rpx 20rpx; /* 内边距 */
  153. font-size: 32rpx; /* 字体大小 */
  154. border-radius: 8rpx; /* 圆角 */
  155. cursor: pointer; /* 鼠标悬停时显示为手指 */
  156. transition: background-color 0.3s ease; /* 背景色变化平滑过渡 */
  157. }
  158. /* 取消按钮悬停效果 */
  159. .cancel-btn:hover {
  160. background-color: #c0392b; /* 悬停时变为更深的红色 */
  161. }
  162. /* 新增数据弹窗的按钮容器 */
  163. .modal-content {
  164. display: flex;
  165. flex-direction: column; /* 默认垂直方向布局 */
  166. align-items: center; /* 居中对齐内容 */
  167. }
  168. /* 按钮容器 */
  169. .button-container {
  170. display: flex; /* 使用 flexbox 布局 */
  171. justify-content: space-between; /* 按钮之间均匀分布 */
  172. width: 100%; /* 按钮容器宽度为 100% */
  173. margin-top: 20rpx; /* 上边距 */
  174. }
  175. /* 每个按钮样式 */
  176. .submit-btn, .cancel-btn {
  177. flex: 1; /* 使按钮宽度相等 */
  178. margin: 0 10rpx; /* 按钮间隔 */
  179. }