From 08cf3a75914828199aac95bbf334746c1e62ec70 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 28 Oct 2025 18:54:02 +0800
Subject: [PATCH] feat: 性能优化

---
 src/subPackages/inProgress/index.vue |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/subPackages/inProgress/index.vue b/src/subPackages/inProgress/index.vue
index a23c9b8..93c1705 100644
--- a/src/subPackages/inProgress/index.vue
+++ b/src/subPackages/inProgress/index.vue
@@ -1,15 +1,15 @@
 <template>
-  <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>
+  <WebViewPlus v-if="showComponent" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
 </template>
 
 <script setup>
 import WebViewPlus from "@/components/WebViewPlus.vue";
 import {getWebViewUrl} from "@/utils/index.js";
-import {onLoad} from "@dcloudio/uni-app";
+import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
 
 const wayLineJodInfoId = ref(null)
 const viewUrl = ref('')
-
+const showComponent = ref(false)
 function onPostMessage(data) {
   if (data.type === 'back') {
     uni.switchTab({
@@ -26,6 +26,14 @@
   wayLineJodInfoId.value = options.wayLineJodInfoId
   viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJodInfoId: wayLineJodInfoId.value})
 })
+
+onShow(function () {
+  showComponent.value = true
+})
+
+onHide(() =>{
+  showComponent.value = false
+})
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3