Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
7625dfc2
Commit
7625dfc2
authored
Dec 18, 2020
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:联调云盘的文件的删除的操作
parent
4f7b45bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
52 deletions
+48
-52
src/bu-components/CopyFileModal.jsx
+2
-2
src/modules/resource-disk/components/FolderList.jsx
+45
-49
src/modules/resource-disk/modal/CreateFolderModal.jsx
+1
-1
No files found.
src/bu-components/CopyFileModal.jsx
View file @
7625dfc2
...
...
@@ -251,12 +251,12 @@ class CopyFileModal extends React.Component {
</
Button
>
]
}
>
<
div
className=
'copy-header'
>
{
/*
<div className='copy-header'>
<Radio.Group>
<Radio.Button value={'MYSELF'} onClick={() => this.getFileList('MYSELF')}>我的文件</Radio.Button>
<Radio.Button onClick={() => this.getFileList('COMMON')}>公共文件</Radio.Button>
</Radio.Group>
</
div
>
</div>
*/
}
<
div
className=
'copy-body'
>
{
/* 面包屑 */
}
<
div
className=
"bread-crumbs"
>
...
...
src/modules/resource-disk/components/FolderList.jsx
View file @
7625dfc2
...
...
@@ -25,10 +25,12 @@ import ManagingMembersModal from '@/bu-components/ManagingMembersModal';
import
ScanFileModal
from
'../modal/ScanFileModal'
;
import
CreateFolderModal
from
'../modal/CreateFolderModal'
;
import
User
from
'@/common/js/user'
;
const
DEL_FOLDER_URL_MAP
=
{
'MYSELF'
:
'public/hadesStore/delFolder'
,
'COMMON'
:
'public/
apollo/delCommon
Folder'
'COMMON'
:
'public/
hadesStore/del
Folder'
}
// 支持本地上传的文件类型
...
...
@@ -290,29 +292,21 @@ class FolderList extends React.Component {
handleDeleteFolder
=
(
folder
)
=>
{
const
{
currentRootDisk
:
{
disk
}
}
=
this
.
props
;
const
{
instId
}
=
window
.
currentUserInstInfo
;
// 判断此文件是否有关联的课次
Service
.
Hades
(
'public/apollo/judgeRelation'
,
{
instId
,
folderIds
:
[
folder
.
id
],
}).
then
((
res
)
=>
{
// 如果有关联的文件,二次弹窗确认
const
hasRelative
=
!!
res
.
result
;
Modal
.
confirm
({
title
:
'确认删除所选的文件吗?'
,
content
:
hasRelative
?
'此文件已关联了课次,删除后,学员将不能查看到此文件。'
:
'删除后,数据将无法恢复。'
,
// icon: <span className="icon iconfont default-confirm-icon"></span>,
onOk
:
()
=>
{
const
{
currentFolder
}
=
this
.
state
;
Service
.
Hades
(
DEL_FOLDER_URL_MAP
[
disk
],
{
instId
,
ids
:
[
folder
.
id
],
}).
then
(()
=>
{
message
.
success
(
'删除成功'
);
this
.
props
.
onRefresh
({
parentId
:
currentFolder
.
id
||
null
});
})
}
});
})
Modal
.
confirm
({
title
:
'确认删除所选的文件吗?'
,
content
:
'删除后,数据将无法恢复。'
,
onOk
:
()
=>
{
const
{
currentFolder
}
=
this
.
state
;
Service
.
Hades
(
DEL_FOLDER_URL_MAP
[
disk
],
{
operatorId
:
User
.
getUserId
(),
storeId
:
User
.
getStoreId
(),
ids
:
[
folder
.
id
],
}).
then
(()
=>
{
message
.
success
(
'删除成功'
);
this
.
props
.
onRefresh
({
parentId
:
currentFolder
.
id
||
null
});
})
}
});
}
// 重命名
...
...
@@ -328,34 +322,36 @@ class FolderList extends React.Component {
// 重命名完成或者取消重命名之后隐藏重命名弹窗
handleRenameDone
=
(
folderName
)
=>
{
const
{
renameModalData
,
currentFolder
}
=
this
.
state
;
const
{
folderPathList
}
=
this
.
props
;
// 名称未修改不发送请求
if
(
folderName
===
renameModalData
.
folderName
)
{
this
.
setState
({
renameModalData
:
{}
});
return
;
}
// 判断是否有同名文件
this
.
handleGetSameNameFiles
(
folderName
).
then
((
res
)
=>
{
if
((
!!
res
)
||
(
res
&&
Object
.
keys
(
res
).
length
))
{
if
(
!
res
.
isLook
&&
folderPathList
.
length
===
1
)
{
message
.
warning
(
'此目录下已存在同名文件,有疑问请联系机构校长'
);
}
else
{
message
.
warning
(
'此目录下已存在同名文件'
);
}
return
new
Promise
((
resolve
)
=>
{
const
{
renameModalData
,
currentFolder
}
=
this
.
state
;
const
{
folderPathList
}
=
this
.
props
;
// 名称未修改不发送请求
if
(
folderName
===
renameModalData
.
folderName
)
{
this
.
setState
({
renameModalData
:
{}
});
return
;
}
Service
.
Hades
(
'public/hadesStore/renameFolder'
,
{
id
:
renameModalData
.
id
,
name
:
folderName
}).
then
(()
=>
{
message
.
success
(
'重命名成功'
);
this
.
setState
({
renameModalData
:
{}
});
this
.
props
.
onRefresh
({
parentId
:
currentFolder
.
id
||
null
});
})
});
// 判断是否有同名文件
this
.
handleGetSameNameFiles
(
folderName
).
then
((
res
)
=>
{
if
((
!!
res
)
||
(
res
&&
Object
.
keys
(
res
).
length
))
{
if
(
!
res
.
isLook
&&
folderPathList
.
length
===
1
)
{
message
.
warning
(
'此目录下已存在同名文件,有疑问请联系机构校长'
);
}
else
{
message
.
warning
(
'此目录下已存在同名文件'
);
}
return
;
}
Service
.
Hades
(
'public/hadesStore/renameFolder'
,
{
id
:
renameModalData
.
id
,
name
:
folderName
}).
then
(()
=>
{
message
.
success
(
'重命名成功'
);
this
.
setState
({
renameModalData
:
{}
});
this
.
props
.
onRefresh
({
parentId
:
currentFolder
.
id
||
null
});
})
});
})
}
// 获取同名文件
...
...
src/modules/resource-disk/modal/CreateFolderModal.jsx
View file @
7625dfc2
...
...
@@ -104,7 +104,7 @@ class CreateFolderModal extends React.Component {
placeholder=
"请输入文件夹名称"
style=
{
{
width
:
'400px'
}
}
onChange=
{
this
.
handleChangeFolderName
}
max
l
ength=
"50"
max
L
ength=
"50"
ref=
"folderNameInput"
/>
</
Form
.
Item
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment