瀏覽代碼

更新立卷修改

duy 2 年之前
父節點
當前提交
23b61c0439
共有 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>