Commit 431e28dc by zhaochengxiang

关联关系

parent 65e7da60
......@@ -58,7 +58,7 @@ const AssetAction = (props) => {
dataAssetId: id,
},
callback: data => {
setResourceRelations(data);
setResourceRelations(data||[]);
}
});
}
......@@ -382,7 +382,7 @@ const AssetAction = (props) => {
{
(resourceRelations||[]).map((item, key) => {
return (
<span key={key}>{item}</span>
<span key={key}>{item?.dataAssetName||''}</span>
);
})
}
......
import React, { useEffect, useState, useRef } from 'react';
import { useMount, useUnmount } from 'ahooks';
import {Card, Spin, Tooltip, Tree, Dropdown, Menu, Modal, AutoComplete} from 'antd';
import { PlusOutlined, ImportOutlined,ExportOutlined,ReloadOutlined, SettingOutlined } from '@ant-design/icons';
import classNames from 'classnames';
......@@ -54,13 +53,15 @@ const AssetTree = (props) => {
const treeDataRef = useRef([]);
const dataListRef = useRef([]);
useMount(() => {
useEffect(() => {
window?.addEventListener("storage", storageChange);
})
useUnmount(() => {
window?.removeEventListener("storage", storageChange);
})
return () => {
window?.removeEventListener("storage", storageChange);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => {
if ((id||'') !== '') {
......@@ -699,9 +700,11 @@ const AssetTree = (props) => {
/>
{
(reference!==AssetMountReference) && <RcMenu id={MENU_ID}>
<RcItem id="edit" onClick={editDir}>
修改目录
</RcItem>
{
currentRightClickDir && (currentRightClickDir.type!=='custom') && <RcItem id="edit" onClick={editDir}>
修改目录
</RcItem>
}
<RcItem id="up" onClick={() => { moveNode(1); }}>
上移目录
</RcItem>
......
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