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