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