assets.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. // 自定义主题
  2. $primary-color: #1e40af; // 深蓝主色,传递可靠感
  3. $primary-light: #3b82f6; // 浅蓝色,用于悬停效果
  4. $secondary-color: #0d9488; // 薄荷绿,作为强调色
  5. $success-color: #10b981; // 成功色
  6. $warning-color: #f59e0b; // 警告色(浅橙)
  7. $error-color: #ef4444; // 错误色
  8. $text-primary: #1f2937; // 主要文本色
  9. $text-secondary: #4b5563; // 次要文本色
  10. $text-tertiary: #9ca3af; // 辅助文本色
  11. $bg-primary: #ffffff; // 主背景色
  12. $bg-secondary: #f9fafb; // 次要背景色
  13. $bg-tertiary: #f3f4f6; // 辅助背景色
  14. $border-color: #e5e7eb; // 边框色
  15. $shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  16. $shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  17. $shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  18. $border-radius: 8px;
  19. $transition: all 0.2s ease;
  20. // 主容器样式
  21. .assets-container {
  22. padding: 24px;
  23. min-height: 100vh;
  24. background-color: $bg-secondary;
  25. font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  26. }
  27. // 页面标题
  28. .page-header {
  29. margin-bottom: 24px;
  30. padding-bottom: 16px;
  31. border-bottom: 2px solid $border-color;
  32. h1 {
  33. font-size: 28px;
  34. font-weight: 700;
  35. color: $text-primary;
  36. margin: 0 0 8px 0;
  37. }
  38. .page-description {
  39. font-size: 16px;
  40. color: $text-secondary;
  41. margin: 0;
  42. }
  43. }
  44. // 顶部操作栏
  45. .action-bar {
  46. display: flex;
  47. justify-content: space-between;
  48. align-items: center;
  49. margin-bottom: 24px;
  50. padding: 16px 20px;
  51. background-color: $bg-primary;
  52. border-radius: $border-radius;
  53. box-shadow: $shadow-sm;
  54. flex-wrap: wrap;
  55. gap: 16px;
  56. .action-buttons {
  57. display: flex;
  58. align-items: center;
  59. gap: 12px;
  60. flex-wrap: wrap;
  61. }
  62. .add-btn {
  63. display: flex;
  64. align-items: center;
  65. gap: 8px;
  66. padding: 10px 20px;
  67. background-color: $primary-color;
  68. color: white;
  69. border: none;
  70. border-radius: $border-radius;
  71. font-size: 16px;
  72. font-weight: 500;
  73. cursor: pointer;
  74. transition: $transition;
  75. &:hover {
  76. background-color: $primary-light;
  77. transform: translateY(-1px);
  78. box-shadow: $shadow-md;
  79. }
  80. &:active {
  81. transform: translateY(0);
  82. box-shadow: $shadow-sm;
  83. }
  84. }
  85. .batch-actions {
  86. display: flex;
  87. align-items: center;
  88. gap: 8px;
  89. animation: slideIn 0.3s ease-out;
  90. &.hidden {
  91. display: none;
  92. }
  93. }
  94. .batch-btn {
  95. display: flex;
  96. align-items: center;
  97. gap: 6px;
  98. padding: 8px 12px;
  99. border: 1px solid $border-color;
  100. border-radius: $border-radius;
  101. background-color: $bg-primary;
  102. color: $text-secondary;
  103. font-size: 14px;
  104. cursor: pointer;
  105. transition: $transition;
  106. &:hover {
  107. background-color: $bg-tertiary;
  108. border-color: $text-tertiary;
  109. }
  110. &:active {
  111. transform: scale(0.98);
  112. }
  113. }
  114. .search-filters {
  115. display: flex;
  116. align-items: center;
  117. gap: 12px;
  118. flex-wrap: wrap;
  119. }
  120. .search-container {
  121. position: relative;
  122. display: flex;
  123. align-items: center;
  124. min-width: 280px;
  125. .search-icon {
  126. position: absolute;
  127. left: 12px;
  128. color: $text-tertiary;
  129. z-index: 1;
  130. }
  131. .search-input {
  132. width: 100%;
  133. padding: 10px 12px 10px 40px;
  134. border: 1px solid $border-color;
  135. border-radius: $border-radius;
  136. font-size: 14px;
  137. color: $text-primary;
  138. background-color: $bg-primary;
  139. transition: $transition;
  140. &:focus {
  141. outline: none;
  142. border-color: $primary-color;
  143. box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
  144. }
  145. &::placeholder {
  146. color: $text-tertiary;
  147. }
  148. }
  149. .clear-search {
  150. position: absolute;
  151. right: 8px;
  152. color: $text-tertiary;
  153. padding: 4px;
  154. transition: $transition;
  155. &:hover {
  156. color: $text-primary;
  157. }
  158. }
  159. }
  160. .filter-container {
  161. min-width: 150px;
  162. }
  163. .filter-btn {
  164. display: flex;
  165. align-items: center;
  166. gap: 6px;
  167. padding: 10px 16px;
  168. background-color: $secondary-color;
  169. color: white;
  170. border: none;
  171. border-radius: $border-radius;
  172. font-size: 14px;
  173. font-weight: 500;
  174. cursor: pointer;
  175. transition: $transition;
  176. &:hover {
  177. background-color: #0f766e;
  178. transform: translateY(-1px);
  179. box-shadow: $shadow-md;
  180. }
  181. &:active {
  182. transform: translateY(0);
  183. box-shadow: $shadow-sm;
  184. }
  185. }
  186. }
  187. // 表格容器
  188. .table-container {
  189. background-color: $bg-primary;
  190. border-radius: $border-radius;
  191. box-shadow: $shadow-sm;
  192. overflow: hidden;
  193. margin-bottom: 24px;
  194. }
  195. // 员工表格
  196. .employee-table {
  197. width: 100%;
  198. .mat-header-row {
  199. background-color: $bg-tertiary;
  200. font-weight: 600;
  201. color: $text-primary;
  202. .mat-header-cell {
  203. padding: 16px;
  204. font-size: 14px;
  205. color: $text-primary;
  206. font-weight: 600;
  207. border-bottom: 1px solid $border-color;
  208. }
  209. }
  210. .mat-row {
  211. transition: $transition;
  212. cursor: pointer;
  213. &:hover {
  214. background-color: color-mix(in srgb, $primary-color 2%, transparent);
  215. transform: translateY(-1px);
  216. }
  217. .mat-cell {
  218. padding: 16px;
  219. font-size: 14px;
  220. color: $text-secondary;
  221. border-bottom: 1px solid $border-color;
  222. vertical-align: middle;
  223. }
  224. &:last-child .mat-cell {
  225. border-bottom: none;
  226. }
  227. }
  228. .name-column {
  229. min-width: 150px;
  230. .employee-info {
  231. display: flex;
  232. align-items: center;
  233. gap: 10px;
  234. }
  235. .employee-avatar {
  236. width: 36px;
  237. height: 36px;
  238. border-radius: 50%;
  239. object-fit: cover;
  240. }
  241. .employee-name {
  242. font-weight: 500;
  243. color: $text-primary;
  244. }
  245. }
  246. .actions-column {
  247. min-width: 120px;
  248. .action-buttons {
  249. display: flex;
  250. align-items: center;
  251. gap: 8px;
  252. }
  253. .edit-btn,
  254. .delete-btn,
  255. .view-btn {
  256. color: $text-tertiary;
  257. transition: $transition;
  258. opacity: 0.8;
  259. &:hover {
  260. opacity: 1;
  261. transform: scale(1.1);
  262. }
  263. &.edit-btn:hover {
  264. color: $primary-color;
  265. }
  266. &.delete-btn:hover {
  267. color: $error-color;
  268. }
  269. &.view-btn:hover {
  270. color: $secondary-color;
  271. }
  272. }
  273. }
  274. // 合同信息样式
  275. .contract-info {
  276. display: flex;
  277. align-items: center;
  278. gap: 8px;
  279. .contract-date {
  280. font-size: 12px;
  281. color: $text-secondary;
  282. }
  283. .expiring-soon {
  284. background-color: color-mix(in srgb, $warning-color 15%, transparent);
  285. color: $warning-color;
  286. padding: 2px 8px;
  287. border-radius: 12px;
  288. font-size: 11px;
  289. font-weight: 500;
  290. animation: pulse 2s infinite;
  291. }
  292. .contract-btn {
  293. color: $primary-color;
  294. transition: $transition;
  295. &:hover {
  296. color: $primary-light;
  297. transform: scale(1.1);
  298. }
  299. }
  300. }
  301. .no-contract {
  302. color: $text-tertiary;
  303. font-size: 12px;
  304. font-style: italic;
  305. }
  306. // 状态选择器样式
  307. .status-select {
  308. min-width: 100px;
  309. .mat-select-trigger {
  310. font-size: 14px;
  311. }
  312. }
  313. // 空状态样式
  314. .empty-state {
  315. text-align: center;
  316. padding: 60px 20px;
  317. .empty-icon {
  318. font-size: 48px;
  319. color: $text-tertiary;
  320. margin-bottom: 16px;
  321. }
  322. p {
  323. color: $text-secondary;
  324. font-size: 16px;
  325. margin-bottom: 24px;
  326. }
  327. }
  328. }
  329. // 分页组件
  330. .pagination {
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. padding: 16px;
  335. background-color: $bg-primary;
  336. border-radius: $border-radius;
  337. box-shadow: $shadow-sm;
  338. .pagination-info {
  339. font-size: 14px;
  340. color: $text-secondary;
  341. }
  342. .mat-paginator {
  343. display: flex;
  344. justify-content: flex-end;
  345. flex: 1;
  346. }
  347. }
  348. // 自定义对话框样式 - 以深蓝色和白色为主色调
  349. .add-employee-dialog-container {
  350. .mat-dialog-container {
  351. background-color: #1e293b;
  352. color: white;
  353. border-radius: 12px;
  354. padding: 0;
  355. overflow: hidden;
  356. box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  357. }
  358. .mat-dialog-title {
  359. color: white;
  360. font-size: 24px;
  361. font-weight: 600;
  362. padding: 24px 24px 0;
  363. margin: 0;
  364. }
  365. .mat-dialog-content {
  366. padding: 24px;
  367. background-color: white;
  368. color: #1e293b;
  369. margin: 0;
  370. }
  371. .mat-dialog-actions {
  372. padding: 16px 24px;
  373. background-color: #1e293b;
  374. justify-content: flex-end;
  375. margin: 0;
  376. }
  377. }
  378. .custom-dialog {
  379. // 对话框容器样式
  380. .mat-dialog-container {
  381. border-radius: $border-radius;
  382. box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 10px 15px -6px rgba(0, 0, 0, 0.1);
  383. overflow: hidden;
  384. background-color: $bg-primary; // 使用白色作为主背景
  385. border: 2px solid $primary-color; // 深蓝色边框
  386. max-width: 700px; // 增加对话框宽度
  387. width: 95vw;
  388. animation: slideIn 0.3s ease-out; // 添加动画效果
  389. }
  390. // 对话框标题样式
  391. h2 {
  392. font-size: 24px; // 增大标题字体
  393. font-weight: 700;
  394. color: $primary-color; // 使用深蓝色标题
  395. margin: 0;
  396. }
  397. // 输入框样式
  398. .mat-input-element {
  399. color: $text-primary;
  400. font-size: 16px; // 增大输入框字体
  401. font-weight: 500;
  402. }
  403. .mat-form-field {
  404. width: 100%;
  405. transition: all 0.2s ease;
  406. }
  407. .mat-form-field-appearance-fill .mat-form-field-flex {
  408. background-color: $bg-primary; // 输入框白色背景
  409. border-radius: $border-radius;
  410. border: 1px solid $border-color;
  411. transition: all 0.2s ease;
  412. }
  413. .mat-form-field-appearance-fill .mat-form-field-outline {
  414. border: none;
  415. }
  416. .mat-form-field-appearance-fill .mat-form-field-underline {
  417. display: none;
  418. }
  419. // 输入框聚焦效果增强
  420. .mat-form-field-appearance-fill .mat-form-field-focus-overlay {
  421. background-color: rgba(30, 64, 175, 0.08);
  422. }
  423. .mat-form-field:focus-within .mat-form-field-flex {
  424. border-color: $primary-color;
  425. box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
  426. }
  427. // 选择框样式增强
  428. .mat-select {
  429. color: $text-primary;
  430. font-size: 16px;
  431. }
  432. .mat-select-panel {
  433. background-color: $bg-primary;
  434. border-radius: $border-radius;
  435. box-shadow: $shadow-lg;
  436. margin-top: 8px;
  437. border: 1px solid $border-color;
  438. animation: slideIn 0.2s ease-out;
  439. }
  440. .mat-option {
  441. color: $text-primary;
  442. padding: 12px 20px; // 增加选项间距
  443. font-size: 16px; // 增大选项字体
  444. font-weight: 500;
  445. transition: all 0.2s ease;
  446. border-radius: $border-radius;
  447. margin: 2px 8px;
  448. &:hover {
  449. background-color: rgba(30, 64, 175, 0.1);
  450. transform: translateX(4px); // 悬停时轻微移动
  451. }
  452. &.mat-selected {
  453. background-color: color-mix(in srgb, $primary-color 20%, transparent);
  454. color: $primary-color;
  455. font-weight: 600;
  456. }
  457. &:active {
  458. transform: scale(0.98);
  459. }
  460. }
  461. // 按钮样式优化
  462. button[mat-button] {
  463. color: $text-secondary;
  464. font-size: 16px; // 增大按钮字体
  465. font-weight: 600;
  466. padding: 10px 24px;
  467. transition: all 0.2s ease;
  468. border-radius: $border-radius;
  469. &:hover {
  470. color: $primary-color;
  471. background-color: rgba(30, 64, 175, 0.08);
  472. transform: translateY(-1px);
  473. }
  474. &:active {
  475. transform: translateY(0);
  476. }
  477. }
  478. button[mat-raised-button][color="primary"] {
  479. background-color: $primary-color;
  480. color: white;
  481. font-size: 16px; // 增大按钮字体
  482. font-weight: 600;
  483. border-radius: $border-radius;
  484. padding: 12px 32px;
  485. transition: all 0.2s ease;
  486. box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
  487. &:hover {
  488. background-color: $primary-light;
  489. transform: translateY(-2px);
  490. box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
  491. }
  492. &:active {
  493. transform: translateY(0);
  494. box-shadow: 0 4px 10px rgba(30, 64, 175, 0.3);
  495. }
  496. &:disabled {
  497. background-color: $text-tertiary;
  498. transform: none;
  499. box-shadow: none;
  500. }
  501. }
  502. // 日期选择器样式增强
  503. .mat-datepicker-toggle {
  504. color: $text-tertiary;
  505. transition: all 0.2s ease;
  506. &:hover {
  507. color: $primary-color;
  508. transform: scale(1.1);
  509. }
  510. }
  511. .mat-datepicker-content {
  512. border-radius: $border-radius;
  513. overflow: hidden;
  514. border: 1px solid $border-color;
  515. }
  516. // 表单标签样式增强
  517. label {
  518. color: $text-primary;
  519. font-weight: 600;
  520. font-size: 16px;
  521. margin-bottom: 8px;
  522. display: block;
  523. }
  524. // 必填标记样式
  525. .required-mark {
  526. color: $error-color;
  527. font-size: 16px;
  528. margin-left: 4px;
  529. }
  530. // 错误状态样式增强
  531. .mat-error {
  532. color: $error-color;
  533. font-size: 14px;
  534. margin-top: 6px;
  535. display: block;
  536. font-weight: 500;
  537. }
  538. .mat-form-field-invalid .mat-form-field-flex {
  539. border-color: $error-color;
  540. background-color: rgba(239, 68, 68, 0.05);
  541. }
  542. .mat-form-field-invalid .mat-input-element {
  543. color: $error-color;
  544. }
  545. }
  546. // 自定义通知消息样式
  547. .success-snackbar {
  548. background-color: $success-color;
  549. color: white;
  550. }
  551. .error-snackbar {
  552. background-color: $error-color;
  553. color: white;
  554. }
  555. // 动画定义
  556. @keyframes slideIn {
  557. from {
  558. opacity: 0;
  559. transform: translateY(-10px);
  560. }
  561. to {
  562. opacity: 1;
  563. transform: translateY(0);
  564. }
  565. }
  566. @keyframes pulse {
  567. 0%, 100% {
  568. opacity: 1;
  569. }
  570. 50% {
  571. opacity: 0.7;
  572. }
  573. }
  574. // 响应式设计
  575. @media (max-width: 1200px) {
  576. .assets-container {
  577. padding: 16px;
  578. }
  579. .action-bar {
  580. flex-direction: column;
  581. align-items: stretch;
  582. .search-filters {
  583. justify-content: space-between;
  584. }
  585. }
  586. }
  587. @media (max-width: 768px) {
  588. .assets-container {
  589. padding: 12px;
  590. }
  591. .page-header {
  592. text-align: center;
  593. }
  594. .action-bar {
  595. padding: 12px;
  596. .search-filters {
  597. flex-direction: column;
  598. align-items: stretch;
  599. .search-container,
  600. .filter-container,
  601. .filter-btn {
  602. width: 100%;
  603. min-width: auto;
  604. }
  605. }
  606. }
  607. .table-container {
  608. overflow-x: auto;
  609. }
  610. .pagination {
  611. flex-direction: column;
  612. gap: 12px;
  613. align-items: center;
  614. .mat-paginator {
  615. justify-content: center;
  616. }
  617. }
  618. }