Commit 0c34a354 by zhaochengxiang

快速创建

parent 42d01639
...@@ -34,7 +34,11 @@ class ImportExcelCopy extends React.Component { ...@@ -34,7 +34,11 @@ class ImportExcelCopy extends React.Component {
const _placeholder = '支持两种方式创建\n方式一: Excel内容复制粘贴(模型名称和中文字段名)\n方式二: 手动输入模型名称和中文字段'; const _placeholder = '支持两种方式创建\n方式一: Excel内容复制粘贴(模型名称和中文字段名)\n方式二: 手动输入模型名称和中文字段';
let _attrsStr = ''; let _modelName = '', _attrsStr = '';
if (translateValues.length>0) {
_modelName= translateValues[0];
}
translateValues.forEach((item, index) => { translateValues.forEach((item, index) => {
if (index === 0) { if (index === 0) {
_attrsStr = ''; _attrsStr = '';
...@@ -46,8 +50,8 @@ class ImportExcelCopy extends React.Component { ...@@ -46,8 +50,8 @@ class ImportExcelCopy extends React.Component {
}) })
return ( return (
<Row gutter={(translateValues.length>0)?10: 0}> <Row gutter={10}>
<Col span={(translateValues.length>0)?14: 24}> <Col span={14}>
<Input.TextArea <Input.TextArea
value={inputValue||''} value={inputValue||''}
onChange={this.onInputChange} onChange={this.onInputChange}
...@@ -56,20 +60,16 @@ class ImportExcelCopy extends React.Component { ...@@ -56,20 +60,16 @@ class ImportExcelCopy extends React.Component {
> >
</Input.TextArea> </Input.TextArea>
</Col> </Col>
{ <Col span={10}>
(translateValues.length>0) && <Col span={10}> <Descriptions className='excel-copy-descritpion' column={1} size='small'>
<Descriptions className='excel-copy-descritpion' column={1} size='small'> <Descriptions.Item label='模型名称'>
<Descriptions.Item label='模型名称'> { translateValues[0] }
{ translateValues[0] } </Descriptions.Item>
</Descriptions.Item> <Descriptions.Item label='字段名称'>
{ { _attrsStr }
_attrsStr.length>0 && <Descriptions.Item label='字段名称'> </Descriptions.Item>
{ _attrsStr } </Descriptions>
</Descriptions.Item> </Col>
}
</Descriptions>
</Col>
}
</Row> </Row>
) )
} }
......
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