Commit a76f77d9 by zhaochengxiang

类型调整

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