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