king
2020-07-07 faf99ae37eea8905ef181eaddae48d9a1457d92a
2020-07-07
9个文件已修改
181 ■■■■ 已修改文件
src/components/sidemenu/config.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/index.scss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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'},
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({
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 = []
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
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss
@@ -68,7 +68,7 @@
    .excel-col-add {
      position: relative;
      float: right;
      top: -60px;
      top: -40px;
    }
  }
}
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>
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"
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;
    }
  }
}
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;
        }
      }
    }
  }
}