From 1a176e4bdba485301385caac1a29102e598d25cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 13 五月 2025 11:32:02 +0800
Subject: [PATCH] 2025-05-13

---
 src/menu/components/form/formaction/actionform/index.jsx |  104 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 65 insertions(+), 39 deletions(-)

diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx
index 69ca082..7514e22 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 {
@@ -52,15 +54,29 @@
 
     if (this.record.type === 'prev') {
       shows = ['typeName', 'label', 'actionType']
+      if (this.record.actionType === 'close') {
+        shows.push('refreshTab', 'reload')
+      }
     } else if (this.record.type === 'next') {
       shows = ['typeName', 'label', 'actionType']
-    } else if (this.record.type === 'close' || this.record.type === 'reset') {
+      if (this.record.actionType === 'close') {
+        shows.push('refreshTab', 'reload')
+      }
+    } else if (this.record.type === 'close') {
+      shows = ['typeName', 'label', 'refreshTab', 'reload']
+    } else if (this.record.type === 'reset') {
       shows = ['typeName', 'label']
     } else {
-      shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton'] // 閫夐」鍒楄〃
+      shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton', 'refreshTab'] // 閫夐」鍒楄〃
 
       if (this.record.execSuccess === 'never') {
         shows.push('resetForms')
+      }
+      if (this.record.refreshTab && this.record.refreshTab.length) {
+        shows.push('urlPar')
+      }
+      if (this.record.syncComponent && this.record.syncComponent[0]) {
+        shows.push('syncDelay')
       }
       if (this.record.intertype === 'custom') {
         shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify', 'ContentType', 'outerBlacklist')
@@ -102,6 +118,13 @@
         shows.push('innerFunc')
       } else {
         shows.push('sql', 'sqlType')
+        // 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') {
@@ -164,11 +187,19 @@
 
   getFields() {
     const { getFieldDecorator } = this.props.form
-    const { interType, callbackType } = this.state
     const fields = []
 
     this.state.formlist.forEach((item, index) => {
       if (item.hidden || item.forbid) return
+
+      let label = item.label
+      if (item.tooltip) {
+        if (item.toolWidth) {
+          label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip>
+        } else {
+          label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip>
+        }
+      }
 
       if (item.type === 'text') {
         let _rules = []
@@ -191,7 +222,7 @@
             message: formRule.func.maxMessage
           }]
         } else if (item.key === 'output') {
-          if (interType === 'system' || ((interType === 'outer' || interType === 'custom') && callbackType === 'script')) {
+          if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) {
             _rules = [{
               pattern: /^@[0-9a-zA-Z_]+@?$/,
               message: '鍙橀噺浠绗﹀紑澶达紝鍙娇鐢ㄥ瓧姣嶃�佹暟瀛椾互鍙奯'
@@ -216,12 +247,7 @@
         }
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item label={item.tooltip ?
-              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                {item.label}
-              </Tooltip> : item.label
-            }>
+            <Form.Item label={label}>
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal || '',
                 rules: [
@@ -238,7 +264,7 @@
       } else if (item.type === 'tip') {
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item label={item.label}>
+            <Form.Item label={label}>
               {item.initVal}
             </Form.Item>
           </Col>
@@ -246,12 +272,7 @@
       } else if (item.type === 'number') {
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item label={item.tooltip ?
-              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                {item.label}
-              </Tooltip> : item.label
-            }>
+            <Form.Item label={label}>
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal,
                 rules: [
@@ -260,19 +281,14 @@
                     message: '璇疯緭鍏�' + item.label + '!'
                   }
                 ]
-              })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)}
+              })(<InputNumber min={0} max={10000} placeholder={item.placeholder || ''} precision={0} onPressEnter={this.handleSubmit}/>)}
             </Form.Item>
           </Col>
         )
       } else if (item.type === 'select') { // 涓嬫媺鎼滅储
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item help={item.help || null} label={item.tooltip ?
-              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                {item.label}
-              </Tooltip> : item.label
-            }>
+            <Form.Item help={item.help || null} label={label}>
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal || '',
                 rules: [
@@ -303,12 +319,7 @@
       } else if (item.type === 'radio') {
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item label={item.tooltip ?
-              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                {item.label}
-              </Tooltip> : item.label
-            }>
+            <Form.Item label={label}>
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal,
                 rules: [
@@ -334,7 +345,7 @@
       } else if (item.type === 'textarea') {
         fields.push(
           <Col span={24} key={index}>
-            <Form.Item label={item.label} className="textarea">
+            <Form.Item label={label} className="textarea">
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal,
                 rules: [
@@ -350,12 +361,7 @@
       } else if (item.type === 'cascader') {
         fields.push(
           <Col span={12} key={index}>
-            <Form.Item label={item.tooltip ?
-              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                {item.label}
-              </Tooltip> : item.label
-            }>
+            <Form.Item label={label}>
               {getFieldDecorator(item.key, {
                 initialValue: item.initVal || [],
                 rules: [
@@ -367,6 +373,22 @@
               })(
                 <Cascader onChange={(value) => {this.optionChange(item.key, value)}} options={item.options || []} expandTrigger="hover" placeholder=""/>
               )}
+            </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>
         )
@@ -383,8 +405,12 @@
           if (values.outerBlacklist) {
             values.outerBlacklist = values.outerBlacklist.replace(/\s/ig, '')
           }
-          if (values.resetForms && values.resetForms.length === 0) {
-            values.resetForms = null
+          if (values.resetForms) {
+            if (values.resetForms.length === 0) {
+              values.resetForms = null
+            } else {
+              values.returnValue = 'true'
+            }
           }
           resolve(values)
         } else {

--
Gitblit v1.8.0