From db18f67e6a9ec7be3446ebfb1592809b3c3dcb7d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 06 一月 2020 10:43:42 +0800
Subject: [PATCH] 2020-01-06

---
 src/templates/subtableconfig/index.jsx |   92 +++++++++++++++++++++++++++------------------
 1 files changed, 55 insertions(+), 37 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 93775e0..97d8123 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -15,6 +15,7 @@
 import ColspanForm from '@/templates/tableshare/colspanform'
 import GridBtnForm from '@/templates/tableshare/gridbtnform'
 import EditCard from '@/templates/tableshare/editcard'
+import VerifyCard from '@/templates/tableshare/verifycard'
 import MenuForm from '@/templates/tableshare/menuform'
 import SourceElement from '@/templates/tableshare/dragelement/source'
 import zhCN from '@/locales/zh-CN/comtable.js'
@@ -65,7 +66,8 @@
     delActions: [],          // 鍒犻櫎鎸夐挳鍒楄〃
     funcLoading: false,      // 瀛樺偍杩囩▼鍒涘缓涓�
     showColumnName: false,   // 鏄剧ず鍒楀瓧娈靛悕鎺у埗
-    tabviews: []             // 鎵�鏈夋爣绛鹃〉
+    tabviews: [],            // 鎵�鏈夋爣绛鹃〉
+    profileVisible: false    // 楠岃瘉淇℃伅妯℃�佹
   }
 
   /**
@@ -678,42 +680,6 @@
             text: this.state.dict['header.form.refresh.subgrid']
           }]
         },
-        // {
-        //   type: 'select',
-        //   key: 'errorTip',
-        //   label: this.state.dict['header.form.messageTip'],
-        //   initVal: card.errorTip || 'E',
-        //   tooltip: '璇ラ�夐」涓烘彁绀烘晥鏋滃睍绀猴紝閫夋嫨鎻愮ず绫诲瀷鍚庯紝鍙偣鍑绘寜閽煡鐪嬶紝鑷畾涔夊嚱鏁颁腑璁剧疆 ErrCode 涓猴紙S銆�-1銆丒銆丯銆丗銆丯M锛夋椂锛屼細浠ュ搴旀柟寮忓睍绀烘彁绀轰俊鎭��',
-        //   tooltipClass: 'middle',
-        //   required: false,
-        //   options: [{
-        //     value: 'S',
-        //     text: 'S(鎻愰啋妗�-0)'
-        //   }, {
-        //     value: '-1',
-        //     text: '-1(涓嶆彁绀�)'
-        //   }, {
-        //     value: 'N',
-        //     text: 'N(鎻愰啋妗�-1)'
-        //   }, {
-        //     value: 'F',
-        //     text: 'F(鎻愰啋妗�-2)'
-        //   }, {
-        //     value: 'E',
-        //     text: 'E(纭妗�)'
-        //   }, {
-        //     value: 'NM',
-        //     text: 'NM(椤堕儴鎻愮ず)'
-        //   }]
-        // },
-        // {
-        //   type: 'number',
-        //   key: 'errorTime',
-        //   label: this.state.dict['header.form.errorTime'],
-        //   initVal: card.errorTime || 15,
-        //   tooltip: '鎵ц缁撴灉涓缃� ErrCode 涓� N 鎴� F 鏃舵湁鏁�',
-        //   required: false
-        // },
         {
           type: 'select',
           key: 'icon',
@@ -1649,6 +1615,44 @@
     })
   }
 
+  /**
+   * @description 楠岃瘉淇℃伅閰嶇疆
+   */
+  profileAction = (element) => {
+    this.setState({
+      profileVisible: true,
+      card: element
+    })
+  }
+
+  /**
+   * @description 楠岃瘉淇℃伅淇濆瓨
+   */
+  verifySubmit = () => {
+    const { card } = this.state
+    let config = JSON.parse(JSON.stringify(this.state.config))
+    let _verify = this.verifyRef.state.verify
+
+    config.action = config.action.map(item => {
+      if (item.uuid === card.uuid) {
+        item.verify = _verify
+      }
+
+      return item
+    })
+
+    this.setState({
+      profileVisible: false,
+      config: config,
+      card: '',
+      actionloading: true
+    }, () => {
+      this.setState({
+        actionloading: false
+      })
+    })
+  }
+
   // changeTemplate = () => {
   //   this.props.handleConfig('template')
   // }
@@ -2507,6 +2511,7 @@
                     handleMenu={this.handleAction}
                     copyElement={(val) => this.handleAction(val, 'copy')}
                     deleteMenu={this.deleteElement}
+                    profileMenu={this.profileAction}
                     placeholder={this.state.dict['header.form.action.placeholder']}
                   /> : null
                 }
@@ -2613,6 +2618,19 @@
             <Empty />
           }
         </Modal>
+        {/* 鎸夐挳浣跨敤绯荤粺瀛樺偍杩囩▼鏃讹紝楠岃瘉淇℃伅妯℃�佹 */}
+        <Modal
+          wrapClassName="common-table-fields-modal"
+          title={'楠岃瘉淇℃伅'}
+          visible={this.state.profileVisible}
+          width={'75vw'}
+          style={{minWidth: '900px', maxWidth: '1200px'}}
+          onOk={this.verifySubmit}
+          onCancel={() => { this.setState({ profileVisible: false }) }}
+          destroyOnClose
+        >
+          <VerifyCard card={this.state.card} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} />
+        </Modal>
         {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */}
         <Modal
           title={this.state.dict['header.edit']}

--
Gitblit v1.8.0