factory-overview.css 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /* factory-overview.css */
  2. :host {
  3. display: block;
  4. width: 100%;
  5. padding: 15px;
  6. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  7. }
  8. .dashboard {
  9. max-width: 1400px;
  10. margin: 0 auto;
  11. padding: 20px;
  12. background: white;
  13. border-radius: 8px;
  14. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  15. }
  16. /* 头部样式 */
  17. .dashboard-header {
  18. display: flex;
  19. justify-content: space-between;
  20. align-items: center;
  21. margin-bottom: 24px;
  22. padding-bottom: 16px;
  23. border-bottom: 1px solid #eee;
  24. }
  25. .header-left {
  26. display: flex;
  27. align-items: center;
  28. gap: 30px;
  29. }
  30. .dashboard-header h2 {
  31. display: flex;
  32. align-items: center;
  33. gap: 10px;
  34. font-size: 24px;
  35. color: #2c3e50;
  36. margin: 0;
  37. }
  38. .quick-nav {
  39. display: flex;
  40. gap: 10px;
  41. }
  42. .nav-btn {
  43. padding: 8px 16px;
  44. background: #f1f2f6;
  45. border: none;
  46. border-radius: 4px;
  47. cursor: pointer;
  48. font-size: 14px;
  49. transition: all 0.3s ease;
  50. }
  51. .nav-btn.active, .nav-btn:hover {
  52. background: #2c3e50;
  53. color: white;
  54. }
  55. .header-right {
  56. display: flex;
  57. align-items: center;
  58. gap: 20px;
  59. }
  60. .user-info {
  61. display: flex;
  62. align-items: center;
  63. gap: 8px;
  64. font-size: 14px;
  65. color: #2c3e50;
  66. }
  67. .time-display {
  68. background: #2c3e50;
  69. color: white;
  70. padding: 8px 16px;
  71. border-radius: 20px;
  72. font-size: 14px;
  73. display: flex;
  74. align-items: center;
  75. gap: 8px;
  76. }
  77. .refresh-btn {
  78. background: #27ae60;
  79. color: white;
  80. border: none;
  81. padding: 8px 15px;
  82. border-radius: 4px;
  83. cursor: pointer;
  84. font-size: 14px;
  85. display: flex;
  86. align-items: center;
  87. gap: 8px;
  88. transition: background 0.3s ease;
  89. }
  90. .refresh-btn:hover {
  91. background: #219653;
  92. }
  93. /* 指标网格样式 */
  94. .metric-grid {
  95. display: grid;
  96. grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  97. gap: 20px;
  98. margin-bottom: 20px;
  99. }
  100. .metric-card {
  101. background: white;
  102. border-radius: 8px;
  103. box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  104. padding: 20px;
  105. display: flex;
  106. align-items: center;
  107. gap: 15px;
  108. position: relative;
  109. overflow: hidden;
  110. cursor: pointer;
  111. transition: all 0.3s ease;
  112. }
  113. .metric-card:hover {
  114. transform: translateY(-5px);
  115. box-shadow: 0 12px 20px rgba(0,0,0,0.15);
  116. }
  117. .metric-icon {
  118. width: 60px;
  119. height: 60px;
  120. border-radius: 50%;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. font-size: 24px;
  125. color: white;
  126. }
  127. .metric-icon.blue { background: #3498db; }
  128. .metric-icon.green { background: #27ae60; }
  129. .metric-icon.orange { background: #f39c12; }
  130. .metric-icon.purple { background: #9b59b6; }
  131. .metric-data {
  132. flex: 1;
  133. }
  134. .metric-data h3 {
  135. font-size: 16px;
  136. font-weight: 600;
  137. margin-bottom: 5px;
  138. color: #2c3e50;
  139. }
  140. .metric-value {
  141. font-size: 24px;
  142. font-weight: 700;
  143. color: #2c3e50;
  144. margin: 5px 0;
  145. }
  146. .metric-label {
  147. font-size: 14px;
  148. color: #95a5a6;
  149. margin: 0;
  150. }
  151. /* 进度条样式 */
  152. .metric-progress {
  153. height: 6px;
  154. background: #e0e0e0;
  155. border-radius: 3px;
  156. margin-top: 10px;
  157. overflow: hidden;
  158. }
  159. .progress-bar {
  160. height: 100%;
  161. border-radius: 3px;
  162. transition: width 0.5s ease;
  163. }
  164. .metric-card:nth-child(1) .progress-bar { background: #3498db; }
  165. .metric-card:nth-child(2) .progress-bar { background: #f39c12; }
  166. .metric-card:nth-child(3) .progress-bar { background: #27ae60; }
  167. .metric-card:nth-child(4) .progress-bar { background: #9b59b6; }
  168. /* 悬停效果 */
  169. .metric-hover {
  170. position: absolute;
  171. bottom: 0;
  172. left: 0;
  173. right: 0;
  174. background: rgba(0,0,0,0.8);
  175. color: white;
  176. padding: 10px;
  177. text-align: center;
  178. opacity: 0;
  179. transform: translateY(100%);
  180. transition: all 0.3s ease;
  181. }
  182. .metric-card.hover .metric-hover {
  183. opacity: 1;
  184. transform: translateY(0);
  185. }
  186. /* 仪表板行布局 */
  187. .dashboard-row {
  188. display: flex;
  189. gap: 20px;
  190. margin-bottom: 20px;
  191. }
  192. .chart-card, .alert-card {
  193. flex: 1;
  194. background: white;
  195. border-radius: 8px;
  196. padding: 20px;
  197. box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  198. }
  199. .trend-card {
  200. background: white;
  201. border-radius: 8px;
  202. padding: 20px;
  203. box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  204. }
  205. /* 饼图样式 */
  206. .chart-header {
  207. display: flex;
  208. justify-content: space-between;
  209. align-items: center;
  210. margin-bottom: 15px;
  211. }
  212. .chart-tabs {
  213. display: flex;
  214. gap: 8px;
  215. }
  216. .tab-btn {
  217. padding: 6px 12px;
  218. border: none;
  219. border-radius: 15px;
  220. background: #f1f1f1;
  221. font-size: 12px;
  222. cursor: pointer;
  223. transition: all 0.3s ease;
  224. }
  225. .tab-btn.active, .tab-btn:hover {
  226. background: #2c3e50;
  227. color: white;
  228. }
  229. .chart-container-wrapper {
  230. display: flex;
  231. gap: 30px;
  232. }
  233. .pie-chart {
  234. display: flex;
  235. align-items: center;
  236. gap: 30px;
  237. padding: 10px 0;
  238. }
  239. .chart-container {
  240. width: 180px;
  241. height: 180px;
  242. position: relative;
  243. border-radius: 50%;
  244. background: conic-gradient(
  245. #27ae60 0% 80%,
  246. #f39c12 80% 95%,
  247. #e74c3c 95% 100%
  248. );
  249. }
  250. .chart-center {
  251. position: absolute;
  252. width: 100px;
  253. height: 100px;
  254. background: white;
  255. border-radius: 50%;
  256. top: 50%;
  257. left: 50%;
  258. transform: translate(-50%, -50%);
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. }
  263. .chart-center-text {
  264. font-size: 20px;
  265. font-weight: bold;
  266. color: #2c3e50;
  267. }
  268. .chart-legend div {
  269. display: flex;
  270. align-items: center;
  271. gap: 10px;
  272. margin-bottom: 15px;
  273. font-size: 16px;
  274. }
  275. .dot {
  276. width: 12px;
  277. height: 12px;
  278. border-radius: 50%;
  279. display: inline-block;
  280. }
  281. .dot.normal { background: #27ae60; }
  282. .dot.warning { background: #f39c12; }
  283. .dot.danger { background: #e74c3c; }
  284. /* 图表详情 */
  285. .chart-details {
  286. display: grid;
  287. grid-template-columns: 1fr 1fr;
  288. gap: 15px;
  289. flex: 1;
  290. }
  291. .detail-item {
  292. background: #f8fafc;
  293. border-radius: 6px;
  294. padding: 12px;
  295. transition: transform 0.3s ease;
  296. }
  297. .detail-item:hover {
  298. transform: translateY(-3px);
  299. box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  300. }
  301. .detail-label {
  302. font-size: 13px;
  303. color: #7f8c8d;
  304. margin-bottom: 5px;
  305. }
  306. .detail-value {
  307. font-size: 18px;
  308. font-weight: 700;
  309. color: #2c3e50;
  310. }
  311. /* 警报样式 */
  312. .alert-header {
  313. display: flex;
  314. justify-content: space-between;
  315. align-items: center;
  316. margin-bottom: 10px;
  317. }
  318. .alert-filter select {
  319. padding: 6px 12px;
  320. border: 1px solid #ddd;
  321. border-radius: 4px;
  322. background: white;
  323. font-size: 14px;
  324. }
  325. .alert-list {
  326. margin-top: 15px;
  327. max-height: 300px;
  328. overflow-y: auto;
  329. }
  330. .alert-item {
  331. display: flex;
  332. align-items: center;
  333. gap: 15px;
  334. padding: 12px 16px;
  335. border-radius: 6px;
  336. margin-bottom: 10px;
  337. background: #f9f9f9;
  338. border-left: 4px solid;
  339. transition: all 0.3s ease;
  340. }
  341. .alert-item:hover {
  342. transform: translateX(5px);
  343. box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  344. }
  345. .alert-item.critical {
  346. border-left-color: #e74c3c;
  347. background: #fdecea;
  348. }
  349. .alert-item.warning {
  350. border-left-color: #f39c12;
  351. background: #fef5e7;
  352. }
  353. .alert-item.info {
  354. border-left-color: #3498db;
  355. background: #ebf5fb;
  356. }
  357. .alert-item i {
  358. font-size: 20px;
  359. }
  360. .alert-item.critical i { color: #e74c3c; }
  361. .alert-item.warning i { color: #f39c12; }
  362. .alert-item.info i { color: #3498db; }
  363. .alert-content {
  364. flex: 1;
  365. }
  366. .alert-content strong {
  367. display: block;
  368. font-weight: 600;
  369. margin-bottom: 3px;
  370. }
  371. .alert-content span {
  372. font-size: 13px;
  373. color: #95a5a6;
  374. }
  375. .alert-status {
  376. padding: 4px 10px;
  377. border-radius: 12px;
  378. font-size: 12px;
  379. font-weight: bold;
  380. }
  381. .alert-item.critical .alert-status {
  382. background: #e74c3c;
  383. color: white;
  384. }
  385. .alert-item.warning .alert-status {
  386. background: #f39c12;
  387. color: white;
  388. }
  389. .alert-item.info .alert-status {
  390. background: #3498db;
  391. color: white;
  392. }
  393. .alert-footer {
  394. margin-top: 15px;
  395. text-align: center;
  396. }
  397. .view-all-btn {
  398. background: #3498db;
  399. color: white;
  400. border: none;
  401. padding: 8px 15px;
  402. border-radius: 4px;
  403. cursor: pointer;
  404. font-size: 14px;
  405. display: inline-flex;
  406. align-items: center;
  407. gap: 8px;
  408. transition: background 0.3s ease;
  409. }
  410. .view-all-btn:hover {
  411. background: #2980b9;
  412. }
  413. /* 趋势图样式 */
  414. .trend-header {
  415. display: flex;
  416. justify-content: space-between;
  417. align-items: center;
  418. margin-bottom: 15px;
  419. }
  420. .time-range-selector {
  421. display: flex;
  422. gap: 8px;
  423. }
  424. .time-btn {
  425. padding: 6px 12px;
  426. border: 1px solid #ddd;
  427. border-radius: 15px;
  428. background: white;
  429. font-size: 12px;
  430. cursor: pointer;
  431. transition: all 0.3s ease;
  432. }
  433. .time-btn.active, .time-btn:hover {
  434. border-color: #3498db;
  435. background: #3498db;
  436. color: white;
  437. }
  438. .trend-graph {
  439. display: flex;
  440. flex-direction: column;
  441. height: 200px;
  442. padding: 20px;
  443. background: #f8fafc;
  444. border-radius: 6px;
  445. margin-top: 15px;
  446. position: relative;
  447. }
  448. .graph-labels {
  449. display: flex;
  450. justify-content: space-between;
  451. margin-top: auto;
  452. color: #7f8c8d;
  453. font-size: 12px;
  454. }
  455. .graph-bars {
  456. display: flex;
  457. align-items: flex-end;
  458. gap: 10px;
  459. height: 100%;
  460. width: 100%;
  461. }
  462. .graph-bar {
  463. flex: 1;
  464. background: #3498db;
  465. border-radius: 4px 4px 0 0;
  466. position: relative;
  467. transition: height 0.5s ease;
  468. }
  469. .graph-bar::after {
  470. content: attr(style);
  471. position: absolute;
  472. top: -25px;
  473. left: 50%;
  474. transform: translateX(-50%);
  475. background: rgba(0,0,0,0.7);
  476. color: white;
  477. padding: 3px 8px;
  478. border-radius: 4px;
  479. font-size: 12px;
  480. opacity: 0;
  481. transition: opacity 0.3s ease;
  482. }
  483. .graph-bar:hover::after {
  484. opacity: 1;
  485. }
  486. /* 响应式调整 */
  487. @media (max-width: 1200px) {
  488. .dashboard-row {
  489. flex-direction: column;
  490. }
  491. }
  492. @media (max-width: 768px) {
  493. .dashboard-header {
  494. flex-direction: column;
  495. align-items: flex-start;
  496. gap: 15px;
  497. }
  498. .header-left, .header-right {
  499. width: 100%;
  500. }
  501. .quick-nav {
  502. overflow-x: auto;
  503. padding-bottom: 10px;
  504. }
  505. .chart-container-wrapper {
  506. flex-direction: column;
  507. }
  508. }