hr-common.scss 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. /* HR板块统一样式文件 */
  2. /* 主题色彩变量 */
  3. $hr-primary: #1e40af;
  4. $hr-primary-light: #3b82f6;
  5. $hr-secondary: #0d9488;
  6. $hr-success: #10b981;
  7. $hr-warning: #f59e0b;
  8. $hr-error: #ef4444;
  9. $hr-info: #3b82f6;
  10. $hr-text-primary: #1f2937;
  11. $hr-text-secondary: #4b5563;
  12. $hr-text-tertiary: #9ca3af;
  13. $hr-bg-primary: #ffffff;
  14. $hr-bg-secondary: #f9fafb;
  15. $hr-bg-tertiary: #f3f4f6;
  16. $hr-border: #e5e7eb;
  17. /* 统一卡片样式 */
  18. .hr-card {
  19. background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  20. border: 1px solid rgba(226, 232, 240, 0.8);
  21. border-radius: 12px;
  22. box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  23. transition: all 0.3s ease;
  24. overflow: hidden;
  25. &:hover {
  26. box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  27. transform: translateY(-2px);
  28. }
  29. .hr-card-header {
  30. background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  31. padding: 16px 20px;
  32. border-bottom: 1px solid $hr-border;
  33. .hr-card-title {
  34. display: flex;
  35. align-items: center;
  36. gap: 12px;
  37. margin: 0;
  38. font-size: 18px;
  39. font-weight: 600;
  40. color: $hr-text-primary;
  41. mat-icon {
  42. background: linear-gradient(135deg, #e6f7ff 0%, #f3e8ff 100%);
  43. color: $hr-primary;
  44. padding: 8px;
  45. border-radius: 50%;
  46. font-size: 20px;
  47. width: 36px;
  48. height: 36px;
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. }
  53. }
  54. }
  55. .hr-card-content {
  56. padding: 20px;
  57. }
  58. }
  59. /* 统一表格样式 */
  60. .hr-table {
  61. width: 100%;
  62. background: white;
  63. border-radius: 8px;
  64. overflow: hidden;
  65. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  66. .mat-header-cell {
  67. background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  68. color: $hr-text-primary;
  69. font-weight: 600;
  70. font-size: 14px;
  71. border-bottom: 2px solid $hr-border;
  72. padding: 16px 12px;
  73. }
  74. .mat-cell {
  75. padding: 16px 12px;
  76. font-size: 14px;
  77. border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  78. &:last-child {
  79. text-align: center;
  80. }
  81. }
  82. .mat-row {
  83. transition: all 0.2s ease;
  84. &:hover {
  85. background-color: rgba(59, 130, 246, 0.05);
  86. }
  87. &:last-child .mat-cell {
  88. border-bottom: none;
  89. }
  90. }
  91. .no-data {
  92. text-align: center;
  93. color: $hr-text-tertiary;
  94. font-style: italic;
  95. padding: 40px 20px;
  96. }
  97. }
  98. /* 统一按钮样式 */
  99. .hr-btn {
  100. border-radius: 8px;
  101. font-weight: 500;
  102. transition: all 0.3s ease;
  103. &.hr-btn-primary {
  104. background: linear-gradient(135deg, $hr-primary 0%, $hr-primary-light 100%);
  105. color: white;
  106. border: none;
  107. &:hover {
  108. transform: translateY(-1px);
  109. box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
  110. }
  111. }
  112. &.hr-btn-secondary {
  113. background: linear-gradient(135deg, $hr-secondary 0%, #14b8a6 100%);
  114. color: white;
  115. border: none;
  116. &:hover {
  117. transform: translateY(-1px);
  118. box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  119. }
  120. }
  121. &.hr-btn-outline {
  122. background: transparent;
  123. border: 2px solid $hr-primary;
  124. color: $hr-primary;
  125. &:hover {
  126. background: $hr-primary;
  127. color: white;
  128. transform: translateY(-1px);
  129. }
  130. }
  131. &.hr-btn-icon {
  132. display: flex;
  133. align-items: center;
  134. gap: 8px;
  135. mat-icon {
  136. font-size: 18px !important;
  137. width: 18px !important;
  138. height: 18px !important;
  139. line-height: 18px !important;
  140. }
  141. }
  142. }
  143. /* 统一状态徽章样式 */
  144. .hr-badge {
  145. padding: 4px 12px;
  146. border-radius: 20px;
  147. font-size: 12px;
  148. font-weight: 500;
  149. text-align: center;
  150. display: inline-block;
  151. &.hr-badge-success {
  152. background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
  153. color: $hr-success;
  154. border: 1px solid rgba(16, 185, 129, 0.3);
  155. }
  156. &.hr-badge-warning {
  157. background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.2));
  158. color: $hr-warning;
  159. border: 1px solid rgba(245, 158, 11, 0.3);
  160. }
  161. &.hr-badge-error {
  162. background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
  163. color: $hr-error;
  164. border: 1px solid rgba(239, 68, 68, 0.3);
  165. }
  166. &.hr-badge-info {
  167. background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
  168. color: $hr-info;
  169. border: 1px solid rgba(59, 130, 246, 0.3);
  170. }
  171. }
  172. /* 统一表单样式 */
  173. .hr-form {
  174. .mat-form-field {
  175. width: 100%;
  176. margin-bottom: 16px;
  177. .mat-form-field-outline {
  178. border-radius: 8px;
  179. }
  180. &.mat-focused .mat-form-field-outline-thick {
  181. border-color: $hr-primary;
  182. }
  183. }
  184. .form-row {
  185. display: grid;
  186. grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  187. gap: 16px;
  188. margin-bottom: 16px;
  189. }
  190. .form-actions {
  191. display: flex;
  192. justify-content: flex-end;
  193. gap: 12px;
  194. margin-top: 24px;
  195. padding-top: 16px;
  196. border-top: 1px solid $hr-border;
  197. }
  198. }
  199. /* 统一进度条样式 */
  200. .hr-progress {
  201. height: 8px;
  202. border-radius: 4px;
  203. overflow: hidden;
  204. background-color: rgba(226, 232, 240, 0.5);
  205. .progress-fill {
  206. height: 100%;
  207. border-radius: 4px;
  208. transition: width 0.6s ease;
  209. &.hr-progress-primary {
  210. background: linear-gradient(90deg, $hr-primary, $hr-primary-light);
  211. }
  212. &.hr-progress-success {
  213. background: linear-gradient(90deg, $hr-success, #34d399);
  214. }
  215. &.hr-progress-warning {
  216. background: linear-gradient(90deg, $hr-warning, #fbbf24);
  217. }
  218. &.hr-progress-error {
  219. background: linear-gradient(90deg, $hr-error, #f87171);
  220. }
  221. }
  222. }
  223. /* 统一统计卡片样式 */
  224. .hr-stat-card {
  225. background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  226. border: 1px solid rgba(226, 232, 240, 0.8);
  227. border-radius: 12px;
  228. padding: 20px;
  229. text-align: center;
  230. transition: all 0.3s ease;
  231. position: relative;
  232. overflow: hidden;
  233. &::before {
  234. content: '';
  235. position: absolute;
  236. top: 0;
  237. left: 0;
  238. right: 0;
  239. height: 4px;
  240. background: linear-gradient(90deg, $hr-primary, $hr-secondary);
  241. }
  242. &:hover {
  243. transform: translateY(-4px);
  244. box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
  245. }
  246. &.hr-stat-warning::before {
  247. background: linear-gradient(90deg, $hr-warning, #fbbf24);
  248. }
  249. &.hr-stat-error::before {
  250. background: linear-gradient(90deg, $hr-error, #f87171);
  251. }
  252. &.hr-stat-info::before {
  253. background: linear-gradient(90deg, $hr-info, #60a5fa);
  254. }
  255. &.hr-stat-success::before {
  256. background: linear-gradient(90deg, $hr-success, #34d399);
  257. }
  258. .stat-value {
  259. font-size: 28px;
  260. font-weight: 700;
  261. margin-bottom: 8px;
  262. background: linear-gradient(135deg, $hr-text-primary, $hr-text-secondary);
  263. -webkit-background-clip: text;
  264. -webkit-text-fill-color: transparent;
  265. background-clip: text;
  266. }
  267. .stat-label {
  268. font-size: 14px;
  269. color: $hr-text-secondary;
  270. font-weight: 500;
  271. margin-bottom: 4px;
  272. }
  273. .stat-sub {
  274. font-size: 12px;
  275. color: $hr-text-tertiary;
  276. font-weight: 400;
  277. }
  278. }
  279. /* 统一Material图标修复 */
  280. mat-icon {
  281. font-family: 'Material Icons' !important;
  282. font-feature-settings: 'liga' 1;
  283. -webkit-font-feature-settings: 'liga';
  284. -moz-font-feature-settings: 'liga';
  285. font-variant-ligatures: common-ligatures;
  286. text-rendering: optimizeLegibility;
  287. -webkit-font-smoothing: antialiased;
  288. -moz-osx-font-smoothing: grayscale;
  289. font-size: inherit;
  290. line-height: inherit;
  291. vertical-align: middle;
  292. &::before {
  293. content: none !important;
  294. }
  295. }
  296. /* 响应式设计 */
  297. @media (max-width: 768px) {
  298. .hr-card {
  299. margin: 0 8px;
  300. border-radius: 8px;
  301. }
  302. .hr-table {
  303. font-size: 12px;
  304. .mat-header-cell,
  305. .mat-cell {
  306. padding: 8px 6px;
  307. }
  308. }
  309. .hr-form .form-row {
  310. grid-template-columns: 1fr;
  311. }
  312. .hr-stat-card {
  313. .stat-value {
  314. font-size: 24px;
  315. }
  316. }
  317. }
  318. /* 动画效果 */
  319. @keyframes fadeIn {
  320. from {
  321. opacity: 0;
  322. transform: translateY(20px);
  323. }
  324. to {
  325. opacity: 1;
  326. transform: translateY(0);
  327. }
  328. }
  329. @keyframes slideInUp {
  330. from {
  331. opacity: 0;
  332. transform: translateY(30px);
  333. }
  334. to {
  335. opacity: 1;
  336. transform: translateY(0);
  337. }
  338. }
  339. .hr-fade-in {
  340. animation: fadeIn 0.3s ease-in-out;
  341. }
  342. .hr-slide-in-up {
  343. animation: slideInUp 0.3s ease-out;
  344. }