king
2020-02-11 30c350ff93af3fcc7dcd9b78eb110212b2d44a49
src/templates/comtableconfig/index.jsx
@@ -2163,8 +2163,31 @@
   * @description 显示隐藏显示列字段名
   */
  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
    })