From 5d1e5dc9b248f91b33105dc838200af07947cdb2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 04 一月 2022 18:07:40 +0800
Subject: [PATCH] 2022-01-04

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |   78 ++++++++++++++++++++++++++++++++------
 1 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index dce21d6..e9500ee 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -19,7 +19,8 @@
   popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter'],
   tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'],
   innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'],
-  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width']
+  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'],
+  form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'open', 'refreshTab', 'reload', 'title']
 }
 
 class ActionForm extends Component {
@@ -38,13 +39,13 @@
     requireOptions: [],
     insertUpdateOptions: [{
       value: 'insert',
-      text: this.props.dict['header.form.action.insert']
+      text: '娣诲姞'
     }, {
       value: 'update',
-      text: this.props.dict['header.form.action.update']
+      text: '淇敼'
     }, {
       value: 'audit',
-      text: this.props.dict['header.form.action.audit']
+      text: '瀹℃牳'
     }],
     deleteOptions: [{
       value: 'LogicDelete',
@@ -54,7 +55,7 @@
       text: '鐗╃悊鍒犻櫎'
     }, {
       value: 'custom',
-      text: this.props.dict['header.form.custom']
+      text: '鑷畾涔�'
     }],
     interTypeOptions: [{
       value: 'system',
@@ -197,6 +198,43 @@
       } else {
         reOptions.sqlType = this.state.insertUpdateOptions
       }
+    } else if (openType === 'form') {
+      let intertype = this.record.intertype
+
+      if (this.record.formType === 'switch') {
+        shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
+      } else {
+        shows.push('field', 'openVal', 'closeVal')
+      }
+
+      reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom')
+
+      if (intertype === 'outer') {
+        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
+        reRequired.innerFunc = false
+
+        if (this.record.sysInterface === 'false') {
+          reReadonly.interface = false
+          reRequired.interface = true
+        } else {
+          reReadonly.interface = true
+          reRequired.interface = false
+        }
+      } else if (intertype === 'inner') {
+        shows.push('innerFunc')
+        reRequired.innerFunc = true
+      } else {
+        shows.push('sql', 'sqlType')
+      }
+
+      reOptions.Ot = requireOptions
+      reOptions.sqlType = [{
+        value: 'update',
+        text: '淇敼'
+      }, {
+        value: 'custom',
+        text: '鑷畾涔�'
+      }]
     } else if (openType === 'excelIn') {
       reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
       reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -375,6 +413,10 @@
         _fieldval.intertype = 'system'
         _fieldval.sqlType = ''
   
+      } else if (value === 'form') {
+        _fieldval.Ot = 'requiredSgl'
+
+        this.record.Ot = 'requiredSgl'
       } else if (value === 'excelIn') {
         _fieldval.intertype = 'system'
         _fieldval.Ot = 'notRequired'
@@ -446,10 +488,12 @@
       } else if (value === 'update') {
         _fieldval.label = '淇敼'
         _fieldval.Ot = 'requiredSgl'
-        if (hasclass) {
-          _fieldval.class = 'purple'
-        } else {
-          _fieldval.color = 'primary'
+        if (this.record.OpenType !== 'form') {
+          if (hasclass) {
+            _fieldval.class = 'purple'
+          } else {
+            _fieldval.color = 'primary'
+          }
         }
       } else if (value === 'audit') {
         _fieldval.label = '瀹℃牳'
@@ -469,10 +513,10 @@
         }
       }
 
-      this.record.label = _fieldval.label
-      this.record.Ot = _fieldval.Ot
-      this.record.class = _fieldval.class || ''
-      this.record.color = _fieldval.color || ''
+      this.record.label = _fieldval.label || this.record.label || ''
+      this.record.Ot = _fieldval.Ot || this.record.Ot || ''
+      this.record.class = _fieldval.class || this.record.class || ''
+      this.record.color = _fieldval.color || this.record.color || ''
 
       if (appType !== 'mob' && _fieldval.Ot === 'notRequired') {
         this.record.control = ''
@@ -549,6 +593,14 @@
       let content = null
       let initVal = item.initVal || ''
 
+      if (item.type === 'splitLine') {
+        fields.push(
+          <Col span={24} key={index}>
+            <p style={{borderBottom: '1px solid #e9e9e9', color: '#1890ff', textAlign: 'center'}}>{item.label}</p>
+          </Col>
+        )
+        return
+      }
       if (item.type === 'text') {
         rules = [
           { required: item.required, message: dict['form.required.input'] + item.label + '!' }

--
Gitblit v1.8.0