Commit 1ea25ef9 by zhaochengxiang

excel复制粘贴空格,逗号,以及回车等符号可作为字段分割符

parent 370db5ea
...@@ -20,7 +20,7 @@ class ImportExcelCopy extends React.Component { ...@@ -20,7 +20,7 @@ class ImportExcelCopy extends React.Component {
onInputChange = (e) => { onInputChange = (e) => {
const { onChange } = this.props; const { onChange } = this.props;
this.setState({ inputValue: e.target.value }, () => { this.setState({ inputValue: e.target.value }, () => {
onChange && onChange(e.target.value.split('\n').filter(value => value!=='')); onChange && onChange(e.target.value.split(/[,,_\n ]/).filter(value => value!==''));
}); });
} }
...@@ -29,7 +29,7 @@ class ImportExcelCopy extends React.Component { ...@@ -29,7 +29,7 @@ class ImportExcelCopy extends React.Component {
const { inputValue } = this.state; const { inputValue } = this.state;
const _placeholder = '支持两种方式创建\n方式一: Excel内容复制粘贴(中文字段名)\n方式二: 手动输入中文字段,多个字段按行分割(每行一个)'; const _placeholder = '支持两种方式创建\n方式一: Excel内容复制粘贴(模型名称和中文字段名)\n方式二: 手动输入模型名称和中文字段';
return ( return (
<Input.TextArea <Input.TextArea
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment