|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-09-06 10:28:12
|
|
* @Date: 2021-09-06 10:28:12
|
|
- * @LastEditTime: 2021-10-11 10:39:49
|
|
|
|
|
|
+ * @LastEditTime: 2021-10-18 10:41:23
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/index.tsx
|
|
* @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/index.tsx
|
|
@@ -13,15 +13,16 @@ import { Input, Spin, Image, Popconfirm } from 'antd';
|
|
import { PlusOutlined } from '@ant-design/icons';
|
|
import { PlusOutlined } from '@ant-design/icons';
|
|
import DirectoryTree from './components/DirectoryTree';
|
|
import DirectoryTree from './components/DirectoryTree';
|
|
import './index.less'
|
|
import './index.less'
|
|
-
|
|
|
|
|
|
+import DelActionIcon from './images/del14px.png';
|
|
|
|
+import EditActionIcon from './images/edit14px.png';
|
|
|
|
+import AddActionIcon from './images/add.png';
|
|
|
|
+import FileIcon from './images/file.png';
|
|
|
|
|
|
// const { DirectoryTree } = Tree;
|
|
// const { DirectoryTree } = Tree;
|
|
const { Search } = Input;
|
|
const { Search } = Input;
|
|
|
|
|
|
//树形文件组件
|
|
//树形文件组件
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
enum Types { 'add', 'del', 'edit', 'search' };
|
|
enum Types { 'add', 'del', 'edit', 'search' };
|
|
|
|
|
|
type TypeVals = keyof typeof Types;
|
|
type TypeVals = keyof typeof Types;
|
|
@@ -56,12 +57,12 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
|
|
{
|
|
{
|
|
!isLeaf && ( //非叶子结点才可以新增
|
|
!isLeaf && ( //非叶子结点才可以新增
|
|
<>
|
|
<>
|
|
- <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'add', props)} src={'https://i.postimg.cc/fb3Fq26H/add.png'} />
|
|
|
|
|
|
+ <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'add', props)} src={AddActionIcon} />
|
|
<div style={{ width: 5 }}></div>
|
|
<div style={{ width: 5 }}></div>
|
|
</>
|
|
</>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
- <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'edit', props)} src={'https://i.postimg.cc/13HdKg0T/image.png'} />
|
|
|
|
|
|
+ <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'edit', props)} src={EditActionIcon} />
|
|
<div style={{ width: 5 }}></div>
|
|
<div style={{ width: 5 }}></div>
|
|
<Popconfirm
|
|
<Popconfirm
|
|
title="是否确定删除?"
|
|
title="是否确定删除?"
|
|
@@ -69,7 +70,7 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
|
|
okText="确定"
|
|
okText="确定"
|
|
cancelText="取消"
|
|
cancelText="取消"
|
|
>
|
|
>
|
|
- <Image width={15} preview={false} onClick={e=>e.stopPropagation()} src={'https://i.postimg.cc/HLkhvpBL/image.png'} />
|
|
|
|
|
|
+ <Image width={15} preview={false} onClick={e=>e.stopPropagation()} src={DelActionIcon} />
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
@@ -83,7 +84,7 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
|
|
setcurrentActivedIndex(id);
|
|
setcurrentActivedIndex(id);
|
|
onSelectHandle(nodeProps)
|
|
onSelectHandle(nodeProps)
|
|
} : () => { setcurrentActivedIndex(id); }}>
|
|
} : () => { setcurrentActivedIndex(id); }}>
|
|
- <div style={{ display: 'flex', marginRight: 5, justifyContent: 'center', alignItems: 'center' }} ><Image width={15} preview={false} src={'https://i.postimg.cc/vHvhJJ1x/image.png'} /> </div>
|
|
|
|
|
|
+ <div style={{ display: 'flex', marginRight: 5, justifyContent: 'center', alignItems: 'center' }} ><Image width={15} preview={false} src={FileIcon} /> </div>
|
|
<div className='treeNodeInner'>{`${code} ${title}`}</div>
|
|
<div className='treeNodeInner'>{`${code} ${title}`}</div>
|
|
|
|
|
|
{(currentActivedIndex == id && editable) && <Action {...nodeProps} /> /*点击展示操作项*/}
|
|
{(currentActivedIndex == id && editable) && <Action {...nodeProps} /> /*点击展示操作项*/}
|