From e603c97dbe7a4f1dbd6445e00383ed651182e0fe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 03 三月 2020 17:09:11 +0800
Subject: [PATCH] 2020-03-03

---
 src/templates/comtableconfig/index.jsx |  101 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 78 insertions(+), 23 deletions(-)

diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx
index 4710693..7fb6751 100644
--- a/src/templates/comtableconfig/index.jsx
+++ b/src/templates/comtableconfig/index.jsx
@@ -19,6 +19,7 @@
 import TabForm from '@/templates/tableshare/tabform'
 import SearchForm from '@/templates/tableshare/searchform'
 import ColumnForm from '@/templates/tableshare/columnform'
+import PasteForm from '@/templates/tableshare/pasteform'
 import DragElement from '@/templates/tableshare/dragelement'
 import ColspanForm from '@/templates/tableshare/colspanform'
 import GridBtnForm from '@/templates/tableshare/gridbtnform'
@@ -612,9 +613,9 @@
               // 瑙f瀽閰嶇疆锛屼慨鏀规ā鎬佹鏍囬鍚嶇О
               if (result.LongParam) {
                 try {
-                  _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
-                  _LongParam = JSON.parse(_LongParam)
+                  _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
                 } catch (e) {
+                  console.warn('Parse Failure')
                   _LongParam = ''
                 }
               }
@@ -623,6 +624,7 @@
                   _LongParam.setting.title = res.label
                   _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam)))
                 } catch {
+                  console.warn('Stringify Failure')
                   _LongParam = ''
                 }
               } else {
@@ -669,9 +671,9 @@
               // 瑙f瀽閰嶇疆锛屼慨鏀规ā鎬佹鏍囬鍚嶇О
               if (result.LongParam) {
                 try {
-                  _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
-                  _LongParam = JSON.parse(_LongParam)
+                  _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
                 } catch (e) {
+                  console.warn('Parse Failure')
                   _LongParam = ''
                 }
               }
@@ -694,6 +696,7 @@
                   _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam)))
                   _temp = 'FormTab'
                 } catch {
+                  console.warn('Stringify Failure')
                   _LongParam = ''
                 }
               } else {
@@ -874,10 +877,10 @@
           }).then(res => {
             let _LongParam = ''
             if (res.status && res.LongParam) {
-              _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
               try {
-                _LongParam = JSON.parse(_LongParam)
+                _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
               } catch (e) {
+                console.warn('Parse Failure')
                 _LongParam = ''
               }
             }
@@ -1685,9 +1688,9 @@
         
                   if (result.LongParam) {
                     try {
-                      _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
-                      _LongParam = JSON.parse(_LongParam)
+                      _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
                     } catch (e) {
+                      console.warn('Parse Failure')
                       _LongParam = ''
                     }
                   }
@@ -1752,14 +1755,22 @@
         
         let tabParam = { // 娣诲姞鑿滃崟tab椤�
           func: 'sPC_sMenusTab_AddUpt',
-          MenuID: menu.MenuID,
-          LText: _config.tabs.map((item, index) => {
-            return `select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${(index + 1) * 10}' as Sort`
-          })
+          MenuID: menu.MenuID
         }
 
-        tabParam.LText = tabParam.LText.join(' union all ')
-        tabParam.LText = Utils.formatOptions(tabParam.LText)
+        let _LText = []
+        let _index = 1
+
+        _config.tabgroups.forEach(groupId => {
+          _config[groupId].forEach(item => {
+            _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_index * 10}' as Sort`)
+            _index++
+          })
+        })
+
+        _LText = _LText.join(' union all ')
+
+        tabParam.LText = Utils.formatOptions(_LText)
         tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
         tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
   
@@ -1804,6 +1815,7 @@
                 try {
                   _ParentParam = window.btoa(window.encodeURIComponent(JSON.stringify(item.card)))
                 } catch (e) {
+                  console.warn('Stringify Failure')
                   _ParentParam = null
                 }
 
@@ -2027,10 +2039,10 @@
             if (result.LongParam) {
               let _subconfig = ''
               try {
-                _subconfig = window.decodeURIComponent(window.atob(result.LongParam))
-                _subconfig = JSON.parse(_subconfig)
+                _subconfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
                 _temp = _subconfig.type
               } catch (e) {
+                console.warn('Parse Failure')
                 _subconfig = ''
               }
 
@@ -2054,6 +2066,7 @@
                   })
                   _subconfig = window.btoa(window.encodeURIComponent(JSON.stringify(_subconfig)))
                 } catch {
+                  console.warn('Stringify Failure')
                   _subconfig = ''
                 }
 
@@ -2554,10 +2567,10 @@
             })
             let _LongParam = ''
             if (res.LongParam) {
-              _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
               try {
-                _LongParam = JSON.parse(_LongParam)
+                _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
               } catch (e) {
+                console.warn('Parse Failure')
                 _LongParam = ''
               }
             }
@@ -2740,6 +2753,7 @@
             try {
               _conf = JSON.parse(window.decodeURIComponent(window.atob(menu.ParentParam)))
             } catch (e) {
+              console.warn('Parse Failure')
               _conf = ''
             }
           }
@@ -2826,6 +2840,25 @@
       Api.getSystemConfig(_param)
     })
     this.props.handleView()
+  }
+
+  pasteSubmit = () => {
+    this.pasteFormRef.handleConfirm().then(res => {
+      if (res.copyType !== 'action') {
+        notification.warning({
+          top: 92,
+          message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�',
+          duration: 10
+        })
+        return
+      }
+
+      this.setState({
+        modaltype: ''
+      }, () => {
+        this.handleAction(res, 'copy')
+      })
+    })
   }
 
   render () {
@@ -2995,13 +3028,13 @@
                   placeholder={this.state.dict['header.form.search.placeholder']}
                 />
               </div>
-              <div className="action-list">
+              <div className="action-list" id="action-list">
                 <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃寜閽�嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬寜閽嫋鑷虫澶勬坊鍔狅紝濡傞�夋嫨鎸夐挳绫诲瀷涓鸿〃鍗曘�佹柊鏍囩椤电瓑鍚湁閰嶇疆椤甸潰鐨勬寜閽紝鍙湪宸︿晶宸ュ叿鏍�-鎸夐挳-鍙厤缃寜閽锛岀偣鍑绘寜閽畬鎴愮浉鍏抽厤缃�傛敞锛氬綋璁剧疆鎸夐挳鏄剧ず浣嶇疆涓鸿〃鏍兼椂锛屾樉绀哄垪浼氬鍔犳搷浣滃垪銆�">
                   <Icon type="question-circle" />
                 </Tooltip>
-                {/* <div className="thawbutton" title={this.state.dict['header.form.thawbutton']} onClick={this.handleThaw}>
-                  <Icon type="unlock" />
-                </div> */}
+                <div className="copybutton" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({modaltype: 'paste'})}}>
+                  <Icon type="snippets" />
+                </div>
                 <DragElement
                   type="action"
                   list={this.state.config.action}
@@ -3073,6 +3106,7 @@
           <SearchForm
             dict={this.state.dict}
             card={this.state.card}
+            inputSubmit={this.handleSubmit}
             optionLibs={this.state.optionLibs}
             formlist={this.state.formlist}
             wrappedComponentRef={(inst) => this.searchFormRef = inst}
@@ -3097,6 +3131,7 @@
             card={this.state.card}
             tabs={this.state.tabviews}
             formlist={this.state.formlist}
+            inputSubmit={this.handleSubmit}
             setting={this.state.config.setting}
             wrappedComponentRef={(inst) => this.actionFormRef = inst}
           />
@@ -3114,6 +3149,7 @@
           <ColumnForm
             dict={this.state.dict}
             card={this.state.card}
+            inputSubmit={this.handleSubmit}
             formlist={this.state.formlist}
             wrappedComponentRef={(inst) => this.columnFormRef = inst}
           />
@@ -3131,6 +3167,7 @@
           <ColspanForm
             dict={this.state.dict}
             card={this.state.card}
+            inputSubmit={this.handleSubmit}
             columns={this.state.config.columns}
             wrappedComponentRef={(inst) => this.columnFormRef = inst}
           />
@@ -3147,6 +3184,7 @@
         >
           <GridBtnForm
             dict={this.state.dict}
+            inputSubmit={this.handleSubmit}
             card={this.state.config.gridBtn}
             wrappedComponentRef={(inst) => this.gridBtnFormRef = inst}
           />
@@ -3163,10 +3201,11 @@
         >
           <TabForm
             type="tabs"
-            tabs={this.state.tabviews}
             dict={this.state.dict}
             card={this.state.card}
+            tabs={this.state.tabviews}
             formlist={this.state.formlist}
+            inputSubmit={this.handleSubmit}
             wrappedComponentRef={(inst) => this.tabsFormRef = inst}
           />
         </Modal>
@@ -3261,6 +3300,7 @@
           <SettingForm
             dict={this.state.dict}
             menu={this.props.menu}
+            inputSubmit={this.settingSave}
             data={this.state.config.setting}
             columns={this.state.config.columns}
             usefulFields={this.props.permFuncField}
@@ -3295,6 +3335,21 @@
           {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />}
           {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawbtnlist}/>}
         </Modal>
+        {/* 鎸夐挳閰嶇疆淇℃伅绮樿创澶嶅埗 */}
+        <Modal
+          title={this.state.dict['header.form.paste']}
+          visible={modaltype === 'paste'}
+          width={600}
+          maskClosable={false}
+          onOk={this.pasteSubmit}
+          onCancel={() => {this.setState({modaltype: ''})}}
+          destroyOnClose
+        >
+          <PasteForm
+            dict={this.state.dict}
+            wrappedComponentRef={(inst) => this.pasteFormRef = inst}
+          />
+        </Modal>
         {this.state.loading && <Spin size="large" />}
       </div>
     )

--
Gitblit v1.8.0