From bf99f8f61f118d72f2ed79f5d85ead493c11bb67 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 21 二月 2023 09:24:40 +0800 Subject: [PATCH] 2023-02-21 --- src/tabviews/custom/components/tree/antd-tree/index.jsx | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 688fe7a..b381c81 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -1,17 +1,20 @@ 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 = { @@ -390,14 +393,34 @@ */ 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 /> }) } -- Gitblit v1.8.0