From f9697383bc9097be8a444558e09ae21b27f1e831 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 31 十二月 2019 09:27:21 +0800
Subject: [PATCH] 2019-12-31

---
 src/templates/subtableconfig/actionform/index.jsx |   95 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 75 insertions(+), 20 deletions(-)

diff --git a/src/templates/subtableconfig/actionform/index.jsx b/src/templates/subtableconfig/actionform/index.jsx
index 8745257..0b431b9 100644
--- a/src/templates/subtableconfig/actionform/index.jsx
+++ b/src/templates/subtableconfig/actionform/index.jsx
@@ -8,9 +8,10 @@
 
 class MainSearch extends Component {
   static propTpyes = {
-    dict: PropTypes.object, // 瀛楀吀椤�
-    formlist: PropTypes.any,
-    card: PropTypes.any
+    dict: PropTypes.object,  // 瀛楀吀椤�
+    formlist: PropTypes.any, // 琛ㄥ崟淇℃伅
+    card: PropTypes.any,     // 鎸夐挳淇℃伅
+    tabs: PropTypes.array    // 鎵�鏈夋爣绛鹃〉
   }
 
   state = {
@@ -20,40 +21,40 @@
     interType: null,
     position: null,
     reqOptionSgl: [{
-      MenuID: 'requiredSgl',
+      value: 'requiredSgl',
       text: this.props.dict['header.form.requiredSgl']
     }],
     reqOptionsMutil: [{
-      MenuID: 'notRequired',
+      value: 'notRequired',
       text: this.props.dict['header.form.notRequired']
     }, {
-      MenuID: 'requiredSgl',
+      value: 'requiredSgl',
       text: this.props.dict['header.form.requiredSgl']
     }, {
-      MenuID: 'required',
+      value: 'required',
       text: this.props.dict['header.form.required']
     }, {
-      MenuID: 'requiredOnce',
+      value: 'requiredOnce',
       text: this.props.dict['header.form.requiredOnce']
     }],
     insertUpdateOptions: [{
-      MenuID: '',
+      value: '',
       text: this.props.dict['header.form.empty']
     }, {
-      MenuID: 'insert',
+      value: 'insert',
       text: this.props.dict['header.form.action.insert']
     }, {
-      MenuID: 'update',
+      value: 'update',
       text: this.props.dict['header.form.action.update']
     }],
     deleteOptions: [{
-      MenuID: '',
+      value: '',
       text: this.props.dict['header.form.empty']
     }, {
-      MenuID: 'LogicDelete',
+      value: 'LogicDelete',
       text: this.props.dict['header.form.action.LogicDelete']
     }, {
-      MenuID: 'delete',
+      value: 'delete',
       text: this.props.dict['header.form.action.delete']
     }]
   }
@@ -64,6 +65,8 @@
     let _intertype = ''
     let _position = ''
     let _errorType = ''
+    let _tabType = ''
+    let _linkTab = ''
     let _options = null
 
     this.props.formlist.forEach(form => {
@@ -75,10 +78,19 @@
         _position = form.initVal
       } else if (form.key === 'errorTip') {
         _errorType = form.initVal
+      } else if (form.key === 'tabType') {
+        _tabType = form.initVal
+      } else if (form.key === 'linkTab') {
+        _linkTab = form.initVal
       }
     })
 
-    if (_opentype === 'excelIn' || _opentype === 'excelOut') {
+    let _tabs = this.props.tabs.filter(tab => tab.type === _tabType)
+    let initTab = _tabs.filter(tab => tab.uuid === _linkTab)[0]
+
+    if (_opentype === 'popview') {
+      _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose']
+    } else if (_opentype === 'excelIn' || _opentype === 'excelOut') {
       if (_intertype === 'outer') {
         _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method']
       } else {
@@ -109,6 +121,17 @@
           } else {
             item.options = this.state.insertUpdateOptions
           }
+        } else if (item.key === 'linkTab') {
+          item.options = [
+            {
+              value: '',
+              text: '鏂板缓'
+            },
+            ..._tabs
+          ]
+          if (!initTab) {
+            item.initVal = ''
+          }
         }
         item.hidden = !_options.includes(item.key)
         return item
@@ -120,7 +143,10 @@
   openTypeChange = (key, value) => {
     if (key === 'OpenType') {
       let _options = null
-      if (value === 'excelIn' || value === 'excelOut') {
+
+      if (value === 'popview') {
+        _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose']
+      } else if (value === 'excelIn' || value === 'excelOut') {
         if (this.state.interType === 'outer') {
           _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method']
         } else {
@@ -133,6 +159,7 @@
           _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method']
         }
       }
+      
       this.setState({
         openType: value,
         formlist: this.state.formlist.map(item => {
@@ -205,6 +232,34 @@
     } else if (key === 'errorTip') {
       this.setState({
         errorType: value
+      })
+    } else if (key === 'tabType') {
+      let _tabs = this.props.tabs.filter(tab => tab.type === value)
+
+      this.setState({
+        formlist: this.state.formlist.map(item => {
+          if (item.key === 'linkTab') {
+            item.options = [
+              {
+                value: '',
+                text: '鏂板缓'
+              },
+              ..._tabs
+            ]
+            item.initVal = ''
+            item.hidden = true
+          }
+          return item
+        })
+      }, () => {
+        this.setState({
+          formlist: this.state.formlist.map(item => {
+            if (item.key === 'linkTab') {
+              item.hidden = false
+            }
+            return item
+          })
+        })
       })
     }
   }
@@ -341,9 +396,9 @@
                   onChange={(value) => {this.openTypeChange(item.key, value)}}
                   getPopupContainer={() => document.getElementById('winter')}
                 >
-                  {item.options.map(option =>
-                    <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}>
-                      {item.key === 'icon' && option.MenuID && <Icon type={option.MenuID} />} {option.text}
+                  {item.options.map((option, index) =>
+                    <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}>
+                      {item.key === 'icon' && option.value && <Icon type={option.value} />} {option.text}
                     </Select.Option>
                   )}
                 </Select>
@@ -369,7 +424,7 @@
                   {
                     item.options.map(option => {
                       return (
-                        <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio>
+                        <Radio key={option.value} value={option.value}>{option.text}</Radio>
                       )
                     })
                   }

--
Gitblit v1.8.0