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
54417ef3
Commit
54417ef3
authored
Jul 27, 2022
by
jiangzijing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:SearchInput组件封装
parent
a96ed9fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
11 deletions
+81
-11
index.tsx
src/components/BusinessComponents/SearchInput/index.tsx
+62
-0
index.tsx
src/views/Project/ProjectOverview/TaskCard/index.tsx
+1
-2
index.module.css
src/views/Project/ProjectOverview/index.module.css
+18
-9
index.tsx
src/views/Project/ProjectOverview/index.tsx
+0
-0
No files found.
src/components/BusinessComponents/SearchInput/index.tsx
0 → 100644
View file @
54417ef3
import
OutlinedInput
,
{
OutlinedInputProps
}
from
"@mui/material/OutlinedInput"
;
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
// 使用该搜索框组件时,width、height、font-size等样式属性可以在组件sx属性中覆盖掉当前组件内的样式
// 该组件默认搜索框高度为32px,宽度和容器一致,字体大小14px
// 若想自定义修改,写法:<SearchInput sx={{ width: 340 ,height: 36 ,fontSize: 12}} />
interface
SearchInputProps
extends
OutlinedInputProps
{
value
?:
any
;
variant
?:
"standard"
|
"filled"
|
"outlined"
;
size
?:
"small"
|
"medium"
;
placeholder
?:
string
;
fullWidth
?:
boolean
;
// 宽度是否和容器一致
error
?:
boolean
;
};
const
SearchInput
=
(
props
:
SearchInputProps
)
=>
{
const
{
size
=
"small"
,
placeholder
=
"输入关键词搜索"
,
fullWidth
=
true
,
...
other
}
=
props
;
const
theme
=
createTheme
({
components
:
{
MuiOutlinedInput
:
{
styleOverrides
:
{
root
:
{
height
:
"32px"
,
fontSize
:
"14px"
,
paddingRight
:
"8px"
,
":hover"
:
{
"& .MuiOutlinedInput-notchedOutline"
:
{
borderColor
:
"#1370ff"
,
},
},
},
input
:
{
padding
:
"5px 12px"
,
verticalAlign
:
"middle"
,
},
},
},
},
});
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
OutlinedInput
size=
{
size
}
placeholder=
{
placeholder
}
fullWidth=
{
fullWidth
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#999"
}
}
/>
}
{
...
other
}
/>
</
ThemeProvider
>
);
}
export
default
SearchInput
\ No newline at end of file
src/views/Project/ProjectOverview/TaskCard/index.tsx
View file @
54417ef3
...
...
@@ -45,7 +45,7 @@ const TaskCard = (props: TaskCardProps) => {
return
[];
}
},
[
outputs
])
// 结果跳转
// 结果
文件
跳转
const
goToProjectData
=
(
path
:
string
)
=>
{
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
if
(
lastIndex
!==
-
1
)
{
...
...
@@ -153,7 +153,6 @@ const TaskCard = (props: TaskCardProps) => {
<
div
style=
{
{
color
:
renderTextColor
(
state
)
}
}
>
{
completeNum
+
"/"
+
totalNum
}
</
div
>
</
div
>
<
MyProgress
color=
{
renderProgressColor
(
state
)
}
value=
{
(
completeNum
/
totalNum
)
*
100
}
/>
{
/* <MyProgress color="info" value={80}/> */
}
</
div
>
<
div
className=
{
style
.
bottomLine
}
>
<
img
alt=
""
src=
{
runTime
}
/>
...
...
src/views/Project/ProjectOverview/index.module.css
View file @
54417ef3
...
...
@@ -86,20 +86,28 @@
min-height
:
calc
(
100vh
-
291px
);
}
.noDataBox
{
.noDataBox
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.noDataText
{
margin-top
:
8px
;
font-size
:
14px
;
line-height
:
22px
;
color
:
#8a9099
;
margin-top
:
8px
;
font-size
:
14px
;
line-height
:
22px
;
color
:
#8a9099
;
}
.loadingBox
{
width
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
calc
(
100vh
-
100px
);
}
\ No newline at end of file
src/views/Project/ProjectOverview/index.tsx
View file @
54417ef3
This diff is collapsed.
Click to expand it.
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