From 13272e92a6c98daad06aa166a6674bf4dac7cc4b Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期一, 21 十月 2024 11:06:55 +0800
Subject: [PATCH] 问题审核1021

---
 src/views/fysp/check/components/CompProblemAddOrUpd.vue |   70 ++++++++++++++---------------------
 1 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
index 19c20e3..d901b6a 100644
--- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue
+++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -83,7 +83,7 @@
         accept="image/*"
       >
         <el-button type="primary" id="uploadBtnId" style="display: none"></el-button>
-        <el-icon>
+        <el-icon v-show="fileList.length != 3">
           <Plus />
         </el-icon>
       </el-upload>
@@ -109,6 +109,7 @@
       </ArbitraryPhoto>
     </el-dialog>
     <el-dialog
+      title="鍙拌处鍥剧墖"
       width="80%"
       v-model="ledgerPicDialog"
       :before-close="beforeLedgerPicDialogclose"
@@ -141,7 +142,7 @@
       </CompDevicePhono>
     </el-dialog>
     <el-dialog v-model="previewDialogVisible">
-      <img w-full :src="previewDialogImageUrl" alt="棰勮" class="preview-pic"/>
+      <img w-full :src="previewDialogImageUrl" alt="棰勮" class="preview-pic" />
     </el-dialog>
   </div>
 </template>
@@ -153,7 +154,7 @@
 
 import { $fysp } from '@/api/index.js';
 import fileUtil from '@/utils/fileUtils.js';
-import { useCloned } from '@vueuse/core';
+import { get, useCloned } from '@vueuse/core';
 import { ElMessage } from 'element-plus';
 import deviceApi from '@/api/fysp/deviceApi';
 export default {
@@ -241,11 +242,13 @@
   computed: {
     descriptionOptions() {
       const descriptions = [];
+      
       this.problemTypeList.forEach((item) => {
         if (item.typename == this.proType) {
           descriptions.push(item);
         }
       });
+      
       return descriptions;
     },
     problemTypeOptions() {
@@ -258,9 +261,11 @@
       }, []);
     },
     adviseOptions() {
-      var array = this.suggestions.filter((item) => item.adProblemtypeguid == this.currProTypeGuid);
-      console.log('adName', array);
-
+      var problemGuid = this.currProTypeGuid || this.problem.guid;
+      console.log("problemGuid", problemGuid);
+      
+      var array = this.suggestions.filter((item) => item.adProblemtypeguid == problemGuid);
+      console.log("array", array);
       return array;
     }
   },
@@ -311,12 +316,11 @@
         return new Date(x.dlCreateTime) - new Date(y.dlCreateTime); //	闄嶅簭锛屽崌搴忓垯鍙嶄箣
       });
     },
-    getDeviceImgList() {
+    async getDeviceImgList() {
       this.deviceImgObjList = [];
-      this.deviceTopTypes.forEach(e => {
-        
-        const topTypeId = e.id;
-        deviceApi.fetchDevices(this.subtask.sceneId, topTypeId).then((result) => {
+      for (const deviceTopTypeElement of this.deviceTopTypes) {
+        const topTypeId = deviceTopTypeElement.id;
+        await deviceApi.fetchDevices(this.subtask.sceneId, topTypeId).then((result) => {
           // 鏍囧噯鍖栧睘鎬у悕
           for (let i = 0; i < result.data.length; i++) {
             var element = this.convertKeys(result.data[i]);
@@ -356,7 +360,7 @@
               .catch((err) => {});
           }
         });
-      });
+      }
     },
     initOptions() {
       if (this.problem == undefined || this.problem == null) {
@@ -423,10 +427,6 @@
       // 闂寤鸿
       problemApi.getSuggestion().then((res) => {
         this.suggestions = res.data;
-        // 濉厖褰撳墠闂寤鸿
-        this.deepCopyProblem.advise = this.suggestions.filter(
-          (item) => item.adProblemtypeguid == this.deepCopyProblem.guid
-        )[0].adName;
       });
 
       // 闂浣嶇疆
@@ -444,7 +444,7 @@
         this.oldFileList.filter((item) => item.url != file.url);
       }
     },
-    handleLedgerPicPhono() {
+    handleLedgerPicPhono(data) {
       this.beforeLedgerPicDialogclose();
       let isExist = false;
       for (const item of data) {
@@ -461,9 +461,6 @@
         }
         isExist = false;
       }
-    },
-    beforeLedgerPicDialogclose() {
-      this.ledgerPicDialog = false;
     },
     findProTypeByGuid(guid) {
       let result;
@@ -493,11 +490,12 @@
       let currPro = this.findProTypeByGuid(value);
       this.deepCopyProblem.advise = '';
       this.currProTypeGuid = value;
-      this.deepCopyProblem.description = currPro.description;
+      // this.deepCopyProblem.description = currPro.description;
       this.changeProblemname();
       this.deepCopyProblem.advise = '';
 
-      this.deepCopyProblem.advise = this.adviseOptions[0].adName;
+      var adName = this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName;
+      this.deepCopyProblem.advise = adName;
     },
     onProLocationChange(value) {
       this.posList.forEach((item) => {
@@ -624,25 +622,6 @@
         isExist = false;
       }
     },
-    handleLedgerPicPhono(data) {
-      let isExist = false;
-      for (const item of data) {
-        for (const already of this.fileList) {
-          if (item.url == already.url) {
-            isExist = true;
-          }
-        }
-        if (!isExist) {
-          this.fileList.push({
-            url: item.url,
-            name: '1'
-          });
-        }
-        isExist = false;
-      }
-
-      this.beforeAnyPhotoDialogclose();
-    },
     chosePicFromAnyPic() {
       this.anyPhotoDialog = true;
     },
@@ -706,9 +685,13 @@
 .row {
   width: 100%;
 }
-
+::v-deep .el-dialog {
+  --el-dialog-margin-top: 2vh;
+  height: 98vh;
+}
 ::v-deep .el-dialog__body {
   width: 95%;
+  height: 100%;
 }
 ::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail {
   object-fit: cover !important;
@@ -718,4 +701,7 @@
   width: 100%;
   height: 100%;
 }
+::v-deep .el-upload--picture-card {
+  border: 0 !important;
+}
 </style>

--
Gitblit v1.9.3