Commit a121c633 by zhaochengxiang

草稿资产目录路径对比

parent 5d40d763
......@@ -70,7 +70,9 @@ const AssetAction = (props) => {
const [modal, contextHolder] = Modal.useModal();
const [permissions, setPermissions] = useState(undefined);
const [keyword, setKeyword] = useState('');
const [publishedAssetPaths, setPublishedAssetPaths] = useState([]);
const [publishedAsset, setPublishedAsset] = useState();
const [isMetadataEdit, setMetadataEdit] = useState(false);
const [loadingSaveAsDraft, setLoadingSaveAsDraft] = React.useState(false)
const [needSaveAsDraft, setNeedSaveAsDraft] = React.useState()
......@@ -525,6 +527,18 @@ const AssetAction = (props) => {
});
}
const getPublishedAssetPaths = (id) => {
dispatch({
type: 'assetmanage.getAssetPaths',
payload: {
dataAssetId: id,
},
callback: data => {
setPublishedAssetPaths(data)
}
});
}
const getSystems = () => {
setLoadingSystems(true);
dispatch({
......@@ -676,6 +690,7 @@ const AssetAction = (props) => {
//只有修改的资产草稿才有版本比对
if (reference === AssetDraftReference && data?.dataAssetId && (data?.dirIds??[]).length > 0 && data?.operation==='change') {
getPublishedAssetPaths(data?.dataAssetId)
getPublishedAsset(data?.dataAssetId, data?.dirIds[0])
}
......@@ -1238,17 +1253,18 @@ const AssetAction = (props) => {
label={<div className='title-text' style={{ textAlign: 'right', width: 90 }}>资产目录路径</div>}
style={{ paddingBottom: 0 }}
>
<div className='flex' style={{ flexDirection: 'column' }}>
<span>
{
(assetPaths||[]).map((item, key) => {
return (
<a key={key} onClick={() => { jumpToPath(item); }}>
<span>{item?.dataAssetName||''}</span>
(assetPaths??[]).length > 0 && <a onClick={() => { jumpToPath(assetPaths[0]); }}>
{assetPaths[0].dataAssetName||''}
</a>
);
})
}
</div>
{
(assetPaths??[]).length > 0 && (publishedAssetPaths??[]).length > 0 && assetPaths[0].dirId!==publishedAssetPaths[0].dirId && <Typography.Text className='ml-2 pointer' type='danger' onClick={() => { jumpToPath(publishedAssetPaths[0]) }}>
<del>{publishedAssetPaths[0].dataAssetName||''}</del>
</Typography.Text>
}
</span>
</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