import{_ as w,a5 as C,b as k,r as x,aA as E,o as m,c as _,v as o,x as n,F as M,A as F,O as H,n as y,t as J,J as O,S as P,D as Q}from"./index.8d733f79.js";import{n as R}from"./dashboard.62cdb0f4.js";import{u as T}from"./searchStore.0c98fb50.js";const U={style:{flex:"1",padding:"16px 16px 4px 16px",height:"calc(100% - 40px)"}},V={style:{overflow:"hidden",height:"calc(100% - 6px)",display:"flex","flex-direction":"column"}},j={className:"tableHeader"},z={className:"txt_ellipsis",style:{width:"calc(100% - 246px)"}},K={className:"txt_ellipsis",style:{width:"88px"}},Z={className:"txt_ellipsis",style:{width:"158px"}},q=["onClick"],G=["title"],W={className:"txt_ellipsis",style:{width:"158px"}},X={key:0,class:"noData"},Y=C({name:"AlarmTrend"}),ee=Object.assign(Y,{setup(le,{expose:A}){const{t:N,locale:te}=k(),{proxy:u}=Q(),D=e=>O.session.getJSON("enums").alarmLevel.find(c=>+c.key===e).desc,L={11:{label:"\u4E00\u7EA7\u62A5\u8B66",color:"#F5C448"},16:{label:"\u4E8C\u7EA7\u62A5\u8B66",color:"#FF8D1F"},21:{label:"\u4E09\u7EA7\u62A5\u8B66",color:"#8E51DA"},25:{label:"\u56DB\u7EA7\u62A5\u8B66",color:"#D42121"}};let r=null;const p=30;let d=null,a=null,h=!1;const s=x([]),f=x(""),g=x("");E(()=>{r&&(clearInterval(r),r=null),d&&(clearInterval(d),d=null),a&&(clearInterval(a),a=null)});function b(e,c){f.value=e,g.value=c.label,r&&(clearInterval(r),r=null),r=setInterval(()=>{b(e)},10*60*1e3),a&&(clearInterval(a),a=null),document.getElementById("deviceTable_device")&&(document.getElementById("deviceTable_device").scrollTop=0),R({deviceId:e}).then(t=>{if(s.value=t.data||[],!t.data||!t.data.length)return;a&&(clearInterval(a),a=null,document.getElementById("deviceTable_device").scrollTop=0,v("deviceTable_device",[],"tableList",0));const i=s.value.length;v("deviceTable_device",s.value,"tableList",i);let l=0;a=setInterval(()=>{h||(l++,l>=p?d||(d=setTimeout(()=>{d=null,l=0,v("deviceTable_device",s.value,"tableList",i)},1e3)):v("deviceTable_device",s.value,"tableList",i))},10)}).catch(()=>{})}function v(e,c,t,i){const l=document.getElementById(e);if(!l){clearInterval([`${e}Timer`]);return}if(s.value.length*p<=l.offsetHeight)return;const I=l.scrollHeight-l.offsetHeight;l.scrollTop=Math.ceil(l.scrollTop)+1,Math.ceil(l.scrollTop)-I<=1&&Math.ceil(l.scrollTop-I)>=0&&(c.length<=i*2?s.value=c.concat(c):l.scrollTop-=p*i)}function B(){h=!0}function S(){h=!1}function $(e){u.$router.hasRoute("smartAlarm")?(T().setAiAlarmTab(e.alarmStatus),T().setJumpAlarmQuery({deviceId:f.value,deviceName:g.value}),u.$router.push("/alarm/process")):u.$router.hasRoute("allStatusAlarm")?(T().setJumpAlarmQuery({status:e.alarmStatus,deviceId:f.value,deviceName:g.value}),u.$router.push("/alarm/allAlarm")):P.error(N("noZNBJAuth"))}return A({getData:b}),(e,c)=>(m(),_("div",U,[o("div",V,[o("div",j,[o("div",z,n(e.$t("pointName")),1),o("div",K,n(e.$t("alarmLevel")),1),o("div",Z,n(e.$t("lastAlarmTime")),1)]),o("div",{style:{overflow:"hidden",height:"calc(100% - 34px)"},id:"deviceTable_device",onMouseover:B,onMouseleave:S},[(m(!0),_(M,null,F(y(s),(t,i)=>(m(),_("div",{style:{display:"flex"},className:"coloumn_td",key:"single_"+i,onClick:l=>$(t)},[o("div",{className:"txt_ellipsis",style:{width:"calc(100% - 246px)"},title:(t.pointName||"-")+"("+(t.axial||"-")+")"},n(t.pointName||"-")+n("("+(t.axial||"-")+")"),9,G),o("div",{className:"txt_ellipsis",style:H([{width:"88px"},{color:L[t.alarmLevel].color}])},n(D(t.alarmLevel)),5),o("div",W,n(t.lastAlarmTime||"-"),1)],8,q))),128)),!y(s)||!y(s).length?(m(),_("div",X,n(e.$t("noData")),1)):J("",!0)],32)])]))}}),ce=w(ee,[["__scopeId","data-v-c6ceae68"]]);export{ce as default};
