import{_ as P,a5 as z,b as M,r as b,ah as R,o as _,y as E,q as n,v as U,p as s,P as L,x as S,n as a,c as x,F as j,A as q,aj as A,s as O,ay as K,E as W,i as G,k as H,j as J,m as Q,l as X,bv as Y,D as Z}from"./index.8d733f79.js";import{l as ee,m as ae}from"./deviceAnalysis.ce7ce4e7.js";const le={class:"dialog-footer"},te=z({name:"FaultLib"}),oe=Object.assign(te,{emits:["confirm"],setup(ne,{expose:$,emit:V}){const{t:F}=M(),{proxy:r}=Z(),d=b(!1),y=b([]),o=R({factory:"",model:"",pageNo:1,pageSize:10}),i=R({total:0,tableData:[],columns:[{prop:"factory",label:"firm"},{prop:"model",label:"bearModel"},{prop:"innerRing",label:"innerRing"},{prop:"outerRing",label:"outerRing"},{prop:"roller",label:"roller"},{prop:"holder",label:"holder"}]}),c=b([]);let u=[];const k=e=>{console.log("\u56DE\u663E\u7684",e),d.value=!0,o.pageNo=1,p(),N(),u=e,K(()=>{w()})},w=async()=>{r.$refs.FaultTableRef.clearSelection(),u!=null&&u.length&&u.forEach(e=>{e.id=e.bearingId,r.$refs.FaultTableRef.selectedRow(e,!0)})},N=async()=>{const e=await ee();y.value=e.data},p=async()=>{const e=await ae(o);i.tableData=e.data.content,i.total=e.data.totalElements,console.log("selectList.value-------",c.value),c.value.length&&c.value.forEach(l=>{const f=i.tableData.find(g=>g.id===l.id);f&&(r.$refs.FaultTableRef.selectedRow(l,!1),r.$refs.FaultTableRef.selectedRow(f,!0))})},C=e=>{console.log("selection--------",e),c.value=e},D=()=>{if(!c.value.length){r.$modal.msgError(F("bearingP"));return}V("confirm",c.value),m()};function m(){d.value=!1,r.$refs.formRef.resetFields()}return $({showModal:k}),(e,l)=>{const f=W,g=G,v=H,T=J,I=Q,h=X,B=Y;return _(),E(B,{title:e.$t("linkBearing"),modelValue:a(d),"onUpdate:modelValue":l[4]||(l[4]=t=>O(d)?d.value=t:null),style:{width:"calc(60%)"},"align-center":!0,onClose:m,class:"linkBearing"},{footer:n(()=>[U("div",le,[s(h,{onClick:m},{default:n(()=>[L(S(e.$t("cancel")),1)]),_:1}),s(h,{type:"primary",onClick:D},{default:n(()=>[L(S(e.$t("confirm")),1)]),_:1})])]),default:n(()=>[s(I,{ref:"formRef",model:a(o),inline:!0},{default:n(()=>[s(v,{label:e.$t("firm"),prop:"factory"},{default:n(()=>[s(g,{modelValue:a(o).factory,"onUpdate:modelValue":l[0]||(l[0]=t=>a(o).factory=t),placeholder:e.$t("firmP"),onChange:p,teleported:!1},{default:n(()=>[(_(!0),x(j,null,q(a(y),t=>(_(),E(f,{key:t,label:t,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s(v,{label:e.$t("bearModel"),prop:"model"},{default:n(()=>[s(T,{modelValue:a(o).model,"onUpdate:modelValue":l[1]||(l[1]=t=>a(o).model=t),placeholder:e.$t("bearModelP"),maxlength:"20",onInput:p},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),s(a(A),{tableWrapId:"bearingLibTable",class:"f-h",ref:"FaultTableRef",selection:"",rowKey:"id",columns:a(i).columns,tableData:a(i).tableData,total:a(i).total,pageNum:a(o).pageNo,"onUpdate:pageNum":l[2]||(l[2]=t=>a(o).pageNo=t),pageSize:a(o).pageSize,"onUpdate:pageSize":l[3]||(l[3]=t=>a(o).pageSize=t),onPagination:p,onChangeSelection:C},null,8,["columns","tableData","total","pageNum","pageSize"])]),_:1},8,["title","modelValue"])}}}),ie=P(oe,[["__scopeId","data-v-087e73db"]]);export{ie as default};
