import{c as a,g as t,v as e,x as s,z as l,A as r,y as c,e as i,D as o,b5 as n}from"./base-lib.js?v=1761009159";import{_ as u}from"./utils-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const v={class:"file-transfer-progress"},p={class:"transfer-content"},d={class:"transfer-paths"},m={class:"path-item"},f={class:"path-value"},g={class:"path-item"},_={class:"path-value"},h={class:"path-item"},D=["title"],x={class:"progress-section"},b={class:"progress-info"},y={class:"progress-percentage"},k={key:0,class:"text-tertiary text-small mt-[1rem]"},w={class:"transfer-stats"},j={class:"stat-left"},L={class:"stat-item total"},M={class:"stat-value"},F={class:"stat-right"},N={class:"stat-item success"},z={class:"stat-value"},A={class:"stat-item error"},H={class:"stat-value"},I={class:"stat-item remaining"},O={class:"stat-value"},S={key:1,class:"transfer-details"},q={class:"detail-item"},B=u(a({__name:"index",props:{compData:{default:()=>({target_path:"",target_node:{name:""},source_node:{name:""},file_count:0,file_complete:0,file_error:0,progress:0,fileList:[]})}},setup(a){const u=a,B=t(()=>{const a=u.compData.value.progress||0;if("number"!=typeof a||isNaN(a))return 0;if(0===a)return 0;const t=a.toString(),e=t.indexOf(".");if(-1===e||a%1==0)return a;const s=t.substring(e+1);let l=0;for(;l<s.length&&"0"===s[l];)l++;const r=l+2;return parseFloat(a.toFixed(r))}),C=t(()=>Math.max(0,u.compData.value.file_count-u.compData.value.file_complete-u.compData.value.file_error)),E=t(()=>{var a;for(let t=0;t<(null==(a=u.compData.value.fileList)?void 0:a.length);t++)if("pending"===u.compData.value.fileList[t].status)return u.compData.value.fileList[t].target_path;return""}),G=t(()=>0===u.compData.value.file_count?"waiting":0===C.value?"completed":u.compData.value.file_error>0&&0===C.value?"error":"transferring"),J=t(()=>"transferring"===G.value),K=t(()=>{switch(G.value){case"completed":return u.compData.value.file_error>0?"warning":"success";case"error":return"exception";default:return}}),P=t(()=>{if(!J.value||0===u.compData.value.file_complete)return"计算中...";const a=2*C.value;return a<60?"".concat(a,"秒"):a<3600?"".concat(Math.round(a/60),"分钟"):"".concat(Math.round(a/3600),"小时")});return(a,t)=>{var G,Q;const R=n;return e(),s("div",v,[l("div",p,[l("div",d,[l("div",m,[t[0]||(t[0]=l("div",{class:"path-label"},"源节点:",-1)),l("div",f,r((null==(G=u.compData.value.source_node)?void 0:G.name)||"未指定"),1)]),l("div",g,[t[1]||(t[1]=l("div",{class:"path-label"},"目标节点:",-1)),l("div",_,r((null==(Q=u.compData.value.target_node)?void 0:Q.name)||"未指定"),1)]),l("div",h,[t[2]||(t[2]=l("div",{class:"path-label"},"目标路径:",-1)),l("div",{class:"path-value",title:u.compData.value.target_path},r(u.compData.value.target_path||"未指定"),9,D)])]),l("div",x,[l("div",b,[t[3]||(t[3]=l("span",{class:"progress-text"},"传输进度",-1)),l("span",y,r(c(B))+"%",1)]),i(R,{percentage:c(B),status:c(K),"stroke-width":8,"show-text":!1,color:"var(--el-color-primary)"},null,8,["percentage","status"])]),c(E)?(e(),s("div",k,"正在传输："+r(c(E)),1)):o("",!0),l("div",w,[l("div",j,[l("div",L,[t[4]||(t[4]=l("div",{class:"stat-label"},"总计",-1)),l("div",M,r(u.compData.value.file_count),1)])]),l("div",F,[l("div",N,[t[5]||(t[5]=l("span",{class:"text-success mr-[0.5rem] svgtofont-el-circle-check"},null,-1)),t[6]||(t[6]=l("div",{class:"stat-label text-success"},"已完成",-1)),l("div",z,r(u.compData.value.file_complete),1)]),l("div",A,[t[7]||(t[7]=l("span",{class:"text-dangerDark mr-[0.5rem] svgtofont-el-circle-close"},null,-1)),t[8]||(t[8]=l("div",{class:"stat-label text-dangerDark"},"失败",-1)),l("div",H,r(u.compData.value.file_error),1)]),l("div",I,[t[9]||(t[9]=l("span",{class:"text-secondary mr-[0.5rem] svgtofont-icon-login-time"},null,-1)),t[10]||(t[10]=l("div",{class:"stat-label text-secondary"},"剩余",-1)),l("div",O,r(c(C)),1)])])]),c(J)?(e(),s("div",S,[l("div",q,[l("span",null,"预计剩余时间: "+r(c(P)),1)])])):o("",!0)])])}}}),[["__scopeId","data-v-018aad82"]]);export{B as default};
