|
@ -1,4 +1,4 @@ |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import React, { useEffect, useState ,useRef} from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { Button, Col, Row, Input, Tree, Table, Space } from '@douyinfe/semi-ui'; |
|
|
import { Button, Col, Row, Input, Tree, Table, Space } from '@douyinfe/semi-ui'; |
|
|
import { IconSearch, IconEditStroked, IconMinusCircleStroked, IconPlusCircleStroked } from '@douyinfe/semi-icons'; |
|
|
import { IconSearch, IconEditStroked, IconMinusCircleStroked, IconPlusCircleStroked } from '@douyinfe/semi-icons'; |
|
@ -6,14 +6,16 @@ import '../style.less' |
|
|
|
|
|
|
|
|
const ResourceRepository = (props) => { |
|
|
const ResourceRepository = (props) => { |
|
|
const { dispatch, actions, clientHeight } = props; |
|
|
const { dispatch, actions, clientHeight } = props; |
|
|
|
|
|
const ref = useRef(); |
|
|
|
|
|
|
|
|
const treeData = [ |
|
|
const treeData = [ |
|
|
{ |
|
|
{ |
|
|
label: (<div> |
|
|
label: (<div> |
|
|
<span>亚洲</span> |
|
|
<span>亚洲</span> |
|
|
<span className='tree-icon'> |
|
|
<span className='tree-icon'> |
|
|
<IconEditStroked size='default' onClick={() => alert("bianji")} /> |
|
|
<IconEditStroked size='default' onClick={() => alert("bianji")} /> |
|
|
<IconMinusCircleStroked size='default' onClick={() => alert("sahnchu")}/> |
|
|
<IconMinusCircleStroked size='default' onClick={() => alert("sahnchu")} /> |
|
|
<IconPlusCircleStroked size='default' onClick={() => alert("+")}/></span> |
|
|
<IconPlusCircleStroked size='default' onClick={() => alert("+")} /></span> |
|
|
</div> |
|
|
</div> |
|
|
), |
|
|
), |
|
|
value: 'Asia', |
|
|
value: 'Asia', |
|
@ -46,17 +48,17 @@ const ResourceRepository = (props) => { |
|
|
{ |
|
|
{ |
|
|
label: '中国', |
|
|
label: '中国', |
|
|
value: 'China', |
|
|
value: 'China', |
|
|
key: '0-0', |
|
|
key: '1-0', |
|
|
children: [ |
|
|
children: [ |
|
|
{ |
|
|
{ |
|
|
label: '北京', |
|
|
label: '北京', |
|
|
value: 'Beijing', |
|
|
value: 'Beijing2', |
|
|
key: '0-0-0', |
|
|
key: '1-0-0', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '上海', |
|
|
label: '上海', |
|
|
value: 'Shanghai', |
|
|
value: 'Shanghai', |
|
|
key: '0-0-1', |
|
|
key: '1-0-1', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
@ -207,10 +209,14 @@ const ResourceRepository = (props) => { |
|
|
<Col className='left' span={6}> |
|
|
<Col className='left' span={6}> |
|
|
<Button theme='solid' type='primary' >新建文件夹</Button> |
|
|
<Button theme='solid' type='primary' >新建文件夹</Button> |
|
|
<br /> |
|
|
<br /> |
|
|
<Input suffix={<IconSearch />} showClear placeholder="请输入"></Input> |
|
|
<Input suffix={<IconSearch />} showClear onChange={v => ref.current.search(v)} placeholder="请输入"></Input> |
|
|
<Tree |
|
|
<Tree |
|
|
|
|
|
ref={ref} |
|
|
treeData={treeData} |
|
|
treeData={treeData} |
|
|
defaultExpandAll |
|
|
defaultExpandAll |
|
|
|
|
|
filterTreeNode |
|
|
|
|
|
searchRender={false} |
|
|
|
|
|
blockNode={false} |
|
|
directory |
|
|
directory |
|
|
style={style} |
|
|
style={style} |
|
|
/> |
|
|
/> |
|
|