From d7932d42a9c4a08376d542dbff8301e7d985b787 Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期三, 20 十一月 2024 17:38:11 +0800
Subject: [PATCH] 问题新增与修改页面初始化逻辑修改

---
 src/views/fysp/check/components/CompProblemAddOrUpd.vue |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
index 2f58db3..940347a 100644
--- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue
+++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -263,6 +263,7 @@
   },
   data() {
     return {
+      initPropsCount: 0,
       // 鍒濆棰勮鍥剧墖index
       initialIndex: -1,
       // 鍥剧墖閫夋嫨鏈�澶ф暟閲�
@@ -327,10 +328,37 @@
       },
       deep: true
     },
+    initPropsCount: {
+      handler(nv, ov) {
+        if (nv >= 3) {
+          this.initOptions();
+        }
+      },
+      immediate: true
+    },
     problem: {
       handler(nv, ov) {
-        this.initOptions();
-      }
+        if (nv != null && nv != undefined) {
+          this.initPropsCount++;
+        }
+      },
+      immediate: true
+    },
+    topTask: {
+      handler(nv, ov) {
+        if (nv != null && nv != undefined) {
+          this.initPropsCount++;
+        }
+      },
+      immediate: true
+    },
+    subtask: {
+      handler(nv, ov) {
+        if (nv != null && nv != undefined) {
+          this.initPropsCount++;
+        }
+      },
+      immediate: true
     }
   },
   computed: {
@@ -362,15 +390,13 @@
       return array;
     }
   },
-  mounted() {
-    this.initOptions();
-  },
+  mounted() {},
   methods: {
     onProAdviseChange(value) {
       this.deepCopyProblem._adviseEdit = this.deepCopyProblem.advice;
     },
     handlePictureCardPreview(uploadFile) {
-      this.initialIndex = this.fileList.indexOf(uploadFile)
+      this.initialIndex = this.fileList.indexOf(uploadFile);
       this.previewDialogVisible = true;
       this.previewDialogImageUrl = uploadFile.url;
     },

--
Gitblit v1.9.3