import{L as g,i as m}from"./index-b861e656.js";import{z as X,r as i,o as z,b as f,c as G,d as T,f as o,h as s,e as l,t as b,j as U,F as q,k as H}from"./index-dd5fae99.js";const J=w=>X.get("/api/v1/statistics/early-warning",{params:w}),K={class:"flex justify-between text-center mt-24"},P={class:"flex-1"},Q={class:"text-primary text-32 font-bold",style:{"font-family":"DIN"}},Z={class:"flex-1"},$={class:"text-primary text-32 font-bold",style:{"font-family":"DIN"}},ee={class:"flex-1"},te={class:"text-primary text-32 font-bold",style:{"font-family":"DIN"}};const ae=H({name:"earlyWarningStatistics"}),re=Object.assign(ae,{setup(w){const p=i({}),C=i(),k=i(),R=i(),F=i(),Y=i();let u,h,_,y,v;const x=new g(0,0,1,1,[{offset:0,color:"#20DEEF"},{offset:1,color:"#007FED"}]),O=async()=>{V(),j(),L(),S(),E()},V=()=>{var e,a;u||(u=m(C.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:t=>t},grid:{bottom:20,top:10,right:30},xAxis:{type:"category",data:(e=r.value)==null?void 0:e.threeYearsAlarms.map(t=>t.name),axisLabel:{align:"center",interval:0}},yAxis:{name:"",type:"value"},color:x,series:[{name:"累计报警数",data:(a=r.value)==null?void 0:a.threeYearsAlarms.map(t=>t.num),type:"bar",barWidth:50}]};u.setOption(n)},j=()=>{var e,a;h||(h=m(k.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:t=>t},grid:{bottom:45,top:10,right:10,left:70},xAxis:{type:"category",data:(e=r.value)==null?void 0:e.alarmsFlowsNow.map(t=>t.name),axisLabel:{interval:0,hideOverlap:!1,rotate:20}},yAxis:{name:"",type:"value"},color:x,series:[{name:"报警数量",data:(a=r.value)==null?void 0:a.alarmsFlowsNow.map(t=>t.num),type:"line"}]};h.setOption(n)},L=()=>{var e,a;_||(_=m(R.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:t=>t},grid:{bottom:20,top:10,right:30,left:80},xAxis:{type:"value"},yAxis:{type:"category",data:(e=r.value)==null?void 0:e.alarmsFillingNow.map(t=>t.name)},color:x,series:[{name:"预警数量",data:(a=r.value)==null?void 0:a.alarmsFillingNow.map(t=>t.num),type:"bar",barWidth:20}]};_.setOption(n)},S=()=>{var a;const n=[new g(0,0,1,1,[{offset:0,color:"#C59400"},{offset:1,color:"rgba(142, 120, 36, 0.50)"}]),new g(0,0,1,1,[{offset:0,color:"rgba(197, 90, 70, 1)"},{offset:1,color:"rgba(197, 90, 70, 0.5)"}])];y||(y=m(F.value));const e={legend:{show:!1},tooltip:{show:!0,trigger:"item"},color:n,series:[{data:(a=r.value)==null?void 0:a.constructionAlarms.map(t=>({...t,value:t.num})),type:"pie",itemStyle:{borderRadius:4},label:{formatter:`{b} {c}`,color:"#333333"},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};y.setOption(e)},E=()=>{var e;v||(v=m(Y.value));const n={legend:{show:!1},tooltip:{show:!0,trigger:"item"},series:[{data:(e=r.value)==null?void 0:e.safetyMonitoring.map(a=>({...a,value:a.num})),type:"pie",itemStyle:{borderRadius:4},label:{formatter:`{b} {c}`,color:"#333333"},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};v.setOption(n)},r=i(),A=async()=>{const n=await J({year:p.value.projectYear});r.value=n.data,O()};return z(async()=>{A()}),(n,e)=>{const a=f("el-date-picker"),t=f("el-form-item"),W=f("el-form"),c=f("el-card"),d=f("el-col"),I=f("el-row");return G(),T(q,null,[o(c,{class:"mb-16"},{default:s(()=>{var N,D,B;return[o(W,{ref:"formRef",model:p.value},{default:s(()=>[o(t,{label:"年度"},{default:s(()=>[o(a,{modelValue:p.value.projectYear,"onUpdate:modelValue":e[0]||(e[0]=M=>p.value.projectYear=M),type:"year",placeholder:"全部",format:"YYYY","value-format":"YYYY",style:{width:"200px"},onChange:A},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),l("div",K,[l("div",P,[l("p",Q,b(((N=r.value)==null?void 0:N.accumulatedAlarmsTotal)||0),1),e[1]||(e[1]=l("p",{class:"text-info text-14"},"累计报警数量",-1))]),l("div",Z,[l("p",$,b(((D=r.value)==null?void 0:D.accumulatedAlarmsFlow)||0),1),e[2]||(e[2]=l("p",{class:"text-info text-14"},"流程预警累计报警数量",-1))]),l("div",ee,[l("p",te,b(((B=r.value)==null?void 0:B.accumulatedAlarmsFilling)||0),1),e[3]||(e[3]=l("p",{class:"text-info text-14"},"填报预警报警数量",-1))])])]}),_:1}),o(I,{gutter:16},{default:s(()=>[o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"近三年累计报警数量"},{default:s(()=>[l("div",{ref_key:"chart1Ref",ref:C,class:"h-[230px]"},null,512)]),_:1})]),_:1}),o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"当前各流程报警情况"},{default:s(()=>[l("div",{ref_key:"chart2Ref",ref:k,class:"h-[230px]"},null,512)]),_:1})]),_:1}),o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"当前各填报报警情况"},{default:s(()=>[l("div",{ref_key:"chart3Ref",ref:R,class:"h-[230px]"},null,512)]),_:1})]),_:1}),U("",!0),o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"建设周期预警监测"},{default:s(()=>[l("div",{ref_key:"chart5Ref",ref:F,class:"h-[230px]"},null,512)]),_:1})]),_:1}),o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"安全监测"},{default:s(()=>[l("div",{ref_key:"chart6Ref",ref:Y,class:"h-[230px]"},null,512)]),_:1})]),_:1})]),_:1})],64)}}});export{re as default};