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
bc5b7a9d
Commit
bc5b7a9d
authored
Jul 09, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改tabs组件样式, 完成参数样式
parent
aafe285f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
Tabs.tsx
src/components/mui/Tabs.tsx
+41
-3
index.module.css
...WorkFlowEdit/components/ParameterSetting/index.module.css
+4
-0
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+0
-0
No files found.
src/components/mui/Tabs.tsx
View file @
bc5b7a9d
...
@@ -11,27 +11,62 @@ import { isEqual } from "lodash";
...
@@ -11,27 +11,62 @@ import { isEqual } from "lodash";
import
{
useState
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
{
Box
}
from
"@mui/system"
;
import
{
Box
}
from
"@mui/system"
;
import
Tab
from
"@mui/material/Tab"
;
import
Tab
from
"@mui/material/Tab"
;
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
import
{
TabContext
,
TabList
,
TabPanel
}
from
"@mui/lab"
;
import
{
TabContext
,
TabList
,
TabPanel
}
from
"@mui/lab"
;
import
{
Typography
}
from
"@mui/material"
;
import
{
Typography
}
from
"@mui/material"
;
interface
ITabList
{
interface
ITabList
{
label
:
string
;
label
:
string
;
value
:
string
;
value
:
string
;
component
:
JSX
.
Element
;
component
:
JSX
.
Element
|
React
.
ReactNode
;
icon
?:
string
;
icon
?:
string
;
iconed
?:
string
;
iconed
?:
string
;
hide
?:
boolean
;
hide
?:
boolean
;
disabled
?:
boolean
;
}
}
interface
IProps
{
interface
IProps
{
tabList
:
ITabList
[];
tabList
:
ITabList
[];
defaultValue
?:
string
;
defaultValue
?:
string
;
allowNullValue
?:
boolean
;
// 是否允许空值
}
}
const
theme
=
createTheme
({
components
:
{
MuiTab
:
{
styleOverrides
:
{
root
:
{
paddingLeft
:
0
,
paddingRight
:
0
,
paddingTop
:
'8px'
,
paddingBottom
:
'8px'
,
minWidth
:
'20px'
,
marginRight
:
'32px'
,
color
:
'#8A9099'
,
selected
:
{
color
:
'#1976d2'
},
"&.Mui-disabled"
:
{
color
:
'#C2C6CC'
,
},
},
},
},
// #C2C6CC
MuiTabs
:{
styleOverrides
:
{
indicator
:
{
backgroundColor
:
'#1370FF'
,
}
}
},
},
});
const
Tabs
=
(
props
:
IProps
)
=>
{
const
Tabs
=
(
props
:
IProps
)
=>
{
const
{
tabList
,
defaultValue
}
=
props
;
const
{
tabList
,
defaultValue
,
allowNullValue
=
false
}
=
props
;
const
[
value
,
setValue
]
=
useState
(
const
[
value
,
setValue
]
=
useState
(
defaultValue
||
tabList
.
filter
((
e
)
=>
!
e
.
hide
)[
0
].
value
defaultValue
?
defaultValue
:
allowNullValue
?
''
:
tabList
.
filter
((
e
)
=>
!
e
.
hide
)[
0
].
value
);
);
const
onChange
=
(
val
:
string
)
=>
{
const
onChange
=
(
val
:
string
)
=>
{
...
@@ -58,6 +93,7 @@ const Tabs = (props: IProps) => {
...
@@ -58,6 +93,7 @@ const Tabs = (props: IProps) => {
};
};
return
(
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
TabContext
value=
{
value
}
>
<
TabContext
value=
{
value
}
>
<
Box
sx=
{
{
borderBottom
:
1
,
borderColor
:
"#F0F2F5"
}
}
>
<
Box
sx=
{
{
borderBottom
:
1
,
borderColor
:
"#F0F2F5"
}
}
>
<
TabList
<
TabList
...
@@ -74,6 +110,7 @@ const Tabs = (props: IProps) => {
...
@@ -74,6 +110,7 @@ const Tabs = (props: IProps) => {
label=
{
labelRender
(
item
,
key
)
}
label=
{
labelRender
(
item
,
key
)
}
value=
{
item
.
value
}
value=
{
item
.
value
}
id=
{
item
.
value
}
id=
{
item
.
value
}
disabled=
{
item
.
disabled
}
/>
/>
);
);
})
}
})
}
...
@@ -93,6 +130,7 @@ const Tabs = (props: IProps) => {
...
@@ -93,6 +130,7 @@ const Tabs = (props: IProps) => {
);
);
})
}
})
}
</
TabContext
>
</
TabContext
>
</
ThemeProvider
>
);
);
};
};
const
handleEqual
=
(
prvProps
:
IProps
,
nextProps
:
IProps
)
=>
{
const
handleEqual
=
(
prvProps
:
IProps
,
nextProps
:
IProps
)
=>
{
...
...
src/views/WorkFlowEdit/components/ParameterSetting/index.module.css
View file @
bc5b7a9d
...
@@ -133,3 +133,6 @@
...
@@ -133,3 +133,6 @@
line-height
:
22px
;
line-height
:
22px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
color
:
rgba
(
138
,
144
,
153
,
1
);
}
}
.paramsGroup
{
padding-bottom
:
24px
;
}
\ No newline at end of file
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
bc5b7a9d
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