import{a5 as z,b as F,u as P,r as c,ah as S,o as r,y as _,q as s,p as n,n as l,c as v,F as y,A as C,P as x,x as M,aj as R,s as $,E as B,i as O,k as j,l as A,m as K,bv as Q,D as W}from"./index.8d733f79.js";import{N as G,O as H,P as J}from"./collector.4eeb72e6.js";import{c as X}from"./common.d6f7c05a.js";const Y=z({name:"AssociateSensor"}),le=Object.assign(Y,{setup(Z,{expose:V}){F();const{proxy:L}=W();P();const i=c(!1),f=c([]),u=c([]),N=c([]),a=S({pageNo:1,pageSize:10,factoryId:"",sn:"",moduleCode:"",node:"",status:""}),d=S({total:0,tableData:[],columns:[{prop:"createTime",label:"releaseTime",width:180},{prop:"moduleName",label:"moduleName"},{prop:"node",label:"node"},{prop:"firmwareName",label:"firmwareName",width:200},{prop:"firmwareVersion",label:"firmwareVersion"},{prop:"firmwareStatus",label:"firmwareStatus",width:120},{prop:"startTime",label:"upgradeTime",width:200},{prop:"spentTimeMills",label:"upgradeTakeTime",width:120,formatter:t=>X.formatDuration(t.spentTimeMills)},{prop:"progress",label:"upgradeProgress",formatter:t=>t.progress?`${t.progress}%`:"-"},{prop:"status",label:"upgradeStatus",width:120},{prop:"reason",label:"failReason",width:120}]});function D(t){i.value=!0,a.factoryId=t.factoryId,a.sn=t.sn,h(t.productKey),T()}const T=()=>{G({sn:a.sn}).then(t=>{N.value=t.data})},h=t=>{H({productKey:t,sn:a.sn}).then(o=>{f.value=o.data,a.moduleCode=f.value[0].moduleCode,u.value=o.data[0].nodes,a.node=u.value[0].seq,p()})},k=t=>{const o=f.value.find(m=>m.moduleCode===t);u.value=o.nodes,a.node=u.value[0].seq,p()};async function p(){const t=await J(a);d.total=t.data.totalElements,d.tableData=t.data.content}function w(){a.pageNo=1,p()}const E=()=>{var t;(t=L.$refs.formRef)==null||t.resetFields(),a.pageNo=1,a.pageSize=10};return V({showModal:D}),(t,o)=>{const m=B,b=O,g=j,U=A,q=K,I=Q;return r(),_(I,{title:"\u56FA\u4EF6\u5347\u7EA7\u65E5\u5FD7",modelValue:l(i),"onUpdate:modelValue":o[5]||(o[5]=e=>$(i)?i.value=e:null),width:"72%","align-center":!0,"append-to-body":"",class:"upgradeLogList_dialog",onClosed:E},{default:s(()=>[n(q,{ref:"formRef",model:l(a),inline:!0},{default:s(()=>[n(g,{label:"\u6A21\u7EC4",prop:"moduleCode"},{default:s(()=>[n(b,{modelValue:l(a).moduleCode,"onUpdate:modelValue":o[0]||(o[0]=e=>l(a).moduleCode=e),onChange:k,teleported:!1},{default:s(()=>[(r(!0),v(y,null,C(l(f),e=>(r(),_(m,{key:e.moduleCode,label:`${e.moduleName}(${e.cardName})`,value:e.moduleCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(g,{label:"node",prop:"node"},{default:s(()=>[n(b,{modelValue:l(a).node,"onUpdate:modelValue":o[1]||(o[1]=e=>l(a).node=e),onChange:w,teleported:!1},{default:s(()=>[(r(!0),v(y,null,C(l(u),e=>(r(),_(m,{key:e.seq,label:e.seq,value:e.seq},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(g,{label:"\u5347\u7EA7\u72B6\u6001",prop:"status"},{default:s(()=>[n(b,{modelValue:l(a).status,"onUpdate:modelValue":o[2]||(o[2]=e=>l(a).status=e),onChange:w,clearable:"",teleported:!1},{default:s(()=>[(r(!0),v(y,null,C(l(N),e=>(r(),_(m,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(g,null,{default:s(()=>[n(U,{type:"primary",onClick:p},{default:s(()=>[x(M(t.$t("query")),1)]),_:1})]),_:1})]),_:1},8,["model"]),n(l(R),{class:"f-h",tableWrapId:"alarmPushDialog",columns:l(d).columns,tableData:l(d).tableData,total:l(d).total,pageNum:l(a).pageNo,"onUpdate:pageNum":o[3]||(o[3]=e=>l(a).pageNo=e),pageSize:l(a).pageSize,"onUpdate:pageSize":o[4]||(o[4]=e=>l(a).pageSize=e),onPagination:p},null,8,["columns","tableData","total","pageNum","pageSize"])]),_:1},8,["modelValue"])}}});export{le as default};
