|
@ -42,7 +42,7 @@ const DatabaseTable = (props) => { |
|
|
const onEdit = (record) => { |
|
|
const onEdit = (record) => { |
|
|
dispatch(metadataManagement.getMetadataModels({ modelTypes: ModelTypes })).then(res => { |
|
|
dispatch(metadataManagement.getMetadataModels({ modelTypes: ModelTypes })).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
setEditData({ title: '修改库表元数据', record: { path: '/' + resourceCatalogPath.join('/'), ...record } }); |
|
|
setEditData({ title: '修改库表元数据', record: { path: '/' + resourceCatalogPath.join('/'), ...record, ...record.attributesParam } }); |
|
|
setModalVisible(true); |
|
|
setModalVisible(true); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -178,25 +178,25 @@ const DatabaseTable = (props) => { |
|
|
} |
|
|
} |
|
|
//新建、修改
|
|
|
//新建、修改
|
|
|
const onConfirm = (values) => { |
|
|
const onConfirm = (values) => { |
|
|
let obj = { ...values } |
|
|
let obj = {} |
|
|
// if (editData.add) {
|
|
|
if (editData.add) { |
|
|
// obj = { ...values, ...editData.record || {} }
|
|
|
obj = { createBy: user.id, catalog: resourceCatalogId, catalogKey: resourceCatalogKey, ...values } |
|
|
// dispatch(metadataManagement.postResourceCatalog(obj)).then(() => {
|
|
|
dispatch(metadataManagement.postMeatadataDatabases(obj)).then(() => { |
|
|
// onSearch(); setModalVisible(false);
|
|
|
onSearch(); setModalVisible(false); |
|
|
// });
|
|
|
}); |
|
|
// } else {
|
|
|
} else { |
|
|
// dispatch(metadataManagement.putResourceCatalog(editData.record.id, obj)).then(() => {
|
|
|
obj = { catalog: resourceCatalogId, catalogKey: resourceCatalogKey, ...values } |
|
|
// onSearch(); setModalVisible(false);
|
|
|
dispatch(metadataManagement.putMeatadataDatabases(editData.record.id, obj)).then(() => { |
|
|
// });
|
|
|
onSearch(); setModalVisible(false); |
|
|
// }
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return <Spin spinning={isRequesting}> |
|
|
return <Spin spinning={isRequesting}> |
|
|
< div style={{ marginBottom: 16 } |
|
|
<div style={{ marginBottom: 16 }}> |
|
|
}> |
|
|
|
|
|
<Button type='primary' onClick={() => { |
|
|
<Button type='primary' onClick={() => { |
|
|
dispatch(metadataManagement.getMetadataModels({ modelTypes: ModelTypes })).then(res => { |
|
|
dispatch(metadataManagement.getMetadataModels({ modelTypes: ModelTypes })).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
setEditData({ title: '新建库表元数据', record: { path: '/' + resourceCatalogPath.join('/') } }); |
|
|
setEditData({ add: true, title: '新建库表元数据', record: { path: '/' + resourceCatalogPath.join('/') } }); |
|
|
setModalVisible(true); |
|
|
setModalVisible(true); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -255,7 +255,6 @@ const DatabaseTable = (props) => { |
|
|
{ |
|
|
{ |
|
|
modalVisible ? |
|
|
modalVisible ? |
|
|
<MetadataDatabaseModal |
|
|
<MetadataDatabaseModal |
|
|
resourceCatalogPath={resourceCatalogPath} |
|
|
|
|
|
modelTypes={ModelTypes.filter(m => m === '目录')} |
|
|
modelTypes={ModelTypes.filter(m => m === '目录')} |
|
|
metadataModels={metadataModels.filter(m => m.modelType === '目录')} |
|
|
metadataModels={metadataModels.filter(m => m.modelType === '目录')} |
|
|
editData={editData} |
|
|
editData={editData} |
|
|