Commit a816d820 by zhaochengxiang

nullable改为not null

parent 47722fe4
...@@ -481,6 +481,12 @@ const ImportActionTable = (props) => { ...@@ -481,6 +481,12 @@ const ImportActionTable = (props) => {
} }
}) })
if (!row.notNull) {
row.nullable = true;
} else {
row.nullable = false;
}
const newData = [...data]; const newData = [...data];
const index = newData.findIndex((item) => editingKey === item.iid); const index = newData.findIndex((item) => editingKey === item.iid);
...@@ -623,15 +629,15 @@ const ImportActionTable = (props) => { ...@@ -623,15 +629,15 @@ const ImportActionTable = (props) => {
getSuggest(); getSuggest();
} }
} else if(changedValues.hasOwnProperty('nullable') ) { } else if(changedValues.hasOwnProperty('notNull') ) {
if (changedValues.nullable && ownPrimaryKey) { if (!changedValues.notNull && ownPrimaryKey) {
showMessage('info', '主键不允许为空'); showMessage('info', '主键不允许为空');
} }
} }
if (ownPrimaryKey) { if (ownPrimaryKey) {
form.setFieldsValue({ form.setFieldsValue({
nullable: false notNull: true
}); });
} }
...@@ -716,16 +722,14 @@ const ImportActionTable = (props) => { ...@@ -716,16 +722,14 @@ const ImportActionTable = (props) => {
} }
}, },
{ {
title: 'Null?', title: 'Not Null',
width: 50, width: 70,
dataIndex: 'nullable', dataIndex: 'notNull',
editable: (type==='model'?true:false), editable: (type==='model'?true:false),
render: (nullable, record, index) => { render: (notNull, record, index) => {
if (!nullable) { if (!notNull) {
return ( return '-';
<CloseOutlined /> } else if (notNull) {
);
} else if (nullable === true) {
return ( return (
<CheckOutlined /> <CheckOutlined />
) )
...@@ -741,9 +745,7 @@ const ImportActionTable = (props) => { ...@@ -741,9 +745,7 @@ const ImportActionTable = (props) => {
editable: (type==='model'?true:false), editable: (type==='model'?true:false),
render: (partOfPrimaryKeyLogically, record, index) => { render: (partOfPrimaryKeyLogically, record, index) => {
if (!partOfPrimaryKeyLogically) { if (!partOfPrimaryKeyLogically) {
return ( return '-';
<CloseOutlined />
);
} else if (partOfPrimaryKeyLogically === true) { } else if (partOfPrimaryKeyLogically === true) {
return ( return (
<CheckOutlined /> <CheckOutlined />
...@@ -760,9 +762,7 @@ const ImportActionTable = (props) => { ...@@ -760,9 +762,7 @@ const ImportActionTable = (props) => {
// editable: (type==='model'?true:false), // editable: (type==='model'?true:false),
// render: (partOfDistributionKey, record, index) => { // render: (partOfDistributionKey, record, index) => {
// if (!partOfDistributionKey) { // if (!partOfDistributionKey) {
// return ( // return '-';
// <CloseOutlined />
// );
// } else if (partOfDistributionKey === true) { // } else if (partOfDistributionKey === true) {
// return ( // return (
// <CheckOutlined /> // <CheckOutlined />
...@@ -779,9 +779,7 @@ const ImportActionTable = (props) => { ...@@ -779,9 +779,7 @@ const ImportActionTable = (props) => {
editable: (type==='model'?true:false), editable: (type==='model'?true:false),
render: (foreignKey, record, index) => { render: (foreignKey, record, index) => {
if (!foreignKey) { if (!foreignKey) {
return ( return '-';
<CloseOutlined />
);
} else if (foreignKey === true) { } else if (foreignKey === true) {
return ( return (
<CheckOutlined /> <CheckOutlined />
...@@ -798,9 +796,7 @@ const ImportActionTable = (props) => { ...@@ -798,9 +796,7 @@ const ImportActionTable = (props) => {
editable: (type==='model'?true:false), editable: (type==='model'?true:false),
render: (needAttention, record, index) => { render: (needAttention, record, index) => {
if (!needAttention) { if (!needAttention) {
return ( return '-';
<CloseOutlined />
);
} else if (needAttention === true) { } else if (needAttention === true) {
return ( return (
<CheckOutlined /> <CheckOutlined />
...@@ -1047,7 +1043,7 @@ const ImportActionTable = (props) => { ...@@ -1047,7 +1043,7 @@ const ImportActionTable = (props) => {
onCell: (record) => ({ onCell: (record) => ({
record, record,
dataIndex: col.dataIndex, dataIndex: col.dataIndex,
inputType: (col.dataIndex==='nullable' || col.dataIndex==='partOfDistributionKey' || col.dataIndex==='partOfPrimaryKeyLogically' || col.dataIndex==='needAttention' || col.dataIndex==='foreignKey') ? 'check' : 'text', inputType: (col.dataIndex==='notNull' || col.dataIndex==='partOfDistributionKey' || col.dataIndex==='partOfPrimaryKeyLogically' || col.dataIndex==='needAttention' || col.dataIndex==='foreignKey') ? 'check' : 'text',
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