king
2020-02-11 30c350ff93af3fcc7dcd9b78eb110212b2d44a49
src/templates/subtableconfig/index.jsx
@@ -1854,7 +1854,30 @@
  }
  onColumnNameChange = () => {
    const { showColumnName } = this.state
    const { showColumnName, config } = this.state
    if (!showColumnName) {
      let fields = []
      config.columns.forEach(col => {
        if (col.field) {
          fields.push(col.field)
        }
      })
      fields = fields.join(',')
      let textArea = document.createElement('textarea')
      textArea.value = fields
      document.body.appendChild(textArea)
      textArea.select()
      try {
        document.execCommand('copy')
        document.body.removeChild(textArea)
      } catch (err) {
        document.body.removeChild(textArea)
      }
    }
    this.setState({
      showColumnName: !showColumnName