Commit 30d5d2f3 by zhaochengxiang

模型table一行显示

parent f90bca90
...@@ -61,6 +61,13 @@ code { ...@@ -61,6 +61,13 @@ code {
margin-left: auto !important; margin-left: auto !important;
} }
.textOverflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
.text-white { .text-white {
color: white; color: white;
} }
......
...@@ -57,10 +57,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -57,10 +57,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
return ( return (
<> <>
<Row align='middle'> <Row align='middle'>
<Col span={12}> <Col span={9}>
<span>类型名称:</span> <span>类型名称:</span>
</Col> </Col>
<Col span={12}> <Col span={15}>
<Select <Select
onChange={onNameChange} onChange={onNameChange}
value={value.name || ''} value={value.name || ''}
...@@ -81,10 +81,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -81,10 +81,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
//使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input //使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input
return ( return (
<Row key={index} className='mt-2' align='middle'> <Row key={index} className='mt-2' align='middle'>
<Col span={12}> <Col span={9}>
<span>{`${parameterCnName||''}:`}</span> <span>{`${parameterCnName||''}:`}</span>
</Col> </Col>
<Col span={12}> <Col span={15}>
<Input <Input
onChange={(e) => { onChange={(e) => {
onParameterValuesChange(e, index); onParameterValuesChange(e, index);
...@@ -105,7 +105,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -105,7 +105,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const EditableCell = ({ const EditableCell = ({
editing, editing,
dataIndex, dataIndex,
title, colTitle,
inputType, inputType,
record, record,
index, index,
...@@ -130,7 +130,7 @@ const EditableCell = ({ ...@@ -130,7 +130,7 @@ const EditableCell = ({
rules={[ rules={[
{ {
required: (inputType === 'text'), required: (inputType === 'text'),
message: `请输入${title}!`, message: `请输入${colTitle}!`,
}, },
]} ]}
> >
...@@ -149,7 +149,7 @@ const EditableCell = ({ ...@@ -149,7 +149,7 @@ const EditableCell = ({
rules={[ rules={[
{ {
required: true, required: true,
message: `请输入${title}!`, message: `请输入${colTitle}!`,
}, },
]} ]}
> >
...@@ -159,6 +159,7 @@ const EditableCell = ({ ...@@ -159,6 +159,7 @@ const EditableCell = ({
} }
} }
return ( return (
<td {...restProps}> <td {...restProps}>
{editing ? ( {editing ? (
...@@ -357,18 +358,21 @@ const ImportActionTable = (props) => { ...@@ -357,18 +358,21 @@ const ImportActionTable = (props) => {
width: 100, width: 100,
dataIndex: 'cnName', dataIndex: 'cnName',
editable: true, editable: true,
ellipsis: true,
}, },
{ {
title: '英文名称', title: '英文名称',
width: 100, width: 150,
dataIndex: 'name', dataIndex: 'name',
editable: true, editable: true,
ellipsis: true,
}, },
{ {
title: '类型', title: '类型',
width: 200, width: 200,
dataIndex: 'datatype', dataIndex: 'datatype',
editable: true, editable: true,
ellipsis: true,
render: (datatype, record, index) => { render: (datatype, record, index) => {
let _text = ''; let _text = '';
...@@ -384,7 +388,7 @@ const ImportActionTable = (props) => { ...@@ -384,7 +388,7 @@ const ImportActionTable = (props) => {
}, },
{ {
title: '可否为空', title: '可否为空',
width: 50, width: 80,
dataIndex: 'nullable', dataIndex: 'nullable',
editable: true, editable: true,
render: (nullable, record, index) => { render: (nullable, record, index) => {
...@@ -399,7 +403,7 @@ const ImportActionTable = (props) => { ...@@ -399,7 +403,7 @@ const ImportActionTable = (props) => {
}, },
{ {
title: '主键', title: '主键',
width: 50, width: 80,
dataIndex: 'partOfPrimaryKey', dataIndex: 'partOfPrimaryKey',
editable: true, editable: true,
render: (partOfPrimaryKey, record, index) => { render: (partOfPrimaryKey, record, index) => {
...@@ -414,7 +418,7 @@ const ImportActionTable = (props) => { ...@@ -414,7 +418,7 @@ const ImportActionTable = (props) => {
}, },
{ {
title: '分布键', title: '分布键',
width: 50, width: 80,
dataIndex: 'partOfDistributionKey', dataIndex: 'partOfDistributionKey',
editable: true, editable: true,
render: (partOfDistributionKey, record, index) => { render: (partOfDistributionKey, record, index) => {
...@@ -431,6 +435,7 @@ const ImportActionTable = (props) => { ...@@ -431,6 +435,7 @@ const ImportActionTable = (props) => {
title: '描述', title: '描述',
dataIndex: 'remark', dataIndex: 'remark',
editable: true, editable: true,
ellipsis: true,
}, },
]; ];
...@@ -440,7 +445,6 @@ const ImportActionTable = (props) => { ...@@ -440,7 +445,6 @@ const ImportActionTable = (props) => {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
width: 100, width: 100,
render: (_, record) => { render: (_, record) => {
if (!editable) return null; if (!editable) return null;
...@@ -470,7 +474,7 @@ const ImportActionTable = (props) => { ...@@ -470,7 +474,7 @@ const ImportActionTable = (props) => {
const validateColumn = { const validateColumn = {
title: '规范', title: '规范',
dataIndex: 'validate', dataIndex: 'validate',
width: 120, width: 180,
render: (text, record, index) => { render: (text, record, index) => {
let shortCauses = []; let shortCauses = [];
let causes = []; let causes = [];
...@@ -484,13 +488,13 @@ const ImportActionTable = (props) => { ...@@ -484,13 +488,13 @@ const ImportActionTable = (props) => {
}); });
return ( return (
<div className='d-flex' key={index} style={{ alignItems: 'center' }}> <div className='d-flex' key={index} style={{ alignItems: 'center', justifyContent: 'space-between' }}>
<div> <div>
{ {
shortCauses && shortCauses.map((shortCause, index) => { shortCauses && shortCauses.map((shortCause, index) => {
return ( return (
<div key={index}> <div className='textOverflow' style={{ width: 130, color: '#f5222d' }} title={shortCause} key={index}>
<span style={{ color: '#f5222d' }}>{shortCause||''}</span> <span>{shortCause||''}</span>
</div> </div>
); );
}) })
...@@ -548,7 +552,7 @@ const ImportActionTable = (props) => { ...@@ -548,7 +552,7 @@ const ImportActionTable = (props) => {
record, record,
dataIndex: col.dataIndex, dataIndex: col.dataIndex,
inputType: (col.dataIndex==='nullable' || col.dataIndex==='partOfDistributionKey' || col.dataIndex==='partOfPrimaryKey') ? 'check' : 'text', inputType: (col.dataIndex==='nullable' || col.dataIndex==='partOfDistributionKey' || col.dataIndex==='partOfPrimaryKey') ? 'check' : 'text',
title: col.title, colTitle: col.title,
editing: isEditing(record), editing: isEditing(record),
datatypes: supportedDatatypes, datatypes: supportedDatatypes,
}), }),
......
...@@ -260,7 +260,7 @@ const ImportModal = (props) => { ...@@ -260,7 +260,7 @@ const ImportModal = (props) => {
forceRender forceRender
visible={visible} visible={visible}
title={title} title={title}
width={step===2?1000:520} width={step===2?1300:520}
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
onCancel={() => { onCancel={() => {
......
...@@ -30,28 +30,29 @@ const ModelTable = (props) => { ...@@ -30,28 +30,29 @@ const ModelTable = (props) => {
render: (text, record, index) => { render: (text, record, index) => {
return (index+1).toString(); return (index+1).toString();
}, },
width:80, width: 50,
}, },
{ {
title: '模型名称', title: '模型名称',
dataIndex: 'name', dataIndex: 'name',
width:180, width: 180,
ellipsis: true,
}, },
{ {
title: '中文名称', title: '中文名称',
dataIndex: 'cnName', dataIndex: 'cnName',
width:180, width: 180,
ellipsis: true,
}, },
{ {
title: '模型描述', title: '模型描述',
dataIndex: 'remark', dataIndex: 'remark',
ellipsis: true,
}, },
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width:120, width: 120,
render: (text,record) => { render: (text,record) => {
return ( return (
......
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