Commit 0b873519 by zhaochengxiang

模型字段编辑

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