Commit 2e7d2114 by zhaochengxiang

增加关联关系

parent bc071b02
......@@ -156,3 +156,7 @@ export function* fillElementValueBeforeCreate(payload) {
export function* 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) {
export function 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) => {
const [ loading, setLoading ] = useState(false);
const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false);
const [ resourceRelations, setResourceRelations ] = useState([]);
const { assets, attributes, attributesFoldMap } = assetParams;
useEffect(() => {
......@@ -31,6 +31,7 @@ const AssetAction = (props) => {
} else {
setCurrentAction('detail');
if ((id||'')!=='') {
getResourceRelations();
getAsset();
} else {
setMetadataId('');
......@@ -41,6 +42,18 @@ const AssetAction = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [id])
const getResourceRelations = () => {
dispatch({
type: 'assetmanage.getResourceRelations',
payload: {
dataAssetId: id,
},
callback: data => {
setResourceRelations(data);
}
});
}
const getElements = ( cb = null ) => {
setLoading(true);
dispatch({
......@@ -300,7 +313,7 @@ const AssetAction = (props) => {
{assets.currentPath||''}
</a>
</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>
{
value => {
......@@ -309,6 +322,20 @@ const AssetAction = (props) => {
}
</AppContext.Consumer>
</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>
</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