import{_ as q,u as w,ai as y,ah as C,r as v,e as L,cr as x,e5 as A,cE as U,o as u,c as D,p as n,q as o,n as r,s as j,F as $,A as Y,N as z,P as f,x as _,y as g,aH as H,aj as O,Z,k as G,l as J,E as K,i as Q,m as W}from"./index.8d733f79.js";import{E as X}from"./el-date-picker-panel.089dbe6d.js";import"./panel-time-pick.b2dd8e75.js";import"./index.28f6da25.js";const ee={class:"page-content"},ae={__name:"index",setup(te){const h=w(),k=e=>Z(()=>new Date(e).getTime()<new Date().getTime()-30*24*60*60*1e3||new Date(e).getTime()>new Date().getTime()),c=[`${y().subtract(1,"day").format("YYYY-MM-DD")} 00:00:00`,`${y().subtract(1,"day").format("YYYY-MM-DD")} 23:59:59`],T=C({total:0,tableData:[],columns:[{prop:"dataTypeName",label:"dataType"},{prop:"shouldCount",label:"shouldCount"},{prop:"retryCount",label:"retryCount"},{prop:"oneTimeSuccessCount",label:"actualSuccessCount",formatter:e=>{let l;return e.dataType==="temperature"||e.dataType==="speed"||e.dataType==="acceleration"?l=e.oneTimeSuccessCount:l=`${e.oneTimeSuccessCount+e.retrySuccessCount}\uFF08${e.oneTimeSuccessCount}+${e.retrySuccessCount}\uFF09`,l}},{label:"unReportedDetails",type:"action",width:100,fixed:"right"}]}),a=C({startTime:c[0],endTime:c[1],factoryId:""}),M=[{val:1,name:"yesterday"},{val:7,name:"pastDay7"},{val:30,name:"pastDay30"}],i=v(),s=v(c),b=v([]);L(()=>{x().then(e=>{b.value=e.data}),d()});const S=()=>{a.startTime=s.value?`${s.value[0]} 00:00:00`:"",a.endTime=s.value?`${s.value[1]} 23:59:59`:"",i.value=null};async function d(e){e&&(i.value=e,a.startTime=`${y().subtract(e,"day").format("YYYY-MM-DD")} 00:00:00`,a.endTime=`${y().subtract(1,"day").format("YYYY-MM-DD")} 23:59:59`,s.value=[a.startTime,a.endTime]);const l=await A(a);T.tableData=l.data}const E=()=>{a.factoryId="",a.startTime=c[0],a.endTime=c[1],s.value=c,i.value=null,d()},I=e=>{h.push({path:"/alarm/dataAnomalyStatistics/detail",query:{dataType:e.dataType,factoryId:a.factoryId,startTime:a.startTime,endTime:a.endTime}})};return(e,l)=>{const V=X,m=G,p=J,P=K,B=Q,F=W,N=U("hasPermi");return u(),D("div",ee,[n(F,{model:r(a),inline:!0},{default:o(()=>[n(m,{label:e.$t("countTime"),prop:"timeRange"},{default:o(()=>[n(V,{modelValue:r(s),"onUpdate:modelValue":l[0]||(l[0]=t=>j(s)?s.value=t:null),type:"daterange","start-placeholder":e.$t("startTime"),"end-placeholder":e.$t("endTime"),"value-format":"YYYY-MM-DD","disabled-date":k,onChange:S},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),n(m,null,{default:o(()=>[(u(),D($,null,Y(M,t=>n(p,{key:t.val,onClick:R=>d(t.val),class:z(t.val===r(i)?"activeBtn":"")},{default:o(()=>[f(_(e.$t(t.name)),1)]),_:2},1032,["onClick","class"])),64))]),_:1}),n(m,{label:e.$t("factory"),prop:"factoryId"},{default:o(()=>[n(B,{modelValue:r(a).factoryId,"onUpdate:modelValue":l[1]||(l[1]=t=>r(a).factoryId=t),placeholder:e.$t("factoryP"),clearable:"",filterable:""},{default:o(()=>[(u(!0),D($,null,Y(r(b),t=>(u(),g(P,{key:t.id,label:t.name,value:Number(t.id)},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(m,null,{default:o(()=>[n(p,{type:"primary",onClick:l[2]||(l[2]=t=>d())},{default:o(()=>[f(_(e.$t("query")),1)]),_:1}),n(p,{onClick:E},{default:o(()=>[f(_(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),n(r(O),{class:"f-h",columns:r(T).columns,tableData:r(T).tableData,pagination:!1},{action:o(({scope:t})=>[H((u(),g(p,{link:"",type:"primary",onClick:R=>I(t.row)},{default:o(()=>[f(_(e.$t("view")),1)]),_:2},1032,["onClick"])),[[N,["alarm_dataAnomaly_view"]]])]),_:1},8,["columns","tableData"])])}}},re=q(ae,[["__scopeId","data-v-9f31fa7e"]]);export{re as default};
