designer-calendar.component.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. .designer-calendar-overlay {
  2. position: fixed;
  3. top: 0;
  4. left: 0;
  5. right: 0;
  6. bottom: 0;
  7. background: rgba(0, 0, 0, 0.5);
  8. display: flex;
  9. align-items: center;
  10. justify-content: center;
  11. z-index: 1000;
  12. backdrop-filter: blur(4px);
  13. }
  14. .designer-calendar-modal {
  15. background: white;
  16. border-radius: 16px;
  17. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  18. max-width: 800px;
  19. width: 90vw;
  20. max-height: 90vh;
  21. overflow-y: auto;
  22. animation: modalSlideIn 0.3s ease-out;
  23. }
  24. @keyframes modalSlideIn {
  25. from {
  26. opacity: 0;
  27. transform: translateY(-20px) scale(0.95);
  28. }
  29. to {
  30. opacity: 1;
  31. transform: translateY(0) scale(1);
  32. }
  33. }
  34. .modal-header {
  35. display: flex;
  36. justify-content: space-between;
  37. align-items: center;
  38. padding: 24px 24px 16px;
  39. border-bottom: 1px solid #f0f0f0;
  40. h3 {
  41. margin: 0;
  42. font-size: 20px;
  43. font-weight: 600;
  44. color: #2c3e50;
  45. }
  46. .close-btn {
  47. background: none;
  48. border: none;
  49. font-size: 24px;
  50. color: #95a5a6;
  51. cursor: pointer;
  52. padding: 4px;
  53. border-radius: 4px;
  54. transition: all 0.2s ease;
  55. &:hover {
  56. background: #f8f9fa;
  57. color: #e74c3c;
  58. }
  59. }
  60. }
  61. .designer-stats {
  62. padding: 20px 24px;
  63. background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  64. border-bottom: 1px solid #dee2e6;
  65. .stats-grid {
  66. display: grid;
  67. grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  68. gap: 16px;
  69. margin-bottom: 20px;
  70. }
  71. .stat-item {
  72. display: flex;
  73. flex-direction: column;
  74. align-items: center;
  75. padding: 12px;
  76. background: white;
  77. border-radius: 8px;
  78. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  79. .stat-label {
  80. font-size: 12px;
  81. color: #6c757d;
  82. margin-bottom: 4px;
  83. }
  84. .stat-value {
  85. font-size: 18px;
  86. font-weight: 600;
  87. color: #2c3e50;
  88. &.warning {
  89. color: #e74c3c;
  90. }
  91. }
  92. }
  93. .workload-indicator {
  94. display: flex;
  95. align-items: center;
  96. gap: 12px;
  97. padding: 12px;
  98. background: white;
  99. border-radius: 8px;
  100. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  101. .workload-label {
  102. font-size: 14px;
  103. color: #6c757d;
  104. min-width: 60px;
  105. }
  106. .workload-bar {
  107. flex: 1;
  108. height: 8px;
  109. background: #e9ecef;
  110. border-radius: 4px;
  111. overflow: hidden;
  112. .workload-fill {
  113. height: 100%;
  114. border-radius: 4px;
  115. transition: width 0.3s ease;
  116. &.low {
  117. background: linear-gradient(90deg, #28a745, #20c997);
  118. }
  119. &.medium {
  120. background: linear-gradient(90deg, #ffc107, #fd7e14);
  121. }
  122. &.high {
  123. background: linear-gradient(90deg, #dc3545, #e74c3c);
  124. }
  125. }
  126. }
  127. .workload-percentage {
  128. font-size: 14px;
  129. font-weight: 600;
  130. color: #495057;
  131. min-width: 40px;
  132. text-align: right;
  133. }
  134. }
  135. }
  136. .calendar-nav {
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. padding: 16px 24px;
  141. border-bottom: 1px solid #f0f0f0;
  142. .nav-btn {
  143. background: #f8f9fa;
  144. border: 1px solid #dee2e6;
  145. border-radius: 6px;
  146. width: 36px;
  147. height: 36px;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. cursor: pointer;
  152. transition: all 0.2s ease;
  153. font-size: 18px;
  154. color: #495057;
  155. &:hover {
  156. background: #e9ecef;
  157. border-color: #adb5bd;
  158. }
  159. }
  160. .month-title {
  161. margin: 0;
  162. font-size: 18px;
  163. font-weight: 600;
  164. color: #2c3e50;
  165. }
  166. }
  167. .designer-calendar-modal {
  168. // 调整最大宽度,避免内容过窄导致日历看不全
  169. max-width: 1000px;
  170. width: 95vw;
  171. }
  172. .designer-stats {
  173. padding: 20px 24px;
  174. background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  175. border-bottom: 1px solid #dee2e6;
  176. .stats-grid {
  177. display: grid;
  178. grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  179. gap: 16px;
  180. margin-bottom: 20px;
  181. }
  182. .stat-item {
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. padding: 12px;
  187. background: white;
  188. border-radius: 8px;
  189. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  190. .stat-label {
  191. font-size: 12px;
  192. color: #6c757d;
  193. margin-bottom: 4px;
  194. }
  195. .stat-value {
  196. font-size: 18px;
  197. font-weight: 600;
  198. color: #2c3e50;
  199. &.warning {
  200. color: #e74c3c;
  201. }
  202. }
  203. }
  204. .workload-indicator {
  205. display: flex;
  206. align-items: center;
  207. gap: 12px;
  208. padding: 12px;
  209. background: white;
  210. border-radius: 8px;
  211. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  212. margin-bottom: 16px;
  213. .workload-label {
  214. font-size: 14px;
  215. color: #6c757d;
  216. min-width: 60px;
  217. }
  218. .workload-bar {
  219. flex: 1;
  220. height: 8px;
  221. background: #e9ecef;
  222. border-radius: 4px;
  223. overflow: hidden;
  224. .workload-fill {
  225. height: 100%;
  226. border-radius: 4px;
  227. transition: width 0.3s ease;
  228. &.low {
  229. background: linear-gradient(90deg, #28a745, #20c997);
  230. }
  231. &.medium {
  232. background: linear-gradient(90deg, #ffc107, #fd7e14);
  233. }
  234. &.high {
  235. background: linear-gradient(90deg, #dc3545, #e74c3c);
  236. }
  237. }
  238. }
  239. .workload-percentage {
  240. font-size: 14px;
  241. font-weight: 600;
  242. color: #495057;
  243. min-width: 40px;
  244. text-align: right;
  245. }
  246. }
  247. .designer-status {
  248. display: flex;
  249. align-items: center;
  250. justify-content: center;
  251. gap: 16px;
  252. padding: 12px;
  253. background: white;
  254. border-radius: 8px;
  255. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  256. .status-badge {
  257. padding: 6px 16px;
  258. border-radius: 20px;
  259. color: white;
  260. font-size: 14px;
  261. font-weight: 600;
  262. }
  263. .last-order {
  264. font-size: 12px;
  265. color: #6c757d;
  266. }
  267. }
  268. }
  269. .calendar-container {
  270. // 当屏幕较窄时允许水平滚动,确保完整查看7列
  271. padding: 0 24px 20px;
  272. overflow-x: auto;
  273. }
  274. .calendar-header {
  275. display: grid;
  276. // 使用 minmax 保证每列有最低宽度,减少像素舍入造成的对不齐
  277. grid-template-columns: repeat(7, minmax(120px, 1fr));
  278. gap: 1px;
  279. margin-bottom: 8px;
  280. .weekday {
  281. box-sizing: border-box;
  282. padding: 12px 4px;
  283. text-align: center;
  284. font-size: 14px;
  285. font-weight: 600;
  286. color: #6c757d;
  287. background: #f8f9fa;
  288. }
  289. }
  290. .calendar-grid {
  291. display: grid;
  292. // 与 header 保持一致,保证列宽一致
  293. grid-template-columns: repeat(7, minmax(120px, 1fr));
  294. gap: 1px;
  295. background: #dee2e6;
  296. border-radius: 8px;
  297. overflow: hidden;
  298. // 统一行高,避免内容挤压导致错位
  299. grid-auto-rows: 100px;
  300. }
  301. .calendar-day {
  302. box-sizing: border-box;
  303. background: white;
  304. min-height: 100px;
  305. padding: 8px;
  306. display: flex;
  307. flex-direction: column;
  308. align-items: center;
  309. justify-content: flex-start;
  310. cursor: pointer;
  311. transition: all 0.3s ease;
  312. position: relative;
  313. border-radius: 8px;
  314. border: 2px solid transparent;
  315. .day-number {
  316. font-size: 16px;
  317. font-weight: 600;
  318. margin-bottom: 6px;
  319. z-index: 2;
  320. color: #2c3e50;
  321. }
  322. .day-status-text {
  323. flex: 1;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. width: 100%;
  328. margin-bottom: 4px;
  329. .status-label {
  330. font-size: 12px;
  331. font-weight: 500;
  332. padding: 2px 8px;
  333. border-radius: 12px;
  334. color: white;
  335. gap: 4px;
  336. padding: 4px;
  337. border-radius: 6px;
  338. font-size: 10px;
  339. font-weight: 500;
  340. mat-icon {
  341. font-size: 16px;
  342. width: 16px;
  343. height: 16px;
  344. }
  345. &.idle {
  346. background: rgba(76, 175, 80, 0.1);
  347. color: #2e7d32;
  348. mat-icon {
  349. color: #4caf50;
  350. }
  351. }
  352. &.busy {
  353. background: rgba(33, 150, 243, 0.1);
  354. color: #1565c0;
  355. mat-icon {
  356. color: #2196f3;
  357. }
  358. }
  359. &.review {
  360. background: rgba(244, 67, 54, 0.1);
  361. color: #c62828;
  362. mat-icon {
  363. color: #f44336;
  364. }
  365. }
  366. }
  367. }
  368. .workload-indicator-bar {
  369. position: absolute;
  370. bottom: 4px;
  371. left: 8px;
  372. right: 8px;
  373. height: 4px;
  374. background: rgba(0, 0, 0, 0.1);
  375. border-radius: 3px;
  376. overflow: hidden;
  377. .workload-fill {
  378. height: 100%;
  379. border-radius: 3px;
  380. transition: width 0.3s ease;
  381. &.medium-fill {
  382. background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
  383. }
  384. &.high-fill {
  385. background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
  386. }
  387. &.review-fill {
  388. background: linear-gradient(90deg, #dc3545 0%, #b02a37 100%);
  389. }
  390. }
  391. }
  392. // 保留旧样式兼容
  393. .workload-bar-mini {
  394. position: absolute;
  395. bottom: 4px;
  396. left: 8px;
  397. right: 8px;
  398. height: 4px;
  399. background: rgba(0, 0, 0, 0.1);
  400. border-radius: 3px;
  401. overflow: hidden;
  402. .workload-fill-mini {
  403. height: 100%;
  404. border-radius: 3px;
  405. transition: width 0.3s ease;
  406. &.medium {
  407. background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
  408. }
  409. &.high {
  410. background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
  411. }
  412. &.review {
  413. background: linear-gradient(90deg, #dc3545 0%, #b02a37 100%);
  414. }
  415. }
  416. }
  417. &.other-month {
  418. color: #adb5bd;
  419. background: #f8f9fa;
  420. opacity: 0.6;
  421. .day-status {
  422. opacity: 0.5;
  423. }
  424. }
  425. &.weekend {
  426. background: #fff5f5;
  427. }
  428. &.today {
  429. border: 3px solid #ff6b35 !important;
  430. box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
  431. .day-number {
  432. color: #ff6b35;
  433. font-weight: 700;
  434. }
  435. }
  436. // 使用 data-status 属性进行样式控制
  437. &[data-status="idle"] {
  438. background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  439. border: 2px solid #28a745;
  440. &:hover {
  441. background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
  442. transform: scale(1.05);
  443. box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  444. }
  445. .day-number {
  446. color: #155724;
  447. font-weight: 700;
  448. }
  449. .status-label.idle-label {
  450. background: #28a745;
  451. color: white;
  452. }
  453. }
  454. &[data-status="busy-medium"] {
  455. background: linear-gradient(135deg, #cfe2ff 0%, #b6d4fe 100%);
  456. border: 2px solid #0d6efd;
  457. .day-number {
  458. color: #084298;
  459. font-weight: 700;
  460. }
  461. .status-label.busy-label {
  462. background: #0d6efd;
  463. color: white;
  464. }
  465. &:hover {
  466. background: linear-gradient(135deg, #b6d4fe 0%, #9ec5fe 100%);
  467. transform: scale(1.05);
  468. box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
  469. }
  470. }
  471. &[data-status="busy-high"] {
  472. background: linear-gradient(135deg, #9ec5fe 0%, #6ea8fe 100%);
  473. border: 2px solid #0a58ca;
  474. .day-number {
  475. color: #052c65;
  476. font-weight: 700;
  477. }
  478. .status-label.busy-label {
  479. background: #0a58ca;
  480. color: white;
  481. }
  482. &:hover {
  483. background: linear-gradient(135deg, #6ea8fe 0%, #3d8bfd 100%);
  484. transform: scale(1.05);
  485. box-shadow: 0 6px 20px rgba(10, 88, 202, 0.5);
  486. }
  487. }
  488. &[data-status="review"] {
  489. background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  490. border: 2px solid #dc3545;
  491. cursor: not-allowed;
  492. .day-number {
  493. color: #842029;
  494. font-weight: 700;
  495. }
  496. .status-label.review-label {
  497. background: #dc3545;
  498. color: white;
  499. }
  500. &:hover {
  501. transform: none;
  502. box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  503. }
  504. }
  505. // 保留旧的类名兼容性
  506. &.idle {
  507. background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  508. border: 2px solid #28a745;
  509. &:hover {
  510. background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
  511. transform: scale(1.05);
  512. box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  513. }
  514. .day-number {
  515. color: #155724;
  516. }
  517. }
  518. &.busy {
  519. background: linear-gradient(135deg, #cfe2ff 0%, #b6d4fe 100%);
  520. border: 2px solid #0d6efd;
  521. .day-number {
  522. color: #084298;
  523. }
  524. &:hover {
  525. background: linear-gradient(135deg, #b6d4fe 0%, #9ec5fe 100%);
  526. transform: scale(1.05);
  527. box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
  528. }
  529. }
  530. &.review {
  531. background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  532. border: 2px solid #dc3545;
  533. cursor: not-allowed;
  534. .day-number {
  535. color: #842029;
  536. }
  537. &:hover {
  538. transform: none;
  539. box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  540. }
  541. }
  542. &.stagnant {
  543. background: #fff3e0;
  544. border: 1px solid #ff9800;
  545. .day-number {
  546. color: #ef6c00;
  547. }
  548. }
  549. }
  550. // 响应式设计
  551. @media (max-width: 768px) {
  552. .designer-calendar-modal {
  553. width: 95vw;
  554. margin: 10px;
  555. }
  556. .designer-stats {
  557. .stats-grid {
  558. grid-template-columns: repeat(2, 1fr);
  559. gap: 12px;
  560. }
  561. .workload-indicator {
  562. flex-direction: column;
  563. align-items: stretch;
  564. gap: 8px;
  565. .workload-label {
  566. min-width: auto;
  567. text-align: center;
  568. }
  569. }
  570. }
  571. .calendar-legend {
  572. flex-wrap: wrap;
  573. gap: 12px;
  574. }
  575. .calendar-day {
  576. min-height: 70px;
  577. padding: 6px;
  578. .day-number {
  579. font-size: 12px;
  580. }
  581. .day-indicators {
  582. .order-count,
  583. .review-indicator {
  584. font-size: 9px;
  585. padding: 1px 3px;
  586. }
  587. }
  588. }
  589. }
  590. .calendar-legend {
  591. display: flex;
  592. justify-content: center;
  593. gap: 20px;
  594. padding: 16px 24px;
  595. border-top: 1px solid #f0f0f0;
  596. background: #f8f9fa;
  597. .legend-item {
  598. display: flex;
  599. align-items: center;
  600. gap: 6px;
  601. .legend-color {
  602. width: 20px;
  603. height: 20px;
  604. border-radius: 4px;
  605. border: 1px solid rgba(0, 0, 0, 0.1);
  606. &.idle-color {
  607. background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  608. border: 2px solid #28a745;
  609. }
  610. &.busy-color {
  611. background: linear-gradient(135deg, #cfe2ff 0%, #b6d4fe 100%);
  612. border: 2px solid #0d6efd;
  613. }
  614. &.review-color {
  615. background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  616. border: 2px solid #dc3545;
  617. }
  618. &.today-color {
  619. background: white;
  620. border: 3px solid #ff6b35;
  621. }
  622. // 保留旧样式兼容
  623. &.idle {
  624. background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  625. border: 2px solid #28a745;
  626. }
  627. &.busy {
  628. background: linear-gradient(135deg, #cfe2ff 0%, #b6d4fe 100%);
  629. border: 2px solid #0d6efd;
  630. }
  631. &.review {
  632. background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  633. border: 2px solid #dc3545;
  634. }
  635. &.today {
  636. background: white;
  637. border: 3px solid #ff6b35;
  638. }
  639. }
  640. .legend-text {
  641. font-size: 12px;
  642. color: #6c757d;
  643. }
  644. }
  645. }
  646. .calendar-tips {
  647. padding: 16px 24px;
  648. background: #f8f9fa;
  649. border-top: 1px solid #dee2e6;
  650. p {
  651. margin: 0 0 8px;
  652. font-size: 14px;
  653. color: #495057;
  654. }
  655. ul {
  656. margin: 0;
  657. padding-left: 20px;
  658. font-size: 13px;
  659. color: #6c757d;
  660. line-height: 1.5;
  661. li {
  662. margin-bottom: 4px;
  663. }
  664. }
  665. }