From 81a5ae579e84d7cfe0cda268d4156d4b78a27454 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 30 十二月 2024 13:46:34 +0800
Subject: [PATCH] 2024-12-30

---
 src/utils/utils-custom.js |   57 ++++++++++++++-------------------------------------------
 1 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 00e48a7..7989e15 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -652,7 +652,7 @@
    */
   static resetBtn (btn, commonId) {
     if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) {
-      if (btn.modal && btn.modal.fields.length > 0) {
+      if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) {
         btn.modal.fields = btn.modal.fields.map(m => {
           m.uuid = this.getuuid()
           return m
@@ -684,6 +684,10 @@
 
         return md5(commonId + m)
       })
+    }
+
+    if (btn.OpenType === 'popview' && btn.config && btn.config.components) {
+      btn.config.components = this.resetConfig(btn.config.components, commonId)
     }
   }
 
@@ -771,14 +775,7 @@
             if (cell.eleType === 'button') {
               cell.uuid = md5(commonId + cell.uuid)
 
-              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
-                if (cell.modal && cell.modal.fields.length > 0) {
-                  cell.modal.fields = cell.modal.fields.map(m => {
-                    m.uuid = this.getuuid()
-                    return m
-                  })
-                }
-              }
+              this.resetBtn(cell, commonId)
             } else {
               cell.uuid = this.getuuid()
             }
@@ -792,14 +789,8 @@
           card.backElements = card.backElements.map(cell => {
             if (cell.eleType === 'button') {
               cell.uuid = md5(commonId + cell.uuid)
-              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
-                if (cell.modal && cell.modal.fields.length > 0) {
-                  cell.modal.fields = cell.modal.fields.map(m => {
-                    m.uuid = this.getuuid()
-                    return m
-                  })
-                }
-              }
+
+              this.resetBtn(cell, commonId)
             } else {
               cell.uuid = this.getuuid()
             }
@@ -818,14 +809,8 @@
         item.elements = item.elements.map(cell => {
           if (cell.eleType === 'button') {
             cell.uuid = md5(commonId + cell.uuid)
-            if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
-              if (cell.modal && cell.modal.fields.length > 0) {
-                cell.modal.fields = cell.modal.fields.map(m => {
-                  m.uuid = this.getuuid()
-                  return m
-                })
-              }
-            }
+
+            this.resetBtn(cell, commonId)
           } else {
             cell.uuid = this.getuuid()
           }
@@ -850,14 +835,7 @@
             col.elements = col.elements.map(cell => {
               cell.uuid = md5(commonId + cell.uuid)
               if (cell.eleType === 'button') {
-                if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
-                  if (cell.modal && cell.modal.fields.length > 0) {
-                    cell.modal.fields = cell.modal.fields.map(m => {
-                      m.uuid = this.getuuid()
-                      return m
-                    })
-                  }
-                }
+                this.resetBtn(cell, commonId)
               }
               return cell
             })
@@ -902,14 +880,7 @@
       }
       item.action = item.action.map(cell => {
         cell.uuid = md5(commonId + cell.uuid)
-        if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
-          if (cell.modal && cell.modal.fields.length > 0) {
-            cell.modal.fields = cell.modal.fields.map(m => {
-              m.uuid = this.getuuid()
-              return m
-            })
-          }
-        }
+        this.resetBtn(cell, commonId)
 
         return cell
       })
@@ -3331,7 +3302,7 @@
           } else if (form.type === 'popSelect') {
             let msg = getPopSelectSql(form)
         
-            sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
+            sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
           }
         })
       }
@@ -3374,7 +3345,7 @@
             } else if (form.type === 'popSelect') {
               let msg = getPopSelectSql(form)
           
-              sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
+              sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
             }
           })
         }

--
Gitblit v1.8.0