From 076c2b693da1d42cf3a468c0f3d631c1ed424285 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 08 十一月 2023 18:22:56 +0800
Subject: [PATCH] 2023-11-08

---
 src/menu/components/form/formaction/formconfig.jsx |   78 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 1 deletions(-)

diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx
index e90047a..978be6e 100644
--- a/src/menu/components/form/formaction/formconfig.jsx
+++ b/src/menu/components/form/formaction/formconfig.jsx
@@ -4,7 +4,7 @@
  * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
  */
 
-export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) {
+export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid) {
   const appType = sessionStorage.getItem('appType')
   let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview
   let _type = '鎻愪氦'
@@ -44,6 +44,72 @@
       menulist = []
     }
   }
+
+  let linkButtons = []
+  let filterComponent = (components) => {
+    components.forEach(item => {
+      if (item.type === 'tabs') {
+        item.subtabs.forEach(tab => {
+          filterComponent(tab.components)
+        })
+      } else if (item.type === 'group') {
+        filterComponent(item.components)
+      } else {
+        item.action && item.action.forEach(cell => {
+          if (cell.hidden === 'true' || cell.uuid === uuid) return
+          if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
+  
+          linkButtons.push({
+            value: cell.uuid,
+            label: cell.label + '锛�' + item.name + '锛�'
+          })
+        })
+  
+        if (item.type === 'card' && item.subcards) {
+          item.subcards.forEach(m => {
+            if ((item.subtype === 'datacard' || item.subtype === 'dualdatacard') && m.$cardType !== 'extendCard') return
+            m.elements.forEach(cell => {
+              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return
+              if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
+  
+              linkButtons.push({
+                value: cell.uuid,
+                label: cell.label + '锛�' + item.name + '锛�'
+              })
+            })
+          })
+        } else if (item.type === 'balcony') {
+          item.elements.forEach(cell => {
+            if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return
+            if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
+            
+            linkButtons.push({
+              value: cell.uuid,
+              label: cell.label + '锛�' + item.name + '锛�'
+            })
+          })
+        } else if (item.type === 'form') {
+          item.subcards.forEach(group => {
+            if(group.uuid === uuid) return
+
+            if (item.subcards.length > 1) {
+              linkButtons.push({
+                value: group.uuid,
+                label: group.subButton.label + '锛�' + item.name + '-' + group.setting.title + '锛�'
+              })
+            } else {
+              linkButtons.push({
+                value: group.uuid,
+                label: group.subButton.label + '锛�' + item.name + '锛�'
+              })
+            }
+          })
+        }
+      }
+    })
+  }
+
+  filterComponent(window.GLOB.customMenu.components)
 
   let refresh = []
   if (viewType === 'popview') { // 寮圭獥鏍囩
@@ -400,6 +466,16 @@
       options: anchors
     },
     {
+      type: 'select',
+      key: 'preButton',
+      label: '鍓嶇疆鎸夐挳',
+      tooltip: '褰撳墠鎸夐挳鎵ц鍓嶏紝闇�瑕佹墽琛岀殑鎸夐挳銆�',
+      initVal: card.preButton || '',
+      required: false,
+      allowClear: true,
+      options: linkButtons
+    },
+    {
       type: 'radio',
       key: 'reload',
       label: '涓婁竴椤�',

--
Gitblit v1.8.0