Commit 2e7d2114 by zhaochengxiang

增加关联关系

parent bc071b02
...@@ -156,3 +156,7 @@ export function* fillElementValueBeforeCreate(payload) { ...@@ -156,3 +156,7 @@ export function* fillElementValueBeforeCreate(payload) {
export function* countResourceState(payload) { export function* countResourceState(payload) {
return yield call(service.countResourceState, payload); return yield call(service.countResourceState, payload);
} }
export function* getResourceRelations(payload) {
return yield call(service.getResourceRelations, payload);
}
\ No newline at end of file
...@@ -163,3 +163,7 @@ export function fillElementValueBeforeCreate(payload) { ...@@ -163,3 +163,7 @@ export function fillElementValueBeforeCreate(payload) {
export function countResourceState(payload) { export function countResourceState(payload) {
return GetJSON("/dataassetmanager/countApi/countResourceState", payload); return GetJSON("/dataassetmanager/countApi/countResourceState", payload);
} }
export function getResourceRelations(payload) {
return GetJSON("/dataassetmanager/resourceApi/getResourceRelations", payload);
}
...@@ -22,7 +22,7 @@ const AssetAction = (props) => { ...@@ -22,7 +22,7 @@ const AssetAction = (props) => {
const [ loading, setLoading ] = useState(false); const [ loading, setLoading ] = useState(false);
const [ confirmLoading, setConfirmLoading ] = useState(false); const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false); const [ fullScreen, setFullScreen ] = useState(false);
const [ resourceRelations, setResourceRelations ] = useState([]);
const { assets, attributes, attributesFoldMap } = assetParams; const { assets, attributes, attributesFoldMap } = assetParams;
useEffect(() => { useEffect(() => {
...@@ -31,6 +31,7 @@ const AssetAction = (props) => { ...@@ -31,6 +31,7 @@ const AssetAction = (props) => {
} else { } else {
setCurrentAction('detail'); setCurrentAction('detail');
if ((id||'')!=='') { if ((id||'')!=='') {
getResourceRelations();
getAsset(); getAsset();
} else { } else {
setMetadataId(''); setMetadataId('');
...@@ -41,6 +42,18 @@ const AssetAction = (props) => { ...@@ -41,6 +42,18 @@ const AssetAction = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, [id]) }, [id])
const getResourceRelations = () => {
dispatch({
type: 'assetmanage.getResourceRelations',
payload: {
dataAssetId: id,
},
callback: data => {
setResourceRelations(data);
}
});
}
const getElements = ( cb = null ) => { const getElements = ( cb = null ) => {
setLoading(true); setLoading(true);
dispatch({ dispatch({
...@@ -300,7 +313,7 @@ const AssetAction = (props) => { ...@@ -300,7 +313,7 @@ const AssetAction = (props) => {
{assets.currentPath||''} {assets.currentPath||''}
</a> </a>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 0 }}> <Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<AppContext.Consumer> <AppContext.Consumer>
{ {
value => { value => {
...@@ -309,6 +322,20 @@ const AssetAction = (props) => { ...@@ -309,6 +322,20 @@ const AssetAction = (props) => {
} }
</AppContext.Consumer> </AppContext.Consumer>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>关联关系</div>}
style={{ paddingBottom: 0 }}
>
<div className='flex' style={{ flexDirection: 'column' }}>
{
(resourceRelations||[]).map((item, key) => {
return (
<span key={key}>{item}</span>
);
})
}
</div>
</Descriptions.Item>
</Descriptions> </Descriptions>
</div> </div>
{ {
......
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