|
@@ -2,12 +2,13 @@
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { useReportStore } from "@/store";
|
|
|
import { storeToRefs } from "pinia";
|
|
|
-import { computed, ref, watch } from "vue";
|
|
|
+import { computed, onMounted, ref, watch } from "vue";
|
|
|
import { SwipeInstance, Swipe, SwipeItem } from "vant";
|
|
|
import TurnPage from "@/views/report/components/TurnPage.vue";
|
|
|
import CoverPage from "@/views/report/components/CoverPage.vue";
|
|
|
import HeaderPart from "@/views/report/components/HeaderPart.vue";
|
|
|
import Screenshot from "@/views/report/components/Screenshot.vue";
|
|
|
+// import Loading from "@/components/Loading.vue";
|
|
|
|
|
|
const { babyId: _babyId, recordId: _recordId, type: _type } = useRoute().query;
|
|
|
|
|
@@ -16,6 +17,7 @@ const reportStore = useReportStore();
|
|
|
const { isSingle, isTeacher, babyId, recordId, babyInfo, totalPage, pageList } = storeToRefs(reportStore);
|
|
|
const { getReport } = reportStore;
|
|
|
|
|
|
+// const loading = ref(false);
|
|
|
const showCover = ref(false);
|
|
|
const currentPage = ref<number>(1);
|
|
|
const swipeRef = ref<SwipeInstance | null>(null);
|
|
@@ -48,8 +50,14 @@ function init() {
|
|
|
isTeacher.value = _type === "1" || _type === "3";
|
|
|
}
|
|
|
|
|
|
-init();
|
|
|
-getReport();
|
|
|
+onMounted(async () => {
|
|
|
+ // loading.value = true;
|
|
|
+ init();
|
|
|
+ await getReport();
|
|
|
+ // setTimeout(() => {
|
|
|
+ // loading.value = false;
|
|
|
+ // }, 1000);
|
|
|
+});
|
|
|
|
|
|
/**
|
|
|
* 封面页:CoverPage
|
|
@@ -84,6 +92,8 @@ getReport();
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
+ <!--<Loading v-if="loading" />-->
|
|
|
+
|
|
|
<CoverPage v-if="showCover" :info="babyInfo" @start="start" />
|
|
|
|
|
|
<div class="report">
|