From ec9c3ddc2b439180204e8432fb805920ed0d11c1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 31 五月 2021 19:11:09 +0800 Subject: [PATCH] 2021-05-31 --- src/menu/datasource/verifycard/index.jsx | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index b21db46..0e0666e 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Tabs, Popconfirm, Icon, notification, Modal, Typography, Spin } from 'antd' +import { Form, Tabs, Popconfirm, Icon, notification, Modal, Typography, Spin, message } from 'antd' import moment from 'moment' import Api from '@/api' @@ -623,6 +623,27 @@ }) } + copyColumns = () => { + const { columns } = this.state + let m = [] + let n = [] + + columns.forEach(col => { + m.push(`${col.field}(${col.label})`) + n.push(col.field) + }) + + let oInput = document.createElement('input') + oInput.value = `/*${m.join(',')}*/ + ${n.join(',')}` + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + + message.success('澶嶅埗鎴愬姛銆�') + } + /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ @@ -658,6 +679,7 @@ type="fields" updatefield={this.updatefields} /> + <Icon type="copy" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> <EditTable actions={['edit', 'move', 'copy', 'del']} type="datasourcefield" data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> </TabPane> <TabPane tab={ -- Gitblit v1.8.0