style.css 13 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
/* 数据处理模块 - 全局样式(最简实现:原生 CSS) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #333;
  font-size: 14px;
  min-height: 100vh;
}

/* 全局布局 */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; padding: 24px; min-width: 0; overflow-x: auto; }
.page-section { width: 100%; }
.page-placeholder { color: #888; }
.placeholder-text { margin-top: 24px; padding: 40px; background: #fff; border-radius: 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* 侧边栏 */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #001529;
  color: #fff;
  display: flex; flex-direction: column;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1f2e3d;
}
.logo-mark {
  width: 36px; height: 36px;
  background: #185fa5; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 600; font-size: 18px;
  flex-shrink: 0;
}
.logo-title { font-size: 15px; font-weight: 500; }
.logo-sub { font-size: 11px; color: #8c9bab; margin-top: 2px; }

.menu { padding: 12px 0; display: flex; flex-direction: column; flex: 1; }
.menu-item {
  display: block;
  padding: 0 20px;
  height: 40px; line-height: 40px;
  color: #c9d1d9;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-size: 14px;
  border: none; background: none; text-align: left;
  width: 100%;
}
.menu-item:hover { background: #112a45; color: #fff; }
.menu-item.active {
  background: #185fa5;
  color: #fff;
  font-weight: 500;
}
.menu-item.menu-sub { padding-left: 40px; font-size: 13px; }
.menu-group {
  padding: 12px 20px 4px;
  font-size: 12px;
  color: #6a7a8d;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid #1f2e3d;
}
.current-user-block {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  color: #c9d1d9;
}
.current-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.btn-logout {
  background: transparent; border: 1px solid #2c3e54; color: #c9d1d9;
  padding: 2px 10px; border-radius: 3px; font-size: 12px; cursor: pointer;
}
.btn-logout:hover { border-color: #185fa5; color: #fff; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.current-user { color: #555; font-size: 14px; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid #d0d3da;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.btn:hover { border-color: #185fa5; color: #185fa5; }
.btn-primary { background: #185fa5; border-color: #185fa5; color: #fff; }
.btn-primary:hover { background: #0c447c; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 2px 10px; font-size: 13px; margin-right: 8px; }
.btn-link {
  border: none; background: none; color: #185fa5; cursor: pointer; padding: 0; font-size: 14px;
}
.btn-link:disabled { color: #aaa; cursor: not-allowed; }
.btn-link.danger { color: #a32d2d; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label { font-size: 13px; color: #666; }
.filter-item select, .filter-item input {
  height: 38px; padding: 0 10px; border: 1px solid #d0d3da;
  border-radius: 4px; min-width: 140px; outline: none;
}
.filter-item input:focus, .filter-item select:focus { border-color: #185fa5; }

/* 月份选择器包装器 - 支持显示默认文本 */
.month-picker-wrapper {
  position: relative;
  display: inline-block;
  min-width: 140px;
}
.month-picker-wrapper input[type="month"] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d0d3da;
  border-radius: 4px;
  outline: none;
  background: #fff;
  position: relative;
  z-index: 2;
  color: transparent; /* 默认隐藏原生文字 */
}
.month-picker-wrapper input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
.month-picker-wrapper .month-placeholder {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
  z-index: 3; /* 提高 placeholder 层级,确保在 input 之上 */
  white-space: nowrap;
}
/* 有值状态:隐藏 placeholder,显示真实值 */
.month-picker-wrapper.has-value input[type="month"] {
  color: #333 !important;
}
.month-picker-wrapper.has-value .month-placeholder {
  display: none;
}
/* 无值状态:显示 placeholder,隐藏 input 文字 */
.month-picker-wrapper:not(.has-value) input[type="month"] {
  color: transparent;
}
.modal-control .month-picker-wrapper {
  width: 100%;
}
.modal-control .month-picker-wrapper input[type="month"] {
  width: 100%;
}
.filter-actions { display: flex; gap: 8px; }

/* 表格 */
.table-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #eef0f4;
  white-space: nowrap;
}
th { background: #fafbfc; color: #666; font-weight: 500; font-size: 13px; }
tbody tr:hover { background: #f8fafd; }
.empty-tip { text-align: center; color: #999; padding: 40px 0; }

/* 状态 */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.status-PROCESSING { background: #faedda; color: #854f0b; }
.status-COMPLETED { background: #eaf3de; color: #3b6d11; }
.status-FAILED { background: #fcebeb; color: #a32d2d; }

/* 失败原因:悬停/聚焦/点击「失败」标签时展示(自定义浮层,不再用原生 title) */
.status.has-error {
  cursor: help;
  border-bottom: 1px dashed #a32d2d;
}
/* 「失败」标签右侧的提示图标:告诉用户这里悬停/点击能看失败原因 */
.status-error-icon {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  color: #a32d2d;
}
.status.has-error:hover .status-error-icon,
.status.has-error:focus .status-error-icon { color: #7f1f1f; }

.status-tip {
  position: fixed;
  z-index: 9999;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #2b2b2b;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  pointer-events: none;
  display: none;
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  color: #666;
}

/* 表单 */
.form-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 720px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.form-item { margin-bottom: 24px; }
.form-item > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-item label.required::before { content: '* '; color: #e24b4a; }
.radio-group { display: flex; gap: 24px; flex-wrap: wrap; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-group input[type=radio] { accent-color: #185fa5; width: 16px; height: 16px; }
.select { height: 32px; padding: 0 10px; border: 1px solid #d0d3da; border-radius: 4px; min-width: 200px; outline: none; }
.select:focus { border-color: #185fa5; }

/* 上传区 */
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #c8cdd6;
  border-radius: 6px;
  margin-bottom: 12px;
  background: #fafbfc;
}
.upload-item .form-type { font-weight: 500; min-width: 110px; }
.upload-item .file-name { color: #666; flex: 1; word-break: break-all; }
.upload-item input[type=file] { max-width: 220px; }
.tip { color: #999; font-size: 12px; margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  max-width: 720px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .3s;
  z-index: 9999;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: #a32d2d; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow: hidden;
}
.modal-card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #eef0f4;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 500; color: #222; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #999;
  padding: 4px 8px; border-radius: 4px;
}
.modal-close:hover { background: #f5f6fa; color: #333; }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;          /* 关键:让 flex 子项可压缩,触发内部滚动 */
}
.modal-row {
  display: flex; align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-row > label {
  flex: 0 0 130px;
  text-align: right;
  padding-top: 6px;
  font-size: 13px;
  color: #555;
}
.modal-row > label.required::before { content: '*'; color: #e24b4a; margin-right: 4px; }
.modal-control { flex: 1; }
.modal-control select {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid #d0d3da; border-radius: 4px; outline: none;
  background: #fff;
}
.modal-control select:focus { border-color: #185fa5; }

.modal-file {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.modal-file > label {
  flex: 0 0 130px; text-align: right;
  font-size: 13px; color: #555;
  padding-top: 6px;
}
.modal-file > label.required::before { content: '*'; color: #e24b4a; margin-right: 4px; }
.modal-file .file-upload { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.file-upload input[type=file] { display: none; }
.file-upload .file-btn {
  flex-shrink: 0;          /* 防止按钮文字被压成竖排 */
  white-space: nowrap;
  padding: 6px 16px; border: 1px solid #d0d3da; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 13px;
}
.file-upload .file-btn:hover { border-color: #185fa5; color: #185fa5; }
.file-upload .file-name {
  flex: 1; min-width: 0;
  color: #666; font-size: 13px; word-break: break-all;
}
.modal-file .tip {
  flex: 0 0 280px;
  font-size: 12px; color: #999;
  padding-top: 6px;
}

.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid #eef0f4;
  display: flex; justify-content: flex-end; gap: 12px;
  flex-shrink: 0;          /* 关键:底部按钮始终可见 */
  background: #fff;
}

@media (max-width: 760px) {
  .modal-row, .modal-file { flex-wrap: wrap; }
  .modal-row > label, .modal-file > label { flex: 0 0 100%; text-align: left; padding-top: 0; }
  .modal-file .tip { flex: 1 1 100%; padding-top: 0; }
}

/* 所属周期选择器 */
.period-picker { display: flex; align-items: center; gap: 8px; }
.period-picker input[type=date] {
  height: 32px; padding: 0 8px;
  border: 1px solid #d0d3da; border-radius: 4px; outline: none;
  font-size: 13px; background: #fff;
}
.period-picker input[type=date]:focus { border-color: #185fa5; }
.period-sep { color: #999; font-size: 13px; }
.period-hint { margin-top: 4px; font-size: 12px; color: #999; }

/* 上传 Loading 遮罩 */
.loading-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.loading-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}
.loading-box p { color: #444; font-size: 14px; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid #e3e8ef;
  border-top-color: #185fa5;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 周期粒度分段按钮(按月/按周 切换) */
.seg-group {
  display: inline-flex;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.seg-group .seg-btn {
  padding: 4px 12px;
  font-size: 13px;
  border: none;
  background: #fff;
  color: #606266;
  cursor: pointer;
  border-right: 1px solid #dcdfe6;
  transition: all .15s;
  white-space: nowrap;
}
.seg-group .seg-btn:last-child { border-right: none; }
.seg-group .seg-btn:hover { color: #185fa5; }
.seg-group .seg-btn.active {
  background: #185fa5;
  color: #fff;
}