duy преди 2 години
родител
ревизия
8f68f69609
променени са 1 файла, в които са добавени 22 реда и са изтрити 1 реда
  1. 22 1
      src/views/archives/rolling.vue

+ 22 - 1
src/views/archives/rolling.vue

@@ -257,6 +257,9 @@ const updateArchive = async ()=>{
     updateArchiveLoad.value = false
      if (!error && code === 200) {
         window.$message?.success(data)
+        count.value = 0
+        Verification()
+       
      }
    }
 }
@@ -269,10 +272,28 @@ const updateArchiveprogress = async ()=>{
     })
 
     if (!error && code === 200) {
-        console.log(data)
+        if (data == 100) {
+            count.value = 100
+        }
         propercent.value = data
+      
     } 
 }
+const timer = ref(null)
+let count = ref(0) // 倒计时
+//循环请求接口
+const Verification = () => {
+        timer.value = setInterval(() => {
+            if (count.value == 100) {
+                console.log('停着')
+                clearInterval(timer.value)
+            } else {
+                updateArchiveprogress()// 请求数据 
+            }
+        
+       
+    }, 1000)
+}
 </script>
 
 <style lang="scss" scoped>