dashboard.scss 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. // 全局变量定义
  2. $primary-color: #165DFF;
  3. $primary-dark: #0E42CB;
  4. $secondary-color: #4E5BA6;
  5. $success-color: #00B42A;
  6. $warning-color: #FF7D00;
  7. $danger-color: #F53F3F;
  8. $text-primary: #1D2129;
  9. $text-secondary: #4E5969;
  10. $text-tertiary: #86909C;
  11. $border-color: #E5E6EB;
  12. $background-primary: #FFFFFF;
  13. $background-secondary: #F2F3F5;
  14. $background-tertiary: #F7F8FA;
  15. $shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  16. $shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  17. $shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  18. $border-radius: 8px;
  19. $transition: all 0.3s ease;
  20. // 欢迎区域
  21. .welcome-section {
  22. margin-bottom: 24px;
  23. h2 {
  24. font-size: 24px;
  25. font-weight: 600;
  26. margin-bottom: 8px;
  27. color: $text-primary;
  28. }
  29. p {
  30. font-size: 14px;
  31. color: $text-secondary;
  32. }
  33. }
  34. // 数据看板
  35. .stats-dashboard {
  36. margin-bottom: 24px;
  37. .stats-grid {
  38. display: grid;
  39. grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  40. gap: 16px;
  41. }
  42. .stat-card {
  43. display: flex;
  44. align-items: center;
  45. gap: 16px;
  46. padding: 20px;
  47. background-color: $background-primary;
  48. border-radius: $border-radius;
  49. box-shadow: $shadow-sm;
  50. transition: $transition;
  51. &:hover {
  52. box-shadow: $shadow-md;
  53. transform: translateY(-2px);
  54. }
  55. .stat-icon {
  56. width: 48px;
  57. height: 48px;
  58. border-radius: 12px;
  59. display: flex;
  60. align-items: center;
  61. justify-content: center;
  62. color: white;
  63. &.primary {
  64. background-color: $primary-color;
  65. }
  66. &.secondary {
  67. background-color: $secondary-color;
  68. }
  69. &.warning {
  70. background-color: $warning-color;
  71. }
  72. &.success {
  73. background-color: $success-color;
  74. }
  75. }
  76. .stat-content {
  77. flex: 1;
  78. .stat-value {
  79. font-size: 28px;
  80. font-weight: 600;
  81. color: $text-primary;
  82. margin-bottom: 4px;
  83. }
  84. .stat-label {
  85. font-size: 14px;
  86. color: $text-secondary;
  87. }
  88. }
  89. .stat-trend {
  90. padding: 4px 10px;
  91. border-radius: 12px;
  92. font-size: 12px;
  93. font-weight: 500;
  94. &.positive {
  95. background-color: color-mix(in srgb, $success-color 10%, transparent);
  96. color: $success-color;
  97. }
  98. &.negative {
  99. background-color: color-mix(in srgb, $danger-color 10%, transparent);
  100. color: $danger-color;
  101. }
  102. &.neutral {
  103. background-color: color-mix(in srgb, $text-tertiary 10%, transparent);
  104. color: $text-tertiary;
  105. }
  106. }
  107. }
  108. }
  109. // 内容网格
  110. .content-grid {
  111. display: grid;
  112. grid-template-columns: 1fr 1fr;
  113. gap: 24px;
  114. margin-bottom: 24px;
  115. }
  116. // 通用区块头部
  117. .section-header {
  118. display: flex;
  119. align-items: center;
  120. justify-content: space-between;
  121. margin-bottom: 16px;
  122. h3 {
  123. font-size: 18px;
  124. font-weight: 600;
  125. color: $text-primary;
  126. }
  127. .view-all-link {
  128. color: $primary-color;
  129. text-decoration: none;
  130. font-size: 14px;
  131. transition: $transition;
  132. &:hover {
  133. text-decoration: underline;
  134. }
  135. }
  136. .search-box {
  137. max-width: 200px;
  138. .search-input {
  139. width: 100%;
  140. padding: 6px 12px;
  141. border: 1px solid $border-color;
  142. border-radius: $border-radius;
  143. font-size: 14px;
  144. background-color: $background-primary;
  145. color: $text-primary;
  146. &::placeholder {
  147. color: $text-tertiary;
  148. }
  149. &:focus {
  150. outline: none;
  151. border-color: $primary-color;
  152. box-shadow: 0 0 0 2px color-mix(in srgb, $primary-color 20%, transparent);
  153. }
  154. }
  155. }
  156. }
  157. // 紧急待办列表
  158. .urgent-tasks-section {
  159. background-color: $background-primary;
  160. border-radius: $border-radius;
  161. padding: 24px;
  162. box-shadow: $shadow-sm;
  163. .tasks-list {
  164. display: flex;
  165. flex-direction: column;
  166. gap: 12px;
  167. }
  168. .empty-state {
  169. text-align: center;
  170. padding: 40px 20px;
  171. color: $text-tertiary;
  172. svg {
  173. margin-bottom: 16px;
  174. opacity: 0.5;
  175. }
  176. p {
  177. font-size: 14px;
  178. }
  179. }
  180. .task-item {
  181. display: flex;
  182. align-items: flex-start;
  183. gap: 12px;
  184. padding: 16px;
  185. border: 1px solid $border-color;
  186. border-radius: $border-radius;
  187. transition: $transition;
  188. &:hover {
  189. border-color: $primary-color;
  190. box-shadow: 0 2px 8px color-mix(in srgb, $primary-color 10%, transparent);
  191. }
  192. &.completed {
  193. opacity: 0.6;
  194. background-color: $background-tertiary;
  195. }
  196. &.overdue {
  197. border-color: $danger-color;
  198. background-color: color-mix(in srgb, $danger-color 5%, transparent);
  199. }
  200. .task-checkbox {
  201. margin-top: 2px;
  202. input[type="checkbox"] {
  203. width: 18px;
  204. height: 18px;
  205. cursor: pointer;
  206. }
  207. }
  208. .task-content {
  209. flex: 1;
  210. .task-title {
  211. font-size: 16px;
  212. font-weight: 500;
  213. color: $text-primary;
  214. margin-bottom: 4px;
  215. }
  216. .task-project {
  217. font-size: 13px;
  218. color: $text-secondary;
  219. margin-bottom: 8px;
  220. }
  221. .task-meta {
  222. display: flex;
  223. gap: 16px;
  224. font-size: 12px;
  225. color: $text-tertiary;
  226. }
  227. }
  228. .task-actions {
  229. display: flex;
  230. align-items: flex-start;
  231. }
  232. }
  233. }
  234. // 项目动态流
  235. .project-updates-section {
  236. background-color: $background-primary;
  237. border-radius: $border-radius;
  238. padding: 24px;
  239. box-shadow: $shadow-sm;
  240. .updates-list {
  241. display: flex;
  242. flex-direction: column;
  243. gap: 16px;
  244. }
  245. .empty-state {
  246. text-align: center;
  247. padding: 40px 20px;
  248. color: $text-tertiary;
  249. svg {
  250. margin-bottom: 16px;
  251. opacity: 0.5;
  252. }
  253. p {
  254. font-size: 14px;
  255. }
  256. }
  257. .update-item {
  258. display: flex;
  259. gap: 12px;
  260. padding: 16px;
  261. border: 1px solid $border-color;
  262. border-radius: $border-radius;
  263. transition: $transition;
  264. &:hover {
  265. border-color: $primary-color;
  266. box-shadow: 0 2px 8px color-mix(in srgb, $primary-color 10%, transparent);
  267. }
  268. .update-icon {
  269. width: 40px;
  270. height: 40px;
  271. border-radius: 10px;
  272. background-color: color-mix(in srgb, $primary-color 10%, transparent);
  273. display: flex;
  274. align-items: center;
  275. justify-content: center;
  276. color: $primary-color;
  277. flex-shrink: 0;
  278. }
  279. .update-content {
  280. flex: 1;
  281. .update-title {
  282. font-size: 15px;
  283. font-weight: 500;
  284. color: $text-primary;
  285. margin-bottom: 4px;
  286. }
  287. .update-text {
  288. font-size: 14px;
  289. color: $text-secondary;
  290. margin-bottom: 8px;
  291. line-height: 1.5;
  292. }
  293. .update-meta {
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. .update-time {
  298. font-size: 12px;
  299. color: $text-tertiary;
  300. }
  301. .update-status {
  302. font-size: 12px;
  303. font-weight: 500;
  304. padding: 2px 8px;
  305. border-radius: 10px;
  306. &.completed {
  307. background-color: color-mix(in srgb, $success-color 10%, transparent);
  308. color: $success-color;
  309. }
  310. &.pending {
  311. background-color: color-mix(in srgb, $primary-color 10%, transparent);
  312. color: $primary-color;
  313. }
  314. &.exception {
  315. background-color: color-mix(in srgb, $danger-color 10%, transparent);
  316. color: $danger-color;
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. // 按钮样式
  324. .btn-primary {
  325. padding: 8px 16px;
  326. background-color: $primary-color;
  327. color: white;
  328. border: none;
  329. border-radius: $border-radius;
  330. font-size: 14px;
  331. font-weight: 500;
  332. cursor: pointer;
  333. transition: $transition;
  334. &:hover {
  335. background-color: $primary-dark;
  336. transform: translateY(-1px);
  337. box-shadow: $shadow-md;
  338. }
  339. &:active {
  340. transform: translateY(0);
  341. }
  342. &:disabled {
  343. background-color: $text-tertiary;
  344. cursor: not-allowed;
  345. transform: none;
  346. box-shadow: none;
  347. }
  348. }
  349. // 回到顶部按钮
  350. .back-to-top {
  351. position: fixed;
  352. bottom: 20px;
  353. right: 20px;
  354. width: 40px;
  355. height: 40px;
  356. border-radius: 50%;
  357. background-color: #1976d2;
  358. color: white;
  359. display: flex;
  360. align-items: center;
  361. justify-content: center;
  362. cursor: pointer;
  363. opacity: 0;
  364. visibility: hidden;
  365. transition: opacity 0.3s, visibility 0.3s;
  366. border: none;
  367. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  368. }
  369. .back-to-top.visible {
  370. opacity: 1;
  371. visibility: visible;
  372. }
  373. .back-to-top:hover {
  374. background-color: #1565c0;
  375. }
  376. // 响应式设计
  377. @media (max-width: 1024px) {
  378. .content-grid {
  379. grid-template-columns: 1fr;
  380. }
  381. .stats-dashboard .stats-grid {
  382. grid-template-columns: repeat(2, 1fr);
  383. }
  384. }
  385. @media (max-width: 768px) {
  386. .welcome-section {
  387. margin-bottom: 16px;
  388. h2 {
  389. font-size: 20px;
  390. }
  391. }
  392. .stats-dashboard {
  393. margin-bottom: 16px;
  394. .stats-grid {
  395. grid-template-columns: 1fr;
  396. gap: 12px;
  397. }
  398. .stat-card {
  399. padding: 16px;
  400. .stat-icon {
  401. width: 40px;
  402. height: 40px;
  403. }
  404. .stat-value {
  405. font-size: 24px;
  406. }
  407. }
  408. }
  409. .content-grid {
  410. gap: 16px;
  411. margin-bottom: 16px;
  412. }
  413. .section-header {
  414. flex-direction: column;
  415. align-items: flex-start;
  416. gap: 12px;
  417. h3 {
  418. font-size: 16px;
  419. }
  420. .search-box {
  421. max-width: 100%;
  422. width: 100%;
  423. }
  424. }
  425. .urgent-tasks-section,
  426. .project-updates-section {
  427. padding: 16px;
  428. }
  429. .task-item,
  430. .update-item {
  431. padding: 12px;
  432. }
  433. .back-to-top {
  434. bottom: 16px;
  435. right: 16px;
  436. width: 36px;
  437. height: 36px;
  438. }
  439. }
  440. @media (max-width: 480px) {
  441. .task-item {
  442. flex-direction: column;
  443. align-items: flex-start;
  444. .task-actions {
  445. margin-top: 12px;
  446. align-self: flex-end;
  447. }
  448. }
  449. .update-item {
  450. .update-icon {
  451. width: 32px;
  452. height: 32px;
  453. }
  454. }
  455. }