From 461e4fff4b51d067671244eec63b097cd9012b6e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 30 三月 2020 09:25:41 +0800
Subject: [PATCH] 2020-03-30

---
 src/templates/subtableconfig/index.jsx |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 232fcc2..4cb409d 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -30,6 +30,7 @@
 import TransferForm from '@/components/transferform'
 import SourceElement from '@/templates/zshare/dragelement/source'
 import CreateFunc from '@/templates/zshare/createfunc'
+import CreateInterface from '@/templates/zshare/createinterface'
 import Source from './source'
 import './index.scss'
 
@@ -2012,6 +2013,57 @@
     }
   }
 
+  /**
+   * @description 鍒涘缓琛ㄦ牸鎺ュ彛
+   */
+  tableCreatInterface = () => {
+    const { config } = this.state
+
+    this.menuformRef.handleConfirm().then(res => {
+      this.settingRef.handleConfirm().then(setting => {
+
+        if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) {
+          let param = {
+            func: 's_DataSrc_Save',
+            LText: setting.dataresource,
+            MenuID: config.uuid
+          }
+  
+          param.LText = Utils.formatOptions(param.LText)
+          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
+          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+  
+          Api.getLocalConfig(param)
+        }
+
+        if (setting.interType !== 'inner' || setting.innerFunc) {
+          notification.warning({
+            top: 92,
+            message: '鎺ュ彛绫诲瀷涓�-鍐呴儴锛屼笖涓嶅瓨鍦ㄥ唴閮ㄥ嚱鏁版椂锛屾墠鍙互鍒涘缓鎺ュ彛锛�',
+            duration: 10
+          })
+          return
+        }
+  
+        let _config = {...config, setting: setting}
+        let _menu = {
+          type: 'subtable',
+          MenuID: config.uuid,
+          menuName: res.tabName,
+          menuNo: res.tabNo
+        }
+  
+        this.refs.tableCreatInterface.exec(_menu, _config).then(result => {
+          if (result === 'success') {
+            this.setState({
+              config: _config
+            })
+          }
+        })
+      })
+    })
+  }
+
   pasteSubmit = () => {
     this.pasteFormRef.handleConfirm().then(res => {
       if (res.copyType !== 'action') {
@@ -2386,6 +2438,7 @@
             })
           }}
           footer={[
+            <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>,
             <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>,
             <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>,
             <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>

--
Gitblit v1.8.0