Commit a76f77d9 by zhaochengxiang

类型调整

parent 8cc1752f
...@@ -105,52 +105,41 @@ export const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -105,52 +105,41 @@ export const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
value = value ? value: {}; value = value ? value: {};
return ( return (
<> <div className='flex' style={{ justifyContent: 'space-between', alignItems: 'center' }}>
<Row align='middle'> <div onClick={e => e.stopPropagation()} style={{ flex: 1 }}>
<Col span={9}> <Select
<span>名称:</span> onChange={onNameChange}
</Col> value={value.name || ''}
<Col span={15}> placeholder='请选择类型名称'
<span onClick={e => e.stopPropagation()}> style={{ width: '100%' }}
<Select >
onChange={onNameChange} {
value={value.name || ''} (datatypes||[]) && datatypes.map((_datatype, index) => {
placeholder='请选择类型名称' return (
> <Option key={_datatype.name||''}>{_datatype.name||''}</Option>
{ );
(datatypes||[]) && datatypes.map((_datatype, index) => { })
return ( }
<Option key={_datatype.name||''}>{_datatype.name||''}</Option> </Select>
); </div>
})
}
</Select>
</span>
</Col>
</Row>
{ {
(value.parameterCnNames||[]).map((parameterCnName, index) => { (value.parameterCnNames||[]).map((parameterCnName, index) => {
//使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input //使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input
return ( return (
<Row key={index} className='mt-2' align='middle'> <div key={index} className='ml-2' style={{ flex: 1 }}>
<Col span={9}> <Input
<span>{`${parameterCnName||''}:`}</span> onChange={(e) => {
</Col> onParameterValuesChange(e, index);
<Col span={15}> }}
<Input value={value.parameterValues[index] || ''}
onChange={(e) => { style={{ width: '100%' }}
onParameterValuesChange(e, index); placeholder={parameterCnName}
}} />
value={value.parameterValues[index] || ''} </div>
style={{ width: '100%' }}
placeholder='请输入一个整数'
/>
</Col>
</Row>
); );
}) })
} }
</> </div>
) )
} }
......
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