From b59af63c6742fa48de8fcdba67c9b8dc2e42bf94 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 二月 2023 11:25:29 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/modalform/modaleditable/index.jsx | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/templates/zshare/modalform/modaleditable/index.jsx b/src/templates/zshare/modalform/modaleditable/index.jsx index 3e076af..9edfdf9 100644 --- a/src/templates/zshare/modalform/modaleditable/index.jsx +++ b/src/templates/zshare/modalform/modaleditable/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Table, Input, Popconfirm, Form, Radio, message } from 'antd' +import { Table, Input, Popconfirm, Form, message } from 'antd' import { ArrowUpOutlined, ArrowDownOutlined, DeleteOutlined, PlusOutlined, SwapOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' @@ -140,27 +140,9 @@ }) } - getColumnSearchProps = column => ({ - filterDropdown: () => ( - <div style={{ padding: 8 }}> - <Radio.Group onChange={(e) => this.changeDatatype(column, e)} value={column.datatype}> - <Radio style={{display: 'block', height: '30px', lineHeight: '30px'}} value="string"> - 瀛楃涓� - </Radio> - <Radio style={{display: 'block', height: '30px', lineHeight: '30px'}} value="number"> - 鏁板瓧 - </Radio> - </Radio.Group> - </div> - ), - filterIcon: () => ( - <SwapOutlined style={{ color: column.datatype === 'number' ? '#1890ff' : ''}} /> - ) - }) - - changeDatatype = (column, e) => { + changeDatatype = (column) => { const { columns, dataSource } = this.state - let value = e.target.value + let value = column.datatype !== 'number' ? 'number' : 'string' let _data = dataSource.map(item => { let val = item[column.dataIndex] if (value === 'number') { @@ -185,7 +167,16 @@ } if (col.dataIndex !== 'operation') { - col = {...col, ...this.getColumnSearchProps(col)} + col.title = <div> + Value + <Popconfirm + title={`纭畾鍒囨崲涓�${col.datatype === 'number' ? '鏂囨湰' : '鏁板��'}鍚楋紵`} + overlayClassName="popover-confirm" + onConfirm={() => this.changeDatatype(col) + }> + <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} /> + </Popconfirm> + </div> } return col @@ -376,7 +367,16 @@ return { columns: columns.map(col => { if (col.dataIndex !== 'operation') { - col = {...col, ...this.getColumnSearchProps(col)} + col.title = <div> + Value + <Popconfirm + title={`纭畾鍒囨崲涓�${col.datatype === 'number' ? '鏂囨湰' : '鏁板��'}鍚楋紵`} + overlayClassName="popover-confirm" + onConfirm={() => this.changeDatatype(col) + }> + <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} /> + </Popconfirm> + </div> } return col }), -- Gitblit v1.8.0