From 6ffa9ed530f4b04af6b8dfc58cd526d53e7c9c1a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 16 四月 2025 11:32:13 +0800
Subject: [PATCH] 2025-04-16

---
 src/menu/components/form/formaction/formconfig.jsx       |   25 ++++++++++++
 src/menu/components/form/formaction/actionform/index.jsx |   22 +++++++++++
 src/tabviews/zshare/actionList/normalbutton/index.jsx    |   66 ++++++++++++++++++++++++---------
 3 files changed, 94 insertions(+), 19 deletions(-)

diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx
index 2f9e22f..92c414f 100644
--- a/src/menu/components/form/formaction/actionform/index.jsx
+++ b/src/menu/components/form/formaction/actionform/index.jsx
@@ -4,8 +4,10 @@
 import { QuestionCircleOutlined } from '@ant-design/icons'
 import { formRule } from '@/utils/option.js'
 
+import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
+const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable'))
 const { TextArea } = Input
 
 class ActionForm extends Component {
@@ -111,6 +113,10 @@
         // if (this.record.execSuccess === 'never' && this.record.resetForms && this.record.resetForms[0]) {
         //   shows.push('returnValue')
         // }
+      }
+
+      if (this.record.syncComponent && this.record.syncComponent[0] === 'multiComponent') {
+        shows.push('syncComponents')
       }
       
       if (this.record.linkmenu && this.record.linkmenu !== 'goback') {
@@ -362,6 +368,22 @@
             </Form.Item>
           </Col>
         )
+      } else if (item.type === 'table') {
+        fields.push(
+          <Col span={24} key={index}>
+            <Form.Item label={label} className="textarea">
+              {getFieldDecorator(item.key, {
+                initialValue: item.initVal,
+                rules: [
+                  {
+                    required: item.required,
+                    message: '璇锋坊鍔�' + item.label + '!'
+                  }
+                ]
+              })(<MKTable columns={item.columns || []} actions={item.actions}/>)}
+            </Form.Item>
+          </Col>
+        )
       }
     })
     return fields
diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx
index 776f233..0e752a5 100644
--- a/src/menu/components/form/formaction/formconfig.jsx
+++ b/src/menu/components/form/formaction/formconfig.jsx
@@ -509,7 +509,8 @@
       initVal: card.syncComponent,
       tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夐渶瑕佸埛鏂扮殑缁勪欢銆傛敞锛氶�夋嫨褰撳墠缁勪欢鐨勪笂绾х粍浠舵棤鏁堬紝鍒锋柊涓婄骇缁勪欢璇烽�夋嫨鎴愬姛鍚庘�滃埛鏂颁笂绾х粍浠� - 琛屸�濄��',
       required: false,
-      options: modules
+      options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : []
+      // options: modules
     },
     {
       type: 'number',
@@ -577,6 +578,28 @@
         value: 'true',
         text: '鍒锋柊'
       }]
+    },
+    {
+      type: 'table',
+      key: 'syncComponents',
+      label: '缁勪欢鍒楄〃',
+      initVal: card.syncComponents || [],
+      required: true,
+      actions: ['edit', 'del', 'add', 'move'],
+      columns: [
+        {
+          title: '缁勪欢',
+          dataIndex: 'syncComId',
+          inputType: 'cascader',
+          editable: true,
+          unique: true,
+          required: true,
+          extends: [{key: 'label', value: 'label'}],
+          width: '70%',
+          render: (text, record) => record.label,
+          options: modules
+        }
+      ]
     }
   ]
 }
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index fcd5a10..31fa58c 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -3041,15 +3041,30 @@
     
     if (btn.syncComponentId) {
       if (btn.syncComponentId === 'multiComponent') {
-        btn.syncComponentIds.forEach((id, i) => {
-          setTimeout(() => {
-            if (/\$focus/.test(id)) {
-              MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
-            } else {
-              MKEmitter.emit('reloadData', id)
-            }
-          }, 20 * i)
-        })
+        if (btn.syncDelay) {
+          this.delayTimer && clearTimeout(this.delayTimer)
+          this.delayTimer = setTimeout(() => {
+            btn.syncComponentIds.forEach((id, i) => {
+              setTimeout(() => {
+                if (/\$focus/.test(id)) {
+                  MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
+                } else {
+                  MKEmitter.emit('reloadData', id)
+                }
+              }, 20 * i)
+            })
+          }, btn.syncDelay)
+        } else {
+          btn.syncComponentIds.forEach((id, i) => {
+            setTimeout(() => {
+              if (/\$focus/.test(id)) {
+                MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
+              } else {
+                MKEmitter.emit('reloadData', id)
+              }
+            }, 20 * i)
+          })
+        }
       } else if (/\$focus/.test(btn.syncComponentId)) {
         MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1])
       } else {
@@ -3812,15 +3827,30 @@
 
       if (btn.syncComponentId) {
         if (btn.syncComponentId === 'multiComponent') {
-          btn.syncComponentIds.forEach((id, i) => {
-            setTimeout(() => {
-              if (/\$focus/.test(id)) {
-                MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
-              } else {
-                MKEmitter.emit('reloadData', id)
-              }
-            }, 20 * i)
-          })
+          if (btn.syncDelay) {
+            this.delayTimer && clearTimeout(this.delayTimer)
+            this.delayTimer = setTimeout(() => {
+              btn.syncComponentIds.forEach((id, i) => {
+                setTimeout(() => {
+                  if (/\$focus/.test(id)) {
+                    MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
+                  } else {
+                    MKEmitter.emit('reloadData', id)
+                  }
+                }, 20 * i)
+              })
+            }, btn.syncDelay)
+          } else {
+            btn.syncComponentIds.forEach((id, i) => {
+              setTimeout(() => {
+                if (/\$focus/.test(id)) {
+                  MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
+                } else {
+                  MKEmitter.emit('reloadData', id)
+                }
+              }, 20 * i)
+            })
+          }
         } else if (/\$focus/.test(btn.syncComponentId)) {
           MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1])
         } else {

--
Gitblit v1.8.0