From 30c350ff93af3fcc7dcd9b78eb110212b2d44a49 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 11 二月 2020 08:53:53 +0800 Subject: [PATCH] 2020-02-11 --- src/templates/comtableconfig/index.jsx | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 9946b3d..ad2b0f7 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/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 }) -- Gitblit v1.8.0