Commit afed889e by zhaochengxiang

展示完整的业务含义

parent 89763115
...@@ -167,47 +167,33 @@ export const EditableCell = ({ ...@@ -167,47 +167,33 @@ export const EditableCell = ({
let editingComponent = null; let editingComponent = null;
if (editing) { if (editing) {
if (dataIndex !== 'datatype') { let inputNode = <InputDebounce />;
const inputNode = inputType === 'check' ? <Checkbox /> : <InputDebounce /> if (inputType === 'check') {
inputNode = <Checkbox />;
editingComponent = ( } else if (inputType === 'textarea') {
<Form.Item inputNode = <Input.TextArea autoSize={{ minRows: 1, maxRows: 6 }} />;
name={dataIndex} } else if (inputType === 'datatype') {
style={{ inputNode = <DatatypeInput datatypes={datatypes} />;
margin: 0,
}}
valuePropName={(inputType==='check')? 'checked': 'value'}
rules={[
{
required: (require===null)?false:require,
message: `请输入${colTitle}!`,
},
]}
>
{ inputNode }
</Form.Item>
);
} else {
editingComponent = (
<Form.Item
name={dataIndex}
style={{
margin: 0,
}}
valuePropName={'value'}
rules={[
{
required: (require===null)?false:require,
message: `请输入${colTitle}!`,
},
]}
>
<DatatypeInput datatypes={datatypes} />
</Form.Item>
)
} }
editingComponent = (
<Form.Item
name={dataIndex}
style={{
margin: 0,
}}
valuePropName={(inputType==='check')? 'checked': 'value'}
rules={[
{
required: (require===null)?false:require,
message: `请输入${colTitle}!`,
},
]}
>
{ inputNode }
</Form.Item>
);
} }
...@@ -1120,13 +1106,28 @@ export const ImportActionTable = (props) => { ...@@ -1120,13 +1106,28 @@ export const ImportActionTable = (props) => {
if (!col.editable) { if (!col.editable) {
return col; return col;
} }
let inputType = 'text';
if (
col.dataIndex==='notNull'||
col.dataIndex==='partOfDistributionKey' ||
col.dataIndex==='partOfPrimaryKeyLogically' ||
col.dataIndex==='needAttention' ||
col.dataIndex==='foreignKey'
) {
inputType = 'check';
} else if (col.dataIndex === 'remark') {
inputType = 'textarea';
} else if (col.dataIndex === 'datatype') {
inputType = 'datatype';
}
return { return {
...col, ...col,
onCell: (record) => ({ onCell: (record) => ({
record, record,
dataIndex: col.dataIndex, dataIndex: col.dataIndex,
inputType: (col.dataIndex==='notNull' || col.dataIndex==='partOfDistributionKey' || col.dataIndex==='partOfPrimaryKeyLogically' || col.dataIndex==='needAttention' || col.dataIndex==='foreignKey') ? 'check' : 'text', inputType,
colTitle: col.title, colTitle: col.title,
editing: isEditing(record), editing: isEditing(record),
datatypes: supportedDatatypes, datatypes: supportedDatatypes,
......
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