Commit cd22ec04 by zhaochengxiang

增加上下移

parent 922fb667
......@@ -105,6 +105,10 @@ export function* getDirectoryById(payload) {
return yield call(service.getDirectoryById, payload);
}
export function* upDownDirectory(payload) {
return yield call(service.upDownDirectory, payload);
}
export function* loadDataAssets(payload) {
return yield call(service.loadDataAssets, payload);
}
......
......@@ -128,6 +128,10 @@ export function getDirectoryById(payload) {
return GetJSON("/dataassetmanager/directoryApi/getDirectoryById", payload);
}
export function upDownDirectory(payload) {
return PostJSON("/dataassetmanager/directoryApi/upDownDirectory", payload);
}
export function getMetadataModelTree() {
return GetJSON("/metadatarepo/rest/model/tree");
}
......
import React, { useEffect, useState } from 'react';
import {Card, Spin, Tooltip, Tree, Input, Dropdown, Menu, Modal} from 'antd';
import { PlusOutlined, ImportOutlined,EditOutlined,DeleteOutlined,ExportOutlined,SyncOutlined, SettingOutlined } from '@ant-design/icons';
import { PlusOutlined, ImportOutlined,EditOutlined,DeleteOutlined,ExportOutlined,ReloadOutlined, SettingOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
import classNames from 'classnames';
import { dispatch } from '../../../../model';
......@@ -364,6 +364,31 @@ const AssetTree = (props) => {
}
}
const moveNode = (steps) => {
if ((currentDirId||'') === '') {
showMessage('info', '请先选择目录');
return;
}
setLoading(true);
dispatch({
type: 'assetmanage.upDownDirectory',
payload: {
params: {
dirId: currentDirId,
steps
}
},
callback: () => {
showMessage('success', (steps===1)?'上移目录成功':'下移目录成功');
getAllDirectoryAsTree();
},
error: () => {
setLoading(false);
}
});
}
const customDir = () => {
setCustomDirectoryAction('add');
setCustomDirectoryModalVisible(true);
......@@ -521,24 +546,30 @@ const AssetTree = (props) => {
<Tooltip title="新增目录">
<PlusOutlined onClick={addDir} style={{ fontSize:16,cursor: (currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }}/>
</Tooltip>
<Tooltip title="修改" className='ml-3'>
<Tooltip title="修改目录" className='ml-3'>
<EditOutlined onClick={editDir} style={{ fontSize:16,cursor: 'pointer' }} />
</Tooltip>
<Tooltip title="刷新" className='ml-3'>
<SyncOutlined onClick={refreshTree} style={{ fontSize:16,cursor:'pointer' }} />
<Tooltip title="刷新目录" className='ml-3'>
<ReloadOutlined onClick={refreshTree} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
<Tooltip title="导入" className='ml-3'>
<Tooltip title="导入目录" className='ml-3'>
<ImportOutlined onClick={importDir} style={{ fontSize:16,cursor:(currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip>
<Dropdown overlay={exportMenu} placement="bottomLeft" className='ml-3'>
<Tooltip title="导出">
<Tooltip title="导出目录">
<ExportOutlined style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
</Dropdown>
<Tooltip title="删除" className='ml-3'>
<Tooltip title="上移目录" className='ml-2'>
<ArrowUpOutlined onClick={() => { moveNode(1); }} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
<Tooltip title="下移目录" className='ml-2'>
<ArrowDownOutlined onClick={() => { moveNode(-1); }} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
<Tooltip title="删除目录" className='ml-3'>
<DeleteOutlined onClick={deleteDir} style={{ fontSize:16,cursor:(currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip>
<Tooltip title="自定义" className='ml-3'>
<Tooltip title="自定义目录" className='ml-3'>
<SettingOutlined onClick={customDir} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
</div>
......
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