Commit 14f87fb1 by guomingpang
parents 11524618 dfaacbb6
...@@ -80,7 +80,7 @@ class CopyFileModal extends React.Component { ...@@ -80,7 +80,7 @@ class CopyFileModal extends React.Component {
// const { folderPathList, folderList } = this.state; // const { folderPathList, folderList } = this.state;
const { folderPathList, disk } = this.state; const { folderPathList, disk } = this.state;
const { dataInfo } = this.props; const { dataInfo } = this.props;
const { id, createId, folderName } = dataInfo; const { id, createId, folderName,folderType} = dataInfo;
const newParentId = folderPathList[folderPathList.length-1].id; const newParentId = folderPathList[folderPathList.length-1].id;
const _params = { const _params = {
copyIds : [id], // 复制文件的ID copyIds : [id], // 复制文件的ID
...@@ -99,7 +99,10 @@ class CopyFileModal extends React.Component { ...@@ -99,7 +99,10 @@ class CopyFileModal extends React.Component {
} }
return allowCopy; return allowCopy;
}) })
if(folderPathList.length > 9 && folderType === 'FOLDER'){
allowCopy = 1;
message.warning('不能将文件夹复制到10级目录下');
}
if (allowCopy === 0) { if (allowCopy === 0) {
Service.Hades('public/hadesStore/copyFolder', _params).then((res) => { Service.Hades('public/hadesStore/copyFolder', _params).then((res) => {
if (res.success) { if (res.success) {
......
...@@ -765,7 +765,7 @@ class FolderList extends React.Component { ...@@ -765,7 +765,7 @@ class FolderList extends React.Component {
}} }}
onMove={(query) => { onMove={(query) => {
this.setState({ showSelectFileModal: false }); this.setState({ showSelectFileModal: false });
this.props.onMove(query, [currentFile.id]); this.props.onMove(query, [currentFile.id],[currentFile.folderType]);
}} }}
/> />
{ {
......
...@@ -47,6 +47,7 @@ class FolderManage extends React.Component { ...@@ -47,6 +47,7 @@ class FolderManage extends React.Component {
folderPathList: [props.currentRootDisk], folderPathList: [props.currentRootDisk],
selectedFileIds: [], // 已被选择的文件 selectedFileIds: [], // 已被选择的文件
selectedFileRights: [], // 已被选择的文件对应权限 selectedFileRights: [], // 已被选择的文件对应权限
selectedFileType:[], // 已选择的文件的类型
folderList: [], // 当前目录下的文件 folderList: [], // 当前目录下的文件
searchKey: null, // 搜索关键字 searchKey: null, // 搜索关键字
totalCount: 0, // 该磁盘总共有的文件个数 totalCount: 0, // 该磁盘总共有的文件个数
...@@ -200,10 +201,12 @@ class FolderManage extends React.Component { ...@@ -200,10 +201,12 @@ class FolderManage extends React.Component {
handleChangeRow = (selectedRowKeys) => { handleChangeRow = (selectedRowKeys) => {
const { folderList } = this.state; const { folderList } = this.state;
let _selectedFileRights = []; let _selectedFileRights = [];
let _selectedFileType = [];
selectedRowKeys.map(folderId => { selectedRowKeys.map(folderId => {
folderList.map(item => { folderList.map(item => {
if (item.id === folderId) { if (item.id === folderId) {
_selectedFileRights.push(item.rights); _selectedFileRights.push(item.rights);
_selectedFileType.push(item.folderType);
} }
return _selectedFileRights; return _selectedFileRights;
}) })
...@@ -211,7 +214,8 @@ class FolderManage extends React.Component { ...@@ -211,7 +214,8 @@ class FolderManage extends React.Component {
}) })
this.setState({ this.setState({
selectedFileIds: selectedRowKeys, selectedFileIds: selectedRowKeys,
selectedFileRights: _selectedFileRights selectedFileRights: _selectedFileRights,
selectedFileType:_selectedFileType
}) })
} }
...@@ -255,12 +259,13 @@ class FolderManage extends React.Component { ...@@ -255,12 +259,13 @@ class FolderManage extends React.Component {
} }
// 移动文件 // 移动文件
handleMove = (query, sourceFileIds = this.state.selectedFileIds) => { handleMove = (query, sourceFileIds = this.state.selectedFileIds,selectedFileTypes=this.state.selectedFileType) => {
const { targetFolder, selectFolderPathList } = query; const { targetFolder, selectFolderPathList } = query;
const { currentRootDisk: { disk} } = this.props; const { currentRootDisk: { disk} } = this.props;
const { folderPathList } = this.state; const { folderPathList } = this.state;
const currentFolder = folderPathList[folderPathList.length - 1]; const currentFolder = folderPathList[folderPathList.length - 1];
const { id } = targetFolder; const { id } = targetFolder;
let canRemove = true;
// 将selectedFileIds移动到targetFolder // 将selectedFileIds移动到targetFolder
let params = { let params = {
disk, disk,
...@@ -271,28 +276,38 @@ class FolderManage extends React.Component { ...@@ -271,28 +276,38 @@ class FolderManage extends React.Component {
if (selectFolderPathList.length > 1) { if (selectFolderPathList.length > 1) {
params.newParentId = id params.newParentId = id
} }
Service.Hades('public/hadesStore/moveFolder', params).then((res) => { if(selectFolderPathList.length > 9){
selectedFileTypes.map((item)=>{
// 判断是否将文件移动到了自身或者子目录 //判定是否存在文件夹
const { result = {} } = res; if(item==="FOLDER"){
const { code, message: _message } = result; canRemove = false;
if (code === 'PARAM_ERROR') { message.warning('不能将文件夹移动到10级目录下');
message.warning(_message); }
return; })
} }
if (id == null) { if(canRemove){
Modal.success({ Service.Hades('public/hadesStore/moveFolder', params).then((res) => {
title: '文件移动成功', // 判断是否将文件移动到了自身或者子目录
content: '移动到一级目录的文件仅自己可以查看,如需其他成员查看请设置权限' const { result = {} } = res;
}) const { code, message: _message } = result;
} else { if (code === 'PARAM_ERROR') {
message.success('文件移动成功'); message.warning(_message);
} return;
}
if (id == null) {
Modal.success({
title: '文件移动成功',
content: '移动到一级目录的文件仅自己可以查看,如需其他成员查看请设置权限'
})
} else {
message.success('文件移动成功');
}
// 移动成功之后需要将selectedFileIds置为空 // 移动成功之后需要将selectedFileIds置为空
this.setState({ selectedFileIds: [] }); this.setState({ selectedFileIds: [] });
this.handleFetchFolderList({ parentId: currentFolder.id, current: 1}); this.handleFetchFolderList({ parentId: currentFolder.id, current: 1});
}) })
}
} }
// 修改文件路径 // 修改文件路径
......
...@@ -70,7 +70,7 @@ class OperateArea extends React.Component { ...@@ -70,7 +70,7 @@ class OperateArea extends React.Component {
// 判断当前目录是否在第10层,如果是的话提示最多只能创建10层文件夹 // 判断当前目录是否在第10层,如果是的话提示最多只能创建10层文件夹
const { folderPathList } = this.props; const { folderPathList } = this.props;
if (folderPathList.length > 10) { if (folderPathList.length > 9) {
message.warning('最多只能创建10层文件夹'); message.warning('最多只能创建10层文件夹');
return; return;
} }
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
margin-right: 20px margin-right: 20px
} }
.icon-img{ .icon-img{
width:16px; width:18px;
height:16px; height:18px;
margin-right:16px; margin-right:16px;
} }
.listType { .listType {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 15:53:31 * @Date: 2021-02-21 15:53:31
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-30 11:00:09 * @LastEditTime: 2021-06-08 16:46:15
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -44,22 +44,6 @@ export const menuList: any = [ ...@@ -44,22 +44,6 @@ export const menuList: any = [
] ]
}, },
{ {
groupName: "知识库",
groupCode: "CloudKnowledge",
icon: '',
link: '/knowledge-base',
img:'https://image.xiaomaiketang.com/xm/8sbP5rGQWh.png',
selectImg:'https://image.xiaomaiketang.com/xm/hJKCfibC22.png'
},
{
groupName: "资料云盘",
groupCode: "CloudDisk",
icon: '',
link: '/resource-disk',
img:'https://image.xiaomaiketang.com/xm/zGKbXJPzXx.png',
selectImg:'https://image.xiaomaiketang.com/xm/5sN4MzjxYc.png',
},
{
groupName: "培训管理", groupName: "培训管理",
groupCode: "TrainManage", groupCode: "TrainManage",
icon: '', icon: '',
...@@ -96,17 +80,28 @@ export const menuList: any = [ ...@@ -96,17 +80,28 @@ export const menuList: any = [
] ]
}, },
{ {
groupName: "学院管理", groupName: "知识库",
groupCode: "CloudShop", groupCode: "CloudKnowledge",
icon: '',
link: '/knowledge-base',
img:'https://image.xiaomaiketang.com/xm/8sbP5rGQWh.png',
selectImg:'https://image.xiaomaiketang.com/xm/hJKCfibC22.png'
},
{
groupName: "资料云盘",
groupCode: "CloudDisk",
icon: '',
link: '/resource-disk',
img:'https://image.xiaomaiketang.com/xm/zGKbXJPzXx.png',
selectImg:'https://image.xiaomaiketang.com/xm/5sN4MzjxYc.png',
},
{
groupName: "人员管理",
groupCode: "PersonManage",
icon: '', icon: '',
img:'https://image.xiaomaiketang.com/xm/Q8i5RSMKNc.png', img:'https://image.xiaomaiketang.com/xm/PRCnrt35y8.png',
children: [ children: [
{ {
groupName: "学院信息",
groupCode: "ShopInfo",
link: '/college-info'
},
{
groupName: "员工管理", groupName: "员工管理",
groupCode: "ShopStaff", groupCode: "ShopStaff",
link: '/college-employee' link: '/college-employee'
...@@ -115,11 +110,19 @@ export const menuList: any = [ ...@@ -115,11 +110,19 @@ export const menuList: any = [
groupName: "学员管理", groupName: "学员管理",
groupCode: "ShopUser", groupCode: "ShopUser",
link: '/college-user' link: '/college-user'
}, }
]
},
{
groupName: "学院管理",
groupCode: "CloudShop",
icon: '',
img:'https://image.xiaomaiketang.com/xm/Q8i5RSMKNc.png',
children: [
{ {
groupName: "课程分类", groupName: "学院信息",
groupCode: "CourseCategory", groupCode: "ShopInfo",
link: '/course-category-manage' link: '/college-info'
}, },
{ {
groupName: "学院装修", groupName: "学院装修",
...@@ -127,6 +130,11 @@ export const menuList: any = [ ...@@ -127,6 +130,11 @@ export const menuList: any = [
link: '/store-decoration' link: '/store-decoration'
}, },
{ {
groupName: "分类管理",
groupCode: "CourseCategory",
link: '/course-category-manage'
},
{
groupName: "H5学院", groupName: "H5学院",
groupCode: "ShopDecorationH5", groupCode: "ShopDecorationH5",
link: '/store-decoration/h5' link: '/store-decoration/h5'
...@@ -138,5 +146,4 @@ export const menuList: any = [ ...@@ -138,5 +146,4 @@ export const menuList: any = [
} }
] ]
}, },
] ]
\ No newline at end of file
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