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
87a6abe5
Commit
87a6abe5
authored
Aug 12, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 提交任务样式修改
parent
920fe725
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
212 additions
and
177 deletions
+212
-177
MyRadio.tsx
src/components/mui/MyRadio.tsx
+55
-48
index.module.css
...ews/Project/ProjectSubmitWork/ConfigForm/index.module.css
+75
-62
index.tsx
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
+77
-63
index.module.css
src/views/Project/ProjectSubmitWork/index.module.css
+3
-2
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+2
-2
No files found.
src/components/mui/MyRadio.tsx
View file @
87a6abe5
...
...
@@ -11,65 +11,72 @@ import Radio from "@mui/material/Radio";
import
RadioGroup
,
{
RadioGroupProps
}
from
"@mui/material/RadioGroup"
;
import
FormControlLabel
from
"@mui/material/FormControlLabel"
;
import
FormControl
from
"@mui/material/FormControl"
;
import
FormHelperText
from
'@mui/material/FormHelperText'
;
import
FormHelperText
from
"@mui/material/FormHelperText"
;
interface
IMyRadioProps
extends
RadioGroupProps
{
value
:
any
;
options
:
Array
<
ICheckBoxOption
>
;
onChange
:
any
;
variant
?:
"standard"
|
"outlined"
|
"filled"
;
error
?:
boolean
;
helperText
?:
string
;
}
;
value
:
any
;
options
:
Array
<
ICheckBoxOption
>
;
onChange
:
any
;
variant
?:
"standard"
|
"outlined"
|
"filled"
;
error
?:
boolean
;
helperText
?:
string
;
}
type
ICheckBoxOption
=
{
value
:
any
;
label
?:
string
;
disabled
?:
boolean
;
value
:
any
;
label
?:
string
;
disabled
?:
boolean
;
};
// 如果后端给的options不是 value-label的字段可以用下面的方法转换
export
const
optionsTransform
=
(
arr
:
Array
<
any
>
,
labelKey
:
string
=
"label"
,
valueKey
:
string
=
"value"
,
disabledKey
:
string
=
"disabled"
arr
:
Array
<
any
>
,
labelKey
:
string
=
"label"
,
valueKey
:
string
=
"value"
,
disabledKey
:
string
=
"disabled"
):
Array
<
ICheckBoxOption
>
=>
{
return
arr
.
map
((
item
:
any
)
=>
{
return
{
value
:
item
[
valueKey
],
label
:
item
[
labelKey
],
disabled
:
item
[
disabledKey
]
||
false
,
};
});
return
arr
.
map
((
item
:
any
)
=>
{
return
{
value
:
item
[
valueKey
],
label
:
item
[
labelKey
],
disabled
:
item
[
disabledKey
]
||
false
,
};
});
};
export
default
function
MyRadio
(
props
:
IMyRadioProps
)
{
const
{
value
,
options
,
onChange
,
error
=
false
,
helperText
,
variant
}
=
props
;
const
{
value
,
options
,
onChange
,
error
=
false
,
helperText
,
variant
,
}
=
props
;
return
(
<
FormControl
fullWidth
variant=
{
variant
}
error=
{
error
}
>
<
RadioGroup
{
...
props
}
row
aria
-
labelledby=
"demo-row-radio-buttons-group-label"
name=
"row-radio-buttons-group"
value=
{
value
}
onChange=
{
onChange
}
>
{
options
.
map
((
option
)
=>
{
return
(
<
FormControlLabel
key=
{
option
.
value
}
value=
{
option
.
value
}
control=
{
<
Radio
/>
}
label=
{
option
.
label
}
disabled=
{
option
.
disabled
}
/>
);
})
}
</
RadioGroup
>
{
helperText
&&
error
&&
<
FormHelperText
>
{
helperText
}
</
FormHelperText
>
}
</
FormControl
>
);
return
(
<
FormControl
fullWidth
variant=
{
variant
}
error=
{
error
}
>
<
RadioGroup
{
...
props
}
row
aria
-
labelledby=
"demo-row-radio-buttons-group-label"
name=
"row-radio-buttons-group"
value=
{
value
}
onChange=
{
onChange
}
>
{
options
.
map
((
option
)
=>
{
return
(
<
FormControlLabel
key=
{
option
.
value
}
value=
{
option
.
value
}
control=
{
<
Radio
sx=
{
{
color
:
"rgba(209, 214, 222, 1)"
}
}
/>
}
label=
{
option
.
label
}
disabled=
{
option
.
disabled
}
/>
);
})
}
</
RadioGroup
>
{
helperText
&&
error
&&
<
FormHelperText
>
{
helperText
}
</
FormHelperText
>
}
</
FormControl
>
);
}
src/views/Project/ProjectSubmitWork/ConfigForm/index.module.css
View file @
87a6abe5
.formBox
{
position
:
relative
;
position
:
relative
;
}
.templateDescBox
{
margin-bottom
:
40px
;
margin-bottom
:
40px
;
}
.templateDescTitle
{
font-size
:
16px
;
line-height
:
24px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-weight
:
600
;
margin-bottom
:
12px
;
font-size
:
16px
;
line-height
:
24px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-weight
:
600
;
margin-bottom
:
12px
;
}
.templateDesc
{
font-size
:
12px
;
line-height
:
20px
;
color
:
#565c66
;
}
font-size
:
12px
;
line-height
:
20px
;
color
:
#565c66
;
}
.formItemBox
{
background
:
#ffffff
;
box-shadow
:
0px
3px
10px
0px
rgba
(
0
,
24
,
57
,
0.04
);
border-radius
:
4px
;
border
:
1px
solid
#ebedf0
;
margin-bottom
:
24px
;
}
/* .taskBox {
margin-bottom: 24px;
} */
.backgroundTitle
{
background-color
:
rgba
(
245
,
246
,
247
,
1
);
height
:
48px
;
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
padding
:
12px
16
px
;
box-sizing
:
border-box
;
position
:
relative
;
background-color
:
rgba
(
245
,
246
,
247
,
1
);
height
:
48px
;
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
padding
:
12px
24
px
;
box-sizing
:
border-box
;
position
:
relative
;
}
.backgroundTitleTextIcon
{
visibility
:
hidden
;
position
:
absolute
;
top
:
16px
;
right
:
24px
;
visibility
:
hidden
;
}
.backgroundTitleTextIconShow
{
visibility
:
visible
;
visibility
:
visible
;
}
.backgroundTitleText
{
font-size
:
16px
;
font-weight
:
600
;
line-height
:
24px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
margin-left
:
12px
;
font-size
:
16px
;
font-weight
:
600
;
line-height
:
24px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
}
.taskDescIcon
{
margin-left
:
8px
;
margin-left
:
8px
;
}
.flowDescIcon
{
margin-left
:
8px
;
margin-left
:
8px
;
}
.formItems
{
padding
:
20px
44px
40px
4
4px
;
padding
:
16px
24px
4px
;
}
.formItem
{
margin-bottom
:
20px
;
margin-bottom
:
20px
;
}
.fileSelectImg
{
cursor
:
pointer
;
cursor
:
pointer
;
}
.formItemLable
{
margin-bottom
:
12px
;
font-size
:
14px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
line-height
:
22px
;
font-weight
:
600
;
margin-bottom
:
12px
;
font-size
:
14px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
line-height
:
22px
;
font-weight
:
600
;
}
.required
::after
{
content
:
"*"
;
color
:
red
;
margin-left
:
3px
;
content
:
"*"
;
color
:
red
;
margin-left
:
3px
;
}
.taskConfigBox
{
padding
:
24px
44px
40px
4
4px
;
padding
:
16px
24px
4px
;
}
.flowTitle
{
line-height
:
16px
;
margin
:
3px
0
27px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
14px
;
font-weight
:
600
;
border-left
:
3px
solid
rgba
(
19
,
112
,
255
,
1
);
padding-left
:
3px
;
display
:
flex
;
align-items
:
center
;
line-height
:
16px
;
margin
:
3px
0
27px
;
color
:
rgba
(
19
,
112
,
255
,
1
);
font-size
:
14px
;
font-weight
:
600
;
border-left
:
3px
solid
rgba
(
19
,
112
,
255
,
1
);
padding-left
:
3px
;
display
:
flex
;
align-items
:
center
;
padding-left
:
8px
;
}
.parameter
{
margin-bottom
:
20px
;
position
:
relative
;
margin-bottom
:
20px
;
position
:
relative
;
}
.parameterTitle
{
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
14px
;
font-weight
:
600
;
line-height
:
22px
;
margin-bottom
:
12px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
14px
;
font-weight
:
600
;
line-height
:
22px
;
margin-bottom
:
12px
;
}
.parameterContent
{
position
:
relative
;
position
:
relative
;
}
.parameterDesc
{
position
:
absolute
;
top
:
12px
;
right
:
-22px
;
position
:
absolute
;
top
:
12px
;
right
:
-22px
;
}
.parameterDataType
{
color
:
rgba
(
138
,
144
,
153
,
1
);
margin-left
:
16px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
margin-left
:
16px
;
}
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
View file @
87a6abe5
...
...
@@ -396,84 +396,83 @@ const ConfigForm = (props: ConfigFormProps) => {
{
templateConfigInfo
?.
description
||
""
}
</
div
>
</
div
>
<
div
className=
{
classnames
({
[
styles
.
backgroundTitle
]:
true
,
[
styles
.
backgroundTitlePass
]:
true
,
})
}
>
<
img
src=
""
alt=
""
/>
<
span
className=
{
styles
.
backgroundTitleText
}
>
基础信息
</
span
>
</
div
>
<
div
className=
{
styles
.
formItems
}
>
<
div
className=
{
styles
.
formItem
}
>
<
div
<
div
className=
{
styles
.
formItemBox
}
>
<
div
className=
{
classnames
({
[
styles
.
backgroundTitle
]:
true
,
})
}
>
<
span
className=
{
styles
.
backgroundTitleText
}
>
基础信息
</
span
>
<
img
className=
{
classnames
({
[
styles
.
formItemLable
]:
true
,
[
styles
.
required
]:
true
,
[
styles
.
backgroundTitleTextIcon
]:
true
,
[
styles
.
backgroundTitleTextIconShow
]:
!
nameHelp
.
error
,
})
}
>
任务名称
</
div
>
<
div
className=
{
styles
.
formItem
}
>
<
MyInput
value=
{
name
}
onChange=
{
handleNameChange
}
placeholder=
"请输入任务名称"
error=
{
nameHelp
.
error
}
helperText=
{
nameHelp
.
helperText
}
></
MyInput
>
</
div
>
src=
{
jobSueIcon
}
alt=
""
/>
</
div
>
<
div
className=
{
styles
.
formItem
}
>
<
div
className=
{
classnames
({
[
styles
.
formItemLable
]:
true
,
[
styles
.
required
]:
true
,
})
}
>
输出路径
<
div
className=
{
styles
.
formItems
}
>
<
div
className=
{
styles
.
formItem
}
>
<
div
className=
{
classnames
({
[
styles
.
formItemLable
]:
true
,
[
styles
.
required
]:
true
,
})
}
>
任务名称
</
div
>
<
div
className=
{
styles
.
formItem
}
>
<
MyInput
value=
{
name
}
onChange=
{
handleNameChange
}
placeholder=
"请输入任务名称"
error=
{
nameHelp
.
error
}
helperText=
{
nameHelp
.
helperText
}
></
MyInput
>
</
div
>
</
div
>
<
div
className=
{
styles
.
formItem
}
>
<
MyInput
value=
{
outputPath
||
""
}
onClick=
{
()
=>
{
setSelectedBatchNodeId
(
""
);
setFileSelectType
(
"path"
);
handleOpenFileSelect
();
}
}
InputProps=
{
{
endAdornment
:
(
<
img
src=
{
fileSelectIcon
}
alt=
"选择输出路径"
className=
{
styles
.
fileSelectImg
}
/>
),
}
}
error=
{
outputPathHelp
.
error
}
helperText=
{
outputPathHelp
.
helperText
}
></
MyInput
>
<
div
className=
{
classnames
({
[
styles
.
formItemLable
]:
true
,
[
styles
.
required
]:
true
,
})
}
>
输出路径
</
div
>
<
div
className=
{
styles
.
formItem
}
>
<
MyInput
value=
{
outputPath
||
""
}
onClick=
{
()
=>
{
setSelectedBatchNodeId
(
""
);
setFileSelectType
(
"path"
);
handleOpenFileSelect
();
}
}
InputProps=
{
{
endAdornment
:
(
<
img
src=
{
fileSelectIcon
}
alt=
"选择输出路径"
className=
{
styles
.
fileSelectImg
}
/>
),
}
}
error=
{
outputPathHelp
.
error
}
helperText=
{
outputPathHelp
.
helperText
}
></
MyInput
>
</
div
>
</
div
>
</
div
>
</
div
>
{
renderTasks
.
map
((
task
,
taskIndex
)
=>
{
return
(
<
div
className=
{
styles
.
task
Box
}
key=
{
task
.
id
+
taskIndex
}
>
<
div
className=
{
styles
.
formItem
Box
}
key=
{
task
.
id
+
taskIndex
}
>
<
div
className=
{
classnames
({
[
styles
.
backgroundTitle
]:
true
,
[
styles
.
backgroundTitlePass
]:
true
,
})
}
>
<
img
className=
{
classnames
({
[
styles
.
backgroundTitleTextIcon
]:
true
,
[
styles
.
backgroundTitleTextIconShow
]:
task
.
isCheck
,
})
}
src=
{
jobSueIcon
}
alt=
""
/>
<
span
id=
{
`point${task.id}`
}
className=
{
styles
.
backgroundTitleText
}
...
...
@@ -485,10 +484,25 @@ const ConfigForm = (props: ConfigFormProps) => {
<
img
className=
{
styles
.
taskDescIcon
}
src=
{
tipsIcon
}
alt=
""
/>
</
MyTooltip
>
)
}
<
img
className=
{
classnames
({
[
styles
.
backgroundTitleTextIcon
]:
true
,
[
styles
.
backgroundTitleTextIconShow
]:
task
.
isCheck
,
})
}
src=
{
jobSueIcon
}
alt=
""
/>
</
div
>
<
div
className=
{
styles
.
taskConfigBox
}
>
{
randerParameters
(
task
.
parameters
,
task
.
id
,
task
.
id
)
}
{
task
.
flows
.
map
((
flow
)
=>
{
if
(
flow
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
hidden
===
false
).
length
===
0
)
{
return
null
;
}
return
(
<
div
className=
{
styles
.
flowConfigBox
}
key=
{
flow
.
id
}
>
<
div
className=
{
styles
.
flowTitle
}
>
...
...
src/views/Project/ProjectSubmitWork/index.module.css
View file @
87a6abe5
...
...
@@ -30,13 +30,14 @@
line-height
:
22px
;
font-size
:
14px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-weight
:
6
00
;
font-weight
:
7
00
;
padding-right
:
20px
;
border-right
:
1px
solid
rgba
(
2
35
,
237
,
240
,
1
);
border-right
:
1px
solid
rgba
(
2
09
,
214
,
222
,
1
);
}
.swHeaderLable
{
color
:
rgba
(
138
,
144
,
153
,
1
);
font-size
:
12px
;
line-height
:
22px
;
}
.swHeaderValue
{
color
:
rgba
(
30
,
38
,
51
,
1
);
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
87a6abe5
...
...
@@ -240,8 +240,8 @@ const ProjectSubmitWork = observer(() => {
<
ArrowBackIosNewIcon
sx=
{
{
color
:
"rgba(194, 198, 204, 1)"
,
width
:
"1
2
px"
,
height
:
"1
2
px"
,
width
:
"1
4
px"
,
height
:
"1
4
px"
,
}
}
/>
</
IconButton
>
...
...
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