瀏覽代碼

first commit

liuhairui 6 天之前
父節點
當前提交
a3838c0cb0
共有 1 個文件被更改,包括 28 次插入1 次删除
  1. 28 1
      src/view/performance/QualityAssessment/Product.vue

+ 28 - 1
src/view/performance/QualityAssessment/Product.vue

@@ -145,6 +145,7 @@
             <span style="margin-top: 5px; font-size: 10px;">暂无新图</span>
           </div>
         </div>
+        
       </div>
           
     <!-- 输入框区域 -->
@@ -605,10 +606,15 @@ const formatImageUrl = (path) => {
   return formattedUrl
 }
 
-// 点击图片时更新产品信息部分的图片
+// 点击图片时更新产品信息部分的图片和对应的product_content
 const updateProductImage = (imageUrl) => {
   editFormData.new_image_url = imageUrl
   showProductImage.value = true
+  // 查找对应的图片对象,更新product_content到输入框
+  const selectedImage = newImages.value.find(img => img.url === imageUrl)
+  if (selectedImage && selectedImage.product_content) {
+    editFormData.chinese_description = selectedImage.product_content
+  }
   // ElMessage.success('图片已更新到产品信息区域')
 }
 
@@ -736,6 +742,27 @@ const onRowDblClick = async (row) => {
       if (detailResponse.data['产品效果图']) {
         showProductImage.value = true
       }
+      
+      // 获取image数组数据
+      if (detailResponse.image && Array.isArray(detailResponse.image)) {
+        // 清空之前的新图数据
+        newImages.value = []
+        
+        // 遍历image数组,添加到newImages
+        detailResponse.image.forEach(item => {
+          if (item.product_new_img) {
+            newImages.value.push({
+              url: item.product_new_img,
+              product_content: item.product_content || ''
+            })
+          }
+        })
+        
+        // 如果有image数据,默认显示第一个的product_content
+        if (newImages.value.length > 0 && newImages.value[0].product_content) {
+          editFormData.chinese_description = newImages.value[0].product_content
+        }
+      }
     }
     
     // 2. 获取所有模板数据