123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- // 全局变量定义
- $primary-color: #165DFF;
- $secondary-color: #6B7280;
- $success-color: #00B42A;
- $warning-color: #FFAA00;
- $error-color: #F53F3F;
- $text-primary: #333333;
- $text-secondary: #666666;
- $text-tertiary: #999999;
- $border-color: #E5E7EB;
- $bg-light: #F9FAFB;
- $bg-white: #FFFFFF;
- $shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
- $shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
- $shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
- // 主容器
- .logs {
- padding: 24px;
- min-height: 100vh;
- background-color: $bg-light;
- }
- // 页面标题区域
- .page-header {
- display: flex;
- flex-direction: column;
- margin-bottom: 24px;
- padding-bottom: 16px;
- border-bottom: 1px solid $border-color;
- .page-title {
- font-size: 24px;
- font-weight: 600;
- color: $text-primary;
- margin: 0 0 4px 0;
- }
- .page-description {
- font-size: 14px;
- color: $text-tertiary;
- margin: 0;
- }
- }
- // 搜索区域
- .search-filter-section {
- margin-bottom: 24px;
- .search-input-wrapper {
- position: relative;
- display: flex;
- align-items: center;
- background-color: $bg-white;
- border-radius: 8px;
- box-shadow: $shadow-sm;
- overflow: hidden;
- .search-icon {
- position: absolute;
- left: 16px;
- color: $text-tertiary;
- z-index: 1;
- }
- .search-input {
- flex: 1;
- padding: 12px 16px 12px 48px;
- border: none;
- background-color: transparent;
- font-size: 14px;
- color: $text-primary;
- outline: none;
- &::placeholder {
- color: $text-tertiary;
- }
- }
- .clear-search-btn,
- .search-btn {
- padding: 12px 16px;
- color: $text-secondary;
- min-width: auto;
- &:hover {
- background-color: $bg-light;
- color: $text-primary;
- }
- }
- }
- }
- // 高级筛选区域
- .advanced-filters {
- background-color: $bg-white;
- border-radius: 12px;
- padding: 24px;
- box-shadow: $shadow-sm;
- margin-bottom: 24px;
- .filter-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
- gap: 20px;
- margin-bottom: 20px;
- .filter-item {
- .filter-field {
- width: 100%;
- .mat-form-field-wrapper {
- .mat-form-field-flex {
- border-radius: 6px;
- }
- .mat-form-field-outline {
- border-radius: 6px;
- }
- .mat-form-field-infix {
- padding: 8px 0;
- .mat-input-element {
- font-size: 14px;
- color: $text-primary;
- }
- }
- .mat-form-field-label {
- font-size: 14px;
- color: $text-secondary;
- }
- .mat-form-field-suffix {
- .mat-icon {
- color: $text-tertiary;
- }
- }
- }
- }
- }
- }
- .date-range-filter {
- display: flex;
- gap: 20px;
- margin-bottom: 20px;
- flex-wrap: wrap;
- .date-filter-item {
- .date-field {
- width: 200px;
- .mat-form-field-wrapper {
- .mat-form-field-flex {
- border-radius: 6px;
- }
- .mat-form-field-outline {
- border-radius: 6px;
- }
- .mat-form-field-infix {
- padding: 8px 0;
- .mat-input-element {
- font-size: 14px;
- color: $text-primary;
- }
- }
- .mat-form-field-label {
- font-size: 14px;
- color: $text-secondary;
- }
- }
- }
- }
- }
- .filter-actions {
- display: flex;
- gap: 12px;
- justify-content: flex-end;
- .clear-btn,
- .expand-btn {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 8px 16px;
- font-size: 14px;
- color: $text-secondary;
- border: 1px solid $border-color;
- border-radius: 6px;
- background-color: $bg-white;
- transition: all 0.2s ease;
- &:hover {
- background-color: $bg-light;
- border-color: $text-tertiary;
- color: $text-primary;
- }
- }
- }
- }
- // 操作按钮区域
- .log-actions {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- flex-wrap: wrap;
- gap: 16px;
- .logs-summary {
- font-size: 14px;
- color: $text-secondary;
- .highlight {
- font-weight: 600;
- color: $primary-color;
- }
- }
- .action-buttons {
- display: flex;
- gap: 12px;
- .export-btn {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 10px 20px;
- font-size: 14px;
- font-weight: 500;
- background-color: $primary-color;
- color: $bg-white;
- border-radius: 6px;
- transition: all 0.2s ease;
- box-shadow: $shadow-sm;
- &:hover:not(:disabled) {
- background-color: #0E4BD8;
- box-shadow: $shadow-md;
- transform: translateY(-1px);
- }
- &:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- transform: none;
- box-shadow: none;
- }
- }
- }
- }
- // 日志表格容器
- .logs-table-container {
- background-color: $bg-white;
- border-radius: 12px;
- box-shadow: $shadow-sm;
- overflow: hidden;
- margin-bottom: 24px;
- .logs-table {
- width: 100%;
- border-collapse: collapse;
- .table-header {
- background-color: $bg-light;
- font-weight: 600;
- color: $text-secondary;
- font-size: 13px;
- text-align: left;
- padding: 14px 16px;
- border-bottom: 1px solid $border-color;
- cursor: pointer;
- transition: background-color 0.2s ease;
- &:hover {
- background-color: #F3F4F6;
- }
- .header-content {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .sort-icon {
- opacity: 0.5;
- }
- }
- .table-cell {
- padding: 12px 16px;
- border-bottom: 1px solid $border-color;
- font-size: 13px;
- color: $text-primary;
- vertical-align: middle;
- &.details-cell {
- max-width: 300px;
- .details-content {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .status-badge {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 4px 12px;
- border-radius: 16px;
- font-size: 12px;
- font-weight: 500;
- color: $bg-white;
- text-align: center;
- white-space: nowrap;
- .status-icon {
- font-size: 14px;
- }
- }
- .user-info {
- .user-name {
- font-weight: 500;
- }
- }
- .action-badge,
- .resource-badge {
- display: inline-block;
- padding: 4px 12px;
- border-radius: 16px;
- font-size: 12px;
- font-weight: 500;
- background-color: #E6F0FF;
- color: $primary-color;
- white-space: nowrap;
- }
- .ip-address {
- font-family: 'Courier New', monospace;
- color: $text-secondary;
- }
- }
- tr:last-child .table-cell {
- border-bottom: none;
- }
- tr:hover .table-cell {
- background-color: $bg-light;
- }
- }
- // 无数据状态
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 80px 20px;
- text-align: center;
- svg {
- margin-bottom: 16px;
- opacity: 0.5;
- }
- p {
- font-size: 16px;
- color: $text-tertiary;
- margin-bottom: 24px;
- }
- button {
- border-radius: 8px;
- padding: 8px 24px;
- font-size: 14px;
- font-weight: 500;
- }
- }
- }
- // 分页控件
- .pagination-controls {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20px;
- background-color: $bg-white;
- border-radius: 12px;
- box-shadow: $shadow-sm;
- .pagination-info {
- font-size: 14px;
- color: $text-tertiary;
- }
- .pagination-buttons {
- display: flex;
- align-items: center;
- gap: 8px;
- button {
- padding: 6px 12px;
- border-radius: 6px;
- font-size: 13px;
- font-weight: 500;
- transition: all 0.2s ease;
- min-width: auto;
- &:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- }
- &.active {
- background-color: $primary-color;
- color: $bg-white;
- }
- }
- .page-numbers {
- display: flex;
- gap: 4px;
- }
- }
- }
- // 日志统计卡片
- .log-stats-cards {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
- gap: 20px;
- margin-top: 32px;
- .stat-card {
- display: flex;
- align-items: center;
- gap: 16px;
- background-color: $bg-white;
- border-radius: 12px;
- padding: 24px;
- box-shadow: $shadow-sm;
- transition: all 0.2s ease;
- &:hover {
- box-shadow: $shadow-md;
- transform: translateY(-2px);
- }
- .stat-icon {
- width: 48px;
- height: 48px;
- border-radius: 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- color: $bg-white;
- &.primary {
- background-color: $primary-color;
- }
- &.success {
- background-color: $success-color;
- }
- &.error {
- background-color: $error-color;
- }
- &.warning {
- background-color: $warning-color;
- }
- }
- .stat-content {
- flex: 1;
- .stat-value {
- font-size: 28px;
- font-weight: 700;
- color: $text-primary;
- margin-bottom: 4px;
- }
- .stat-label {
- font-size: 14px;
- color: $text-tertiary;
- }
- }
- }
- }
- // 响应式设计
- @media (max-width: 1200px) {
- .logs-table {
- .table-header,
- .table-cell {
- padding: 12px;
- }
- }
- .date-range-filter {
- flex-direction: column;
- gap: 16px !important;
- .date-field {
- width: 100% !important;
- }
- }
- }
- @media (max-width: 992px) {
- .logs {
- padding: 16px;
- }
- .filter-grid {
- grid-template-columns: 1fr !important;
- }
- .logs-table-container {
- overflow-x: auto;
- }
- .pagination-controls {
- flex-direction: column;
- gap: 16px;
- .pagination-buttons {
- flex-wrap: wrap;
- justify-content: center;
- }
- }
- .log-stats-cards {
- grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
- }
- }
- @media (max-width: 768px) {
- .advanced-filters {
- padding: 16px;
- }
- .log-actions {
- flex-direction: column;
- align-items: stretch;
- gap: 12px;
- }
- .action-buttons {
- justify-content: center;
- }
- .stat-card {
- padding: 20px;
- .stat-icon {
- width: 40px;
- height: 40px;
- }
- .stat-value {
- font-size: 24px;
- }
- }
- }
- @media (max-width: 480px) {
- .logs {
- padding: 12px;
- }
- .page-title {
- font-size: 20px !important;
- }
- .log-stats-cards {
- grid-template-columns: 1fr;
- gap: 16px;
- }
- }
- // 滚动条样式
- .logs-table-container,
- .advanced-filters {
- &::-webkit-scrollbar {
- width: 6px;
- }
- &::-webkit-scrollbar-track {
- background: $bg-light;
- border-radius: 3px;
- }
- &::-webkit-scrollbar-thumb {
- background: $border-color;
- border-radius: 3px;
- }
- &::-webkit-scrollbar-thumb:hover {
- background: $text-tertiary;
- }
- }
|