classic_turbine.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!doctype html><html lang="zh" data-theme="light"><head><meta charset="utf-8"><script>(function(){try{var q=new URLSearchParams(location.search).get("theme");if(q){localStorage.setItem("windscada_theme",q)}var t=q||"light";document.documentElement.setAttribute("data-theme",t)}catch(e){}})();</script><meta name="viewport" content="width=device-width,initial-scale=1">
  2. <title>%T% · windscada</title><style>%CSS%</style></head><body>
  3. <header><h1>%T% <a href="/">← 工作台</a></h1><span id="winbox"></span><span class="badge">只显示有问题的系统; 无问题不出图</span></header>
  4. <div id="probs">加载中…</div>
  5. <div class="card" style="margin-top:14px"><h3>台内即时查询 (任一契约通道 × 时间窗 × 聚合)</h3>
  6. <div style="display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px">
  7. <select id="qch" style="max-width:340px"></select>
  8. <select id="qagg"><option value="med">月中位</option><option value="dutyd">月duty(秒/日)</option><option value="daily">逐日中位</option></select>
  9. <button onclick="runQ()">出图</button><span class="small" id="qmsg"></span></div>
  10. <div id="qfig"></div></div>
  11. <footer>边界: 叶片/塔架无SCADA轴 | 对风误差=wrap(风向−机舱位置) vane口径; 死区/速率需≤30s数据=INSUFFICIENT | 判级时间窗: 变桨/偏航/蓄能/温度判级=近90日固定, 曲线=2025H2; 图内月序=所选时间窗 | P级归综合报告线</footer>
  12. <script>%JS%
  13. const T='%T%';let WIN='2026年';
  14. async function reload(win){WIN=win;
  15. const r=await fetch('/api/turbine?t='+T+'&win='+encodeURIComponent(win)); const d=await r.json();
  16. document.getElementById('winbox').innerHTML=winSel(win);
  17. let h='';
  18. if(!d.problems.length) h='<div class="card"><p class="empty">各系统在判级时间窗内均无非常态 —— 可用下方即时查询查看任意契约通道。</p></div>';
  19. d.problems.forEach(p=>{
  20. h+=`<div class="card mb"><h3>${p.sys} ${chip(p.状态)}</h3><p class="small" style="margin-bottom:8px">${p.依据}</p>`;
  21. if(p.figs.length){h+=`<div class="grid">`; p.figs.forEach(f=>{h+=drawFig(f)}); h+=`</div>`}
  22. h+=`</div>`+ordersHtml(p.orders)});
  23. document.getElementById('probs').innerHTML=h;
  24. }
  25. async function loadCh(){const r=await fetch('/api/channels');const d=await r.json();
  26. let o='';for(const [g,cols] of Object.entries(d)){o+=`<optgroup label="${g}">`+cols.map(c=>`<option value="${c.code}">${c.cn}</option>`).join('')+`</optgroup>`}
  27. document.getElementById('qch').innerHTML=o}
  28. async function runQ(){document.getElementById('qmsg').textContent='计算中…';
  29. const ch=document.getElementById('qch').value, agg=document.getElementById('qagg').value;
  30. const r=await fetch(`/api/query?t=${T}&ch=${encodeURIComponent(ch)}&win=${encodeURIComponent(WIN)}&agg=${agg}`);
  31. const f=await r.json(); document.getElementById('qmsg').textContent=f.err||'';
  32. document.getElementById('qfig').innerHTML=f.err?'':drawFig(f)}
  33. reload(WIN);loadCh();
  34. </script></body></html>