Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

sticky-header.component.html 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <div class="sticky-header sticky top-0 z-10 transition-all duration-300 ease-in-out" [style.min-height]="headerHeight" [class.locked]="isLocked" [class.compact]="isCompact" [ngStyle]="isLocked ? {
  2. width: headerWidth ? (typeof headerWidth === 'number' ? headerWidth + 'px' : headerWidth) : null,
  3. left: headerLeft ? (typeof headerLeft === 'number' ? headerLeft + 'px' : headerLeft) : null
  4. } : null">
  5. <!-- 主标题区域 -->
  6. <div class="header-content bg-white rounded-lg border border-gray-200 shadow-sm transition-all duration-300">
  7. <div class="flex justify-between items-center p-4 transition-all duration-300">
  8. <h1 class="header-title text-2xl font-bold transition-all duration-300">{{ title }}</h1>
  9. <button
  10. mat-raised-button
  11. [color]="buttonColor"
  12. (click)="onButtonClick()"
  13. [disabled]="disabled || loading"
  14. class="flex items-center gap-2"
  15. >
  16. <mat-icon *ngIf="!loading">{{ buttonIcon }}</mat-icon>
  17. <mat-progress-spinner
  18. *ngIf="loading"
  19. diameter="20"
  20. mode="indeterminate"
  21. class="inline-block"
  22. ></mat-progress-spinner>
  23. {{ loading ? '处理中...' : buttonText }}
  24. </button>
  25. </div>
  26. <!-- 提示信息 -->
  27. @if (hintText) {
  28. <div class="hint-section border-t border-gray-100 p-3 bg-blue-50/30 transition-all duration-300 overflow-hidden">
  29. <p class="text-sm text-gray-600 m-0 transition-all duration-300">{{ hintText }}</p>
  30. </div>
  31. }
  32. <!-- 调试信息区域 -->
  33. @if (showDebugInfo && (debugDataSource || debugRegisterUrl || debugListUrl)) {
  34. <div class="debug-section border-t border-gray-100 overflow-hidden">
  35. <!-- 数据源信息 -->
  36. @if (debugDataSource) {
  37. <div class="debug-info text-xs text-gray-500 p-2 bg-gray-50 transition-all duration-300">
  38. <div class="flex gap-4 flex-wrap transition-all duration-300">
  39. <span>数据源: <span class="font-mono">{{ debugDataSource }}</span></span>
  40. <span>记录条数: <span class="font-mono">{{ debugRecordCount }}</span></span>
  41. <span>更新时间: <span class="font-mono">{{ debugLastUpdated }}</span></span>
  42. @if (debugUseMockData) {
  43. <span class="text-amber-600 font-medium">⚠ 使用模拟数据</span>
  44. } @else {
  45. <span class="text-green-600 font-medium">✓ 使用API数据</span>
  46. }
  47. </div>
  48. </div>
  49. }
  50. <!-- API URL信息 -->
  51. @if (debugRegisterUrl || debugListUrl) {
  52. <div class="debug-urls text-xs text-gray-500 p-2 bg-gray-50 border-t border-gray-100 transition-all duration-300">
  53. <div class="flex flex-col gap-1 transition-all duration-300">
  54. @if (debugRegisterUrl) {
  55. <span>注册API: <span class="font-mono">{{ debugRegisterUrl || '未调用' }}</span></span>
  56. }
  57. @if (debugListUrl) {
  58. <span>列表API: <span class="font-mono">{{ debugListUrl || '未调用' }}</span></span>
  59. }
  60. </div>
  61. </div>
  62. }
  63. </div>
  64. }
  65. </div>
  66. </div>