import{b as q,u as w,r as s,ah as L,e as P,cr as U,ay as x,bN as D,o as r,c as i,p as o,q as n,n as l,F as m,A as _,y as b,P as F,x as N,v as R,E as S,i as H,k as W,l as A,m as M,cp as j,cq as z}from"./index.8d733f79.js";import{g as G,d as J}from"./reportAnalysis.c518059d.js";const K={class:"page-content"},Q={class:"f-h tableWrap"},ee={__name:"index",setup(X){q(),w();const y=s([]),g=s([]),t=L({factoryId:"",orgId:"",keyDevice:1}),v=s([]),f=s([]);let c=null;const h=s();P(()=>{O()});async function O(){const e=await U();!e.data.length||(v.value=e.data,t.factoryId=e.data[0].id,I(),d(),c=setInterval(d,5*60*1e3))}const I=()=>{if(!t.factoryId){f.value=[];return}G({factoryId:t.factoryId}).then(e=>{f.value=e.data})};async function d(){const e=await J(t);g.value=e.data.cols,y.value=e.data.data,x(()=>{h.value=document.getElementsByClassName("tableWrap")[0].offsetHeight})}const B=()=>{t.orgId="",d()};return D(()=>{c&&(clearInterval(c),c=null)}),(e,u)=>{const k=S,E=H,p=W,V=A,C=M,T=j,$=z;return r(),i("div",K,[o(C,{ref:"formRef",model:l(t),inline:!0},{default:n(()=>[o(p,{label:e.$t("belongTofactory"),prop:"factoryId"},{default:n(()=>[o(E,{modelValue:l(t).factoryId,"onUpdate:modelValue":u[0]||(u[0]=a=>l(t).factoryId=a),placeholder:e.$t("belongTofactoryP"),filterable:"",onChange:I},{default:n(()=>[(r(!0),i(m,null,_(l(v),a=>(r(),b(k,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,{label:e.$t("branchOfficeName"),prop:"orgId"},{default:n(()=>[o(E,{modelValue:l(t).orgId,"onUpdate:modelValue":u[1]||(u[1]=a=>l(t).orgId=a),placeholder:e.$t("branchOfficeNameP"),clearable:"",filterable:""},{default:n(()=>[(r(!0),i(m,null,_(l(f),a=>(r(),b(k,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,null,{default:n(()=>[o(V,{type:"primary",onClick:d},{default:n(()=>[F(N(e.$t("query")),1)]),_:1}),o(V,{onClick:B},{default:n(()=>[F(N(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),R("div",Q,[o($,{data:l(y),"max-height":l(h)},{default:n(()=>[(r(!0),i(m,null,_(l(g),a=>(r(),b(T,{key:a.prop,prop:a.prop,label:a.label,width:"120"},null,8,["prop","label"]))),128))]),_:1},8,["data","max-height"])])])}}};export{ee as default};
