Selaa lähdekoodia

fix: 添加获取最新报告

拎壶冲 5 kuukautta sitten
vanhempi
commit
c21ec36033
1 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
  1. 8 2
      src/views/hl/check/index.vue

+ 8 - 2
src/views/hl/check/index.vue

@@ -81,7 +81,7 @@
   </div>
 </template>
 <script setup lang="ts">
-import {chkcCheck, listChkc} from "@/api/check/chkc"
+import {chkcCheck, chkcResult, listChkc} from "@/api/check/chkc"
 import {onMounted} from "vue";
 import {Loading} from "@element-plus/icons-vue";
 import nCheckList from "./widget/nCheckList.vue"
@@ -109,11 +109,16 @@ const colors = [
   {color: '#1e88e5', percentage: 100},
 ]
 
+const initData = async () => {
+  await chkcResult(0)
+  getListChkc().then()
+}
+
 onMounted(() => {
   if (localStorage.getItem("listData")) {
     return restoreCache()
   }
-  getListChkc()
+  initData()
 })
 
 const handleDialog = (action) => {
@@ -133,6 +138,7 @@ const handleDialog = (action) => {
 }
 
 const restoreCache = () => {
+  chkcResult(0)
   listData.value = JSON.parse(localStorage.getItem("listData"))
   nowCheck.value = JSON.parse(localStorage.getItem("nowCheck"))
   checkList.value = uniqueByKey(listData.value, 'className')