Commit 0c74811a by zhaochengxiang

主数据资产隐藏字段级资产目录

parent f357bfc2
...@@ -1510,20 +1510,22 @@ const AssetAction = (props) => { ...@@ -1510,20 +1510,22 @@ const AssetAction = (props) => {
编辑 编辑
</Button> </Button>
} }
<Button {
((reference!==AssetDraftReference)||(reference===AssetDraftReference&&assets?.templateType!=='mdg')) && <Button
onClick={() => { onClick={() => {
if (metadata?.metadataTableId) { if (metadata?.metadataTableId) {
setAttributeMaintainParam({ setAttributeMaintainParam({
visible: true, visible: true,
metadataId: metadata?.metadataTableId metadataId: metadata?.metadataTableId
}); });
} else { } else {
showMessage("warn","该资产目录没有关联元数据信息"); showMessage("warn","该资产目录没有关联元数据信息");
} }
}} }}
> >
字段级维护 字段级维护
</Button> </Button>
}
</React.Fragment> </React.Fragment>
} }
<Input size="middle" <Input size="middle"
...@@ -1573,6 +1575,7 @@ const AssetAction = (props) => { ...@@ -1573,6 +1575,7 @@ const AssetAction = (props) => {
<AttributeMaintain <AttributeMaintain
visible={attributeMaintainParam.visible} visible={attributeMaintainParam.visible}
metadataId={attributeMaintainParam.metadataId} metadataId={attributeMaintainParam.metadataId}
asset={assets}
reference={reference} reference={reference}
onCancel={onAttributeMaintainCancel} onCancel={onAttributeMaintainCancel}
onChange={onAttributeMaintainChange} onChange={onAttributeMaintainChange}
......
...@@ -9,7 +9,7 @@ import download from '../../../../util/download'; ...@@ -9,7 +9,7 @@ import download from '../../../../util/download';
import { AssetDraftReference, AssetManageReference } from '../../../../util/constant'; import { AssetDraftReference, AssetManageReference } from '../../../../util/constant';
const FC = (props) => { const FC = (props) => {
const { onCancel, onSuccess, visible, metadataId, onChange, reference } = props; const { onCancel, onSuccess, visible, metadataId, asset, onChange, reference } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [catalogId, setCatalogId] = useState('1'); const [catalogId, setCatalogId] = useState('1');
...@@ -84,6 +84,11 @@ const FC = (props) => { ...@@ -84,6 +84,11 @@ const FC = (props) => {
] ]
useEffect(() => { useEffect(() => {
setCatalogId((asset?.templateType==='mdg')?'2':'1')
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [asset])
useEffect(() => {
if (visible) { if (visible) {
getLogs(); getLogs();
} }
...@@ -95,11 +100,19 @@ const FC = (props) => { ...@@ -95,11 +100,19 @@ const FC = (props) => {
return [{ title: '字段级资产目录', key: '1' }] return [{ title: '字段级资产目录', key: '1' }]
} }
if (asset?.templateType==='mdg') {
return [
{ title: '映射关系', key: '2' },
]
}
return [ return [
{ title: '字段级资产目录', key: '1' }, { title: '字段级资产目录', key: '1' },
{ title: '映射关系', key: '2' }, { title: '映射关系', key: '2' },
] ]
}, [reference]) }, [reference, asset])
const getLogs = () => { const getLogs = () => {
setLoading(true); setLoading(true);
......
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