king
2020-07-07 faf99ae37eea8905ef181eaddae48d9a1457d92a
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"