import{b as L,r as u,o as i,y as b,q as o,P as c,x as m,v as $,p as r,C as N,c as S,F as D,A as P,S as _,k as C,E as O,i as U,m as x,l as J,bv as R}from"./index.8d733f79.js";import{E as A}from"./el-input-number.60463ef8.js";import{a as T,b as j}from"./components.b31a8293.js";import{a as z}from"./deviceAnalysis.ce7ce4e7.js";import"./index.28f6da25.js";const G={class:"dialog-footer"},Z={__name:"bearingFaultLibrary",emits:["backFaultLibrary"],setup(H,{expose:y,emit:g}){const{t:p}=L(),s=u(!1),a=u({name:"",factoryModels:[],deviceId:""}),d=u([]),n=u("");function M(e){d.value=[],a.value={name:"",factoryModels:[],deviceId:e.deviceId},n.value="",s.value=!0,F(),I()}const F=async()=>{const e=await z({deviceId:a.value.deviceId});n.value=e.data||""};function I(){T({deviceId:a.value.deviceId}).then(e=>{d.value=e.data||[]})}function V(){if(!n.value){_.error(p("rotateFreqP"));return}if(!a.value.factoryModels||!a.value.factoryModels.length){_.error(p("bearModelP"));return}j({deviceId:a.value.deviceId,rotatingFrequency:n.value,factoryModels:a.value.factoryModels}).then(e=>{g("backFaultLibrary",JSON.parse(JSON.stringify(e.data||[]))),E()})}function E(){s.value=!1}return y({showModal:M}),(e,l)=>{const k=A,v=C,w=O,B=U,h=x,f=J,q=R;return i(),b(q,{modelValue:s.value,"onUpdate:modelValue":l[4]||(l[4]=t=>s.value=t),width:"480","align-center":""},{header:o(()=>[c(m(e.$t("bearingFaultLib")),1)]),footer:o(()=>[$("span",G,[r(f,{onClick:l[3]||(l[3]=t=>s.value=!1)},{default:o(()=>[c(m(e.$t("cancel")),1)]),_:1}),r(f,{type:"primary",onClick:V},{default:o(()=>[c(m(e.$t("confirm")),1)]),_:1})])]),default:o(()=>[r(h,{model:a.value,inline:!0,"label-width":"68px"},{default:o(()=>[r(v,{label:e.$t("rotateFreq")},{default:o(()=>[r(k,{class:"input-number",style:{width:"214px !important"},modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=t=>n.value=t),placeholder:e.$t("rotateFreqP"),onMousewheel:l[1]||(l[1]=N(()=>{},["prevent"])),step:.001,min:.001,max:1e6,controls:!1},null,8,["modelValue","placeholder","step","min"])]),_:1},8,["label"]),r(v,{label:e.$t("bearModel")},{default:o(()=>[r(B,{modelValue:a.value.factoryModels,"onUpdate:modelValue":l[2]||(l[2]=t=>a.value.factoryModels=t),multiple:"",placeholder:e.$t("bearModelP"),clearable:"",teleported:!1},{default:o(()=>[(i(!0),S(D,null,P(d.value,t=>(i(),b(w,{key:t,label:t,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue"])}}};export{Z as default};
