Commit 431e28dc by zhaochengxiang

关联关系

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