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
3b42d192
Commit
3b42d192
authored
Aug 15, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 部分接口请求增加loading
parent
ed9537e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
29 deletions
+58
-29
MyPopconfirm.tsx
src/components/mui/MyPopconfirm.tsx
+8
-1
index.tsx
src/views/CustomOperator/index.tsx
+2
-1
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+11
-1
index.tsx
src/views/Project/ProjectWorkbench/workbenchList/index.tsx
+37
-26
No files found.
src/components/mui/MyPopconfirm.tsx
View file @
3b42d192
...
...
@@ -30,6 +30,7 @@ interface IMyPopconfirmProps {
showCancel
?:
boolean
;
onCancel
?:
any
;
onConfirm
?:
any
;
loading
?:
boolean
;
}
const
MyPopconfirm
=
(
props
:
IMyPopconfirmProps
)
=>
{
...
...
@@ -42,6 +43,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
showCancel
=
true
,
onCancel
,
onConfirm
,
loading
=
false
,
}
=
props
;
const
open
=
useMemo
(()
=>
{
...
...
@@ -97,7 +99,12 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
style=
{
{
marginRight
:
"12px"
}
}
/>
)
}
<
MyButton
text=
{
okText
}
onClick=
{
handleOk
}
/>
<
MyButton
text=
{
okText
}
onClick=
{
handleOk
}
loading=
{
loading
}
isLoadingButton=
{
true
}
/>
</
Box
>
</
Popper
>
);
...
...
src/views/CustomOperator/index.tsx
View file @
3b42d192
...
...
@@ -100,7 +100,8 @@ const CustomOperator = observer((props: IProps) => {
return
(
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"file"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"path"
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"input"
);
})
)
{
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
3b42d192
...
...
@@ -74,6 +74,8 @@ const ProjectSubmitWork = observer(() => {
(
parameter
.
domType
||
""
).
toLowerCase
()
===
"checkbox"
)
{
value
=
parameter
.
defaultValue
.
split
(
","
);
}
else
if
((
parameter
.
domType
||
""
).
toLowerCase
()
===
"input"
)
{
value
=
String
(
parameter
.
defaultValue
);
}
else
{
value
=
parameter
.
defaultValue
;
}
...
...
@@ -82,6 +84,13 @@ const ProjectSubmitWork = observer(() => {
(
parameter
.
domType
||
""
).
toLowerCase
()
===
"checkbox"
)
{
value
=
[];
}
else
if
((
parameter
.
domType
||
""
).
toLowerCase
()
===
"input"
)
{
value
=
String
(
parameter
.
defaultValue
)
===
"null"
?
""
:
String
(
parameter
.
defaultValue
);
}
else
if
((
parameter
.
domType
||
""
).
toLowerCase
()
===
"radio"
)
{
value
=
false
;
}
else
{
value
=
""
;
}
...
...
@@ -106,7 +115,7 @@ const ProjectSubmitWork = observer(() => {
},
});
const
{
run
:
submitWorkFlowRun
}
=
useMyRequest
(
submitWorkFlow
,
{
const
{
run
:
submitWorkFlowRun
,
loading
}
=
useMyRequest
(
submitWorkFlow
,
{
onSuccess
:
(
res
)
=>
{
Message
.
success
(
"提交成功"
);
goToWorkbench
(
true
);
...
...
@@ -323,6 +332,7 @@ const ProjectSubmitWork = observer(() => {
anchorEl=
{
anchorEl
}
onCancel=
{
handleCancel
}
onConfirm=
{
handleConfirm
}
loading=
{
loading
}
/>
</
div
>
);
...
...
src/views/Project/ProjectWorkbench/workbenchList/index.tsx
View file @
3b42d192
...
...
@@ -79,30 +79,31 @@ const ProjectMembers = observer(() => {
const
[
size
,
setSize
]
=
useState
(
10
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
false
)
/** 简单弹窗 */
const
[
jobData
,
setJobData
]
=
useState
(
""
);
const
[
openDialog
,
setOpenDialog
]
=
useState
(
false
);
const
[
dialogType
,
setDialogType
]
=
useState
(
"del"
);
// 获取作业列表
const
{
run
:
getWorkflowJobInfo
}
=
useMyRequest
(
getWorkflowJobList
,
{
onSuccess
:
(
result
:
any
)
=>
{
setJobList
(
result
.
data
.
content
);
setCount
(
result
.
data
.
totalElements
);
setLoading
(
false
);
timer
&&
clearTimeout
(
timer
as
number
);
timer
=
null
;
timer
=
setTimeout
(()
=>
{
getWorkflowJobInfo
({
projectId
:
currentProjectStore
.
currentProjectInfo
.
id
as
string
,
page
:
page
,
size
:
size
,
name
:
jobName
,
state
:
currency
===
"ALL"
?
""
:
currency
,
});
},
60000
);
},
});
const
{
run
:
getWorkflowJobInfo
,
loading
}
=
useMyRequest
(
getWorkflowJobList
,
{
onSuccess
:
(
result
:
any
)
=>
{
setJobList
(
result
.
data
.
content
);
setCount
(
result
.
data
.
totalElements
);
timer
&&
clearTimeout
(
timer
as
number
);
timer
=
null
;
timer
=
setTimeout
(()
=>
{
getWorkflowJobInfo
({
projectId
:
currentProjectStore
.
currentProjectInfo
.
id
as
string
,
page
:
page
,
size
:
size
,
name
:
jobName
,
state
:
currency
===
"ALL"
?
""
:
currency
,
});
},
60000
);
},
}
);
useEffect
(()
=>
{
return
()
=>
{
...
...
@@ -281,7 +282,7 @@ const ProjectMembers = observer(() => {
const
rowClick
=
useCallback
(
(
id
:
string
)
=>
{
navigate
(
`/product/cadd/projectJobDetail`
,
{
state
:
{
taskId
:
id
,
from
:
'workbenchList'
},
state
:
{
taskId
:
id
,
from
:
"workbenchList"
},
});
},
[
navigate
]
...
...
@@ -359,7 +360,6 @@ const ProjectMembers = observer(() => {
name
:
jobName
,
state
:
currency
===
"ALL"
?
""
:
currency
,
});
setLoading
(
true
)
}
}
>
<
img
alt=
""
src=
{
onload
}
/>
...
...
@@ -410,7 +410,9 @@ const ProjectMembers = observer(() => {
</
Box
>
<
Box
className=
{
styles
.
tabBoxMiddle
}
>
<
img
alt=
""
src=
{
jobCost
}
/>
<
div
className=
{
styles
.
tabBoxTime
}
>
{
item
.
jobCost
.
toFixed
(
2
)
}
元
</
div
>
<
div
className=
{
styles
.
tabBoxTime
}
>
{
item
.
jobCost
.
toFixed
(
2
)
}
元
</
div
>
</
Box
>
<
Box
className=
{
styles
.
tabBoxJobStatus
}
>
<
img
alt=
""
src=
{
renderStatusIcon
(
item
.
state
)
}
/>
...
...
@@ -427,7 +429,10 @@ const ProjectMembers = observer(() => {
/>
</
Box
>
<
div
style=
{
{
color
:
renderTextColor
(
item
.
state
),
margin
:
'0px'
}
}
style=
{
{
color
:
renderTextColor
(
item
.
state
),
margin
:
"0px"
,
}
}
className=
{
styles
.
tabBoxStatusText
}
>
{
item
.
completeNum
+
"/"
+
item
.
totalNum
}
...
...
@@ -437,8 +442,14 @@ const ProjectMembers = observer(() => {
{
item
.
state
===
"RUNNING"
&&
isPass
(
"PROJECT_WORKBENCH_JOBS_STOP"
,
"USER"
)
&&
(
<
Box
className=
{
styles
.
tabBoxJobOperate
}
>
{
currentProjectStore
.
currentProjectInfo
.
projectRole
===
"USER"
&&
(
item
.
creator
!==
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
)
||
"{}"
)?.
name
)
?
""
:
<
img
{
currentProjectStore
.
currentProjectInfo
.
projectRole
===
"USER"
&&
item
.
creator
!==
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
)
||
"{}"
)
?.
name
?
(
""
)
:
(
<
img
alt=
""
src=
{
jobStop
}
style=
{
{
cursor
:
"pointer"
}
}
...
...
@@ -450,7 +461,7 @@ const ProjectMembers = observer(() => {
setDialogType
(
"stop"
);
}
}
/>
}
)
}
</
Box
>
)
}
{
item
.
state
!==
"RUNNING"
&&
...
...
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