Commit b7b38364 by zhaochengxiang

优化数据类型编辑

parent 0caf1f2f
import React, { useState, useCallback, useRef } from 'react'; import React, { useState, useCallback, useRef } from 'react';
import { Table, Input, InputNumber, Form, Typography, Radio, Divider, Button, Popconfirm, Select } from 'antd'; import { Table, Input, InputNumber, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col } from 'antd';
import { DndProvider, useDrag, useDrop } from 'react-dnd'; import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend'; import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper'; import update from 'immutability-helper';
...@@ -54,8 +54,16 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -54,8 +54,16 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
return ( return (
<> <>
<span> <Row align='middle'>
<Select onChange={onNameChange} value={name}> <Col span={12}>
<span>类型名称:</span>
</Col>
<Col span={12}>
<Select
onChange={onNameChange}
value={name}
placeholder='请选择类型名称'
>
{ {
(datatypes||[]) && datatypes.map((_datatype, index) => { (datatypes||[]) && datatypes.map((_datatype, index) => {
return ( return (
...@@ -64,19 +72,28 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -64,19 +72,28 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
}) })
} }
</Select> </Select>
</Col>
</Row>
{ {
(parameterNames||[]).map((parameterName, index) => { (parameterNames||[]).map((parameterName, index) => {
return ( return (
<Row key={index} className='mt-2' align='middle'>
<Col span={12}>
<span>{`${parameterName||''}:`}</span>
</Col>
<Col span={12}>
<InputNumber <InputNumber
key={index}
onChange={(value) => { onChange={(value) => {
onParameterValuesChange(value, index); onParameterValuesChange(value, index);
}} }}
value={parameterValues[index]} /> value={parameterValues[index]}
style={{ width: 60 }}
/>
</Col>
</Row>
); );
}) })
} }
</span>
</> </>
) )
} }
......
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