index-v2.html 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  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 { width:100%; height:100%; }
  462. </style>
  463. </head>
  464. <body>
  465. <canvas id="nebula-canvas"></canvas>
  466. <!-- ===== ALERT MODAL ===== -->
  467. <div id="alert-modal">
  468. <div class="alert-modal-inner">
  469. <div class="alert-scan-line"></div>
  470. <div class="alert-modal-header">
  471. <span class="alert-icon">🚨</span>
  472. <div>
  473. <div class="alert-title">⚡ 系统预警 · ALERT</div>
  474. <div class="alert-subtitle">LABORATORY SAFETY MONITORING SYSTEM · EMERGENCY</div>
  475. </div>
  476. </div>
  477. <div class="alert-modal-body">
  478. <!-- 左侧: 实验室实时监控画面 360×280 -->
  479. <div class="alert-cam-wrap">
  480. <div class="alert-cam-label">告警实验室实时监控画面</div>
  481. <div class="alert-cam-box">
  482. <canvas id="alert-cam-canvas" width="900" height="700"></canvas>
  483. <div class="alert-cam-overlay"></div>
  484. <div class="alert-cam-id">CAM · A301-02</div>
  485. <div class="alert-cam-rec">REC</div>
  486. <div class="alert-cam-bottom">
  487. <span class="alert-cam-name">化学分析实验室 A301</span>
  488. <span class="alert-cam-ai">🤖 AI检测</span>
  489. </div>
  490. <!-- AI危险行为框 -->
  491. <div class="alert-det-box" style="left:22%;top:15%;width:28%;height:42%">
  492. <div class="alert-det-label">危险行为: 未佩戴防护</div>
  493. </div>
  494. </div>
  495. </div>
  496. <!-- 右侧: 告警信息 -->
  497. <div class="alert-info-col">
  498. <div class="alert-info-grid">
  499. <div class="alert-info-item"><div class="ail">告警实验室</div><div class="aiv" id="alert-lab">化学分析实验室 (A301)</div></div>
  500. <div class="alert-info-item"><div class="ail">所属单位</div><div class="aiv" id="alert-unit">化学研究所</div></div>
  501. <div class="alert-info-item"><div class="ail">告警指标</div><div class="aiv" id="alert-metric">TVOC 浓度超标</div></div>
  502. <div class="alert-info-item"><div class="ail">当前值 / 安全阈值</div><div class="aiv" id="alert-value">2.85 / 0.6 mg/m³</div></div>
  503. </div>
  504. <div class="alert-pulse-text">▶▶ 请立即采取安全措施,疏散实验人员 ◀◀</div>
  505. </div>
  506. </div>
  507. <div class="alert-modal-footer">
  508. <button class="btn-alert-ignore" onclick="closeAlert()">稍后处理</button>
  509. <button class="btn-alert-confirm" onclick="closeAlert()">确认处理</button>
  510. </div>
  511. </div>
  512. </div>
  513. <!-- ===== MAIN WRAPPER ===== -->
  514. <div id="scale-root">
  515. <div class="bg-hex"></div>
  516. <div class="scan-effect"></div>
  517. <!-- TOP NAV -->
  518. <nav class="top-nav">
  519. <!-- 左侧:实时时钟 + 星期 -->
  520. <div class="nav-left" style="justify-content:flex-start">
  521. <div class="nav-clock">
  522. <div class="time" id="clock-time">--:--:--</div>
  523. <div class="date" id="clock-date">----年--月--日 星期-</div>
  524. </div>
  525. </div>
  526. <!-- 中部:LOGO + 单位名称 + 大标题 -->
  527. <div class="nav-center">
  528. <div class="nav-logo"><div class="nav-logo-ring"></div></div>
  529. <div class="nav-org" style="margin-right:50px">
  530. <strong>中国安全生产科学研究院</strong>
  531. <span>National Institute for Occupational Safety</span>
  532. </div>
  533. <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>
  534. <div style="display:flex;flex-direction:column;align-items:center;position:relative">
  535. <div class="nav-title">实验室安全智能监测与管控中心</div>
  536. <div class="nav-title-deco"></div>
  537. </div>
  538. </div>
  539. <!-- 右侧:天气 -->
  540. <div class="nav-right" style="justify-content:flex-end">
  541. <div class="nav-weather">
  542. <span class="icon">⛅</span>
  543. <div>
  544. <div>北京 · 晴转多云</div>
  545. <div style="font-size:28px;color:var(--gold)">12°C / AQI 68</div>
  546. </div>
  547. </div>
  548. </div>
  549. </nav>
  550. <!-- MAIN CONTENT: 4 COLS L→R: 1区(2) 2区(2) 3区(4) 4区(2) -->
  551. <div class="main-content">
  552. <!-- ======== 1区 ======== -->
  553. <div class="panel-col">
  554. <!-- 实验室基本情况统计 -->
  555. <div class="panel" style="flex:0 0 auto;display:flex;flex-direction:column">
  556. <div class="border-beam"></div>
  557. <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>
  558. <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>
  559. <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>
  560. <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>
  561. <div class="panel-header">
  562. <div class="panel-header-icon">🏛️</div>
  563. <span class="panel-title">实验室基本情况统计</span>
  564. <div class="status-dot green" style="margin-left:auto"></div>
  565. </div>
  566. <!-- 上部 80%:左(3) 总数 + 右(7) 分级 -->
  567. <div style="flex:4;display:flex;min-height:680px;overflow:hidden">
  568. <!-- 左侧 4:实验室总数统计 -->
  569. <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)">
  570. <!-- SVG 圆弧仪表 -->
  571. <svg width="320" height="320" viewBox="0 0 320 320">
  572. <defs>
  573. <linearGradient id="arcG1" x1="0%" y1="0%" x2="100%" y2="100%">
  574. <stop offset="0%" stop-color="#1e90ff"/>
  575. <stop offset="100%" stop-color="#00d8ff"/>
  576. </linearGradient>
  577. <filter id="glow1">
  578. <feGaussianBlur stdDeviation="4" result="blur"/>
  579. <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
  580. </filter>
  581. </defs>
  582. <!-- 最外装饰环 -->
  583. <circle cx="160" cy="160" r="148" fill="none" stroke="rgba(30,144,255,0.08)" stroke-width="1" stroke-dasharray="6 6"/>
  584. <!-- 外轨道 -->
  585. <circle cx="160" cy="160" r="136" fill="none" stroke="rgba(30,144,255,0.14)" stroke-width="3"/>
  586. <!-- 主弧 300° -->
  587. <circle cx="160" cy="160" r="136" fill="none" stroke="url(#arcG1)" stroke-width="8"
  588. stroke-dasharray="711 143" stroke-linecap="round" transform="rotate(-240 160 160)" filter="url(#glow1)"/>
  589. <!-- 内轨道 -->
  590. <circle cx="160" cy="160" r="110" fill="rgba(3,14,31,0.7)" stroke="rgba(0,216,255,0.15)" stroke-width="2"/>
  591. <!-- 四分级色弧 小环 -->
  592. <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"/>
  593. <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"/>
  594. <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"/>
  595. <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"/>
  596. <!-- 端点光晕 -->
  597. <circle cx="160" cy="24" r="6" fill="#1e90ff" opacity="0.9"/>
  598. <!-- 中心数字 -->
  599. <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>
  600. <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>
  601. </svg>
  602. <!-- 标签 -->
  603. <div style="text-align:center">
  604. <div style="font-size:30px;font-weight:700;color:var(--cyan);letter-spacing:4px">实验室总数</div>
  605. <div style="font-size:22px;color:var(--text-dim);margin-top:6px;letter-spacing:2px">TOTAL LABORATORIES</div>
  606. </div>
  607. <!-- 分级色条 -->
  608. <div style="width:100%;padding:0 10px">
  609. <div style="display:flex;gap:5px;height:12px;border-radius:6px;overflow:hidden">
  610. <div style="flex:12;background:#cc0000;box-shadow:0 0 10px rgba(204,0,0,0.5)"></div>
  611. <div style="flex:28;background:#ff8000;box-shadow:0 0 10px rgba(255,128,0,0.4)"></div>
  612. <div style="flex:45;background:#ffcc00;box-shadow:0 0 10px rgba(255,204,0,0.4)"></div>
  613. <div style="flex:43;background:#0066cc;box-shadow:0 0 10px rgba(0,102,204,0.4)"></div>
  614. </div>
  615. <div style="display:flex;gap:5px;margin-top:8px;font-size:22px;color:var(--text-dim);text-align:center">
  616. <span style="flex:12">Ⅰ</span><span style="flex:28">Ⅱ</span><span style="flex:45">Ⅲ</span><span style="flex:43">Ⅳ</span>
  617. </div>
  618. </div>
  619. </div>
  620. <!-- 右侧 6:分级统计(环形图 + 明细列表) -->
  621. <div style="flex:6;display:flex;flex-direction:column;justify-content:center;padding:25px 25px 20px;gap:0">
  622. <!-- 环形图 -->
  623. <div style="flex:0 0 340px;width:100%" id="chart-donut"></div>
  624. <!-- 分级明细 -->
  625. <div style="display:flex;flex-direction:column;gap:10px;margin-top:10px">
  626. <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">
  627. <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>
  628. <span style="color:#ff6666;font-weight:700;font-size:28px">12间</span>
  629. </div>
  630. <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">
  631. <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>
  632. <span style="color:#ffaa44;font-weight:700;font-size:28px">28间</span>
  633. </div>
  634. <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">
  635. <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>
  636. <span style="color:#ffe066;font-weight:700;font-size:28px">45间</span>
  637. </div>
  638. <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">
  639. <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>
  640. <span style="color:#4499ff;font-weight:700;font-size:28px">43间</span>
  641. </div>
  642. </div>
  643. </div>
  644. </div>
  645. <!-- 下部 20%:三种状态统计 -->
  646. <div style="flex:1;display:flex;align-items:center;padding:0 25px 20px;border-top:1px solid var(--border);gap:15px;min-height:170px">
  647. <div class="status-row" style="width:100%;margin:0">
  648. <div class="status-badge active"><div class="val">20</div><div class="lbl">使用(间)</div></div>
  649. <div class="status-badge warning"><div class="val">3</div><div class="lbl">异常(间)</div></div>
  650. <div class="status-badge idle"><div class="val">105</div><div class="lbl">空闲(间)</div></div>
  651. </div>
  652. </div>
  653. </div>
  654. <!-- 实验室安全分级统计 -->
  655. <div class="panel" style="flex:1;min-height:450px;display:flex;flex-direction:column">
  656. <div class="border-beam"></div>
  657. <div class="panel-header">
  658. <div class="panel-header-icon">📊</div>
  659. <span class="panel-title">实验室安全分级统计</span>
  660. </div>
  661. <div style="flex:1;min-height:0;padding:15px 20px">
  662. <div id="chart-stack" style="height:100%;width:100%"></div>
  663. </div>
  664. </div>
  665. <!-- 实验室进入人数统计及走势 -->
  666. <div class="panel" style="flex:0 0 auto">
  667. <div class="border-beam"></div>
  668. <div class="panel-header">
  669. <div class="panel-header-icon">👥</div>
  670. <span class="panel-title">实验室进入人数统计及走势</span>
  671. </div>
  672. <div style="padding:20px 25px">
  673. <div class="flip-counters">
  674. <div class="flip-counter"><div class="fc-label">今日进入总人数</div><div class="fc-digits" id="flip-total"></div></div>
  675. <div class="flip-counter"><div class="fc-label">当前在场实验人数</div><div class="fc-digits" id="flip-current"></div></div>
  676. </div>
  677. <div style="height:275px;margin-top:12px" id="chart-line"></div>
  678. </div>
  679. </div>
  680. </div><!-- /1区 -->
  681. <!-- ======== 2区 ======== -->
  682. <div class="panel-col">
  683. <!-- 智能环境感知应用设备统计 -->
  684. <div class="panel" style="flex:0 0 auto">
  685. <div class="border-beam"></div>
  686. <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>
  687. <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>
  688. <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>
  689. <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>
  690. <div class="panel-header">
  691. <div class="panel-header-icon">📡</div>
  692. <span class="panel-title">智能环境感知应用设备统计</span>
  693. </div>
  694. <div style="padding:20px 25px">
  695. <div class="device-online-row">
  696. <div class="device-stat-chip online"><div class="dv">312</div><div class="dl">在线设备</div></div>
  697. <div class="device-stat-chip offline"><div class="dv">18</div><div class="dl">离线设备</div></div>
  698. </div>
  699. <div style="display:flex;gap:20px;align-items:center">
  700. <div id="chart-gauge" style="flex:0 0 295px;height:295px"></div>
  701. <div class="device-list-row" style="flex:1">
  702. <div class="device-list-item"><div class="dli-icon">🏷️</div><div class="dli-num">86</div><div class="dli-name">电子信息铭牌</div></div>
  703. <div class="device-list-item"><div class="dli-icon">⚗️</div><div class="dli-num">44</div><div class="dli-name">化学品智能终端</div></div>
  704. <div class="device-list-item"><div class="dli-icon">🌡️</div><div class="dli-num">128</div><div class="dli-name">传感器套件</div></div>
  705. <div class="device-list-item"><div class="dli-icon">📷</div><div class="dli-num">72</div><div class="dli-name">智能摄像设备</div></div>
  706. </div>
  707. </div>
  708. </div>
  709. </div>
  710. <!-- 实验室设备分类及使用统计 (4:2:4) -->
  711. <div class="panel" style="flex:1;min-height:650px;display:flex;flex-direction:column">
  712. <div class="border-beam"></div>
  713. <div class="panel-header">
  714. <div class="panel-header-icon">🔬</div>
  715. <span class="panel-title">实验室设备分类及使用统计</span>
  716. </div>
  717. <!-- 4:2:4 layout -->
  718. <div style="flex:1;display:flex;flex-direction:column;padding:15px 25px;gap:12px;min-height:0">
  719. <!-- 上: 占4 环形图 - 设备分类 -->
  720. <div style="flex:4;min-height:0">
  721. <div id="chart-ring" style="height:100%;width:100%"></div>
  722. </div>
  723. <!-- 中: 占2 统计数字 -->
  724. <div style="flex:2;min-height:0;display:flex;align-items:center">
  725. <div class="equip-mid-row" style="width:100%">
  726. <div class="equip-stat-item"><div class="ev">2,458</div><div class="el">设备总数(台)</div></div>
  727. <div class="equip-stat-item"><div class="ev">18,620</div><div class="el">使用时长(h)</div></div>
  728. <div class="equip-stat-item"><div class="ev">62.4%</div><div class="el">设备使用率</div></div>
  729. </div>
  730. </div>
  731. <!-- 下: 占4 饼图 - 使用状态 -->
  732. <div style="flex:4;min-height:0">
  733. <div id="chart-pie" style="height:100%;width:100%"></div>
  734. </div>
  735. </div>
  736. </div>
  737. </div><!-- /2区 -->
  738. <!-- ======== 3区: 实时监控 ======== -->
  739. <div class="center-col">
  740. <!-- 实时监控(常显) -->
  741. <div id="view-monitor">
  742. <div class="monitor-header">
  743. <span style="font-size:32px;font-weight:600;color:var(--cyan);letter-spacing:2px">📹 实时监控</span>
  744. <span style="font-size:28px;color:var(--text-dim);margin-left:10px">CCTV Live Feed</span>
  745. <div style="margin-left:auto;display:flex;align-items:center;gap:15px">
  746. <div class="status-dot green"></div>
  747. <span style="font-size:28px;color:var(--text-dim)">信号正常</span>
  748. </div>
  749. </div>
  750. <div class="monitor-inner">
  751. <div class="monitor-left">
  752. <div class="search-box"><span style="font-size:32px;color:var(--text-dim)">🔍</span><input type="text" placeholder="搜索楼栋 / 楼层 / 房间…"></div>
  753. <select class="filter-select">
  754. <option value="">全部二级单位</option>
  755. <option>化学研究所</option><option>物理研究所</option>
  756. <option>生物研究所</option><option>材料研究所</option><option>工程研究所</option>
  757. </select>
  758. <div class="tree-wrap" id="building-tree"></div>
  759. </div>
  760. <div class="monitor-right">
  761. <div class="camera-grid-header">
  762. <div class="camera-breadcrumb"><span>安科院主园区</span> › <span>综合实验楼A</span> › <span>3层</span></div>
  763. <div class="camera-pager">
  764. <button class="pager-btn">‹</button>
  765. <span class="pager-info">1 / 3 页</span>
  766. <button class="pager-btn">›</button>
  767. </div>
  768. </div>
  769. <div class="camera-grid" id="camera-grid"></div>
  770. </div>
  771. </div>
  772. </div>
  773. </div><!-- /3区 -->
  774. <!-- ======== 4区 ======== -->
  775. <div class="panel-col">
  776. <!-- 实验环境安全智能感知 -->
  777. <div class="panel" style="flex:7;min-height:0;display:flex;flex-direction:column">
  778. <div class="border-beam"></div>
  779. <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>
  780. <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>
  781. <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>
  782. <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>
  783. <div class="panel-header">
  784. <div class="panel-header-icon">🌡️</div>
  785. <span class="panel-title">实验环境安全智能感知</span>
  786. <div class="status-dot red" style="margin-left:auto"></div>
  787. </div>
  788. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  789. <div class="sensor-scroll-wrap">
  790. <div class="sensor-scroll-inner" id="sensor-list"></div>
  791. </div>
  792. </div>
  793. </div>
  794. <!-- 实验室实时风险预警 -->
  795. <div class="panel" style="flex:3;min-height:0;display:flex;flex-direction:column">
  796. <div class="border-beam"></div>
  797. <div class="panel-header">
  798. <div class="panel-header-icon">⚠️</div>
  799. <span class="panel-title">实验室实时风险预警</span>
  800. <div style="margin-left:auto;display:flex;align-items:center;gap:10px;flex-shrink:0">
  801. <span style="font-size:25px;color:var(--text-dim)">本月</span>
  802. <span style="font-size:50px;font-weight:700;color:#f59e0b">42</span>
  803. <span style="font-size:25px;color:var(--text-dim)">次</span>
  804. </div>
  805. </div>
  806. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  807. <div class="warn-scroll-wrap">
  808. <div class="warn-scroll-inner" id="warn-list"></div>
  809. </div>
  810. </div>
  811. </div>
  812. </div><!-- /4区 -->
  813. </div><!-- /main-content -->
  814. </div><!-- /scale-root -->
  815. <script>
  816. // ====================================================
  817. // SCALE
  818. // ====================================================
  819. // ====================================================
  820. // INIT MONITOR ON LOAD
  821. // ====================================================
  822. document.addEventListener('DOMContentLoaded', () => {
  823. if (document.documentElement.requestFullscreen)
  824. document.documentElement.requestFullscreen().catch(() => {});
  825. buildTree();
  826. buildCameras();
  827. });
  828. const WD = ['日','一','二','三','四','五','六'];
  829. function tick() {
  830. const n = new Date();
  831. const t = `${String(n.getHours()).padStart(2,'0')}:${String(n.getMinutes()).padStart(2,'0')}:${String(n.getSeconds()).padStart(2,'0')}`;
  832. const d = `${n.getFullYear()}年${n.getMonth()+1}月${n.getDate()}日 星期${WD[n.getDay()]}`;
  833. document.getElementById('clock-time').textContent = t;
  834. document.getElementById('clock-date').textContent = d;
  835. }
  836. setInterval(tick, 1000); tick();
  837. // ====================================================
  838. // NEBULA BACKGROUND
  839. // ====================================================
  840. (function () {
  841. const c = document.getElementById('nebula-canvas');
  842. const ctx = c.getContext('2d');
  843. let W, H, stars = [], t = 0;
  844. function resize() { W = c.width = window.innerWidth; H = c.height = window.innerHeight; }
  845. window.addEventListener('resize', resize); resize();
  846. for (let i = 0; i < 500; i++)
  847. 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 });
  848. function draw() {
  849. t++;
  850. ctx.clearRect(0, 0, W, H);
  851. const g1 = ctx.createRadialGradient(W*0.22, H*0.35, 40, W*0.22, H*0.35, 420);
  852. g1.addColorStop(0, 'rgba(0,60,180,0.09)'); g1.addColorStop(1, 'transparent');
  853. ctx.fillStyle = g1; ctx.fillRect(0,0,W,H);
  854. const g2 = ctx.createRadialGradient(W*0.78, H*0.65, 30, W*0.78, H*0.65, 360);
  855. g2.addColorStop(0, 'rgba(0,100,220,0.08)'); g2.addColorStop(1, 'transparent');
  856. ctx.fillStyle = g2; ctx.fillRect(0,0,W,H);
  857. stars.forEach(s => {
  858. s.a += s.va; if (s.a > 1 || s.a < 0.1) s.va *= -1;
  859. const hue = 200 + Math.sin(t * 0.01 + s.x) * 30;
  860. ctx.beginPath(); ctx.arc(s.x*(W/9600), s.y*(H/2800), s.r, 0, Math.PI*2);
  861. ctx.fillStyle = `hsla(${hue},80%,80%,${s.a})`; ctx.fill();
  862. });
  863. requestAnimationFrame(draw);
  864. }
  865. draw();
  866. })();
  867. // ====================================================
  868. // FLIP COUNTER
  869. // ====================================================
  870. function renderFlip(id, val) {
  871. const el = document.getElementById(id); if (!el) return;
  872. el.innerHTML = String(val).padStart(4,'0').split('').map(d => `<div class="flip-digit">${d}</div>`).join('');
  873. }
  874. function animFlip(id, from, to, dur) {
  875. const s = Date.now();
  876. (function tick() {
  877. const p = Math.min((Date.now()-s)/dur, 1);
  878. renderFlip(id, Math.round(from + (to-from)*p));
  879. if (p < 1) requestAnimationFrame(tick);
  880. })();
  881. }
  882. renderFlip('flip-total', 1284); renderFlip('flip-current', 47);
  883. setTimeout(() => animFlip('flip-total', 0, 1284, 2000), 600);
  884. setTimeout(() => animFlip('flip-current', 0, 47, 1500), 900);
  885. // ====================================================
  886. // SENSOR LIST (4区上)
  887. // ====================================================
  888. const LABS = [
  889. {name:'化学分析实验室', room:'A301', unit:'化学研究所', t:22.5, h:58, tvoc:0.82, co2:650, o2:20.9, alert:true},
  890. {name:'生物安全实验室', room:'B201', unit:'生物研究所', t:20.1, h:62, tvoc:0.18, co2:580, o2:20.8, alert:false},
  891. {name:'材料测试实验室', room:'C401', unit:'材料研究所', t:24.0, h:45, tvoc:0.09, co2:520, o2:20.9, alert:false},
  892. {name:'精密仪器实验室', room:'A205', unit:'物理研究所', t:21.5, h:50, tvoc:0.14, co2:490, o2:20.9, alert:false},
  893. {name:'有机合成实验室', room:'B302', unit:'化学研究所', t:23.8, h:55, tvoc:2.10, co2:725, o2:20.5, alert:true},
  894. {name:'光学检测实验室', room:'C203', unit:'物理研究所', t:22.0, h:52, tvoc:0.11, co2:510, o2:20.9, alert:false},
  895. {name:'高压实验室', room:'D101', unit:'工程研究所', t:25.5, h:48, tvoc:0.30, co2:600, o2:20.7, alert:false},
  896. {name:'低温实验室', room:'D205', unit:'物理研究所', t:18.0, h:40, tvoc:0.07, co2:480, o2:20.9, alert:false},
  897. {name:'核磁共振室', room:'A302', unit:'化学研究所', t:20.5, h:54, tvoc:0.05, co2:505, o2:20.9, alert:false},
  898. {name:'质谱分析室', room:'A303', unit:'化学研究所', t:21.0, h:53, tvoc:0.19, co2:530, o2:20.8, alert:false},
  899. ];
  900. function buildSensorList() {
  901. const el = document.getElementById('sensor-list'); if (!el) return;
  902. const all = [...LABS, ...LABS];
  903. el.innerHTML = all.map(lab => `
  904. <div class="sensor-item ${lab.alert ? 'alert' : ''}">
  905. <div class="sensor-item-head">
  906. <span class="sensor-name">${lab.name}(${lab.room})</span>
  907. <span class="sensor-unit">${lab.unit}</span>
  908. ${lab.alert
  909. ? '<span style="color:var(--red);font-size:25px;animation:blinkRed 0.8s infinite">🚨 告警</span>'
  910. : '<span style="color:var(--green);font-size:25px">● 正常</span>'}
  911. </div>
  912. <div class="sensor-metrics">
  913. <div class="sensor-metric">🌡️ ${lab.t}°C</div>
  914. <div class="sensor-metric">💧 ${lab.h}%</div>
  915. <div class="sensor-metric ${lab.tvoc > 0.6 ? 'alarm' : ''}">🧪 TVOC ${lab.tvoc}</div>
  916. <div class="sensor-metric ${lab.co2 > 700 ? 'alarm' : ''}">💨 CO₂ ${lab.co2}</div>
  917. <div class="sensor-metric">🫧 O₂ ${lab.o2}%</div>
  918. </div>
  919. </div>`).join('');
  920. }
  921. buildSensorList();
  922. // ====================================================
  923. // WARNING LIST (4区下)
  924. // ====================================================
  925. const WARNS = [
  926. {lab:'化学分析实验室', room:'A301', unit:'化学研究所', metric:'TVOC浓度超标', val:'2.85 mg/m³', time:'2026-03-05 14:32:18'},
  927. {lab:'有机合成实验室', room:'B302', unit:'化学研究所', metric:'CO₂浓度偏高', val:'725 ppm', time:'2026-03-05 13:58:44'},
  928. {lab:'高压实验室', room:'D101', unit:'工程研究所', metric:'温度异常', val:'38.5 °C', time:'2026-03-05 12:15:07'},
  929. {lab:'生物安全实验室', room:'B201', unit:'生物研究所', metric:'湿度超标', val:'88% RH', time:'2026-03-05 11:40:22'},
  930. {lab:'材料测试实验室', room:'C401', unit:'材料研究所', metric:'TVOC超标', val:'1.2 mg/m³', time:'2026-03-05 10:08:55'},
  931. {lab:'光学检测实验室', room:'C203', unit:'物理研究所', metric:'O₂浓度偏低', val:'19.2 %', time:'2026-03-05 09:22:33'},
  932. {lab:'精密仪器实验室', room:'A205', unit:'物理研究所', metric:'温度超标', val:'28.5 °C', time:'2026-03-05 08:45:11'},
  933. {lab:'低温实验室', room:'D205', unit:'物理研究所', metric:'气压异常', val:'85 kPa', time:'2026-03-04 23:12:40'},
  934. ];
  935. function buildWarnList() {
  936. const el = document.getElementById('warn-list'); if (!el) return;
  937. const all = [...WARNS, ...WARNS];
  938. el.innerHTML = all.map(w => `
  939. <div class="warn-item">
  940. <div class="warn-item-head">
  941. <span class="warn-lab">🚨 ${w.lab}(${w.room})- ${w.unit}</span>
  942. <span class="warn-time">${w.time}</span>
  943. </div>
  944. <div class="warn-detail">异常指标:<span class="warn-metric-val">${w.metric} ${w.val}</span></div>
  945. </div>`).join('');
  946. }
  947. buildWarnList();
  948. // ====================================================
  949. // ALERT MODAL + CAMERA
  950. // ====================================================
  951. function closeAlert() { document.getElementById('alert-modal').classList.remove('show'); }
  952. let alertCamRAF = null;
  953. function startAlertCam() {
  954. const canvas = document.getElementById('alert-cam-canvas');
  955. if (!canvas || canvas._alertRunning) return;
  956. canvas._alertRunning = true;
  957. const ctx = canvas.getContext('2d');
  958. const W = 900, H = 700;
  959. let t = Math.random() * 1000;
  960. const noise = Array.from({length:300}, () => ({x:Math.random(), y:Math.random(), s:Math.random()*2.5+0.5, a:Math.random()*0.25}));
  961. function frame() {
  962. t += 0.4;
  963. ctx.clearRect(0, 0, W, H);
  964. // Background gradient (dark green-tinted night-vision feel with red emergency tint)
  965. const bg = ctx.createLinearGradient(0, 0, 0, H);
  966. bg.addColorStop(0, 'hsl(210,45%,5%)');
  967. bg.addColorStop(1, 'hsl(0,30%,4%)');
  968. ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
  969. // Perspective floor grid
  970. ctx.strokeStyle = 'rgba(20,65,140,0.07)'; ctx.lineWidth = 0.5;
  971. const vp = {x: W/2, y: H*0.44};
  972. 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(); }
  973. 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(); }
  974. // Lab furniture silhouettes
  975. ctx.fillStyle = 'rgba(0,30,80,0.45)';
  976. ctx.fillRect(W*0.05, H*0.52, W*0.38, H*0.12); // bench left
  977. ctx.fillRect(W*0.57, H*0.52, W*0.38, H*0.12); // bench right
  978. ctx.fillStyle = 'rgba(0,18,50,0.55)';
  979. ctx.fillRect(W*0.08, H*0.35, W*0.09, H*0.17); // cabinet
  980. ctx.fillRect(W*0.60, H*0.33, W*0.12, H*0.19); // equipment
  981. // Person silhouette (lab worker)
  982. const px = W*(0.4 + Math.sin(t*0.008)*0.03);
  983. const py = H*(0.58 + Math.cos(t*0.006)*0.015);
  984. ctx.fillStyle = 'rgba(110,160,240,0.6)';
  985. ctx.beginPath(); ctx.arc(px, py - H*0.1, W*0.028, 0, Math.PI*2); ctx.fill(); // head
  986. ctx.fillRect(px - W*0.022, py - H*0.08, W*0.044, H*0.1); // body
  987. // Red emergency scan line
  988. const scanY = (t * 0.8) % H;
  989. const scanG = ctx.createLinearGradient(0, scanY-8, 0, scanY+8);
  990. scanG.addColorStop(0, 'transparent');
  991. scanG.addColorStop(0.5, 'rgba(239,68,68,0.18)');
  992. scanG.addColorStop(1, 'transparent');
  993. ctx.fillStyle = scanG; ctx.fillRect(0, scanY-8, W, 16);
  994. // Noise
  995. noise.forEach(n => {
  996. ctx.fillStyle = `rgba(200,210,240,${n.a*0.45})`;
  997. ctx.fillRect(n.x*W, n.y*H, n.s, n.s);
  998. if (Math.random() < 0.015) { n.x = Math.random(); n.y = Math.random(); }
  999. });
  1000. // Red vignette pulse (emergency)
  1001. const vig = ctx.createRadialGradient(W/2, H/2, H*0.25, W/2, H/2, H*0.85);
  1002. const vigAlpha = 0.12 + Math.sin(t*0.08)*0.06;
  1003. vig.addColorStop(0, 'transparent');
  1004. vig.addColorStop(1, `rgba(200,0,0,${vigAlpha})`);
  1005. ctx.fillStyle = vig; ctx.fillRect(0, 0, W, H);
  1006. alertCamRAF = requestAnimationFrame(frame);
  1007. }
  1008. frame();
  1009. }
  1010. setTimeout(() => {
  1011. document.getElementById('alert-modal').classList.add('show');
  1012. startAlertCam();
  1013. }, 5000);
  1014. // ====================================================
  1015. // ECHARTS
  1016. // ====================================================
  1017. function initCharts() {
  1018. const TOOLTIP_CFG = {
  1019. backgroundColor:'rgba(3,14,42,0.92)',
  1020. borderColor:'rgba(30,144,255,0.3)',
  1021. textStyle:{ color:'#a8cce8', fontSize:28 }
  1022. };
  1023. // --- 环形图: 实验室总数分级 ---
  1024. const dEl = document.getElementById('chart-donut');
  1025. if (dEl) {
  1026. const c = echarts.init(dEl, null, {renderer:'canvas', devicePixelRatio:2});
  1027. c.setOption({
  1028. backgroundColor:'transparent',
  1029. tooltip:{ trigger:'item', formatter:'{b}: {c}间 ({d}%)', ...TOOLTIP_CFG },
  1030. graphic:[{
  1031. type:'text', left:'center', top:'40%',
  1032. style:{ text:'128', fill:'#ffd740', font:'bold 80px Arial', textAlign:'center' }
  1033. },{
  1034. type:'text', left:'center', top:'58%',
  1035. style:{ text:'实验室总数(间)', fill:'rgba(168,204,232,0.65)', font:'22px Arial', textAlign:'center' }
  1036. }],
  1037. series:[{
  1038. type:'pie', radius:['42%','68%'], center:['50%','50%'], startAngle:100,
  1039. itemStyle:{ borderRadius:6, borderColor:'rgba(3,14,31,0.6)', borderWidth:3 },
  1040. label:{
  1041. show:true,
  1042. formatter: params => `{lvl|${params.name}}\n{cnt|${params.value}间}\n{pct|${params.percent}%}`,
  1043. rich:{
  1044. lvl:{ fontSize:24, fontWeight:700, color:'#ddf0ff', lineHeight:36 },
  1045. cnt:{ fontSize:30, fontWeight:900, color:'#ffd740', lineHeight:42 },
  1046. pct:{ fontSize:22, color:'rgba(168,204,232,0.6)', lineHeight:32 }
  1047. },
  1048. distanceToLabelLine:8
  1049. },
  1050. labelLine:{
  1051. show:true, length:20, length2:25,
  1052. lineStyle:{ color:'rgba(30,144,255,0.45)', width:2 }
  1053. },
  1054. data:[
  1055. {value:12, name:'I级', itemStyle:{color:'#cc0000', shadowBlur:12, shadowColor:'rgba(204,0,0,0.5)'}},
  1056. {value:28, name:'II级', itemStyle:{color:'#ff8000', shadowBlur:12, shadowColor:'rgba(255,128,0,0.5)'}},
  1057. {value:45, name:'III级', itemStyle:{color:'#ffcc00', shadowBlur:12, shadowColor:'rgba(255,204,0,0.5)'}},
  1058. {value:43, name:'IV级', itemStyle:{color:'#0066cc', shadowBlur:12, shadowColor:'rgba(0,102,204,0.5)'}}
  1059. ],
  1060. emphasis:{
  1061. scale:true, scaleSize:8,
  1062. itemStyle:{ shadowBlur:30, shadowColor:'rgba(30,144,255,0.6)' },
  1063. label:{ fontSize:28 }
  1064. }
  1065. }]
  1066. });
  1067. }
  1068. // --- 堆叠柱状图: 安全分级统计 ---
  1069. const stEl = document.getElementById('chart-stack');
  1070. if (stEl) {
  1071. const c = echarts.init(stEl, null, {renderer:'canvas', devicePixelRatio:2});
  1072. const cols = ['#cc0000','#ff8000','#ffcc00','#0066cc'];
  1073. const lvls = ['I级','II级','III级','IV级'];
  1074. const units = ['化学所','生物所','材料所','物理所','工程所','核能所','信息所','环境所','计量所','医学所'];
  1075. const totals = [28,22,18,24,16,12,20,15,10,14];
  1076. const dat = [
  1077. [2,3,5,4,2,1,3,2,1,2],
  1078. [5,6,4,7,4,3,5,4,3,4],
  1079. [9,8,6,8,5,5,7,5,4,5],
  1080. [12,5,3,5,5,3,5,4,2,3]
  1081. ];
  1082. const xL = units.map((u,i) => `${u}\n(${totals[i]})`);
  1083. c.setOption({
  1084. backgroundColor:'transparent',
  1085. tooltip:{ trigger:'axis', axisPointer:{type:'shadow'}, ...TOOLTIP_CFG },
  1086. legend:{ data:lvls, top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'rect', itemWidth:25, itemHeight:15 },
  1087. grid:{ left:30, right:8, top:55, bottom:110, containLabel:true },
  1088. 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} },
  1089. 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)'}} },
  1090. dataZoom:[{ type:'inside', startValue:0, endValue:5 }],
  1091. series:lvls.map((n,i) => ({
  1092. name:n, type:'bar', stack:'total', barMaxWidth:55,
  1093. data:dat[i].map(v => ({value:v, itemStyle:{color:cols[i], opacity:0.88}})),
  1094. emphasis:{ itemStyle:{opacity:1} }
  1095. }))
  1096. });
  1097. let idx = 0;
  1098. setInterval(() => {
  1099. idx++;
  1100. c.dispatchAction({ type:'dataZoom', startValue:idx, endValue:idx+5 });
  1101. if (idx >= units.length-5) idx = -1;
  1102. }, 5000);
  1103. }
  1104. // --- 折线图: 进入人数走势 ---
  1105. const lnEl = document.getElementById('chart-line');
  1106. if (lnEl) {
  1107. const c = echarts.init(lnEl, null, {renderer:'canvas', devicePixelRatio:2});
  1108. c.setOption({
  1109. backgroundColor:'transparent',
  1110. tooltip:{ trigger:'axis', ...TOOLTIP_CFG },
  1111. legend:{ data:['进入人数','在场人数'], top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'circle', itemWidth:20, itemHeight:20 },
  1112. grid:{ left:28, right:8, top:45, bottom:50, containLabel:true },
  1113. 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} },
  1114. yAxis:{ type:'value', axisLabel:{color:'#5890b8',fontSize:22}, axisLine:{show:false}, splitLine:{lineStyle:{color:'rgba(30,144,255,0.1)'}} },
  1115. series:[
  1116. { 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)'}])} },
  1117. { 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)'}])} }
  1118. ]
  1119. });
  1120. }
  1121. // --- 仪表盘: 设备在线率 ---
  1122. const ggEl = document.getElementById('chart-gauge');
  1123. if (ggEl) {
  1124. const c = echarts.init(ggEl, null, {renderer:'canvas', devicePixelRatio:2});
  1125. c.setOption({
  1126. backgroundColor:'transparent',
  1127. series:[{
  1128. type:'gauge', radius:'90%', center:['50%','60%'],
  1129. startAngle:210, endAngle:-30, min:0, max:100, splitNumber:5,
  1130. axisLine:{ lineStyle:{ width:30, color:[[0.3,'#ef4444'],[0.6,'#f59e0b'],[1,'#1e90ff']] } },
  1131. axisTick:{show:false}, splitLine:{show:false}, axisLabel:{show:false},
  1132. 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'} },
  1133. detail:{ valueAnimation:true, formatter:'{value}%', color:'#ffd740', fontSize:45, fontWeight:700, offsetCenter:[0,'30%'] },
  1134. title:{ show:true, offsetCenter:[0,'62%'], color:'rgba(110,165,210,0.6)', fontSize:25 },
  1135. data:[{value:94.5, name:'在线率'}]
  1136. }]
  1137. });
  1138. }
  1139. // --- 环形图: 设备分类 (2区设备统计上部) ---
  1140. const rgEl = document.getElementById('chart-ring');
  1141. if (rgEl) {
  1142. const c = echarts.init(rgEl, null, {renderer:'canvas', devicePixelRatio:2});
  1143. const ringData = [
  1144. {value:680, name:'检测设备', itemStyle:{color:'#1e90ff', shadowBlur:8, shadowColor:'rgba(30,144,255,0.5)'}},
  1145. {value:520, name:'分析仪器', itemStyle:{color:'#4361ee', shadowBlur:8, shadowColor:'rgba(67,97,238,0.5)'}},
  1146. {value:380, name:'制备设备', itemStyle:{color:'#00e676', shadowBlur:8, shadowColor:'rgba(0,230,118,0.5)'}},
  1147. {value:280, name:'安全设备', itemStyle:{color:'#ffd740', shadowBlur:8, shadowColor:'rgba(255,215,64,0.5)'}},
  1148. {value:240, name:'辅助设备', itemStyle:{color:'#00e5c8', shadowBlur:8, shadowColor:'rgba(0,229,200,0.5)'}},
  1149. {value:358, name:'其他', itemStyle:{color:'#f97316', shadowBlur:8, shadowColor:'rgba(249,115,22,0.5)'}}
  1150. ];
  1151. const ringCountMap = {检测设备:680, 分析仪器:520, 制备设备:380, 安全设备:280, 辅助设备:240, 其他:358};
  1152. c.setOption({
  1153. backgroundColor:'transparent',
  1154. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1155. legend:{
  1156. orient:'vertical', right:'1%', top:'middle',
  1157. icon:'circle', itemWidth:28, itemHeight:28, itemGap:22,
  1158. textStyle:{ color:'#a8cce8', fontSize:22 },
  1159. formatter: name => `{nm|${name}} {vl|${ringCountMap[name]}台}`,
  1160. rich:{
  1161. nm:{ fontSize:22, color:'#a8cce8', width:90 },
  1162. vl:{ fontSize:26, fontWeight:700, color:'#fff' }
  1163. }
  1164. },
  1165. series:[{
  1166. type:'pie', radius:['38%','62%'], center:['36%','50%'],
  1167. itemStyle:{ borderRadius:4, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1168. label:{ show:true, formatter:'{c}台', fontSize:20, color:'#a8cce8' },
  1169. labelLine:{ length:10, length2:10, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1170. data: ringData,
  1171. emphasis:{ scale:true, scaleSize:5, itemStyle:{ shadowBlur:20, shadowColor:'rgba(30,144,255,0.6)' } }
  1172. }]
  1173. });
  1174. }
  1175. // --- 饼图: 设备使用状态 (2区设备统计下部) ---
  1176. const ppEl = document.getElementById('chart-pie');
  1177. if (ppEl) {
  1178. const c = echarts.init(ppEl, null, {renderer:'canvas', devicePixelRatio:2});
  1179. const pieData = [
  1180. {value:486, name:'使用', itemStyle:{color:'#1e90ff', shadowBlur:10, shadowColor:'rgba(30,144,255,0.5)'}},
  1181. {value:1840, name:'空闲', itemStyle:{color:'#00e676', shadowBlur:10, shadowColor:'rgba(0,230,118,0.5)'}},
  1182. {value:34, name:'维修', itemStyle:{color:'#f59e0b', shadowBlur:10, shadowColor:'rgba(245,158,11,0.5)'}}
  1183. ];
  1184. const countMap = {使用:486, 空闲:1840, 维修:34};
  1185. c.setOption({
  1186. backgroundColor:'transparent',
  1187. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1188. legend:{
  1189. show:true, orient:'vertical', right:'2%', top:'middle',
  1190. icon:'circle', itemWidth:36, itemHeight:36, itemGap:40,
  1191. textStyle:{ color:'#a8cce8', fontSize:28 },
  1192. formatter: name => `{nm|${name}} {vl|${countMap[name]}台}`,
  1193. rich:{
  1194. nm:{ fontSize:28, color:'#a8cce8', width:90 },
  1195. vl:{ fontSize:34, fontWeight:700, color:'#fff' }
  1196. }
  1197. },
  1198. series:[{
  1199. type:'pie', radius:['36%','62%'], center:['38%','52%'],
  1200. itemStyle:{ borderRadius:5, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1201. label:{
  1202. show:true,
  1203. formatter: '{b}\n{c}台',
  1204. fontSize:24, color:'#a8cce8', lineHeight:36,
  1205. distanceToLabelLine:6
  1206. },
  1207. labelLine:{ length:18, length2:14, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1208. data: pieData,
  1209. emphasis:{
  1210. scale:true, scaleSize:6,
  1211. itemStyle:{ shadowBlur:25, shadowColor:'rgba(30,144,255,0.6)' }
  1212. }
  1213. }]
  1214. });
  1215. }
  1216. }
  1217. initCharts();
  1218. // ====================================================
  1219. // MONITOR TREE
  1220. // ====================================================
  1221. function buildTree() {
  1222. const el = document.getElementById('building-tree'); if (!el) return;
  1223. const data = {label:'安科院主园区', children:[
  1224. {label:'综合实验楼A', children:[
  1225. {label:'1层', children:[{label:'A101 化学实验室'},{label:'A102 分析室'}]},
  1226. {label:'2层', children:[{label:'A201 生物实验室'}]},
  1227. {label:'3层', children:[{label:'A301 有机合成室'},{label:'A302 核磁共振室'},{label:'A303 质谱室'}]},
  1228. {label:'4层', children:[{label:'A401 X射线室'}]}
  1229. ]},
  1230. {label:'物理实验楼B', children:[
  1231. {label:'1层', children:[{label:'B101 光学实验室'}]},
  1232. {label:'2层', children:[{label:'B201 低温实验室'}]}
  1233. ]},
  1234. {label:'工程技术楼C', children:[
  1235. {label:'1层', children:[{label:'C101 机械加工室'}]},
  1236. {label:'2层', children:[{label:'C201 材料测试室'}]}
  1237. ]}
  1238. ]};
  1239. el.innerHTML = renderT(data, 0);
  1240. el.addEventListener('click', e => {
  1241. const l = e.target.closest('.tree-node-label'); if (!l) return;
  1242. l.classList.toggle('selected');
  1243. const ch = l.parentElement.querySelector('.tree-children');
  1244. const ar = l.querySelector('.arrow');
  1245. if (ch) ch.classList.toggle('open');
  1246. if (ar) ar.classList.toggle('open');
  1247. });
  1248. }
  1249. function renderT(node, depth) {
  1250. const isLeaf = !node.children || !node.children.length;
  1251. const icon = ['🏢','🏗️','📐','🔬'][Math.min(depth,3)];
  1252. let h = `<div class="tree-node"><div class="tree-node-label" style="padding-left:${depth*12+8}px">
  1253. <span class="arrow ${depth===0?'open':''}">${isLeaf ? '&nbsp;&nbsp;' : '▶'}</span>
  1254. <span>${icon}</span><span>${node.label}</span></div>`;
  1255. if (!isLeaf) {
  1256. h += `<div class="tree-children ${depth===0?'open':''}">`;
  1257. node.children.forEach(c => h += renderT(c, depth+1));
  1258. h += '</div>';
  1259. }
  1260. return h + '</div>';
  1261. }
  1262. // ====================================================
  1263. // CAMERAS
  1264. // ====================================================
  1265. const CAMS = ['A301 有机合成室','A302 核磁共振室','A303 质谱室','A301 走廊','A302 走廊','A303 走廊','A层公共区域','A层安全通道','A层出入口'];
  1266. function buildCameras() {
  1267. const g = document.getElementById('camera-grid'); if (!g) return;
  1268. g.innerHTML = '';
  1269. for (let i = 0; i < 9; i++) {
  1270. const cell = document.createElement('div');
  1271. cell.className = 'camera-cell' + (i===0 ? ' ai-cam' : '');
  1272. const cv = document.createElement('canvas');
  1273. cv.style.cssText = 'width:100%;height:100%;display:block';
  1274. cell.appendChild(cv);
  1275. 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>':''}`;
  1276. if (i===0) {
  1277. const box = document.createElement('div');
  1278. box.className = 'ai-detection-box';
  1279. box.style.cssText = 'left:28%;top:18%;width:22%;height:38%';
  1280. box.innerHTML = '<div class="ai-detection-label">危险行为: 未佩戴防护</div>';
  1281. cell.appendChild(box);
  1282. }
  1283. g.appendChild(cell);
  1284. setTimeout(() => drawFakeCam(cv, i), 150);
  1285. }
  1286. }
  1287. function drawFakeCam(canvas, idx) {
  1288. const ctx = canvas.getContext('2d');
  1289. const par = canvas.parentElement;
  1290. let pw, ph;
  1291. function sz() { pw = canvas.width = par.offsetWidth; ph = canvas.height = par.offsetHeight; }
  1292. sz(); window.addEventListener('resize', sz);
  1293. let t = Math.random() * 1000;
  1294. const noise = Array.from({length:200}, () => ({x:Math.random(),y:Math.random(),s:Math.random()*3,a:Math.random()*0.3}));
  1295. function frame() {
  1296. t += 0.5; if (!pw || !ph) sz();
  1297. ctx.clearRect(0,0,pw,ph);
  1298. const bg = ctx.createLinearGradient(0,0,0,ph);
  1299. bg.addColorStop(0,'hsl(210,42%,5%)'); bg.addColorStop(1,'hsl(220,30%,3%)');
  1300. ctx.fillStyle = bg; ctx.fillRect(0,0,pw,ph);
  1301. ctx.strokeStyle = 'rgba(20,70,150,0.06)'; ctx.lineWidth = 0.5;
  1302. const vp = {x:pw/2, y:ph*0.45};
  1303. 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(); }
  1304. 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(); }
  1305. 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);
  1306. 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);
  1307. const np = [2,1,3,1,2,1,0,1,2][idx]||1;
  1308. for (let p=0;p<np;p++) {
  1309. const px=pw*(0.3+p*0.15+Math.sin(t*0.01+p)*0.02);
  1310. const py=ph*(0.6+Math.cos(t*0.008+p)*0.02);
  1311. ctx.fillStyle='rgba(120,170,255,0.65)'; ctx.beginPath(); ctx.arc(px,py,pw*0.025,0,Math.PI*2); ctx.fill();
  1312. ctx.fillStyle='rgba(70,130,220,0.4)'; ctx.fillRect(px-pw*0.02,py+pw*0.025,pw*0.04,ph*0.08);
  1313. }
  1314. const sl = (t*0.5) % ph; ctx.fillStyle='rgba(30,144,255,0.04)'; ctx.fillRect(0,sl,pw,2);
  1315. noise.forEach(n => {
  1316. ctx.fillStyle=`rgba(170,205,255,${n.a*0.5})`; ctx.fillRect(n.x*pw,n.y*ph,n.s,n.s);
  1317. if (Math.random()<0.02) { n.x=Math.random(); n.y=Math.random(); }
  1318. });
  1319. requestAnimationFrame(frame);
  1320. }
  1321. frame();
  1322. }
  1323. // ====================================================
  1324. // RESIZE CHARTS
  1325. // ====================================================
  1326. window.addEventListener('resize', () => {
  1327. ['chart-donut','chart-stack','chart-line','chart-gauge','chart-ring','chart-pie'].forEach(id => {
  1328. const el = document.getElementById(id);
  1329. if (el) { const c = echarts.getInstanceByDom(el); if (c) c.resize(); }
  1330. });
  1331. });
  1332. </script>
  1333. </body>
  1334. </html>