123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725 |
- // 自定义主题
- $primary-color: #1e40af; // 深蓝主色,传递可靠感
- $primary-light: #3b82f6; // 浅蓝色,用于悬停效果
- $secondary-color: #0d9488; // 薄荷绿,作为强调色
- $success-color: #10b981; // 成功色
- $warning-color: #f59e0b; // 警告色(浅橙)
- $error-color: #ef4444; // 错误色
- $text-primary: #1f2937; // 主要文本色
- $text-secondary: #4b5563; // 次要文本色
- $text-tertiary: #9ca3af; // 辅助文本色
- $bg-primary: #ffffff; // 主背景色
- $bg-secondary: #f9fafb; // 次要背景色
- $bg-tertiary: #f3f4f6; // 辅助背景色
- $border-color: #e5e7eb; // 边框色
- $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);
- $border-radius: 8px;
- $transition: all 0.2s ease;
- // 主容器样式
- .assets-container {
- padding: 24px;
- min-height: 100vh;
- background-color: $bg-secondary;
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
- }
- // 页面标题
- .page-header {
- margin-bottom: 24px;
- padding-bottom: 16px;
- border-bottom: 2px solid $border-color;
- h1 {
- font-size: 28px;
- font-weight: 700;
- color: $text-primary;
- margin: 0 0 8px 0;
- }
- .page-description {
- font-size: 16px;
- color: $text-secondary;
- margin: 0;
- }
- }
- // 顶部操作栏
- .action-bar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px 20px;
- background-color: $bg-primary;
- border-radius: $border-radius;
- box-shadow: $shadow-sm;
- flex-wrap: wrap;
- gap: 16px;
- .action-buttons {
- display: flex;
- align-items: center;
- gap: 12px;
- flex-wrap: wrap;
- }
- .add-btn {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 10px 20px;
- background-color: $primary-color;
- color: white;
- border: none;
- border-radius: $border-radius;
- font-size: 16px;
- font-weight: 500;
- cursor: pointer;
- transition: $transition;
- &:hover {
- background-color: $primary-light;
- transform: translateY(-1px);
- box-shadow: $shadow-md;
- }
- &:active {
- transform: translateY(0);
- box-shadow: $shadow-sm;
- }
- }
- .batch-actions {
- display: flex;
- align-items: center;
- gap: 8px;
- animation: slideIn 0.3s ease-out;
- &.hidden {
- display: none;
- }
- }
- .batch-btn {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 8px 12px;
- border: 1px solid $border-color;
- border-radius: $border-radius;
- background-color: $bg-primary;
- color: $text-secondary;
- font-size: 14px;
- cursor: pointer;
- transition: $transition;
- &:hover {
- background-color: $bg-tertiary;
- border-color: $text-tertiary;
- }
- &:active {
- transform: scale(0.98);
- }
- }
- .search-filters {
- display: flex;
- align-items: center;
- gap: 12px;
- flex-wrap: wrap;
- }
- .search-container {
- position: relative;
- display: flex;
- align-items: center;
- min-width: 280px;
- .search-icon {
- position: absolute;
- left: 12px;
- color: $text-tertiary;
- z-index: 1;
- }
- .search-input {
- width: 100%;
- padding: 10px 12px 10px 40px;
- border: 1px solid $border-color;
- border-radius: $border-radius;
- font-size: 14px;
- color: $text-primary;
- background-color: $bg-primary;
- transition: $transition;
- &:focus {
- outline: none;
- border-color: $primary-color;
- box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
- }
- &::placeholder {
- color: $text-tertiary;
- }
- }
- .clear-search {
- position: absolute;
- right: 8px;
- color: $text-tertiary;
- padding: 4px;
- transition: $transition;
- &:hover {
- color: $text-primary;
- }
- }
- }
- .filter-container {
- min-width: 150px;
- }
- .filter-btn {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 10px 16px;
- background-color: $secondary-color;
- color: white;
- border: none;
- border-radius: $border-radius;
- font-size: 14px;
- font-weight: 500;
- cursor: pointer;
- transition: $transition;
- &:hover {
- background-color: #0f766e;
- transform: translateY(-1px);
- box-shadow: $shadow-md;
- }
- &:active {
- transform: translateY(0);
- box-shadow: $shadow-sm;
- }
- }
- }
- // 表格容器
- .table-container {
- background-color: $bg-primary;
- border-radius: $border-radius;
- box-shadow: $shadow-sm;
- overflow: hidden;
- margin-bottom: 24px;
- }
- // 员工表格
- .employee-table {
- width: 100%;
- .mat-header-row {
- background-color: $bg-tertiary;
- font-weight: 600;
- color: $text-primary;
- .mat-header-cell {
- padding: 16px;
- font-size: 14px;
- color: $text-primary;
- font-weight: 600;
- border-bottom: 1px solid $border-color;
- }
- }
- .mat-row {
- transition: $transition;
- cursor: pointer;
- &:hover {
- background-color: color-mix(in srgb, $primary-color 2%, transparent);
- transform: translateY(-1px);
- }
- .mat-cell {
- padding: 16px;
- font-size: 14px;
- color: $text-secondary;
- border-bottom: 1px solid $border-color;
- vertical-align: middle;
- }
- &:last-child .mat-cell {
- border-bottom: none;
- }
- }
- .name-column {
- min-width: 150px;
- .employee-info {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .employee-avatar {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- object-fit: cover;
- }
- .employee-name {
- font-weight: 500;
- color: $text-primary;
- }
- }
- .actions-column {
- min-width: 120px;
- .action-buttons {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .edit-btn,
- .delete-btn,
- .view-btn {
- color: $text-tertiary;
- transition: $transition;
- opacity: 0.8;
- &:hover {
- opacity: 1;
- transform: scale(1.1);
- }
- &.edit-btn:hover {
- color: $primary-color;
- }
- &.delete-btn:hover {
- color: $error-color;
- }
- &.view-btn:hover {
- color: $secondary-color;
- }
- }
- }
- // 合同信息样式
- .contract-info {
- display: flex;
- align-items: center;
- gap: 8px;
- .contract-date {
- font-size: 12px;
- color: $text-secondary;
- }
- .expiring-soon {
- background-color: color-mix(in srgb, $warning-color 15%, transparent);
- color: $warning-color;
- padding: 2px 8px;
- border-radius: 12px;
- font-size: 11px;
- font-weight: 500;
- animation: pulse 2s infinite;
- }
- .contract-btn {
- color: $primary-color;
- transition: $transition;
- &:hover {
- color: $primary-light;
- transform: scale(1.1);
- }
- }
- }
- .no-contract {
- color: $text-tertiary;
- font-size: 12px;
- font-style: italic;
- }
- // 状态选择器样式
- .status-select {
- min-width: 100px;
- .mat-select-trigger {
- font-size: 14px;
- }
- }
- // 空状态样式
- .empty-state {
- text-align: center;
- padding: 60px 20px;
- .empty-icon {
- font-size: 48px;
- color: $text-tertiary;
- margin-bottom: 16px;
- }
- p {
- color: $text-secondary;
- font-size: 16px;
- margin-bottom: 24px;
- }
- }
- }
- // 分页组件
- .pagination {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16px;
- background-color: $bg-primary;
- border-radius: $border-radius;
- box-shadow: $shadow-sm;
- .pagination-info {
- font-size: 14px;
- color: $text-secondary;
- }
- .mat-paginator {
- display: flex;
- justify-content: flex-end;
- flex: 1;
- }
- }
- // 自定义对话框样式 - 以深蓝色和白色为主色调
- .add-employee-dialog-container {
- .mat-dialog-container {
- background-color: #1e293b;
- color: white;
- border-radius: 12px;
- padding: 0;
- overflow: hidden;
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
- }
- .mat-dialog-title {
- color: white;
- font-size: 24px;
- font-weight: 600;
- padding: 24px 24px 0;
- margin: 0;
- }
- .mat-dialog-content {
- padding: 24px;
- background-color: white;
- color: #1e293b;
- margin: 0;
- }
- .mat-dialog-actions {
- padding: 16px 24px;
- background-color: #1e293b;
- justify-content: flex-end;
- margin: 0;
- }
- }
- .custom-dialog {
- // 对话框容器样式
- .mat-dialog-container {
- border-radius: $border-radius;
- box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 10px 15px -6px rgba(0, 0, 0, 0.1);
- overflow: hidden;
- background-color: $bg-primary; // 使用白色作为主背景
- border: 2px solid $primary-color; // 深蓝色边框
- max-width: 700px; // 增加对话框宽度
- width: 95vw;
- animation: slideIn 0.3s ease-out; // 添加动画效果
- }
-
- // 对话框标题样式
- h2 {
- font-size: 24px; // 增大标题字体
- font-weight: 700;
- color: $primary-color; // 使用深蓝色标题
- margin: 0;
- }
-
- // 输入框样式
- .mat-input-element {
- color: $text-primary;
- font-size: 16px; // 增大输入框字体
- font-weight: 500;
- }
-
- .mat-form-field {
- width: 100%;
- transition: all 0.2s ease;
- }
-
- .mat-form-field-appearance-fill .mat-form-field-flex {
- background-color: $bg-primary; // 输入框白色背景
- border-radius: $border-radius;
- border: 1px solid $border-color;
- transition: all 0.2s ease;
- }
-
- .mat-form-field-appearance-fill .mat-form-field-outline {
- border: none;
- }
-
- .mat-form-field-appearance-fill .mat-form-field-underline {
- display: none;
- }
-
- // 输入框聚焦效果增强
- .mat-form-field-appearance-fill .mat-form-field-focus-overlay {
- background-color: rgba(30, 64, 175, 0.08);
- }
-
- .mat-form-field:focus-within .mat-form-field-flex {
- border-color: $primary-color;
- box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
- }
-
- // 选择框样式增强
- .mat-select {
- color: $text-primary;
- font-size: 16px;
- }
-
- .mat-select-panel {
- background-color: $bg-primary;
- border-radius: $border-radius;
- box-shadow: $shadow-lg;
- margin-top: 8px;
- border: 1px solid $border-color;
- animation: slideIn 0.2s ease-out;
- }
-
- .mat-option {
- color: $text-primary;
- padding: 12px 20px; // 增加选项间距
- font-size: 16px; // 增大选项字体
- font-weight: 500;
- transition: all 0.2s ease;
- border-radius: $border-radius;
- margin: 2px 8px;
-
- &:hover {
- background-color: rgba(30, 64, 175, 0.1);
- transform: translateX(4px); // 悬停时轻微移动
- }
-
- &.mat-selected {
- background-color: color-mix(in srgb, $primary-color 20%, transparent);
- color: $primary-color;
- font-weight: 600;
- }
-
- &:active {
- transform: scale(0.98);
- }
- }
-
- // 按钮样式优化
- button[mat-button] {
- color: $text-secondary;
- font-size: 16px; // 增大按钮字体
- font-weight: 600;
- padding: 10px 24px;
- transition: all 0.2s ease;
- border-radius: $border-radius;
-
- &:hover {
- color: $primary-color;
- background-color: rgba(30, 64, 175, 0.08);
- transform: translateY(-1px);
- }
-
- &:active {
- transform: translateY(0);
- }
- }
-
- button[mat-raised-button][color="primary"] {
- background-color: $primary-color;
- color: white;
- font-size: 16px; // 增大按钮字体
- font-weight: 600;
- border-radius: $border-radius;
- padding: 12px 32px;
- transition: all 0.2s ease;
- box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
-
- &:hover {
- background-color: $primary-light;
- transform: translateY(-2px);
- box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
- }
-
- &:active {
- transform: translateY(0);
- box-shadow: 0 4px 10px rgba(30, 64, 175, 0.3);
- }
-
- &:disabled {
- background-color: $text-tertiary;
- transform: none;
- box-shadow: none;
- }
- }
-
- // 日期选择器样式增强
- .mat-datepicker-toggle {
- color: $text-tertiary;
- transition: all 0.2s ease;
-
- &:hover {
- color: $primary-color;
- transform: scale(1.1);
- }
- }
-
- .mat-datepicker-content {
- border-radius: $border-radius;
- overflow: hidden;
- border: 1px solid $border-color;
- }
-
- // 表单标签样式增强
- label {
- color: $text-primary;
- font-weight: 600;
- font-size: 16px;
- margin-bottom: 8px;
- display: block;
- }
-
- // 必填标记样式
- .required-mark {
- color: $error-color;
- font-size: 16px;
- margin-left: 4px;
- }
-
- // 错误状态样式增强
- .mat-error {
- color: $error-color;
- font-size: 14px;
- margin-top: 6px;
- display: block;
- font-weight: 500;
- }
-
- .mat-form-field-invalid .mat-form-field-flex {
- border-color: $error-color;
- background-color: rgba(239, 68, 68, 0.05);
- }
-
- .mat-form-field-invalid .mat-input-element {
- color: $error-color;
- }
- }
- // 自定义通知消息样式
- .success-snackbar {
- background-color: $success-color;
- color: white;
- }
- .error-snackbar {
- background-color: $error-color;
- color: white;
- }
- // 动画定义
- @keyframes slideIn {
- from {
- opacity: 0;
- transform: translateY(-10px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- @keyframes pulse {
- 0%, 100% {
- opacity: 1;
- }
- 50% {
- opacity: 0.7;
- }
- }
- // 响应式设计
- @media (max-width: 1200px) {
- .assets-container {
- padding: 16px;
- }
- .action-bar {
- flex-direction: column;
- align-items: stretch;
- .search-filters {
- justify-content: space-between;
- }
- }
- }
- @media (max-width: 768px) {
- .assets-container {
- padding: 12px;
- }
- .page-header {
- text-align: center;
- }
- .action-bar {
- padding: 12px;
- .search-filters {
- flex-direction: column;
- align-items: stretch;
- .search-container,
- .filter-container,
- .filter-btn {
- width: 100%;
- min-width: auto;
- }
- }
- }
- .table-container {
- overflow-x: auto;
- }
- .pagination {
- flex-direction: column;
- gap: 12px;
- align-items: center;
- .mat-paginator {
- justify-content: center;
- }
- }
- }
|