Commit 8a5b9af0 by zhaochengxiang

无资产选中 详情显示要素

parent fc9103fd
......@@ -35,7 +35,7 @@ const AssetAction = (props) => {
} else {
setMetadataId('');
setAssetParams({...assetParams, ...{assets: {}, attributes: []}});
setElements([]);
getElements();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
......@@ -50,24 +50,22 @@ const AssetAction = (props) => {
setElements(data||[]);
onElementsChange && onElementsChange(data||[]);
if (action === 'add') {
const _attributes = [];
(data||[]).forEach(element => {
if (_attributes.indexOf(element.type) === -1) {
_attributes.push(element.type);
}
})
const _attributes = [];
(data||[]).forEach(element => {
if (_attributes.indexOf(element.type) === -1) {
_attributes.push(element.type);
}
})
let newAttributesFoldMap = {...attributesFoldMap};
(_attributes||[]).forEach(attribute => {
if (newAttributesFoldMap[attribute]===undefined || newAttributesFoldMap[attribute]===null) {
newAttributesFoldMap[attribute] = true;
}
})
let newAttributesFoldMap = {...attributesFoldMap};
(_attributes||[]).forEach(attribute => {
if (newAttributesFoldMap[attribute]===undefined || newAttributesFoldMap[attribute]===null) {
newAttributesFoldMap[attribute] = true;
}
})
setAssetParams({ assets: {}, attributes: _attributes, attributesFoldMap: newAttributesFoldMap });
form?.resetFields();
}
setAssetParams({ assets: {}, attributes: _attributes, attributesFoldMap: newAttributesFoldMap });
form?.resetFields();
cb && cb();
},
......@@ -260,22 +258,26 @@ const AssetAction = (props) => {
<div>资产详情</div>
<Space>
{
(currentAction!=='detail') && <Tooltip title='取消编辑'>
<Button
onClick={onCancelButtonClick}
icon={<CancelSvg style={{ width: 20, height: 20 }} />}
type='text'
/>
</Tooltip>
((id||'')!=='') && <React.Fragment>
{
(currentAction!=='detail') && <Tooltip title='取消编辑'>
<Button
onClick={onCancelButtonClick}
icon={<CancelSvg style={{ width: 20, height: 20 }} />}
type='text'
/>
</Tooltip>
}
<Tooltip title={(currentAction==='detail')?'编辑':'保存'}>
<Button
loading={confirmLoading}
onClick={onActionButtonClick}
icon={(currentAction==='detail')?<EditSvg style={{ width: 20, height: 20 }} />: <SaveSvg style={{ width: 20, height: 20 }} />}
type='text'
/>
</Tooltip>
</React.Fragment>
}
<Tooltip title={(currentAction==='detail')?'编辑':'保存'}>
<Button
loading={confirmLoading}
onClick={onActionButtonClick}
icon={(currentAction==='detail')?<EditSvg style={{ width: 20, height: 20 }} />: <SaveSvg style={{ width: 20, height: 20 }} />}
type='text'
/>
</Tooltip>
<Tooltip title={fullScreen?'取消全屏':'全屏'}>
<Button
onClick={onFullScreenClick}
......@@ -287,19 +289,17 @@ const AssetAction = (props) => {
</div>
}
{
(action!=='add') && <div>
(action!=='add' && (id||'')!=='') && <div>
<div className='pl-common py-compact-common'>
<Descriptions column={1}>
{
(assets.currentPath||'')!=='' && <Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产路径</div>}
style={{ paddingBottom: 15 }}
>
<a onClick={()=>{jumpToPath();}}>
{assets.currentPath||''}
</a>
</Descriptions.Item>
}
<Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产路径</div>}
style={{ paddingBottom: 15 }}
>
<a onClick={()=>{jumpToPath();}}>
{assets.currentPath||''}
</a>
</Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 0 }}>
<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