From d28223384922de5fb08c20516eb3f99981c8136a Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 22 十一月 2024 17:37:34 +0800
Subject: [PATCH] 1. 修复上传问题或整改图片后,界面更新错误问题; 2. 优化问题整改界面展示效果; 3. 场景图片对话框添加查看状态下可以点击图片放大功能

---
 src/views/fysp/check/components/CompProblemAddOrUpd.vue |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
index 2f58db3..0ba0cb8 100644
--- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue
+++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -167,9 +167,7 @@
             <el-button type="primary" @click="onSubmit" v-show="!readonly"
               >淇濆瓨</el-button
             >
-            <el-button @click="onCancel" v-show="!readonly"
-              >鍙栨秷</el-button
-            >
+            <el-button @click="onCancel" v-show="!readonly">鍙栨秷</el-button>
           </el-form-item>
         </el-form>
         <ArbitraryPhoto
@@ -214,7 +212,6 @@
   </CompGenericWrapper>
 </template>
 <script>
-import CompGenericWrapper from './CompGenericWrapper.vue';
 import ArbitraryPhoto from './ArbitraryPhoto.vue';
 import CompLedgerPhoto from './CompLedgerPhoto.vue';
 import CompDevicePhoto from './CompDevicePhoto.vue';
@@ -231,8 +228,7 @@
   components: {
     ArbitraryPhoto,
     CompDevicePhoto,
-    CompLedgerPhoto,
-    CompGenericWrapper
+    CompLedgerPhoto
   },
   props: {
     readonly: {
@@ -263,6 +259,8 @@
   },
   data() {
     return {
+      // fixme 2024.11.20 瀛愮粍浠跺垵濮嬪寲鏃舵満闂
+      initPropsCount: 0,
       // 鍒濆棰勮鍥剧墖index
       initialIndex: -1,
       // 鍥剧墖閫夋嫨鏈�澶ф暟閲�
@@ -327,10 +325,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 +387,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;
     },
@@ -561,7 +584,8 @@
       return true;
     },
     onCancel() {
-      this.$emit("cancel")
+      this.$emit('cancel');
+      this.$emit('update:visible', false);
     },
     onSubmit() {
       this.$refs.formRef.validate((valid) => {
@@ -603,9 +627,10 @@
               files.forEach((image) => {
                 data.append('images', image);
               });
-              problemApi.updateProblem(data).then((res) => {});
+              problemApi.updateProblem(data).then((res) => {
+                this.$emit('submit', false);
+              });
             });
-            this.$emit('submit', false);
           } else {
             const deepCopySubTask = useCloned(this.subtask).cloned.value;
             const that = this;
@@ -625,9 +650,10 @@
               files.forEach((image) => {
                 data.append('images', image);
               });
-              problemApi.newProblem(data).then((res) => {});
+              problemApi.newProblem(data).then((res) => {
+                this.$emit('submit', true);
+              });
             });
-            this.$emit('submit', true);
           }
         }
       });

--
Gitblit v1.9.3