From 4d08cb2fa0daad4b7593a2b8282466b000194344 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 27 七月 2021 14:29:55 +0800
Subject: [PATCH] 2021-07-27

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   46 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 3a412a3..fb45054 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -302,6 +302,7 @@
 
       let errorMsg = ''
       let _temps = {}
+      let images = []
 
       result.forEach(res => {
         if (res.status && !errorMsg) {
@@ -315,6 +316,7 @@
               status: false
             }
           } else {
+            images = [...images, ..._temp.imgs]
             _temps[res.tempId] = _temp
           }
         } else if (!errorMsg) {
@@ -323,7 +325,38 @@
       })
 
       if (!errorMsg) {
-        this.execPrint(printlist, _temps, formdata)
+        if (images.length > 0) {
+          let errorUrls = []
+          images.forEach(url => {
+            let img = new Image()
+            img.onerror = () => {
+              errorUrls.push(url)
+            }
+            img.src = url
+          })
+
+          setTimeout(() => {
+            if (errorUrls.length > 0) {
+              notification.warning({
+                top: 92,
+                message: '妯℃澘涓浘鐗� ' + errorUrls.join('锛�') + ' 宸插け鏁堬紒',
+                duration: 5
+              })
+              Object.keys(_temps).forEach(key => {
+                _temps[key].config.ReportHeader.Control = _temps[key].config.ReportHeader.Control.map(item => {
+                  if (item.Type === 'image' && errorUrls.includes(item.Value)) {
+                    item.Value = ''
+                  }
+                  return item
+                })
+              })
+            }
+
+            this.execPrint(printlist, _temps, formdata)
+          }, 500)
+        } else {
+          this.execPrint(printlist, _temps, formdata)
+        }
       } else {
         this.execError(errorMsg)
       }
@@ -601,6 +634,7 @@
     let _configparam = ''  // 鎵撳嵃閰嶇疆淇℃伅
     let fields = []        // 妯℃澘涓墍闇�瀛楁
     let nonEFields = []    // 闈炵┖瀛楁
+    let imgs = []
 
     if (!res.ConfigParam) {
       error = '鏈幏鍙栧埌鎵撳嵃妯℃澘淇℃伅锛�'
@@ -614,7 +648,6 @@
       if (!configParam) {
         error = '鎵撳嵃妯℃澘瑙f瀽閿欒锛�'
       } else {
-        
         let control = configParam.elements.map(element => {
           let _field = element.field
 
@@ -661,6 +694,12 @@
             item.ImageWidth = element.imgWidth
             item.ImageHeight = element.imgHeight
             item.Trimming = ''
+            if (element.productValue && window.GLOB.systemType === 'production') {
+              item.Value = element.productValue
+              imgs.push(item.Value)
+            } else if (item.Value) {
+              imgs.push(item.Value)
+            }
           } else if (item.Type === 'text') {
             item.FontFamily = element.fontFamily
             item.FontSize = element.fontSize
@@ -721,7 +760,8 @@
       error: error,
       config: _configparam,
       fields: fields,
-      nonEFields: nonEFields
+      nonEFields: nonEFields,
+      imgs: imgs
     }
   }
 

--
Gitblit v1.8.0