index-v2.html 104 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887
  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. /* ========== CHEMICAL INVENTORY TAGS ========== */
  243. .chem-tag-row { display:flex; gap:12px; margin-bottom:12px; }
  244. .chem-tag {
  245. flex:1; padding:14px 18px; border-radius:8px; text-align:center; cursor:pointer;
  246. font-size:26px; font-weight:600; letter-spacing:2px; border:1px solid rgba(30,144,255,0.3);
  247. background:var(--bg-card); color:var(--text-dim); transition:all 0.25s;
  248. }
  249. .chem-tag.active {
  250. border-color:var(--cyan); color:var(--cyan);
  251. background:rgba(0,216,255,0.1); text-shadow:0 0 10px rgba(0,216,255,0.5);
  252. box-shadow:0 0 12px rgba(0,216,255,0.15);
  253. }
  254. .chem-tag:hover:not(.active) { border-color:rgba(30,144,255,0.6); color:var(--text); }
  255. /* chemical inventory summary cards */
  256. .chem-stat-card {
  257. border-radius:10px; padding:16px 20px;
  258. background:rgba(4,14,38,0.7); border:1px solid rgba(30,144,255,0.15);
  259. transition:border-color 0.25s;
  260. }
  261. .chem-stat-card:hover { border-color:rgba(30,144,255,0.4); }
  262. .chem-stat-card.total { border-color:rgba(30,144,255,0.3); background:rgba(30,144,255,0.06); text-align:center; }
  263. .chem-stat-card.ctrl { border-color:rgba(239,68,68,0.25); background:rgba(239,68,68,0.05); }
  264. .chem-stat-card.free { border-color:rgba(0,216,255,0.2); background:rgba(0,216,255,0.04); }
  265. .chem-stat-card.cat { border-color:rgba(255,215,64,0.22); background:rgba(255,215,64,0.04); }
  266. .csc-label { font-size:24px; color:var(--text-dim); letter-spacing:2px; margin-bottom:4px; }
  267. .csc-value { font-size:52px; font-weight:700; color:#ef4444; line-height:1.1; }
  268. .csc-value.total { color:var(--white); }
  269. .chem-stat-card.total .csc-value { color:var(--white); font-size:60px; }
  270. .csc-unit { font-size:24px; font-weight:400; color:var(--text-dim); margin-left:6px; }
  271. .csc-sub { font-size:22px; color:rgba(239,68,68,0.55); margin-top:8px; }
  272. /* warn-item type: emergency vs chemical */
  273. .warn-item.type-emergency {
  274. background:rgba(245,158,11,0.06); border:1px solid rgba(245,158,11,0.25);
  275. }
  276. .warn-item.type-chemical {
  277. background:rgba(0,216,255,0.04); border:1px solid rgba(0,216,255,0.18);
  278. }
  279. .warn-type-badge {
  280. display:inline-flex; align-items:center; gap:5px;
  281. padding:4px 12px; border-radius:6px; font-size:22px; font-weight:600; margin-right:10px;
  282. }
  283. .warn-type-badge.emergency { background:rgba(245,158,11,0.15); color:#fbbf24; }
  284. .warn-type-badge.chemical { background:rgba(0,216,255,0.12); color:var(--cyan); }
  285. .warn-lab-info { font-size:27px; font-weight:600; color:#fcd34d; flex:1; min-width:0; }
  286. .warn-lab-info.chemical { color:#67e8f9; }
  287. /* ========== DEVICE STATS ========== */
  288. .device-online-row { display:flex; gap:18px; margin-bottom:18px; }
  289. .device-stat-chip {
  290. flex:1; padding:15px; border-radius:10px; text-align:center;
  291. background:var(--bg-card); border:1px solid var(--border);
  292. }
  293. .device-stat-chip.online { border-color:var(--green); }
  294. .device-stat-chip.offline { border-color:var(--red); }
  295. .device-stat-chip .dv { font-size:50px; font-weight:700; }
  296. .device-stat-chip.online .dv { color:var(--green); }
  297. .device-stat-chip.offline .dv { color:var(--red); }
  298. .device-stat-chip .dl { font-size:25px; color:var(--text-dim); }
  299. .device-list-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  300. .device-list-item {
  301. padding:15px; border-radius:10px;
  302. background:var(--bg-card); border:1px solid var(--border);
  303. display:flex; flex-direction:column; align-items:center; gap:8px;
  304. }
  305. .device-list-item .dli-icon { font-size:40px; }
  306. .device-list-item .dli-num { font-size:38px; font-weight:700; color:var(--gold); }
  307. .device-list-item .dli-name { font-size:22px; color:var(--text-dim); text-align:center; line-height:1.3; }
  308. /* ========== EQUIP STATS ========== */
  309. .equip-mid-row { display:flex; gap:15px; }
  310. .equip-stat-item { flex:1; text-align:center; padding:15px 10px; border-radius:10px; background:var(--bg-card); border:1px solid var(--border); }
  311. .equip-stat-item .ev { font-size:38px; font-weight:700; color:var(--gold); }
  312. .equip-stat-item .el { font-size:22px; color:var(--text-dim); margin-top:5px; }
  313. /* ========== EQUIP STATUS CARDS ========== */
  314. .equip-status-card {
  315. position:relative; border-radius:12px; padding:18px 22px 15px;
  316. background:var(--bg-card);
  317. border:1px solid color-mix(in srgb, var(--sc) 35%, transparent);
  318. display:flex; flex-direction:column; justify-content:space-between;
  319. overflow:hidden; transition:border-color 0.3s;
  320. }
  321. .equip-status-card::before {
  322. content:''; position:absolute; inset:0;
  323. background:radial-gradient(ellipse at 10% 10%, color-mix(in srgb, var(--sc) 10%, transparent) 0%, transparent 65%);
  324. pointer-events:none;
  325. }
  326. .equip-status-card:hover { border-color:color-mix(in srgb, var(--sc) 70%, transparent); }
  327. .esc-icon {
  328. width:70px; height:70px; color:var(--sc);
  329. filter:drop-shadow(0 0 12px var(--sc));
  330. animation:iconGlow 3s ease-in-out infinite;
  331. flex-shrink:0;
  332. }
  333. .esc-num {
  334. font-size:55px; font-weight:700; letter-spacing:2px;
  335. color:var(--sc); line-height:1;
  336. text-shadow:0 0 30px color-mix(in srgb, var(--sc) 60%, transparent);
  337. }
  338. .esc-label { font-size:25px; color:var(--text-dim); margin-top:2px; }
  339. .esc-bar { height:5px; border-radius:2px; background:rgba(255,255,255,0.06); margin-top:10px; overflow:hidden; }
  340. .esc-bar-fill {
  341. height:100%; border-radius:2px;
  342. background:linear-gradient(90deg, var(--sc), color-mix(in srgb, var(--sc) 50%, transparent));
  343. box-shadow:0 0 10px var(--sc);
  344. }
  345. /* ========== CENTER COL (3区) ========== */
  346. .center-col { display:flex; flex-direction:column; padding:0 10px; min-height:0; position:relative; }
  347. /* Monitor view — 全时显示 */
  348. #view-monitor {
  349. flex:1; display:flex; flex-direction:column; border-radius:15px;
  350. border:1px solid var(--border); background:var(--bg-panel); overflow:hidden; min-height:0;
  351. }
  352. .monitor-header {
  353. padding:20px 30px; border-bottom:1px solid var(--border); flex-shrink:0;
  354. display:flex; align-items:center; gap:25px;
  355. background:linear-gradient(90deg,rgba(0,60,160,0.18),transparent);
  356. }
  357. .monitor-inner { flex:1; display:grid; grid-template-columns:575px 1fr; gap:0; min-height:0; overflow:hidden; }
  358. .monitor-left {
  359. display:flex; flex-direction:column; gap:15px; padding:20px; border-right:1px solid var(--border);
  360. min-height:0; overflow:hidden;
  361. }
  362. .monitor-right { padding:20px; display:flex; flex-direction:column; gap:15px; min-height:0; }
  363. .search-box {
  364. display:flex; align-items:center; gap:18px; padding:15px 25px; border-radius:10px;
  365. background:var(--bg-card); border:1px solid var(--border); flex-shrink:0;
  366. }
  367. .search-box input { flex:1; background:none; border:none; outline:none; color:var(--text); font-size:30px; font-family:var(--font-main); }
  368. .search-box input::placeholder { color:var(--text-dim); }
  369. .filter-select {
  370. padding:12px 25px; border-radius:10px; width:100%; flex-shrink:0;
  371. background:var(--bg-card); border:1px solid var(--border);
  372. color:var(--text); font-size:28px; font-family:var(--font-main); outline:none; cursor:pointer; appearance:none;
  373. 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");
  374. background-repeat:no-repeat; background-position:right 25px center;
  375. }
  376. .tree-wrap { flex:1; overflow-y:auto; overflow-x:hidden; min-height:0; }
  377. .tree-wrap::-webkit-scrollbar { width:8px; }
  378. .tree-wrap::-webkit-scrollbar-thumb { background:var(--border); border-radius:5px; }
  379. .tree-node-label {
  380. display:flex; align-items:center; gap:15px; padding:12px 20px; border-radius:8px;
  381. font-size:28px; color:var(--text); transition:all 0.2s; user-select:none; cursor:pointer;
  382. }
  383. .tree-node-label:hover { background:var(--blue-dim); color:var(--blue); }
  384. .tree-node-label.selected { background:rgba(30,144,255,0.15); color:var(--cyan); border-left:5px solid var(--blue); }
  385. .tree-node-label .arrow { transition:transform 0.2s; font-size:25px; color:var(--text-dim); flex-shrink:0; }
  386. .tree-node-label .arrow.open { transform:rotate(90deg); }
  387. .tree-children { padding-left:35px; display:none; }
  388. .tree-children.open { display:block; }
  389. .camera-grid-header { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
  390. .camera-breadcrumb { font-size:30px; color:var(--text-dim); }
  391. .camera-breadcrumb span { color:var(--cyan); }
  392. .camera-pager { display:flex; align-items:center; gap:15px; }
  393. .pager-btn {
  394. width:60px; height:60px; border-radius:8px; cursor:pointer;
  395. background:var(--bg-card); border:1px solid var(--border);
  396. color:var(--text-dim); font-size:32px; display:flex; align-items:center; justify-content:center; transition:all 0.2s;
  397. }
  398. .pager-btn:hover { border-color:var(--blue); color:var(--blue); }
  399. .pager-info { font-size:28px; color:var(--text-dim); }
  400. .camera-grid {
  401. display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr);
  402. gap:12px; flex:1; min-height:0;
  403. }
  404. .camera-cell {
  405. position:relative; border-radius:10px; overflow:hidden;
  406. background:#020810; border:1px solid var(--border);
  407. display:flex; align-items:center; justify-content:center;
  408. }
  409. .camera-cell:hover { border-color:var(--blue); }
  410. .camera-cell.ai-cam { border-color:rgba(0,230,118,0.4); }
  411. .camera-cell canvas { width:100%; height:100%; display:block; }
  412. .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%); }
  413. .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; }
  414. .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; }
  415. .camera-rec::before { content:''; width:12px; height:12px; border-radius:50%; background:var(--red); animation:blinkRed 1s ease-in-out infinite; }
  416. .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); }
  417. .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; }
  418. @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)} }
  419. .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; }
  420. /* ========== STATUS DOTS ========== */
  421. .status-dot { width:20px; height:20px; border-radius:50%; display:inline-block; animation:dotPulse 2s ease-in-out infinite; }
  422. .status-dot.green { background:var(--green); box-shadow:0 0 15px var(--green); }
  423. .status-dot.red { background:var(--red); box-shadow:0 0 15px var(--red); animation:blinkRed 0.8s ease-in-out infinite; }
  424. .status-dot.orange { background:#f59e0b; box-shadow:0 0 15px #f59e0b; }
  425. @keyframes dotPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:0.7} }
  426. /* ========== SCAN EFFECT ========== */
  427. .scan-effect { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:0; }
  428. .scan-effect::after {
  429. content:''; position:absolute; left:0; right:0; height:200px; top:-200px;
  430. background:linear-gradient(180deg,transparent,rgba(30,144,255,0.025),transparent);
  431. animation:scanFull 9s linear infinite;
  432. }
  433. @keyframes scanFull { from{top:-200px} to{top:100%} }
  434. /* ========== ALERT MODAL ========== */
  435. #alert-modal {
  436. position:fixed; inset:0; z-index:9999;
  437. display:none; align-items:center; justify-content:center;
  438. background:rgba(0,0,0,0.9); backdrop-filter:blur(6px);
  439. }
  440. #alert-modal.show { display:flex; animation:alertFadeIn 0.4s ease; }
  441. @keyframes alertFadeIn { from{opacity:0;transform:scale(0.88)} to{opacity:1;transform:scale(1)} }
  442. .alert-modal-inner {
  443. position:relative; width:2200px; border-radius:20px; overflow:hidden;
  444. background:linear-gradient(135deg,rgba(38,3,8,0.98),rgba(14,2,5,0.99));
  445. border:2px solid rgba(239,68,68,0.5);
  446. box-shadow:0 0 250px rgba(239,68,68,0.45),inset 0 0 150px rgba(200,0,0,0.08);
  447. }
  448. .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; }
  449. @keyframes alertScan { from{top:0} to{top:100%} }
  450. .alert-modal-header {
  451. padding:45px 60px 35px; background:linear-gradient(90deg,rgba(200,0,0,0.18),transparent);
  452. display:flex; align-items:center; gap:40px; border-bottom:2px solid rgba(239,68,68,0.25);
  453. }
  454. .alert-icon { font-size:85px; animation:alertFlash 0.6s ease-in-out infinite; }
  455. @keyframes alertFlash { 0%,100%{opacity:1} 50%{opacity:0.15} }
  456. .alert-title { font-size:55px; font-weight:700; color:#ef4444; letter-spacing:8px; }
  457. .alert-subtitle { font-size:28px; color:rgba(239,100,100,0.6); margin-top:8px; letter-spacing:5px; }
  458. /* body: flex row — left cam + right info */
  459. .alert-modal-body { padding:45px 60px; display:flex; gap:50px; align-items:flex-start; }
  460. /* LEFT: camera panel */
  461. .alert-cam-wrap {
  462. flex:0 0 900px;
  463. display:flex; flex-direction:column; gap:15px;
  464. }
  465. .alert-cam-label {
  466. font-size:28px; color:rgba(255,150,150,0.7); letter-spacing:5px;
  467. display:flex; align-items:center; gap:20px;
  468. }
  469. .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; }
  470. .alert-cam-box {
  471. position:relative; width:900px; height:700px; border-radius:10px; overflow:hidden;
  472. border:2px solid rgba(239,68,68,0.5);
  473. box-shadow:0 0 50px rgba(239,68,68,0.25), inset 0 0 75px rgba(200,0,0,0.1);
  474. }
  475. .alert-cam-box canvas { display:block; width:100%; height:100%; }
  476. .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%); }
  477. .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; }
  478. .alert-cam-rec::before { content:''; width:15px; height:15px; border-radius:50%; background:#ef4444; animation:blinkRed 1s ease-in-out infinite; }
  479. .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; }
  480. .alert-cam-bottom { position:absolute; bottom:20px; left:25px; right:25px; display:flex; justify-content:space-between; align-items:center; }
  481. .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; }
  482. .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); }
  483. .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; }
  484. .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; }
  485. /* RIGHT: info */
  486. .alert-info-col { flex:1; display:flex; flex-direction:column; gap:35px; }
  487. .alert-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:25px; }
  488. .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); }
  489. .alert-info-item .ail { font-size:28px; color:rgba(255,150,150,0.65); margin-bottom:10px; }
  490. .alert-info-item .aiv { font-size:40px; font-weight:700; color:#ef4444; }
  491. .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); }
  492. .alert-modal-footer { padding:30px 60px; display:flex; gap:30px; justify-content:flex-end; border-top:1px solid rgba(239,68,68,0.15); }
  493. .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; }
  494. .btn-alert-confirm:hover { background:rgba(239,68,68,0.3); }
  495. .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; }
  496. /* ========== EVACUATION MODAL ========== */
  497. #evac-modal {
  498. position:fixed; inset:0; z-index:10000;
  499. display:none; align-items:center; justify-content:center;
  500. background:rgba(0,2,18,0.94); backdrop-filter:blur(8px);
  501. }
  502. #evac-modal.show { display:flex; animation:alertFadeIn 0.4s ease; }
  503. .evac-inner {
  504. position:relative; width:2820px; border-radius:20px; overflow:hidden;
  505. background:linear-gradient(135deg,rgba(2,8,28,0.99),rgba(1,5,20,0.99));
  506. border:2px solid rgba(30,144,255,0.45);
  507. box-shadow:0 0 200px rgba(30,144,255,0.22), inset 0 0 120px rgba(0,50,140,0.05);
  508. display:flex; flex-direction:column; max-height:96vh;
  509. }
  510. .evac-hdr {
  511. padding:36px 55px; display:flex; align-items:center; gap:28px; flex-shrink:0;
  512. border-bottom:1px solid rgba(30,144,255,0.2);
  513. background:linear-gradient(90deg,rgba(0,55,160,0.12),transparent);
  514. }
  515. .evac-hdr-icon { font-size:68px; }
  516. .evac-hdr-title { font-size:50px; font-weight:700; color:var(--white); letter-spacing:6px; }
  517. .evac-hdr-close {
  518. margin-left:auto; width:68px; height:68px; border-radius:10px;
  519. border:1px solid rgba(30,144,255,0.35); background:rgba(30,144,255,0.08);
  520. color:var(--cyan); font-size:34px; cursor:pointer;
  521. display:flex; align-items:center; justify-content:center; transition:background 0.2s;
  522. }
  523. .evac-hdr-close:hover { background:rgba(30,144,255,0.22); }
  524. .evac-body { display:flex; flex:1; min-height:0; overflow:hidden; }
  525. .evac-map-col { flex:1; min-width:0; padding:26px 28px; display:flex; flex-direction:column; gap:14px; }
  526. .evac-legend { display:flex; align-items:center; gap:12px; justify-content:flex-end; }
  527. .evac-legend-rect { width:36px; height:14px; background:#1e90ff; border-radius:3px; }
  528. .evac-legend-text { font-size:26px; color:var(--text-dim); }
  529. .evac-map-wrap {
  530. flex:1; min-height:0; position:relative;
  531. border-radius:10px; background:rgba(1,8,28,0.65);
  532. border:1px solid rgba(30,144,255,0.15);
  533. }
  534. .evac-map-wrap svg { width:100%; height:100%; display:block; }
  535. .evac-popup {
  536. position:absolute; left:3%; top:53%;
  537. width:390px; border-radius:10px; padding:18px 24px 20px;
  538. background:rgba(45,4,6,0.97); border:2px solid rgba(239,68,68,0.6);
  539. box-shadow:0 0 50px rgba(239,68,68,0.28); z-index:5; pointer-events:none;
  540. }
  541. .evac-popup-hdr { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
  542. .evac-popup-alarm { font-size:30px; }
  543. .evac-popup-time { font-size:22px; color:rgba(255,255,255,0.65); flex:1; }
  544. .evac-popup-x { color:rgba(255,255,255,0.45); font-size:22px; }
  545. .evac-popup-badge { background:#ef4444; color:#fff; font-size:20px; font-weight:700; border-radius:5px; padding:4px 14px; display:inline-block; margin-bottom:12px; letter-spacing:1px; }
  546. .evac-popup-msg { font-size:28px; font-weight:600; color:#fff; letter-spacing:1px; }
  547. .evac-right-col { flex:0 0 540px; border-left:1px solid rgba(30,144,255,0.15); display:flex; flex-direction:column; }
  548. .evac-right-hdr { padding:22px 28px; font-size:26px; color:var(--text-dim); letter-spacing:3px; border-bottom:1px solid rgba(30,144,255,0.12); background:rgba(30,144,255,0.04); flex-shrink:0; }
  549. .evac-cam-slot { flex:1; border-bottom:1px solid rgba(30,144,255,0.1); display:flex; align-items:center; justify-content:center; background:rgba(12,15,26,0.6); color:rgba(255,255,255,0.2); font-size:26px; letter-spacing:3px; min-height:180px; }
  550. .evac-floor-lbl { padding:14px 28px; font-size:24px; color:var(--text-dim); letter-spacing:3px; background:rgba(30,144,255,0.06); border-top:1px solid rgba(30,144,255,0.12); border-bottom:1px solid rgba(30,144,255,0.12); flex-shrink:0; }
  551. .evac-footer { padding:26px 50px; display:flex; gap:28px; align-items:stretch; border-top:1px solid rgba(30,144,255,0.15); flex-shrink:0; }
  552. .evac-metrics { flex:0 0 490px; display:flex; flex-direction:column; gap:12px; justify-content:center; }
  553. .evac-metric-row { background:rgba(239,68,68,0.06); border:1px solid rgba(239,68,68,0.2); border-radius:8px; padding:14px 20px; display:flex; justify-content:space-between; align-items:center; }
  554. .evac-metric-col .evac-ml { font-size:22px; color:var(--text-dim); margin-bottom:4px; }
  555. .evac-metric-col .evac-mv { font-size:28px; font-weight:600; color:#ef4444; }
  556. .evac-metric-rt { font-size:26px; color:rgba(255,255,255,0.75); }
  557. .evac-broadcast { flex:1; border:1px solid rgba(30,144,255,0.22); border-radius:12px; padding:18px 24px; display:flex; flex-direction:column; gap:14px; background:rgba(30,144,255,0.04); }
  558. .evac-bc-hdr { display:flex; align-items:center; gap:14px; }
  559. .evac-bc-icon { font-size:28px; }
  560. .evac-bc-title { font-size:30px; font-weight:600; color:var(--white); flex:1; }
  561. .evac-bc-device { font-size:24px; color:var(--text-dim); }
  562. .evac-speaker-row { display:flex; gap:14px; }
  563. .evac-speaker-btn { flex:1; padding:14px 8px; border-radius:8px; font-size:23px; border:1px solid rgba(30,144,255,0.35); background:rgba(30,144,255,0.1); color:var(--cyan); cursor:pointer; transition:background 0.2s; white-space:nowrap; }
  564. .evac-speaker-btn:hover, .evac-speaker-btn.on { background:rgba(30,144,255,0.25); border-color:var(--cyan); }
  565. .evac-input-row { display:flex; gap:14px; }
  566. .evac-text-input { flex:1; padding:13px 18px; border-radius:8px; font-size:26px; border:1px solid rgba(30,144,255,0.25); background:rgba(0,8,36,0.7); color:var(--white); outline:none; }
  567. .evac-text-input::placeholder { color:rgba(255,255,255,0.2); }
  568. .evac-send-btn { padding:13px 40px; border-radius:8px; font-size:26px; font-weight:600; border:1px solid rgba(30,144,255,0.4); background:rgba(30,144,255,0.14); color:var(--cyan); cursor:pointer; transition:background 0.2s; }
  569. .evac-send-btn:hover { background:rgba(30,144,255,0.3); }
  570. .evac-actions { flex:0 0 380px; display:flex; flex-direction:column; gap:14px; justify-content:center; }
  571. .evac-btn-later { padding:22px; border-radius:10px; font-size:30px; font-weight:600; border:1px solid rgba(255,255,255,0.2); background:rgba(255,255,255,0.05); color:rgba(255,255,255,0.55); cursor:pointer; }
  572. .evac-btn-later:hover { background:rgba(255,255,255,0.1); }
  573. .evac-btn-exec { padding:22px; border-radius:10px; font-size:30px; font-weight:700; border:2px solid #ef4444; background:rgba(239,68,68,0.16); color:#ef4444; cursor:pointer; }
  574. .evac-btn-exec:hover { background:rgba(239,68,68,0.32); }
  575. .btn-alert-evac { padding:22px 70px; border-radius:10px; cursor:pointer; border:2px solid #f59e0b; background:rgba(245,158,11,0.15); color:#f59e0b; font-size:32px; font-weight:600; transition:all 0.2s; }
  576. .btn-alert-evac:hover { background:rgba(245,158,11,0.3); }
  577. /* ========== SCROLLBAR ========== */
  578. ::-webkit-scrollbar { width:8px; height:8px; }
  579. ::-webkit-scrollbar-track { background:transparent; }
  580. ::-webkit-scrollbar-thumb { background:var(--border); border-radius:5px; }
  581. /* ========== CHART HEIGHTS ========== */
  582. #chart-donut { width:100%; height:100%; }
  583. #chart-stack { width:100%; height:100%; }
  584. #chart-line { width:100%; height:100%; }
  585. #chart-gauge { width:100%; height:100%; }
  586. #chart-ring { width:100%; height:100%; }
  587. #chart-pie-status { width:100%; flex:1; min-height:0; }
  588. #chart-pie-usage { width:100%; flex:1; min-height:0; }
  589. </style>
  590. </head>
  591. <body>
  592. <canvas id="nebula-canvas"></canvas>
  593. <!-- ===== ALERT MODAL ===== -->
  594. <div id="alert-modal">
  595. <div class="alert-modal-inner">
  596. <div class="alert-scan-line"></div>
  597. <div class="alert-modal-header">
  598. <span class="alert-icon">🚨</span>
  599. <div>
  600. <div class="alert-title">⚡ 系统预警 · ALERT</div>
  601. <div class="alert-subtitle">LABORATORY SAFETY MONITORING SYSTEM · EMERGENCY</div>
  602. </div>
  603. </div>
  604. <div class="alert-modal-body">
  605. <!-- 左侧: 实验室实时监控画面 360×280 -->
  606. <div class="alert-cam-wrap">
  607. <div class="alert-cam-label">告警实验室实时监控画面</div>
  608. <div class="alert-cam-box">
  609. <canvas id="alert-cam-canvas" width="900" height="700"></canvas>
  610. <div class="alert-cam-overlay"></div>
  611. <div class="alert-cam-id">CAM · A301-02</div>
  612. <div class="alert-cam-rec">REC</div>
  613. <div class="alert-cam-bottom">
  614. <span class="alert-cam-name">化学分析实验室 A301</span>
  615. <span class="alert-cam-ai">🤖 AI检测</span>
  616. </div>
  617. <!-- AI危险行为框 -->
  618. <div class="alert-det-box" style="left:22%;top:15%;width:28%;height:42%">
  619. <div class="alert-det-label">危险行为: 未佩戴防护</div>
  620. </div>
  621. </div>
  622. </div>
  623. <!-- 右侧: 告警信息 -->
  624. <div class="alert-info-col">
  625. <div class="alert-info-grid">
  626. <div class="alert-info-item"><div class="ail">告警实验室</div><div class="aiv" id="alert-lab">化学分析实验室 (A301)</div></div>
  627. <div class="alert-info-item"><div class="ail">所属单位</div><div class="aiv" id="alert-unit">化学研究所</div></div>
  628. <div class="alert-info-item"><div class="ail">告警指标</div><div class="aiv" id="alert-metric">TVOC 浓度超标</div></div>
  629. <div class="alert-info-item"><div class="ail">当前值 / 安全阈值</div><div class="aiv" id="alert-value">2.85 / 0.6 mg/m³</div></div>
  630. </div>
  631. <div class="alert-pulse-text">▶▶ 请立即采取安全措施,疏散实验人员 ◀◀</div>
  632. </div>
  633. </div>
  634. <div class="alert-modal-footer">
  635. <button class="btn-alert-ignore" onclick="closeAlert()">稍后处理</button>
  636. <button class="btn-alert-evac" onclick="openEvac()">🚪 应急疏散</button>
  637. <button class="btn-alert-confirm" onclick="closeAlert()">确认处理</button>
  638. </div>
  639. </div>
  640. </div>
  641. <!-- ===== EVACUATION MODAL ===== -->
  642. <div id="evac-modal">
  643. <div class="evac-inner">
  644. <!-- Header -->
  645. <div class="evac-hdr">
  646. <span class="evac-hdr-icon">🚪</span>
  647. <span class="evac-hdr-title">应急疏散</span>
  648. <button class="evac-hdr-close" onclick="closeEvac()">✕</button>
  649. </div>
  650. <!-- Body -->
  651. <div class="evac-body">
  652. <!-- Left: floor plan -->
  653. <div class="evac-map-col">
  654. <div class="evac-legend">
  655. <div class="evac-legend-rect"></div>
  656. <span class="evac-legend-text">应急疏散路线图</span>
  657. </div>
  658. <div class="evac-map-wrap">
  659. <svg viewBox="0 0 1060 590" xmlns="http://www.w3.org/2000/svg">
  660. <defs>
  661. <marker id="ev-arrow" markerWidth="9" markerHeight="7" refX="8" refY="3.5" orient="auto">
  662. <polygon points="0 0, 9 3.5, 0 7" fill="#1e90ff"/>
  663. </marker>
  664. </defs>
  665. <!-- Top row background -->
  666. <rect x="45" y="40" width="758" height="185" fill="rgba(0,15,50,0.3)" stroke="rgba(30,144,255,0.28)" stroke-width="1.5"/>
  667. <!-- Emergency exit zone top-right -->
  668. <rect x="808" y="40" width="205" height="185" fill="rgba(30,144,255,0.04)" stroke="rgba(30,144,255,0.22)" stroke-width="1" stroke-dasharray="9,5" rx="2"/>
  669. <text x="910" y="118" text-anchor="middle" fill="rgba(30,144,255,0.6)" font-size="22">紧急</text>
  670. <text x="910" y="146" text-anchor="middle" fill="rgba(30,144,255,0.6)" font-size="22">出口</text>
  671. <line x1="870" y1="132" x2="918" y2="132" stroke="#1e90ff" stroke-width="3" marker-end="url(#ev-arrow)" opacity="0.75"/>
  672. <!-- A101 -->
  673. <rect x="45" y="40" width="190" height="185" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  674. <line x1="45" y1="40" x2="235" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  675. <line x1="235" y1="40" x2="45" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  676. <text x="140" y="140" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A101</text>
  677. <!-- A102 -->
  678. <rect x="235" y="40" width="190" height="185" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  679. <line x1="235" y1="40" x2="425" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  680. <line x1="425" y1="40" x2="235" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  681. <text x="330" y="140" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A102</text>
  682. <!-- A103 -->
  683. <rect x="425" y="40" width="190" height="185" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  684. <line x1="425" y1="40" x2="615" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  685. <line x1="615" y1="40" x2="425" y2="225" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  686. <text x="520" y="140" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A103</text>
  687. <!-- A104 (blue — near top-right exit) -->
  688. <rect x="615" y="40" width="193" height="185" fill="rgba(30,144,255,0.1)" stroke="#1e90ff" stroke-width="3"/>
  689. <line x1="615" y1="40" x2="808" y2="225" stroke="rgba(30,144,255,0.18)" stroke-width="1"/>
  690. <line x1="808" y1="40" x2="615" y2="225" stroke="rgba(30,144,255,0.18)" stroke-width="1"/>
  691. <text x="711" y="140" text-anchor="middle" fill="#7ab8e8" font-size="22">A104</text>
  692. <!-- Corridor -->
  693. <rect x="45" y="225" width="968" height="85" fill="rgba(0,25,70,0.18)" stroke="rgba(30,144,255,0.2)" stroke-width="1"/>
  694. <text x="350" y="277" text-anchor="middle" fill="rgba(168,204,232,0.38)" font-size="24" letter-spacing="6">走道</text>
  695. <!-- Assembly points -->
  696. <circle cx="645" cy="268" r="22" fill="none" stroke="#1e90ff" stroke-width="2.5" opacity="0.75"/>
  697. <circle cx="755" cy="268" r="22" fill="none" stroke="#1e90ff" stroke-width="2.5" opacity="0.75"/>
  698. <!-- Bottom section background -->
  699. <rect x="45" y="310" width="968" height="242" fill="rgba(0,15,50,0.3)" stroke="rgba(30,144,255,0.28)" stroke-width="1.5"/>
  700. <!-- Emergency exit zone bottom-left label -->
  701. <text x="22" y="445" text-anchor="middle" fill="rgba(30,144,255,0.58)" font-size="19" transform="rotate(-90,22,445)">紧急出口</text>
  702. <line x1="47" y1="432" x2="16" y2="432" stroke="#1e90ff" stroke-width="3" marker-end="url(#ev-arrow)" opacity="0.7"/>
  703. <!-- A105 (red — alert room) -->
  704. <rect x="45" y="310" width="185" height="242" fill="rgba(239,68,68,0.1)" stroke="#ef4444" stroke-width="3"/>
  705. <line x1="45" y1="310" x2="230" y2="552" stroke="rgba(239,68,68,0.22)" stroke-width="1.5"/>
  706. <line x1="230" y1="310" x2="45" y2="552" stroke="rgba(239,68,68,0.22)" stroke-width="1.5"/>
  707. <text x="137" y="440" text-anchor="middle" fill="#ef4444" font-size="22" font-weight="600">A105</text>
  708. <!-- A106 -->
  709. <rect x="230" y="310" width="185" height="242" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  710. <line x1="230" y1="310" x2="415" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  711. <line x1="415" y1="310" x2="230" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  712. <text x="322" y="440" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A106</text>
  713. <!-- A107 -->
  714. <rect x="415" y="310" width="185" height="242" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  715. <line x1="415" y1="310" x2="600" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  716. <line x1="600" y1="310" x2="415" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  717. <text x="507" y="440" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A107</text>
  718. <!-- A108 -->
  719. <rect x="600" y="310" width="185" height="242" fill="rgba(0,15,50,0.25)" stroke="rgba(30,144,255,0.42)" stroke-width="1.5"/>
  720. <line x1="600" y1="310" x2="785" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  721. <line x1="785" y1="310" x2="600" y2="552" stroke="rgba(30,144,255,0.12)" stroke-width="1"/>
  722. <text x="692" y="440" text-anchor="middle" fill="rgba(168,204,232,0.65)" font-size="22">A108</text>
  723. <!-- A109 (blue — evacuation destination) -->
  724. <rect x="785" y="310" width="228" height="242" fill="rgba(30,144,255,0.1)" stroke="#1e90ff" stroke-width="3"/>
  725. <line x1="785" y1="310" x2="1013" y2="552" stroke="rgba(30,144,255,0.18)" stroke-width="1.5"/>
  726. <line x1="1013" y1="310" x2="785" y2="552" stroke="rgba(30,144,255,0.18)" stroke-width="1.5"/>
  727. <text x="899" y="440" text-anchor="middle" fill="#7ab8e8" font-size="22" font-weight="600">A109</text>
  728. <!-- Evacuation route: bottom-left through corridor -->
  729. <line x1="230" y1="432" x2="50" y2="432" stroke="#1e90ff" stroke-width="3" stroke-dasharray="14,7" marker-end="url(#ev-arrow)"/>
  730. <!-- Evacuation route: top-right toward exit -->
  731. <line x1="808" y1="132" x2="862" y2="132" stroke="#1e90ff" stroke-width="3" stroke-dasharray="14,7" marker-end="url(#ev-arrow)"/>
  732. <!-- Connector: corridor down to A104 corridor side -->
  733. <line x1="711" y1="225" x2="711" y2="310" stroke="#1e90ff" stroke-width="3" stroke-dasharray="14,7"/>
  734. </svg>
  735. <!-- Floating alert popup over A105 -->
  736. <div class="evac-popup">
  737. <div class="evac-popup-hdr">
  738. <span class="evac-popup-alarm">🚨</span>
  739. <span class="evac-popup-time">2026-03-23 14:32:18</span>
  740. <span class="evac-popup-x">✕</span>
  741. </div>
  742. <div class="evac-popup-badge">触发风险</div>
  743. <div class="evac-popup-msg">发生风险:TVOC浓度超标</div>
  744. </div>
  745. </div>
  746. </div>
  747. <!-- Right: camera feeds -->
  748. <div class="evac-right-col">
  749. <div class="evac-right-hdr">房间号-实验室名称</div>
  750. <div class="evac-cam-slot">实时视频监控</div>
  751. <div class="evac-cam-slot">实时视频监控</div>
  752. <div class="evac-floor-lbl">楼道 2层</div>
  753. <div class="evac-cam-slot">实时视频监控</div>
  754. </div>
  755. </div>
  756. <!-- Footer -->
  757. <div class="evac-footer">
  758. <!-- Alert metrics -->
  759. <div class="evac-metrics">
  760. <div class="evac-metric-row">
  761. <div class="evac-metric-col">
  762. <div class="evac-ml">告警指标</div>
  763. <div class="evac-mv">TVOC 浓度超标</div>
  764. </div>
  765. <div class="evac-metric-rt">2.85 / 0.6 mg/m³</div>
  766. </div>
  767. <div class="evac-metric-row">
  768. <div class="evac-metric-col">
  769. <div class="evac-ml">当前值 / 安全阈值</div>
  770. <div class="evac-mv">TVOC 浓度超标</div>
  771. </div>
  772. <div class="evac-metric-rt">2.85 / 0.6 mg/m³</div>
  773. </div>
  774. </div>
  775. <!-- Voice broadcast -->
  776. <div class="evac-broadcast">
  777. <div class="evac-bc-hdr">
  778. <span class="evac-bc-icon">📢</span>
  779. <span class="evac-bc-title">语音广播</span>
  780. <span class="evac-bc-device">选择播放设备</span>
  781. </div>
  782. <div class="evac-speaker-row">
  783. <button class="evac-speaker-btn on">NKL1FB1122 喇叭</button>
  784. <button class="evac-speaker-btn on">NKL1FB1122 喇叭</button>
  785. <button class="evac-speaker-btn on">NKL1FB1122 喇叭</button>
  786. </div>
  787. <div class="evac-input-row">
  788. <input type="text" class="evac-text-input" placeholder="请输入喊话内容"/>
  789. <button class="evac-send-btn">发送</button>
  790. </div>
  791. </div>
  792. <!-- Action buttons -->
  793. <div class="evac-actions">
  794. <button class="evac-btn-later" onclick="closeEvac()">稍后处理</button>
  795. <button class="evac-btn-exec">执行疏散</button>
  796. </div>
  797. </div>
  798. </div>
  799. </div>
  800. <!-- ===== MAIN WRAPPER ===== -->
  801. <div id="scale-root">
  802. <div class="bg-hex"></div>
  803. <div class="scan-effect"></div>
  804. <!-- TOP NAV -->
  805. <nav class="top-nav">
  806. <!-- 左侧:实时时钟 + 星期 -->
  807. <div class="nav-left" style="justify-content:flex-start">
  808. <div class="nav-clock">
  809. <div class="time" id="clock-time">--:--:--</div>
  810. <div class="date" id="clock-date">----年--月--日 星期-</div>
  811. </div>
  812. </div>
  813. <!-- 中部:LOGO + 单位名称 + 大标题 -->
  814. <div class="nav-center">
  815. <div class="nav-logo"><div class="nav-logo-ring"></div></div>
  816. <div class="nav-org" style="margin-right:50px">
  817. <strong>中国安全生产科学研究院</strong>
  818. <span>National Institute for Occupational Safety</span>
  819. </div>
  820. <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>
  821. <div style="display:flex;flex-direction:column;align-items:center;position:relative">
  822. <div class="nav-title">实验室安全智能监测与管控中心</div>
  823. <div class="nav-title-deco"></div>
  824. </div>
  825. </div>
  826. <!-- 右侧:天气 -->
  827. <div class="nav-right" style="justify-content:flex-end">
  828. <div class="nav-weather">
  829. <span class="icon">⛅</span>
  830. <div>
  831. <div>北京 · 晴转多云</div>
  832. <div style="font-size:28px;color:var(--gold)">12°C / AQI 68</div>
  833. </div>
  834. </div>
  835. </div>
  836. </nav>
  837. <!-- MAIN CONTENT: 4 COLS L→R: 1区(2) 2区(2) 3区(4) 4区(2) -->
  838. <div class="main-content">
  839. <!-- ======== 1区 ======== -->
  840. <div class="panel-col">
  841. <!-- 实验室基本情况统计 -->
  842. <div class="panel" style="flex:0 0 auto;display:flex;flex-direction:column">
  843. <div class="border-beam"></div>
  844. <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>
  845. <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>
  846. <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>
  847. <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>
  848. <div class="panel-header">
  849. <div class="panel-header-icon">🏛️</div>
  850. <span class="panel-title">实验室基本情况统计</span>
  851. <div class="status-dot green" style="margin-left:auto"></div>
  852. </div>
  853. <!-- 上部 80%:左(3) 总数 + 右(7) 分级 -->
  854. <div style="flex:4;display:flex;min-height:680px;overflow:hidden">
  855. <!-- 左侧 4:实验室总数统计 -->
  856. <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)">
  857. <!-- SVG 圆弧仪表 -->
  858. <svg width="320" height="320" viewBox="0 0 320 320">
  859. <defs>
  860. <linearGradient id="arcG1" x1="0%" y1="0%" x2="100%" y2="100%">
  861. <stop offset="0%" stop-color="#1e90ff"/>
  862. <stop offset="100%" stop-color="#00d8ff"/>
  863. </linearGradient>
  864. <filter id="glow1">
  865. <feGaussianBlur stdDeviation="4" result="blur"/>
  866. <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
  867. </filter>
  868. </defs>
  869. <!-- 最外装饰环 -->
  870. <circle cx="160" cy="160" r="148" fill="none" stroke="rgba(30,144,255,0.08)" stroke-width="1" stroke-dasharray="6 6"/>
  871. <!-- 外轨道 -->
  872. <circle cx="160" cy="160" r="136" fill="none" stroke="rgba(30,144,255,0.14)" stroke-width="3"/>
  873. <!-- 主弧 300° -->
  874. <circle cx="160" cy="160" r="136" fill="none" stroke="url(#arcG1)" stroke-width="8"
  875. stroke-dasharray="711 143" stroke-linecap="round" transform="rotate(-240 160 160)" filter="url(#glow1)"/>
  876. <!-- 内轨道 -->
  877. <circle cx="160" cy="160" r="110" fill="rgba(3,14,31,0.7)" stroke="rgba(0,216,255,0.15)" stroke-width="2"/>
  878. <!-- 四分级色弧 小环 -->
  879. <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"/>
  880. <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"/>
  881. <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"/>
  882. <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"/>
  883. <!-- 端点光晕 -->
  884. <circle cx="160" cy="24" r="6" fill="#1e90ff" opacity="0.9"/>
  885. <!-- 中心数字 -->
  886. <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>
  887. <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>
  888. </svg>
  889. <!-- 标签 -->
  890. <div style="text-align:center">
  891. <div style="font-size:30px;font-weight:700;color:var(--cyan);letter-spacing:4px">实验室总数</div>
  892. <div style="font-size:22px;color:var(--text-dim);margin-top:6px;letter-spacing:2px">TOTAL LABORATORIES</div>
  893. </div>
  894. <!-- 分级色条 -->
  895. <div style="width:100%;padding:0 10px">
  896. <div style="display:flex;gap:5px;height:12px;border-radius:6px;overflow:hidden">
  897. <div style="flex:12;background:#cc0000;box-shadow:0 0 10px rgba(204,0,0,0.5)"></div>
  898. <div style="flex:28;background:#ff8000;box-shadow:0 0 10px rgba(255,128,0,0.4)"></div>
  899. <div style="flex:45;background:#ffcc00;box-shadow:0 0 10px rgba(255,204,0,0.4)"></div>
  900. <div style="flex:43;background:#0066cc;box-shadow:0 0 10px rgba(0,102,204,0.4)"></div>
  901. </div>
  902. <div style="display:flex;gap:5px;margin-top:8px;font-size:22px;color:var(--text-dim);text-align:center">
  903. <span style="flex:12">Ⅰ</span><span style="flex:28">Ⅱ</span><span style="flex:45">Ⅲ</span><span style="flex:43">Ⅳ</span>
  904. </div>
  905. </div>
  906. </div>
  907. <!-- 右侧 6:分级统计(环形图 + 明细列表) -->
  908. <div style="flex:6;display:flex;flex-direction:column;justify-content:center;padding:25px 25px 20px;gap:0">
  909. <!-- 环形图 -->
  910. <div style="flex:0 0 340px;width:100%" id="chart-donut"></div>
  911. <!-- 分级明细 -->
  912. <div style="display:flex;flex-direction:column;gap:10px;margin-top:10px">
  913. <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">
  914. <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>
  915. <span style="color:#ff6666;font-weight:700;font-size:28px">12间</span>
  916. </div>
  917. <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">
  918. <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>
  919. <span style="color:#ffaa44;font-weight:700;font-size:28px">28间</span>
  920. </div>
  921. <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">
  922. <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>
  923. <span style="color:#ffe066;font-weight:700;font-size:28px">45间</span>
  924. </div>
  925. <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">
  926. <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>
  927. <span style="color:#4499ff;font-weight:700;font-size:28px">43间</span>
  928. </div>
  929. </div>
  930. </div>
  931. </div>
  932. <!-- 下部 20%:三种状态统计 -->
  933. <div style="flex:1;display:flex;align-items:center;padding:0 25px 20px;border-top:1px solid var(--border);gap:15px;min-height:170px">
  934. <div class="status-row" style="width:100%;margin:0">
  935. <div class="status-badge active"><div class="val">20</div><div class="lbl">使用(间)</div></div>
  936. <div class="status-badge warning"><div class="val">3</div><div class="lbl">异常(间)</div></div>
  937. <div class="status-badge idle"><div class="val">105</div><div class="lbl">空闲(间)</div></div>
  938. </div>
  939. </div>
  940. </div>
  941. <!-- 实验室安全分级统计 -->
  942. <div class="panel" style="flex:1;min-height:450px;display:flex;flex-direction:column">
  943. <div class="border-beam"></div>
  944. <div class="panel-header">
  945. <div class="panel-header-icon">📊</div>
  946. <span class="panel-title">实验室安全分级统计</span>
  947. </div>
  948. <div style="flex:1;min-height:0;padding:15px 20px">
  949. <div id="chart-stack" style="height:100%;width:100%"></div>
  950. </div>
  951. </div>
  952. <!-- 实验室进入人数统计及走势 -->
  953. <div class="panel" style="flex:0 0 auto">
  954. <div class="border-beam"></div>
  955. <div class="panel-header">
  956. <div class="panel-header-icon">👥</div>
  957. <span class="panel-title">实验室进入人数统计及走势</span>
  958. </div>
  959. <div style="padding:20px 25px">
  960. <div class="flip-counters">
  961. <div class="flip-counter"><div class="fc-label">今日进入总人数</div><div class="fc-digits" id="flip-total"></div></div>
  962. <div class="flip-counter"><div class="fc-label">当前在场实验人数</div><div class="fc-digits" id="flip-current"></div></div>
  963. </div>
  964. <div style="height:275px;margin-top:12px" id="chart-line"></div>
  965. </div>
  966. </div>
  967. </div><!-- /1区 -->
  968. <!-- ======== 2区 ======== -->
  969. <div class="panel-col">
  970. <!-- 智能环境感知应用设备统计 -->
  971. <div class="panel" style="flex:0 0 auto">
  972. <div class="border-beam"></div>
  973. <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>
  974. <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>
  975. <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>
  976. <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>
  977. <div class="panel-header">
  978. <div class="panel-header-icon">📡</div>
  979. <span class="panel-title">智能环境感知应用设备统计</span>
  980. </div>
  981. <div style="padding:20px 25px">
  982. <div class="device-online-row">
  983. <div class="device-stat-chip online"><div class="dv">312</div><div class="dl">在线设备</div></div>
  984. <div class="device-stat-chip offline"><div class="dv">18</div><div class="dl">离线设备</div></div>
  985. </div>
  986. <div style="display:flex;gap:20px;align-items:center">
  987. <div id="chart-gauge" style="flex:0 0 295px;height:295px"></div>
  988. <div style="flex:1;display:flex;flex-direction:column;gap:12px">
  989. <div style="display:flex;gap:12px">
  990. <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>
  991. <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>
  992. <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>
  993. </div>
  994. <div style="display:flex;gap:12px;justify-content:center">
  995. <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>
  996. <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>
  997. </div>
  998. </div>
  999. </div>
  1000. </div>
  1001. </div>
  1002. <!-- 实验室设备分类及使用统计 (4:6) -->
  1003. <div class="panel" style="flex:1;min-height:650px;display:flex;flex-direction:column">
  1004. <div class="border-beam"></div>
  1005. <div class="panel-header">
  1006. <div class="panel-header-icon">🔬</div>
  1007. <span class="panel-title">实验室设备分类及使用统计</span>
  1008. </div>
  1009. <!-- 4:6 layout -->
  1010. <div style="flex:1;display:flex;flex-direction:column;padding:15px 25px;gap:12px;min-height:0">
  1011. <!-- 上: 占4 环形图 - 设备分类(含图例:名称/数量/占比) -->
  1012. <div style="flex:4;min-height:0">
  1013. <div id="chart-ring" style="height:100%;width:100%"></div>
  1014. </div>
  1015. <!-- 下: 占6 统计 + 双饼图 -->
  1016. <div style="flex:6;min-height:0;display:flex;flex-direction:column;gap:10px">
  1017. <!-- 上方 3网格统计 -->
  1018. <div class="equip-mid-row" style="flex:0 0 auto">
  1019. <div class="equip-stat-item"><div class="ev">2,458</div><div class="el">设备总数(台)</div></div>
  1020. <div class="equip-stat-item"><div class="ev">18,620</div><div class="el">使用时长(h)</div></div>
  1021. <div class="equip-stat-item"><div class="ev">62.4%</div><div class="el">设备使用率</div></div>
  1022. </div>
  1023. <!-- 下方 左右双饼图 -->
  1024. <div style="flex:1;min-height:0;display:flex;gap:12px">
  1025. <div style="flex:1;min-height:0;display:flex;flex-direction:column;gap:6px">
  1026. <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>
  1027. <div id="chart-pie-status" style="flex:1;min-height:0"></div>
  1028. </div>
  1029. <div style="flex:1;min-height:0;display:flex;flex-direction:column;gap:6px">
  1030. <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>
  1031. <div id="chart-pie-usage" style="flex:1;min-height:0"></div>
  1032. </div>
  1033. </div>
  1034. </div>
  1035. </div>
  1036. </div>
  1037. <!-- 危化品库存统计 -->
  1038. <div class="panel" style="flex:0 0 auto;min-height:460px">
  1039. <div class="border-beam"></div>
  1040. <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>
  1041. <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>
  1042. <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>
  1043. <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>
  1044. <div class="panel-header">
  1045. <div class="panel-header-icon">⚗️</div>
  1046. <span class="panel-title">化学品库存动态统计</span>
  1047. </div>
  1048. <div style="padding:12px 20px 15px;display:flex;gap:15px;height:calc(100% - 82px)">
  1049. <!-- 左侧: 饼图 -->
  1050. <div style="flex:1;min-width:0;display:flex;flex-direction:column">
  1051. <div id="chart-chem-inventory" style="flex:1;min-height:0"></div>
  1052. </div>
  1053. <!-- 右侧: 存量统计 -->
  1054. <div style="flex:0 0 380px;display:flex;flex-direction:column;gap:14px;justify-content:center">
  1055. <!-- 总量 -->
  1056. <div class="chem-stat-card total">
  1057. <div class="csc-label">存量化学品总量</div>
  1058. <div class="csc-value">1,229<span class="csc-unit">L</span></div>
  1059. </div>
  1060. <!-- 管控 -->
  1061. <div class="chem-stat-card ctrl">
  1062. <div style="display:flex;justify-content:space-between;align-items:flex-start">
  1063. <div>
  1064. <div class="csc-label">管控类化学品</div>
  1065. <div class="csc-value">269<span class="csc-unit">L</span></div>
  1066. </div>
  1067. <div class="csc-pct-ring" style="--pct:21.9;--clr:#ef4444">
  1068. <svg viewBox="0 0 60 60" width="80" height="80">
  1069. <circle cx="30" cy="30" r="24" fill="none" stroke="rgba(239,68,68,0.12)" stroke-width="6"/>
  1070. <circle cx="30" cy="30" r="24" fill="none" stroke="#ef4444" stroke-width="6"
  1071. stroke-dasharray="27.5 123" stroke-linecap="round" transform="rotate(-90 30 30)"
  1072. style="filter:drop-shadow(0 0 4px rgba(239,68,68,0.7))"/>
  1073. <text x="30" y="35" text-anchor="middle" fill="#ef4444" font-size="11" font-weight="700" font-family="Arial">21.9%</text>
  1074. </svg>
  1075. </div>
  1076. </div>
  1077. <div class="csc-sub">占总量 21.9% · 共 5 类目</div>
  1078. </div>
  1079. <!-- 非管控 -->
  1080. <div class="chem-stat-card free">
  1081. <div style="display:flex;justify-content:space-between;align-items:flex-start">
  1082. <div>
  1083. <div class="csc-label">非管控类化学品</div>
  1084. <div class="csc-value" style="color:#00d8ff">960<span class="csc-unit">L</span></div>
  1085. </div>
  1086. <div>
  1087. <svg viewBox="0 0 60 60" width="80" height="80">
  1088. <circle cx="30" cy="30" r="24" fill="none" stroke="rgba(0,216,255,0.12)" stroke-width="6"/>
  1089. <circle cx="30" cy="30" r="24" fill="none" stroke="#00d8ff" stroke-width="6"
  1090. stroke-dasharray="101 50.6" stroke-linecap="round" transform="rotate(-90 30 30)"
  1091. style="filter:drop-shadow(0 0 4px rgba(0,216,255,0.7))"/>
  1092. <text x="30" y="35" text-anchor="middle" fill="#00d8ff" font-size="11" font-weight="700" font-family="Arial">78.1%</text>
  1093. </svg>
  1094. </div>
  1095. </div>
  1096. <div class="csc-sub" style="color:rgba(0,216,255,0.55)">占总量 78.1% · 共 5 类目</div>
  1097. </div>
  1098. <!-- 类目总数 -->
  1099. <div class="chem-stat-card cat">
  1100. <div class="csc-label">存量化学品总类目数</div>
  1101. <div style="display:flex;align-items:baseline;gap:12px;margin-top:8px">
  1102. <div class="csc-value" style="color:#ffd740">10<span class="csc-unit">类</span></div>
  1103. <div style="display:flex;gap:6px;align-items:center">
  1104. <span style="font-size:22px;color:rgba(239,68,68,0.8)">管控 5类</span>
  1105. <span style="font-size:20px;color:rgba(168,204,232,0.3)">|</span>
  1106. <span style="font-size:22px;color:rgba(0,216,255,0.8)">非管控 5类</span>
  1107. </div>
  1108. </div>
  1109. </div>
  1110. </div>
  1111. </div>
  1112. </div>
  1113. </div><!-- /2区 -->
  1114. <!-- ======== 3区: 实时监控 ======== -->
  1115. <div class="center-col">
  1116. <!-- 实时监控(常显) -->
  1117. <div id="view-monitor">
  1118. <div class="monitor-header">
  1119. <span style="font-size:32px;font-weight:600;color:var(--cyan);letter-spacing:2px">📹 实时监控</span>
  1120. <span style="font-size:28px;color:var(--text-dim);margin-left:10px">CCTV Live Feed</span>
  1121. <div style="margin-left:auto;display:flex;align-items:center;gap:15px">
  1122. <div class="status-dot green"></div>
  1123. <span style="font-size:28px;color:var(--text-dim)">信号正常</span>
  1124. </div>
  1125. </div>
  1126. <div class="monitor-inner">
  1127. <div class="monitor-left">
  1128. <div class="search-box"><span style="font-size:32px;color:var(--text-dim)">🔍</span><input type="text" placeholder="搜索楼栋 / 楼层 / 房间…"></div>
  1129. <select class="filter-select">
  1130. <option value="">全部二级单位</option>
  1131. <option>化学研究所</option><option>物理研究所</option>
  1132. <option>生物研究所</option><option>材料研究所</option><option>工程研究所</option>
  1133. </select>
  1134. <div class="tree-wrap" id="building-tree"></div>
  1135. </div>
  1136. <div class="monitor-right">
  1137. <div class="camera-grid-header">
  1138. <div class="camera-breadcrumb"><span>安科院主园区</span> › <span>综合实验楼A</span> › <span>3层</span></div>
  1139. <div class="camera-pager">
  1140. <button class="pager-btn">‹</button>
  1141. <span class="pager-info">1 / 3 页</span>
  1142. <button class="pager-btn">›</button>
  1143. </div>
  1144. </div>
  1145. <div class="camera-grid" id="camera-grid"></div>
  1146. </div>
  1147. </div>
  1148. </div>
  1149. </div><!-- /3区 -->
  1150. <!-- ======== 4区 ======== -->
  1151. <div class="panel-col">
  1152. <!-- 实验环境安全智能感知 -->
  1153. <div class="panel" style="flex:7;min-height:0;display:flex;flex-direction:column">
  1154. <div class="border-beam"></div>
  1155. <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>
  1156. <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>
  1157. <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>
  1158. <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>
  1159. <div class="panel-header">
  1160. <div class="panel-header-icon">🌡️</div>
  1161. <span class="panel-title">实验环境安全智能感知</span>
  1162. <div class="status-dot red" style="margin-left:auto"></div>
  1163. </div>
  1164. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  1165. <div class="sensor-scroll-wrap">
  1166. <div class="sensor-scroll-inner" id="sensor-list"></div>
  1167. </div>
  1168. </div>
  1169. </div>
  1170. <!-- 实验室实时风险预警 -->
  1171. <div class="panel" style="flex:3;min-height:0;display:flex;flex-direction:column">
  1172. <div class="border-beam"></div>
  1173. <div class="panel-header">
  1174. <div class="panel-header-icon">⚠️</div>
  1175. <span class="panel-title">实验室实时风险预警</span>
  1176. <div style="margin-left:auto;display:flex;align-items:center;gap:18px;flex-shrink:0">
  1177. <div style="display:flex;align-items:center;gap:6px">
  1178. <span style="font-size:22px">🚨</span>
  1179. <span style="font-size:24px;color:var(--text-dim)">应急</span>
  1180. <span style="font-size:44px;font-weight:700;color:#f59e0b">28</span>
  1181. <span style="font-size:22px;color:var(--text-dim)">次</span>
  1182. </div>
  1183. <div style="width:1px;height:40px;background:rgba(30,144,255,0.3)"></div>
  1184. <div style="display:flex;align-items:center;gap:6px">
  1185. <span style="font-size:22px">☣️</span>
  1186. <span style="font-size:24px;color:var(--text-dim)">违规带离</span>
  1187. <span style="font-size:44px;font-weight:700;color:var(--cyan)">14</span>
  1188. <span style="font-size:22px;color:var(--text-dim)">次</span>
  1189. </div>
  1190. </div>
  1191. </div>
  1192. <div style="flex:1;min-height:0;padding:15px 20px;display:flex;flex-direction:column">
  1193. <div class="warn-scroll-wrap">
  1194. <div class="warn-scroll-inner" id="warn-list"></div>
  1195. </div>
  1196. </div>
  1197. </div>
  1198. </div><!-- /4区 -->
  1199. </div><!-- /main-content -->
  1200. </div><!-- /scale-root -->
  1201. <script>
  1202. // ====================================================
  1203. // SCALE
  1204. // ====================================================
  1205. // ====================================================
  1206. // INIT MONITOR ON LOAD
  1207. // ====================================================
  1208. document.addEventListener('DOMContentLoaded', () => {
  1209. if (document.documentElement.requestFullscreen)
  1210. document.documentElement.requestFullscreen().catch(() => {});
  1211. buildTree();
  1212. buildCameras();
  1213. });
  1214. const WD = ['日','一','二','三','四','五','六'];
  1215. function tick() {
  1216. const n = new Date();
  1217. const t = `${String(n.getHours()).padStart(2,'0')}:${String(n.getMinutes()).padStart(2,'0')}:${String(n.getSeconds()).padStart(2,'0')}`;
  1218. const d = `${n.getFullYear()}年${n.getMonth()+1}月${n.getDate()}日 星期${WD[n.getDay()]}`;
  1219. document.getElementById('clock-time').textContent = t;
  1220. document.getElementById('clock-date').textContent = d;
  1221. }
  1222. setInterval(tick, 1000); tick();
  1223. // ====================================================
  1224. // NEBULA BACKGROUND
  1225. // ====================================================
  1226. (function () {
  1227. const c = document.getElementById('nebula-canvas');
  1228. const ctx = c.getContext('2d');
  1229. let W, H, stars = [], t = 0;
  1230. function resize() { W = c.width = window.innerWidth; H = c.height = window.innerHeight; }
  1231. window.addEventListener('resize', resize); resize();
  1232. for (let i = 0; i < 500; i++)
  1233. 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 });
  1234. function draw() {
  1235. t++;
  1236. ctx.clearRect(0, 0, W, H);
  1237. const g1 = ctx.createRadialGradient(W*0.22, H*0.35, 40, W*0.22, H*0.35, 420);
  1238. g1.addColorStop(0, 'rgba(0,60,180,0.09)'); g1.addColorStop(1, 'transparent');
  1239. ctx.fillStyle = g1; ctx.fillRect(0,0,W,H);
  1240. const g2 = ctx.createRadialGradient(W*0.78, H*0.65, 30, W*0.78, H*0.65, 360);
  1241. g2.addColorStop(0, 'rgba(0,100,220,0.08)'); g2.addColorStop(1, 'transparent');
  1242. ctx.fillStyle = g2; ctx.fillRect(0,0,W,H);
  1243. stars.forEach(s => {
  1244. s.a += s.va; if (s.a > 1 || s.a < 0.1) s.va *= -1;
  1245. const hue = 200 + Math.sin(t * 0.01 + s.x) * 30;
  1246. ctx.beginPath(); ctx.arc(s.x*(W/9600), s.y*(H/2800), s.r, 0, Math.PI*2);
  1247. ctx.fillStyle = `hsla(${hue},80%,80%,${s.a})`; ctx.fill();
  1248. });
  1249. requestAnimationFrame(draw);
  1250. }
  1251. draw();
  1252. })();
  1253. // ====================================================
  1254. // FLIP COUNTER
  1255. // ====================================================
  1256. function renderFlip(id, val) {
  1257. const el = document.getElementById(id); if (!el) return;
  1258. el.innerHTML = String(val).padStart(4,'0').split('').map(d => `<div class="flip-digit">${d}</div>`).join('');
  1259. }
  1260. function animFlip(id, from, to, dur) {
  1261. const s = Date.now();
  1262. (function tick() {
  1263. const p = Math.min((Date.now()-s)/dur, 1);
  1264. renderFlip(id, Math.round(from + (to-from)*p));
  1265. if (p < 1) requestAnimationFrame(tick);
  1266. })();
  1267. }
  1268. renderFlip('flip-total', 1284); renderFlip('flip-current', 47);
  1269. setTimeout(() => animFlip('flip-total', 0, 1284, 2000), 600);
  1270. setTimeout(() => animFlip('flip-current', 0, 47, 1500), 900);
  1271. // ====================================================
  1272. // CHEMICAL INVENTORY (2区 化学品库存动态统计)
  1273. // ====================================================
  1274. const CHEM_PIE_DATA = [
  1275. {name:'管控化学品', value:269, itemStyle:{color:'#ef4444'}},
  1276. {name:'非管控化学品', value:960, itemStyle:{color:'#1e90ff'}},
  1277. ];
  1278. let chemChart = null;
  1279. function renderChemChart() {
  1280. if (!chemChart) {
  1281. const el = document.getElementById('chart-chem-inventory');
  1282. if (!el) return;
  1283. chemChart = echarts.init(el);
  1284. }
  1285. chemChart.setOption({
  1286. backgroundColor:'transparent',
  1287. tooltip:{ trigger:'item', formatter:'{b}<br/>数量:{c} L<br/>占比:{d}%' },
  1288. series:[{
  1289. type:'pie', radius:['32%','62%'],
  1290. center:['50%','52%'],
  1291. avoidLabelOverlap:true,
  1292. label:{
  1293. show:true, position:'outside',
  1294. formatter:params => `{name|${params.name}}\n{val|${params.value}L ${params.percent}%}`,
  1295. rich:{
  1296. name:{ fontSize:24, color:'#a8cce8', lineHeight:30 },
  1297. val:{ fontSize:22, color:'#ffd740', lineHeight:26 },
  1298. },
  1299. distanceToLabelLine:10,
  1300. },
  1301. labelLine:{ show:true, length:25, length2:35, lineStyle:{color:'rgba(168,204,232,0.5)'} },
  1302. emphasis:{ label:{fontSize:26, fontWeight:'bold'}, scale:true, scaleSize:8 },
  1303. data: CHEM_PIE_DATA,
  1304. }],
  1305. }, true);
  1306. }
  1307. renderChemChart();
  1308. // ====================================================
  1309. // SENSOR LIST (4区上)
  1310. // ====================================================
  1311. const LABS = [
  1312. {name:'化学分析实验室', room:'A301', unit:'化学研究所', t:22.5, h:58, tvoc:0.82, co2:650, o2:20.9, alert:true},
  1313. {name:'生物安全实验室', room:'B201', unit:'生物研究所', t:20.1, h:62, tvoc:0.18, co2:580, o2:20.8, alert:false},
  1314. {name:'材料测试实验室', room:'C401', unit:'材料研究所', t:24.0, h:45, tvoc:0.09, co2:520, o2:20.9, alert:false},
  1315. {name:'精密仪器实验室', room:'A205', unit:'物理研究所', t:21.5, h:50, tvoc:0.14, co2:490, o2:20.9, alert:false},
  1316. {name:'有机合成实验室', room:'B302', unit:'化学研究所', t:23.8, h:55, tvoc:2.10, co2:725, o2:20.5, alert:true},
  1317. {name:'光学检测实验室', room:'C203', unit:'物理研究所', t:22.0, h:52, tvoc:0.11, co2:510, o2:20.9, alert:false},
  1318. {name:'高压实验室', room:'D101', unit:'工程研究所', t:25.5, h:48, tvoc:0.30, co2:600, o2:20.7, alert:false},
  1319. {name:'低温实验室', room:'D205', unit:'物理研究所', t:18.0, h:40, tvoc:0.07, co2:480, o2:20.9, alert:false},
  1320. {name:'核磁共振室', room:'A302', unit:'化学研究所', t:20.5, h:54, tvoc:0.05, co2:505, o2:20.9, alert:false},
  1321. {name:'质谱分析室', room:'A303', unit:'化学研究所', t:21.0, h:53, tvoc:0.19, co2:530, o2:20.8, alert:false},
  1322. ];
  1323. function buildSensorList() {
  1324. const el = document.getElementById('sensor-list'); if (!el) return;
  1325. const all = [...LABS, ...LABS];
  1326. el.innerHTML = all.map(lab => `
  1327. <div class="sensor-item ${lab.alert ? 'alert' : ''}">
  1328. <div class="sensor-item-head">
  1329. <span class="sensor-name">${lab.name}(${lab.room})</span>
  1330. <span class="sensor-unit">${lab.unit}</span>
  1331. ${lab.alert
  1332. ? '<span style="color:var(--red);font-size:25px;animation:blinkRed 0.8s infinite">🚨 告警</span>'
  1333. : '<span style="color:var(--green);font-size:25px">● 正常</span>'}
  1334. </div>
  1335. <div class="sensor-metrics">
  1336. <div class="sensor-metric">🌡️ ${lab.t}°C</div>
  1337. <div class="sensor-metric">💧 ${lab.h}%</div>
  1338. <div class="sensor-metric ${lab.tvoc > 0.6 ? 'alarm' : ''}">🧪 TVOC ${lab.tvoc}</div>
  1339. <div class="sensor-metric ${lab.co2 > 700 ? 'alarm' : ''}">💨 CO₂ ${lab.co2}</div>
  1340. <div class="sensor-metric">🫧 O₂ ${lab.o2}%</div>
  1341. </div>
  1342. </div>`).join('');
  1343. }
  1344. buildSensorList();
  1345. // ====================================================
  1346. // WARNING LIST (4区下) — 应急预警 + 危化品违规带离
  1347. // ====================================================
  1348. const WARNS = [
  1349. {type:'emergency', lab:'化学分析实验室', room:'A301', unit:'化学研究所', metric:'TVOC浓度超标', val:'2.85 mg/m³', time:'2026-03-23 14:32:18'},
  1350. {type:'chemical', lab:'有机合成实验室', room:'B302', unit:'化学研究所', person:'李研究员', action:'盐酸未正常使用违规带离', time:'2026-03-23 13:58:44'},
  1351. {type:'emergency', lab:'有机合成实验室', room:'B302', unit:'化学研究所', metric:'CO₂浓度偏高', val:'725 ppm', time:'2026-03-23 12:15:07'},
  1352. {type:'chemical', lab:'生物安全实验室', room:'B201', unit:'生物研究所', person:'王实验员', action:'甲醇溶液违规带出实验室', time:'2026-03-22 17:40:22'},
  1353. {type:'emergency', lab:'高压实验室', room:'D101', unit:'工程研究所', metric:'温度异常', val:'38.5 °C', time:'2026-03-22 12:15:07'},
  1354. {type:'emergency', lab:'生物安全实验室', room:'B201', unit:'生物研究所', metric:'湿度超标', val:'88% RH', time:'2026-03-21 11:40:22'},
  1355. {type:'chemical', lab:'材料测试实验室', room:'C401', unit:'材料研究所', person:'张工程师', action:'硫酸未经审批带离', time:'2026-03-21 10:08:55'},
  1356. {type:'emergency', lab:'光学检测实验室', room:'C203', unit:'物理研究所', metric:'O₂浓度偏低', val:'19.2 %', time:'2026-03-20 09:22:33'},
  1357. {type:'chemical', lab:'精密仪器实验室', room:'A205', unit:'物理研究所', person:'赵研究员', action:'丙酮溶液违规带离实验楼', time:'2026-03-19 16:45:11'},
  1358. {type:'emergency', lab:'低温实验室', room:'D205', unit:'物理研究所', metric:'气压异常', val:'85 kPa', time:'2026-03-18 23:12:40'},
  1359. ];
  1360. function buildWarnList() {
  1361. const el = document.getElementById('warn-list'); if (!el) return;
  1362. const all = [...WARNS, ...WARNS];
  1363. el.innerHTML = all.map(w => {
  1364. const isEm = w.type === 'emergency';
  1365. const labCls = isEm ? 'warn-lab-info' : 'warn-lab-info chemical';
  1366. const badge = isEm
  1367. ? '<span class="warn-type-badge emergency">🚨 应急预警</span>'
  1368. : '<span class="warn-type-badge chemical">☣️ 违规带离</span>';
  1369. const detail = isEm
  1370. ? `异常传感器:<span class="warn-metric-val">${w.metric} ${w.val}</span>`
  1371. : `<span style="color:#67e8f9">${w.person}</span> — <span style="color:#fbbf24">${w.action}</span>`;
  1372. return `
  1373. <div class="warn-item type-${w.type}">
  1374. <div class="warn-item-head" style="flex-wrap:wrap;gap:8px 15px">
  1375. <div style="display:flex;align-items:center;flex:1;min-width:0;gap:8px">
  1376. ${badge}
  1377. <span class="${labCls}">${w.lab}(${w.room})- ${w.unit}</span>
  1378. </div>
  1379. <span class="warn-time">${w.time}</span>
  1380. </div>
  1381. <div class="warn-detail">${detail}</div>
  1382. </div>`;
  1383. }).join('');
  1384. }
  1385. buildWarnList();
  1386. // ====================================================
  1387. // ALERT MODAL + CAMERA
  1388. // ====================================================
  1389. function closeAlert() { document.getElementById('alert-modal').classList.remove('show'); }
  1390. function openEvac() { document.getElementById('evac-modal').classList.add('show'); }
  1391. function closeEvac() { document.getElementById('evac-modal').classList.remove('show'); }
  1392. let alertCamRAF = null;
  1393. function startAlertCam() {
  1394. const canvas = document.getElementById('alert-cam-canvas');
  1395. if (!canvas || canvas._alertRunning) return;
  1396. canvas._alertRunning = true;
  1397. const ctx = canvas.getContext('2d');
  1398. const W = 900, H = 700;
  1399. let t = Math.random() * 1000;
  1400. const noise = Array.from({length:300}, () => ({x:Math.random(), y:Math.random(), s:Math.random()*2.5+0.5, a:Math.random()*0.25}));
  1401. function frame() {
  1402. t += 0.4;
  1403. ctx.clearRect(0, 0, W, H);
  1404. // Background gradient (dark green-tinted night-vision feel with red emergency tint)
  1405. const bg = ctx.createLinearGradient(0, 0, 0, H);
  1406. bg.addColorStop(0, 'hsl(210,45%,5%)');
  1407. bg.addColorStop(1, 'hsl(0,30%,4%)');
  1408. ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
  1409. // Perspective floor grid
  1410. ctx.strokeStyle = 'rgba(20,65,140,0.07)'; ctx.lineWidth = 0.5;
  1411. const vp = {x: W/2, y: H*0.44};
  1412. 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(); }
  1413. 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(); }
  1414. // Lab furniture silhouettes
  1415. ctx.fillStyle = 'rgba(0,30,80,0.45)';
  1416. ctx.fillRect(W*0.05, H*0.52, W*0.38, H*0.12); // bench left
  1417. ctx.fillRect(W*0.57, H*0.52, W*0.38, H*0.12); // bench right
  1418. ctx.fillStyle = 'rgba(0,18,50,0.55)';
  1419. ctx.fillRect(W*0.08, H*0.35, W*0.09, H*0.17); // cabinet
  1420. ctx.fillRect(W*0.60, H*0.33, W*0.12, H*0.19); // equipment
  1421. // Person silhouette (lab worker)
  1422. const px = W*(0.4 + Math.sin(t*0.008)*0.03);
  1423. const py = H*(0.58 + Math.cos(t*0.006)*0.015);
  1424. ctx.fillStyle = 'rgba(110,160,240,0.6)';
  1425. ctx.beginPath(); ctx.arc(px, py - H*0.1, W*0.028, 0, Math.PI*2); ctx.fill(); // head
  1426. ctx.fillRect(px - W*0.022, py - H*0.08, W*0.044, H*0.1); // body
  1427. // Red emergency scan line
  1428. const scanY = (t * 0.8) % H;
  1429. const scanG = ctx.createLinearGradient(0, scanY-8, 0, scanY+8);
  1430. scanG.addColorStop(0, 'transparent');
  1431. scanG.addColorStop(0.5, 'rgba(239,68,68,0.18)');
  1432. scanG.addColorStop(1, 'transparent');
  1433. ctx.fillStyle = scanG; ctx.fillRect(0, scanY-8, W, 16);
  1434. // Noise
  1435. noise.forEach(n => {
  1436. ctx.fillStyle = `rgba(200,210,240,${n.a*0.45})`;
  1437. ctx.fillRect(n.x*W, n.y*H, n.s, n.s);
  1438. if (Math.random() < 0.015) { n.x = Math.random(); n.y = Math.random(); }
  1439. });
  1440. // Red vignette pulse (emergency)
  1441. const vig = ctx.createRadialGradient(W/2, H/2, H*0.25, W/2, H/2, H*0.85);
  1442. const vigAlpha = 0.12 + Math.sin(t*0.08)*0.06;
  1443. vig.addColorStop(0, 'transparent');
  1444. vig.addColorStop(1, `rgba(200,0,0,${vigAlpha})`);
  1445. ctx.fillStyle = vig; ctx.fillRect(0, 0, W, H);
  1446. alertCamRAF = requestAnimationFrame(frame);
  1447. }
  1448. frame();
  1449. }
  1450. setTimeout(() => {
  1451. document.getElementById('alert-modal').classList.add('show');
  1452. startAlertCam();
  1453. }, 5000);
  1454. // ====================================================
  1455. // ECHARTS
  1456. // ====================================================
  1457. function initCharts() {
  1458. const TOOLTIP_CFG = {
  1459. backgroundColor:'rgba(3,14,42,0.92)',
  1460. borderColor:'rgba(30,144,255,0.3)',
  1461. textStyle:{ color:'#a8cce8', fontSize:28 }
  1462. };
  1463. // --- 环形图: 实验室总数分级 ---
  1464. const dEl = document.getElementById('chart-donut');
  1465. if (dEl) {
  1466. const c = echarts.init(dEl, null, {renderer:'canvas', devicePixelRatio:2});
  1467. c.setOption({
  1468. backgroundColor:'transparent',
  1469. tooltip:{ trigger:'item', formatter:'{b}: {c}间 ({d}%)', ...TOOLTIP_CFG },
  1470. graphic:[{
  1471. type:'text', left:'center', top:'40%',
  1472. style:{ text:'128', fill:'#ffd740', font:'bold 80px Arial', textAlign:'center' }
  1473. },{
  1474. type:'text', left:'center', top:'58%',
  1475. style:{ text:'实验室总数(间)', fill:'rgba(168,204,232,0.65)', font:'22px Arial', textAlign:'center' }
  1476. }],
  1477. series:[{
  1478. type:'pie', radius:['42%','68%'], center:['50%','50%'], startAngle:100,
  1479. itemStyle:{ borderRadius:6, borderColor:'rgba(3,14,31,0.6)', borderWidth:3 },
  1480. label:{
  1481. show:true,
  1482. formatter: params => `{lvl|${params.name}}\n{cnt|${params.value}间}\n{pct|${params.percent}%}`,
  1483. rich:{
  1484. lvl:{ fontSize:24, fontWeight:700, color:'#ddf0ff', lineHeight:36 },
  1485. cnt:{ fontSize:30, fontWeight:900, color:'#ffd740', lineHeight:42 },
  1486. pct:{ fontSize:22, color:'rgba(168,204,232,0.6)', lineHeight:32 }
  1487. },
  1488. distanceToLabelLine:8
  1489. },
  1490. labelLine:{
  1491. show:true, length:20, length2:25,
  1492. lineStyle:{ color:'rgba(30,144,255,0.45)', width:2 }
  1493. },
  1494. data:[
  1495. {value:12, name:'I级', itemStyle:{color:'#cc0000', shadowBlur:12, shadowColor:'rgba(204,0,0,0.5)'}},
  1496. {value:28, name:'II级', itemStyle:{color:'#ff8000', shadowBlur:12, shadowColor:'rgba(255,128,0,0.5)'}},
  1497. {value:45, name:'III级', itemStyle:{color:'#ffcc00', shadowBlur:12, shadowColor:'rgba(255,204,0,0.5)'}},
  1498. {value:43, name:'IV级', itemStyle:{color:'#0066cc', shadowBlur:12, shadowColor:'rgba(0,102,204,0.5)'}}
  1499. ],
  1500. emphasis:{
  1501. scale:true, scaleSize:8,
  1502. itemStyle:{ shadowBlur:30, shadowColor:'rgba(30,144,255,0.6)' },
  1503. label:{ fontSize:28 }
  1504. }
  1505. }]
  1506. });
  1507. }
  1508. // --- 堆叠柱状图: 安全分级统计 ---
  1509. const stEl = document.getElementById('chart-stack');
  1510. if (stEl) {
  1511. const c = echarts.init(stEl, null, {renderer:'canvas', devicePixelRatio:2});
  1512. const cols = ['#cc0000','#ff8000','#ffcc00','#0066cc'];
  1513. const lvls = ['I级','II级','III级','IV级'];
  1514. const units = ['化学所','生物所','材料所','物理所','工程所','核能所','信息所','环境所','计量所','医学所'];
  1515. const totals = [28,22,18,24,16,12,20,15,10,14];
  1516. const dat = [
  1517. [2,3,5,4,2,1,3,2,1,2],
  1518. [5,6,4,7,4,3,5,4,3,4],
  1519. [9,8,6,8,5,5,7,5,4,5],
  1520. [12,5,3,5,5,3,5,4,2,3]
  1521. ];
  1522. const xL = units.map((u,i) => `${u}\n(${totals[i]})`);
  1523. c.setOption({
  1524. backgroundColor:'transparent',
  1525. tooltip:{ trigger:'axis', axisPointer:{type:'shadow'}, ...TOOLTIP_CFG },
  1526. legend:{ data:lvls, top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'rect', itemWidth:25, itemHeight:15 },
  1527. grid:{ left:30, right:8, top:55, bottom:110, containLabel:true },
  1528. 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} },
  1529. 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)'}} },
  1530. dataZoom:[{ type:'inside', startValue:0, endValue:5 }],
  1531. series:lvls.map((n,i) => ({
  1532. name:n, type:'bar', stack:'total', barMaxWidth:55,
  1533. data:dat[i].map(v => ({value:v, itemStyle:{color:cols[i], opacity:0.88}})),
  1534. emphasis:{ itemStyle:{opacity:1} }
  1535. }))
  1536. });
  1537. let idx = 0;
  1538. setInterval(() => {
  1539. idx++;
  1540. c.dispatchAction({ type:'dataZoom', startValue:idx, endValue:idx+5 });
  1541. if (idx >= units.length-5) idx = -1;
  1542. }, 5000);
  1543. }
  1544. // --- 折线图: 进入人数走势 ---
  1545. const lnEl = document.getElementById('chart-line');
  1546. if (lnEl) {
  1547. const c = echarts.init(lnEl, null, {renderer:'canvas', devicePixelRatio:2});
  1548. c.setOption({
  1549. backgroundColor:'transparent',
  1550. tooltip:{ trigger:'axis', ...TOOLTIP_CFG },
  1551. legend:{ data:['进入人数','在场人数'], top:0, right:0, textStyle:{color:'#a8cce8',fontSize:25}, icon:'circle', itemWidth:20, itemHeight:20 },
  1552. grid:{ left:28, right:8, top:45, bottom:50, containLabel:true },
  1553. 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} },
  1554. yAxis:{ type:'value', axisLabel:{color:'#5890b8',fontSize:22}, axisLine:{show:false}, splitLine:{lineStyle:{color:'rgba(30,144,255,0.1)'}} },
  1555. series:[
  1556. { 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)'}])} },
  1557. { 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)'}])} }
  1558. ]
  1559. });
  1560. }
  1561. // --- 仪表盘: 设备在线率 ---
  1562. const ggEl = document.getElementById('chart-gauge');
  1563. if (ggEl) {
  1564. const c = echarts.init(ggEl, null, {renderer:'canvas', devicePixelRatio:2});
  1565. c.setOption({
  1566. backgroundColor:'transparent',
  1567. series:[{
  1568. type:'gauge', radius:'90%', center:['50%','60%'],
  1569. startAngle:210, endAngle:-30, min:0, max:100, splitNumber:5,
  1570. axisLine:{ lineStyle:{ width:30, color:[[0.3,'#ef4444'],[0.6,'#f59e0b'],[1,'#1e90ff']] } },
  1571. axisTick:{show:false}, splitLine:{show:false}, axisLabel:{show:false},
  1572. 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'} },
  1573. detail:{ valueAnimation:true, formatter:'{value}%', color:'#ffd740', fontSize:45, fontWeight:700, offsetCenter:[0,'30%'] },
  1574. title:{ show:true, offsetCenter:[0,'62%'], color:'rgba(110,165,210,0.6)', fontSize:25 },
  1575. data:[{value:94.5, name:'在线率'}]
  1576. }]
  1577. });
  1578. }
  1579. // --- 环形图: 设备分类 (2区设备统计上部) ---
  1580. const rgEl = document.getElementById('chart-ring');
  1581. if (rgEl) {
  1582. const c = echarts.init(rgEl, null, {renderer:'canvas', devicePixelRatio:2});
  1583. const ringData = [
  1584. {value:680, name:'检测设备', itemStyle:{color:'#1e90ff', shadowBlur:8, shadowColor:'rgba(30,144,255,0.5)'}},
  1585. {value:520, name:'分析仪器', itemStyle:{color:'#4361ee', shadowBlur:8, shadowColor:'rgba(67,97,238,0.5)'}},
  1586. {value:380, name:'制备设备', itemStyle:{color:'#00e676', shadowBlur:8, shadowColor:'rgba(0,230,118,0.5)'}},
  1587. {value:280, name:'安全设备', itemStyle:{color:'#ffd740', shadowBlur:8, shadowColor:'rgba(255,215,64,0.5)'}},
  1588. {value:240, name:'辅助设备', itemStyle:{color:'#00e5c8', shadowBlur:8, shadowColor:'rgba(0,229,200,0.5)'}},
  1589. {value:358, name:'其他', itemStyle:{color:'#f97316', shadowBlur:8, shadowColor:'rgba(249,115,22,0.5)'}}
  1590. ];
  1591. const total = ringData.reduce((s,d)=>s+d.value,0);
  1592. const ringCountMap = Object.fromEntries(ringData.map(d=>[d.name,d.value]));
  1593. c.setOption({
  1594. backgroundColor:'transparent',
  1595. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1596. legend:{
  1597. orient:'vertical', right:'1%', top:'middle',
  1598. icon:'circle', itemWidth:24, itemHeight:24, itemGap:18,
  1599. textStyle:{ color:'#a8cce8', fontSize:20 },
  1600. formatter: name => {
  1601. const v = ringCountMap[name];
  1602. const pct = (v/total*100).toFixed(1);
  1603. return `{nm|${name}} {vl|${v}台} {pt|${pct}%}`;
  1604. },
  1605. rich:{
  1606. nm:{ fontSize:20, color:'#a8cce8', width:80 },
  1607. vl:{ fontSize:23, fontWeight:700, color:'#fff', width:70 },
  1608. pt:{ fontSize:20, color:'#ffd740', width:55 }
  1609. }
  1610. },
  1611. series:[{
  1612. type:'pie', radius:['38%','62%'], center:['32%','50%'],
  1613. itemStyle:{ borderRadius:4, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1614. label:{ show:true, formatter:'{c}台', fontSize:20, color:'#a8cce8' },
  1615. labelLine:{ length:10, length2:10, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1616. data: ringData,
  1617. emphasis:{ scale:true, scaleSize:5, itemStyle:{ shadowBlur:20, shadowColor:'rgba(30,144,255,0.6)' } }
  1618. }]
  1619. });
  1620. }
  1621. // --- 饼图: 设备状态(正常/维修/报废) ---
  1622. const psEl = document.getElementById('chart-pie-status');
  1623. if (psEl) {
  1624. const c = echarts.init(psEl, null, {renderer:'canvas', devicePixelRatio:2});
  1625. const statusData = [
  1626. {value:2180, name:'正常', itemStyle:{color:'#00e676', shadowBlur:10, shadowColor:'rgba(0,230,118,0.5)'}},
  1627. {value:198, name:'维修', itemStyle:{color:'#f59e0b', shadowBlur:10, shadowColor:'rgba(245,158,11,0.5)'}},
  1628. {value:80, name:'报废', itemStyle:{color:'#ef4444', shadowBlur:10, shadowColor:'rgba(239,68,68,0.5)'}}
  1629. ];
  1630. const smMap = Object.fromEntries(statusData.map(d=>[d.name,d.value]));
  1631. c.setOption({
  1632. backgroundColor:'transparent',
  1633. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1634. legend:{ show:false },
  1635. series:[{
  1636. type:'pie', radius:['35%','58%'], center:['50%','55%'],
  1637. itemStyle:{ borderRadius:5, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1638. label:{ show:true, formatter:'{b}\n{c}台\n{d}%', fontSize:20, color:'#a8cce8', lineHeight:30 },
  1639. labelLine:{ length:14, length2:10, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1640. data: statusData,
  1641. emphasis:{ scale:true, scaleSize:5, itemStyle:{ shadowBlur:20, shadowColor:'rgba(30,144,255,0.6)' } }
  1642. }]
  1643. });
  1644. }
  1645. // --- 饼图: 使用状态(使用/空闲) ---
  1646. const puEl = document.getElementById('chart-pie-usage');
  1647. if (puEl) {
  1648. const c = echarts.init(puEl, null, {renderer:'canvas', devicePixelRatio:2});
  1649. const usageData = [
  1650. {value:1534, name:'使用', itemStyle:{color:'#1e90ff', shadowBlur:14, shadowColor:'rgba(30,144,255,0.6)'}},
  1651. {value:924, name:'空闲', itemStyle:{color:'#00e5c8', shadowBlur:14, shadowColor:'rgba(0,229,200,0.5)'}}
  1652. ];
  1653. c.setOption({
  1654. backgroundColor:'transparent',
  1655. tooltip:{ trigger:'item', formatter:'{b}: {c}台 ({d}%)', ...TOOLTIP_CFG },
  1656. legend:{ show:false },
  1657. series:[{
  1658. type:'pie', radius:['35%','60%'], center:['50%','55%'],
  1659. itemStyle:{ borderRadius:6, borderColor:'rgba(3,14,31,0.5)', borderWidth:2 },
  1660. label:{ show:true, formatter:'{b}\n{c}台\n{d}%', fontSize:22, color:'#a8cce8', lineHeight:32 },
  1661. labelLine:{ length:16, length2:12, lineStyle:{color:'rgba(30,144,255,0.4)', width:2} },
  1662. data: usageData,
  1663. emphasis:{ scale:true, scaleSize:6, itemStyle:{ shadowBlur:24, shadowColor:'rgba(30,144,255,0.7)' } }
  1664. }]
  1665. });
  1666. }
  1667. }
  1668. initCharts();
  1669. // ====================================================
  1670. // MONITOR TREE
  1671. // ====================================================
  1672. function buildTree() {
  1673. const el = document.getElementById('building-tree'); if (!el) return;
  1674. const data = {label:'安科院主园区', children:[
  1675. {label:'综合实验楼A', children:[
  1676. {label:'1层', children:[{label:'A101 化学实验室'},{label:'A102 分析室'}]},
  1677. {label:'2层', children:[{label:'A201 生物实验室'}]},
  1678. {label:'3层', children:[{label:'A301 有机合成室'},{label:'A302 核磁共振室'},{label:'A303 质谱室'}]},
  1679. {label:'4层', children:[{label:'A401 X射线室'}]}
  1680. ]},
  1681. {label:'物理实验楼B', children:[
  1682. {label:'1层', children:[{label:'B101 光学实验室'}]},
  1683. {label:'2层', children:[{label:'B201 低温实验室'}]}
  1684. ]},
  1685. {label:'工程技术楼C', children:[
  1686. {label:'1层', children:[{label:'C101 机械加工室'}]},
  1687. {label:'2层', children:[{label:'C201 材料测试室'}]}
  1688. ]}
  1689. ]};
  1690. el.innerHTML = renderT(data, 0);
  1691. el.addEventListener('click', e => {
  1692. const l = e.target.closest('.tree-node-label'); if (!l) return;
  1693. l.classList.toggle('selected');
  1694. const ch = l.parentElement.querySelector('.tree-children');
  1695. const ar = l.querySelector('.arrow');
  1696. if (ch) ch.classList.toggle('open');
  1697. if (ar) ar.classList.toggle('open');
  1698. });
  1699. }
  1700. function renderT(node, depth) {
  1701. const isLeaf = !node.children || !node.children.length;
  1702. const icon = ['🏢','🏗️','📐','🔬'][Math.min(depth,3)];
  1703. let h = `<div class="tree-node"><div class="tree-node-label" style="padding-left:${depth*12+8}px">
  1704. <span class="arrow ${depth===0?'open':''}">${isLeaf ? '&nbsp;&nbsp;' : '▶'}</span>
  1705. <span>${icon}</span><span>${node.label}</span></div>`;
  1706. if (!isLeaf) {
  1707. h += `<div class="tree-children ${depth===0?'open':''}">`;
  1708. node.children.forEach(c => h += renderT(c, depth+1));
  1709. h += '</div>';
  1710. }
  1711. return h + '</div>';
  1712. }
  1713. // ====================================================
  1714. // CAMERAS
  1715. // ====================================================
  1716. const CAMS = ['A301 有机合成室','A302 核磁共振室','A303 质谱室','A301 走廊','A302 走廊','A303 走廊','A层公共区域','A层安全通道','A层出入口'];
  1717. function buildCameras() {
  1718. const g = document.getElementById('camera-grid'); if (!g) return;
  1719. g.innerHTML = '';
  1720. for (let i = 0; i < 9; i++) {
  1721. const cell = document.createElement('div');
  1722. cell.className = 'camera-cell' + (i===0 ? ' ai-cam' : '');
  1723. const cv = document.createElement('canvas');
  1724. cv.style.cssText = 'width:100%;height:100%;display:block';
  1725. cell.appendChild(cv);
  1726. 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>':''}`;
  1727. if (i===0) {
  1728. const box = document.createElement('div');
  1729. box.className = 'ai-detection-box';
  1730. box.style.cssText = 'left:28%;top:18%;width:22%;height:38%';
  1731. box.innerHTML = '<div class="ai-detection-label">危险行为: 未佩戴防护</div>';
  1732. cell.appendChild(box);
  1733. }
  1734. g.appendChild(cell);
  1735. setTimeout(() => drawFakeCam(cv, i), 150);
  1736. }
  1737. }
  1738. function drawFakeCam(canvas, idx) {
  1739. const ctx = canvas.getContext('2d');
  1740. const par = canvas.parentElement;
  1741. let pw, ph;
  1742. function sz() { pw = canvas.width = par.offsetWidth; ph = canvas.height = par.offsetHeight; }
  1743. sz(); window.addEventListener('resize', sz);
  1744. let t = Math.random() * 1000;
  1745. const noise = Array.from({length:200}, () => ({x:Math.random(),y:Math.random(),s:Math.random()*3,a:Math.random()*0.3}));
  1746. function frame() {
  1747. t += 0.5; if (!pw || !ph) sz();
  1748. ctx.clearRect(0,0,pw,ph);
  1749. const bg = ctx.createLinearGradient(0,0,0,ph);
  1750. bg.addColorStop(0,'hsl(210,42%,5%)'); bg.addColorStop(1,'hsl(220,30%,3%)');
  1751. ctx.fillStyle = bg; ctx.fillRect(0,0,pw,ph);
  1752. ctx.strokeStyle = 'rgba(20,70,150,0.06)'; ctx.lineWidth = 0.5;
  1753. const vp = {x:pw/2, y:ph*0.45};
  1754. 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(); }
  1755. 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(); }
  1756. 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);
  1757. 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);
  1758. const np = [2,1,3,1,2,1,0,1,2][idx]||1;
  1759. for (let p=0;p<np;p++) {
  1760. const px=pw*(0.3+p*0.15+Math.sin(t*0.01+p)*0.02);
  1761. const py=ph*(0.6+Math.cos(t*0.008+p)*0.02);
  1762. ctx.fillStyle='rgba(120,170,255,0.65)'; ctx.beginPath(); ctx.arc(px,py,pw*0.025,0,Math.PI*2); ctx.fill();
  1763. ctx.fillStyle='rgba(70,130,220,0.4)'; ctx.fillRect(px-pw*0.02,py+pw*0.025,pw*0.04,ph*0.08);
  1764. }
  1765. const sl = (t*0.5) % ph; ctx.fillStyle='rgba(30,144,255,0.04)'; ctx.fillRect(0,sl,pw,2);
  1766. noise.forEach(n => {
  1767. ctx.fillStyle=`rgba(170,205,255,${n.a*0.5})`; ctx.fillRect(n.x*pw,n.y*ph,n.s,n.s);
  1768. if (Math.random()<0.02) { n.x=Math.random(); n.y=Math.random(); }
  1769. });
  1770. requestAnimationFrame(frame);
  1771. }
  1772. frame();
  1773. }
  1774. // ====================================================
  1775. // RESIZE CHARTS
  1776. // ====================================================
  1777. window.addEventListener('resize', () => {
  1778. ['chart-donut','chart-stack','chart-line','chart-gauge','chart-ring','chart-pie-status','chart-pie-usage','chart-chem-inventory'].forEach(id => {
  1779. const el = document.getElementById(id);
  1780. if (el) { const c = echarts.getInstanceByDom(el); if (c) c.resize(); }
  1781. });
  1782. });
  1783. </script>
  1784. </body>
  1785. </html>