Commit 8a5b9af0 by zhaochengxiang

无资产选中 详情显示要素

parent fc9103fd
...@@ -35,7 +35,7 @@ const AssetAction = (props) => { ...@@ -35,7 +35,7 @@ const AssetAction = (props) => {
} else { } else {
setMetadataId(''); setMetadataId('');
setAssetParams({...assetParams, ...{assets: {}, attributes: []}}); setAssetParams({...assetParams, ...{assets: {}, attributes: []}});
setElements([]); getElements();
} }
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
...@@ -50,7 +50,6 @@ const AssetAction = (props) => { ...@@ -50,7 +50,6 @@ const AssetAction = (props) => {
setElements(data||[]); setElements(data||[]);
onElementsChange && onElementsChange(data||[]); onElementsChange && onElementsChange(data||[]);
if (action === 'add') {
const _attributes = []; const _attributes = [];
(data||[]).forEach(element => { (data||[]).forEach(element => {
if (_attributes.indexOf(element.type) === -1) { if (_attributes.indexOf(element.type) === -1) {
...@@ -67,7 +66,6 @@ const AssetAction = (props) => { ...@@ -67,7 +66,6 @@ const AssetAction = (props) => {
setAssetParams({ assets: {}, attributes: _attributes, attributesFoldMap: newAttributesFoldMap }); setAssetParams({ assets: {}, attributes: _attributes, attributesFoldMap: newAttributesFoldMap });
form?.resetFields(); form?.resetFields();
}
cb && cb(); cb && cb();
}, },
...@@ -260,6 +258,8 @@ const AssetAction = (props) => { ...@@ -260,6 +258,8 @@ const AssetAction = (props) => {
<div>资产详情</div> <div>资产详情</div>
<Space> <Space>
{ {
((id||'')!=='') && <React.Fragment>
{
(currentAction!=='detail') && <Tooltip title='取消编辑'> (currentAction!=='detail') && <Tooltip title='取消编辑'>
<Button <Button
onClick={onCancelButtonClick} onClick={onCancelButtonClick}
...@@ -276,6 +276,8 @@ const AssetAction = (props) => { ...@@ -276,6 +276,8 @@ const AssetAction = (props) => {
type='text' type='text'
/> />
</Tooltip> </Tooltip>
</React.Fragment>
}
<Tooltip title={fullScreen?'取消全屏':'全屏'}> <Tooltip title={fullScreen?'取消全屏':'全屏'}>
<Button <Button
onClick={onFullScreenClick} onClick={onFullScreenClick}
...@@ -287,11 +289,10 @@ const AssetAction = (props) => { ...@@ -287,11 +289,10 @@ const AssetAction = (props) => {
</div> </div>
} }
{ {
(action!=='add') && <div> (action!=='add' && (id||'')!=='') && <div>
<div className='pl-common py-compact-common'> <div className='pl-common py-compact-common'>
<Descriptions column={1}> <Descriptions column={1}>
{ <Descriptions.Item
(assets.currentPath||'')!=='' && <Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产路径</div>} label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产路径</div>}
style={{ paddingBottom: 15 }} style={{ paddingBottom: 15 }}
> >
...@@ -299,7 +300,6 @@ const AssetAction = (props) => { ...@@ -299,7 +300,6 @@ 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: 0 }}>
<AppContext.Consumer> <AppContext.Consumer>
{ {
......
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