|
@@ -103,15 +103,18 @@ const colors = [
|
|
|
{ color: '#1e88e5', percentage: 100 },
|
|
|
]
|
|
|
|
|
|
-onMounted(async ()=>{
|
|
|
+onMounted( ()=>{
|
|
|
if(localStorage.getItem("listData")){
|
|
|
return restoreCache()
|
|
|
}
|
|
|
+ getListData()
|
|
|
+})
|
|
|
+
|
|
|
+async function getListData(){
|
|
|
const res = await getCheckList();
|
|
|
checkList.value = res.data
|
|
|
listData.value = res.data[0].classList
|
|
|
-})
|
|
|
-
|
|
|
+}
|
|
|
|
|
|
function convertTime(milliseconds) {
|
|
|
// 将毫秒转换为秒
|
|
@@ -140,10 +143,15 @@ function getRandomInt(min, max) {
|
|
|
|
|
|
function handleNowCheck(sub){
|
|
|
if(!cLoading.value){
|
|
|
- removeCache()
|
|
|
- cLoading.value = true
|
|
|
+ if(localStorage.getItem("listData")){
|
|
|
+ removeCache()
|
|
|
+ getListData()
|
|
|
+ }
|
|
|
+ cLoading.value = true;
|
|
|
cIndex.value = null;
|
|
|
- checkTime.value = new Date()
|
|
|
+ totalError.value = 0;
|
|
|
+ totalErrorCount.value=0;
|
|
|
+ checkTime.value = new Date();
|
|
|
}
|
|
|
let index = checkList.value.length-sub
|
|
|
currentProgress.value = Number(Number(index / checkList.value.length * 100).toFixed(2))
|
|
@@ -173,6 +181,7 @@ function saveCache(){
|
|
|
function removeCache(){
|
|
|
localStorage.removeItem("listData")
|
|
|
localStorage.removeItem("errorInfo")
|
|
|
+ localStorage.removeItem("checkList")
|
|
|
}
|
|
|
|
|
|
function restoreCache(){
|