From 131bc212f0cfe964c9a38bbe6178aca4f4a16677 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 03 二月 2024 17:50:30 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/table/edit-table/columns/index.jsx | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index a141757..9275f2e 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -38,6 +38,32 @@ this.props.updateCol({...column, marks: vals}) } + copycolumn = () => { + const { column } = this.props + + let oInput = document.createElement('input') + let val = { + copyType: 'editcols', + cols: [column] + } + + let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') + if (srcid) { + val.$srcId = srcid + } + + oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + oInput.className = 'oInput' + oInput.style.display = 'none' + + message.success('澶嶅埗鎴愬姛銆�') + + document.body.removeChild(oInput) + } + shouldComponentUpdate (nextProps, nextState) { if (this.props.rowSpan !== nextProps.rowSpan || this.props.colSpan !== nextProps.colSpan) { @@ -77,6 +103,7 @@ {column.type === 'custom' ? <PlusOutlined className="plus" title="娣诲姞鍏冪礌" onClick={() => this.props.addElement(column)} /> : null} {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={() => this.props.addElement(column, 'button')} /> : null} <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> + <CopyOutlined title="澶嶅埗鏄剧ず鍒�" style={{color: '#26C281'}} onClick={this.copycolumn} /> {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} {column.type === 'custom' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> @@ -520,7 +547,7 @@ let oInput = document.createElement('input') let val = { - copyType: 'cols', + copyType: 'editcols', cols: columns.filter(col => !col.origin) } -- Gitblit v1.8.0