Commit 7625dfc2 by zhangleyuan

feat:联调云盘的文件的删除的操作

parent 4f7b45bf
...@@ -251,12 +251,12 @@ class CopyFileModal extends React.Component { ...@@ -251,12 +251,12 @@ class CopyFileModal extends React.Component {
</Button> </Button>
]} ]}
> >
<div className='copy-header'> {/* <div className='copy-header'>
<Radio.Group> <Radio.Group>
<Radio.Button value={'MYSELF'} onClick={() => this.getFileList('MYSELF')}>我的文件</Radio.Button> <Radio.Button value={'MYSELF'} onClick={() => this.getFileList('MYSELF')}>我的文件</Radio.Button>
<Radio.Button onClick={() => this.getFileList('COMMON')}>公共文件</Radio.Button> <Radio.Button onClick={() => this.getFileList('COMMON')}>公共文件</Radio.Button>
</Radio.Group> </Radio.Group>
</div> </div> */}
<div className='copy-body'> <div className='copy-body'>
{/* 面包屑 */} {/* 面包屑 */}
<div className="bread-crumbs"> <div className="bread-crumbs">
......
...@@ -25,10 +25,12 @@ import ManagingMembersModal from '@/bu-components/ManagingMembersModal'; ...@@ -25,10 +25,12 @@ import ManagingMembersModal from '@/bu-components/ManagingMembersModal';
import ScanFileModal from '../modal/ScanFileModal'; import ScanFileModal from '../modal/ScanFileModal';
import CreateFolderModal from '../modal/CreateFolderModal'; import CreateFolderModal from '../modal/CreateFolderModal';
import User from '@/common/js/user';
const DEL_FOLDER_URL_MAP = { const DEL_FOLDER_URL_MAP = {
'MYSELF': 'public/hadesStore/delFolder', 'MYSELF': 'public/hadesStore/delFolder',
'COMMON': 'public/apollo/delCommonFolder' 'COMMON': 'public/hadesStore/delFolder'
} }
// 支持本地上传的文件类型 // 支持本地上传的文件类型
...@@ -290,21 +292,14 @@ class FolderList extends React.Component { ...@@ -290,21 +292,14 @@ class FolderList extends React.Component {
handleDeleteFolder = (folder) => { handleDeleteFolder = (folder) => {
const { currentRootDisk: { disk } } = this.props; const { currentRootDisk: { disk } } = this.props;
const { instId } = window.currentUserInstInfo; const { instId } = window.currentUserInstInfo;
// 判断此文件是否有关联的课次
Service.Hades('public/apollo/judgeRelation', {
instId,
folderIds: [folder.id],
}).then((res) => {
// 如果有关联的文件,二次弹窗确认
const hasRelative = !!res.result;
Modal.confirm({ Modal.confirm({
title: '确认删除所选的文件吗?', title: '确认删除所选的文件吗?',
content: hasRelative ? '此文件已关联了课次,删除后,学员将不能查看到此文件。' : '删除后,数据将无法恢复。', content: '删除后,数据将无法恢复。',
// icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => { onOk: () => {
const { currentFolder } = this.state; const { currentFolder } = this.state;
Service.Hades(DEL_FOLDER_URL_MAP[disk], { Service.Hades(DEL_FOLDER_URL_MAP[disk], {
instId, operatorId: User.getUserId(),
storeId: User.getStoreId(),
ids: [folder.id], ids: [folder.id],
}).then(() => { }).then(() => {
message.success('删除成功'); message.success('删除成功');
...@@ -312,7 +307,6 @@ class FolderList extends React.Component { ...@@ -312,7 +307,6 @@ class FolderList extends React.Component {
}) })
} }
}); });
})
} }
// 重命名 // 重命名
...@@ -328,6 +322,7 @@ class FolderList extends React.Component { ...@@ -328,6 +322,7 @@ class FolderList extends React.Component {
// 重命名完成或者取消重命名之后隐藏重命名弹窗 // 重命名完成或者取消重命名之后隐藏重命名弹窗
handleRenameDone = (folderName) => { handleRenameDone = (folderName) => {
return new Promise((resolve) => {
const { renameModalData, currentFolder } = this.state; const { renameModalData, currentFolder } = this.state;
const { folderPathList } = this.props; const { folderPathList } = this.props;
// 名称未修改不发送请求 // 名称未修改不发送请求
...@@ -356,6 +351,7 @@ class FolderList extends React.Component { ...@@ -356,6 +351,7 @@ class FolderList extends React.Component {
this.props.onRefresh({ parentId: currentFolder.id || null }); this.props.onRefresh({ parentId: currentFolder.id || null });
}) })
}); });
})
} }
// 获取同名文件 // 获取同名文件
......
...@@ -104,7 +104,7 @@ class CreateFolderModal extends React.Component { ...@@ -104,7 +104,7 @@ class CreateFolderModal extends React.Component {
placeholder="请输入文件夹名称" placeholder="请输入文件夹名称"
style={{width: '400px'}} style={{width: '400px'}}
onChange={this.handleChangeFolderName} onChange={this.handleChangeFolderName}
maxlength="50" maxLength="50"
ref="folderNameInput" ref="folderNameInput"
/> />
</Form.Item> </Form.Item>
......
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