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
Administrator
bkunyun
Commits
d4fb15ff
Commit
d4fb15ff
authored
Jul 08, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 新增模板勾选、文件路径修改
parent
bbcf9e9e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
20 deletions
+49
-20
tusUpload.ts
src/utils/Upload/tusUpload.ts
+1
-1
index.tsx
src/views/ConsoleLayout/index.tsx
+1
-1
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+6
-6
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+2
-9
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+35
-2
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+4
-1
No files found.
src/utils/Upload/tusUpload.ts
View file @
d4fb15ff
...
@@ -78,7 +78,7 @@ const UseTusUpload = (uploadInfoStore: any) => {
...
@@ -78,7 +78,7 @@ const UseTusUpload = (uploadInfoStore: any) => {
id
:
timeId
,
id
:
timeId
,
statusMsg
:
"正在上传"
,
statusMsg
:
"正在上传"
,
upload
,
upload
,
dir
:
"/
home/cloudam
/"
,
dir
:
"/
ProjectData
/"
,
};
};
uploadInfoStore
?.
setUploadInfo
(
item
.
id
,
{
uploadInfoStore
?.
setUploadInfo
(
item
.
id
,
{
...
item
,
...
item
,
...
...
src/views/ConsoleLayout/index.tsx
View file @
d4fb15ff
...
@@ -64,7 +64,7 @@ const ConsoleLayout = observer(() => {
...
@@ -64,7 +64,7 @@ const ConsoleLayout = observer(() => {
currentProjectStore
.
changeProductInfo
({
id
:
item
.
id
,
name
:
item
.
name
});
currentProjectStore
.
changeProductInfo
({
id
:
item
.
id
,
name
:
item
.
name
});
setCurrentProduct
(
item
);
setCurrentProduct
(
item
);
runGetProjectList
({
runGetProjectList
({
product
:
item
.
name
,
product
:
item
.
id
,
});
});
};
};
...
...
src/views/Project/ProjectJobDetail/index.tsx
View file @
d4fb15ff
...
@@ -98,7 +98,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -98,7 +98,7 @@ const ProjectSubmitWork = observer(() => {
// 前往数据管理页面
// 前往数据管理页面
const
goToProjectData
=
(
path
:
string
)
=>
{
const
goToProjectData
=
(
path
:
string
)
=>
{
path
=
path
.
slice
(
1
3
);
path
=
path
.
slice
(
1
2
);
if
(
path
)
{
if
(
path
)
{
navigate
(
`/product/cadd/projectData`
,
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
path
},
state
:
{
pathName
:
path
},
...
@@ -110,7 +110,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -110,7 +110,7 @@ const ProjectSubmitWork = observer(() => {
}
}
};
};
// 通过文件路径获取文件所在文件夹路径 如 输入 /
home/cloudam/task_a.out 输出/home/cloudam
/
// 通过文件路径获取文件所在文件夹路径 如 输入 /
ProjectData/task_a.out 输出/ProjectData
/
const
getFolderPath
=
(
path
:
string
)
=>
{
const
getFolderPath
=
(
path
:
string
)
=>
{
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
if
(
lastIndex
!==
-
1
)
{
if
(
lastIndex
!==
-
1
)
{
...
@@ -127,8 +127,8 @@ const ProjectSubmitWork = observer(() => {
...
@@ -127,8 +127,8 @@ const ProjectSubmitWork = observer(() => {
},
[
navigate
]);
},
[
navigate
]);
const
outputPathTransform
=
(
path
:
string
)
=>
{
const
outputPathTransform
=
(
path
:
string
)
=>
{
path
=
path
.
slice
(
1
3
);
path
=
path
.
slice
(
1
);
return
`ProjectData
${
path
}
`
;
return
path
;
};
};
const
getOutouts
=
(
outputs
:
any
)
=>
{
const
getOutouts
=
(
outputs
:
any
)
=>
{
...
@@ -259,8 +259,8 @@ const ProjectSubmitWork = observer(() => {
...
@@ -259,8 +259,8 @@ const ProjectSubmitWork = observer(() => {
};
};
const
handleDownLoad
=
(
path
:
string
)
=>
{
const
handleDownLoad
=
(
path
:
string
)
=>
{
if
(
path
.
indexOf
(
"/
home/cloudam
"
)
!==
-
1
)
{
if
(
path
.
indexOf
(
"/
ProjectData
"
)
!==
-
1
)
{
path
=
path
.
slice
(
1
3
);
path
=
path
.
slice
(
1
2
);
}
}
CloudEController
.
JobFileDownload
(
CloudEController
.
JobFileDownload
(
path
,
path
,
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
d4fb15ff
...
@@ -182,11 +182,7 @@ const ProjectSubmitWork = () => {
...
@@ -182,11 +182,7 @@ const ProjectSubmitWork = () => {
parameter
.
domType
.
toLowerCase
()
===
"dataset"
||
parameter
.
domType
.
toLowerCase
()
===
"dataset"
||
parameter
.
domType
.
toLowerCase
()
===
"file"
parameter
.
domType
.
toLowerCase
()
===
"file"
)
{
)
{
if
(
value
===
"ProjectData"
)
{
value
=
`/
${
value
}
`
;
value
=
"/home/cloudam"
;
}
else
{
value
=
`/home/cloudam
${
value
.
slice
(
11
)}
`
;
}
}
}
promotedParameters
[
parameter
.
name
]
=
{
promotedParameters
[
parameter
.
name
]
=
{
[
parameter
.
classTypeName
]:
value
,
[
parameter
.
classTypeName
]:
value
,
...
@@ -195,10 +191,7 @@ const ProjectSubmitWork = () => {
...
@@ -195,10 +191,7 @@ const ProjectSubmitWork = () => {
});
});
submitWorkFlowRun
({
submitWorkFlowRun
({
name
,
name
,
outputPath
:
outputPath
:
`/
${
outputPath
}
`
,
outputPath
===
"ProjectData"
?
"/home/cloudam"
:
`/home/cloudam
${
outputPath
.
slice
(
11
)}
`
,
projectId
:
projectId
as
string
,
projectId
:
projectId
as
string
,
specId
:
templateConfigInfo
?.
id
as
string
,
specId
:
templateConfigInfo
?.
id
as
string
,
promotedParameters
,
promotedParameters
,
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
d4fb15ff
...
@@ -16,11 +16,15 @@ import _ from "lodash";
...
@@ -16,11 +16,15 @@ import _ from "lodash";
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
getAddWorkbenchTemplate
}
from
"@/api/workbench_api"
;
import
{
getAddWorkbenchTemplate
,
addWorkbenchTemplate
,
}
from
"@/api/workbench_api"
;
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
type
IAddTemplateProps
=
{
type
IAddTemplateProps
=
{
setShowAddTemplate
:
any
;
setShowAddTemplate
:
any
;
getTemplateInfo
:
any
;
};
};
const
radioOptions
=
[
const
radioOptions
=
[
...
@@ -38,7 +42,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
...
@@ -38,7 +42,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
{
setShowAddTemplate
}
=
props
;
const
{
setShowAddTemplate
,
getTemplateInfo
}
=
props
;
const
handleSearch
=
(
value
:
string
)
=>
{
const
handleSearch
=
(
value
:
string
)
=>
{
console
.
log
(
value
);
console
.
log
(
value
);
...
@@ -56,8 +60,34 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
...
@@ -56,8 +60,34 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
setTemplateType
(
value
);
setTemplateType
(
value
);
};
};
const
handleSelectTemplate
=
(
id
:
string
)
=>
{
let
list
:
string
[]
=
[...
selectTemplateData
];
if
(
selectTemplateData
.
filter
((
e
)
=>
e
===
id
).
length
>
0
)
{
list
=
list
.
filter
((
e
)
=>
e
!==
id
);
setSelectTemplateData
(
list
);
}
else
{
list
.
push
(
id
);
setSelectTemplateData
(
list
);
}
};
// 项目管理员-添加工作流模板-提交
const
{
run
:
addTemplate
}
=
useMyRequest
(
addWorkbenchTemplate
,
{
onSuccess
:
(
result
:
any
)
=>
{
setSelectTemplateData
([]);
setShowAddTemplate
(
false
);
getTemplateInfo
({
projectId
:
projectId
as
string
,
});
},
});
const
handleAddTemplate
=
()
=>
{
const
handleAddTemplate
=
()
=>
{
console
.
log
(
"handleAddTemplate"
);
console
.
log
(
"handleAddTemplate"
);
addTemplate
({
projectId
:
projectId
as
string
,
workflowSpecIds
:
selectTemplateData
,
});
};
};
// 添加工作流模板-获取模板列表
// 添加工作流模板-获取模板列表
...
@@ -205,6 +235,9 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
...
@@ -205,6 +235,9 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
})
}
})
}
key=
{
index
}
key=
{
index
}
onClick=
{
()
=>
{
handleSelectTemplate
(
item
.
id
);
}
}
>
>
<
div
className=
{
style
.
templateLiTop
}
>
<
div
className=
{
style
.
templateLiTop
}
>
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
d4fb15ff
...
@@ -267,7 +267,10 @@ const ProjectMembers = observer(() => {
...
@@ -267,7 +267,10 @@ const ProjectMembers = observer(() => {
/> */
}
/> */
}
{
showAddTemplate
&&
(
{
showAddTemplate
&&
(
<
AddTemplate
setShowAddTemplate=
{
setShowAddTemplate
}
/>
<
AddTemplate
setShowAddTemplate=
{
setShowAddTemplate
}
getTemplateInfo=
{
getTemplateInfo
}
/>
)
}
)
}
<
SimpleDialog
<
SimpleDialog
...
...
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