Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sunyihao
bkunyun
Commits
d9facce0
Commit
d9facce0
authored
Jun 16, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 文件夹移动删除相关重写
parent
0c956341
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
402 additions
and
103 deletions
+402
-103
api_manager.ts
src/api/api_manager.ts
+7
-5
transformParams.ts
src/api/fileserver/transformParams.ts
+3
-0
project_api.ts
src/api/project_api.ts
+39
-2
util.ts
src/utils/util.ts
+4
-4
index.tsx
src/views/Project/ProjectData/DeleteDialog/index.tsx
+183
-0
index.tsx
src/views/Project/ProjectData/MoveFile/index.tsx
+160
-89
index.tsx
src/views/Project/ProjectData/index.tsx
+0
-0
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+1
-0
AddMember.tsx
...ct/ProjectSetting/ProjectMembers/components/AddMember.tsx
+5
-3
No files found.
src/api/api_manager.ts
View file @
d9facce0
...
@@ -21,12 +21,14 @@ const RESTAPI = {
...
@@ -21,12 +21,14 @@ const RESTAPI = {
API_DATA_FIND
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/find`
,
//查询某路径下数据集
API_DATA_FIND
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/find`
,
//查询某路径下数据集
API_DATA_SEARCH
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/search`
,
//搜索项目中某路径下的数据集
API_DATA_SEARCH
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/search`
,
//搜索项目中某路径下的数据集
API_DATA_MOVE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/move`
,
//移动到
API_DATA_MOVE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/move`
,
//移动到
API_DATA_MOVE_PACKAGE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/move/package`
,
//移动文件夹中的数据集
API_DATA_DEL
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/del`
,
//删除项目中的数据集
API_DATA_DEL
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/del`
,
//删除项目中的数据集
API_DATA_DEL_PACKAGE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/data/del/package`
,
//删除文件夹中的数据集
API_USER_PERMISSION_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/uaa/routes/privilege/list`
,
//获取用户包含的权限列表
API_USER_PERMISSION_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/uaa/routes/privilege/list`
,
//获取用户包含的权限列表
API_WORKBENCH_TEMPLATE_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//查询项目下工作流模板列表
API_WORKBENCH_TEMPLATE_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//查询项目下工作流模板列表
API_WORKBENCH_DELETE_TEMPLATE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//项目管理员-删除工作流模板
API_WORKBENCH_DELETE_TEMPLATE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//项目管理员-删除工作流模板
API_WORKBENCH_ADD_TEMPLATE_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/product/workflowspec`
,
//项目管理员-添加工作流模板-模板列表
API_WORKBENCH_ADD_TEMPLATE_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/product/workflowspec`
,
//项目管理员-添加工作流模板-模板列表
API_WORKBENCH_ADD_TEMPLATE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//项目管理员-添加工作流模板-提交
API_WORKBENCH_ADD_TEMPLATE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/project/workflowspec`
,
//项目管理员-添加工作流模板-提交
}
}
;
export
default
RESTAPI
;
export
default
RESTAPI
;
src/api/fileserver/transformParams.ts
0 → 100644
View file @
d9facce0
export
const
a
=
()
=>
{
return
"a"
;
};
src/api/project_api.ts
View file @
d9facce0
...
@@ -135,7 +135,6 @@ type getDataFileMoveParams = {
...
@@ -135,7 +135,6 @@ type getDataFileMoveParams = {
dpath
?:
string
;
// 目标路径
dpath
?:
string
;
// 目标路径
};
};
// Content-Type application/x-www-form-urlencoded
// 移动到
// 移动到
const
getDataFileMove
=
(
params
:
getDataFileMoveParams
)
=>
{
const
getDataFileMove
=
(
params
:
getDataFileMoveParams
)
=>
{
return
request
({
return
request
({
...
@@ -148,13 +147,31 @@ const getDataFileMove = (params: getDataFileMoveParams) => {
...
@@ -148,13 +147,31 @@ const getDataFileMove = (params: getDataFileMoveParams) => {
});
});
};
};
type
getDataFileMovePackageParams
=
{
projectId
:
string
;
names
:
string
;
// 包名
spath
?:
string
;
// 原路径
dpath
?:
string
;
// 目标路径
};
// 移动文件夹中的数据集
const
getDataFileMovePackage
=
(
params
:
getDataFileMovePackageParams
)
=>
{
return
request
({
url
:
Api
.
API_DATA_MOVE_PACKAGE
,
method
:
"put"
,
data
:
params
,
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
},
});
};
type
getDataFileDelParams
=
{
type
getDataFileDelParams
=
{
projectId
:
string
;
projectId
:
string
;
names
:
string
;
names
:
string
;
path
?:
string
;
path
?:
string
;
};
};
// Content-Type application/x-www-form-urlencoded
// 删除项目中的数据集
// 删除项目中的数据集
const
getDataFileDel
=
(
params
:
getDataFileDelParams
)
=>
{
const
getDataFileDel
=
(
params
:
getDataFileDelParams
)
=>
{
return
request
({
return
request
({
...
@@ -167,6 +184,24 @@ const getDataFileDel = (params: getDataFileDelParams) => {
...
@@ -167,6 +184,24 @@ const getDataFileDel = (params: getDataFileDelParams) => {
});
});
};
};
type
getDataFileDelPackageParams
=
{
projectId
:
string
;
names
:
string
;
path
?:
string
;
};
// 删除项目中的数据集
const
getDataFileDelPackage
=
(
params
:
getDataFileDelPackageParams
)
=>
{
return
request
({
url
:
Api
.
API_DATA_DEL_PACKAGE
,
method
:
"delete"
,
params
,
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
},
});
};
export
{
export
{
current
,
current
,
menu
,
menu
,
...
@@ -180,5 +215,7 @@ export {
...
@@ -180,5 +215,7 @@ export {
getDataFind
,
getDataFind
,
getDataFileSearch
,
getDataFileSearch
,
getDataFileMove
,
getDataFileMove
,
getDataFileMovePackage
,
getDataFileDel
,
getDataFileDel
,
getDataFileDelPackage
,
};
};
src/utils/util.ts
View file @
d9facce0
...
@@ -33,14 +33,14 @@ export const uuid = () => {
...
@@ -33,14 +33,14 @@ export const uuid = () => {
* params: item: 毫秒的时间戳
* params: item: 毫秒的时间戳
*/
*/
export
const
formatTime
=
(
time
:
number
)
=>
{
export
const
formatTime
=
(
time
:
number
)
=>
{
const
newTime
=
Math
.
floor
(
time
/
1000
)
;
const
newTime
=
Math
.
floor
(
time
/
1000
)
;
const
hours
=
Math
.
floor
(
newTime
/
3600
);
const
hours
=
Math
.
floor
(
newTime
/
3600
);
const
minutes
=
Math
.
floor
((
newTime
%
3600
)
/
60
);
const
minutes
=
Math
.
floor
((
newTime
%
3600
)
/
60
);
const
seconds
=
newTime
%
60
;
const
seconds
=
newTime
%
60
;
const
hoursString
=
hours
?
`
${
hours
}
小时`
:
''
;
const
hoursString
=
hours
?
`
${
hours
}
小时`
:
""
;
const
minutesString
=
minutes
?
`
${
minutes
}
分钟`
:
''
;
const
minutesString
=
minutes
?
`
${
minutes
}
分钟`
:
""
;
const
secondsString
=
seconds
?
`
${
seconds
}
秒`
:
''
;
const
secondsString
=
seconds
?
`
${
seconds
}
秒`
:
""
;
return
`
${
hoursString
}${
minutesString
}${
secondsString
}
`
;
return
`
${
hoursString
}${
minutesString
}${
secondsString
}
`
;
};
};
...
...
src/views/Project/ProjectData/DeleteDialog/index.tsx
0 → 100644
View file @
d9facce0
import
React
,
{
useState
,
useImperativeHandle
,
useMemo
}
from
"react"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
{
getDataFileDel
,
getDataFileDelPackage
}
from
"@/api/project_api"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
const
DeleteDialog
=
(
props
:
any
)
=>
{
const
{
path
,
projectId
,
fileToken
,
currentOperateFile
,
selectIds
,
refresh
,
showList
,
}
=
props
;
const
Message
=
useMessage
();
let
deleteFileDialogRef
:
any
=
React
.
createRef
();
const
showDialog
=
()
=>
{
deleteFileDialogRef
.
current
.
handleClickOpen
();
};
useImperativeHandle
(
props
.
onRef
,
()
=>
{
return
{
showDialog
:
showDialog
,
};
});
const
{
run
:
getDataFileDelRun
}
=
useMyRequest
(
getDataFileDel
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
});
const
{
run
:
getDataFileDelPackageRun
}
=
useMyRequest
(
getDataFileDelPackage
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
}
);
const
successDelete
=
()
=>
{
Message
.
success
(
"删除成功!"
);
deleteFileDialogRef
?.
current
?.
handleClose
();
refresh
();
};
const
deletePathProvidedToDataSet
=
useMemo
(()
=>
{
return
path
===
"/"
?
"/"
:
`
${
path
}
/`
;
},
[
path
]);
const
deletePathProvidedFileServer
=
useMemo
(()
=>
{
return
path
===
"/"
?
`
${
path
}
`
:
`
${
path
}
/`
;
},
[
path
]);
// 删除
const
handleSubmit
=
()
=>
{
if
(
!
currentOperateFile
)
{
// 批量删除
// 要删除的数据集
const
datSetDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"dataSet"
;
});
// 要删除的文件夹
const
folderDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"directory"
;
});
// 要删除的文件
const
fileDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
(
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
!==
"dataSet"
&&
item
.
type
!==
"directory"
);
});
if
(
datSetDeleteList
.
length
>
0
)
{
dataSetsDelete
(
datSetDeleteList
);
}
if
(
folderDeleteList
.
length
>
0
)
{
foldersDelete
(
folderDeleteList
);
}
if
(
fileDeleteList
.
length
>
0
)
{
filesDelete
(
fileDeleteList
);
}
}
else
{
if
(
currentOperateFile
.
type
===
"dataSet"
)
{
dataSetDelete
();
}
else
if
(
currentOperateFile
.
type
===
"directory"
)
{
folerDelete
();
}
else
{
fileDelete
();
}
}
};
// 删除单个数据集
const
dataSetDelete
=
()
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
currentOperateFile
.
name
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件夹
const
folerDelete
=
()
=>
{
fileDelete
();
const
names
=
currentOperateFile
.
name
;
dataSetInFolerDelete
(
names
);
};
// 删除文件夹中的数据集
const
dataSetInFolerDelete
=
(
names
:
string
)
=>
{
getDataFileDelPackageRun
({
projectId
:
projectId
as
string
,
names
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件
const
fileDelete
=
()
=>
{
CloudEController
.
JobOutFileDel
(
`
${
deletePathProvidedFileServer
}${
currentOperateFile
.
name
}
`
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
// 删除多个数据集
const
dataSetsDelete
=
(
datSetDeleteList
:
Array
<
any
>
)
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
datSetDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
),
path
:
deletePathProvidedToDataSet
,
});
};
// 删除多个文件夹
const
foldersDelete
=
(
folderDeleteList
:
Array
<
any
>
)
=>
{
filesDelete
(
folderDeleteList
);
const
names
=
folderDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
);
dataSetInFolerDelete
(
names
);
};
// 删除多个文件
const
filesDelete
=
(
fileDeleteList
:
Array
<
any
>
)
=>
{
const
deletePath
=
fileDeleteList
.
map
((
item
:
any
)
=>
{
return
`
${
deletePathProvidedFileServer
}${
item
.
name
}
`
;
})
.
join
(
" "
);
CloudEController
.
JobOutFileDel
(
deletePath
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
const
submitloading
=
false
;
return
(
<
MyDialog
handleSubmit=
{
handleSubmit
}
onRef=
{
deleteFileDialogRef
}
title=
"提示"
submitloading=
{
submitloading
}
>
{
currentOperateFile
?
"确认删除该数据吗?"
:
`确认删除这${selectIds.length}条数据吗?`
}
</
MyDialog
>
);
};
export
default
DeleteDialog
;
src/views/Project/ProjectData/MoveFile/index.tsx
View file @
d9facce0
import
React
,
{
useState
,
useImperativeHandle
,
useCallback
}
from
"react"
;
import
React
,
{
useState
,
useImperativeHandle
,
useCallback
,
useMemo
,
}
from
"react"
;
import
style
from
"./index.module.css"
;
import
style
from
"./index.module.css"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
...
@@ -7,7 +12,7 @@ import bigFolderIcon from "@/assets/project/bigFolderIcon.svg";
...
@@ -7,7 +12,7 @@ import bigFolderIcon from "@/assets/project/bigFolderIcon.svg";
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
MyTreeView
from
"@/components/mui/MyTreeView"
;
import
MyTreeView
from
"@/components/mui/MyTreeView"
;
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
{
getDataFileMove
}
from
"@/api/project_api"
;
import
{
getDataFileMove
,
getDataFileMovePackage
}
from
"@/api/project_api"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
...
@@ -19,17 +24,24 @@ const MoveFile = (props: any) => {
...
@@ -19,17 +24,24 @@ const MoveFile = (props: any) => {
currentOperateFile
,
currentOperateFile
,
selectIds
,
selectIds
,
refresh
,
refresh
,
activeTab
,
showList
,
showList
,
}
=
props
;
}
=
props
;
const
Message
=
useMessage
();
const
Message
=
useMessage
();
const
{
run
:
getDataFileMoveRun
}
=
useMyRequest
(
getDataFileMove
,
{
const
{
run
:
getDataFileMoveRun
}
=
useMyRequest
(
getDataFileMove
,
{
onSuccess
:
(
res
:
any
)
=>
{
onSuccess
:
(
res
:
any
)
=>
{
Message
.
success
(
"移动成功!"
);
successMove
();
moveFileDialogRef
.
current
.
handleClose
();
refresh
();
},
},
});
});
const
{
run
:
getDataFileMovePackageRun
}
=
useMyRequest
(
getDataFileMovePackage
,
{
onSuccess
:
(
res
:
any
)
=>
{
successMove
();
},
}
);
const
[
newPath
,
setNewPath
]
=
useState
(
"/"
);
const
[
newPath
,
setNewPath
]
=
useState
(
"/"
);
const
[
rootActive
,
setRootActive
]
=
useState
(
true
);
const
[
rootActive
,
setRootActive
]
=
useState
(
true
);
...
@@ -65,97 +77,155 @@ const MoveFile = (props: any) => {
...
@@ -65,97 +77,155 @@ const MoveFile = (props: any) => {
};
};
});
});
// 提供给fileserver相关接口的newpath 直接用newPath就可以了
// const newPathProvidedToFileServer = useMemo(() => {
// return newPath
// }, [newPath])
// 提供给数据集相关接口的newpath
const
newPathProvidedToDataSet
=
useMemo
(()
=>
{
return
newPath
===
"/"
?
"/"
:
`
${
newPath
}
/`
;
},
[
newPath
]);
// 提供给fileserver相关接口的oldpath
const
oldPathProvidedToFileServer
=
useMemo
(()
=>
{
return
`
${
path
}${
path
===
"/"
?
""
:
"/"
}
`
;
},
[
path
]);
// 提供给数据集相关接口的oldpath
const
oldPathProvidedToDataSet
=
useMemo
(()
=>
{
return
path
===
"/"
?
"/"
:
`
${
path
}
/`
;
},
[
path
]);
// 移动成功后的操作
const
successMove
=
()
=>
{
Message
.
success
(
"移动成功!"
);
moveFileDialogRef
?.
current
?.
handleClose
();
refresh
();
};
// 移动
const
handleMoveFileSubmit
=
()
=>
{
const
handleMoveFileSubmit
=
()
=>
{
if
(
newPath
)
{
if
(
!
newPath
)
{
Message
.
error
(
"请选择移动到哪个目录"
);
}
else
if
(
newPath
===
path
)
{
Message
.
error
(
"指定的目标路径为数据原路径,无需移动。"
);
}
else
{
if
(
!
currentOperateFile
)
{
if
(
!
currentOperateFile
)
{
// 批量移动
// 批量移动
if
(
activeTab
===
1
)
{
// 要移动的数据集
const
oldPaths
=
selectIds
.
map
((
name
:
any
)
=>
{
const
datSetMoveList
=
showList
.
filter
((
item
:
any
)
=>
{
return
`
${
path
}${
path
===
"/"
?
""
:
"/"
}${
name
}
`
;
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"dataSet"
;
});
});
CloudEController
.
JobFileBatchMove
(
// 要移动的文件夹
newPath
,
const
folderMoveList
=
showList
.
filter
((
item
:
any
)
=>
{
oldPaths
,
return
(
""
,
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"directory"
fileToken
,
);
projectId
});
)?.
then
((
res
)
=>
{
// 要移动的文件
Message
.
success
(
"移动成功!"
);
const
fileMoveList
=
showList
.
filter
((
item
:
any
)
=>
{
moveFileDialogRef
.
current
.
handleClose
();
return
(
refresh
();
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
});
item
.
type
!==
"dataSet"
&&
}
else
{
item
.
type
!==
"directory"
const
datSetMoveList
=
showList
.
filter
((
item
:
any
)
=>
{
);
return
(
});
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"dataSet"
if
(
datSetMoveList
.
length
>
0
)
{
);
dataSetsMove
(
datSetMoveList
);
});
}
const
otherMoveList
=
showList
.
filter
((
item
:
any
)
=>
{
if
(
folderMoveList
.
length
>
0
)
{
return
(
foldersMove
(
folderMoveList
);
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
!==
"dataSet"
}
);
if
(
fileMoveList
.
length
>
0
)
{
});
filesMove
(
fileMoveList
);
if
(
datSetMoveList
.
length
>
0
)
{
const
oldPaths
=
`
${
path
}${
path
===
"/"
?
""
:
"/"
}
`
;
getDataFileMoveRun
({
projectId
:
projectId
as
string
,
names
:
datSetMoveList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
),
spath
:
oldPaths
,
dpath
:
newPath
===
"/"
?
"/"
:
`
${
newPath
}
/`
,
});
}
if
(
otherMoveList
.
length
>
0
)
{
const
oldPaths
=
otherMoveList
.
map
((
item
:
any
)
=>
{
return
`
${
path
}${
path
===
"/"
?
""
:
"/"
}${
item
.
name
}
`
;
});
CloudEController
.
JobFileBatchMove
(
newPath
,
oldPaths
,
""
,
fileToken
,
projectId
)?.
then
((
res
)
=>
{
Message
.
success
(
"移动成功!"
);
moveFileDialogRef
.
current
.
handleClose
();
refresh
();
});
}
}
}
}
else
{
}
else
{
if
(
currentOperateFile
.
type
===
"dataSet"
)
{
if
(
currentOperateFile
.
type
===
"dataSet"
)
{
const
oldPaths
=
`
${
path
}${
path
===
"/"
?
""
:
"/"
}
`
;
dataSetMove
();
getDataFileMoveRun
({
}
else
if
(
currentOperateFile
.
type
===
"directory"
)
{
projectId
:
projectId
as
string
,
folerMove
();
names
:
currentOperateFile
.
name
,
spath
:
oldPaths
,
dpath
:
newPath
===
"/"
?
"/"
:
`
${
newPath
}
/`
,
});
}
else
{
}
else
{
const
oldPath
=
`
${
path
}${
path
===
"/"
?
""
:
"/"
}${
fileMove
();
currentOperateFile
.
name
}
`
;
if
(
oldPath
===
newPath
)
{
Message
.
info
(
"指定的目标路径为数据原路径,无需移动。"
);
return
;
}
CloudEController
.
JobFileMove
(
newPath
,
oldPath
,
""
,
fileToken
,
projectId
)?.
then
((
res
)
=>
{
Message
.
success
(
"移动成功!"
);
moveFileDialogRef
.
current
.
handleClose
();
refresh
();
});
}
}
}
}
}
else
{
Message
.
error
(
"请选择移动到哪个目录"
);
}
}
};
};
// 单文件移动
const
fileMove
=
()
=>
{
const
oldPathToFileServer
=
`
${
oldPathProvidedToFileServer
}${
currentOperateFile
.
name
}
`
;
CloudEController
.
JobFileMove
(
newPath
,
oldPathToFileServer
,
""
,
fileToken
,
projectId
)?.
then
((
res
)
=>
{
successMove
();
});
};
// 多文件移动
const
filesMove
=
(
fileMoveList
:
Array
<
any
>
)
=>
{
const
oldPaths
=
fileMoveList
.
map
((
item
:
any
)
=>
{
return
`
${
oldPathProvidedToFileServer
}${
item
.
name
}
`
;
});
CloudEController
.
JobFileBatchMove
(
newPath
,
oldPaths
,
""
,
fileToken
,
projectId
)?.
then
((
res
)
=>
{
successMove
();
});
};
// 单文件夹移动
const
folerMove
=
()
=>
{
fileMove
();
const
names
=
currentOperateFile
.
name
;
dataSetInFolerMove
(
names
);
};
// 移动文件夹中的数据集
const
dataSetInFolerMove
=
(
names
:
string
)
=>
{
getDataFileMovePackageRun
({
projectId
:
projectId
as
string
,
names
,
spath
:
oldPathProvidedToDataSet
,
dpath
:
newPathProvidedToDataSet
,
});
};
// 多文件夹移动
const
foldersMove
=
(
folderMoveList
:
Array
<
any
>
)
=>
{
filesMove
(
folderMoveList
);
const
names
=
folderMoveList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
);
dataSetInFolerMove
(
names
);
};
// 单数据集移动
const
dataSetMove
=
()
=>
{
getDataFileMoveRun
({
projectId
:
projectId
as
string
,
names
:
currentOperateFile
.
name
,
spath
:
oldPathProvidedToDataSet
,
dpath
:
newPathProvidedToDataSet
,
});
};
// 多数据集移动
const
dataSetsMove
=
(
datSetMoveList
:
Array
<
any
>
)
=>
{
getDataFileMoveRun
({
projectId
:
projectId
as
string
,
names
:
datSetMoveList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
),
spath
:
oldPathProvidedToFileServer
,
dpath
:
newPath
===
"/"
?
"/"
:
`
${
newPath
}
/`
,
});
};
const
renderLabel
=
(
labelNmae
:
string
)
=>
{
const
renderLabel
=
(
labelNmae
:
string
)
=>
{
return
(
return
(
<
span
className=
{
style
.
treeLabel
}
>
<
span
className=
{
style
.
treeLabel
}
>
...
@@ -170,6 +240,11 @@ const MoveFile = (props: any) => {
...
@@ -170,6 +240,11 @@ const MoveFile = (props: any) => {
setRootActive
(
false
);
setRootActive
(
false
);
};
};
// 给路径去掉第一个'/'然后结尾加上文件名 方便后面直接使用
const
idFunc
=
(
item
:
any
)
=>
{
return
`
${
item
.
dir
.
substr
(
1
)}${
item
.
name
}
`
;
};
const
handleRoot
=
()
=>
{
const
handleRoot
=
()
=>
{
setNewPath
(
"/"
);
setNewPath
(
"/"
);
setRootActive
(
true
);
setRootActive
(
true
);
...
@@ -177,10 +252,6 @@ const MoveFile = (props: any) => {
...
@@ -177,10 +252,6 @@ const MoveFile = (props: any) => {
const
moveFileSubmitloading
=
false
;
const
moveFileSubmitloading
=
false
;
const
idFunc
=
(
item
:
any
)
=>
{
return
`
${
item
.
dir
.
substr
(
1
)}${
item
.
name
}
`
;
};
return
(
return
(
<
MyDialog
<
MyDialog
handleSubmit=
{
handleMoveFileSubmit
}
handleSubmit=
{
handleMoveFileSubmit
}
...
...
src/views/Project/ProjectData/index.tsx
View file @
d9facce0
This diff is collapsed.
Click to expand it.
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
d9facce0
...
@@ -212,6 +212,7 @@ const BaseInfo = observer(() => {
...
@@ -212,6 +212,7 @@ const BaseInfo = observer(() => {
// 显示删除弹窗
// 显示删除弹窗
const
handleClickDelete
=
()
=>
{
const
handleClickDelete
=
()
=>
{
DialogRef
.
current
.
handleClickOpen
();
DialogRef
.
current
.
handleClickOpen
();
setDeleteProjectName
(
""
);
};
};
const
deleteProjectNameChange
=
(
e
:
any
)
=>
{
const
deleteProjectNameChange
=
(
e
:
any
)
=>
{
...
...
src/views/Project/ProjectSetting/ProjectMembers/components/AddMember.tsx
View file @
d9facce0
...
@@ -61,7 +61,6 @@ const AddMember = observer((props: IProps) => {
...
@@ -61,7 +61,6 @@ const AddMember = observer((props: IProps) => {
const
defaultValue
=
selectOptions
.
filter
(
const
defaultValue
=
selectOptions
.
filter
(
(
every
)
=>
every
.
value
===
item
(
every
)
=>
every
.
value
===
item
);
);
console
.
log
(
selectOptions
,
defaultValue
,
"111"
);
return
(
return
(
<
MySelect
<
MySelect
input=
{
<
OutlinedInput
/>
}
input=
{
<
OutlinedInput
/>
}
...
@@ -122,13 +121,16 @@ const AddMember = observer((props: IProps) => {
...
@@ -122,13 +121,16 @@ const AddMember = observer((props: IProps) => {
}
);
}
);
}
, [currentProjectStore?.currentProjectInfo, http, addMemberDialog]);
}
, [currentProjectStore?.currentProjectInfo, http, addMemberDialog]);
const onClose = () =
>
{
const onClose = (event: any =
{}
, reason: any = "other") =
>
{
// 点击弹窗外不关闭弹窗
if
(
reason
===
"backdropClick"
)
{
return
;
}
setAddMemberDialog
(
false
);
setAddMemberDialog
(
false
);
}
;
}
;
const onConfirm = () =
>
{
const onConfirm = () =
>
{
const
projectInfo
=
toJS
(
currentProjectStore
?.
currentProjectInfo
);
const
projectInfo
=
toJS
(
currentProjectStore
?.
currentProjectInfo
);
console
.
log
(
tableData
,
1111
);
const
params
=
tableData
.
filter
((
item
:
any
)
=>
{
const
params
=
tableData
.
filter
((
item
:
any
)
=>
{
return
checkData
.
includes
(
item
?.
username
);
return
checkData
.
includes
(
item
?.
username
);
});
});
...
...
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