/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{reactive as e,watch as t,computed as r,onMounted as s,onActivated as o,onDeactivated as a,openBlock as n,createElementBlock as c,createElementVNode as u,normalizeStyle as l,toDisplayString as i,createCommentVNode as d}from"vue";import './index2.css';import './index.css';/* empty css          *//* empty css          */import p from"../../_virtual/_plugin-vue_export-helper.js";const w={class:"flex items-center"},v={class:"gsc-progress-wrapper",style:{width:"100px"}},I={class:"gsc-progress"},f=/* @__PURE__ */p({__name:"index",props:{row:Object,refresh:Function},setup(p){const f=p,h=e({percent:0,status:"normal",downloadStatus:f.row.statusName,showInfo:!0,currentDownloadCount:0}),m=(e=!0)=>{switch(h.downloadStatus){case"Success":h.percent=100,h.status="active",h.showInfo=!1;break;case"Error":h.percent=100,h.status="exception",h.showInfo=!0;break;case"Initialize":h.percent=5,h.status="normal",h.showInfo=!1;break;case"Interrupt":h.percent=100,h.status="exception",h.showInfo=!1;break;case"Inprogress":e&&(h.percent=0,h.status="normal",h.showInfo=!1)}};let g;const x=()=>{clearInterval(Number(g)),g=null},S=()=>{"Inprogress"===h.downloadStatus||"Initialize"===h.downloadStatus?f.refresh(f.row).then(e=>{if(0!==e.total&&0!==e.counter){const t=e.counter/e.total;if(e.counter<h.currentDownloadCount)return;h.currentDownloadCount=e.counter,h.percent=Number.parseFloat((100*t).toFixed(1))}else h.percent=0;h.downloadStatus=e.status,m(!1)}):(h.currentDownloadCount=0,x())};t(()=>f?.row?.id,()=>{h.downloadStatus=f.row.statusName,m(!0)});const b=r(()=>{switch(h.downloadStatus){case"Initialize":return"Waiting";case"Inprogress":return`${h.percent}%`;case"Error":return"";default:return h.downloadStatus}}),F=r(()=>{switch(h.downloadStatus){case"Success":return"#52C41A";case"Error":case"Interrupt":case"Timeout":return"#F5232D";case"Initialize":return"#91D5FF";default:return"#1990FF"}});return s(()=>{m(!0),g=setInterval(()=>{S()},3e3)}),o(()=>{g=setInterval(()=>{S()},3e3)}),a(()=>{x()}),(e,t)=>(n(),c("div",w,[u("div",v,[u("div",I,[u("div",{class:"gsc-progress-bar",style:l({width:`${h.percent}%`,backgroundColor:F.value})},null,4)]),h.showInfo?(n(),c("div",{key:0,class:"gsc-progress-text",style:l({color:F.value})},i(h.percent)+"% ",5)):d("",!0)]),u("div",{style:l([{"margin-left":"10px"},{width:b.value?"125px":"0px"}])},i(b.value),5)]))}},[["__scopeId","data-v-4a7cfcde"]]);export{f as default};