import{b as C,u as D,ah as k,r as w,J as g,e as K,cr as z,bN as J,o as s,c as p,p as n,q as r,n as l,F as f,A as v,y,P as $,x as S,aj as q,E as B,i as R,k as j,j as A,l as M,m as G,D as H}from"./index.8d733f79.js";import{r as Q}from"./reportAnalysis.c518059d.js";import{h as W}from"./deviceType.30ac56e5.js";const X={class:"page-content"},le={__name:"index",setup(Y){C();const{proxy:_}=H();D();const u=k({total:0,tableData:[],columns:[{prop:"deviceName",label:"deviceName"},{prop:"deviceCode",label:"deviceCode"},{prop:"deviceType",label:"deviceType"},{prop:"defectLevelName",label:"defectLevel"},{prop:"diagnosisConclusion",label:"diagnosisConclusion"},{prop:"follow",label:"isFollow",formatter:a=>JSON.parse(sessionStorage.getItem("enums")).yesOrNo.find(o=>JSON.parse(o.key)===a.follow).desc},{prop:"importantLevel",label:"importantLevel"},{prop:"devicePath",label:"devicePath",width:200}]}),t=k({factoryId:"",deviceName:"",productKey:"",follow:"",defectLevel:"",importantLevel:"",queryType:1,pageNo:1,pageSize:10}),N=w([]),L=w([]),O=g.session.getJSON("enums").yesOrNo,P=g.session.getJSON("enums").faultLevel,I=g.session.getJSON("enums").importantLevel;let b=null;K(()=>{i(),b=setInterval(i,5*60*1e3),T(),h()});async function i(){const a=await Q(t);u.total=a.data.totalElements,u.tableData=a.data.content}async function T(){const a=await z();N.value=a.data}const h=async()=>{const a=await W();a.data.length&&(L.value=a.data)},F=()=>{_.$refs.formRef.resetFields(),i()};return J(()=>{b&&(clearInterval(b),b=null)}),(a,o)=>{const c=B,m=R,d=j,U=A,V=M,E=G;return s(),p("div",X,[n(E,{ref:"formRef",model:l(t),inline:!0,"label-width":"68px"},{default:r(()=>[n(d,{label:a.$t("belongTofactory"),prop:"factoryId"},{default:r(()=>[n(m,{modelValue:l(t).factoryId,"onUpdate:modelValue":o[0]||(o[0]=e=>l(t).factoryId=e),placeholder:a.$t("belongTofactoryP"),clearable:"",filterable:""},{default:r(()=>[(s(!0),p(f,null,v(l(N),e=>(s(),y(c,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,{label:a.$t("deviceName"),prop:"deviceName"},{default:r(()=>[n(U,{modelValue:l(t).deviceName,"onUpdate:modelValue":o[1]||(o[1]=e=>l(t).deviceName=e),placeholder:a.$t("deviceNameP"),maxlength:"20",style:{width:"236px"}},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,{label:a.$t("deviceType"),prop:"productKey"},{default:r(()=>[n(m,{modelValue:l(t).productKey,"onUpdate:modelValue":o[2]||(o[2]=e=>l(t).productKey=e),filterable:"",placeholder:a.$t("deviceTypeP"),clearable:""},{default:r(()=>[(s(!0),p(f,null,v(l(L),e=>(s(),y(c,{key:e.productKey,label:e.name,value:e.productKey},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,{label:a.$t("isFollow"),prop:"follow"},{default:r(()=>[n(m,{modelValue:l(t).follow,"onUpdate:modelValue":o[3]||(o[3]=e=>l(t).follow=e),placeholder:a.$t("isFollowP"),clearable:""},{default:r(()=>[(s(!0),p(f,null,v(l(O),e=>(s(),y(c,{key:e.key,label:e.desc,value:e.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,{label:a.$t("defectLevel"),prop:"defectLevel"},{default:r(()=>[n(m,{modelValue:l(t).defectLevel,"onUpdate:modelValue":o[4]||(o[4]=e=>l(t).defectLevel=e),placeholder:a.$t("defectLevelP"),clearable:""},{default:r(()=>[(s(!0),p(f,null,v(l(P),e=>(s(),y(c,{key:e.key,label:e.desc,value:e.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,{label:a.$t("importantLevel"),prop:"importantLevel"},{default:r(()=>[n(m,{modelValue:l(t).importantLevel,"onUpdate:modelValue":o[5]||(o[5]=e=>l(t).importantLevel=e),placeholder:a.$t("importantLevelP"),clearable:""},{default:r(()=>[(s(!0),p(f,null,v(l(I),e=>(s(),y(c,{key:e.key,label:e.desc,value:e.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),n(d,null,{default:r(()=>[n(V,{type:"primary",onClick:i},{default:r(()=>[$(S(a.$t("query")),1)]),_:1}),n(V,{onClick:F},{default:r(()=>[$(S(a.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),n(l(q),{class:"f-h",columns:l(u).columns,tableData:l(u).tableData,total:l(u).total,pageNum:l(t).pageNo,"onUpdate:pageNum":o[6]||(o[6]=e=>l(t).pageNo=e),pageSize:l(t).pageSize,"onUpdate:pageSize":o[7]||(o[7]=e=>l(t).pageSize=e),onPagination:i},null,8,["columns","tableData","total","pageNum","pageSize"])])}}};export{le as default};
