From faf99ae37eea8905ef181eaddae48d9a1457d92a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 07 七月 2020 16:19:32 +0800
Subject: [PATCH] 2020-07-07

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx                          |   74 +++---------------
 src/templates/sharecomponent/tabscomponent/index.scss                            |    7 +
 src/components/sidemenu/config.jsx                                               |   14 +++
 src/components/sidemenu/index.jsx                                                |    2 
 src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx |   20 ----
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx             |    2 
 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss           |   11 ++
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss            |    2 
 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx            |   49 +++++++++--
 9 files changed, 91 insertions(+), 90 deletions(-)

diff --git a/src/components/sidemenu/config.jsx b/src/components/sidemenu/config.jsx
index ca4a6ad..02602f3 100644
--- a/src/components/sidemenu/config.jsx
+++ b/src/components/sidemenu/config.jsx
@@ -179,6 +179,20 @@
       text: '澶т簬鐭俊妯℃澘'
     }]
   }, {
+    MenuID: 'systemPayManage',
+    text: '鏀粯',
+    PageParam: {Icon: 'folder'},
+    children: [{
+      src: '',
+      systems: ['local', 'cloud'],
+      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
+      type: 'ManageTable',
+      MenuID: '1594095599055qicg2eb642v5qglhnuo',
+      MenuNo: 's_weixin_pay_bdM',
+      MenuName: '寰俊鏀粯',
+      text: '寰俊鏀粯'
+    }]
+  }, {
     MenuID: 'systemManageViewParam',
     text: '绯荤粺鍙傛暟',
     PageParam: {Icon: 'folder'},
diff --git a/src/components/sidemenu/index.jsx b/src/components/sidemenu/index.jsx
index e21bf91..9b03266 100644
--- a/src/components/sidemenu/index.jsx
+++ b/src/components/sidemenu/index.jsx
@@ -184,6 +184,8 @@
       menulist.forEach(menu => {
         menu.children = menu.children.filter(item => !item.systems || item.systems.includes(options.sysType))
       })
+
+      menulist = menulist.filter(menu => menu.children.length > 0)
     }
 
     this.setState({
diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index d967530..c1c6dc0 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -91,6 +91,13 @@
         duration: 5
       })
       return
+    } else if (!btn.verify || !btn.verify.columns || btn.verify.columns.length === 0) {
+      notification.warning({
+        top: 92,
+        message: '璇疯缃鍑哄垪锛�',
+        duration: 5
+      })
+      return
     }
 
     this.triggerExcelout()
@@ -373,74 +380,21 @@
    * @description Excel 鐢熸垚
    */
   exportExcel = (data) => {
-    const { columns, btn } = this.props
+    const { btn } = this.props
     if (data && data.length > 0) {
       try {
         let _header = []
         let _topRow = {}
         let colwidth = []
 
-        let hidecolumns = []
+        btn.verify.columns.forEach(col => {
+          if (!data[0].hasOwnProperty(col.Column)) return
+          if (_topRow[col.Column]) return
 
-        let verifyColumn = {} // 璁板綍楠岃瘉淇℃伅涓殑Excel鍒楅厤缃�
-        if (btn.verify && btn.verify.columns && btn.verify.columns.length > 0) {
-          btn.verify.columns.forEach(col => {
-            if (col.export === 'false') {
-              hidecolumns.push(col.Column)
-              return
-            }
-            verifyColumn[col.Column] = col
-          })
-        }
+          _header.push(col.Column)
+          _topRow[col.Column] = col.Text
 
-        columns.forEach(col => {
-          if (col.Hide === 'true' || hidecolumns.includes(col.field)) {
-            hidecolumns.push(col.field)
-            return
-          }
-          if (!data[0].hasOwnProperty(col.field)) return
-          if (_topRow[col.field]) return
-
-          if (verifyColumn[col.field]) { // 浼樺厛浣跨敤楠岃瘉淇℃伅涓殑鍒楄缃�
-            _header.push(col.field)
-            _topRow[col.field] = verifyColumn[col.field].Text
-  
-            colwidth.push({width: verifyColumn[col.field].Width})
-          } else {
-            _header.push(col.field)
-            _topRow[col.field] = col.label
-  
-            let _colwidth = Math.floor(col.Width / 6)
-  
-            if (!_colwidth || _colwidth < 5) {
-              _colwidth = 5
-            }
-  
-            colwidth.push({width: _colwidth})
-          }
-        })
-
-        if (btn.verify && btn.verify.columns && btn.verify.columns.length > 0) {
-          btn.verify.columns.forEach(col => {
-            if (hidecolumns.includes(col.Column)) return
-            if (!data[0].hasOwnProperty(col.Column)) return
-            if (_topRow[col.Column]) return
-
-            _header.push(col.Column)
-            _topRow[col.Column] = col.Text
-
-            colwidth.push({width: col.Width})
-          })
-        }
-
-        Object.keys(data[0]).forEach(key => {
-          if (hidecolumns.includes(key)) return
-          if (_topRow[key]) return
-
-          _header.push(key)
-          _topRow[key] = key
-
-          colwidth.push({width: 12})
+          colwidth.push({width: col.Width})
         })
 
         let table = []
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
index d963be1..1040b3b 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -708,7 +708,7 @@
               wrappedComponentRef={(inst) => this.columnForm = inst}
             />
             <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}>
-              蹇嵎娣诲姞
+              鍚屾鏄剧ず鍒�
             </Button>
             <Table
               bordered
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss
index 94d193b..4c5cd60 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss
@@ -68,7 +68,7 @@
     .excel-col-add {
       position: relative;
       float: right;
-      top: -60px;
+      top: -40px;
     }
   }
 }
\ No newline at end of file
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx
index b20a6f2..56f31eb 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Button, Input, InputNumber, Radio } from 'antd'
+import { Form, Row, Col, Button, Input, InputNumber } from 'antd'
 import './index.scss'
 
 class ExcelOutColumn extends Component {
@@ -22,8 +22,7 @@
     this.props.form.setFieldsValue({
       Column: record.Column,
       Text: record.Text,
-      Width: record.Width,
-      export: record.export || 'true'
+      Width: record.Width
     })
   }
 
@@ -41,8 +40,7 @@
         this.props.form.setFieldsValue({
           Column: '',
           Text: '',
-          Width: 20,
-          export: 'true'
+          Width: 20
         })
       }
     })
@@ -108,18 +106,6 @@
             <Button onClick={this.handleConfirm} type="primary" className="mk-green">
               淇濆瓨
             </Button>
-          </Col>
-          <Col span={7}>
-            <Form.Item label={dict['model.export']}>
-              {getFieldDecorator('export', {
-                initialValue: 'true'
-              })(
-                <Radio.Group>
-                  <Radio value="true">{dict['model.true']}</Radio>
-                  <Radio value="false">{dict['model.false']}</Radio>
-                </Radio.Group>
-              )}
-            </Form.Item>
           </Col>
         </Row>
       </Form>
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
index 6621ff3..2712d53 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -27,24 +27,17 @@
       {
         title: this.props.dict['model.form.field'],
         dataIndex: 'Column',
-        width: '20%'
+        width: '25%'
       },
       {
         title: this.props.dict['model.name'],
         dataIndex: 'Text',
-        width: '20%'
-      },
-      {
-        title: this.props.dict['model.export'],
-        dataIndex: 'export',
-        width: '20%',
-        editable: true,
-        render: (text, record) => record.export !== 'false' ? this.props.dict['model.true'] : this.props.dict['model.false']
+        width: '25%'
       },
       {
         title: this.props.dict['model.form.columnWidth'],
         dataIndex: 'Width',
-        width: '20%'
+        width: '25%'
       },
       {
         title: '鎿嶄綔',
@@ -163,6 +156,15 @@
         }
       })
     } else {
+      let fields = verify.columns.map(item => item.Column)
+      if (fields.includes(values.Column)) {
+        notification.warning({
+          top: 92,
+          message: values.Column + '瀛楁宸插瓨鍦紒',
+          duration: 5
+        })
+        return
+      }
       values.uuid = Utils.getuuid()
       verify.columns.push(values)
     }
@@ -373,6 +375,30 @@
     })
   }
 
+  columnFieldInput = () => {
+    const { config } = this.props
+    const { verify } = this.state
+
+    let columns = fromJS(verify.columns).toJS()
+    let fields = columns.map(item => item.Column)
+
+    config.columns.forEach(item => {
+      if (fields.includes(item.field)) return
+      fields.push(item.field)
+
+      columns.push({
+        Column: item.field,
+        Text: item.label,
+        Width: 20,
+        uuid: Utils.getuuid()
+      })
+    })
+
+    this.setState({
+      verify: {...verify, columns: columns}
+    })
+  }
+
   render() {
     const { card } = this.props
     const { verify, excelColumns, defaultscript } = this.state
@@ -397,6 +423,9 @@
               columnChange={this.columnChange}
               wrappedComponentRef={(inst) => this.columnForm = inst}
             />
+            <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}>
+              鍚屾鏄剧ず鍒�
+            </Button>
             <Table
               bordered
               rowKey="uuid"
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss
index 017545b..bc8ed5b 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss
@@ -59,4 +59,15 @@
     padding: 0 5px;
     cursor: pointer;
   }
+}
+#verify-excelout-box-tab {
+  .ant-tabs-tabpane {
+    position: relative;
+    .excel-col-add {
+      position: relative;
+      float: right;
+      top: -5px;
+      z-index: 1;
+    }
+  }
 }
\ No newline at end of file
diff --git a/src/templates/sharecomponent/tabscomponent/index.scss b/src/templates/sharecomponent/tabscomponent/index.scss
index dec6c80..5655aa8 100644
--- a/src/templates/sharecomponent/tabscomponent/index.scss
+++ b/src/templates/sharecomponent/tabscomponent/index.scss
@@ -93,7 +93,12 @@
       right: 85px;
     }
     .ant-tabs-nav-container-scrolling {
-      margin-right: 50px;
+      margin-right: 100px;
+      .ant-tabs-tab-arrow-show {
+        > span {
+          padding-top: 10px;
+        }
+      }
     }
   }
 }
\ No newline at end of file

--
Gitblit v1.8.0