| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, Empty, notification, Input, Tree, Modal } from 'antd' |
| | | import { FolderOpenOutlined, FolderOutlined, FileOutlined } from '@ant-design/icons' |
| | | import { Spin, Empty, notification, Input, Tree, Modal, Dropdown } from 'antd' |
| | | import { FolderOpenOutlined, FolderOutlined, FileOutlined, MoreOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import TimerTask from '@/utils/timer-task.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TreeNode } = Tree |
| | | const { Search } = Input |
| | | |
| | | const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) |
| | | |
| | | class NormalTree extends Component { |
| | | static propTpyes = { |
| | |
| | | */ |
| | | renderTreeNodes = (nodes) => { |
| | | return nodes.map(item => { |
| | | let title = item.$title |
| | | |
| | | title = <> |
| | | {item.$title} |
| | | <Dropdown overlay={ |
| | | <div className="mk-tree-dropdown-wrap" onClick={(e) => e.stopPropagation()}> |
| | | <MainAction |
| | | BID={this.state.BID} |
| | | BData={this.state.BData} |
| | | setting={this.state.config.setting} |
| | | actions={this.state.config.action} |
| | | columns={this.state.config.columns} |
| | | selectedData={[item]} |
| | | /> |
| | | </div> |
| | | } placement="bottomCenter" trigger={['hover']}> |
| | | <MoreOutlined onClick={(e) => e.stopPropagation()}/> |
| | | </Dropdown> |
| | | </> |
| | | |
| | | if (item.children) { |
| | | return ( |
| | | <TreeNode icon={<span><FolderOpenOutlined /><FolderOutlined /></span>} title={item.$title} key={item.$key} dataRef={item}> |
| | | <TreeNode icon={<span><FolderOpenOutlined /><FolderOutlined /></span>} title={title} key={item.$key} dataRef={item}> |
| | | {this.renderTreeNodes(item.children)} |
| | | </TreeNode> |
| | | ) |
| | | } |
| | | return <TreeNode icon={<FileOutlined />} key={item.$key} title={item.$title} dataRef={item} isLeaf /> |
| | | return <TreeNode icon={<FileOutlined />} key={item.$key} title={title} dataRef={item} isLeaf /> |
| | | }) |
| | | } |
| | | |