From 2c0e07ad097eb692c9909efdc614cc40b8653de2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 01 四月 2020 14:13:36 +0800
Subject: [PATCH] 2020-04-01

---
 src/templates/subtableconfig/index.jsx |   48 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 824c78e..48fb0fa 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -2015,6 +2015,35 @@
   }
 
   /**
+   * @description 鍒涘缓鎸夐挳鎺ュ彛锛堝啓鍏ワ級
+   */
+  btnCreatInterface = () => {
+    const { config } = this.state
+
+    this.menuformRef.handleConfirm().then(res => {
+      this.actionFormRef.handleConfirm().then(result => {
+        if (!['pop', 'exec', 'prompt'].includes(result) || result.funcType || result.intertype !== 'inner' || result.innerFunc ) {
+          notification.warning({
+            top: 92,
+            message: '鎵撳紑鏂瑰紡涓� 寮圭獥锛堣〃鍗曪級銆佹彁绀烘鎴栫洿鎺ユ墽琛岋紝涓斾娇鐢ㄧ郴缁熷嚱鏁版椂锛屾墠鍙互鍒涘缓鎺ュ彛锛�',
+            duration: 10
+          })
+          return
+        }
+        
+        let _menu = {
+          type: 'subtable',
+          MenuID: config.uuid,
+          menuName: res.tabName,
+          menuNo: res.tabNo
+        }
+        
+        this.refs.btnCreatInterface.triggerInInterface(result, config, _menu)
+      })
+    })
+  }
+
+  /**
    * @description 鍒涘缓琛ㄦ牸鎺ュ彛
    */
   tableCreatInterface = () => {
@@ -2039,13 +2068,7 @@
           menuNo: res.tabNo
         }
   
-        this.refs.tableCreatInterface.exec(_menu, _config).then(result => {
-          if (result === 'success') {
-            this.setState({
-              config: _config
-            })
-          }
-        })
+        this.refs.tableCreatInterface.triggerOutInterface(_menu, _config)
       })
     })
   }
@@ -2077,10 +2100,16 @@
   }
 
   render () {
-    const { modaltype, activeKey } = this.state
-    const configAction = this.state.config.action.filter(_action =>
+    const { modaltype, activeKey, config } = this.state
+
+    const configAction = config.action.filter(_action =>
       !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
     )
+
+    let hasbtncrtinter = false
+    if (modaltype === 'actionEdit' && config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.dataresource) {
+      hasbtncrtinter = true
+    }
 
     return (
       <div className="common-table-board">
@@ -2282,6 +2311,7 @@
           maskClosable={false}
           onCancel={this.editModalCancel}
           footer={[
+            hasbtncrtinter ? <CreateInterface key="interface" dict={this.state.dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null,
             modaltype === 'actionEdit' ? <CreateFunc key="create" dict={this.state.dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
             <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['header.cancel']}</Button>,
             <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button>

--
Gitblit v1.8.0