import{L as x,i as m}from"./index.f55de596.js";import{y as X,d as G,r as i,o as T,c as f,e as U,f as q,h as o,i as s,g as l,t as b,k as z,F as H}from"./index.5bb861d3.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=l("p",{class:"text-info text-14"},"\u7D2F\u8BA1\u62A5\u8B66\u6570\u91CF",-1),$={class:"flex-1"},ee={class:"text-primary text-32 font-bold",style:{"font-family":"DIN"}},te=l("p",{class:"text-info text-14"},"\u6D41\u7A0B\u9884\u8B66\u7D2F\u8BA1\u62A5\u8B66\u6570\u91CF",-1),ae={class:"flex-1"},oe={class:"text-primary text-32 font-bold",style:{"font-family":"DIN"}},le=l("p",{class:"text-info text-14"},"\u586B\u62A5\u9884\u8B66\u62A5\u8B66\u6570\u91CF",-1);const se=G({name:"earlyWarningStatistics"}),ce=Object.assign(se,{setup(w){const p=i({}),C=i(),k=i(),R=i(),F=i(),Y=i();let u,_,h,y,v;const g=new x(0,0,1,1,[{offset:0,color:"#20DEEF"},{offset:1,color:"#007FED"}]),O=async()=>{V(),S(),j(),L(),E()},V=()=>{var t,a;u||(u=m(C.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:e=>e},grid:{bottom:20,top:10,right:30},xAxis:{type:"category",data:(t=r.value)==null?void 0:t.threeYearsAlarms.map(e=>e.name),axisLabel:{align:"center",interval:0}},yAxis:{name:"",type:"value"},color:g,series:[{name:"\u7D2F\u8BA1\u62A5\u8B66\u6570",data:(a=r.value)==null?void 0:a.threeYearsAlarms.map(e=>e.num),type:"bar",barWidth:50}]};u.setOption(n)},S=()=>{var t,a;_||(_=m(k.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:e=>e},grid:{bottom:45,top:10,right:10,left:70},xAxis:{type:"category",data:(t=r.value)==null?void 0:t.alarmsFlowsNow.map(e=>e.name),axisLabel:{interval:0,hideOverlap:!1,rotate:20}},yAxis:{name:"",type:"value"},color:g,series:[{name:"\u62A5\u8B66\u6570\u91CF",data:(a=r.value)==null?void 0:a.alarmsFlowsNow.map(e=>e.num),type:"line"}]};_.setOption(n)},j=()=>{var t,a;h||(h=m(R.value));const n={tooltip:{show:!0,trigger:"axis",valueFormatter:e=>e},grid:{bottom:20,top:10,right:30,left:80},xAxis:{type:"value"},yAxis:{type:"category",data:(t=r.value)==null?void 0:t.alarmsFillingNow.map(e=>e.name)},color:g,series:[{name:"\u9884\u8B66\u6570\u91CF",data:(a=r.value)==null?void 0:a.alarmsFillingNow.map(e=>e.num),type:"bar",barWidth:20}]};h.setOption(n)},L=()=>{var a;const n=[new x(0,0,1,1,[{offset:0,color:"#C59400"},{offset:1,color:"rgba(142, 120, 36, 0.50)"}]),new x(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 t={legend:{show:!1},tooltip:{show:!0,trigger:"item"},color:n,series:[{data:(a=r.value)==null?void 0:a.constructionAlarms.map(e=>({...e,value:e.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(t)},E=()=>{var t;v||(v=m(Y.value));const n={legend:{show:!1},tooltip:{show:!0,trigger:"item"},series:[{data:(t=r.value)==null?void 0:t.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 T(async()=>{A()}),(n,t)=>{const a=f("el-date-picker"),e=f("el-form-item"),I=f("el-form"),c=f("el-card"),d=f("el-col"),W=f("el-row");return U(),q(H,null,[o(c,{class:"mb-16"},{default:s(()=>{var N,D,B;return[o(I,{ref:"formRef",model:p.value},{default:s(()=>[o(e,{label:"\u5E74\u5EA6"},{default:s(()=>[o(a,{modelValue:p.value.projectYear,"onUpdate:modelValue":t[0]||(t[0]=M=>p.value.projectYear=M),type:"year",placeholder:"\u5168\u90E8",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),Z]),l("div",$,[l("p",ee,b(((D=r.value)==null?void 0:D.accumulatedAlarmsFlow)||0),1),te]),l("div",ae,[l("p",oe,b(((B=r.value)==null?void 0:B.accumulatedAlarmsFilling)||0),1),le])])]}),_:1}),o(W,{gutter:16},{default:s(()=>[o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"\u8FD1\u4E09\u5E74\u7D2F\u8BA1\u62A5\u8B66\u6570\u91CF"},{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:"\u5F53\u524D\u5404\u6D41\u7A0B\u62A5\u8B66\u60C5\u51B5"},{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:"\u5F53\u524D\u5404\u586B\u62A5\u62A5\u8B66\u60C5\u51B5"},{default:s(()=>[l("div",{ref_key:"chart3Ref",ref:R,class:"h-[230px]"},null,512)]),_:1})]),_:1}),z("",!0),o(d,{span:12,class:"mb-16"},{default:s(()=>[o(c,{header:"\u5EFA\u8BBE\u5468\u671F\u9884\u8B66\u76D1\u6D4B"},{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:"\u5B89\u5168\u76D1\u6D4B"},{default:s(()=>[l("div",{ref_key:"chart6Ref",ref:Y,class:"h-[230px]"},null,512)]),_:1})]),_:1})]),_:1})],64)}}});export{ce as default};
