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
a47a004f
Commit
a47a004f
authored
3 years ago
by
zhenjintao
Browse files
Options
Download
Email Patches
Plain Diff
feat: 表单项tabs增加required参数
parent
81eb250a
master
add-color
add-color-detail
add-detail
add-detail-explain
add-table-explain
dev-detail-table
dev-detail-table-beta
dev-isv-detail-enum
dev-isv-detail-table
dev-isv-detail-text
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_table_rowoperations
formItem-add-required
form_width
v1.2.1
v1.2.2
v1.2.3
v1.2.4
v1.2.4-beta
v1.2.4_bak
v1.3.0
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/formFields/tabs/index.tsx
+30
-28
src/components/formFields/tabs/index.tsx
with
30 additions
and
28 deletions
+30
-28
src/components/formFields/tabs/index.tsx
+
30
-
28
View file @
a47a004f
import
{
Field
,
FieldConfig
,
FieldConfigs
,
FieldError
,
FieldProps
,
IField
}
from
"
../common
"
;
import
{
Field
,
FieldConfig
,
FieldConfigs
,
FieldError
,
FieldProps
,
IField
}
from
'
../common
'
import
getALLComponents
from
'
../
'
import
React
from
"
react
"
;
import
ConditionHelper
from
"
../../../util/condition
"
;
import
{
cloneDeep
}
from
"
lodash
"
;
import
{
getValue
,
setValue
}
from
"
../../../util/value
"
;
import
React
from
'
react
'
import
ConditionHelper
from
'
../../../util/condition
'
import
{
cloneDeep
}
from
'
lodash
'
import
{
getValue
,
setValue
,
getBoolean
}
from
'
../../../util/value
'
export
type
TabsFieldConfig
=
TabsFieldConfig_Same
|
TabsFieldConfig_Diff
...
...
@@ -33,7 +33,6 @@ export interface ITabsField {
children
:
React
.
ReactNode
[]
}
export
interface
ITabsFieldItem
{
key
:
string
label
:
string
...
...
@@ -43,6 +42,7 @@ export interface ITabsFieldItem {
export
interface
ITabsFieldItemField
{
index
:
number
label
:
string
required
:
boolean
status
:
'
normal
'
|
'
error
'
|
'
loading
'
description
?:
string
message
?:
string
...
...
@@ -80,7 +80,7 @@ export default class TabsField<S> extends Field<TabsFieldConfig, ITabsField, { [
}
get
=
async
()
=>
{
let
data
:
any
=
{}
;
let
data
:
any
=
{}
for
(
const
index
in
(
this
.
props
.
config
.
tabs
||
[]))
{
const
tab
=
(
this
.
props
.
config
.
tabs
||
[])[
index
]
...
...
@@ -295,6 +295,7 @@ export default class TabsField<S> extends Field<TabsFieldConfig, ITabsField, { [
})
}
}
handleValueListSort
=
async
(
index
:
number
,
formFieldIndex
:
number
,
path
:
string
,
_index
:
number
,
sortType
:
'
up
'
|
'
down
'
,
validation
:
true
|
FieldError
[])
=>
{
const
tab
=
(
this
.
props
.
config
.
tabs
||
[])[
index
]
...
...
@@ -408,6 +409,7 @@ export default class TabsField<S> extends Field<TabsFieldConfig, ITabsField, { [
label
:
formFieldConfig
.
label
,
status
,
message
:
((
this
.
state
.
formDataList
[
index
]
||
[])[
formFieldIndex
]
||
{}).
message
||
''
,
required
:
getBoolean
(
formFieldConfig
.
required
),
layout
:
this
.
props
.
formLayout
,
fieldType
:
formFieldConfig
.
type
,
children
:
(
...
...
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