Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaojuan huang
Ccms
Commits
6d237289
Commit
6d237289
authored
3 years ago
by
cuiwenlong7
Browse files
Options
Download
Email Patches
Plain Diff
feat:步骤、筛选表单显隐确定取消按钮、自定义文案
parent
4a83cfcf
master
add-color
add-color-detail
add-detail
add-detail-explain
add-table-explain
column-dateRange-format
custom-btn-text
custom-formStep-btn
detail-step
dev-detail-table
dev-detail-table-beta
dev-globalValidation
dev-isv-detail-enum
dev-isv-detail-table
dev-isv-detail-text
dev-list
dev-rollup
dev-treeselect
dev-xc
dev_await
dev_detail_custom
dev_detail_import
dev_detail_v1
dev_form_actions
dev_form_submitvalidate
dev_form_validations
dev_immer
dev_isv
dev_isv_220408
dev_jt
dev_loadPageList
dev_performance
dev_redux
dev_scu
dev_scu-20220209
dev_stringify
dev_table_rowoperations
formItem-add-required
form_width
subform-withConfig
upload-unit
v1.2
v1.2.1
v1.2.2
v1.2.3
v1.2.4
v1.2.4-beta
v1.2.4_bak
v1.2_niuxg
v1.3.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/steps/filter/index.tsx
+13
-4
src/steps/filter/index.tsx
src/steps/form/index.tsx
+6
-0
src/steps/form/index.tsx
with
19 additions
and
4 deletions
+19
-4
src/steps/filter/index.tsx
+
13
-
4
View file @
6d237289
...
...
@@ -20,6 +20,10 @@ export interface FilterConfig extends StepConfig {
type
:
'
filter
'
fields
?:
FieldConfigs
[]
defaultValue
?:
ParamConfig
hiddenSubmit
?:
boolean
// 是否隐藏确认按钮
hiddenReset
?:
boolean
// 是否隐藏重置按钮
submitText
?:
string
// 自定义确认按钮文本
resetText
?:
string
// 自定义重置按钮文本
}
/**
...
...
@@ -33,8 +37,10 @@ export interface FilterConfig extends StepConfig {
* - children: 表单内容
*/
export
interface
IFilter
{
onSubmit
:
()
=>
Promise
<
any
>
onReset
:
()
=>
Promise
<
any
>
onSubmit
?:
()
=>
Promise
<
any
>
onReset
?:
()
=>
Promise
<
any
>
submitText
?:
string
// 自定义确认按钮文本
resetText
?:
string
// 自定义重置按钮文本
children
:
React
.
ReactNode
[]
}
...
...
@@ -59,6 +65,7 @@ export interface IFilterItem {
description
?:
string
message
?:
string
visitable
:
boolean
fieldType
:
string
children
:
React
.
ReactNode
}
...
...
@@ -419,8 +426,10 @@ export default class FilterStep extends Step<FilterConfig, FilterState> {
<
React
.
Fragment
>
{
/* 渲染表单 */
}
{
this
.
renderComponent
({
onSubmit
:
async
()
=>
this
.
handleSubmit
(),
onReset
:
async
()
=>
this
.
handleReset
(),
onSubmit
:
this
.
props
.
config
?.
hiddenSubmit
?
undefined
:
async
()
=>
this
.
handleSubmit
(),
onReset
:
this
.
props
.
config
?.
hiddenReset
?
undefined
:
async
()
=>
this
.
handleReset
(),
submitText
:
this
.
props
.
config
?.
submitText
,
resetText
:
this
.
props
.
config
?.
resetText
,
children
:
fields
.
map
((
formFieldConfig
,
formFieldIndex
)
=>
{
if
(
!
ConditionHelper
(
formFieldConfig
.
condition
,
{
record
:
formValue
,
data
,
step
}))
{
this
.
formFieldsMounted
[
formFieldIndex
]
=
false
...
...
This diff is collapsed.
Click to expand it.
src/steps/form/index.tsx
+
6
-
0
View file @
6d237289
...
...
@@ -27,6 +27,8 @@ export interface FormConfig extends StepConfig {
defaultValue
?:
ParamConfig
,
hiddenSubmit
?:
boolean
// 是否隐藏提交按钮
hiddenCancel
?:
boolean
// 是否隐藏取消按钮
submitText
?:
string
// 自定义确认按钮文本
cancelText
?:
string
// 自定义取消按钮文本
}
/**
...
...
@@ -44,6 +46,8 @@ export interface IForm {
onSubmit
?:
()
=>
Promise
<
any
>
onCancel
?:
()
=>
Promise
<
any
>
children
:
React
.
ReactNode
[]
submitText
?:
string
// 自定义确认按钮文本
cancelText
?:
string
// 自定义取消按钮文本
}
/**
...
...
@@ -411,6 +415,8 @@ export default class FormStep extends Step<FormConfig, FormState> {
layout
,
onSubmit
:
this
.
props
.
config
.
hiddenSubmit
?
undefined
:
async
()
=>
this
.
handleSubmit
(),
onCancel
:
this
.
props
.
config
.
hiddenCancel
?
undefined
:
async
()
=>
this
.
handleCancel
(),
submitText
:
this
.
props
.
config
?.
submitText
,
cancelText
:
this
.
props
.
config
?.
cancelText
,
children
:
fields
.
map
((
formFieldConfig
,
formFieldIndex
)
=>
{
if
(
!
ConditionHelper
(
formFieldConfig
.
condition
,
{
record
:
formValue
,
data
,
step
}))
{
return
null
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help