/*!
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
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index2.css');require('./index.css');const e=require("vue");/* empty css             */;/* empty css            */const t=require("../../_virtual/_plugin-vue_export-helper.js"),r={class:"flex items-center"},o={class:"gsc-progress-wrapper",style:{width:"100px"}},s={class:"gsc-progress"},n={__name:"index",props:{row:Object,refresh:Function},setup(t){const n=t,a=e.reactive({percent:0,status:"normal",downloadStatus:n.row.statusName,showInfo:!0,currentDownloadCount:0}),c=(e=!0)=>{switch(a.downloadStatus){case"Success":a.percent=100,a.status="active",a.showInfo=!1;break;case"Error":a.percent=100,a.status="exception",a.showInfo=!0;break;case"Initialize":a.percent=5,a.status="normal",a.showInfo=!1;break;case"Interrupt":a.percent=100,a.status="exception",a.showInfo=!1;break;case"Inprogress":e&&(a.percent=0,a.status="normal",a.showInfo=!1)}};let l;const u=()=>{clearInterval(Number(l)),l=null},i=()=>{"Inprogress"===a.downloadStatus||"Initialize"===a.downloadStatus?n.refresh(n.row).then(e=>{if(0!==e.total&&0!==e.counter){const t=e.counter/e.total;if(e.counter<a.currentDownloadCount)return;a.currentDownloadCount=e.counter,a.percent=Number.parseFloat((100*t).toFixed(1))}else a.percent=0;a.downloadStatus=e.status,c(!1)}):(a.currentDownloadCount=0,u())};e.watch(()=>n?.row?.id,()=>{a.downloadStatus=n.row.statusName,c(!0)});const d=e.computed(()=>{switch(a.downloadStatus){case"Initialize":return"Waiting";case"Inprogress":return`${a.percent}%`;case"Error":return"";default:return a.downloadStatus}}),p=e.computed(()=>{switch(a.downloadStatus){case"Success":return"#52C41A";case"Error":case"Interrupt":case"Timeout":return"#F5232D";case"Initialize":return"#91D5FF";default:return"#1990FF"}});return e.onMounted(()=>{c(!0),l=setInterval(()=>{i()},3e3)}),e.onActivated(()=>{l=setInterval(()=>{i()},3e3)}),e.onDeactivated(()=>{u()}),(t,n)=>(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("div",o,[e.createElementVNode("div",s,[e.createElementVNode("div",{class:"gsc-progress-bar",style:e.normalizeStyle({width:`${a.percent}%`,backgroundColor:p.value})},null,4)]),a.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gsc-progress-text",style:e.normalizeStyle({color:p.value})},e.toDisplayString(a.percent)+"% ",5)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{style:e.normalizeStyle([{"margin-left":"10px"},{width:d.value?"125px":"0px"}])},e.toDisplayString(d.value),5)]))}},a=t.default(n,[["__scopeId","data-v-4a7cfcde"]]);exports.default=a;