|
@@ -59,10 +59,12 @@ watch(() => useAppState.getCollapse, (Collapse) => {
|
|
|
})
|
|
|
|
|
|
//渲染完成
|
|
|
-onMounted(() => {
|
|
|
- getClassIfyList()
|
|
|
- updateArchiveprogress()
|
|
|
- Verification()
|
|
|
+onMounted(async () => {
|
|
|
+ getClassIfyList().then()
|
|
|
+ await updateArchiveprogress()
|
|
|
+ if (count.value < 100) {
|
|
|
+ Verification(false)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
//树加载
|
|
@@ -218,7 +220,7 @@ const updateArchive = async () => {
|
|
|
if (!error && code === 200) {
|
|
|
window.$message?.success(data)
|
|
|
count.value = 0
|
|
|
- Verification()
|
|
|
+ Verification(true)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -239,10 +241,12 @@ const updateArchiveprogress = async () => {
|
|
|
const timer = ref(null)
|
|
|
let count = ref(0) // 倒计时
|
|
|
//循环请求接口
|
|
|
-const Verification = () => {
|
|
|
+const Verification = (tip = true) => {
|
|
|
timer.value = setInterval(() => {
|
|
|
if (count.value == 100) {
|
|
|
- window.$message.success('更新成功')
|
|
|
+ if (tip) {
|
|
|
+ window.$message.success('更新成功')
|
|
|
+ }
|
|
|
clearInterval(timer.value)
|
|
|
} else {
|
|
|
updateArchiveprogress()// 请求数据
|