Commit 0b873519 by zhaochengxiang

模型字段编辑

parent acfbab7e
......@@ -109,6 +109,10 @@ const EditModel = (props) => {
newModelerData.easyDataModelerModelingTemplate = null;
}
if (newModelerData.partition && ( !newModelerData.partition.partitionType || newModelerData.partition.partitionType==={} || (newModelerData.partition.keys||[]).length===0 )) {
newModelerData.partition = null;
}
if (action==='add' && (cid||'')==='' && ((catalogId||'')==='')) {
setCatalogModalVisible(true);
return ;
......
......@@ -428,17 +428,46 @@ const ImportActionIndex = (props) => {
}
};
const remove = (record) => {
const newData = [...data];
const removeLogic = (record) => {
const newData = [...dataRef.current];
const index = newData.findIndex((item) => record.name === item.name);
if (index !== -1) {
newData.splice(index, 1);
}
onChange && onChange(newData);
}
setEditingKey(null);
const remove = (record) => {
if (record.name === '') {
const newData = [...dataRef.current];
onChange && onChange(newData);
} else {
if (record.name !== editingKey) {
save().then(result => {
if (result) {
removeLogic(record);
}
})
} else {
removeLogic(record);
}
}
save().then(result => {
if (result) {
const newData = [...dataRef.current];
const index = newData.findIndex((item) => record.name === item.name);
if (index !== -1) {
newData.splice(index, 1);
}
onChange && onChange(newData);
}
})
}
const save = async() => {
......@@ -676,7 +705,7 @@ const ImportActionIndex = (props) => {
}
title="规则详情"
>
<a href="">详情</a>
<a href="#">详情</a>
</Popover>
}
</div>
......
......@@ -404,8 +404,6 @@ const ImportActionTable = (props) => {
...record,
});
console.log('record', record);
setEditingKey(record?.iid);
setAutoTranslate((record?.name||'')==='');
......@@ -428,8 +426,8 @@ const ImportActionTable = (props) => {
}
};
const remove = (record) => {
const newData = [...data];
const removeLogic = (record) => {
const newData = [...moveRowRef.current.data];
const index = newData.findIndex((item) => record.iid === item.iid);
if (index !== -1) {
......@@ -437,11 +435,17 @@ const ImportActionTable = (props) => {
}
onChange && onChange(newData);
}
if (editingKey === record.iid) {
setEditingKey('');
setSuggests([]);
setEnglishSuggests([]);
const remove = (record) => {
if (record.iid !== editingKey) {
save().then(result => {
if (result) {
removeLogic(record);
}
})
} else {
removeLogic(record);
}
}
......
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