From 30c350ff93af3fcc7dcd9b78eb110212b2d44a49 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 11 二月 2020 08:53:53 +0800
Subject: [PATCH] 2020-02-11

---
 src/templates/formtabconfig/actionform/index.jsx |   71 ++++++++++++++++-------------------
 1 files changed, 33 insertions(+), 38 deletions(-)

diff --git a/src/templates/formtabconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx
index 5e1fbff..95bdf11 100644
--- a/src/templates/formtabconfig/actionform/index.jsx
+++ b/src/templates/formtabconfig/actionform/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
 import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
-import Utils from '@/utils/utils.js'
+// import Utils from '@/utils/utils.js'
 import './index.scss'
 
 const { TextArea } = Input
@@ -19,31 +19,6 @@
     formlist: null,  // 琛ㄥ崟淇℃伅
     openType: null,  // 鎵撳紑鏂瑰紡
     interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮�
-    position: null,  // 鎸夐挳浣嶇疆
-    reqOptionSgl: [{
-      value: 'requiredSgl',
-      text: this.props.dict['header.form.requiredSgl']
-    }],
-    reqOptions: [{
-      value: 'notRequired',
-      text: this.props.dict['header.form.notRequired']
-    }, {
-      value: 'requiredSgl',
-      text: this.props.dict['header.form.requiredSgl']
-    }],
-    reqOptionsMutil: [{
-      value: 'notRequired',
-      text: this.props.dict['header.form.notRequired']
-    }, {
-      value: 'requiredSgl',
-      text: this.props.dict['header.form.requiredSgl']
-    }, {
-      value: 'required',
-      text: this.props.dict['header.form.required']
-    }, {
-      value: 'requiredOnce',
-      text: this.props.dict['header.form.requiredOnce']
-    }],
     insertUpdateOptions: [{
       value: '',
       text: this.props.dict['header.form.empty']
@@ -72,9 +47,9 @@
       })
   
       if (_intertype === 'outer') {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError']
+        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
       } else {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
+        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
       }
     }
 
@@ -97,10 +72,10 @@
             }
           ]
           if (card.btnType === 'cancel') {
-            item.readonly = 'true'
+            item.readonly = true
           }
         } else if (item.key === 'execSuccess' && card.btnType === 'cancel') {
-          item.label = '杩斿洖鍚�'
+          item.label = '鍏抽棴鍚�'
         }
         item.hidden = !_options.includes(item.key)
         return item
@@ -126,14 +101,38 @@
     if (key === 'intertype') {
       let _options = null
       if (value === 'inner') {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
+        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
       } else {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method']
+        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'afterExecSuccess', 'afterExecError']
       }
       this.setState({
         interType: value,
         formlist: this.state.formlist.map(item => {
           item.hidden = !_options.includes(item.key)
+
+          if (item.key === 'interface') {
+            item.readonly = false
+          } else if (item.key === 'sysInterface') {
+            item.initVal = 'false'
+          }
+          return item
+        })
+      })
+    } else if (key === 'sysInterface') {
+      if (value === 'true') {
+        this.props.form.setFieldsValue({
+          interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi
+        })
+      }
+      this.setState({
+        // interType: value,
+        formlist: this.state.formlist.map(item => {
+          if (item.key === 'interface' && value === 'true') {
+            item.readonly = true
+          } else if (item.key === 'interface') {
+            item.readonly = false
+          }
+
           return item
         })
       })
@@ -231,6 +230,7 @@
                   showSearch
                   filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0}
                   getPopupContainer={() => document.getElementById('winter')}
+                  disabled={!!item.readonly}
                 >
                   {item.options.map((option, index) =>
                     <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}>
@@ -291,13 +291,8 @@
           values.id = this.props.card.id
           values.uuid = this.props.card.uuid
           values.verify = this.props.card.verify || null
+          values.btnType = this.props.card.btnType || 'tabFormBtn'
 
-          if (values.OpenType === 'excelIn' || values.OpenType === 'excelOut') {
-            values.position = 'toolbar'
-            values.Ot = 'notRequired'
-          } else if (values.OpenType === 'popview' && !values.linkTab) { // 娌℃湁鍏宠仈鏍囩锛堟柊寤烘椂锛夛紝鍒涘缓鏂版爣绛綢d
-            values.linkTab = Utils.getuuid()
-          }
 
           if (values.innerFunc === '' && values.sql === '') {
             notification.warning({

--
Gitblit v1.8.0