From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 24 一月 2025 11:10:32 +0800 Subject: [PATCH] 2025-01-24 --- src/menu/components/table/edit-table/columns/index.jsx | 41 +++++++++++++---------------------------- 1 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index b410cc8..16de3eb 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -22,12 +22,12 @@ class HeaderCol extends Component { deleteCol = () => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�', onOk() { - _this.props.deleteCol(_this.props.column) + that.props.deleteCol(that.props.column) }, onCancel() {} }) @@ -45,11 +45,6 @@ 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))) @@ -195,10 +190,10 @@ val = '$Index' } else if (column.type === 'formula') { val = column.formula - if (column.eval === 'false') { - val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') - val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span> - } + // if (column.eval === 'false') { + // val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') + // val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span> + // } } return ( <td style={style} className={className}> @@ -386,7 +381,7 @@ if (!cell.eleType) { if (cell.copyType === 'action') { cell.eleType = 'button' - cell.width = cell.width || 12 + cell.width = cell.width || cell.width === 0 ? cell.width : 12 } else { cell.eleType = 'text' } @@ -553,11 +548,6 @@ cols: columns.filter(col => !col.origin) } - 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() @@ -597,13 +587,13 @@ columns.push(cell) }) - const _this = this + const that = this confirm({ content: '纭畾鍚屾瀛楁闆嗗悧锛�', onOk() { - _this.setState({columns}, () => { - _this.props.updatecolumn({..._this.props.config, cols: columns}) + that.setState({columns}, () => { + that.props.updatecolumn({...that.props.config, cols: columns}) }) }, onCancel() {} @@ -611,13 +601,13 @@ } clear = () => { - const _this = this + const that = this confirm({ content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�', onOk() { - _this.setState({columns: []}, () => { - _this.props.updatecolumn({..._this.props.config, cols: []}) + that.setState({columns: []}, () => { + that.props.updatecolumn({...that.props.config, cols: []}) }) }, onCancel() {} @@ -637,10 +627,6 @@ }) } - componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) - } - /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 */ @@ -648,7 +634,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) } handlecolumns = (columns, fields, config, pId) => { -- Gitblit v1.8.0