import{a5 as u,b as f,r as g,aA as b,o as p,c as y,bL as _,v as x}from"./index.8d733f79.js";import{b as C}from"./dashboard.62cdb0f4.js";const L={style:{flex:"1"}},v=x("div",{id:"alarmTrend_factory",style:{height:"100%",width:"100%"}},null,-1),A=[v],T=u({name:"AlarmTrend"}),D=Object.assign(T,{setup(B,{expose:h}){const{t}=f();let e=null;const d={1:t("month1"),2:t("month2"),3:t("month3"),4:t("month4"),5:t("month5"),6:t("month6"),7:t("month7"),8:t("month8"),9:t("month9"),10:t("month10"),11:t("month11"),12:t("month12")},c=g(0);b(()=>{e&&(clearInterval(e),e=null)});function l(o){e&&(clearInterval(e),e=null),e=setInterval(()=>{l(o)},10*60*1e3),C({factoryId:o}).then(a=>{c.value=a.data.total||0;const n=[],s=[];if(a.data)for(let r=0;r<a.data.length;r++){const i=a.data[r];n.push(d[i.month]),s.push(Number(i.alarmCount))}setTimeout(()=>{m(n,s)},0)}).catch(()=>{})}function m(o,a){_.chart("alarmTrend_factory",{colors:["#3596FE"],title:{useHTML:!0,text:null,align:"left",x:-8,y:6,style:{color:"#A9C1E0",fontSize:"15px"}},time:{useUTC:!1},chart:{type:"areaspline",backgroundColor:"transparent",marginTop:20,marginRight:28,marginBottom:40,marginLeft:40},exporting:{enabled:!1},yAxis:{title:{text:null},lineColor:"rgba(255,255,255,0)",gridLineDashStyle:"ShortDash",gridLineColor:"rgba(255,255,255,0.2)",gridLineWidth:1,labels:{style:{color:"#93B3E0"}}},xAxis:{categories:o,gridLineDashStyle:"ShortDash",gridLineColor:"rgba(255,255,255,0.2)",lineColor:"#364A64",gridLineWidth:1,tickLength:4,labels:{y:16,style:{color:"#93B3E0",fontSize:"12px"}},crosshair:{color:"#93B3E0",dashStyle:"dash",width:1}},credits:{enabled:!1},legend:{enabled:!1},tooltip:{backgroundColor:"#004584",style:{color:"#EAF2FF"},borderColor:"#004584",shadow:!1,useHTML:!0,shared:!0,shape:"rect",formatter(){return`${this.x}: ${this.y}`}},plotOptions:{area:{fillOpacity:1,lineWidth:0,marker:{enabled:!1,states:{hover:{enabled:!0,radius:5}}},shadow:!1,states:{hover:{lineWidth:1}},threshold:null},series:{label:{connectorAllowed:!1},marker:{enabled:!1,lineWidth:0,lineColor:"#3596FE",width:0,height:0,symbol:"circle",radius:2}}},series:[{data:a,lineWidth:3,line:{smooth:!0},fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"rgba(27,172,255,0.4)"],[1,"rgba(27,172,255,0)"]]}}]})}return h({getData:l}),(o,a)=>(p(),y("div",L,A))}});export{D as default};
