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
489ed282
Commit
489ed282
authored
Dec 12, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 详情任务结果修改
parent
873bef37
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
18 deletions
+67
-18
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+61
-15
interface.ts
src/views/Project/ProjectJobDetail/interface.ts
+4
-2
index.tsx
src/views/Project/ProjectOverview/TaskCard/index.tsx
+2
-1
No files found.
src/views/Project/ProjectJobDetail/index.tsx
View file @
489ed282
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-
09-06 10:54:40
* @LastEditTime: 2022-
12-12 18:11:38
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -46,6 +46,8 @@ import {
getSameBatch
,
}
from
"./utils"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
import
taskResultsFileIcon
from
"@/assets/project/taskResultsFileIcon.svg"
;
import
taskResultsDatasetIcon
from
"@/assets/project/taskResultsDatasetIcon.svg"
;
import
styles
from
"./index.module.css"
;
...
...
@@ -57,7 +59,7 @@ const statusMap = {
};
type
IStatus
=
"Done"
|
"Running"
|
"Failed"
|
"Pending"
;
let
r
a
nderOutputs
:
Array
<
any
>
=
[];
let
r
e
nderOutputs
:
Array
<
any
>
=
[];
const
ProjectSubmitWork
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
...
...
@@ -72,7 +74,7 @@ const ProjectSubmitWork = observer(() => {
/** 选中的node Id */
const
[
activeFlowIndex
,
setActiveFlowIndex
]
=
useState
<
string
>
(
""
);
// const [showOptions, setShowOptions] = useState<boolean>(false);
const
[
r
anderOutputs1
,
setRa
nderOutputs
]
=
useState
<
Array
<
any
>>
([]);
const
[
r
enderOutputs1
,
setRe
nderOutputs
]
=
useState
<
Array
<
any
>>
([]);
const
locationInfo
:
any
=
useLocation
()?.
state
;
// const locationInfo: any = location?.state;
const
navigate
=
useNavigate
();
...
...
@@ -97,7 +99,7 @@ const ProjectSubmitWork = observer(() => {
pollingInterval
:
1000
*
20
,
pollingWhenHidden
:
false
,
onSuccess
:
(
res
:
IResponse
<
ITaskInfo
>
)
=>
{
getOut
o
uts
(
res
.
data
.
outputs
);
getOut
p
uts
(
res
.
data
.
outputs
);
getLogs
(
res
.
data
);
setWorkFlowJobInfo
(
res
.
data
);
const
newWorkflowId
=
locationInfo
?.
taskId
?.
replaceAll
(
"-"
,
""
);
...
...
@@ -180,6 +182,7 @@ const ProjectSubmitWork = observer(() => {
const
{
run
:
getworkFlowTaskInfoRun
}
=
useMyRequest
(
getworkFlowTaskInfo
,
{
onSuccess
:
(
res
)
=>
{
setPatchInfo
(
res
.
data
);
getOutputs
(
res
.
data
.
outputs
)
},
});
...
...
@@ -225,7 +228,7 @@ const ProjectSubmitWork = observer(() => {
}
},
[
navigate
,
locationInfo
.
from
,
productId
]);
const
getOut
o
uts
=
(
outputs
:
any
)
=>
{
const
getOut
p
uts
=
(
outputs
:
any
)
=>
{
if
(
outputs
)
{
let
result
=
Object
.
keys
(
outputs
);
let
arr
=
result
.
map
((
item
)
=>
{
...
...
@@ -233,8 +236,9 @@ const ProjectSubmitWork = observer(() => {
if
(
outputs
[
item
].
indexOf
(
"dataset"
)
!==
-
1
)
{
type
=
"dataset"
;
}
const
nameArr
=
outputs
[
item
]?.
split
(
'/'
)
||
[]
return
{
name
:
item
,
name
:
nameArr
.
length
?
nameArr
[
nameArr
.
length
-
1
]
:
''
,
type
,
path
:
outputs
[
item
],
size
:
0
,
...
...
@@ -247,11 +251,11 @@ const ProjectSubmitWork = observer(() => {
await
getFileSize
(
item
,
index
);
}
});
r
a
nderOutputs
=
arr
;
setR
anderOutputs
([...
randerOutputs
]
);
r
e
nderOutputs
=
arr
;
setR
enderOutputs
(
renderOutputs
);
}
else
{
r
a
nderOutputs
=
[];
setR
a
nderOutputs
([]);
r
e
nderOutputs
=
[];
setR
e
nderOutputs
([]);
}
};
...
...
@@ -265,8 +269,8 @@ const ProjectSubmitWork = observer(() => {
name
:
getDatasetName
(
item
.
path
),
})
?.
then
((
res
)
=>
{
r
a
nderOutputs
[
index
].
size
=
`
${
res
.
data
}
条`
;
setR
anderOutputs
([...
randerOutputs
]
);
r
e
nderOutputs
[
index
].
size
=
`
${
res
.
data
}
条`
;
setR
enderOutputs
(
renderOutputs
);
})
?.
catch
(()
=>
{
message
.
error
(
"获取数据集大小失败"
);
...
...
@@ -290,10 +294,10 @@ const ProjectSubmitWork = observer(() => {
if
(
Array
.
isArray
(
res
.
data
))
{
res
.
data
.
forEach
((
item1
)
=>
{
if
(
item1
.
name
===
item
.
path
.
slice
(
item
.
path
.
lastIndexOf
(
"/"
)
+
1
))
{
r
a
nderOutputs
[
index
].
size
=
`
${
r
e
nderOutputs
[
index
].
size
=
`
${
item1
.
size
?
storageUnitFromB
(
Number
(
item1
.
size
))
:
"-"
}
`
;
setR
anderOutputs
([...
randerOutputs
]
);
setR
enderOutputs
(
renderOutputs
);
}
});
}
...
...
@@ -466,7 +470,7 @@ const ProjectSubmitWork = observer(() => {
{
!
activeFlowIndex
&&
(
<
TaskInfo
workFlowJobInfo=
{
workFlowJobInfo
as
ITaskInfo
}
randerOutputs1=
{
r
a
nderOutputs1
}
randerOutputs1=
{
r
e
nderOutputs1
}
handleDownLoadOutput=
{
handleDownLoadOutput
}
handleShowPopper=
{
handleShowPopper
}
setGoToProjectDataPath=
{
setGoToProjectDataPath
}
...
...
@@ -547,6 +551,48 @@ const ProjectSubmitWork = observer(() => {
{
statusMap
[
overviewInfo
?.
status
as
IStatus
]
}
</
div
>
</
div
>
{
workFlowJobInfo
?.
outputs
&&
Object
.
keys
(
workFlowJobInfo
?.
outputs
).
length
>
0
&&
(
<
div
className=
{
styles
.
taskResults
}
>
{
renderOutputs1
.
map
((
item
,
index
)
=>
{
return
(
<
div
key=
{
index
}
className=
{
styles
.
outputLi
}
>
<
div
className=
{
styles
.
outputLiLeft
}
>
<
img
className=
{
classNames
({
[
styles
.
outputLiLeftImg
]:
true
,
[
styles
.
outputLiLeftImgBoxShadow2
]:
item
.
type
===
"file"
,
})
}
src=
{
item
.
type
===
"file"
?
taskResultsFileIcon
:
taskResultsDatasetIcon
}
alt=
""
/>
<
div
className=
{
styles
.
outputLiLeftContent
}
>
<
div
className=
{
styles
.
outputItemName
}
>
{
item
.
name
}
</
div
>
<
div
className=
{
styles
.
outputLiSize
}
>
{
item
.
size
}
</
div
>
</
div
>
</
div
>
<
div
onClick=
{
(
e
:
any
)
=>
{
handleDownLoadOutput
(
item
);
}
}
className=
{
classNames
({
[
styles
.
outputLiRight
]:
true
,
[
styles
.
seeDataset
]:
item
.
type
!==
"file"
,
[
styles
.
downloadFile
]:
item
.
type
===
"file"
,
})
}
></
div
>
</
div
>
);
})
}
</
div
>
)
}
</
div
>
)
}
{
!
overviewActive
&&
(
...
...
src/views/Project/ProjectJobDetail/interface.ts
View file @
489ed282
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-15 14:44:24
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-
08-15 14:46:02
* @LastEditTime: 2022-
12-12 18:05:01
* @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/interface.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -10,5 +10,6 @@ export interface IFlowNodeTransmissionNum {
target
:
string
,
value
:
number
,
batchId
:
string
,
source
:
string
source
:
string
,
outputs
:
any
}
\ No newline at end of file
src/views/Project/ProjectOverview/TaskCard/index.tsx
View file @
489ed282
...
...
@@ -53,8 +53,9 @@ const TaskCard = observer((props: TaskCardProps) => {
if
(
outputs
[
item
].
indexOf
(
"dataset"
)
!==
-
1
)
{
type
=
"dataset"
;
}
const
nameArr
=
outputs
[
item
]?.
split
(
'/'
)
||
[]
return
{
name
:
item
,
name
:
nameArr
.
length
?
nameArr
[
nameArr
.
length
-
1
]
:
''
,
type
,
path
:
outputs
[
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