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
21d25080
Commit
21d25080
authored
Dec 14, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 任务结果选中状态不轮询
parent
34250724
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+14
-14
No files found.
src/views/Project/ProjectJobDetail/index.tsx
View file @
21d25080
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-12-1
3 19:15:57
* @LastEditTime: 2022-12-1
4 10:53:11
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -59,7 +59,6 @@ const statusMap = {
...
@@ -59,7 +59,6 @@ const statusMap = {
};
};
type
IStatus
=
"Done"
|
"Running"
|
"Failed"
|
"Pending"
;
type
IStatus
=
"Done"
|
"Running"
|
"Failed"
|
"Pending"
;
let
renderOutputs
:
Array
<
any
>
=
[];
const
ProjectSubmitWork
=
observer
(()
=>
{
const
ProjectSubmitWork
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
...
@@ -99,7 +98,9 @@ const ProjectSubmitWork = observer(() => {
...
@@ -99,7 +98,9 @@ const ProjectSubmitWork = observer(() => {
pollingInterval
:
1000
*
20
,
pollingInterval
:
1000
*
20
,
pollingWhenHidden
:
false
,
pollingWhenHidden
:
false
,
onSuccess
:
(
res
:
IResponse
<
ITaskInfo
>
)
=>
{
onSuccess
:
(
res
:
IResponse
<
ITaskInfo
>
)
=>
{
getOutputs
(
res
.
data
.
outputs
);
if
(
!
activeFlowIndex
)
{
getOutputs
(
res
.
data
.
outputs
);
}
getLogs
(
res
.
data
);
getLogs
(
res
.
data
);
setWorkFlowJobInfo
(
res
.
data
);
setWorkFlowJobInfo
(
res
.
data
);
const
newWorkflowId
=
locationInfo
?.
taskId
?.
replaceAll
(
"-"
,
""
);
const
newWorkflowId
=
locationInfo
?.
taskId
?.
replaceAll
(
"-"
,
""
);
...
@@ -228,6 +229,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -228,6 +229,7 @@ const ProjectSubmitWork = observer(() => {
}
}
},
[
navigate
,
locationInfo
.
from
,
productId
]);
},
[
navigate
,
locationInfo
.
from
,
productId
]);
/** 获取输出文件 */
const
getOutputs
=
(
outputs
:
any
)
=>
{
const
getOutputs
=
(
outputs
:
any
)
=>
{
if
(
outputs
)
{
if
(
outputs
)
{
let
result
=
Object
.
keys
(
outputs
);
let
result
=
Object
.
keys
(
outputs
);
...
@@ -246,21 +248,18 @@ const ProjectSubmitWork = observer(() => {
...
@@ -246,21 +248,18 @@ const ProjectSubmitWork = observer(() => {
});
});
arr
.
forEach
(
async
(
item
,
index
)
=>
{
arr
.
forEach
(
async
(
item
,
index
)
=>
{
if
(
item
.
type
===
"dataset"
)
{
if
(
item
.
type
===
"dataset"
)
{
await
getDataSetSize
(
item
,
index
);
await
getDataSetSize
(
item
,
index
,
arr
);
}
else
{
}
else
{
await
getFileSize
(
item
,
index
);
await
getFileSize
(
item
,
index
,
arr
);
}
}
});
});
renderOutputs
=
arr
;
setRenderOutputs
(
renderOutputs
);
}
else
{
}
else
{
renderOutputs
=
[];
setRenderOutputs
([]);
setRenderOutputs
([]);
}
}
};
};
const
getDataSetSize
=
async
(
item
:
any
,
index
:
number
)
=>
{
const
getDataSetSize
=
async
(
item
:
any
,
index
:
number
,
arr
:
any
)
=>
{
CloudEController
.
GetDatasetSize
({
CloudEController
.
GetDatasetSize
({
type
:
productId
,
type
:
productId
,
projectId
:
projectId
as
string
,
projectId
:
projectId
as
string
,
...
@@ -270,15 +269,15 @@ const ProjectSubmitWork = observer(() => {
...
@@ -270,15 +269,15 @@ const ProjectSubmitWork = observer(() => {
name
:
getDatasetName
(
item
.
path
),
name
:
getDatasetName
(
item
.
path
),
})
})
?.
then
((
res
)
=>
{
?.
then
((
res
)
=>
{
renderOutputs
[
index
].
size
=
`
${
res
.
data
}
条`
;
arr
[
index
].
size
=
`
${
res
.
data
}
条`
;
setRenderOutputs
(
renderOutputs
);
setRenderOutputs
(
arr
);
})
})
?.
catch
(()
=>
{
?.
catch
(()
=>
{
message
.
error
(
"获取数据集大小失败"
);
message
.
error
(
"获取数据集大小失败"
);
});
});
};
};
const
getFileSize
=
(
item
:
any
,
index
:
number
)
=>
{
const
getFileSize
=
(
item
:
any
,
index
:
number
,
arr
:
any
)
=>
{
let
path
=
item
.
path
.
slice
(
12
);
let
path
=
item
.
path
.
slice
(
12
);
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
if
(
lastIndex
===
-
1
)
{
if
(
lastIndex
===
-
1
)
{
...
@@ -295,10 +294,10 @@ const ProjectSubmitWork = observer(() => {
...
@@ -295,10 +294,10 @@ const ProjectSubmitWork = observer(() => {
if
(
Array
.
isArray
(
res
.
data
))
{
if
(
Array
.
isArray
(
res
.
data
))
{
res
.
data
.
forEach
((
item1
)
=>
{
res
.
data
.
forEach
((
item1
)
=>
{
if
(
item1
.
name
===
item
.
path
.
slice
(
item
.
path
.
lastIndexOf
(
"/"
)
+
1
))
{
if
(
item1
.
name
===
item
.
path
.
slice
(
item
.
path
.
lastIndexOf
(
"/"
)
+
1
))
{
renderOutputs
[
index
].
size
=
`
${
arr
[
index
].
size
=
`
${
item1
.
size
?
storageUnitFromB
(
Number
(
item1
.
size
))
:
"-"
item1
.
size
?
storageUnitFromB
(
Number
(
item1
.
size
))
:
"-"
}
`
;
}
`
;
setRenderOutputs
(
renderOutputs
);
setRenderOutputs
(
arr
);
}
}
});
});
}
}
...
@@ -340,6 +339,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -340,6 +339,7 @@ const ProjectSubmitWork = observer(() => {
}
}
});
});
}
else
{
}
else
{
/** 未选中算子初始化为 整体的任务结果 */
getOutputs
(
workFlowJobInfo
?.
outputs
)
getOutputs
(
workFlowJobInfo
?.
outputs
)
}
}
...
...
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