123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- /* 顶部固定区域 */
- .top-container {
- position: sticky;
- top: 0;
- background-color: white;
- z-index: 100; /* 保证顶部元素位于表格之上 */
- }
- .topsearch {
- width: 90%;
- margin-left: 5%;
- display: flex;
- align-items: center;
- justify-content: space-between; /* 确保搜索框和按钮分开 */
- }
- .frame {
- background-color: white;
- width: 75%;
- border-radius: 1px;
- padding: 0 3%;
- }
- .frame > input {
- font-size: 24rpx;
- margin: 6rpx 0;
- }
- .topsearch > text {
- width: 10%;
- margin-left: 5%;
- color: #a8a7a7fa;
- }
- /* 新增按钮容器 */
- .add-btn-container {
- position: sticky;
- top: 0;
- background-color: #fff; /* 背景色为白色 */
- z-index: 101; /* 确保新增按钮高于表格 */
- padding: 1rpx; /* 增加按钮的上内边距 */
- display: flex;
- justify-content: center;
- margin-top: 1rpx; /* 新增按钮的上边距 */
- }
- /* 新增按钮 */
- .add-btn {
- padding: 1px 12px;
- background-color: #3EC01E;
- color: #fff;
- border-radius: 4px;
- font-size: 14px;
- }
- /* 表格容器 */
- .table-container {
- width: 100%;
- overflow-x: auto; /* 启用横向滚动 */
- white-space: nowrap; /* 禁止换行 */
- background-color: #fff;
- border: 1rpx solid #ddd;
- margin-top: 10rpx; /* 添加上边距,确保不会和顶部元素重叠 */
- white-space: nowrap; /* 禁止换行 */
- }
- /* 表头样式 */
- .table-header {
- display: flex;
- background-color: #61E054; /* 表头背景色 */
- font-weight: bold;
- text-align: center;
- }
- /* 表格单元格样式 */
- .table-cell {
- flex: none;
- width: 250rpx; /* 固定宽度 */
- padding: 10rpx;
- text-align: center;
- font-size: 28rpx;
- color: #030803; /* 表头文字颜色 */
- border-right: 1rpx solid #ddd;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- /* 表格行样式 */
- .table-row:nth-child(odd) {
- background-color: #E4FBE5; /* 奇数行背景色 */
- }
- .table-row:nth-child(even) {
- background-color: #fff; /* 偶数行背景色 */
- }
- /* 表格内容样式 */
- .table-body {
- display: flex;
- flex-direction: column;
- width: max-content;
- }
- .table-row {
- display: flex;
- flex-direction: row;
- border-bottom: 1rpx solid #ddd;
- }
- /* 模态框背景 */
- .modal {
- display: flex;
- justify-content: center;
- align-items: center;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
- z-index: 1000; /* 确保弹窗在最上层 */
- }
- /* 模态框内容 */
- .modal-content {
- background-color: #fff; /* 白色背景 */
- padding: 20px;
- border-radius: 8px;
- width: 90%;
- max-width: 400px; /* 最大宽度 */
- max-height: 80vh; /* 最大高度,留出一些空间以便滚动条显示 */
- overflow-y: auto; /* 垂直方向溢出时显示滚动条 */
- overflow-x: hidden; /* 隐藏水平滚动条 */
- }
- /* 每个选项项 */
- .modal-item {
- text-align: center; /* 每个项的文本居中 */
- font-size: 32rpx; /* 字体大小 */
- padding: 20rpx 0; /* 内边距 */
- border-top: 1rpx solid #eee; /* 上边框为浅灰色 */
- cursor: pointer; /* 鼠标悬停时显示为手指 */
- transition: background-color 0.2s; /* 添加鼠标悬停的平滑过渡 */
- }
- /* 第一项不显示上边框 */
- .modal-item:first-child {
- border-top: none;
- }
- /* 提交按钮样式 */
- .submit-btn {
- background-color: #4CAF50; /* 绿色背景 */
- color: white; /* 白色字体 */
- border: none; /* 去掉边框 */
- padding: 10rpx 20rpx; /* 内边距 */
- font-size: 32rpx; /* 字体大小 */
- border-radius: 8rpx; /* 圆角 */
- cursor: pointer; /* 鼠标悬停时显示为手指 */
- transition: background-color 0.3s ease; /* 背景色变化平滑过渡 */
- }
- /* 提交按钮悬停效果 */
- .submit-btn:hover {
- background-color: #45a049; /* 悬停时变为更深的绿色 */
- }
- /* 取消按钮样式 */
- .cancel-btn {
- background-color: #e74c3c; /* 红色背景 */
- color: white; /* 白色字体 */
- border: none; /* 去掉边框 */
- padding: 10rpx 20rpx; /* 内边距 */
- font-size: 32rpx; /* 字体大小 */
- border-radius: 8rpx; /* 圆角 */
- cursor: pointer; /* 鼠标悬停时显示为手指 */
- transition: background-color 0.3s ease; /* 背景色变化平滑过渡 */
- }
- /* 取消按钮悬停效果 */
- .cancel-btn:hover {
- background-color: #c0392b; /* 悬停时变为更深的红色 */
- }
- /* 新增数据弹窗的按钮容器 */
- .modal-content {
- display: flex;
- flex-direction: column; /* 默认垂直方向布局 */
- align-items: center; /* 居中对齐内容 */
- }
- /* 按钮容器 */
- .button-container {
- display: flex; /* 使用 flexbox 布局 */
- justify-content: space-between; /* 按钮之间均匀分布 */
- width: 100%; /* 按钮容器宽度为 100% */
- margin-top: 20rpx; /* 上边距 */
- }
- /* 每个按钮样式 */
- .submit-btn, .cancel-btn {
- flex: 1; /* 使按钮宽度相等 */
- margin: 0 10rpx; /* 按钮间隔 */
- }
|