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
f1b5424e
Commit
f1b5424e
authored
Jul 11, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完成参数设置的参数校验
parent
de23a8e5
Pipeline
#185
canceled with stages
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
50 deletions
+58
-50
MyInput.tsx
src/components/mui/MyInput.tsx
+52
-50
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+0
-0
util.ts
src/views/WorkFlowEdit/util.ts
+6
-0
No files found.
src/components/mui/MyInput.tsx
View file @
f1b5424e
...
@@ -8,59 +8,61 @@
...
@@ -8,59 +8,61 @@
*/
*/
import
TextField
,
{
TextFieldProps
}
from
"@mui/material/TextField"
;
import
TextField
,
{
TextFieldProps
}
from
"@mui/material/TextField"
;
interface
MyInputProps
extends
Omit
<
TextFieldProps
,
"value"
>
{
interface
MyInputProps
extends
Omit
<
TextFieldProps
,
"value"
>
{
value
:
any
;
value
:
any
;
inputSx
?:
any
;
inputSx
?:
any
;
onChange
?:
any
;
onChange
?:
any
;
onFocus
?:
any
;
onFocus
?:
any
;
label
?:
string
;
label
?:
string
;
variant
?:
"standard"
|
"filled"
|
"outlined"
;
variant
?:
"standard"
|
"filled"
|
"outlined"
;
id
?:
string
;
id
?:
string
;
size
?:
"small"
|
"medium"
;
size
?:
"small"
|
"medium"
;
placeholder
?:
string
;
placeholder
?:
string
;
fullWidth
?:
boolean
;
// 宽度是否和容器一致
fullWidth
?:
boolean
;
// 宽度是否和容器一致
InputProps
?:
any
;
// input加前后icon可以用这个
InputProps
?:
any
;
// input加前后icon可以用这个
error
?:
boolean
;
error
?:
boolean
;
helperText
?:
string
;
helperText
?:
string
;
}
;
}
const
MyInput
=
(
props
:
MyInputProps
)
=>
{
const
MyInput
=
(
props
:
MyInputProps
)
=>
{
const
{
const
{
inputSx
=
{},
inputSx
=
{},
value
,
value
,
onChange
,
onChange
,
onFocus
,
onFocus
,
label
,
label
,
id
,
id
,
variant
,
variant
,
size
=
"small"
,
size
=
"small"
,
placeholder
=
"请输入"
,
placeholder
=
"请输入"
,
fullWidth
=
true
,
fullWidth
=
true
,
InputProps
,
InputProps
,
error
=
false
,
error
=
false
,
helperText
,
helperText
,
}
=
props
;
disabled
,
}
=
props
;
return
(
return
(
<
TextField
<
TextField
{
...
props
}
{
...
props
}
error=
{
error
}
error=
{
error
}
helperText=
{
helperText
}
helperText=
{
helperText
}
sx=
{
{
...
inputSx
}
}
sx=
{
{
...
inputSx
}
}
id=
{
id
}
id=
{
id
}
label=
{
label
}
label=
{
label
}
variant=
{
variant
}
variant=
{
variant
}
onChange=
{
onChange
}
onChange=
{
onChange
}
onFocus=
{
onFocus
}
onFocus=
{
onFocus
}
size=
{
size
}
size=
{
size
}
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
fullWidth=
{
fullWidth
}
fullWidth=
{
fullWidth
}
InputProps=
{
{
InputProps=
{
{
...
InputProps
,
...
InputProps
,
}
}
}
}
value=
{
value
}
disabled=
{
disabled
}
/>
value=
{
value
}
);
/>
);
};
};
export
default
MyInput
;
export
default
MyInput
;
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
f1b5424e
This diff is collapsed.
Click to expand it.
src/views/WorkFlowEdit/util.ts
View file @
f1b5424e
...
@@ -23,6 +23,12 @@ export const getCustomTemplateParameterCheckResult = (
...
@@ -23,6 +23,12 @@ export const getCustomTemplateParameterCheckResult = (
}
}
}
}
}
}
if
(
error
)
{
return
{
error
,
helperText
,
};
}
if
(
parameter
.
validators
.
length
>
0
)
{
if
(
parameter
.
validators
.
length
>
0
)
{
parameter
.
validators
.
forEach
((
validator
)
=>
{
parameter
.
validators
.
forEach
((
validator
)
=>
{
const
reg
=
new
RegExp
(
validator
.
regex
);
const
reg
=
new
RegExp
(
validator
.
regex
);
...
...
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