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
f74a51ad
Commit
f74a51ad
authored
Jul 28, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI: 样式优化 select组件替换
parent
5cf52638
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
114 deletions
+60
-114
MyButton.tsx
src/components/mui/MyButton.tsx
+4
-4
MyDialog.tsx
src/components/mui/MyDialog.tsx
+1
-0
index.tsx
src/views/Project/ProjectData/AddFolder/index.tsx
+1
-2
index.tsx
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
+18
-2
MySelect.tsx
src/views/Project/ProjectSubmitWork/components/MySelect.tsx
+0
-95
index.module.css
...ews/Project/components/ProjectListPopper/index.module.css
+6
-2
index.tsx
src/views/Project/components/ProjectListPopper/index.tsx
+14
-4
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+16
-5
No files found.
src/components/mui/MyButton.tsx
View file @
f74a51ad
...
@@ -82,12 +82,12 @@ const theme = createTheme({
...
@@ -82,12 +82,12 @@ const theme = createTheme({
},
},
},
},
outlinedSecondary
:
{
outlinedSecondary
:
{
border
:
"1px solid
#FF4E4E
"
,
border
:
"1px solid
rgba(221, 225, 230, 1)
"
,
boxShadow
:
"none !important"
,
boxShadow
:
"none !important"
,
color
:
"
#FF4E4E
"
,
color
:
"
rgba(30, 38, 51, 1)
"
,
"&:hover"
:
{
"&:hover"
:
{
backgroundColor
:
"#FFEDED "
,
//
backgroundColor: "#FFEDED ",
border
:
"1px solid #FF4E4E
"
,
// border: "1px solid rgba(30, 38, 51, 1)
",
},
},
},
},
textSecondary
:
{
textSecondary
:
{
...
...
src/components/mui/MyDialog.tsx
View file @
f74a51ad
...
@@ -89,6 +89,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
...
@@ -89,6 +89,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
onClick=
{
onClose
}
onClick=
{
onClose
}
variant=
"outlined"
variant=
"outlined"
size=
"small"
size=
"small"
color=
"secondary"
/>
/>
)
:
null
}
)
:
null
}
{
showConfirm
?
(
{
showConfirm
?
(
...
...
src/views/Project/ProjectData/AddFolder/index.tsx
View file @
f74a51ad
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
useState
,
useEffect
}
from
"react"
;
import
{
TextField
}
from
"@mui/material"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
...
...
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
View file @
f74a51ad
...
@@ -310,7 +310,15 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -310,7 +310,15 @@ const ConfigForm = (props: ConfigFormProps) => {
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
value=
{
parameter
.
value
}
value=
{
parameter
.
value
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
handleParameterChange
(
e
,
taskId
,
parameter
.
name
||
""
)
handleParameterChange
(
{
target
:
{
value
:
e
,
},
},
taskId
,
parameter
.
name
||
""
)
}
}
error=
{
parameter
.
error
||
false
}
error=
{
parameter
.
error
||
false
}
helpertext=
{
parameter
.
helperText
}
helpertext=
{
parameter
.
helperText
}
...
@@ -324,7 +332,15 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -324,7 +332,15 @@ const ConfigForm = (props: ConfigFormProps) => {
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
value=
{
parameter
.
value
}
value=
{
parameter
.
value
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
handleParameterChange
(
e
,
taskId
,
parameter
.
name
||
""
)
handleParameterChange
(
{
target
:
{
value
:
e
,
},
},
taskId
,
parameter
.
name
||
""
)
}
}
multiple=
{
true
}
multiple=
{
true
}
error=
{
parameter
.
error
||
false
}
error=
{
parameter
.
error
||
false
}
...
...
src/views/Project/ProjectSubmitWork/components/MySelect.tsx
deleted
100644 → 0
View file @
5cf52638
import
*
as
React
from
"react"
;
import
InputLabel
from
"@mui/material/InputLabel"
;
import
MenuItem
from
"@mui/material/MenuItem"
;
import
FormControl
from
"@mui/material/FormControl"
;
import
FormHelperText
from
"@mui/material/FormHelperText"
;
import
Select
,
{
SelectProps
}
from
"@mui/material/Select"
;
export
interface
IOption
{
label
:
string
;
value
:
string
;
disabled
?:
boolean
;
}
export
const
optionsTransform
=
(
arr
:
Array
<
any
>
,
labelKey
:
string
=
"label"
,
valueKey
:
string
=
"value"
,
disabledKey
:
string
=
"disabled"
):
Array
<
IOption
>
=>
{
return
arr
.
map
((
item
:
any
)
=>
{
return
{
label
:
item
[
labelKey
],
value
:
item
[
valueKey
],
disabled
:
item
[
disabledKey
],
};
});
};
interface
IProps
extends
Omit
<
SelectProps
,
"value"
|
"options"
|
"onChange"
|
"title"
>
{
value
?:
any
;
options
:
IOption
[];
onChange
?:
any
;
/** 类型变种 */
variant
?:
"standard"
|
"outlined"
|
"filled"
;
/** title */
title
?:
string
;
/** 是否显示title */
isTitle
?:
boolean
;
size
?:
"small"
|
"medium"
;
multiple
?:
boolean
;
// 多选
error
?:
boolean
;
helpertext
?:
string
;
fullWidth
?:
boolean
;
}
export
default
function
MySelect
(
props
:
IProps
)
{
const
{
value
,
options
,
onChange
,
title
,
isTitle
=
false
,
variant
,
size
=
"small"
,
multiple
=
false
,
error
=
false
,
helpertext
,
fullWidth
=
true
,
}
=
props
;
return
(
<
FormControl
fullWidth=
{
fullWidth
}
variant=
{
variant
}
error=
{
error
}
>
{
isTitle
?
(
<
InputLabel
id=
"demo-simple-select-label"
>
{
title
||
"请选择"
}
</
InputLabel
>
)
:
null
}
<
Select
labelId=
"demo-simple-select-label"
id=
"demo-simple-select"
label=
{
title
||
""
}
size=
{
size
}
{
...
props
}
value=
{
value
}
onChange=
{
onChange
}
multiple=
{
multiple
}
>
{
options
.
length
?
options
?.
map
((
item
:
IOption
)
=>
{
return
(
<
MenuItem
key=
{
item
.
value
}
value=
{
item
.
value
}
disabled=
{
item
?.
disabled
}
>
{
item
.
label
}
</
MenuItem
>
);
})
:
null
}
</
Select
>
{
helpertext
&&
error
&&
<
FormHelperText
>
{
helpertext
}
</
FormHelperText
>
}
</
FormControl
>
);
}
src/views/Project/components/ProjectListPopper/index.module.css
View file @
f74a51ad
...
@@ -41,12 +41,16 @@
...
@@ -41,12 +41,16 @@
.projectlist
{
.projectlist
{
flex
:
1
;
flex
:
1
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
border-top
:
1px
solid
#f0f2f5
;
}
}
.projectli
{
.projectli
{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.projectli
:hover
{
.projectli
:hover
{
background-color
:
#f2f7ff
;
background-color
:
rgba
(
240
,
242
,
245
,
1
);
}
.projectliActive
{
background-color
:
rgba
(
237
,
244
,
255
,
1
);
}
}
.projectliBorderBox
{
.projectliBorderBox
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
@@ -57,7 +61,7 @@
...
@@ -57,7 +61,7 @@
flex-direction
:
row
;
flex-direction
:
row
;
justify-content
:
flex-start
;
justify-content
:
flex-start
;
align-items
:
flex-start
;
align-items
:
flex-start
;
border-top
:
1px
solid
#f0f2f5
;
border-bottom
:
1px
solid
#f0f2f5
;
}
}
.projectliLogo
{
.projectliLogo
{
width
:
24px
;
width
:
24px
;
...
...
src/views/Project/components/ProjectListPopper/index.tsx
View file @
f74a51ad
...
@@ -3,6 +3,7 @@ import style from "./index.module.css";
...
@@ -3,6 +3,7 @@ import style from "./index.module.css";
import
{
InputBase
,
IconButton
}
from
"@mui/material"
;
import
{
InputBase
,
IconButton
}
from
"@mui/material"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
AddIcon
from
"@mui/icons-material/Add"
;
import
AddIcon
from
"@mui/icons-material/Add"
;
import
classNames
from
"classnames"
;
import
{
useStores
}
from
"@/store/index"
;
import
{
useStores
}
from
"@/store/index"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
React
,
{
useMemo
,
useState
}
from
"react"
;
import
React
,
{
useMemo
,
useState
}
from
"react"
;
...
@@ -12,16 +13,19 @@ import { observer } from "mobx-react-lite";
...
@@ -12,16 +13,19 @@ import { observer } from "mobx-react-lite";
const
ProjectListPopper
=
observer
((
props
:
any
)
=>
{
const
ProjectListPopper
=
observer
((
props
:
any
)
=>
{
const
{
handleChangeCurrentProject
,
handleClickOpen
}
=
props
;
const
{
handleChangeCurrentProject
,
handleClickOpen
}
=
props
;
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
const
projectList
=
toJS
(
currentProjectStore
.
projectList
);
const
currentProjectName
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
name
);
// 通过名称本地搜索
const
[
name
,
setName
]
=
useState
(
""
);
const
[
name
,
setName
]
=
useState
(
""
);
const
nameChange
=
(
e
:
any
)
=>
{
const
nameChange
=
(
e
:
any
)
=>
{
setName
(
e
.
target
.
value
);
setName
(
e
.
target
.
value
);
};
};
const
list
=
useMemo
(()
=>
{
const
list
=
useMemo
(()
=>
{
return
toJS
(
currentProjectStore
.
projectList
)
.
filter
((
item
:
any
)
=>
{
return
projectList
.
filter
((
item
:
any
)
=>
{
return
item
.
name
?.
indexOf
(
name
)
!==
-
1
;
return
item
.
name
?.
indexOf
(
name
)
!==
-
1
;
});
});
},
[
currentProjectStore
.
projectList
,
name
]);
},
[
projectList
,
name
]);
const
handleProjectBox
=
(
e
:
React
.
SyntheticEvent
)
=>
{
const
handleProjectBox
=
(
e
:
React
.
SyntheticEvent
)
=>
{
e
.
nativeEvent
.
stopImmediatePropagation
();
e
.
nativeEvent
.
stopImmediatePropagation
();
...
@@ -35,7 +39,10 @@ const ProjectListPopper = observer((props: any) => {
...
@@ -35,7 +39,10 @@ const ProjectListPopper = observer((props: any) => {
className=
{
style
.
searchButton
}
className=
{
style
.
searchButton
}
aria
-
label=
"search"
aria
-
label=
"search"
>
>
<
SearchIcon
className=
{
style
.
searchIcon
}
/>
<
SearchIcon
className=
{
style
.
searchIcon
}
style=
{
{
color
:
"rgba(153, 153, 153, 1)"
}
}
/>
</
IconButton
>
</
IconButton
>
<
InputBase
<
InputBase
className=
{
style
.
searchInput
}
className=
{
style
.
searchInput
}
...
@@ -57,7 +64,10 @@ const ProjectListPopper = observer((props: any) => {
...
@@ -57,7 +64,10 @@ const ProjectListPopper = observer((props: any) => {
{
list
.
map
((
item
:
any
)
=>
{
{
list
.
map
((
item
:
any
)
=>
{
return
(
return
(
<
div
<
div
className=
{
style
.
projectli
}
className=
{
classNames
({
[
style
.
projectli
]:
true
,
[
style
.
projectliActive
]:
item
.
name
===
currentProjectName
,
})
}
key=
{
item
.
id
}
key=
{
item
.
id
}
onClick=
{
()
=>
handleChangeCurrentProject
(
item
)
}
onClick=
{
()
=>
handleChangeCurrentProject
(
item
)
}
>
>
...
...
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
f74a51ad
...
@@ -9,9 +9,6 @@ import {
...
@@ -9,9 +9,6 @@ import {
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
// import MySelect, {
// optionsTransform,
// } from "../../../Project/ProjectSubmitWork/components/MySelect";
import
MySelect
from
"@/components/mui/MySelect"
;
import
MySelect
from
"@/components/mui/MySelect"
;
import
FileSelect
,
{
import
FileSelect
,
{
FileSelectType
,
FileSelectType
,
...
@@ -491,7 +488,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -491,7 +488,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
<
MySelect
<
MySelect
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
handleParameterChange
(
e
,
parameter
.
name
||
""
)
handleParameterChange
(
{
target
:
{
value
:
e
,
},
},
parameter
.
name
||
""
)
}
}
error=
{
parameter
.
error
||
false
}
error=
{
parameter
.
error
||
false
}
helpertext=
{
parameter
.
helperText
}
helpertext=
{
parameter
.
helperText
}
...
@@ -503,7 +507,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -503,7 +507,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
<
MySelect
<
MySelect
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
handleParameterChange
(
e
,
parameter
.
name
||
""
)
handleParameterChange
(
{
target
:
{
value
:
e
,
},
},
parameter
.
name
||
""
)
}
}
multiple=
{
true
}
multiple=
{
true
}
error=
{
parameter
.
error
||
false
}
error=
{
parameter
.
error
||
false
}
...
...
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