From 6b5cb9058495b03f0a3ad36e0169c1c2e5dbabc4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 四月 2023 16:55:57 +0800 Subject: [PATCH] 2023-04-27 --- src/templates/zshare/modalform/modaleditable/index.jsx | 84 +++++++++++++++++++++--------------------- 1 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/templates/zshare/modalform/modaleditable/index.jsx b/src/templates/zshare/modalform/modaleditable/index.jsx index 5e84435..053e370 100644 --- a/src/templates/zshare/modalform/modaleditable/index.jsx +++ b/src/templates/zshare/modalform/modaleditable/index.jsx @@ -140,51 +140,51 @@ }) } - changeDatatype = (column) => { - const { columns, dataSource } = this.state - let value = column.datatype !== 'number' ? 'number' : 'string' - let _data = dataSource.map(item => { - let val = item[column.dataIndex] - if (value === 'number') { - val = parseFloat(val) - if (isNaN(val)) { - val = 0 - } - } else { - val = '' + val - } + // changeDatatype = (column) => { + // const { columns, dataSource } = this.state + // let value = column.datatype !== 'number' ? 'number' : 'string' + // let _data = dataSource.map(item => { + // let val = item[column.dataIndex] + // if (value === 'number') { + // val = parseFloat(val) + // if (isNaN(val)) { + // val = 0 + // } + // } else { + // val = '' + val + // } - item[column.dataIndex] = val + // item[column.dataIndex] = val - return item - }) + // return item + // }) - this.setState({ - dataSource: _data, - columns: columns.map(col => { - if (col.dataIndex === column.dataIndex) { - col.datatype = value - } + // this.setState({ + // dataSource: _data, + // columns: columns.map(col => { + // if (col.dataIndex === column.dataIndex) { + // col.datatype = value + // } - if (col.dataIndex !== 'operation') { - col.title = <div> - {col.$title} - <Popconfirm - title={`纭畾鍒囨崲涓�${col.datatype === 'number' ? '鏂囨湰' : '鏁板��'}鍚楋紵`} - overlayClassName="popover-confirm" - onConfirm={() => this.changeDatatype(col) - }> - <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} /> - </Popconfirm> - </div> - } + // if (col.dataIndex !== 'operation') { + // col.title = <div> + // {col.$title} + // {/* <Popconfirm + // title={`纭畾鍒囨崲涓�${col.datatype === 'number' ? '鏂囨湰' : '鏁板��'}鍚楋紵`} + // overlayClassName="popover-confirm" + // onConfirm={() => this.changeDatatype(col) + // }> + // <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} /> + // </Popconfirm> */} + // </div> + // } - return col - }) - }, () => { - this.props.onChange(_data) - }) - } + // return col + // }) + // }, () => { + // this.props.onChange(_data) + // }) + // } handleUpDown = (record, direction) => { const { dataSource } = this.state @@ -373,13 +373,13 @@ if (col.dataIndex !== 'operation') { col.title = <div> {col.$title} - <Popconfirm + {/* <Popconfirm title={`纭畾鍒囨崲涓�${col.datatype === 'number' ? '鏂囨湰' : '鏁板��'}鍚楋紵`} overlayClassName="popover-confirm" onConfirm={() => this.changeDatatype(col) }> <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} /> - </Popconfirm> + </Popconfirm> */} </div> } return col -- Gitblit v1.8.0