From 9798a9fa338ee5d022793ae1ef91a49e2e2b4c62 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 22 十二月 2019 10:10:28 +0800
Subject: [PATCH] 2019-12-22

---
 src/templates/comtableconfig/index.jsx |   63 +++++++++++++++++++++++++++++--
 1 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx
index db0e52a..0c14c97 100644
--- a/src/templates/comtableconfig/index.jsx
+++ b/src/templates/comtableconfig/index.jsx
@@ -2356,7 +2356,7 @@
   /**
    * @description 璁剧疆鍙厤缃寜閽�
    */
-  setSubConfig = (btn) => {
+  setSubConfig = (btn, type) => {
     const { menu } = this.props
     const { config, originMenu } = this.state
 
@@ -2396,7 +2396,7 @@
             message: '鑿滃崟閰嶇疆宸蹭慨鏀癸紝璇蜂繚瀛橈紒',
             duration: 10
           })
-        } else {
+        } else if (type === 'button') {
           this.setState({
             loading: true
           })
@@ -2417,7 +2417,7 @@
                   _LongParam = ''
                 }
               }
-              this.props.handleSubConfig(btn, originMenu, _LongParam)
+              this.props.handleSubConfig(btn, originMenu, _LongParam, type)
             } else {
               this.setState({
                 loading: false
@@ -2429,6 +2429,40 @@
               })
             }
           })
+        } else if (type === 'tab') {
+          this.props.handleSubConfig(btn, originMenu, '', type)
+          // this.setState({
+          //   loading: true
+          // })
+          // Api.getSystemConfig({
+          //   func: 'sPC_Get_LongParam',
+          //   MenuID: btn.uuid
+          // }).then(res => {
+          //   if (res.status) {
+          //     this.setState({
+          //       loading: false
+          //     })
+          //     let _LongParam = ''
+          //     if (res.LongParam) {
+          //       _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
+          //       try {
+          //         _LongParam = JSON.parse(_LongParam)
+          //       } catch (e) {
+          //         _LongParam = ''
+          //       }
+          //     }
+          //     this.props.handleSubConfig(btn, originMenu, _LongParam)
+          //   } else {
+          //     this.setState({
+          //       loading: false
+          //     })
+          //     notification.warning({
+          //       top: 92,
+          //       message: res.message,
+          //       duration: 10
+          //     })
+          //   }
+          // })
         }
       }, () => {
         notification.warning({
@@ -2544,12 +2578,13 @@
                         icon={item.icon}
                         style={{marginBottom: '10px'}}
                         className={'mk-btn mk-' + item.class}
-                        onClick={() => this.setSubConfig(item)}
+                        onClick={() => this.setSubConfig(item, 'button')}
                       >{item.label}</Button>
                     </div>
                   )
                 })}
               </Panel>
+              {/* 娣诲姞鏄剧ず鍒� */}
               <Panel header={this.state.dict['header.menu.column']} key="3">
                 <div className="search-element">
                   {Source.columnItems.map((item, index) => {
@@ -2558,12 +2593,32 @@
                 </div>
                 <Button type="primary" block onClick={() => this.queryField('columns')}>{this.state.dict['header.menu.column.add']}</Button>
               </Panel>
+              {/* 娣诲姞鏍囩 */}
               <Panel header={this.state.dict['header.menu.tab']} key="4">
                 <div className="search-element">
                   {Source.tabItems.map((item, index) => {
                     return (<SourceElement key={index} content={item}/>)
                   })}
                 </div>
+                {this.state.config.tabs.length > 0 ?
+                  <p className="config-btn-title">
+                    <Tooltip placement="topLeft" title="鐐瑰嚮鎸夐挳锛屽彲瀹屾垚鎴栨煡鐪嬫爣绛鹃厤缃俊鎭��">
+                      <Icon type="question-circle" />
+                    </Tooltip>
+                    {this.state.dict['header.menu.tab.configurable']}
+                  </p> : null
+                }
+                {this.state.config.tabs.map((item, index) => {
+                  return (
+                    <div key={index}>
+                      <Button
+                        icon={item.icon}
+                        style={{marginBottom: '10px'}}
+                        onClick={() => this.setSubConfig(item, 'tab')}
+                      >{item.label}</Button>
+                    </div>
+                  )
+                })}
               </Panel>
             </Collapse>
           </div>

--
Gitblit v1.8.0