index-v2.html 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>实验室安全智能监测与管控中心</title>
  7. <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
  8. <style>
  9. /* ========== RESET ========== */
  10. *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  11. /* ========== DEEP BLUE SCI-FI THEME ========== */
  12. :root {
  13. --bg-deep: #030e1f;
  14. --bg-panel: rgba(5,16,42,0.95);
  15. --bg-card: rgba(7,22,54,0.85);
  16. --blue: #1e90ff;
  17. --blue-dim: rgba(30,144,255,0.14);
  18. --blue-glow: rgba(30,144,255,0.5);
  19. --cyan: #00d8ff;
  20. --cyan-dim: rgba(0,216,255,0.12);
  21. --teal: #00e5c8;
  22. --indigo: #4361ee;
  23. --red: #ff3b3b;
  24. --green: #00e676;
  25. --gold: #ffd740;
  26. --white: #ddf0ff;
  27. --text: #a8cce8;
  28. --text-dim: rgba(110,165,210,0.55);
  29. --border: rgba(30,144,255,0.22);
  30. --border-h: rgba(30,144,255,0.65);
  31. --shadow: 0 4px 24px rgba(0,80,220,0.22);
  32. --font-main: 'PingFang SC','Microsoft YaHei','Noto Sans SC',sans-serif;
  33. }
  34. html, body { width:100%; height:100%; overflow:auto; background:var(--bg-deep); font-family:var(--font-main); color:var(--text); }
  35. /* ========== FIXED SIZE WRAPPER ========== */
  36. #scale-root {
  37. width:9600px; height:2800px;
  38. position:relative;
  39. overflow:hidden;
  40. display:flex; flex-direction:column;
  41. }
  42. /* ========== BACKGROUND ========== */
  43. #nebula-canvas { position:fixed; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:0; }
  44. .bg-hex {
  45. position:absolute; inset:0; pointer-events:none; z-index:0;
  46. background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'%3E%3Cpolygon points='30,2 58,17 58,47 30,52 2,47 2,17' fill='none' stroke='rgba(30,144,255,0.05)' stroke-width='1'/%3E%3C/svg%3E");
  47. background-size:150px 130px;
  48. }
  49. .bg-hex::after { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at 50% 50%, transparent 25%, var(--bg-deep) 85%); }
  50. /* ========== TOP NAV ========== */
  51. .top-nav {
  52. position:relative; z-index:10; flex-shrink:0;
  53. height:160px; display:flex; align-items:stretch;
  54. background:linear-gradient(180deg, rgba(4,18,52,0.99) 0%, rgba(3,12,36,0.97) 100%);
  55. border-bottom:1px solid rgba(30,144,255,0.3);
  56. box-shadow:0 2px 30px rgba(0,80,220,0.28), inset 0 1px 0 rgba(30,144,255,0.15);
  57. }
  58. .nav-left { display:flex; align-items:center; padding:0 50px; width:950px; gap:30px; }
  59. .nav-logo {
  60. width:100px; height:100px; border-radius:20px; flex-shrink:0;
  61. background:linear-gradient(135deg,#0d2d6b,#1565c0);
  62. display:flex; align-items:center; justify-content:center;
  63. box-shadow:0 0 40px rgba(30,144,255,0.6), inset 0 0 20px rgba(255,255,255,0.1);
  64. position:relative; overflow:visible;
  65. }
  66. .nav-logo::after { content:'安'; font-size:45px; font-weight:900; color:rgba(255,255,255,0.95); }
  67. .nav-logo-ring {
  68. position:absolute; inset:-10px; border-radius:25px;
  69. border:2px solid rgba(30,144,255,0.5);
  70. animation:ringPulse 2s ease-in-out infinite;
  71. }
  72. @keyframes ringPulse { 0%,100%{transform:scale(1);opacity:0.5} 50%{transform:scale(1.1);opacity:1} }
  73. .nav-org { font-size:30px; color:var(--text-dim); line-height:1.4; }
  74. .nav-org strong { display:block; font-size:32px; color:var(--cyan); }
  75. .nav-center {
  76. flex:1; display:flex; align-items:center; justify-content:center; gap:30px; position:relative;
  77. }
  78. .nav-title {
  79. font-size:65px; font-weight:700; letter-spacing:10px;
  80. background:linear-gradient(90deg,var(--blue),var(--cyan),var(--white),var(--cyan),var(--blue));
  81. background-size:200% auto;
  82. -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  83. animation:titleShine 4s linear infinite;
  84. filter:drop-shadow(0 0 40px rgba(30,144,255,0.5));
  85. }
  86. @keyframes titleShine { from{background-position:0% center} to{background-position:200% center} }
  87. .nav-title-deco {
  88. position:absolute; bottom:15px; left:50%; transform:translateX(-50%);
  89. width:900px; height:2px;
  90. background:linear-gradient(90deg,transparent,var(--blue),var(--cyan),var(--blue),transparent);
  91. animation:decoGlow 3s ease-in-out infinite;
  92. }
  93. @keyframes decoGlow { 0%,100%{opacity:0.5} 50%{opacity:1;filter:blur(1px)} }
  94. .btn-nav-switch {
  95. padding:18px 55px; border-radius:50px; cursor:pointer; outline:none;
  96. background:var(--bg-deep);
  97. border:2px solid var(--blue); color:var(--cyan);
  98. font-size:32px; font-weight:600; letter-spacing:2px;
  99. transition:all 0.3s; position:relative; overflow:hidden; flex-shrink:0;
  100. }
  101. .btn-nav-switch::before {
  102. content:''; position:absolute; top:0; left:-100%; width:100%; height:100%;
  103. background:linear-gradient(90deg,transparent,rgba(30,144,255,0.25),transparent);
  104. animation:btnShine 3s linear infinite;
  105. }
  106. @keyframes btnShine { from{left:-100%} to{left:100%} }
  107. .btn-nav-switch:hover { box-shadow:0 0 60px rgba(30,144,255,0.6); transform:translateY(-2px); }
  108. .nav-right { width:950px; display:flex; align-items:center; justify-content:flex-end; padding:0 50px; gap:50px; }
  109. .nav-weather { display:flex; align-items:center; gap:20px; font-size:32px; color:var(--text-dim); }
  110. .nav-weather .icon { font-size:45px; }
  111. .nav-clock .time { font-size:55px; font-weight:300; color:var(--gold); font-variant-numeric:tabular-nums; letter-spacing:4px; }
  112. .nav-clock .date { font-size:30px; color:var(--text-dim); margin-top:5px; text-align:right; }
  113. /* ========== MAIN CONTENT: 4 COLS 2:2:4:2 ========== */
  114. .main-content {
  115. flex:1; min-height:0;
  116. display:grid;
  117. grid-template-columns:2fr 1.5fr 4.5fr 2fr;
  118. gap:0; padding:20px 20px 20px;
  119. position:relative; z-index:2;
  120. }
  121. /* ========== PANEL SYSTEM ========== */
  122. .panel-col { display:flex; flex-direction:column; gap:18px; min-height:0; padding:0 10px; }
  123. .panel {
  124. position:relative; border-radius:15px; overflow:hidden;
  125. background:var(--bg-panel);
  126. border:1px solid var(--border);
  127. flex-shrink:0;
  128. }
  129. .panel::before {
  130. content:''; position:absolute; inset:0; pointer-events:none; border-radius:inherit;
  131. background:linear-gradient(135deg,rgba(30,144,255,0.05) 0%,transparent 50%,rgba(0,216,255,0.03) 100%);
  132. }
  133. /* Corner ornaments */
  134. .pc { position:absolute; width:35px; height:35px; z-index:3; pointer-events:none; }
  135. .pc.tl { top:0; left:0; }
  136. .pc.tr { top:0; right:0; transform:scaleX(-1); }
  137. .pc.bl { bottom:0; left:0; transform:scaleY(-1); }
  138. .pc.br { bottom:0; right:0; transform:scale(-1); }
  139. .pc svg { width:100%; height:100%; }
  140. /* Animated border beam */
  141. .border-beam { position:absolute; inset:0; pointer-events:none; border-radius:inherit; overflow:hidden; z-index:2; }
  142. .border-beam::before {
  143. content:''; position:absolute; top:0; left:-100%; width:40%; height:3px;
  144. background:linear-gradient(90deg,transparent,rgba(30,144,255,0.9),rgba(0,216,255,0.7),transparent);
  145. animation:beamTop 5s linear infinite;
  146. }
  147. .border-beam::after {
  148. content:''; position:absolute; bottom:0; right:-100%; width:40%; height:3px;
  149. background:linear-gradient(90deg,transparent,rgba(0,216,255,0.7),rgba(30,144,255,0.9),transparent);
  150. animation:beamBottom 5s linear infinite 2.5s;
  151. }
  152. @keyframes beamTop { from{left:-40%} to{left:100%} }
  153. @keyframes beamBottom { from{right:-40%} to{right:100%} }
  154. .panel-header {
  155. display:flex; align-items:center; gap:25px;
  156. padding:20px 30px 18px;
  157. border-bottom:1px solid var(--border);
  158. background:linear-gradient(90deg,rgba(0,60,160,0.18),transparent);
  159. flex-shrink:0;
  160. }
  161. .panel-header-icon {
  162. width:65px; height:65px; border-radius:12px; flex-shrink:0;
  163. display:flex; align-items:center; justify-content:center; font-size:32px;
  164. background:linear-gradient(135deg,rgba(30,144,255,0.25),rgba(0,216,255,0.15));
  165. border:1px solid rgba(30,144,255,0.35);
  166. animation:iconGlow 3s ease-in-out infinite;
  167. }
  168. @keyframes iconGlow {
  169. 0%,100%{box-shadow:0 0 15px rgba(30,144,255,0.3)}
  170. 50%{box-shadow:0 0 35px rgba(30,144,255,0.7),0 0 12px rgba(0,216,255,0.3)}
  171. }
  172. .panel-title { font-size:30px; font-weight:600; letter-spacing:2px; color:var(--cyan); }
  173. /* ========== STATUS BADGES ========== */
  174. .status-row { display:flex; gap:15px; }
  175. .status-badge {
  176. flex:1; padding:15px 10px; border-radius:10px; text-align:center;
  177. background:var(--bg-card); border:1px solid var(--border);
  178. }
  179. .status-badge.active { border-color:var(--green); background:rgba(0,230,118,0.07); }
  180. .status-badge.warning { border-color:#f59e0b; background:rgba(245,158,11,0.07); }
  181. .status-badge.idle { border-color:var(--indigo); background:rgba(67,97,238,0.07); }
  182. .status-badge .val { font-size:48px; font-weight:700; }
  183. .status-badge.active .val { color:var(--green); }
  184. .status-badge.warning .val { color:#f59e0b; }
  185. .status-badge.idle .val { color:var(--indigo); }
  186. .status-badge .lbl { font-size:25px; color:var(--text-dim); margin-top:5px; }
  187. /* ========== FLIP COUNTER ========== */
  188. .flip-counters { display:flex; gap:25px; }
  189. .flip-counter { flex:1; text-align:center; padding:18px 15px; border-radius:10px; background:var(--bg-card); border:1px solid var(--border); }
  190. .flip-counter .fc-label { font-size:25px; color:var(--text-dim); margin-bottom:12px; letter-spacing:2px; }
  191. .flip-counter .fc-digits { display:flex; gap:8px; justify-content:center; }
  192. .flip-digit {
  193. width:50px; height:75px; border-radius:8px;
  194. background:linear-gradient(180deg,rgba(4,18,55,0.9),rgba(2,10,32,0.95));
  195. border:1px solid rgba(30,144,255,0.3);
  196. display:flex; align-items:center; justify-content:center;
  197. font-size:45px; font-weight:700; color:var(--gold);
  198. font-variant-numeric:tabular-nums; position:relative; overflow:hidden;
  199. }
  200. .flip-digit::after { content:''; position:absolute; left:0; right:0; top:50%; height:2px; background:rgba(0,0,0,0.4); }
  201. /* ========== SENSOR SCROLL ========== */
  202. .sensor-scroll-wrap { overflow:hidden; flex:1; min-height:0; }
  203. .sensor-scroll-inner { animation:scrollUp 30s linear infinite; }
  204. .sensor-scroll-inner:hover { animation-play-state:paused; }
  205. @keyframes scrollUp { 0%{transform:translateY(0)} 100%{transform:translateY(-50%)} }
  206. .sensor-item {
  207. padding:18px 20px; border-radius:10px; margin-bottom:12px;
  208. background:var(--bg-card); border:1px solid var(--border);
  209. }
  210. .sensor-item.alert {
  211. border-color:rgba(255,59,59,0.6); background:rgba(255,30,30,0.07);
  212. animation:alertGlow 1.5s ease-in-out infinite;
  213. }
  214. @keyframes alertGlow { 0%,100%{box-shadow:0 0 12px rgba(255,59,59,0.25)} 50%{box-shadow:0 0 40px rgba(255,59,59,0.6)} }
  215. .sensor-item-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
  216. .sensor-name { font-size:28px; font-weight:600; color:var(--white); }
  217. .sensor-unit { font-size:25px; color:var(--text-dim); }
  218. .sensor-metrics { display:flex; gap:10px; flex-wrap:wrap; }
  219. .sensor-metric {
  220. padding:5px 15px; border-radius:5px; font-size:25px;
  221. background:rgba(4,16,45,0.7); border:1px solid rgba(30,144,255,0.2);
  222. display:flex; align-items:center; gap:8px; color:var(--text);
  223. }
  224. .sensor-metric.alarm {
  225. background:rgba(255,0,30,0.12); border-color:var(--red); color:var(--red);
  226. animation:blinkRed 0.8s ease-in-out infinite;
  227. }
  228. @keyframes blinkRed { 0%,100%{opacity:1} 50%{opacity:0.35} }
  229. /* ========== WARNING SCROLL ========== */
  230. .warn-scroll-wrap { overflow:hidden; flex:1; min-height:0; }
  231. .warn-scroll-inner { animation:scrollUp 22s linear infinite; }
  232. .warn-scroll-inner:hover { animation-play-state:paused; }
  233. .warn-item {
  234. padding:18px 20px; border-radius:10px; margin-bottom:12px;
  235. background:rgba(245,158,11,0.05); border:1px solid rgba(245,158,11,0.2);
  236. }
  237. .warn-item-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; gap:15px; }
  238. .warn-lab { font-size:28px; font-weight:600; color:#fcd34d; flex:1; }
  239. .warn-time { font-size:25px; color:var(--text-dim); white-space:nowrap; }
  240. .warn-detail { font-size:25px; color:var(--text-dim); display:flex; align-items:center; gap:10px; }
  241. .warn-metric-val { color:#fb923c; font-weight:600; }
  242. /* ========== DEVICE STATS ========== */
  243. .device-online-row { display:flex; gap:18px; margin-bottom:18px; }
  244. .device-stat-chip {
  245. flex:1; padding:15px; border-radius:10px; text-align:center;
  246. background:var(--bg-card); border:1px solid var(--border);
  247. }
  248. .device-stat-chip.online { border-color:var(--green); }
  249. .device-stat-chip.offline { border-color:var(--red); }
  250. .device-stat-chip .dv { font-size:50px; font-weight:700; }
  251. .device-stat-chip.online .dv { color:var(--green); }
  252. .device-stat-chip.offline .dv { color:var(--red); }
  253. .device-stat-chip .dl { font-size:25px; color:var(--text-dim); }
  254. .device-list-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  255. .device-list-item {
  256. padding:15px; border-radius:10px;
  257. background:var(--bg-card); border:1px solid var(--border);
  258. display:flex; flex-direction:column; align-items:center; gap:8px;
  259. }
  260. .device-list-item .dli-icon { font-size:40px; }
  261. .device-list-item .dli-num { font-size:38px; font-weight:700; color:var(--gold); }
  262. .device-list-item .dli-name { font-size:22px; color:var(--text-dim); text-align:center; line-height:1.3; }
  263. /* ========== EQUIP STATS ========== */
  264. .equip-mid-row { display:flex; gap:15px; }
  265. .equip-stat-item { flex:1; text-align:center; padding:15px 10px; border-radius:10px; background:var(--bg-card); border:1px solid var(--border); }
  266. .equip-stat-item .ev { font-size:38px; font-weight:700; color:var(--gold); }
  267. .equip-stat-item .el { font-size:22px; color:var(--text-dim); margin-top:5px; }
  268. /* ========== EQUIP STATUS CARDS ========== */
  269. .equip-status-card {
  270. position:relative; border-radius:12px; padding:18px 22px 15px;
  271. background:var(--bg-card);
  272. border:1px solid color-mix(in srgb, var(--sc) 35%, transparent);
  273. display:flex; flex-direction:column; justify-content:space-between;
  274. overflow:hidden; transition:border-color 0.3s;
  275. }
  276. .equip-status-card::before {
  277. content:''; position:absolute; inset:0;
  278. background:radial-gradient(ellipse at 10% 10%, color-mix(in srgb, var(--sc) 10%, transparent) 0%, transparent 65%);
  279. pointer-events:none;
  280. }
  281. .equip-status-card:hover { border-color:color-mix(in srgb, var(--sc) 70%, transparent); }
  282. .esc-icon {
  283. width:70px; height:70px; color:var(--sc);
  284. filter:drop-shadow(0 0 12px var(--sc));
  285. animation:iconGlow 3s ease-in-out infinite;
  286. flex-shrink:0;
  287. }
  288. .esc-num {
  289. font-size:55px; font-weight:700; letter-spacing:2px;
  290. color:var(--sc); line-height:1;
  291. text-shadow:0 0 30px color-mix(in srgb, var(--sc) 60%, transparent);
  292. }
  293. .esc-label { font-size:25px; color:var(--text-dim); margin-top:2px; }
  294. .esc-bar { height:5px; border-radius:2px; background:rgba(255,255,255,0.06); margin-top:10px; overflow:hidden; }
  295. .esc-bar-fill {
  296. height:100%; border-radius:2px;
  297. background:linear-gradient(90deg, var(--sc), color-mix(in srgb, var(--sc) 50%, transparent));
  298. box-shadow:0 0 10px var(--sc);
  299. }
  300. /* ========== CENTER COL (3区) ========== */
  301. .center-col { display:flex; flex-direction:column; padding:0 10px; min-height:0; position:relative; }
  302. /* Monitor view — 全时显示 */
  303. #view-monitor {
  304. flex:1; display:flex; flex-direction:column; border-radius:15px;
  305. border:1px solid var(--border); background:var(--bg-panel); overflow:hidden; min-height:0;
  306. }
  307. .monitor-header {
  308. padding:20px 30px; border-bottom:1px solid var(--border); flex-shrink:0;
  309. display:flex; align-items:center; gap:25px;
  310. background:linear-gradient(90deg,rgba(0,60,160,0.18),transparent);
  311. }
  312. .monitor-inner { flex:1; display:grid; grid-template-columns:575px 1fr; gap:0; min-height:0; overflow:hidden; }
  313. .monitor-left {
  314. display:flex; flex-direction:column; gap:15px; padding:20px; border-right:1px solid var(--border);
  315. min-height:0; overflow:hidden;
  316. }
  317. .monitor-right { padding:20px; display:flex; flex-direction:column; gap:15px; min-height:0; }
  318. .search-box {
  319. display:flex; align-items:center; gap:18px; padding:15px 25px; border-radius:10px;
  320. background:var(--bg-card); border:1px solid var(--border); flex-shrink:0;
  321. }
  322. .search-box input { flex:1; background:none; border:none; outline:none; color:var(--text); font-size:30px; font-family:var(--font-main); }
  323. .search-box input::placeholder { color:var(--text-dim); }
  324. .filter-select {
  325. padding:12px 25px; border-radius:10px; width:100%; flex-shrink:0;
  326. background:var(--bg-card); border:1px solid var(--border);
  327. color:var(--text); font-size:28px; font-family:var(--font-main); outline:none; cursor:pointer; appearance:none;
  328. background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='rgba(30,144,255,0.6)'/%3E%3C/svg%3E");
  329. background-repeat:no-repeat; background-position:right 25px center;
  330. }
  331. .tree-wrap { flex:1; overflow-y:auto; overflow-x:hidden; min-height:0; }
  332. .tree-wrap::-webkit-scrollbar { width:8px; }
  333. .tree-wrap::-webkit-scrollbar-thumb { background:var(--border); border-radius:5px; }
  334. .tree-node-label {
  335. display:flex; align-items:center; gap:15px; padding:12px 20px; border-radius:8px;
  336. font-size:28px; color:var(--text); transition:all 0.2s; user-select:none; cursor:pointer;
  337. }
  338. .tree-node-label:hover { background:var(--blue-dim); color:var(--blue); }
  339. .tree-node-label.selected { background:rgba(30,144,255,0.15); color:var(--cyan); border-left:5px solid var(--blue); }
  340. .tree-node-label .arrow { transition:transform 0.2s; font-size:25px; color:var(--text-dim); flex-shrink:0; }
  341. .tree-node-label .arrow.open { transform:rotate(90deg); }
  342. .tree-children { padding-left:35px; display:none; }
  343. .tree-children.open { display:block; }
  344. .camera-grid-header { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
  345. .camera-breadcrumb { font-size:30px; color:var(--text-dim); }
  346. .camera-breadcrumb span { color:var(--cyan); }
  347. .camera-pager { display:flex; align-items:center; gap:15px; }
  348. .pager-btn {
  349. width:60px; height:60px; border-radius:8px; cursor:pointer;
  350. background:var(--bg-card); border:1px solid var(--border);
  351. color:var(--text-dim); font-size:32px; display:flex; align-items:center; justify-content:center; transition:all 0.2s;
  352. }
  353. .pager-btn:hover { border-color:var(--blue); color:var(--blue); }
  354. .pager-info { font-size:28px; color:var(--text-dim); }
  355. .camera-grid {
  356. display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr);
  357. gap:12px; flex:1; min-height:0;
  358. }
  359. .camera-cell {
  360. position:relative; border-radius:10px; overflow:hidden;
  361. background:#020810; border:1px solid var(--border);
  362. display:flex; align-items:center; justify-content:center;
  363. }
  364. .camera-cell:hover { border-color:var(--blue); }
  365. .camera-cell.ai-cam { border-color:rgba(0,230,118,0.4); }
  366. .camera-cell canvas { width:100%; height:100%; display:block; }
  367. .camera-overlay { position:absolute; inset:0; pointer-events:none; background:linear-gradient(180deg,rgba(0,0,0,0.4) 0%,transparent 30%,transparent 70%,rgba(0,0,0,0.5) 100%); }
  368. .camera-label { position:absolute; bottom:10px; left:15px; font-size:25px; color:rgba(255,255,255,0.75); background:rgba(0,0,0,0.5); padding:3px 10px; border-radius:5px; }
  369. .camera-rec { position:absolute; top:10px; right:15px; display:flex; align-items:center; gap:8px; font-size:25px; color:var(--red); background:rgba(0,0,0,0.5); padding:3px 10px; border-radius:5px; }
  370. .camera-rec::before { content:''; width:12px; height:12px; border-radius:50%; background:var(--red); animation:blinkRed 1s ease-in-out infinite; }
  371. .camera-ai-badge { position:absolute; top:10px; left:15px; font-size:25px; color:var(--green); background:rgba(0,30,15,0.75); padding:3px 10px; border-radius:5px; border:1px solid rgba(0,230,118,0.3); }
  372. .ai-detection-box { position:absolute; border:5px solid var(--red); background:rgba(255,59,59,0.1); border-radius:5px; animation:detBox 1.5s ease-in-out infinite; }
  373. @keyframes detBox { 0%,100%{border-color:#ff3b3b;box-shadow:0 0 20px rgba(255,59,59,0.4)} 50%{border-color:#fca5a5;box-shadow:0 0 45px rgba(255,59,59,0.7)} }
  374. .ai-detection-label { position:absolute; bottom:100%; left:0; white-space:nowrap; font-size:25px; background:#ff3b3b; color:#fff; padding:3px 10px; border-radius:5px; margin-bottom:5px; }
  375. /* ========== STATUS DOTS ========== */
  376. .status-dot { width:20px; height:20px; border-radius:50%; display:inline-block; animation:dotPulse 2s ease-in-out infinite; }
  377. .status-dot.green { background:var(--green); box-shadow:0 0 15px var(--green); }
  378. .status-dot.red { background:var(--red); box-shadow:0 0 15px var(--red); animation:blinkRed 0.8s ease-in-out infinite; }
  379. .status-dot.orange { background:#f59e0b; box-shadow:0 0 15px #f59e0b; }
  380. @keyframes dotPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:0.7} }
  381. /* ========== SCAN EFFECT ========== */
  382. .scan-effect { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:0; }
  383. .scan-effect::after {
  384. content:''; position:absolute; left:0; right:0; height:200px; top:-200px;
  385. background:linear-gradient(180deg,transparent,rgba(30,144,255,0.025),transparent);
  386. animation:scanFull 9s linear infinite;
  387. }
  388. @keyframes scanFull { from{top:-200px} to{top:100%} }
  389. /* ========== ALERT MODAL ========== */
  390. #alert-modal {
  391. position:fixed; inset:0; z-index:9999;
  392. display:none; align-items:center; justify-content:center;
  393. background:rgba(0,0,0,0.9); backdrop-filter:blur(6px);
  394. }
  395. #alert-modal.show { display:flex; animation:alertFadeIn 0.4s ease; }
  396. @keyframes alertFadeIn { from{opacity:0;transform:scale(0.88)} to{opacity:1;transform:scale(1)} }
  397. .alert-modal-inner {
  398. position:relative; width:2200px; border-radius:20px; overflow:hidden;
  399. background:linear-gradient(135deg,rgba(38,3,8,0.98),rgba(14,2,5,0.99));
  400. border:2px solid rgba(239,68,68,0.5);
  401. box-shadow:0 0 250px rgba(239,68,68,0.45),inset 0 0 150px rgba(200,0,0,0.08);
  402. }
  403. .alert-scan-line { position:absolute; left:0; right:0; height:5px; background:linear-gradient(90deg,transparent,rgba(239,68,68,0.9),transparent); animation:alertScan 1.5s linear infinite; top:0; z-index:2; }
  404. @keyframes alertScan { from{top:0} to{top:100%} }
  405. .alert-modal-header {
  406. padding:45px 60px 35px; background:linear-gradient(90deg,rgba(200,0,0,0.18),transparent);
  407. display:flex; align-items:center; gap:40px; border-bottom:2px solid rgba(239,68,68,0.25);
  408. }
  409. .alert-icon { font-size:85px; animation:alertFlash 0.6s ease-in-out infinite; }
  410. @keyframes alertFlash { 0%,100%{opacity:1} 50%{opacity:0.15} }
  411. .alert-title { font-size:55px; font-weight:700; color:#ef4444; letter-spacing:8px; }
  412. .alert-subtitle { font-size:28px; color:rgba(239,100,100,0.6); margin-top:8px; letter-spacing:5px; }
  413. /* body: flex row — left cam + right info */
  414. .alert-modal-body { padding:45px 60px; display:flex; gap:50px; align-items:flex-start; }
  415. /* LEFT: camera panel */
  416. .alert-cam-wrap {
  417. flex:0 0 900px;
  418. display:flex; flex-direction:column; gap:15px;
  419. }
  420. .alert-cam-label {
  421. font-size:28px; color:rgba(255,150,150,0.7); letter-spacing:5px;
  422. display:flex; align-items:center; gap:20px;
  423. }
  424. .alert-cam-label::before { content:''; width:15px; height:15px; border-radius:50%; background:#ef4444; box-shadow:0 0 20px #ef4444; animation:blinkRed 0.8s ease-in-out infinite; }
  425. .alert-cam-box {
  426. position:relative; width:900px; height:700px; border-radius:10px; overflow:hidden;
  427. border:2px solid rgba(239,68,68,0.5);
  428. box-shadow:0 0 50px rgba(239,68,68,0.25), inset 0 0 75px rgba(200,0,0,0.1);
  429. }
  430. .alert-cam-box canvas { display:block; width:100%; height:100%; }
  431. .alert-cam-overlay { position:absolute; inset:0; pointer-events:none; background:linear-gradient(180deg,rgba(0,0,0,0.35) 0%,transparent 25%,transparent 75%,rgba(0,0,0,0.45) 100%); }
  432. .alert-cam-rec { position:absolute; top:20px; right:25px; display:flex; align-items:center; gap:10px; font-size:28px; color:#ef4444; background:rgba(0,0,0,0.6); padding:5px 18px; border-radius:5px; }
  433. .alert-cam-rec::before { content:''; width:15px; height:15px; border-radius:50%; background:#ef4444; animation:blinkRed 1s ease-in-out infinite; }
  434. .alert-cam-id { position:absolute; top:20px; left:25px; font-size:28px; color:rgba(255,255,255,0.8); background:rgba(0,0,0,0.6); padding:5px 18px; border-radius:5px; }
  435. .alert-cam-bottom { position:absolute; bottom:20px; left:25px; right:25px; display:flex; justify-content:space-between; align-items:center; }
  436. .alert-cam-name { font-size:28px; color:rgba(255,255,255,0.8); background:rgba(0,0,0,0.6); padding:5px 18px; border-radius:5px; }
  437. .alert-cam-ai { font-size:25px; color:#00e676; background:rgba(0,30,15,0.75); padding:5px 18px; border-radius:5px; border:1px solid rgba(0,230,118,0.3); }
  438. .alert-det-box { position:absolute; border:5px solid #ef4444; background:rgba(239,68,68,0.1); border-radius:5px; animation:detBox 1.5s ease-in-out infinite; }
  439. .alert-det-label { position:absolute; bottom:100%; left:0; white-space:nowrap; font-size:25px; background:#ef4444; color:#fff; padding:5px 12px; border-radius:5px; margin-bottom:5px; }
  440. /* RIGHT: info */
  441. .alert-info-col { flex:1; display:flex; flex-direction:column; gap:35px; }
  442. .alert-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:25px; }
  443. .alert-info-item { padding:25px 35px; border-radius:10px; background:rgba(239,68,68,0.07); border:1px solid rgba(239,68,68,0.2); }
  444. .alert-info-item .ail { font-size:28px; color:rgba(255,150,150,0.65); margin-bottom:10px; }
  445. .alert-info-item .aiv { font-size:40px; font-weight:700; color:#ef4444; }
  446. .alert-pulse-text { text-align:center; font-size:32px; letter-spacing:5px; color:rgba(239,100,100,0.75); animation:blinkRed 1s ease-in-out infinite; font-weight:600; padding:20px; border:1px solid rgba(239,68,68,0.2); border-radius:10px; background:rgba(239,68,68,0.05); }
  447. .alert-modal-footer { padding:30px 60px; display:flex; gap:30px; justify-content:flex-end; border-top:1px solid rgba(239,68,68,0.15); }
  448. .btn-alert-confirm { padding:22px 70px; border-radius:10px; cursor:pointer; border:2px solid #ef4444; background:rgba(239,68,68,0.15); color:#ef4444; font-size:32px; font-weight:600; transition:all 0.2s; }
  449. .btn-alert-confirm:hover { background:rgba(239,68,68,0.3); }
  450. .btn-alert-ignore { padding:22px 70px; border-radius:10px; cursor:pointer; border:1px solid var(--border); background:transparent; color:var(--text-dim); font-size:32px; transition:all 0.2s; }
  451. /* ========== SCROLLBAR ========== */
  452. ::-webkit-scrollbar { width:8px; height:8px; }
  453. ::-webkit-scrollbar-track { background:transparent; }
  454. ::-webkit-scrollbar-thumb { background:var(--border); border-radius:5px; }
  455. /* ========== CHART HEIGHTS ========== */
  456. #chart-donut { width:100%; height:100%; }
  457. #chart-stack { width:100%; height:100%; }
  458. #chart-line { width:100%; height:100%; }
  459. #chart-gauge { width:100%; height:100%; }
  460. #chart-ring { width:100%; height:100%; }
  461. #chart-pie-status { width:100%; flex:1; min-height:0; }
  462. #chart-pie-usage { width:100%; flex:1; min-height:0; }
  463. </style>
  464. </head>
  465. <body>
  466. <canvas id="nebula-canvas"></canvas>
  467. <!-- ===== ALERT MODAL ===== -->
  468. <div id="alert-modal">
  469. <div class="alert-modal-inner">
  470. <div class="alert-scan-line"></div>
  471. <div class="alert-modal-header">
  472. <span class="alert-icon">🚨</span>
  473. <div>
  474. <div class="alert-title">⚡ 系统预警 · ALERT</div>
  475. <div class="alert-subtitle">LABORATORY SAFETY MONITORING SYSTEM · EMERGENCY</div>
  476. </div>
  477. </div>
  478. <div class="alert-modal-body">
  479. <!-- 左侧: 实验室实时监控画面 360×280 -->
  480. <div class="alert-cam-wrap">
  481. <div class="alert-cam-label">告警实验室实时监控画面</div>
  482. <div class="alert-cam-box">
  483. <canvas id="alert-cam-canvas" width="900" height="700"></canvas>
  484. <div class="alert-cam-overlay"></div>
  485. <div class="alert-cam-id">CAM · A301-02</div>
  486. <div class="alert-cam-rec">REC</div>
  487. <div class="alert-cam-bottom">
  488. <span class="alert-cam-name">化学分析实验室 A301</span>
  489. <span class="alert-cam-ai">🤖 AI检测</span>
  490. </div>
  491. <!-- AI危险行为框 -->
  492. <div class="alert-det-box" style="left:22%;top:15%;width:28%;height:42%">
  493. <div class="alert-det-label">危险行为: 未佩戴防护</div>
  494. </div>
  495. </div>
  496. </div>
  497. <!-- 右侧: 告警信息 -->
  498. <div class="alert-info-col">
  499. <div class="alert-info-grid">
  500. <div class="alert-info-item"><div class="ail">告警实验室</div><div class="aiv" id="alert-lab">化学分析实验室 (A301)</div></div>
  501. <div class="alert-info-item"><div class="ail">所属单位</div><div class="aiv" id="alert-unit">化学研究所</div></div>
  502. <div class="alert-info-item"><div class="ail">告警指标</div><div class="aiv" id="alert-metric">TVOC 浓度超标</div></div>
  503. <div class="alert-info-item"><div class="ail">当前值 / 安全阈值</div><div class="aiv" id="alert-value">2.85 / 0.6 mg/m³</div></div>
  504. </div>
  505. <div class="alert-pulse-text">▶▶ 请立即采取安全措施,疏散实验人员 ◀◀</div>
  506. </div>
  507. </div>
  508. <div class="alert-modal-footer">
  509. <button class="btn-alert-ignore" onclick="closeAlert()">稍后处理</button>
  510. <button class="btn-alert-confirm" onclick="closeAlert()">确认处理</button>
  511. </div>
  512. </div>
  513. </div>
  514. <!-- ===== MAIN WRAPPER ===== -->
  515. <div id="scale-root">
  516. <div class="bg-hex"></div>
  517. <div class="scan-effect"></div>
  518. <!-- TOP NAV -->
  519. <nav class="top-nav">
  520. <!-- 左侧:实时时钟 + 星期 -->
  521. <div class="nav-left" style="justify-content:flex-start">
  522. <div class="nav-clock">
  523. <div class="time" id="clock-time">--:--:--</div>
  524. <div class="date" id="clock-date">----年--月--日 星期-</div>
  525. </div>
  526. </div>
  527. <!-- 中部:LOGO + 单位名称 + 大标题 -->
  528. <div class="nav-center">
  529. <div class="nav-logo"><div class="nav-logo-ring"></div></div>
  530. <div class="nav-org" style="margin-right:50px">
  531. <strong>中国安全生产科学研究院</strong>
  532. <span>National Institute for Occupational Safety</span>
  533. </div>
  534. <div style="width:2px;height:80px;background:linear-gradient(180deg,transparent,rgba(30,144,255,0.6),transparent);flex-shrink:0;margin-right:50px"></div>
  535. <div style="display:flex;flex-direction:column;align-items:center;position:relative">
  536. <div class="nav-title">实验室安全智能监测与管控中心</div>
  537. <div class="nav-title-deco"></div>
  538. </div>
  539. </div>
  540. <!-- 右侧:天气 -->
  541. <div class="nav-right" style="justify-content:flex-end">
  542. <div class="nav-weather">
  543. <span class="icon">⛅</span>
  544. <div>
  545. <div>北京 · 晴转多云</div>
  546. <div style="font-size:28px;color:var(--gold)">12°C / AQI 68</div>
  547. </div>
  548. </div>
  549. </div>
  550. </nav>
  551. <!-- MAIN CONTENT: 4 COLS L→R: 1区(2) 2区(2) 3区(4) 4区(2) -->
  552. <div class="main-content">
  553. <!-- ======== 1区 ======== -->
  554. <div class="panel-col">
  555. <!-- 实验室基本情况统计 -->
  556. <div class="panel" style="flex:0 0 auto;display:flex;flex-direction:column">
  557. <div class="border-beam"></div>
  558. <svg class="pc tl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  559. <svg class="pc tr" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  560. <svg class="pc bl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  561. <svg class="pc br" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  562. <div class="panel-header">
  563. <div class="panel-header-icon">🏛️</div>
  564. <span class="panel-title">实验室基本情况统计</span>
  565. <div class="status-dot green" style="margin-left:auto"></div>
  566. </div>
  567. <!-- 上部 80%:左(3) 总数 + 右(7) 分级 -->
  568. <div style="flex:4;display:flex;min-height:680px;overflow:hidden">
  569. <!-- 左侧 4:实验室总数统计 -->
  570. <div style="flex:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:25px 20px;border-right:1px solid var(--border);background:linear-gradient(180deg,rgba(30,144,255,0.04),transparent)">
  571. <!-- SVG 圆弧仪表 -->
  572. <svg width="320" height="320" viewBox="0 0 320 320">
  573. <defs>
  574. <linearGradient id="arcG1" x1="0%" y1="0%" x2="100%" y2="100%">
  575. <stop offset="0%" stop-color="#1e90ff"/>
  576. <stop offset="100%" stop-color="#00d8ff"/>
  577. </linearGradient>
  578. <filter id="glow1">
  579. <feGaussianBlur stdDeviation="4" result="blur"/>
  580. <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
  581. </filter>
  582. </defs>
  583. <!-- 最外装饰环 -->
  584. <circle cx="160" cy="160" r="148" fill="none" stroke="rgba(30,144,255,0.08)" stroke-width="1" stroke-dasharray="6 6"/>
  585. <!-- 外轨道 -->
  586. <circle cx="160" cy="160" r="136" fill="none" stroke="rgba(30,144,255,0.14)" stroke-width="3"/>
  587. <!-- 主弧 300° -->
  588. <circle cx="160" cy="160" r="136" fill="none" stroke="url(#arcG1)" stroke-width="8"
  589. stroke-dasharray="711 143" stroke-linecap="round" transform="rotate(-240 160 160)" filter="url(#glow1)"/>
  590. <!-- 内轨道 -->
  591. <circle cx="160" cy="160" r="110" fill="rgba(3,14,31,0.7)" stroke="rgba(0,216,255,0.15)" stroke-width="2"/>
  592. <!-- 四分级色弧 小环 -->
  593. <circle cx="160" cy="160" r="88" fill="none" stroke="#cc0000" stroke-width="12" stroke-dasharray="42 485" stroke-linecap="round" transform="rotate(-90 160 160)" opacity="0.9"/>
  594. <circle cx="160" cy="160" r="88" fill="none" stroke="#ff8000" stroke-width="12" stroke-dasharray="99 428" stroke-linecap="round" transform="rotate(-57 160 160)" opacity="0.9"/>
  595. <circle cx="160" cy="160" r="88" fill="none" stroke="#ffcc00" stroke-width="12" stroke-dasharray="160 367" stroke-linecap="round" transform="rotate(22 160 160)" opacity="0.9"/>
  596. <circle cx="160" cy="160" r="88" fill="none" stroke="#0066cc" stroke-width="12" stroke-dasharray="153 374" stroke-linecap="round" transform="rotate(145 160 160)" opacity="0.9"/>
  597. <!-- 端点光晕 -->
  598. <circle cx="160" cy="24" r="6" fill="#1e90ff" opacity="0.9"/>
  599. <!-- 中心数字 -->
  600. <text x="160" y="145" text-anchor="middle" fill="#ffd740" font-size="72" font-weight="900" font-family="Arial,sans-serif" letter-spacing="-2">128</text>
  601. <text x="160" y="190" text-anchor="middle" fill="rgba(168,204,232,0.75)" font-size="26" font-family="Arial,sans-serif" letter-spacing="4">间</text>
  602. </svg>
  603. <!-- 标签 -->
  604. <div style="text-align:center">
  605. <div style="font-size:30px;font-weight:700;color:var(--cyan);letter-spacing:4px">实验室总数</div>
  606. <div style="font-size:22px;color:var(--text-dim);margin-top:6px;letter-spacing:2px">TOTAL LABORATORIES</div>
  607. </div>
  608. <!-- 分级色条 -->
  609. <div style="width:100%;padding:0 10px">
  610. <div style="display:flex;gap:5px;height:12px;border-radius:6px;overflow:hidden">
  611. <div style="flex:12;background:#cc0000;box-shadow:0 0 10px rgba(204,0,0,0.5)"></div>
  612. <div style="flex:28;background:#ff8000;box-shadow:0 0 10px rgba(255,128,0,0.4)"></div>
  613. <div style="flex:45;background:#ffcc00;box-shadow:0 0 10px rgba(255,204,0,0.4)"></div>
  614. <div style="flex:43;background:#0066cc;box-shadow:0 0 10px rgba(0,102,204,0.4)"></div>
  615. </div>
  616. <div style="display:flex;gap:5px;margin-top:8px;font-size:22px;color:var(--text-dim);text-align:center">
  617. <span style="flex:12">Ⅰ</span><span style="flex:28">Ⅱ</span><span style="flex:45">Ⅲ</span><span style="flex:43">Ⅳ</span>
  618. </div>
  619. </div>
  620. </div>
  621. <!-- 右侧 6:分级统计(环形图 + 明细列表) -->
  622. <div style="flex:6;display:flex;flex-direction:column;justify-content:center;padding:25px 25px 20px;gap:0">
  623. <!-- 环形图 -->
  624. <div style="flex:0 0 340px;width:100%" id="chart-donut"></div>
  625. <!-- 分级明细 -->
  626. <div style="display:flex;flex-direction:column;gap:10px;margin-top:10px">
  627. <div style="display:flex;justify-content:space-between;align-items:center;font-size:26px;padding:10px 16px;border-radius:8px;background:rgba(204,0,0,0.07);border-left:4px solid #cc0000">
  628. <span style="display:flex;align-items:center;gap:12px"><span style="width:16px;height:16px;border-radius:3px;background:#cc0000;display:inline-block;box-shadow:0 0 8px rgba(204,0,0,0.8)"></span>I 级(危险)</span>
  629. <span style="color:#ff6666;font-weight:700;font-size:28px">12间</span>
  630. </div>
  631. <div style="display:flex;justify-content:space-between;align-items:center;font-size:26px;padding:10px 16px;border-radius:8px;background:rgba(255,128,0,0.07);border-left:4px solid #ff8000">
  632. <span style="display:flex;align-items:center;gap:12px"><span style="width:16px;height:16px;border-radius:3px;background:#ff8000;display:inline-block;box-shadow:0 0 8px rgba(255,128,0,0.8)"></span>II 级(较危险)</span>
  633. <span style="color:#ffaa44;font-weight:700;font-size:28px">28间</span>
  634. </div>
  635. <div style="display:flex;justify-content:space-between;align-items:center;font-size:26px;padding:10px 16px;border-radius:8px;background:rgba(255,204,0,0.07);border-left:4px solid #ffcc00">
  636. <span style="display:flex;align-items:center;gap:12px"><span style="width:16px;height:16px;border-radius:3px;background:#ffcc00;display:inline-block;box-shadow:0 0 8px rgba(255,204,0,0.8)"></span>III 级(一般)</span>
  637. <span style="color:#ffe066;font-weight:700;font-size:28px">45间</span>
  638. </div>
  639. <div style="display:flex;justify-content:space-between;align-items:center;font-size:26px;padding:10px 16px;border-radius:8px;background:rgba(0,102,204,0.07);border-left:4px solid #0066cc">
  640. <span style="display:flex;align-items:center;gap:12px"><span style="width:16px;height:16px;border-radius:3px;background:#0066cc;display:inline-block;box-shadow:0 0 8px rgba(0,102,204,0.8)"></span>IV 级(较安全)</span>
  641. <span style="color:#4499ff;font-weight:700;font-size:28px">43间</span>
  642. </div>
  643. </div>
  644. </div>
  645. </div>
  646. <!-- 下部 20%:三种状态统计 -->
  647. <div style="flex:1;display:flex;align-items:center;padding:0 25px 20px;border-top:1px solid var(--border);gap:15px;min-height:170px">
  648. <div class="status-row" style="width:100%;margin:0">
  649. <div class="status-badge active"><div class="val">20</div><div class="lbl">使用(间)</div></div>
  650. <div class="status-badge warning"><div class="val">3</div><div class="lbl">异常(间)</div></div>
  651. <div class="status-badge idle"><div class="val">105</div><div class="lbl">空闲(间)</div></div>
  652. </div>
  653. </div>
  654. </div>
  655. <!-- 实验室安全分级统计 -->
  656. <div class="panel" style="flex:1;min-height:450px;display:flex;flex-direction:column">
  657. <div class="border-beam"></div>
  658. <div class="panel-header">
  659. <div class="panel-header-icon">📊</div>
  660. <span class="panel-title">实验室安全分级统计</span>
  661. </div>
  662. <div style="flex:1;min-height:0;padding:15px 20px">
  663. <div id="chart-stack" style="height:100%;width:100%"></div>
  664. </div>
  665. </div>
  666. <!-- 实验室进入人数统计及走势 -->
  667. <div class="panel" style="flex:0 0 auto">
  668. <div class="border-beam"></div>
  669. <div class="panel-header">
  670. <div class="panel-header-icon">👥</div>
  671. <span class="panel-title">实验室进入人数统计及走势</span>
  672. </div>
  673. <div style="padding:20px 25px">
  674. <div class="flip-counters">
  675. <div class="flip-counter"><div class="fc-label">今日进入总人数</div><div class="fc-digits" id="flip-total"></div></div>
  676. <div class="flip-counter"><div class="fc-label">当前在场实验人数</div><div class="fc-digits" id="flip-current"></div></div>
  677. </div>
  678. <div style="height:275px;margin-top:12px" id="chart-line"></div>
  679. </div>
  680. </div>
  681. </div><!-- /1区 -->
  682. <!-- ======== 2区 ======== -->
  683. <div class="panel-col">
  684. <!-- 智能环境感知应用设备统计 -->
  685. <div class="panel" style="flex:0 0 auto">
  686. <div class="border-beam"></div>
  687. <svg class="pc tl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  688. <svg class="pc tr" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  689. <svg class="pc bl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  690. <svg class="pc br" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  691. <div class="panel-header">
  692. <div class="panel-header-icon">📡</div>
  693. <span class="panel-title">智能环境感知应用设备统计</span>
  694. </div>
  695. <div style="padding:20px 25px">
  696. <div class="device-online-row">
  697. <div class="device-stat-chip online"><div class="dv">312</div><div class="dl">在线设备</div></div>
  698. <div class="device-stat-chip offline"><div class="dv">18</div><div class="dl">离线设备</div></div>
  699. </div>
  700. <div style="display:flex;gap:20px;align-items:center">
  701. <div id="chart-gauge" style="flex:0 0 295px;height:295px"></div>
  702. <div style="flex:1;display:flex;flex-direction:column;gap:12px">
  703. <div style="display:flex;gap:12px">
  704. <div class="device-list-item" style="flex:1"><div class="dli-icon">🏷️</div><div class="dli-num">86</div><div class="dli-name">电子信息铭牌</div></div>
  705. <div class="device-list-item" style="flex:1"><div class="dli-icon">⚗️</div><div class="dli-num">44</div><div class="dli-name">化学品智能终端</div></div>
  706. <div class="device-list-item" style="flex:1"><div class="dli-icon">🌡️</div><div class="dli-num">128</div><div class="dli-name">传感器</div></div>
  707. </div>
  708. <div style="display:flex;gap:12px;justify-content:center">
  709. <div class="device-list-item" style="flex:0 0 calc(33.33% - 6px)"><div class="dli-icon">📷</div><div class="dli-num">72</div><div class="dli-name">智慧摄像头</div></div>
  710. <div class="device-list-item" style="flex:0 0 calc(33.33% - 6px)"><div class="dli-icon">📡</div><div class="dli-num">35</div><div class="dli-name">其他智能设备</div></div>
  711. </div>
  712. </div>
  713. </div>
  714. </div>
  715. </div>
  716. <!-- 实验室设备分类及使用统计 (4:6) -->
  717. <div class="panel" style="flex:1;min-height:650px;display:flex;flex-direction:column">
  718. <div class="border-beam"></div>
  719. <div class="panel-header">
  720. <div class="panel-header-icon">🔬</div>
  721. <span class="panel-title">实验室设备分类及使用统计</span>
  722. </div>
  723. <!-- 4:6 layout -->
  724. <div style="flex:1;display:flex;flex-direction:column;padding:15px 25px;gap:12px;min-height:0">
  725. <!-- 上: 占4 环形图 - 设备分类(含图例:名称/数量/占比) -->
  726. <div style="flex:4;min-height:0">
  727. <div id="chart-ring" style="height:100%;width:100%"></div>
  728. </div>
  729. <!-- 下: 占6 统计 + 双饼图 -->
  730. <div style="flex:6;min-height:0;display:flex;flex-direction:column;gap:10px">
  731. <!-- 上方 3网格统计 -->
  732. <div class="equip-mid-row" style="flex:0 0 auto">
  733. <div class="equip-stat-item"><div class="ev">2,458</div><div class="el">设备总数(台)</div></div>
  734. <div class="equip-stat-item"><div class="ev">18,620</div><div class="el">使用时长(h)</div></div>
  735. <div class="equip-stat-item"><div class="ev">62.4%</div><div class="el">设备使用率</div></div>
  736. </div>
  737. <!-- 下方 左右双饼图 -->
  738. <div style="flex:1;min-height:0;display:flex;gap:12px">
  739. <div style="flex:1;min-height:0;display:flex;flex-direction:column;gap:6px">
  740. <div style="text-align:center;margin-top:100px;padding:5px 0 7px;font-size:22px;font-weight:600;letter-spacing:3px;color:var(--cyan);border-bottom:1px solid rgba(0,216,255,0.22);text-shadow:0 0 10px rgba(0,216,255,0.45)">设备状态统计</div>
  741. <div id="chart-pie-status" style="flex:1;min-height:0"></div>
  742. </div>
  743. <div style="flex:1;min-height:0;display:flex;flex-direction:column;gap:6px">
  744. <div style="text-align:center;margin-top:100px;padding:5px 0 7px;font-size:22px;font-weight:600;letter-spacing:3px;color:var(--cyan);border-bottom:1px solid rgba(0,216,255,0.22);text-shadow:0 0 10px rgba(0,216,255,0.45)">使用状态统计</div>
  745. <div id="chart-pie-usage" style="flex:1;min-height:0"></div>
  746. </div>
  747. </div>
  748. </div>
  749. </div>
  750. </div>
  751. </div><!-- /2区 -->
  752. <!-- ======== 3区: 实时监控 ======== -->
  753. <div class="center-col">
  754. <!-- 实时监控(常显) -->
  755. <div id="view-monitor">
  756. <div class="monitor-header">
  757. <span style="font-size:32px;font-weight:600;color:var(--cyan);letter-spacing:2px">📹 实时监控</span>
  758. <span style="font-size:28px;color:var(--text-dim);margin-left:10px">CCTV Live Feed</span>
  759. <div style="margin-left:auto;display:flex;align-items:center;gap:15px">
  760. <div class="status-dot green"></div>
  761. <span style="font-size:28px;color:var(--text-dim)">信号正常</span>
  762. </div>
  763. </div>
  764. <div class="monitor-inner">
  765. <div class="monitor-left">
  766. <div class="search-box"><span style="font-size:32px;color:var(--text-dim)">🔍</span><input type="text" placeholder="搜索楼栋 / 楼层 / 房间…"></div>
  767. <select class="filter-select">
  768. <option value="">全部二级单位</option>
  769. <option>化学研究所</option><option>物理研究所</option>
  770. <option>生物研究所</option><option>材料研究所</option><option>工程研究所</option>
  771. </select>
  772. <div class="tree-wrap" id="building-tree"></div>
  773. </div>
  774. <div class="monitor-right">
  775. <div class="camera-grid-header">
  776. <div class="camera-breadcrumb"><span>安科院主园区</span> › <span>综合实验楼A</span> › <span>3层</span></div>
  777. <div class="camera-pager">
  778. <button class="pager-btn">‹</button>
  779. <span class="pager-info">1 / 3 页</span>
  780. <button class="pager-btn">›</button>
  781. </div>
  782. </div>
  783. <div class="camera-grid" id="camera-grid"></div>
  784. </div>
  785. </div>
  786. </div>
  787. </div><!-- /3区 -->
  788. <!-- ======== 4区 ======== -->
  789. <div class="panel-col">
  790. <!-- 实验环境安全智能感知 -->
  791. <div class="panel" style="flex:7;min-height:0;display:flex;flex-direction:column">
  792. <div class="border-beam"></div>
  793. <svg class="pc tl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  794. <svg class="pc tr" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  795. <svg class="pc bl" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  796. <svg class="pc br" viewBox="0 0 14 14"><path d="M0 14 V0 H14" fill="none" stroke="rgba(30,144,255,0.85)" stroke-width="1.5"/></svg>
  797. <div class="panel-header">
  798. <div class="panel-header-icon">🌡️</div>
  799. <span class="panel-title">实验环境安全智能感知</span>
  800. <div class="status-dot red" style="margin-left:auto"></div>
  801. </div>
  802. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  803. <div class="sensor-scroll-wrap">
  804. <div class="sensor-scroll-inner" id="sensor-list"></div>
  805. </div>
  806. </div>
  807. </div>
  808. <!-- 实验室实时风险预警 -->
  809. <div class="panel" style="flex:3;min-height:0;display:flex;flex-direction:column">
  810. <div class="border-beam"></div>
  811. <div class="panel-header">
  812. <div class="panel-header-icon">⚠️</div>
  813. <span class="panel-title">实验室实时风险预警</span>
  814. <div style="margin-left:auto;display:flex;align-items:center;gap:10px;flex-shrink:0">
  815. <span style="font-size:25px;color:var(--text-dim)">本月</span>
  816. <span style="font-size:50px;font-weight:700;color:#f59e0b">42</span>
  817. <span style="font-size:25px;color:var(--text-dim)">次</span>
  818. </div>
  819. </div>
  820. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  821. <div class="warn-scroll-wrap">
  822. <div class="warn-scroll-inner" id="warn-list"></div>
  823. </div>
  824. </div>
  825. </div>
  826. </div><!-- /4区 -->
  827. </div><!-- /main-content -->
  828. </div><!-- /scale-root -->
  829. <script>
  830. // ====================================================
  831. // SCALE
  832. // ====================================================
  833. // ====================================================
  834. // INIT MONITOR ON LOAD
  835. // ====================================================
  836. document.addEventListener('DOMContentLoaded', () => {
  837. if (document.documentElement.requestFullscreen)
  838. document.documentElement.requestFullscreen().catch(() => {});
  839. buildTree();
  840. buildCameras();
  841. });
  842. const WD = ['日','一','二','三','四','五','六'];
  843. function tick() {
  844. const n = new Date();
  845. const t = `${String(n.getHours()).padStart(2,'0')}:${String(n.getMinutes()).padStart(2,'0')}:${String(n.getSeconds()).padStart(2,'0')}`;
  846. const d = `${n.getFullYear()}年${n.getMonth()+1}月${n.getDate()}日 星期${WD[n.getDay()]}`;
  847. document.getElementById('clock-time').textContent = t;
  848. document.getElementById('clock-date').textContent = d;
  849. }
  850. setInterval(tick, 1000); tick();
  851. // ====================================================
  852. // NEBULA BACKGROUND
  853. // ====================================================
  854. (function () {
  855. const c = document.getElementById('nebula-canvas');
  856. const ctx = c.getContext('2d');
  857. let W, H, stars = [], t = 0;
  858. function resize() { W = c.width = window.innerWidth; H = c.height = window.innerHeight; }
  859. window.addEventListener('resize', resize); resize();
  860. for (let i = 0; i < 500; i++)
  861. stars.push({ x: Math.random()*9600, y: Math.random()*2800, r: Math.random()*1.5+0.3, a: Math.random()*0.8+0.2, va: Math.random()*0.02-0.01 });
  862. function draw() {
  863. t++;
  864. ctx.clearRect(0, 0, W, H);
  865. const g1 = ctx.createRadialGradient(W*0.22, H*0.35, 40, W*0.22, H*0.35, 420);
  866. g1.addColorStop(0, 'rgba(0,60,180,0.09)'); g1.addColorStop(1, 'transparent');
  867. ctx.fillStyle = g1; ctx.fillRect(0,0,W,H);
  868. const g2 = ctx.createRadialGradient(W*0.78, H*0.65, 30, W*0.78, H*0.65, 360);
  869. g2.addColorStop(0, 'rgba(0,100,220,0.08)'); g2.addColorStop(1, 'transparent');
  870. ctx.fillStyle = g2; ctx.fillRect(0,0,W,H);
  871. stars.forEach(s => {
  872. s.a += s.va; if (s.a > 1 || s.a < 0.1) s.va *= -1;
  873. const hue = 200 + Math.sin(t * 0.01 + s.x) * 30;
  874. ctx.beginPath(); ctx.arc(s.x*(W/9600), s.y*(H/2800), s.r, 0, Math.PI*2);
  875. ctx.fillStyle = `hsla(${hue},80%,80%,${s.a})`; ctx.fill();
  876. });
  877. requestAnimationFrame(draw);
  878. }
  879. draw();
  880. })();
  881. // ====================================================
  882. // FLIP COUNTER
  883. // ====================================================
  884. function renderFlip(id, val) {
  885. const el = document.getElementById(id); if (!el) return;
  886. el.innerHTML = String(val).padStart(4,'0').split('').map(d => `<div class="flip-digit">${d}</div>`).join('');
  887. }
  888. function animFlip(id, from, to, dur) {
  889. const s = Date.now();
  890. (function tick() {
  891. const p = Math.min((Date.now()-s)/dur, 1);
  892. renderFlip(id, Math.round(from + (to-from)*p));
  893. if (p < 1) requestAnimationFrame(tick);
  894. })();
  895. }
  896. renderFlip('flip-total', 1284); renderFlip('flip-current', 47);
  897. setTimeout(() => animFlip('flip-total', 0, 1284, 2000), 600);
  898. setTimeout(() => animFlip('flip-current', 0, 47, 1500), 900);
  899. // ====================================================
  900. // SENSOR LIST (4区上)
  901. // ====================================================
  902. const LABS = [
  903. {name:'化学分析实验室', room:'A301', unit:'化学研究所', t:22.5, h:58, tvoc:0.82, co2:650, o2:20.9, alert:true},
  904. {name:'生物安全实验室', room:'B201', unit:'生物研究所', t:20.1, h:62, tvoc:0.18, co2:580, o2:20.8, alert:false},
  905. {name:'材料测试实验室', room:'C401', unit:'材料研究所', t:24.0, h:45, tvoc:0.09, co2:520, o2:20.9, alert:false},
  906. {name:'精密仪器实验室', room:'A205', unit:'物理研究所', t:21.5, h:50, tvoc:0.14, co2:490, o2:20.9, alert:false},
  907. {name:'有机合成实验室', room:'B302', unit:'化学研究所', t:23.8, h:55, tvoc:2.10, co2:725, o2:20.5, alert:true},
  908. {name:'光学检测实验室', room:'C203', unit:'物理研究所', t:22.0, h:52, tvoc:0.11, co2:510, o2:20.9, alert:false},
  909. {name:'高压实验室', room:'D101', unit:'工程研究所', t:25.5, h:48, tvoc:0.30, co2:600, o2:20.7, alert:false},
  910. {name:'低温实验室', room:'D205', unit:'物理研究所', t:18.0, h:40, tvoc:0.07, co2:480, o2:20.9, alert:false},
  911. {name:'核磁共振室', room:'A302', unit:'化学研究所', t:20.5, h:54, tvoc:0.05, co2:505, o2:20.9, alert:false},
  912. {name:'质谱分析室', room:'A303', unit:'化学研究所', t:21.0, h:53, tvoc:0.19, co2:530, o2:20.8, alert:false},
  913. ];
  914. function buildSensorList() {
  915. const el = document.getElementById('sensor-list'); if (!el) return;
  916. const all = [...LABS, ...LABS];
  917. el.innerHTML = all.map(lab => `
  918. <div class="sensor-item ${lab.alert ? 'alert' : ''}">
  919. <div class="sensor-item-head">
  920. <span class="sensor-name">${lab.name}(${lab.room})</span>
  921. <span class="sensor-unit">${lab.unit}</span>
  922. ${lab.alert
  923. ? '<span style="color:var(--red);font-size:25px;animation:blinkRed 0.8s infinite">🚨 告警</span>'
  924. : '<span style="color:var(--green);font-size:25px">● 正常</span>'}
  925. </div>
  926. <div class="sensor-metrics">
  927. <div class="sensor-metric">🌡️ ${lab.t}°C</div>
  928. <div class="sensor-metric">💧 ${lab.h}%</div>
  929. <div class="sensor-metric ${lab.tvoc > 0.6 ? 'alarm' : ''}">🧪 TVOC ${lab.tvoc}</div>
  930. <div class="sensor-metric ${lab.co2 > 700 ? 'alarm' : ''}">💨 CO₂ ${lab.co2}</div>
  931. <div class="sensor-metric">🫧 O₂ ${lab.o2}%</div>
  932. </div>
  933. </div>`).join('');
  934. }
  935. buildSensorList();
  936. // ====================================================
  937. // WARNING LIST (4区下)
  938. // ====================================================
  939. const WARNS = [
  940. {lab:'化学分析实验室', room:'A301', unit:'化学研究所', metric:'TVOC浓度超标', val:'2.85 mg/m³', time:'2026-03-05 14:32:18'},
  941. {lab:'有机合成实验室', room:'B302', unit:'化学研究所', metric:'CO₂浓度偏高', val:'725 ppm', time:'2026-03-05 13:58:44'},
  942. {lab:'高压实验室', room:'D101', unit:'工程研究所', metric:'温度异常', val:'38.5 °C', time:'2026-03-05 12:15:07'},
  943. {lab:'生物安全实验室', room:'B201', unit:'生物研究所', metric:'湿度超标', val:'88% RH', time:'2026-03-05 11:40:22'},
  944. {lab:'材料测试实验室', room:'C401', unit:'材料研究所', metric:'TVOC超标', val:'1.2 mg/m³', time:'2026-03-05 10:08:55'},
  945. {lab:'光学检测实验室', room:'C203', unit:'物理研究所', metric:'O₂浓度偏低', val:'19.2 %', time:'2026-03-05 09:22:33'},
  946. {lab:'精密仪器实验室', room:'A205', unit:'物理研究所', metric:'温度超标', val:'28.5 °C', time:'2026-03-05 08:45:11'},
  947. {lab:'低温实验室', room:'D205', unit:'物理研究所', metric:'气压异常', val:'85 kPa', time:'2026-03-04 23:12:40'},
  948. ];
  949. function buildWarnList() {
  950. const el = document.getElementById('warn-list'); if (!el) return;
  951. const all = [...WARNS, ...WARNS];
  952. el.innerHTML = all.map(w => `
  953. <div class="warn-item">
  954. <div class="warn-item-head">
  955. <span class="warn-lab">🚨 ${w.lab}(${w.room})- ${w.unit}</span>
  956. <span class="warn-time">${w.time}</span>
  957. </div>
  958. <div class="warn-detail">异常指标:<span class="warn-metric-val">${w.metric} ${w.val}</span></div>
  959. </div>`).join('');
  960. }
  961. buildWarnList();
  962. // ====================================================
  963. // ALERT MODAL + CAMERA
  964. // ====================================================
  965. function closeAlert() { document.getElementById('alert-modal').classList.remove('show'); }
  966. let alertCamRAF = null;
  967. function startAlertCam() {
  968. const canvas = document.getElementById('alert-cam-canvas');
  969. if (!canvas || canvas._alertRunning) return;
  970. canvas._alertRunning = true;
  971. const ctx = canvas.getContext('2d');
  972. const W = 900, H = 700;
  973. let t = Math.random() * 1000;
  974. const noise = Array.from({length:300}, () => ({x:Math.random(), y:Math.random(), s:Math.random()*2.5+0.5, a:Math.random()*0.25}));
  975. function frame() {
  976. t += 0.4;
  977. ctx.clearRect(0, 0, W, H);
  978. // Background gradient (dark green-tinted night-vision feel with red emergency tint)
  979. const bg = ctx.createLinearGradient(0, 0, 0, H);
  980. bg.addColorStop(0, 'hsl(210,45%,5%)');
  981. bg.addColorStop(1, 'hsl(0,30%,4%)');
  982. ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
  983. // Perspective floor grid
  984. ctx.strokeStyle = 'rgba(20,65,140,0.07)'; ctx.lineWidth = 0.5;
  985. const vp = {x: W/2, y: H*0.44};
  986. for (let gx = 0; gx <= 12; gx++) { const fx = W*gx/12; ctx.beginPath(); ctx.moveTo(fx,H); ctx.lineTo(vp.x+(fx-W/2)*0.28,vp.y); ctx.stroke(); }
  987. for (let gy = 0; gy <= 6; gy++) { const fy = H*0.44+(H*0.56)*(gy/6); const wd = W*(0.25+0.75*(gy/6)); ctx.beginPath(); ctx.moveTo((W-wd)/2,fy); ctx.lineTo((W+wd)/2,fy); ctx.stroke(); }
  988. // Lab furniture silhouettes
  989. ctx.fillStyle = 'rgba(0,30,80,0.45)';
  990. ctx.fillRect(W*0.05, H*0.52, W*0.38, H*0.12); // bench left
  991. ctx.fillRect(W*0.57, H*0.52, W*0.38, H*0.12); // bench right
  992. ctx.fillStyle = 'rgba(0,18,50,0.55)';
  993. ctx.fillRect(W*0.08, H*0.35, W*0.09, H*0.17); // cabinet
  994. ctx.fillRect(W*0.60, H*0.33, W*0.12, H*0.19); // equipment
  995. // Person silhouette (lab worker)
  996. const px = W*(0.4 + Math.sin(t*0.008)*0.03);
  997. const py = H*(0.58 + Math.cos(t*0.006)*0.015);
  998. ctx.fillStyle = 'rgba(110,160,240,0.6)';
  999. ctx.beginPath(); ctx.arc(px, py - H*0.1, W*0.028, 0, Math.PI*2); ctx.fill(); // head
  1000. ctx.fillRect(px - W*0.022, py - H*0.08, W*0.044, H*0.1); // body
  1001. // Red emergency scan line
  1002. const scanY = (t * 0.8) % H;
  1003. const scanG = ctx.createLinearGradient(0, scanY-8, 0, scanY+8);
  1004. scanG.addColorStop(0, 'transparent');
  1005. scanG.addColorStop(0.5, 'rgba(239,68,68,0.18)');
  1006. scanG.addColorStop(1, 'transparent');
  1007. ctx.fillStyle = scanG; ctx.fillRect(0, scanY-8, W, 16);
  1008. // Noise
  1009. noise.forEach(n => {
  1010. ctx.fillStyle = `rgba(200,210,240,${n.a*0.45})`;
  1011. ctx.fillRect(n.x*W, n.y*H, n.s, n.s);
  1012. if (Math.random() < 0.015) { n.x = Math.random(); n.y = Math.random(); }
  1013. });
  1014. // Red vignette pulse (emergency)
  1015. const vig = ctx.createRadialGradient(W/2, H/2, H*0.25, W/2, H/2, H*0.85);
  1016. const vigAlpha = 0.12 + Math.sin(t*0.08)*0.06;
  1017. vig.addColorStop(0, 'transparent');
  1018. vig.addColorStop(1, `rgba(200,0,0,${vigAlpha})`);
  1019. ctx.fillStyle = vig; ctx.fillRect(0, 0, W, H);
  1020. alertCamRAF = requestAnimationFrame(frame);
  1021. }
  1022. frame();
  1023. }
  1024. setTimeout(() => {
  1025. document.getElementById('alert-modal').classList.add('show');
  1026. startAlertCam();
  1027. }, 5000);
  1028. // ====================================================
  1029. // ECHARTS
  1030. // ====================================================
  1031. function initCharts() {
  1032. const TOOLTIP_CFG = {
  1033. backgroundColor:'rgba(3,14,42,0.92)',
  1034. borderColor:'rgba(30,144,255,0.3)',
  1035. textStyle:{ color:'#a8cce8', fontSize:28 }
  1036. };
  1037. // --- 环形图: 实验室总数分级 ---
  1038. const dEl = document.getElementById('chart-donut');
  1039. if (dEl) {
  1040. const c = echarts.init(dEl, null, {renderer:'canvas', devicePixelRatio:2});
  1041. c.setOption({
  1042. backgroundColor:'transparent',
  1043. tooltip:{ trigger:'item', formatter:'{b}: {c}间 ({d}%)', ...TOOLTIP_CFG },
  1044. graphic:[{
  1045. type:'text', left:'center', top:'40%',
  1046. style:{ text:'128', fill:'#ffd740', font:'bold 80px Arial', textAlign:'center' }
  1047. },{
  1048. type:'text', left:'center', top:'58%',
  1049. style:{ text:'实验室总数(间)', fill:'rgba(168,204,232,0.65)', font:'22px Arial', textAlign:'center' }
  1050. }],
  1051. series:[{
  1052. type:'pie', radius:['42%','68%'], center:['50%','50%'], startAngle:100,
  1053. itemStyle:{ borderRadius:6, borderColor:'rgba(3,14,31,0.6)', borderWidth:3 },
  1054. label:{
  1055. show:true,
  1056. formatter: params => `{lvl|${params.name}}\n{cnt|${params.value}间}\n{pct|${params.percent}%}`,
  1057. rich:{
  1058. lvl:{ fontSize:24, fontWeight:700, color:'#ddf0ff', lineHeight:36 },
  1059. cnt:{ fontSize:30, fontWeight:900, color:'#ffd740', lineHeight:42 },
  1060. pct:{ fontSize:22, color:'rgba(168,204,232,0.6)', lineHeight:32 }
  1061. },
  1062. distanceToLabelLine:8
  1063. },
  1064. labelLine:{
  1065. show:true, length:20, length2:25,
  1066. lineStyle:{ color:'rgba(30,144,255,0.45)', width:2 }
  1067. },
  1068. data:[
  1069. {value:12, name:'I级', itemStyle:{color:'#cc0000', shadowBlur:12, shadowColor:'rgba(204,0,0,0.5)'}},
  1070. {value:28, name:'II级', itemStyle:{color:'#ff8000', shadowBlur:12, shadowColor:'rgba(255,128,0,0.5)'}},
  1071. {value:45, name:'III级', itemStyle:{color:'#ffcc00', shadowBlur:12, shadowColor:'rgba(255,204,0,0.5)'}},
  1072. {value:43, name:'IV级', itemStyle:{color:'#0066cc', shadowBlur:12, shadowColor:'rgba(0,102,204,0.5)'}}
  1073. ],
  1074. emphasis:{
  1075. scale:true, scaleSize:8,
  1076. itemStyle:{ shadowBlur:30, shadowColor:'rgba(30,144,255,0.6)' },
  1077. label:{ fontSize:28 }
  1078. }
  1079. }]
  1080. });
  1081. }
  1082. // --- 堆叠柱状图: 安全分级统计 ---
  1083. const stEl = document.getElementById('chart-stack');
  1084. if (stEl) {
  1085. const c = echarts.init(stEl, null, {renderer:'canvas', devicePixelRatio:2});
  1086. const cols = ['#cc0000','#ff8000','#ffcc00','#0066cc'];
  1087. const lvls = ['I级','II级','III级','IV级'];
  1088. const units = ['化学所','生物所','材料所','物理所','工程所','核能所','信息所','环境所','计量所','医学所'];
  1089. const totals = [28,22,18,24,16,12,20,15,10,14];
  1090. const dat = [
  1091. [2,3,5,4,2,1,3,2,1,2],
  1092. [5,6,4,7,4,3,5,4,3,4],
  1093. [9,8,6,8,5,5,7,5,4,5],
  1094. [12,5,3,5,5,3,5,4,2,3]
  1095. ];
  1096. const xL = units.map((u,i) => `${u}\n(${totals[i]})`);
  1097. c.setOption({
  1098. backgroundColor:'transparent',
  1099. tooltip:{ trigger:'axis', axisPointer:{type:'shadow'}, ...TOOLTIP_CFG },
  1100. legend:{ data:lvls, top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'rect', itemWidth:25, itemHeight:15 },
  1101. grid:{ left:30, right:8, top:55, bottom:110, containLabel:true },
  1102. xAxis:{ type:'category', data:xL, axisLabel:{color:'#5890b8',fontSize:22,interval:0,lineHeight:35}, axisLine:{lineStyle:{color:'rgba(30,144,255,0.2)'}}, axisTick:{show:false} },
  1103. yAxis:{ type:'value', name:'间', nameTextStyle:{color:'#5890b8',fontSize:25}, axisLabel:{color:'#5890b8',fontSize:25}, axisLine:{show:false}, splitLine:{lineStyle:{color:'rgba(30,144,255,0.1)'}} },
  1104. dataZoom:[{ type:'inside', startValue:0, endValue:5 }],
  1105. series:lvls.map((n,i) => ({
  1106. name:n, type:'bar', stack:'total', barMaxWidth:55,
  1107. data:dat[i].map(v => ({value:v, itemStyle:{color:cols[i], opacity:0.88}})),
  1108. emphasis:{ itemStyle:{opacity:1} }
  1109. }))
  1110. });
  1111. let idx = 0;
  1112. setInterval(() => {
  1113. idx++;
  1114. c.dispatchAction({ type:'dataZoom', startValue:idx, endValue:idx+5 });
  1115. if (idx >= units.length-5) idx = -1;
  1116. }, 5000);
  1117. }
  1118. // --- 折线图: 进入人数走势 ---
  1119. const lnEl = document.getElementById('chart-line');
  1120. if (lnEl) {
  1121. const c = echarts.init(lnEl, null, {renderer:'canvas', devicePixelRatio:2});
  1122. c.setOption({
  1123. backgroundColor:'transparent',
  1124. tooltip:{ trigger:'axis', ...TOOLTIP_CFG },
  1125. legend:{ data:['进入人数','在场人数'], top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'circle', itemWidth:20, itemHeight:20 },
  1126. grid:{ left:28, right:8, top:45, bottom:50, containLabel:true },
  1127. xAxis:{ type:'category', data:['00:00','03:00','06:00','09:00','12:00','15:00','18:00','21:00','24:00'], axisLabel:{color:'#5890b8',fontSize:22}, axisLine:{lineStyle:{color:'rgba(30,144,255,0.2)'}}, axisTick:{show:false} },
  1128. yAxis:{ type:'value', axisLabel:{color:'#5890b8',fontSize:22}, axisLine:{show:false}, splitLine:{lineStyle:{color:'rgba(30,144,255,0.1)'}} },
  1129. series:[
  1130. { name:'进入人数', type:'line', data:[0,0,2,86,128,145,160,90,30], smooth:true, symbol:'circle', symbolSize:12, lineStyle:{color:'#1e90ff',width:5}, itemStyle:{color:'#1e90ff'}, areaStyle:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:'rgba(30,144,255,0.32)'},{offset:1,color:'rgba(30,144,255,0.02)'}])} },
  1131. { name:'在场人数', type:'line', data:[0,0,2,62,98,108,120,72,20], smooth:true, symbol:'circle', symbolSize:12, lineStyle:{color:'#ffd740',width:5}, itemStyle:{color:'#ffd740'}, areaStyle:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:'rgba(255,215,64,0.22)'},{offset:1,color:'rgba(255,215,64,0.01)'}])} }
  1132. ]
  1133. });
  1134. }
  1135. // --- 仪表盘: 设备在线率 ---
  1136. const ggEl = document.getElementById('chart-gauge');
  1137. if (ggEl) {
  1138. const c = echarts.init(ggEl, null, {renderer:'canvas', devicePixelRatio:2});
  1139. c.setOption({
  1140. backgroundColor:'transparent',
  1141. series:[{
  1142. type:'gauge', radius:'90%', center:['50%','60%'],
  1143. startAngle:210, endAngle:-30, min:0, max:100, splitNumber:5,
  1144. axisLine:{ lineStyle:{ width:30, color:[[0.3,'#ef4444'],[0.6,'#f59e0b'],[1,'#1e90ff']] } },
  1145. axisTick:{show:false}, splitLine:{show:false}, axisLabel:{show:false},
  1146. pointer:{ icon:'path://M12.8,0.7l12.3,0 M0,0 l9.2,12.4 M0,0 l2.2,-1.6', offsetCenter:[0,'-60%'], width:8, length:'60%', itemStyle:{color:'#1e90ff'} },
  1147. detail:{ valueAnimation:true, formatter:'{value}%', color:'#ffd740', fontSize:45, fontWeight:700, offsetCenter:[0,'30%'] },
  1148. title:{ show:true, offsetCenter:[0,'62%'], color:'rgba(110,165,210,0.6)', fontSize:25 },
  1149. data:[{value:94.5, name:'在线率'}]
  1150. }]
  1151. });
  1152. }
  1153. // --- 环形图: 设备分类 (2区设备统计上部) ---
  1154. const rgEl = document.getElementById('chart-ring');
  1155. if (rgEl) {
  1156. const c = echarts.init(rgEl, null, {renderer:'canvas', devicePixelRatio:2});
  1157. const ringData = [
  1158. {value:680, name:'检测设备', itemStyle:{color:'#1e90ff', shadowBlur:8, shadowColor:'rgba(30,144,255,0.5)'}},
  1159. {value:520, name:'分析仪器', itemStyle:{color:'#4361ee', shadowBlur:8, shadowColor:'rgba(67,97,238,0.5)'}},
  1160. {value:380, name:'制备设备', itemStyle:{color:'#00e676', shadowBlur:8, shadowColor:'rgba(0,230,118,0.5)'}},
  1161. {value:280, name:'安全设备', itemStyle:{color:'#ffd740', shadowBlur:8, shadowColor:'rgba(255,215,64,0.5)'}},
  1162. {value:240, name:'辅助设备', itemStyle:{color:'#00e5c8', shadowBlur:8, shadowColor:'rgba(0,229,200,0.5)'}},
  1163. {value:358, name:'其他', itemStyle:{color:'#f97316', shadowBlur:8, shadowColor:'rgba(249,115,22,0.5)'}}
  1164. ];
  1165. const total = ringData.reduce((s,d)=>s+d.value,0);
  1166. const ringCountMap = Object.fromEntries(ringData.map(d=>[d.name,d.value]));
  1167. c.setOption({
  1168. backgroundColor:'transparent',
  1169. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1170. legend:{
  1171. orient:'vertical', right:'1%', top:'middle',
  1172. icon:'circle', itemWidth:24, itemHeight:24, itemGap:18,
  1173. textStyle:{ color:'#a8cce8', fontSize:20 },
  1174. formatter: name => {
  1175. const v = ringCountMap[name];
  1176. const pct = (v/total*100).toFixed(1);
  1177. return `{nm|${name}} {vl|${v}台} {pt|${pct}%}`;
  1178. },
  1179. rich:{
  1180. nm:{ fontSize:20, color:'#a8cce8', width:80 },
  1181. vl:{ fontSize:23, fontWeight:700, color:'#fff', width:70 },
  1182. pt:{ fontSize:20, color:'#ffd740', width:55 }
  1183. }
  1184. },
  1185. series:[{
  1186. type:'pie', radius:['38%','62%'], center:['32%','50%'],
  1187. itemStyle:{ borderRadius:4, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1188. label:{ show:true, formatter:'{c}台', fontSize:20, color:'#a8cce8' },
  1189. labelLine:{ length:10, length2:10, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1190. data: ringData,
  1191. emphasis:{ scale:true, scaleSize:5, itemStyle:{ shadowBlur:20, shadowColor:'rgba(30,144,255,0.6)' } }
  1192. }]
  1193. });
  1194. }
  1195. // --- 饼图: 设备状态(正常/维修/报废) ---
  1196. const psEl = document.getElementById('chart-pie-status');
  1197. if (psEl) {
  1198. const c = echarts.init(psEl, null, {renderer:'canvas', devicePixelRatio:2});
  1199. const statusData = [
  1200. {value:2180, name:'正常', itemStyle:{color:'#00e676', shadowBlur:10, shadowColor:'rgba(0,230,118,0.5)'}},
  1201. {value:198, name:'维修', itemStyle:{color:'#f59e0b', shadowBlur:10, shadowColor:'rgba(245,158,11,0.5)'}},
  1202. {value:80, name:'报废', itemStyle:{color:'#ef4444', shadowBlur:10, shadowColor:'rgba(239,68,68,0.5)'}}
  1203. ];
  1204. const smMap = Object.fromEntries(statusData.map(d=>[d.name,d.value]));
  1205. c.setOption({
  1206. backgroundColor:'transparent',
  1207. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1208. legend:{ show:false },
  1209. series:[{
  1210. type:'pie', radius:['35%','58%'], center:['50%','55%'],
  1211. itemStyle:{ borderRadius:5, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1212. label:{ show:true, formatter:'{b}\n{c}台\n{d}%', fontSize:20, color:'#a8cce8', lineHeight:30 },
  1213. labelLine:{ length:14, length2:10, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1214. data: statusData,
  1215. emphasis:{ scale:true, scaleSize:5, itemStyle:{ shadowBlur:20, shadowColor:'rgba(30,144,255,0.6)' } }
  1216. }]
  1217. });
  1218. }
  1219. // --- 饼图: 使用状态(使用/空闲) ---
  1220. const puEl = document.getElementById('chart-pie-usage');
  1221. if (puEl) {
  1222. const c = echarts.init(puEl, null, {renderer:'canvas', devicePixelRatio:2});
  1223. const usageData = [
  1224. {value:1534, name:'使用', itemStyle:{color:'#1e90ff', shadowBlur:14, shadowColor:'rgba(30,144,255,0.6)'}},
  1225. {value:924, name:'空闲', itemStyle:{color:'#00e5c8', shadowBlur:14, shadowColor:'rgba(0,229,200,0.5)'}}
  1226. ];
  1227. c.setOption({
  1228. backgroundColor:'transparent',
  1229. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1230. legend:{ show:false },
  1231. series:[{
  1232. type:'pie', radius:['35%','60%'], center:['50%','55%'],
  1233. itemStyle:{ borderRadius:6, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1234. label:{ show:true, formatter:'{b}\n{c}台\n{d}%', fontSize:22, color:'#a8cce8', lineHeight:32 },
  1235. labelLine:{ length:16, length2:12, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1236. data: usageData,
  1237. emphasis:{ scale:true, scaleSize:6, itemStyle:{ shadowBlur:24, shadowColor:'rgba(30,144,255,0.7)' } }
  1238. }]
  1239. });
  1240. }
  1241. }
  1242. initCharts();
  1243. // ====================================================
  1244. // MONITOR TREE
  1245. // ====================================================
  1246. function buildTree() {
  1247. const el = document.getElementById('building-tree'); if (!el) return;
  1248. const data = {label:'安科院主园区', children:[
  1249. {label:'综合实验楼A', children:[
  1250. {label:'1层', children:[{label:'A101 化学实验室'},{label:'A102 分析室'}]},
  1251. {label:'2层', children:[{label:'A201 生物实验室'}]},
  1252. {label:'3层', children:[{label:'A301 有机合成室'},{label:'A302 核磁共振室'},{label:'A303 质谱室'}]},
  1253. {label:'4层', children:[{label:'A401 X射线室'}]}
  1254. ]},
  1255. {label:'物理实验楼B', children:[
  1256. {label:'1层', children:[{label:'B101 光学实验室'}]},
  1257. {label:'2层', children:[{label:'B201 低温实验室'}]}
  1258. ]},
  1259. {label:'工程技术楼C', children:[
  1260. {label:'1层', children:[{label:'C101 机械加工室'}]},
  1261. {label:'2层', children:[{label:'C201 材料测试室'}]}
  1262. ]}
  1263. ]};
  1264. el.innerHTML = renderT(data, 0);
  1265. el.addEventListener('click', e => {
  1266. const l = e.target.closest('.tree-node-label'); if (!l) return;
  1267. l.classList.toggle('selected');
  1268. const ch = l.parentElement.querySelector('.tree-children');
  1269. const ar = l.querySelector('.arrow');
  1270. if (ch) ch.classList.toggle('open');
  1271. if (ar) ar.classList.toggle('open');
  1272. });
  1273. }
  1274. function renderT(node, depth) {
  1275. const isLeaf = !node.children || !node.children.length;
  1276. const icon = ['🏢','🏗️','📐','🔬'][Math.min(depth,3)];
  1277. let h = `<div class="tree-node"><div class="tree-node-label" style="padding-left:${depth*12+8}px">
  1278. <span class="arrow ${depth===0?'open':''}">${isLeaf ? '&nbsp;&nbsp;' : '▶'}</span>
  1279. <span>${icon}</span><span>${node.label}</span></div>`;
  1280. if (!isLeaf) {
  1281. h += `<div class="tree-children ${depth===0?'open':''}">`;
  1282. node.children.forEach(c => h += renderT(c, depth+1));
  1283. h += '</div>';
  1284. }
  1285. return h + '</div>';
  1286. }
  1287. // ====================================================
  1288. // CAMERAS
  1289. // ====================================================
  1290. const CAMS = ['A301 有机合成室','A302 核磁共振室','A303 质谱室','A301 走廊','A302 走廊','A303 走廊','A层公共区域','A层安全通道','A层出入口'];
  1291. function buildCameras() {
  1292. const g = document.getElementById('camera-grid'); if (!g) return;
  1293. g.innerHTML = '';
  1294. for (let i = 0; i < 9; i++) {
  1295. const cell = document.createElement('div');
  1296. cell.className = 'camera-cell' + (i===0 ? ' ai-cam' : '');
  1297. const cv = document.createElement('canvas');
  1298. cv.style.cssText = 'width:100%;height:100%;display:block';
  1299. cell.appendChild(cv);
  1300. cell.innerHTML += `<div class="camera-overlay"></div><div class="camera-label">${CAMS[i]}</div><div class="camera-rec">REC</div>${i===0?'<div class="camera-ai-badge">🤖 AI检测</div>':''}`;
  1301. if (i===0) {
  1302. const box = document.createElement('div');
  1303. box.className = 'ai-detection-box';
  1304. box.style.cssText = 'left:28%;top:18%;width:22%;height:38%';
  1305. box.innerHTML = '<div class="ai-detection-label">危险行为: 未佩戴防护</div>';
  1306. cell.appendChild(box);
  1307. }
  1308. g.appendChild(cell);
  1309. setTimeout(() => drawFakeCam(cv, i), 150);
  1310. }
  1311. }
  1312. function drawFakeCam(canvas, idx) {
  1313. const ctx = canvas.getContext('2d');
  1314. const par = canvas.parentElement;
  1315. let pw, ph;
  1316. function sz() { pw = canvas.width = par.offsetWidth; ph = canvas.height = par.offsetHeight; }
  1317. sz(); window.addEventListener('resize', sz);
  1318. let t = Math.random() * 1000;
  1319. const noise = Array.from({length:200}, () => ({x:Math.random(),y:Math.random(),s:Math.random()*3,a:Math.random()*0.3}));
  1320. function frame() {
  1321. t += 0.5; if (!pw || !ph) sz();
  1322. ctx.clearRect(0,0,pw,ph);
  1323. const bg = ctx.createLinearGradient(0,0,0,ph);
  1324. bg.addColorStop(0,'hsl(210,42%,5%)'); bg.addColorStop(1,'hsl(220,30%,3%)');
  1325. ctx.fillStyle = bg; ctx.fillRect(0,0,pw,ph);
  1326. ctx.strokeStyle = 'rgba(20,70,150,0.06)'; ctx.lineWidth = 0.5;
  1327. const vp = {x:pw/2, y:ph*0.45};
  1328. for (let gx=0;gx<=10;gx++) { const fx=pw*gx/10; ctx.beginPath();ctx.moveTo(fx,ph);ctx.lineTo(vp.x+(fx-pw/2)*0.3,vp.y);ctx.stroke(); }
  1329. for (let gy=0;gy<=5;gy++) { const fy=ph*0.45+(ph*0.55)*(gy/5); const wd=pw*(0.3+0.7*(gy/5)); ctx.beginPath();ctx.moveTo((pw-wd)/2,fy);ctx.lineTo((pw+wd)/2,fy);ctx.stroke(); }
  1330. ctx.fillStyle='rgba(0,35,90,0.4)'; ctx.fillRect(pw*0.1,ph*0.55,pw*0.35,ph*0.1); ctx.fillRect(pw*0.55,ph*0.55,pw*0.35,ph*0.1);
  1331. ctx.fillStyle='rgba(0,18,55,0.5)'; ctx.fillRect(pw*0.12,ph*0.4,pw*0.08,ph*0.15); ctx.fillRect(pw*0.58,ph*0.38,pw*0.1,ph*0.17);
  1332. const np = [2,1,3,1,2,1,0,1,2][idx]||1;
  1333. for (let p=0;p<np;p++) {
  1334. const px=pw*(0.3+p*0.15+Math.sin(t*0.01+p)*0.02);
  1335. const py=ph*(0.6+Math.cos(t*0.008+p)*0.02);
  1336. ctx.fillStyle='rgba(120,170,255,0.65)'; ctx.beginPath(); ctx.arc(px,py,pw*0.025,0,Math.PI*2); ctx.fill();
  1337. ctx.fillStyle='rgba(70,130,220,0.4)'; ctx.fillRect(px-pw*0.02,py+pw*0.025,pw*0.04,ph*0.08);
  1338. }
  1339. const sl = (t*0.5) % ph; ctx.fillStyle='rgba(30,144,255,0.04)'; ctx.fillRect(0,sl,pw,2);
  1340. noise.forEach(n => {
  1341. ctx.fillStyle=`rgba(170,205,255,${n.a*0.5})`; ctx.fillRect(n.x*pw,n.y*ph,n.s,n.s);
  1342. if (Math.random()<0.02) { n.x=Math.random(); n.y=Math.random(); }
  1343. });
  1344. requestAnimationFrame(frame);
  1345. }
  1346. frame();
  1347. }
  1348. // ====================================================
  1349. // RESIZE CHARTS
  1350. // ====================================================
  1351. window.addEventListener('resize', () => {
  1352. ['chart-donut','chart-stack','chart-line','chart-gauge','chart-ring','chart-pie-status','chart-pie-usage'].forEach(id => {
  1353. const el = document.getElementById(id);
  1354. if (el) { const c = echarts.getInstanceByDom(el); if (c) c.resize(); }
  1355. });
  1356. });
  1357. </script>
  1358. </body>
  1359. </html>