Commit f8c6a8c0 by zhaochengxiang

模型目录功能统一

parent b40dbf97
...@@ -13,7 +13,7 @@ export function loadDataModelStateCatalog() { ...@@ -13,7 +13,7 @@ export function loadDataModelStateCatalog() {
} }
export function saveDataModelCatalog(payload) { export function saveDataModelCatalog(payload) {
return PostJSON("/datamodeler/easyDataModelerCURD/saveDataModelCatalog", payload); return Post("/datamodeler/easyDataModelerCURD/saveDataModelCatalog", payload);
} }
export function deleteDataModelCatalog(payload) { export function deleteDataModelCatalog(payload) {
......
...@@ -315,14 +315,14 @@ const ModelTree = (props) => { ...@@ -315,14 +315,14 @@ const ModelTree = (props) => {
const refresh = () => { const refresh = () => {
if (viewSelectedKey==='dir') { if (viewSelectedKey==='dir') {
getDirTreeData(); getDirTreeData(item?.key||'');
} else { } else {
getStateTreeData(); getStateTreeData(item?.key||'');
} }
} }
const sync = () => { const sync = () => {
getDirTreeData('', null, 'load'); getDirTreeData(item?.key||'', null, 'load');
} }
const moveNode = (steps) => { const moveNode = (steps) => {
...@@ -341,7 +341,7 @@ const ModelTree = (props) => { ...@@ -341,7 +341,7 @@ const ModelTree = (props) => {
callback: () => { callback: () => {
showMessage('success', (steps===-1)?'上移目录成功':'下移目录成功'); showMessage('success', (steps===-1)?'上移目录成功':'下移目录成功');
setItem(null); setItem(null);
getDirTreeData(); getDirTreeData(item.key);
}, },
error: () => { error: () => {
setLoading(false); setLoading(false);
...@@ -382,11 +382,16 @@ const ModelTree = (props) => { ...@@ -382,11 +382,16 @@ const ModelTree = (props) => {
} }
const onUpdateTreeItemModalOk = (updateItem) => { const onUpdateTreeItemModalOk = (id, updateItem) => {
setVisible(false); setVisible(false);
if (type === 'add') {
getDirTreeData(id);
} else {
setItem(updateItem); setItem(updateItem);
itemRef.current = updateItem; itemRef.current = updateItem;
getDirTreeData(); getDirTreeData(id);
}
} }
const onUpdateTreeItemModalCancel = () => { const onUpdateTreeItemModalCancel = () => {
......
...@@ -133,12 +133,12 @@ const UpdateTreeItemModal = (props) => { ...@@ -133,12 +133,12 @@ const UpdateTreeItemModal = (props) => {
payload: { payload: {
data: payload data: payload
}, },
callback: () => { callback: id => {
setConfirmLoading(false); setConfirmLoading(false);
if (onOk) { if (onOk) {
onOk(type==='add'?item:payload); onOk(id, payload);
} }
}, },
error: () => { error: () => {
......
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