Commit afed889e by zhaochengxiang

展示完整的业务含义

parent 89763115
...@@ -167,9 +167,15 @@ export const EditableCell = ({ ...@@ -167,9 +167,15 @@ 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 />;
} else if (inputType === 'textarea') {
inputNode = <Input.TextArea autoSize={{ minRows: 1, maxRows: 6 }} />;
} else if (inputType === 'datatype') {
inputNode = <DatatypeInput datatypes={datatypes} />;
}
editingComponent = ( editingComponent = (
<Form.Item <Form.Item
...@@ -188,26 +194,6 @@ export const EditableCell = ({ ...@@ -188,26 +194,6 @@ export const EditableCell = ({
{ inputNode } { inputNode }
</Form.Item> </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>
)
}
} }
...@@ -1121,12 +1107,27 @@ export const ImportActionTable = (props) => { ...@@ -1121,12 +1107,27 @@ export const ImportActionTable = (props) => {
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