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
ef48fa31
Commit
ef48fa31
authored
Jul 22, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: MyPropress进度条组件开发
parent
aaf17676
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
31 deletions
+114
-31
MyProgress.tsx
src/components/mui/MyProgress.tsx
+74
-0
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+3
-5
index.tsx
src/views/Project/ProjectWorkbench/workbenchList/index.tsx
+37
-26
No files found.
src/components/mui/MyProgress.tsx
0 → 100644
View file @
ef48fa31
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-11 11:56:58
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-22 15:47:55
* @FilePath: /bkunyun/src/components/mui/MyProgress.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
import
{
LinearProgress
,
LinearProgressProps
}
from
"@mui/material"
;
import
{
useMemo
}
from
"react"
;
interface
IMyProgressProps
extends
Omit
<
LinearProgressProps
,
"color"
>
{
color
:
|
"disable"
|
"primary"
|
"secondary"
|
"error"
|
"info"
|
"success"
|
"warning"
|
"inherit"
;
}
const
MyProgress
=
(
props
:
IMyProgressProps
)
=>
{
const
{
color
,
variant
=
"determinate"
,
...
other
}
=
props
;
const
backgroundColorInfo
=
useMemo
(()
=>
{
if
(
color
===
"info"
)
{
return
{
backgroundColor
:
"#1370FF"
,
};
}
if
(
color
===
"success"
)
{
return
{
backgroundColor
:
"#0DD09B"
,
};
}
if
(
color
===
"error"
)
{
return
{
backgroundColor
:
"#FF4E4E"
,
};
}
if
(
color
===
"disable"
)
{
return
{
backgroundColor
:
"#C2C6CC"
,
};
}
},
[
color
]);
// /#C2C6CC
const
theme
=
createTheme
({
components
:
{
MuiLinearProgress
:
{
styleOverrides
:
{
root
:
{
borderRadius
:
3
,
height
:
"6px"
,
background
:
"#F0F2F5"
,
},
bar
:
backgroundColorInfo
,
},
},
},
});
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
LinearProgress
{
...
other
}
/>
</
ThemeProvider
>
);
};
export
default
MyProgress
;
src/views/ConsoleLayout/components/FileItem/index.tsx
View file @
ef48fa31
...
@@ -3,12 +3,12 @@ import { useNavigate, useLocation } from "react-router-dom";
...
@@ -3,12 +3,12 @@ import { useNavigate, useLocation } from "react-router-dom";
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useMemo
}
from
"react"
;
import
{
useMemo
}
from
"react"
;
import
{
LinearProgress
}
from
"@mui/material"
;
import
{
formatTime
,
storageUnitFromB
}
from
"@/utils/util"
;
import
{
formatTime
,
storageUnitFromB
}
from
"@/utils/util"
;
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
{
IUploadInfo
}
from
"@/store/modules/fileList"
;
import
{
IUploadInfo
}
from
"@/store/modules/fileList"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
bkunyunFile
from
"@/assets/img/bkunyunFile.svg"
;
import
bkunyunFile
from
"@/assets/img/bkunyunFile.svg"
;
import
MyProgress
from
"@/components/mui/MyProgress"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
...
@@ -115,14 +115,12 @@ const FileItem = observer((props: IProps) => {
...
@@ -115,14 +115,12 @@ const FileItem = observer((props: IProps) => {
)
}
)
}
</
div
>
</
div
>
{
statusMsg
!==
"上传成功"
?
(
{
statusMsg
!==
"上传成功"
?
(
<
Linear
Progress
<
My
Progress
sx=
{
{
sx=
{
{
width
:
300
,
width
:
300
,
borderRadius
:
2
,
margin
:
"6px 0"
,
margin
:
"6px 0"
,
color
:
"red"
,
}
}
}
}
variant=
"determinate
"
color=
"error
"
value=
{
itemInfo
?.
percentage
}
value=
{
itemInfo
?.
percentage
}
/>
/>
)
:
null
}
)
:
null
}
...
...
src/views/Project/ProjectWorkbench/workbenchList/index.tsx
View file @
ef48fa31
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-0
6-28 11:30:27
* @LastEditTime: 2022-0
7-22 16:20:26
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/
*/
...
@@ -12,7 +12,6 @@ import { useNavigate } from "react-router-dom";
...
@@ -12,7 +12,6 @@ import { useNavigate } from "react-router-dom";
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
OutlinedInput
from
"@mui/material/OutlinedInput"
;
import
OutlinedInput
from
"@mui/material/OutlinedInput"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
LinearProgress
,
{
linearProgressClasses
}
from
'@mui/material/LinearProgress'
;
import
{
TablePagination
}
from
'@mui/material'
;
import
{
TablePagination
}
from
'@mui/material'
;
import
TextField
from
'@mui/material/TextField'
;
import
TextField
from
'@mui/material/TextField'
;
import
MenuItem
from
'@mui/material/MenuItem'
;
import
MenuItem
from
'@mui/material/MenuItem'
;
...
@@ -39,6 +38,7 @@ import {
...
@@ -39,6 +38,7 @@ import {
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
usePass
from
"@/hooks/usePass"
;
import
usePass
from
"@/hooks/usePass"
;
import
MyProgress
from
"@/components/mui/MyProgress"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
...
@@ -231,20 +231,37 @@ const ProjectMembers = observer(() => {
...
@@ -231,20 +231,37 @@ const ProjectMembers = observer(() => {
}
}
}
}
const
renderProgress
=
(
data
:
any
)
=>
{
/** 渲染字体颜色 */
switch
(
data
)
{
const
renderTextColor
=
(
data
:
any
)
=>
{
case
"RUNNING"
:
switch
(
data
)
{
return
'#1370FF'
case
"RUNNING"
:
case
"ABORTED"
:
return
"#1370FF"
;
return
'#C2C6CC'
case
"ABORTED"
:
case
"FAILED"
:
return
"#C2C6CC"
;
return
'#FF4E4E'
case
"FAILED"
:
case
"SUCCEEDED"
:
return
"#FF4E4E"
;
return
'#0DD09B'
case
"SUCCEEDED"
:
default
:
return
"#0DD09B"
;
return
'#C2C6CC'
default
:
}
return
"#C2C6CC"
;
}
}
};
/** 渲染进度条颜色 */
const
renderProgressColor
=
useCallback
((
data
:
any
)
=>
{
switch
(
data
)
{
case
"RUNNING"
:
return
"info"
;
case
"ABORTED"
:
return
"disable"
;
case
"FAILED"
:
return
"error"
;
case
"SUCCEEDED"
:
return
"success"
;
default
:
return
"disable"
;
}
},
[]);
/** 点击每一行 */
/** 点击每一行 */
const
rowClick
=
useCallback
(
const
rowClick
=
useCallback
(
...
@@ -282,12 +299,12 @@ const ProjectMembers = observer(() => {
...
@@ -282,12 +299,12 @@ const ProjectMembers = observer(() => {
size=
"small"
size=
"small"
sx=
{
{
sx=
{
{
width
:
180
,
height
:
32
,
width
:
180
,
height
:
32
,
[
'& .MuiOutlinedInput-root'
]
:
{
'& .MuiOutlinedInput-root'
:
{
height
:
'32px'
,
height
:
'32px'
,
color
:
"#1E2633"
,
color
:
"#1E2633"
,
fontSize
:
'14px'
fontSize
:
'14px'
},
},
[
'& .MuiInputLabel-root'
]
:
{
'& .MuiInputLabel-root'
:
{
color
:
"#8A9099"
,
color
:
"#8A9099"
,
fontSize
:
'14px'
fontSize
:
'14px'
},
},
...
@@ -350,19 +367,13 @@ const ProjectMembers = observer(() => {
...
@@ -350,19 +367,13 @@ const ProjectMembers = observer(() => {
<
img
alt=
""
src=
{
renderStatusIcon
(
item
.
state
)
}
/>
<
img
alt=
""
src=
{
renderStatusIcon
(
item
.
state
)
}
/>
<
div
className=
{
styles
.
tabBoxStatusText
}
>
{
renderStatusText
(
item
.
state
)
}
</
div
>
<
div
className=
{
styles
.
tabBoxStatusText
}
>
{
renderStatusText
(
item
.
state
)
}
</
div
>
<
Box
sx=
{
{
width
:
'100%'
}
}
>
<
Box
sx=
{
{
width
:
'100%'
}
}
>
<
LinearProgress
variant=
"determinate"
value=
{
(
item
.
completeNum
/
item
.
totalNum
)
*
100
}
<
MyProgress
color=
{
renderProgressColor
(
item
.
data
)
}
value=
{
(
item
.
completeNum
/
item
.
totalNum
)
*
100
}
sx=
{
{
sx=
{
{
borderRadius
:
'3px'
,
height
:
"6px"
,
backgroundColor
:
"#F0F2F5"
,
marginRight
:
'16px'
,
marginRight
:
'16px'
,
[
`& .${linearProgressClasses.bar}`
]:
{
backgroundColor
:
renderProgress
(
item
.
state
),
borderRadius
:
'3px'
,
},
}
}
}
}
/>
/>
</
Box
>
</
Box
>
<
div
style=
{
{
color
:
render
Progress
(
item
.
state
)
}
}
className=
{
styles
.
tabBoxStatusText
}
>
{
item
.
completeNum
+
"/"
+
item
.
totalNum
}
</
div
>
<
div
style=
{
{
color
:
render
TextColor
(
item
.
state
)
}
}
className=
{
styles
.
tabBoxStatusText
}
>
{
item
.
completeNum
+
"/"
+
item
.
totalNum
}
</
div
>
</
Box
>
</
Box
>
{
{
...
...
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