Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
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
web_component
submodule
Commits
fe9b0f1d
Commit
fe9b0f1d
authored
Feb 04, 2021
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新formView
parent
1779fb1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
index.tsx
components/apolloTable/editFormV3/index.tsx
+24
-2
No files found.
components/apolloTable/editFormV3/index.tsx
View file @
fe9b0f1d
...
@@ -309,5 +309,27 @@ class FormWrap extends Component {
...
@@ -309,5 +309,27 @@ class FormWrap extends Component {
);
);
}
}
}
}
function
mapPropsToFields
(
props
)
{
export
default
Form
.
create
({
name
:
'editFormV3'
})(
FormWrap
);
const
{
data
,
rowData
}
=
props
;
const
returnObj
:
any
=
{};
if
(
!
data
||
typeof
data
!==
'object'
)
return
returnObj
;
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
const
col
=
data
[
key
];
if
(
!
col
)
{
return
;
}
const
{
columnType
,
value
,
renderEditForm
}
=
col
;
let
detailConfig
:
any
;
if
(
typeof
renderEditForm
===
'function'
)
{
detailConfig
=
renderEditForm
({
cellData
:
value
,
rowData
,
columnConfig
:
col
});
}
else
{
detailConfig
=
config
[
String
(
columnType
)]
||
config
[
'1'
];
}
const
formatValue
=
getFormat
(
detailConfig
,
col
,
value
);
returnObj
[
columnType
]
=
Form
.
createFormField
({
value
:
formatValue
,
});
});
return
returnObj
;
}
export
default
Form
.
create
({
name
:
'editFormV3'
,
mapPropsToFields
})(
FormWrap
);
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