Commit 5d6c6f5c by zhaochengxiang

资产环境

parent eefc4f1f
import { useEffect, useState } from 'react'; import { useEffect, useState, useContext } from 'react';
import { Radio } from 'antd'; import { Radio } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import Relation from './Relation'; import Relation from './Relation';
import Thermodynamic from './Thermodynamic'; import Thermodynamic from './Thermodynamic';
import { AssetBrowseReference, ResourceBrowseReference } from '../../../../util/constant'; import { AssetBrowseReference, ResourceBrowseReference } from '../../../../util/constant';
import { AppContext } from '../../../../App';
const relationTypes = [ const relationTypes = [
{ {
...@@ -21,6 +22,8 @@ const RelationContainer = (props) => { ...@@ -21,6 +22,8 @@ const RelationContainer = (props) => {
const { nodeParams, onChange, reference, resize } = props; const { nodeParams, onChange, reference, resize } = props;
const { env } = useContext(AppContext);
const [ type, setType ] = useState('relation'); const [ type, setType ] = useState('relation');
const [ dirs, setDirs ] = useState([]); const [ dirs, setDirs ] = useState([]);
const [ nodes, setNodes ] = useState([]); const [ nodes, setNodes ] = useState([]);
...@@ -30,7 +33,7 @@ const RelationContainer = (props) => { ...@@ -30,7 +33,7 @@ const RelationContainer = (props) => {
useEffect(() => { useEffect(() => {
getDirectoryData(); getDirectoryData();
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [ env ])
useEffect(() => { useEffect(() => {
if (type === 'relation') { if (type === 'relation') {
......
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